Principle and process of payment interface development of e-commerce platform

With the development of the e-commerce industry, many small and medium-sized enterprises have also joined the e-commerce army. A very important requirement for realizing e-commerce is to have a powerful e-commerce website platform for managing e-commerce-related products and services of enterprises. . The most important part to complete the entire e-commerce process is to collect payment, and pay the goods and services to the owner of the e-commerce platform through the network.

We refer to e-commerce platform owners, i.e., providers of goods or services sold on the e-commerce platform, as merchants. The payment function to be realized by the e-commerce platform is that the customer selects goods and services through the e-commerce platform, submits an order, and the platform handles the price processing, calculates the total amount to be paid for the order, and provides it to the customer for payment.

Merchants need to sign contracts with banks, UnionPay or third-party payment institutions to realize the payment function of the website.

So how do customers pay through the network, and how do merchants receive money and transfer it to their bank cards? That's the point of this article.

We know that the processing of funds must be done through a bank, and a merchant can sign a contract with a commercial bank, and the bank will provide the relevant technical interface to the bank to provide relevant technical interfaces to add relevant interface programs to the website. Transfer to your own account to receive payment.

However, there are many commercial banks, and the bank cards held by users are also diverse. Therefore, to realize that most bank cards can be paid through the website, it is necessary to sign contracts with each bank separately, and the access cost is very high. To solve this cumbersome access problem, we can directly sign a contract with "UnionPay Online Payment" and use the payment interface provided by UnionPay.

"UnionPay Online Payment" is an integrated, comprehensive and open online payment platform jointly launched by China UnionPay and commercial banks, which fully supports various types of UnionPay cards. Convenient, fast, safe and reliable, universal. However, with the issuance of third-party payment licenses by the People's Bank of China, various third-party payment companies directly sign contracts with commercial banks and provide payment access to merchants. Third-party payment companies have low access thresholds, low rates, high efficiency and simple technology development. Caused the access to use of many commercial websites.

The well-known Weibo Wallet, Alipay, Tenpay, Kuaiqian, etc. are all formal payment companies with third-party payment photos taken by the People's Bank of China.

The payment process after signing with UnionPay and third-party payment companies After the

merchant website provides payment information to the payment gateway, the website guides the user to enter the relevant bank gateway to make payment. After completion, the bank deducts the payment and returns the payment result to the third-party payment company. , after the payment company receives the result, it will process the account entry in the payment platform for the merchant and wait for settlement. After the settlement is completed, the merchant can log in to the third-party payment platform to withdraw cash, and transfer the funds to their bank card through the third-party payment platform.

At present, the settlement cycle provided by the payment company is generally T+1 or T+0. In the T+1 mode, that is, after the user completes the payment, the payment company will settle the next day, and the merchant can withdraw the funds to their own bank card. , or the payment company directly settles into the agreed merchant's collection account. If it is in the T+0 mode, the payment funds can be liquidated at any time and withdrawn to the merchant's bank card.

Technology development process after signing with UnionPay and third-party payment company After signing

with payment company, the website will obtain the relevant merchant number, key, payment gateway and development documents. By reading the document, the technician obtains the relevant data parameters to be used, such as commodity name, amount, etc., and encrypts it through the agreed encryption method and key, and sends it to the payment company provided by the payment company in the form of FORM form POST or GET. Gateway URL.

After receiving the relevant parameters provided by the merchant, the payment gateway will perform data processing and encryption verification. If the data is qualified and the key verification is successful, it will guide the user to enter each bank selection page. After the user selects the bank they use, they will enter the relevant bank. payment gateway for payment.

After the user successfully pays at the bank gateway, the bank deducts the money and sends the payment result back to the payment company. The payment company receives the bank's result, and also performs signature verification and transmits the payment result information to the merchant's website.

The payment company also transmits the payment result to the merchant's website through the FORM form, but the data transmission belongs to the back-end processing of the server. When the merchant website initiates a payment request to the payment company and transmits payment-related parameters, it includes one or two URLs, which are used to specify the URL for receiving the payment result.


There are two ways to access the payment result on the merchant's website, one is through the browser for jump notification, and the other is the server-side asynchronous notification. So how should the technicians of the merchants choose? We analyze both notification types.

Browser jump notification: This method is mainly based on the browser accessed by the user. If the user directly closes the page after successful payment on the bank page without waiting for the bank to jump to the payment result page, the merchant website will not receive the notification. The notification of the payment result makes the payment result difficult to process. Moreover, browser-side data is easily tampered with, which reduces security. Therefore, we recommend that technicians use the back-end server notification to make technical judgments when developing, and only display the front-end notification for payment-related display without logical processing.

Server different notification: This method is that the payment company server background directly sends parameters to the asynchronous notification URL specified by the user, using POST or GET. In the program corresponding to the URL of the merchant website that receives the different parameters, the signature verification of the payment result returned by the payment company is required, and the payment logic processing is performed after the success, such as verifying whether the amount and order information are the same as when the payment was initiated. Perform status processing or make in-site accounts for users, etc.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326848121&siteId=291194637