1. Prepare conditions
Download and install sdk
Installation encryption expanded pip3 install pycryptodome (encryption module)
Necessary parameters (use the tool to generate business Alipay private)
Private businesses
Alipay public
order number
product description
Payment amount (two decimal places)
Synchronous callback address
Asynchronous callback address
2. Synchronous callback
Return result of payment, can be tested locally
Payment successful return parameters:
{'charset': 'utf-8', 'out_trade_no': 'x21564885575.0781286', 'method': 'alipay.trade.page.pay.return', 'total_amount': '0.01', 'trade_no': '2019080422001498971000053973', 'auth_app_id': '2016082500309412', 'version': '1.0', 'app_id': '2016082500309412', 'sign_type': 'RSA2', 'seller_id': '2088102172939262', 'timestamp': '2019-08-04 10:27:17'}
Receive parameters, modify the payment status
3. asynchronous callback (test must be online)
Test results payment
Correction state