The official documentation on connecting to the Alipay payment interface has been written very clearly, but there are many novices like me who are confused when connecting to the Alipay payment interface for the first time, so I wrote this article here to give some ideas to my classmates like me. first step(You need to operate in Alipay first, and then run the code after getting the information we need to develop) Enter Ant Financial, we need to create an application first. Do you see the application button in the picture below? Click Apply (as shown below) Create an application (creating an application requires review) and provide information for review. We don’t need to worry about it at this time. It can be used after passing the review. But we can't just sit there while he's reviewing it, we'll do a test and write the code first, and then after the review and communication we'll replace the reviewed information. Step 2(Use the sandbox environment for development) Have you seen the APPID? This is very important. We need to use it when paying. It will also be in the currently reviewed information. This sandbox is for our testing and is almost the same as the official one, except that different APPIDs and Alipay gateways are switched. (Here I want to complain about WeChat Pay. To be honest, the documentation of WeChat Pay is too bad and there are too many pitfalls. I will also integrate WeChat Pay later.) Another good thing about Alipay is the robot next to it. This is very good. If you don’t know how to do it, just call it (a small tip: use the robot, call the question a few times, and the human will come out, otherwise the human will not come out.) In this interface, you need to set the application public key Click to open the settings application public key (no need to set other settings) click to set application public key OK, this is where you enter the public key. To generate a key, please click here to view the method for generating a secret key (see the picture below, download the key generation tool) After downloading, open it according to the instructions (remember to open it according to the instructions) Click Generate Key (note here: do not verify the signature of the key you generated, because the verification will fail). We can directly copy the generated public key and put it in. There is no need to verify the accuracy of the public key here, just click Save. Step 3Import the jar package of alipay (jar package is in) https://docs.open.alipay.com/54/104506/ This is the payment demo which contains a jar package. Just import it. Step 4Writing Code Create an AppPayConfig class and put in the corresponding values as shown below Writing action classes Ok, now Alipay has been connected. Of course, there is an asynchronous callback address above. This interface is also required, so I won’t post it here. I don’t know if you can understand it. If it is still unclear, you can call me. Thank you all for reading. This concludes this article on the detailed steps of developing the Java-to-Alipay payment interface. For more information about the Java-to-Alipay payment interface, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: CSS3 mouse hover transition zoom effect
>>: Example code for inputting the license plate number and province abbreviation in html
When using MySql's window function to collect...
The current environment is: Centos 7.5 docker-ce ...
Preface In MySQL, InnoDB belongs to the storage e...
background When we want to log in to the MySQL da...
Table of contents introduction 1. Overall archite...
Basic syntax of the table <table>...</tab...
This article example shares the specific code of ...
Pure front-end implementation:切片上傳斷點續傳.斷點續傳needs ...
Table of contents Introduction How to connect to ...
Recently, when using IIS as a server, the apk fil...
1. Import csv file Use the following command: 1.m...
The operating system for the following content is...
This article shares the specific code of typescri...
Table of contents 1. Project Description 1.1 Back...
HTML code: <a onclick="goMessage();"...