1. Client "click payment Button" (Browser→server)
Parameters: Payment method, Order SN
2. The server "processes information and responds" (Server→browser)
① receive parameters, check the legality of payment method and order SN
② Order information According to order SN, calculate the total price of orders instantly
③ Order information (order SN, order name, order Total Price ... ) + Merchant Information (key, token) +sign (anti-counterfeiting signature-prevents tampering of parameters)
④ the above information into an HTML form. (The form will automatically submit action to the third-party payment platform interface address)
-Parameters: HTML containing order information
3. Client "Auto-turn to payment platform" (Browser→chinapay)
Parameters: Values in hidden fields in a form
4. Payment platform "process payment operation"
(Chinapay→server)
The server receives information, notifies the handler to verify the payment status, and then modifies the order. Heartbeat: The payment platform will not stop sending this payment information until the server receives the payment status and returns the message to the payment platform to receive the message successfully.
Parameters: Order sn, total receipts, order status
(Chinapay→browser)
The client receives information (302) that points to our web server.
Parameters: Order sn, total receipts, order status
5. Client "Callback Order payment Details" (browser→server)
Requests the current payment result to the client.
-Parameters: Order sn, total receipts, order status
6. Server "Verify Order Payment status" (Server→browser)
Check the order status based on the requested order SN. (It is not possible to modify the order information directly according to the parameters of the request, the order information must be modified according to the information returned by the payment platform, only check here, to prevent users from tampering with the payment status)
Parameters: Order sn, total receipts, user order payment status saved in the server ...
7. Client "Accept and complete this payment"
Third-party payment process for e-shop Project Learning