payment-processing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Payment processing pattern library

支付处理模式库

Reference patterns for payment integrations.
用于支付集成的参考模式。

Idempotency-key patterns

幂等键模式

PatternWhen to use
Client-generated UUIDv4 per attemptDefault for most APIs
Server-derived (customerId, intent-id, timestamp-bucket)When client can't generate unique keys
Deterministic from request payload hashRisky — if any field changes, key changes; not idempotent across retries
Persist the key client-side so retries reuse it. Without persistence, retries generate new keys and bypass idempotency.
模式使用场景
每次尝试由客户端生成 UUIDv4大多数 API 的默认选择
服务端派生(customerId、intent-id、timestamp-bucket)客户端无法生成唯一键时
根据请求载荷哈希确定性生成存在风险——任何字段变化都会改变键;跨重试不具备幂等性
在客户端持久化该键,使重试时能够复用它。如果不持久化,重试会生成新键并绕过幂等性。

Webhook reliability checklist

Webhook 可靠性检查清单

  • Signature verification BEFORE parsing payload
  • Dedupe by event ID, not event type
  • Process inside a DB transaction
  • Return 2xx only after persistence commits
  • Return 5xx on transient failures (provider retries with backoff)
  • Don't trust arrival order (use event sequence / version)
  • Cap processing time (Stripe times out at 30s; queue async if longer)
  • 在解析载荷前验证签名
  • 按 event ID 去重,而不是按 event type
  • 在 DB 事务中处理
  • 只有在持久化提交后才返回 2xx
  • 发生瞬时故障时返回 5xx(提供商会采用退避策略重试)
  • 不要依赖到达顺序(使用 event 序列或版本)
  • 限制处理时长(Stripe 会在 30 秒后超时;处理时间更长时应放入队列异步执行)

Stripe-specific quirks

Stripe 特有的注意事项

  • Idempotency-Key header is finite-lifetime (24h). Past that, retries with same key may create new intents.
  • Webhook signatures use timestamped HMAC; replay attacks need both signature + recent timestamp
  • charge.succeeded
    and
    payment_intent.succeeded
    are different — for PaymentIntents flow, use the latter
  • requires_action
    status often means 3DS challenge needed (not always — bank can require auth without 3DS)
  • Refund metadata is separate from charge metadata; set it explicitly on the refund
  • Idempotency-Key 请求头的有效期有限(24 小时)。超过该期限后,使用同一个键重试可能会创建新的 intent。
  • Webhook 签名使用带时间戳的 HMAC;抵御重放攻击需要同时具备签名和近期时间戳
  • charge.succeeded
    和
    payment_intent.succeeded
    并不相同——对于 PaymentIntents 流程,应使用后者
  • requires_action
    状态通常表示需要进行 3DS 验证(但并非总是如此——银行可能在不使用 3DS 的情况下要求身份验证)
  • 退款 metadata 与扣款 metadata 相互独立;应在退款上显式设置 metadata

Adyen-specific quirks

Adyen 特有的注意事项

  • Notifications (webhooks) require HMAC signature verification with a different algorithm than Stripe
  • Adyen uses
    paymentMethod
    (with a stored token) where Stripe uses
    payment_method
  • Adyen's
    Authorisation
    event is the equivalent of Stripe's
    payment_intent.succeeded
  • 3DS is handled differently — Adyen's
    redirectUrl
    flow vs. Stripe's
    client_secret
  • 通知(Webhook)需要使用与 Stripe 不同的算法进行 HMAC 签名验证
  • Adyen 使用
    paymentMethod
    (配合已存储的 token),而 Stripe 使用
    payment_method
  • Adyen 的
    Authorisation
    事件相当于 Stripe 的
    payment_intent.succeeded
  • 3DS 的处理方式不同——Adyen 使用
    redirectUrl
    流程,而 Stripe 使用
    client_secret

PayPal-specific quirks

PayPal 特有的注意事项

  • Webhook events are PayPal-Verification-Status header + IPN (legacy) or Webhook signatures (modern); pick one
  • PayPal uses BillingAgreement for recurring; not directly comparable to Stripe Subscriptions
  • Disputes go through PayPal's Resolution Center, not the bank chargeback flow
  • Webhook 事件可使用 PayPal-Verification-Status 请求头 + IPN(旧版)或 Webhook 签名(现代版)进行验证;选择一种方式
  • PayPal 使用 BillingAgreement 处理循环扣款;不能直接与 Stripe Subscriptions 比较
  • 争议通过 PayPal 的 Resolution Center 处理,而不是银行的拒付流程

Refund + chargeback decision tree

退款与拒付决策树

Customer wants money back. Did they reach you, or their bank?

Reached you → REFUND
  Initiated by merchant via API. Money returns to the customer's
  payment method. Fast (1-3 business days). Merchant chooses
  full vs. partial.

Reached their bank → CHARGEBACK
  Initiated by issuer. Merchant must respond with evidence.
  Money is held during dispute. Merchant can win (chargeback
  reversed) or lose (money goes back to customer + provider fee).
  Slow (15-90 days).
For minor issues, offer refund proactively. Chargebacks have fee + reputation cost.
Customer wants money back. Did they reach you, or their bank?

Reached you → REFUND
  Initiated by merchant via API. Money returns to the customer's
  payment method. Fast (1-3 business days). Merchant chooses
  full vs. partial.

Reached their bank → CHARGEBACK
  Initiated by issuer. Merchant must respond with evidence.
  Money is held during dispute. Merchant can win (chargeback
  reversed) or lose (money goes back to customer + provider fee).
  Slow (15-90 days).
对于轻微问题,应主动提供退款。拒付会产生费用和信誉成本。

Currency handling

货币处理

RuleWhy
Integer minor units alwaysFloats accumulate rounding error
Zero-decimal currencies (JPY, KRW, VND, IDR) are just integersThe API expects raw integer, not divided
Provider amounts are in the smallest unitStripe's "amount: 100" = $1.00 (US) or ¥100 (JP)
Snapshot FX rates at authorization timeThe bank may settle at a different rate; ledger must record both
Multi-currency requires per-currency balance trackingDon't aggregate $100 + 100€
规则原因
始终使用整数最小货币单位浮点数会累积舍入误差
零小数货币(JPY、KRW、VND、IDR)直接使用整数API 期望原始整数,而不是除以 100 后的值
提供商金额使用最小货币单位Stripe 的
"amount: 100"
= $1.00(美国)或 ¥100(日本)
在授权时记录 FX 汇率快照银行可能按不同汇率结算;账本必须同时记录两者
多币种需要分别跟踪各币种余额不要将 $100 + 100€ 汇总在一起

PCI scope minimization

最小化 PCI 范围

PatternPCI scope
Stripe Elements client-side, server only sees PaymentMethod tokensSAQ-A (lightest)
Server proxies card data to providerSAQ-D (full audit)
Server stores raw PANFull PCI scope (very expensive audit)
Server stores CVV/CVCForbidden (PCI DSS Requirement 3.2)
The cleanest design: never let raw card data touch your servers.
模式PCI 范围
客户端使用 Stripe Elements,服务端只能看到 PaymentMethod tokenSAQ-A(最轻量)
服务端将卡数据代理给提供商SAQ-D(完整审计)
服务端存储原始 PAN完整 PCI 范围(审计成本极高)
服务端存储 CVV/CVC禁止(PCI DSS Requirement 3.2)
最简洁的方案是:绝不让原始卡数据接触你的服务器。

State machine: PaymentIntent (Stripe)

状态机:PaymentIntent(Stripe)

requires_payment_method
    ↓ (attach payment method)
requires_confirmation
    ↓ (confirm)
requires_action (3DS challenge)  ←→  requires_payment_method (failed)
    ↓ (challenge complete)
processing
    ↓ (settled)
succeeded                          ←   processing (failure)
                                        ↓
                                   requires_payment_method
Webhook events fire at each transition. Persist the state in your ledger.
requires_payment_method
    ↓ (attach payment method)
requires_confirmation
    ↓ (confirm)
requires_action (3DS challenge)  ←→  requires_payment_method (failed)
    ↓ (challenge complete)
processing
    ↓ (settled)
succeeded                          ←   processing (failure)
                                        ↓
                                   requires_payment_method
每次状态转换都会触发 Webhook 事件。将状态持久化到你的账本中。

Common mistakes catalog

常见错误目录

"Customer charged twice"

“客户被重复扣款”

Almost always idempotency. Three sub-causes:
  1. Client-side: retried without preserving idempotency key
  2. Server-side: idempotency check happens AFTER provider call (race window)
  3. Webhook-side: same event ID processed twice (no dedupe)
几乎总是幂等性问题。三个子原因:
  1. 客户端:重试时没有保留幂等键
  2. 服务端:幂等检查发生在提供商调用之后(存在竞态窗口)
  3. Webhook:同一个 event ID 被处理了两次(未去重)

"Webhook never arrives"

“Webhook 从未到达”

  • Webhook URL misconfigured in provider dashboard
  • Endpoint returns 5xx → provider gives up after retry-tail
  • Signature verification rejects valid webhooks (wrong secret)
  • Webhook handler is asynchronous and crashes before returning 200
  • 提供商控制台中的 Webhook URL 配置错误
  • 端点返回 5xx → 提供商在耗尽重试后放弃
  • 签名验证拒绝了有效 Webhook(secret 错误)
  • Webhook 处理器采用异步方式,并在返回 200 前崩溃

"Refund didn't go through"

“退款未成功”

  • Refund window expired (Stripe: 180 days from charge)
  • Refund amount > original charge amount
  • Original charge wasn't fully captured (auth-only)
  • Payment method is invalid (bank closed account)
  • 退款窗口已过期(Stripe:自扣款起 180 天)
  • 退款金额大于原始扣款金额
  • 原始扣款未完全完成 capture(仅进行了授权)
  • 支付方式无效(银行账户已关闭)

"Chargeback lost"

“拒付败诉”

  • Dispute response not filed within window (varies: 7-21 days)
  • Evidence package incomplete (Stripe expects specific evidence per dispute reason)
  • The customer's reason was "fraudulent" — these are hard to win
  • 未在规定窗口内提交争议响应(因渠道而异:7–21 天)
  • 证据材料不完整(Stripe 会根据争议原因要求提供特定证据)
  • 客户选择的原因是“欺诈”——此类争议很难胜诉

"Multi-currency settlement is off"

“多币种结算有误”

  • FX rate at authorization differs from settlement (banks set their own conversion timing)
  • Fees not accounted for (Stripe takes fees in the settlement currency, not source)
  • Rounding differences accumulate across many transactions
  • 授权时与结算时的 FX 汇率不同(银行自行决定转换时间)
  • 未计入手续费(Stripe 按结算币种收取费用,而非源币种)
  • 大量交易中累积舍入差异

Core Patterns

核心模式

Domain-specific patterns for payment gateway integration, idempotent payment handling, 3DS2, webhook processing, and payment reconciliation.
支付网关集成、幂等支付处理、3DS2、Webhook 处理和支付对账的领域专用模式。

Pattern: Idempotent Payment Creation

模式:幂等支付创建

typescript
// Every charge creation must have an idempotency key
// Key must be deterministic from the business operation - not random
// Random key = if client retries with new random key, you get two charges

function generatePaymentIdempotencyKey(orderId: string, attempt: number = 0): string {
  // Include order ID (makes it deterministic per order)
  // Include attempt number if you want to allow intentional retries
  return `order-${orderId}-attempt-${attempt}`;
}

// Store idempotency result to handle within-application deduplication
interface IdempotencyRecord {
  key: string;
  requestHash: string;   // Hash of the request body
  responseStatus: number;
  responseBody: string;
  createdAt: Date;
  expiresAt: Date;       // After this, key is no longer valid (Stripe: 24h)
}

async function createPaymentWithIdempotency(
  params: PaymentParams,
  idempotencyKey: string
): Promise<PaymentResult> {
  // Check if we've already processed this key
  const existing = await db.idempotencyRecord.findUnique({ where: { key: idempotencyKey } });
  if (existing) {
    return JSON.parse(existing.responseBody); // Return cached result
  }

  const result = await stripe.paymentIntents.create(params, { idempotencyKey });

  await db.idempotencyRecord.create({
    data: {
      key: idempotencyKey,
      requestHash: hashObject(params),
      responseStatus: 200,
      responseBody: JSON.stringify(result),
      createdAt: new Date(),
      expiresAt: addHours(new Date(), 24),
    },
  });

  return result;
}
typescript
// Every charge creation must have an idempotency key
// Key must be deterministic from the business operation - not random
// Random key = if client retries with new random key, you get two charges

function generatePaymentIdempotencyKey(orderId: string, attempt: number = 0): string {
  // Include order ID (makes it deterministic per order)
  // Include attempt number if you want to allow intentional retries
  return `order-${orderId}-attempt-${attempt}`;
}

// Store idempotency result to handle within-application deduplication
interface IdempotencyRecord {
  key: string;
  requestHash: string;   // Hash of the request body
  responseStatus: number;
  responseBody: string;
  createdAt: Date;
  expiresAt: Date;       // After this, key is no longer valid (Stripe: 24h)
}

async function createPaymentWithIdempotency(
  params: PaymentParams,
  idempotencyKey: string
): Promise<PaymentResult> {
  // Check if we've already processed this key
  const existing = await db.idempotencyRecord.findUnique({ where: { key: idempotencyKey } });
  if (existing) {
    return JSON.parse(existing.responseBody); // Return cached result
  }

  const result = await stripe.paymentIntents.create(params, { idempotencyKey });

  await db.idempotencyRecord.create({
    data: {
      key: idempotencyKey,
      requestHash: hashObject(params),
      responseStatus: 200,
      responseBody: JSON.stringify(result),
      createdAt: new Date(),
      expiresAt: addHours(new Date(), 24),
    },
  });

  return result;
}

Pattern: Webhook Event Processing with Idempotency

模式:带幂等性的 Webhook 事件处理

typescript
// Stripe sends webhooks; events can be delivered more than once
app.post('/webhooks/stripe', express.raw({ type: 'application/json' }), async (req, res) => {
  // 1. Verify signature FIRST with raw body (before any parsing)
  let event: Stripe.Event;
  try {
    event = stripe.webhooks.constructEvent(
      req.body,                           // MUST be raw Buffer, not parsed JSON
      req.headers['stripe-signature']!,
      process.env.STRIPE_WEBHOOK_SECRET!
    );
  } catch (err) {
    return res.status(400).send(`Webhook Error: ${err.message}`);
  }

  // 2. Acknowledge immediately - don't hold up Stripe's delivery
  res.sendStatus(200);

  // 3. Deduplicate: check if we've already processed this event
  const processed = await db.webhookEvent.findUnique({ where: { stripeEventId: event.id } });
  if (processed) return; // Idempotent - already handled

  // 4. Store event before processing (in case processing crashes)
  await db.webhookEvent.create({
    data: {
      stripeEventId: event.id,
      type: event.type,
      payload: JSON.stringify(event),
      processedAt: null,
    },
  });

  // 5. Process asynchronously via queue (don't process inline)
  await queue.enqueue('process-stripe-event', { eventId: event.id });
});

// Webhook event processor (runs from queue)
async function processStripeEvent(eventId: string): Promise<void> {
  const record = await db.webhookEvent.findUnique({ where: { stripeEventId: eventId } });
  const event = JSON.parse(record.payload) as Stripe.Event;

  switch (event.type) {
    case 'payment_intent.succeeded':
      await fulfillOrder((event.data.object as Stripe.PaymentIntent).metadata.orderId);
      break;

    case 'charge.dispute.created':
      await alertDisputeTeam((event.data.object as Stripe.Dispute).id);
      break;

    case 'invoice.payment_failed':
      await triggerDunning((event.data.object as Stripe.Invoice).subscription as string);
      break;
  }

  await db.webhookEvent.update({
    where: { stripeEventId: eventId },
    data: { processedAt: new Date() },
  });
}
typescript
// Stripe sends webhooks; events can be delivered more than once
app.post('/webhooks/stripe', express.raw({ type: 'application/json' }), async (req, res) => {
  // 1. Verify signature FIRST with raw body (before any parsing)
  let event: Stripe.Event;
  try {
    event = stripe.webhooks.constructEvent(
      req.body,                           // MUST be raw Buffer, not parsed JSON
      req.headers['stripe-signature']!,
      process.env.STRIPE_WEBHOOK_SECRET!
    );
  } catch (err) {
    return res.status(400).send(`Webhook Error: ${err.message}`);
  }

  // 2. Acknowledge immediately - don't hold up Stripe's delivery
  res.sendStatus(200);

  // 3. Deduplicate: check if we've already processed this event
  const processed = await db.webhookEvent.findUnique({ where: { stripeEventId: event.id } });
  if (processed) return; // Idempotent - already handled

  // 4. Store event before processing (in case processing crashes)
  await db.webhookEvent.create({
    data: {
      stripeEventId: event.id,
      type: event.type,
      payload: JSON.stringify(event),
      processedAt: null,
    },
  });

  // 5. Process asynchronously via queue (don't process inline)
  await queue.enqueue('process-stripe-event', { eventId: event.id });
});

// Webhook event processor (runs from queue)
async function processStripeEvent(eventId: string): Promise<void> {
  const record = await db.webhookEvent.findUnique({ where: { stripeEventId: eventId } });
  const event = JSON.parse(record.payload) as Stripe.Event;

  switch (event.type) {
    case 'payment_intent.succeeded':
      await fulfillOrder((event.data.object as Stripe.PaymentIntent).metadata.orderId);
      break;

    case 'charge.dispute.created':
      await alertDisputeTeam((event.data.object as Stripe.Dispute).id);
      break;

    case 'invoice.payment_failed':
      await triggerDunning((event.data.object as Stripe.Invoice).subscription as string);
      break;
  }

  await db.webhookEvent.update({
    where: { stripeEventId: eventId },
    data: { processedAt: new Date() },
  });
}

Pattern: 3DS2 with SCA Exemption Handling

模式:包含 SCA 豁免处理的 3DS2

typescript
// Stripe PaymentIntents handles 3DS2 automatically when you use PaymentElement
// For recurring charges (MIT), pass prior transaction reference

// Initial subscription charge (SCA required)
const setupIntent = await stripe.setupIntents.create({
  customer: customerId,
  payment_method_types: ['card'],
  usage: 'off_session',  // Signals this will be used for MIT
  metadata: { subscriptionId },
});

// After user confirms setup intent and card is verified...
// Store: setupIntent.payment_method

// Subsequent MIT charges (no user present)
const recurringPayment = await stripe.paymentIntents.create({
  amount: subscriptionAmount,
  currency: 'usd',
  customer: customerId,
  payment_method: storedPaymentMethodId,
  off_session: true,   // MIT - no user present
  confirm: true,
  // Stripe includes the MIT exemption and network transaction reference automatically
}, { idempotencyKey: `sub-${subscriptionId}-${billingPeriod}` });
typescript
// Stripe PaymentIntents handles 3DS2 automatically when you use PaymentElement
// For recurring charges (MIT), pass prior transaction reference

// Initial subscription charge (SCA required)
const setupIntent = await stripe.setupIntents.create({
  customer: customerId,
  payment_method_types: ['card'],
  usage: 'off_session',  // Signals this will be used for MIT
  metadata: { subscriptionId },
});

// After user confirms setup intent and card is verified...
// Store: setupIntent.payment_method

// Subsequent MIT charges (no user present)
const recurringPayment = await stripe.paymentIntents.create({
  amount: subscriptionAmount,
  currency: 'usd',
  customer: customerId,
  payment_method: storedPaymentMethodId,
  off_session: true,   // MIT - no user present
  confirm: true,
  // Stripe includes the MIT exemption and network transaction reference automatically
}, { idempotencyKey: `sub-${subscriptionId}-${billingPeriod}` });

Pattern: Dunning for Failed Recurring Charges

模式:失败续费扣款的 Dunning 重试

typescript
const DUNNING_SCHEDULE_DAYS = [1, 3, 7, 14]; // Days to retry after initial failure

async function handleFailedRecurringCharge(subscriptionId: string): Promise<void> {
  const subscription = await db.subscription.findUnique({
    where: { id: subscriptionId },
    include: { dunningState: true },
  });

  const attemptNumber = subscription.dunningState?.attemptCount ?? 0;

  if (attemptNumber >= DUNNING_SCHEDULE_DAYS.length) {
    // Exhausted all retries - cancel subscription
    await cancelSubscriptionForNonPayment(subscriptionId);
    await sendFinalCancellationEmail(subscription.userId);
    return;
  }

  const retryDate = addDays(new Date(), DUNNING_SCHEDULE_DAYS[attemptNumber]);

  await db.dunningState.upsert({
    where: { subscriptionId },
    create: { subscriptionId, attemptCount: 1, nextRetryAt: retryDate },
    update: { attemptCount: { increment: 1 }, nextRetryAt: retryDate },
  });

  await sendPaymentFailedEmail(subscription.userId, { retryDate, attemptNumber });
  await scheduleJob('retry-payment', { subscriptionId }, { runAt: retryDate });
}
typescript
const DUNNING_SCHEDULE_DAYS = [1, 3, 7, 14]; // Days to retry after initial failure

async function handleFailedRecurringCharge(subscriptionId: string): Promise<void> {
  const subscription = await db.subscription.findUnique({
    where: { id: subscriptionId },
    include: { dunningState: true },
  });

  const attemptNumber = subscription.dunningState?.attemptCount ?? 0;

  if (attemptNumber >= DUNNING_SCHEDULE_DAYS.length) {
    // Exhausted all retries - cancel subscription
    await cancelSubscriptionForNonPayment(subscriptionId);
    await sendFinalCancellationEmail(subscription.userId);
    return;
  }

  const retryDate = addDays(new Date(), DUNNING_SCHEDULE_DAYS[attemptNumber]);

  await db.dunningState.upsert({
    where: { subscriptionId },
    create: { subscriptionId, attemptCount: 1, nextRetryAt: retryDate },
    update: { attemptCount: { increment: 1 }, nextRetryAt: retryDate },
  });

  await sendPaymentFailedEmail(subscription.userId, { retryDate, attemptNumber });
  await scheduleJob('retry-payment', { subscriptionId }, { runAt: retryDate });
}

Anti-Patterns

反模式

Anti-Pattern: Fulfilling Order from Frontend Redirect

反模式:从前端重定向触发订单履约

typescript
// WRONG: Rely on frontend redirect to fulfill order
// The user can close the browser before the redirect completes
// Or the redirect URL can be manipulated
app.get('/payment/success', async (req, res) => {
  const { payment_intent } = req.query;
  await fulfillOrder(payment_intent); // Unreliable! Can be missed or forged
});

// RIGHT: Fulfill from webhook only
// The frontend redirect just shows success UI
// Fulfillment happens when 'payment_intent.succeeded' webhook is received
app.get('/payment/success', async (req, res) => {
  res.json({ status: 'pending', message: 'Order will be confirmed shortly' });
  // Actual fulfillment happens via webhook
});
typescript
// WRONG: Rely on frontend redirect to fulfill order
// The user can close the browser before the redirect completes
// Or the redirect URL can be manipulated
app.get('/payment/success', async (req, res) => {
  const { payment_intent } = req.query;
  await fulfillOrder(payment_intent); // Unreliable! Can be missed or forged
});

// RIGHT: Fulfill from webhook only
// The frontend redirect just shows success UI
// Fulfillment happens when 'payment_intent.succeeded' webhook is received
app.get('/payment/success', async (req, res) => {
  res.json({ status: 'pending', message: 'Order will be confirmed shortly' });
  // Actual fulfillment happens via webhook
});

Anti-Pattern: No Webhook Signature Verification

反模式:不验证 Webhook 签名

typescript
// WRONG: Trust webhook payload without signature verification
app.post('/webhooks/stripe', async (req, res) => {
  const event = req.body; // Anyone can POST fake events to this endpoint
  await fulfillOrder(event.data.object.metadata.orderId);
});
typescript
// WRONG: Trust webhook payload without signature verification
app.post('/webhooks/stripe', async (req, res) => {
  const event = req.body; // Anyone can POST fake events to this endpoint
  await fulfillOrder(event.data.object.metadata.orderId);
});

Anti-Pattern: Synchronous Payment Processing in Request Handler

反模式:在请求处理器中同步执行支付处理

Long-running payment operations (settlement, complex routing) should not run synchronously in a web request handler. Use a job queue. This prevents timeouts, allows retries, and enables observability.
耗时较长的支付操作(结算、复杂路由)不应在 Web 请求处理器中同步运行。应使用作业队列。这样可以防止超时、支持重试并提升可观测性。

References

参考资料

Cross-references

交叉引用

  • ledger-design
    — for persisting payment events
  • fraud-detection
    — for pre-payment screening
  • reconciliation
    — for daily balance verification
  • regulatory-compliance
    — for PCI DSS, PSD2, SCA
  • financial-security
    — for PCI scope + encryption
  • ledger-design
    — 用于持久化支付事件
  • fraud-detection
    — 用于支付前筛查
  • reconciliation
    — 用于每日余额核验
  • regulatory-compliance
    — 用于 PCI DSS、PSD2、SCA
  • financial-security
    — 用于 PCI 范围与加密