Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement APP payment server with Java

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report