Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to implement APP payment server with Java

Shulou Source: shulou.com Published: 2022-06-01 04:58:42 10月04日 Update

This article mainly explains "Java how to achieve APP payment server", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Java how to achieve APP payment server" bar!

Let's go straight to the code.

One: the merchant receives the user's payment order at the backend and calls WeChat Pay's unified order issuing API.

The server side provides an interface to receive the order id sent from the APP side. The server queries the order information according to id.

Note:

1. The price of Wechat needs to be multiplied by 100. That is to say, 1 yuan is passed over, which shows 0.01 yuan.

two。 The address of the callback must be accessible to the public network. My network is a company intranet, so I used peanut shells to make a mapping. As for how to use it, you can use Baidu on your own.

Second, the merchant backstage receives the payment notice.

Next is the pullback of Wechat. When the user pays, Wechat server will send an asynchronous callback to our server.

Please refer to the document https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_7&index=3 in detail before making the value of this step

The above code:

Next, provide the above utility classes that use the code.

ConfigUtil.java

PayCommonUtil.java

XMLUtil .java

MD5Util.java

MyX509TrustManager.java

At this point, I believe that everyone on the "Java how to achieve APP payment server-side" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Server payment service next code content background merchant interface user order learning query practical deeper previous generation that is price information company Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple NVidia Linux Shulou Information vpn