How to add Alipay payment function to my Java project?

It’s been a long time since I updated the blog.
Step 1: To enter Ant Financial, we first need to click Create Application, enter Baidu, search Alipay open platform, log in to our account,
Insert picture description here
click to enter my platform or developer center, and then click Create Application to
Insert picture description here
create an application (to create an application, you need to provide information for review ), wait patiently, at this time we continue our own operation (testing in the sandbox environment), and after the audit communication is passed, we can replace the audited information here!
Step 2: Use the sandbox environment for development, click R&D service

Insert picture description here
Insert picture description here
This appID is very important, we need to use it when we pay (it will also be included in the information after the current review), click to set the application public key
Insert picture description here
as shown in the figure below: click to view the secret key generation method
Insert picture description here
to download the corresponding tool according to your operating system, and then follow the steps
Insert picture description here
Proceed to the third step: https://docs.open.alipay.com/270/106291/ There is a payment demo and a corresponding jar package, add your own project (with the update, the jar package in the demo may become more and more Multi)
Insert picture description here
Step 4: Write the code, (there is some code in the Demo)
Create an AlipayConfig class as shown below and put the corresponding value into it.
Insert picture description hereFinally, write the action class (the content of this type is the alipay in the demo below. In the .trade.page.pay.jsp file, the Demo is placed in the jsp, I am lazy, and I copied it directly, haha! And I also annotated the empty content, just for simplicity)
Insert picture description here
Click here The button page should have these required items, and the corresponding action (action in the form) (the corresponding class should be the action you wrote yourself or the jsp page in the Demo copied like me). It
Insert picture description here
is basically completed at this time Up! Waiting for the audit result!

Guess you like

Origin blog.csdn.net/lq1759336950/article/details/104581984