当前位置:网站首页>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 ;
边栏推荐
- kubernetes资源对象介绍及常用命令(五)-(NFS&PV&PVC)
- Select 3 fcpx plug-ins. Come and see if you like them
- Unity notes unityxr simple to use
- [vscode] convert tabs to spaces
- Basic grammar of interview (Part 2)
- 国内如何购买Google Colab会员
- 数仓任务里面 跑SQL任务的时候用的数据库账号是在哪里配置的
- Cross border e-commerce: advantages of foreign trade enterprises in overseas social media marketing
- Create a new file from templates with bash script - create new file from templates with bash script
- Hongmeng fourth training
猜你喜欢
Qt调节Win屏幕亮度和声音大小
Applet setting multi account debugging
【RT-Thread】nxp rt10xx 设备驱动框架之--hwtimer搭建和使用
PS screen printing brush 131, many illustrators have followed suit
STM32 realizes 74HC595 control
vs2013已阻止安装程序,需安装IE10
Introduction to SolidWorks gear design software tool geartrax
QT adjust win screen brightness and sound size
Automata and automatic line of non-standard design
【RT-Thread】nxp rt10xx 设备驱动框架之--Pin搭建和使用
随机推荐
Remote office tools sharing | community essay solicitation
[combinatorics] recursive equation (the problem of solving recursive equation with multiple roots | the problem is raised)
鸿蒙第三次培训
Kubernetes resource object introduction and common commands (V) - (NFS & PV & PVC)
Examination questions for the assignment of selected readings of British and American Literature in the course examination of Fujian Normal University in February 2022
Unity notes unityxr simple to use
How to purchase Google colab members in China
1146_ SiCp learning notes_ exponentiation
Leetcode 538 converts binary search tree into cumulative tree -- recursive method and iterative method
STM32H7 HAL库SPI DMA发送一直处于busy的解决办法
Assembly for unloading Loadfrom() loaded assembly - unloading the assembly loaded with assembly LoadFrom()
Kotlin learning quick start (7) -- wonderful use of expansion
Brief introduction to the core functions of automatic penetration testing tool
[combinatorics] recursive equation (example of solving recursive equation without multiple roots | complete process of solving recursive equation without multiple roots)
Implementation of Tetris in C language
What is the difference between cloud server and cloud virtual machine
SQL injection database operation foundation
[UE4] brush Arctic pack high quality Arctic terrain pack
Website with JS doesn't work in IE9 until the Developer Tools is activated
Swm32 series Tutorial 4 port mapping and serial port application