The whole system is divided into trading system (OMS), payment system, clearing and settlement system, reconciliation system, accounting statements (optional) and so on.
The payment system is a subsystem responsible for the collection and payment of e-commerce system, which needs to support all collection and payment functions between e-commerce platform and external channels, as well as the transfer function between internal accounts of e-commerce platform. Simply put, the payment platform needs to realize four functions: recharge, cash withdrawal, transfer and refund.
Generally speaking, the payment system consists of the following functions.
Third-party payment: WeChat and Alipay account for the vast majority of domestic mobile payments, so they must be networked.
According to the settlement type, there are generally two kinds of payment: immediate receipt and secured transaction, and the payment types are transfer and bank card payment.
If the e-commerce platform has a payment license and can separate accounts by itself, or the collection type is a transaction that does not need to be separated, such as annual fee, then you can choose to collect money immediately.
If the e-commerce platform does not have a payment license, it needs to be divided into secondary merchants, and you can choose products such as WeChat PayPal or Alipay's direct payment. However, orders paid by users through WeChat can only be settled separately through WeChat products, and orders paid by Alipay can only be settled through Alipay products, which is inconvenient for platform docking and merchants to collect money. Therefore, e-commerce platforms rarely choose this method.
Bank card payment
Generally speaking, after accessing WeChat and Alipay, the e-commerce platform can meet most of the payment needs without accessing the bank card for payment. For large-scale e-commerce platforms that have purchased payment licenses, if they want to build their own payment tools, they will connect with major banks and access the fast payment function. Or an e-commerce platform with a certain scale can also directly sign a contract with the bank and open a fast payment interface.
Unlike third-party payment, bank card receipt and refund are generally not settled in real time. The acquiring transaction between the payment company and the e-commerce merchants is settled in real time, which is actually the prepayment of the payment company.
Quick payment
In most e-commerce apps on the market, the bank card payment function is a fast payment method. For the e-commerce platform, there are two ways to access the fast payment function of the bank card:
For example, the e-commerce platform opened a fast payment interface in ICBC, and the user signed an ICBC card for fast payment. After the payment is made by the user and the settlement is successful, the fund deduction will enter the settlement account of the e-commerce platform in ICBC. Note that fast payment is limited by the business type, and only the business within the contracted business scope is allowed to collect money, that is, MCC code.
If it is a third-party payment company, because it is not allowed to directly connect with the bank, it needs to use the online interface provided by UnionPay or the bank. After payment by the user and online settlement, the amount will be transferred to the reserve account opened by the payment company in the bank.
For the e-commerce platform, it is much more convenient and faster to connect with UnionPay, and most bank cards can be paid quickly once accessed; For e-commerce platforms or third-party payment companies with payment licenses, in order to lower the handling fee, they will choose to directly connect with the bank.
For fast payment with bank card, you need to sign the card first, and then you can complete the deduction without any verification. For security, the e-commerce platform will increase fingerprint, face, SMS or payment password verification, and only small payments can be exempted from verification.
To register for fast payment, you need to provide three elements (name, ID number and bank card number) or four elements (mobile phone number reserved by the bank), and the credit card may need the validity period and the last three cvv. Note that payment companies or e-commerce platforms are not allowed to save users' cvv codes. Before signing a fast payment contract, users need to complete real-name authentication or higher-level authentication to ensure that the signing card is their own bank card. National laws and regulations have three levels of information verification for third-party payment users. The third level is the highest security level, and the corresponding payment limit and payment scope are more limited.
For third-party payment companies, due to security, handling fees and other reasons, they will sign contracts with the same bank, different branches of the head office, or other channels such as UnionPay. When signing a contract with a card, or when signing a contract for subsequent payment, the user may sign a channel that needs SMS verification, or may sign other channels that do not need SMS verification. When subsequent users use fast payment, the payment channel routing will automatically select the most suitable payment channel to initiate deduction. For the fast payment quota of the same card, the quotas for using different payment channels are independent, but the total amount does not exceed the limit of the issuing bank.
For the product end, if the fast payment function is to be realized, the front end needs to realize the functions of signing card management, new signing (entering card information-identifying card information-signing result return) and unbinding.
No matter whether it is a third-party payment or an express payment, when signing a contract with a payment company, multiple collection accounts can be bound, and sometimes different businesses can use different collection accounts to make financial distinction.
Basic principles of bank transfer
There are two kinds of inter-bank transfer: super online banking and small transfer. Within the limit of 5w, the opening hours are 7*24 hours. The difference is that super online banking is real-time settlement, while micro-transfer banking is batch processing and quasi-real-time. For large transfers of more than 5w, the opening hours are 8:30- 17:00 on working days, and the settlement is made in real time. The transfer products provided by banks are basically packaged in the above three ways.
E-commerce refund, merchant settlement, commission settlement, supplier payment settlement and other businesses all involve payment.
Refund: Generally speaking, within a period of time after payment (usually 3 to 6 months), you can use the refund function of the original payment channel to return the funds. If you exceed the time limit or partial refund limit, you can't go back. Refund may take 5~7 working days to confirm the return status; For banks, clearing acquiring transactions after deducting handling fees; Even if a refund is generated, the previous collection fee will not be refunded. If the refund is made before settlement, the bank may support a proportional refund of the handling fee. The collection of refund between the third-party payment company and the e-commerce platform is determined by mutual agreement.
Bank-enterprise direct connection: This method can be used if the e-commerce has been connected to the bank's bank-enterprise direct connection products and the payment object has been bound to the bank card.
Payment function of third-party payment: this method can be used for high-frequency and micro-payment needs, and the user has bound the third-party payment account.
Corporate online banking: generally used for 2B large-sum fund transfer. Fund settlement or user withdrawal.
For third-party payment companies, when users withdraw cash, the same withdrawal account will charge a certain amount (amount or quantity) and submit it to the bank for batch processing, so the withdrawal may not arrive in real time.
The premise of payment is that the user carries out real-name authentication and binds the bank card corresponding to the real name. Binding a card requires four-factor verification, and it will require an information verification interface provided by a third-party payment, or directly connect with a bank. A debit card registered with Express Payment can also be used to withdraw funds from the account without re-verification.
The interface description of each payment channel is different. In order to facilitate service call and maintenance in the future, it is necessary to establish a unified payment gateway and open it to services. When the service is called, the payment channel is specified at the same time, and the payment gateway requests the channel routing, and returns the most suitable payment channel to initiate the payment request according to the pre-configured routing rules.
The gateway needs to realize different types of functional interfaces, generally speaking, it is the union of the interface capabilities of the payment channel, such as recharging, cash withdrawal, transfer, refund, signing inquiry, real-name authentication and verification, and so on.
Guided routing: refers to the rules of payment methods displayed to users when they pay, including visible status, available status, display order, etc. The significance of guided routing is to guide users to choose the payment method that the platform wants them to choose according to their payment scenarios. The demand on the platform side is generally high payment success rate (stable channels and sufficient amount) and low rate, and there are also reasons for the limited amount of diversion caused by business cooperation between different payment channels.
When there are few payment channels for matching access, the guiding route has little effect. Generally, there may only be a simple weight configuration background, that is, the so-called static routing, or you can directly remember the way the user chose last time.
Channel routing: For the e-commerce platform, if only the third-party payment is accessed, there is no channel routing. For the payment company, if the fast payment interfaces of different banks and UnionPay network are connected, and the bank card selected by the user has signed multiple channels, the channel routing will match the channel with the highest weight according to the routing rules and initiate a debit request.
After the direct connection is broken, the payment service of the payment company can only be through UnionPay or network interface, so the significance of channel routing is weakened. For the agency payment business, the payment company will open collection and payment accounts in major banks, and all inter-bank transfers will be converted into peer transfers, which will improve the transfer speed and exempt the handling fee. At the same time, the payment company needs to do a good job in the reserve management system, and automatically or manually manage, monitor and allocate the reserve funds of all banks.
When the service initiates a payment request to the payment gateway, the payment gateway needs to authenticate the service provider to determine whether the request is legal. A payment request generally includes the following elements: business identification, payment time, payment amount, payment account number, payment client information, payment order information, etc. The payment gateway needs to confirm that all elements are legal, such as whether the payment time is within the validity period and whether the payment bill is overdue; Whether the payment account status is normal, whether the payment form is payable, whether the goods are available, and so on. At the same time, it is necessary to transmit information through risk control, and the risk control party will judge whether the payment is risky according to various rules. Risk control is a complex system, which belongs to another professional field, so I won't elaborate here.
After the e-commerce platform requests payment from the payment channel, the payment channel will return the payment result information synchronously or asynchronously. If the payment channel does not actively return the results, the e-commerce platform needs to poll the results regularly. At the same time, the e-commerce terminal needs to save payment request information, result information, result voucher, etc. , that is, the payment flow record. The payment flow record is the proof of reconciliation between e-commerce and payment channels.
After the payment system obtains the payment result record, it needs to return the payment result to the payment requester and notify the accounting system to trigger the corresponding accounting operation.
Each payment channel will generate transaction records and cash flow statements on a daily and monthly basis, which are divided into payment, refund, cash withdrawal and other types. Transaction record file is equivalent to information flow voucher, and capital flow bill is equivalent to capital flow voucher.
Generally, bank channels will also push cash flow files, but not all bank transactions have business reconciliation files, and reconciliation files for acquiring transactions are usually more common.
What does the payment system or reconciliation system of e-commerce need to do?
The payment system also needs to reconcile with the upstream business system to encapsulate the consistency of payment status and amount. Generally, the method of rolling subsidiary ledger is adopted.
Frequently asked questions about bill receipt reconciliation:
Long-term payment: the user has paid, but the transaction system has not confirmed the success of payment. In this case, it needs to be replenished or refunded in time. Under normal circumstances, if the business order status is to be paid, it can be converted into successful payment, and if the status is cancelled, it will be refunded automatically. It is also possible that the test data is mixed into the production environment; It can also offset the previous short paragraph errors;
Short payment: usually caused by day-to-day problems, and reconciliation will continue on the next accounting day after posting; Still see if you can offset the long-term mistakes before;
Repeated payment: the general payment channel does not allow repeated payment for the same order, and it can be refunded automatically if repeated payment is found;
Inconsistent amount: it may be that the order amount of the trading system has changed after the user pays and before the payment result is returned.
Refund FAQ:
Refund failed due to network problems or interface problems. In this case, you can automatically submit a refund again;
Refund failed due to abnormal account status of the other party, so it cannot be returned through the original channels, and only transfer/pay on behalf of the other party;
When refunding, it is necessary to deal with the problem of refund of payment and who will bear the refund fee, usually in proportion;
For short-term errors, you can pause for 7 days.
Frequently asked questions about cash withdrawal: Refund failed due to abnormal account status of the other party, and users need to be informed in time for handling. For short-term errors, you can suspend your account for 3 days.
The product side needs to design a reconciliation management background, which can view payment flow, reconciliation batch records, error handling background and so on. For error types with fixed processing methods, automatic processing can be carried out.
Combination payment means that users pay multiple orders at one time, which is very common in e-commerce. The e-commerce business side needs to split the order itself. In the payment system, if the payment interface of the payment channel is used, the payment process will automatically split the records, which is the best way; If the payment channel does not have a consolidated payment interface, it can be disassembled or not, which is simple to save according to the original records and not easy to make mistakes, and splitting records can facilitate other business processing.
Mixed payment is to pay an order through various payment methods such as balance+fast payment. Hybrid payment will generate multiple payment streams according to different payment methods.
Because different payment methods have different success rates, some payment methods may fail to deduct money. Therefore, mixed payment needs to give priority to the payment method with lower success rate according to the payment success rate; If some payment methods fail to deduct money, it is necessary to judge whether to cancel payment, refund in full, or remind users to continue payment in other ways; After all payment methods are deducted successfully, this payment is completed than the order. Subsequent orders are refunded. If it is a partial refund, the payment method with the lowest refund fee needs to be judged and preferred.
E-commerce platforms or payment companies sometimes do marketing activities, pay subsidies, or use mixed payment methods.
It is said that the mixed payment of balance and card has the risk of money laundering, which is gradually rare at present.
For large orders, you can pay by installment, which is also a mixed payment in essence.
After the order is completed, the e-commerce platform needs to deduct the platform commission and settle the payment with the merchant; If the promotion service is involved, it is necessary to calculate the commission and tax of the promotion user, and then settle it to the promotion user.
According to the law, e-commerce companies without a clearing and settlement license are not allowed to intercept the inventory funds themselves and then settle with the merchants. The e-commerce platform can choose a third-party payment company, or use the bank's e-commerce settlement products, and they will save the payment on their behalf and then settle it to the merchants. Such products need to submit merchant information to payment channels or banks for approval. After the approval, the user pays the merchant's order, submits the payment and sends the clearing rules (to whom, according to what proportion or amount). After the order transaction is completed, the e-commerce party submits a settlement request, and the payment platform makes separate settlement according to the settlement rules sent in the previous payment. For some payment platforms, it is necessary for the e-commerce platform to specify the sub-account object and amount at the time of settlement, but this is slightly suspicious.
When choosing this kind of settlement products, we should also pay attention to the following points:
After accessing such products, in addition to the back-end payment and settlement interface, the merchant-side client of the e-commerce platform also needs to dock the merchant's purchase, cancel account binding, and settle bills.
Common sales models of e-commerce platforms include distribution, anchor consignment, group assembling, taobao guest and so on. The role of "distributor" or "head of delegation" is not the sales subject itself, and you can get promotion commission after completing the order. Generally speaking, this part of the promotion expenses, after the order is generated, the merchant can see this expenditure item in the order expense details; When the order is settled, the promotion commission can be deducted together with the platform commission, and then the platform will settle the promotion commission to the promoters.
This kind of expenditure belongs to labor remuneration, and the platform has the obligation to pay taxes on behalf of the sponsors, and the tax rate and amount need to be calculated monthly. Therefore, some platforms adopt the method of monthly settlement, specify a date every month, calculate the tax that each promoter needs to settle, and then settle the after-tax amount to the promoters after deduction. There are also some platforms (such as O2O and online car rental platforms). Then bear this part of the tax (wool is on sheep). When the order is settled, the promotion commission will be settled to the promoter immediately, and the tax of the promoter will be counted the next month. The platform pays taxes for the promoters themselves.
The platform can also adopt a variety of tax planning methods such as "flexible employment" to establish part-time labor relations with promoters, so that promoters can enjoy lower tax rates.
The platform will settle the accounts for the sponsors by itself, and you can use the functions such as bank-enterprise direct link and payment platform to pay for the sponsors. Platform tax payment requires the real-name information of the sponsors, so the sponsors need to pass the real-name registration system before they can withdraw the commission.
No matter which settlement method is adopted, the e-commerce platform needs to calculate various expense details (settlement) during order settlement, and the module responsible for settlement is also called billing system.
E-commerce platform has a variety of deduction rules, such as by commodity, by merchant, by category, by marketing activities and other rules, as well as various promotional commissions. Deduction rule routing corresponds to various deduction rules, such as the management background of deduction rules for commodities, merchants and categories. The basic elements are deduction object, deduction proportion, deduction line, effective time range of rules and rule status. The product manager needs to confirm the judgment logic of the deduction rules with the operators, that is, according to what conditions to judge the order, to confirm the deduction rules applicable to the order. Later, when you add a new deduction rule, you also need to maintain this deduction rule route.
The deduction rule routing of each e-commerce platform is different, which may include marketing activities, ordering/paying customers, buyer identity, deduction rule weight and so on.
Generally, when creating an order, the deduction rule routing needs to judge the applicable deduction rule of the order according to the relevant information of the order and record it. At the same time, it is necessary to save the information elements used for judgment as evidence for later inspection.
If there are promoters involved in the order, it is also necessary to calculate the promotion expenses to be deducted when creating the order, and save and record the relevant promoters' information.
When calculating the sub-account details of each party, the following points should be noted:
Generally speaking, the settlement related to the order transaction is that when the order status changes to the final status (transaction completed, refund completed) and the order amount has not been settled, the trading system submits a settlement request to the settlement system. There are several solutions. For example, if some goods in the order are confirmed to be received first, you can settle part of the amount first, and then settle the remaining amount.
For a large-scale e-commerce platform with payment license, in order to improve the payment speed of merchants, it is also possible to settle the payment with merchants when the order has not been finalized, such as when the user confirms the receipt or when the merchant delivers the goods. If the order is refunded after settlement, the corresponding amount will be deducted from the merchant's wallet. This settlement method requires the platform to have relatively mature risk control ability, and prevent the loss of platform funds through risk control and risk transfer. For example, sign an agreement with a merchant, set a merchant deposit, and the merchant &; Buyer's risk control, purchase corresponding compensation insurance and so on.
When the trading system initiates a settlement request to the clearing and settlement system, it needs to submit fields such as settlement instruction, settlement amount and settlement type (full/partial settlement). After receiving the settlement request, the settlement can be real-time or asynchronous, such as every x hours, depending on the business volume.
At the beginning of settlement, the billing center obtains the pending amount of the order from the accounting system, checks the settlement amount according to the settlement type, freezes the pending amount after checking, and submits it to the billing center; The billing center finds the deduction rules in the order snapshot and calculates the detailed accounting.
After calculating the detailed accounts of all parties, the billing center needs to conduct real-time or quasi-real-time reconciliation with the accounting center to ensure that the amount to be settled is equal to the sum of the detailed accounts of all parties. Generate a pre-settlement document after approval.
For most orders, the settlement center can submit the settlement form to the payment system for final fund transfer. For a few orders, the settlement document may need manual approval, so it can only be submitted to the payment system after approval, otherwise the settlement will be rejected and cancelled.
Generally, each branch will open an account in the payment system in advance, and the payment system will settle the funds into the fund accounts of all parties. For the payment system, it only involves the transfer of funds between internal accounts, and the settlement payment fails rarely.
After the payment system returns the result of successful settlement, the status of the settlement document will change to settlement completed; The settlement system needs to notify the trading system and the accounting system in real time, and the accounting system records the fund changes of each account and updates the account balance; The trading system triggers related services such as message notification. If there is an accounting system, it is also necessary to notify the accounting system asynchronously to make accounting entries.
For mature payment companies, there will be two systems: accounting system and accounting system. These two sets are designed with the account model, but the difference is that the accounting system is directly used for business. With the real-time accounting and updating of the balance of business information flow, accounting flow records more contents related to transactions; The accounting system is used for financial accounting, generally asynchronous entries, and strict double-entry bookkeeping method is adopted.
The account in the accounting system must be under the leaf account in the accounting system. The family model between the two systems will have a many-to-many relationship. This accounting system can be called account (external), and this accounting system is called account (internal).
According to the double-entry bookkeeping method, it is generally divided into assets, liabilities, profits and losses, etc.
The essence of transaction is the transfer of funds between accounts of various amounts, so it is necessary to establish corresponding accounts first.
Account design follows three models: customer, account number and account.
Customer: refers to a natural person or enterprise, and can only open a payment account with real-name authentication. The customer takes the ID number as the unique identification.
Account number: login account number, a customer can have a limited number of accounts, that is, an ID card can be used for real-name authentication of a limited number of accounts. However, for the same payment company with multiple accounts under one ID card, the maximum payment amount is * * *. According to the richness of identity authentication information, the balance account number of the payment platform is divided into one or two categories, and the maximum payment amount and authority of the three categories are 200,000/year. There is no annual limit for balance withdrawal, balance treasure payment and credit payment. Bank card fast payment signing, extracting bank card binding and other operations are also based on account number.
Account: Each account will have multiple accounts with different functions on the payment platform or e-commerce website. The merchant has a payment settlement account and a margin account; The buyer has a payment account, a credit payment account and an integral account; Or an internal account on the e-commerce platform, such as an activity subsidy account and an order guarantee account.
There are four tables in the accounting core: entry process, subsidiary ledger, subsidiary ledger and general ledger.
First of all, there needs to be an entry rule table of transaction codes-entry rules, which is used to maintain the rules of how to split each transaction scenario differentiated by transaction codes into accounting entries. For example, if the transaction code 100 1 is defined as fast payment for an order bank card, when the payment process of this order is synchronized to the accounting center through the payment platform, the corresponding posting rules are found according to the synchronized transaction code 100 1, and accounting entries are generated according to the definitions in the rules:
When a transaction occurs, an entry flow is generated first, and then the account balance is driven to change. After the account balance changes, a subsidiary ledger is generated. At the end of the day, the general ledger is generated according to the entry process. According to business needs, you can also modify the account balance first and then generate journal entries asynchronously. However, whether it is to generate accounting entries or to buffer the asynchronous generation of accounting entries, it is necessary to ensure the consistency between journal entries and subsidiary ledger balances, which is guaranteed by day-end system inspection.
Every day, the payment channel needs to be reconciled first, and then the accounting system and the accounting system need to be reconciled.
What needs to be done:
Error handling needs to achieve two effects, one is to complete reconciliation, and the other is to balance accounts. Common accounting methods include suspense, posting and reconciliation.
Supplementary Order: Continue the original business through manual intervention, such as manual intervention in the order status through the interface.
Pending account: for the uneven bill, suspend it first, and then deal with it after finding out.
Bookentry: Bookkeeping, accompanied by the transfer of virtual funds from one account to another (original voucher).
1, overcharged
There are two main situations of overpayment. One is to give priority to replenish orders without receiving asynchronous notice. The other is that the same order is paid twice, which is generally handled by posting.
2. Short term accounts
Basically, it will not appear, and it is generally handled by a third party through a signature anti-denial mechanism. After reconciliation, manually add a statement to balance the account.
3. The amount is inconsistent
The probability of occurrence is extremely low, which is generally an internal calculation error of the e-commerce platform.
Solve this bug first, and then deal with it in abnormal order, such as canceling reconciliation, modifying the system or the amount of the statement before reconciliation.