当前位置:网站首页>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 ;
边栏推荐
- Notes on problems -- watching videos on edge will make the screen green
- [combinatorics] recursive equation (solution of linear non-homogeneous recursive equation with constant coefficients | standard form and general solution of recursive equation | proof of general solut
- 企业级自定义表单引擎解决方案(十一)--表单规则引擎1
- QT learning diary 9 - dialog box
- 毕业总结
- [RT thread] NXP rt10xx device driver framework -- pin construction and use
- Great changes! National housing prices fell below the 10000 yuan mark
- Automata and automatic line of non-standard design
- Open vsftpd port under iptables firewall
- Collection of the most beautiful graduation photos in the graduation season, collection of excellent graduation photos
猜你喜欢
【RT-Thread】nxp rt10xx 设备驱动框架之--rtc搭建和使用
[RT thread] NXP rt10xx device driver framework -- Audio construction and use
【JokerのZYNQ7020】DDS_ Compiler。
Cross border e-commerce: advantages of foreign trade enterprises in overseas social media marketing
[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela
Applet setting multi account debugging
Draw some simple graphics with MFC
Collection of the most beautiful graduation photos in the graduation season, collection of excellent graduation photos
PS screen printing brush 131, many illustrators have followed suit
QT学习日记9——对话框
随机推荐
[combinatorics] recursive equation (general solution structure of recursive equation with multiple roots | linear independent solution | general solution with multiple roots | solution example of recu
Type conversion, variable
Assignment examination questions of advanced English (III) for the course examination of Fujian Normal University in February 2022
Examination questions for the assignment of selected readings of British and American Literature in the course examination of Fujian Normal University in February 2022
Create a new file from templates with bash script - create new file from templates with bash script
Tensorboard quick start (pytoch uses tensorboard)
Servlet specification Part II
面试官:值为 nil 为什么不等于 nil ?
Collection of the most beautiful graduation photos in the graduation season, collection of excellent graduation photos
Qt调节Win屏幕亮度和声音大小
Write a program to process a list container of string type. Find a special value in the container 9.27: and delete it if found. Rewrite the above procedure with deque container.
PHP processing - watermark images (text, etc.)
[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela
鸿蒙第四次培训
【JokerのZYNQ7020】DDS_ Compiler。
TCP拥塞控制详解 | 3. 设计空间
QT adjust win screen brightness and sound size
SQL injection database operation foundation
Analyse ArrayList 3: suppression d'éléments
Kubernetes resource object introduction and common commands (V) - (NFS & PV & PVC)