Payment is always a core area for a company, because it is the lifeblood of a company with transaction attributes. So what does a payment system look like and how does it interact?

Regardless of the payment architecture of a finance company with a payment license, the following links and system composition are generally consistent with the vast majority of payment scenarios.

In fact, the whole can be regarded as a transaction core + payment core two big systems. The transaction system is associated with the business scene and the underlying payment, while the payment system completes a series of related operations from calling payment tools to reconciliation and settlement. Let’s take a look at the core components and interactions of each system.

By Petter Liu

Reference:www.cnblogs.com/wintersun/

Part One Payment System Overview

Core System Interaction

The business map

Part two Core system analysis

Trading core

The transaction core connects the company’s business system with the underlying payment, so that the business system focuses on the business rather than the underlying payment.

Trading core

Abstract underlying transaction type

Multi-table aggregation & order association

Payment of the core

The payment core is mainly responsible for abstracting a variety of payment types into four payment forms: top up, cash withdrawal, refund and transfer. At the same time, I am also responsible for integrating various payment tools, arranging payment instructions and so on.

Payment core Overview

Arrangement of payment behavior

Its purpose is to realize plug-in development and flexible development with configurable payment rules.

Exception handling

Exception handling includes repeated payment, partial payment, inconsistent amount, and other exceptions.

Channel gateway

Cash accounting

Part Three Service governance

Platform unified Context

After the system boundary is determined and the business modeling is split, the whole payment platform is split into dozens of services, and how to ensure that the business information flowing between services is not lost is a problem we need to consider. The element information of platform unified context (unique business IDENTIFIER), which is transmitted throughout the payment platform link, is used to solve this problem.

Data Consistency Management

Large payment companies have very strict and complete data consistency schemes internally. For example, it is necessary to sacrifice development efficiency to improve data stability by adopting distributed transactions which are very intrusive. What strategies do business companies have if they don’t adopt distributed transactions?

The CAS checking

Idempotent & abnormal compensation

reconciliation

Quasi real-time reconciliation

The DB split

asynchronous

Payment is the core link of the whole transaction link, so how to give consideration to the stability and execution efficiency of the payment system? It’s asynchronous.

Message asynchronization

External payment calls are asynchronized

In external payment, it is often necessary for the service party to interact with the third-party payment and obtain the pre-payment voucher, as shown in the figure above.

In the case of this synchronous call, the RT of the response will be very long because of the need to cross the external network, and it may cross seconds. Because it is a synchronous call, the entire payment link is blocked. Once the RT is very long and the QPS is relatively large, the service will be held as a whole, and even the denial of service will occur.

Therefore, the operation of obtaining credentials can be separated, and the method of obtaining credentials can be asynchronously asynchronized by pre-provisioning services through independent gateway channels. Internal credentials can be obtained from the front-gateway, and then the front-gateway can asynchronously invoke a third party.

Asynchronous parallelization

Asynchronize capital accounting

Hot spot accounts are handled separately

Accounting transaction sharding

Part four Production practice

Performance pressure measurement

Build a pressure measurement model to simulate the real scene; Pressure measurement data into the shadow library, normal business without intrusion; Single machine performance and centralized link can not be ignored; Identify system stability and capacity ratio…

Stability management

Core link separation

Service dependency degradation

This article uses the article synchronization assistant to synchronize