Today I will share with you how to access Alipay payment, although it may not be necessary, after all, a larger company will not allow an ordinary employee to write a financial module, but what if you go to a small company? Haha, just kidding
This blog will list the steps to access Alipay. If you don’t understand, you can ask me or Baidu.
Preliminary steps
To Alipay open platform to register an account
Go to the document center to find the payment document of the computer website , click to open it and see the quick access
Access
pom.xml
Click on the link in the figure to go in and see the link that maven depends on, just go in and copy
alipayRequest.setReturnUrl("http://localhost:8081/");// The user jumps to the page after the payment is completed, synchronously, it is sent by the browser, so you can use localhost // AlipayRequest for asynchronous notification of successful payment . setNotifyUrl("http://w5g9y4.natappfree.cc/updateOrder");//Set the return jump and notification address in the public parameters
Both links are redirected by Alipay. The first link is the page to which the payment is successful, and it is synchronized. You can specify your homepage or payment success page, and the second link is to jump after the payment is successful. Go to an asynchronous request sent before the first link. This request can be sent to the controller you want to jump to to do some operations, such as changing the unpaid status of the order to the paid status
Mock payment
Web version payment
You can also click the link in the picture to download a mobile phone simulation Alipay app payment