payment-integration

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Payment Integration

支付集成

Purpose

用途

Provides expertise in integrating payment gateways and designing PCI-compliant billing systems. Specializes in implementing checkout flows, subscription management, and payment processing with providers like Stripe, PayPal, and Adyen.
提供支付网关集成及符合PCI合规要求的计费系统设计相关专业支持。专注于基于Stripe、PayPal、Adyen等服务商实现结账流程、订阅管理及支付处理功能。

When to Use

适用场景

  • Integrating Stripe, PayPal, or other payment gateways
  • Implementing checkout and payment flows
  • Building subscription billing systems
  • Ensuring PCI-DSS compliance
  • Handling payment webhooks
  • Implementing payment retry logic
  • Setting up multi-currency payments
  • Building invoicing systems
  • 集成Stripe、PayPal或其他支付网关
  • 实现结账与支付流程
  • 构建订阅计费系统
  • 确保符合PCI-DSS合规要求
  • 处理支付Webhook
  • 实现支付重试逻辑
  • 配置多币种支付
  • 构建发票系统

Quick Start

快速入门

Invoke this skill when:
  • Integrating payment gateways (Stripe, PayPal, Adyen)
  • Building checkout or subscription flows
  • Designing PCI-compliant payment systems
  • Implementing webhook handlers for payments
  • Setting up recurring billing
Do NOT invoke when:
  • General ledger/accounting systems → use
    /fintech-engineer
  • API design without payment focus → use
    /api-designer
  • Frontend checkout UI only → use
    /frontend-design
  • Security audit → use
    /security-auditor
在以下场景调用此技能:
  • 集成支付网关(Stripe、PayPal、Adyen)
  • 构建结账或订阅流程
  • 设计符合PCI合规要求的支付系统
  • 实现支付Webhook处理程序
  • 配置定期计费
请勿在以下场景调用:
  • 总账/会计系统 → 使用
    /fintech-engineer
  • 非支付聚焦的API设计 → 使用
    /api-designer
  • 仅前端结账UI → 使用
    /frontend-design
  • 安全审计 → 使用
    /security-auditor

Decision Framework

决策框架

Payment Use Case?
├── One-time Purchase
│   └── Stripe Checkout / PayPal Buttons
├── Subscription
│   └── Stripe Billing / Recurly
├── Marketplace/Split Payments
│   └── Stripe Connect / PayPal Commerce
├── Enterprise/B2B
│   └── Invoicing with NET terms
└── Global Payments
    └── Adyen / Multi-gateway strategy
Payment Use Case?
├── One-time Purchase
│   └── Stripe Checkout / PayPal Buttons
├── Subscription
│   └── Stripe Billing / Recurly
├── Marketplace/Split Payments
│   └── Stripe Connect / PayPal Commerce
├── Enterprise/B2B
│   └── Invoicing with NET terms
└── Global Payments
    └── Adyen / Multi-gateway strategy

Core Workflows

核心工作流

1. Stripe Integration

1. Stripe集成

  1. Set up Stripe account and API keys
  2. Create products and prices
  3. Implement Checkout Session or Elements
  4. Handle payment confirmation
  5. Set up webhook endpoint
  6. Process webhook events (succeeded, failed)
  1. 搭建Stripe账户并获取API密钥
  2. 创建产品与定价
  3. 实现Checkout Session或Elements
  4. 处理支付确认
  5. 配置Webhook端点
  6. 处理Webhook事件(成功、失败)

2. Subscription Billing

2. 订阅计费

  1. Define subscription plans and pricing
  2. Create customer in payment provider
  3. Implement subscription creation flow
  4. Handle trial periods
  5. Manage upgrades/downgrades
  6. Implement dunning for failed payments
  1. 定义订阅方案与定价
  2. 在支付服务商系统中创建客户
  3. 实现订阅创建流程
  4. 处理试用期
  5. 管理订阅升级/降级
  6. 实现失败支付的催缴机制

3. Webhook Handling

3. Webhook处理

  1. Create secure webhook endpoint
  2. Verify webhook signatures
  3. Make handlers idempotent
  4. Process events in order
  5. Handle retry scenarios
  6. Log all webhook events
  1. 创建安全的Webhook端点
  2. 验证Webhook签名
  3. 确保处理程序具备幂等性
  4. 按顺序处理事件
  5. 处理重试场景
  6. 记录所有Webhook事件

Best Practices

最佳实践

  • Never store full card numbers—use tokenization
  • Always verify webhook signatures
  • Implement idempotency for payment operations
  • Use test mode thoroughly before production
  • Handle all payment states (pending, succeeded, failed)
  • Store payment provider IDs for reconciliation
  • 切勿存储完整卡号——使用令牌化技术
  • 始终验证Webhook签名
  • 为支付操作实现幂等性
  • 上线前充分使用测试环境
  • 处理所有支付状态(待处理、成功、失败)
  • 存储支付服务商ID用于对账

Anti-Patterns

反模式

Anti-PatternProblemCorrect Approach
Storing card numbersPCI violationUse tokenization
No webhook verificationSecurity riskVerify signatures
Synchronous payment onlyPoor UX, timeoutsAsync with webhooks
Missing idempotencyDuplicate chargesIdempotency keys
No retry logicLost revenueImplement dunning
反模式问题正确做法
存储卡号违反PCI合规要求使用令牌化技术
未验证Webhook签名安全风险验证签名
仅支持同步支付用户体验差、易超时结合Webhook实现异步处理
未实现幂等性重复扣费使用幂等键
无重试逻辑收入损失实现催缴机制