Third-party payment process for e-shop Project Learning

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.