当前位置:网站首页>Talk about the design and implementation logic of payment process
Talk about the design and implementation logic of payment process
2022-07-03 17:38:00 【InfoQ】
One 、 Business background

Two 、 Payment business
1、 Process disassembly

- Book management : For users who have opened the payment function , Must have clear management information ; For example, available , frozen , Bills, etc ;
- Transaction flow : The running records of the whole fund management , Not limited to trading scenarios , And recharge , Withdrawal , Refund, etc ;
- Payment docking : Usually, the payment function in the process is realized by connecting with the third-party payment platform , So make a good record of requests and messages ;
- Order structure : For example, in e-commerce transactions , Order model management , Split order strategy, etc , Specifications of goods paid, etc ;
2、 Process sequence

- Before payment : When placing an order , Build order model , Check the inventory according to the splitting rules 、 Commodity status, etc , Then freeze the account funds , Generate transaction flow , At this time, the status is to be paid ;
- Payment docking : After the business model is initialized successfully before payment , Build a third-party payment docking request , Initiate payment process , And record the corresponding request actions and parameters , Waiting for notification of payment results ;
- After payment : According to the success of the payment results , Perform the corresponding business model status update , If the payment is successful, the transaction is recorded 、 Frozen funds 、 Order structure and inventory need to be updated ;
3、 The structure design

- Book management : Three core dimensions , Amount of account , Available balance , Freezing amount ;
- Transaction records : Store users' transaction actions , However, multiple transaction details may be generated , A typical scenario is to place an order in a shopping cart ;
- Transaction details : Usually because the order is split , As a result, the transaction is split into multiple details , And then pay the funds to different businesses ;
- Payment docking : When requesting a third-party payment platform , Need to record request parameters , And the message of the third party callback notification ;
- Order records : There may be multiple split sub orders in an order , There are also many splitting strategies , Like the warehouse , merchants , Category, etc ;
- The order details : Manage the information of each sub order , Goods ordered 、 specifications 、 round turn 、 The unit price 、 Number 、 Amount, etc. ;
3、 ... and 、 Related business

- Commodity subject : Maintain the information of each dimension of goods , And provide various specifications and options , And the basic pricing ladder , Build product details ;
- Warehouse management : After the order is split , You need to verify the storage information according to the commodity number , Carry out corresponding inventory freezing and warehouse delivery after payment ;

- Coupon subject : In order to adapt to more business scenarios , There need to be many designs for preferential rules , Such as full reduction or discount ratio 、 Price ladder discount 、 Validity limit, etc ;
- Distribution rules : Support daily operational activities , Maintenance of user life cycle , And the transformation of channel flow , Provide the basic ability of user group marketing ;
Four 、 practice
- business model : Have a clear understanding of the business , And can split the core nodes , Design the corresponding process sequence and data structure ;
- Business management : Commonly used in the transaction process TCC Transaction mechanism , namely Try( Preprocessing )、Confirm( confirm )、Cancel( Cancel ) Pattern ;
- Lock and retry : Send the message of successful payment after payment , Then update the business , It is usually necessary to lock the processed order number , Avoid data problems caused by message retry mechanism ;
- Capital settlement : Calculation of amount involved , The problem of accuracy loss cannot occur naturally , In a transaction, it must be ensured that each fund can be verified by reconciliation ;
- Process maintenance : The process itself is difficult to ensure that there are no errors , It needs to be developed , Provide a visual interface of the process , And support the mechanism of manual maintenance ;
边栏推荐
- The third day of writing C language by Yabo people
- SWM32系列教程4-端口映射及串口应用
- TCP congestion control details | 3 design space
- 互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼
- PS screen printing brush 131, many illustrators have followed suit
- vs2013已阻止安装程序,需安装IE10
- Answer to the homework assessment of advanced English reading (II) of the course examination of Fuzhou Normal University in February 2022
- 鸿蒙第三次培训
- Baiwen.com 7 days Internet of things smart home learning experience punch in the next day
- Unity notes unityxr simple to use
猜你喜欢

QT adjust win screen brightness and sound size

鸿蒙第三次培训
![[RT thread] NXP rt10xx device driver framework -- Audio construction and use](/img/85/32a83eaa4b7f5b30d4d7c4f4c32791.png)
[RT thread] NXP rt10xx device driver framework -- Audio construction and use

QT学习日记9——对话框

Simple use of unity pen XR grab

Leetcode Valentine's Day Special - looking for a single dog

Type conversion, variable

Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13

Is AI too slow to design pictures and draw illustrations? 3 sets of practical brushes to save you

TCP congestion control details | 3 design space
随机推荐
AcWing 4489. Longest subsequence
Analyse ArrayList 3: suppression d'éléments
Servlet specification Part II
MinGW compile boost library
Graduation summary
Notes on problems -- watching videos on edge will make the screen green
自动渗透测试工具核心功能简述
Redis: operation commands for list type data
Open vsftpd port under iptables firewall
Examination questions for the assignment of selected readings of British and American Literature in the course examination of Fujian Normal University in February 2022
Draw some simple graphics with MFC
[combinatorics] recursive equation (the non-homogeneous part is an exponential function and the bottom is the characteristic root | example of finding a special solution)
Vs2013 has blocked the installer, and ie10 needs to be installed
WEB-UI自动化测试-最全元素定位方法
互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼
Dagong 21 autumn "power plant electrical part" online operation 1 [standard answer] power plant electrical part
IntelliJ 2021.3 short command line when running applications
Leetcode13. Roman numeral to integer (three solutions)
The difference between i++ and ++i: tell their differences easily
September, 19, "cam principle and application" online assignment [Full Score answer]