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
Usually, we first define the Dockerfile file, and...
The target attribute of a link determines where th...
1. Implement call step: Set the function as a pro...
A Thorough Analysis of HTML (14) Special Characte...
When I was writing join table queries before, I a...
There are four main MySQL string interception fun...
This article example shares the specific code of ...
1. This is a bit complicated to understand, I hop...
Note: The system is Ubuntu 14.04LTS, a 32-bit ope...
The insignificant flex-basis has caused a lot of ...
Allow './' relative paths in docker-compo...
Template 1: login.vue <template> <p clas...
0x0 Parameter verification Most of the parameter ...
Detailed explanation of Linux vi command The vi e...
Development Pain Points During the development pr...