Evolution and Architecture of MaFengWo Payment Center (Version 1.0 → 2.0)
The article details the evolution of MaFengWo's payment center from a basic payment‑refund module (1.0) to a comprehensive, modular platform (2.0), describing its core capabilities, layered architecture, customizable checkout, routing management, monitoring system, and future micro‑service roadmap.
To support rapid growth of transaction business, MaFengWo Payment Center progressed from a simple payment‑refund stage ("knife‑cultivation") through an architectural overhaul ("bone‑scraping") to a consolidated product platform ("sedimentation and power").
The current center integrates order management, checkout, routing, payment channels, settlement verification, and reporting, serving nearly 20 business lines such as vacation packages, transportation, and hotels.
Version 1.0 focused on quick business response, handling basic payment and refund by directly invoking third‑party channels (Alipay, WeChat, LianLian). The interaction flow involved business systems sending order requests to the payment center, which then called the channel and returned asynchronous results.
As business complexity grew, the monolithic design caused high maintenance cost, poor disaster recovery, unreasonable structure, and tangled responsibilities, prompting the shift to Version 2.0 .
Version 2.0 addresses three main problems:
Establishes a unified order, payment, and finance system to reduce integration and duplicate development costs.
Builds a secure, stable, and extensible system that balances fast business growth with reliable payment.
Aggregates core transaction data to provide big‑data support for users, merchants, and finance.
Core Capabilities include platform payment, quick payment, protocol payment, credit payment, overseas payment, and offline (ToB) payment, as well as specific scenarios such as split payment and combined payment for insurance.
Architecture Design is divided into three layers:
Product Layer – presents checkout UI, payment management backend, and financial reconciliation systems to end users and operators.
Core Layer – contains fundamental modules such as basic order, payment routing, and payment channel abstractions.
Support Layer – provides infrastructure like monitoring & alerting, logging (ELK), configuration management, and a message bus (RabbitMQ).
The Checkout (cashier) is split into H5 and PC versions, built with a factory‑class inheritance pattern for business‑specific data and UI, and supports both customization and configuration to adapt to diverse business needs.
Routing Management handles both payment account selection and channel selection, moving from file‑based configuration to a database‑driven mapping for easier maintenance.
Payment channels (Alipay, WeChat, UnionPay, Apple Pay, etc.) are abstracted via a base class using the template‑method pattern, allowing uniform interaction while hiding channel‑specific implementations.
The Support Layer includes a monitoring system that isolates monitoring resources from business databases, offering API, service performance, and database monitoring with unified alerting, analysis, and fault‑tolerance capabilities.
Monitoring backend allows users to define items, set thresholds, and configure alert channels (SMS, email). A multi‑process architecture enables monitoring frequencies as low as 10 seconds while handling thousands of concurrent checks.
Practical Experience highlights data consistency challenges solved with transactions, real‑time and delayed checks, and compensation mechanisms, as well as stability issues caused by third‑party channel unreliability, mitigated by periodic scans, automatic refunds, and exponential back‑off retry strategies.
Looking ahead, Payment Center 3.0 will adopt micro‑service principles to decompose the monolith into loosely coupled services, improving scalability and availability while introducing new challenges in development and maintenance.
Author: MaFengWo E‑commerce Payment & Settlement Team.
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.