payment-integration

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Payment Integration

支付集成

Implement payment processing with SePay (Vietnamese payments) and Polar (global SaaS monetization).
基于SePay(越南本地支付)和Polar(全球SaaS变现)实现支付处理功能。

When to Use

适用场景

Use when implementing:
  • Payment gateway integration (checkout, processing)
  • Subscription management (trials, upgrades, billing)
  • Webhook handling (payment notifications)
  • QR code payments (VietQR, NAPAS)
  • Usage-based billing (metering, credits)
  • Automated benefit delivery (licenses, GitHub access, Discord roles)
  • Customer portals (self-service management)
  • Bank transfer automation (Vietnamese banks)
  • Product catalogs with pricing
在以下场景中使用:
  • 支付网关集成(结账、支付处理)
  • 订阅管理(试用、升级、计费)
  • Webhook处理(支付通知)
  • 二维码支付(VietQR、NAPAS)
  • 基于使用量的计费(计量、额度)
  • 权益自动发放(许可证、GitHub访问权限、Discord角色)
  • 客户门户(自助管理)
  • 银行转账自动化(越南本地银行)
  • 带定价的产品目录

Platform Selection

平台选择

Choose SePay for:
  • Vietnamese market (VND currency)
  • Bank transfer automation
  • VietQR/NAPAS payments
  • Local payment methods
  • Direct bank account monitoring
Choose Polar for:
  • Global SaaS products
  • Subscription management
  • Usage-based billing
  • Automated benefits (GitHub, Discord, licenses)
  • Merchant of Record (tax compliance)
  • Digital product sales
选择SePay的场景:
  • 越南市场(越南盾结算)
  • 银行转账自动化
  • VietQR/NAPAS支付
  • 本地支付方式
  • 银行账户实时监控
选择Polar的场景:
  • 全球SaaS产品
  • 订阅管理
  • 基于使用量的计费
  • 权益自动发放(GitHub、Discord、许可证)
  • Merchant of Record(MoR,税务合规)
  • 数字产品销售

Quick Reference

快速参考

SePay Integration

SePay集成

  • Overview & Auth:
    references/sepay/overview.md
    - Platform capabilities, API/OAuth2 auth, supported banks
  • API Reference:
    references/sepay/api.md
    - Endpoints, transactions, bank accounts, virtual accounts
  • Webhooks:
    references/sepay/webhooks.md
    - Setup, payload structure, verification, retry logic
  • SDK Usage:
    references/sepay/sdk.md
    - Node.js, PHP, Laravel implementations
  • QR Codes:
    references/sepay/qr-codes.md
    - VietQR generation, templates, integration
  • Best Practices:
    references/sepay/best-practices.md
    - Security, patterns, monitoring
  • 概述与认证
    references/sepay/overview.md
    - 平台能力、API/OAuth2认证、支持的银行列表
  • API参考
    references/sepay/api.md
    - 接口端点、交易管理、银行账户、虚拟账户
  • Webhook
    references/sepay/webhooks.md
    - 配置方法、负载结构、验证机制、重试逻辑
  • SDK使用
    references/sepay/sdk.md
    - Node.js、PHP、Laravel实现示例
  • 二维码
    references/sepay/qr-codes.md
    - VietQR生成、模板、集成方式
  • 最佳实践
    references/sepay/best-practices.md
    - 安全规范、设计模式、监控方案

Polar Integration

Polar集成

  • Overview & Auth:
    references/polar/overview.md
    - Platform capabilities, authentication methods, MoR concept
  • Products & Pricing:
    references/polar/products.md
    - Product types, pricing models, usage-based billing
  • Checkouts:
    references/polar/checkouts.md
    - Checkout flows, embedded checkout, links
  • Subscriptions:
    references/polar/subscriptions.md
    - Lifecycle, upgrades, downgrades, trials
  • Webhooks:
    references/polar/webhooks.md
    - Event types, signature verification, monitoring
  • Benefits:
    references/polar/benefits.md
    - Automated delivery (GitHub, Discord, licenses, files)
  • SDK Usage:
    references/polar/sdk.md
    - TypeScript, Python, PHP, Go, framework adapters
  • Best Practices:
    references/polar/best-practices.md
    - Security, patterns, monitoring
  • 概述与认证
    references/polar/overview.md
    - 平台能力、认证方式、MoR概念说明
  • 产品与定价
    references/polar/products.md
    - 产品类型、定价模型、基于使用量的计费
  • 结账功能
    references/polar/checkouts.md
    - 结账流程、嵌入式结账、结账链接
  • 订阅管理
    references/polar/subscriptions.md
    - 订阅生命周期、升级、降级、试用
  • Webhook
    references/polar/webhooks.md
    - 事件类型、签名验证、监控方案
  • 权益管理
    references/polar/benefits.md
    - 自动发放(GitHub、Discord、许可证、文件)
  • SDK使用
    references/polar/sdk.md
    - TypeScript、Python、PHP、Go、框架适配
  • 最佳实践
    references/polar/best-practices.md
    - 安全规范、设计模式、监控方案

Integration Scripts

集成脚本

  • SePay Webhook Verification:
    scripts/sepay-webhook-verify.js
    - Verify SePay webhook authenticity
  • Polar Webhook Verification:
    scripts/polar-webhook-verify.js
    - Verify Polar webhook signatures
  • Checkout Helper:
    scripts/checkout-helper.js
    - Generate checkout sessions for both platforms
  • SePay Webhook验证
    scripts/sepay-webhook-verify.js
    - 验证SePay Webhook的真实性
  • Polar Webhook验证
    scripts/polar-webhook-verify.js
    - 验证Polar Webhook签名
  • 结账辅助工具
    scripts/checkout-helper.js
    - 为两个平台生成结账会话

Implementation Workflow

实施流程

SePay Implementation

SePay实施步骤

  1. Load
    references/sepay/overview.md
    for auth setup
  2. Load
    references/sepay/api.md
    or
    references/sepay/sdk.md
    for integration
  3. Load
    references/sepay/webhooks.md
    for payment notifications
  4. Use
    scripts/sepay-webhook-verify.js
    for webhook verification
  5. Load
    references/sepay/best-practices.md
    for production readiness
  1. 查阅
    references/sepay/overview.md
    完成认证配置
  2. 查阅
    references/sepay/api.md
    references/sepay/sdk.md
    进行集成开发
  3. 查阅
    references/sepay/webhooks.md
    配置支付通知
  4. 使用
    scripts/sepay-webhook-verify.js
    完成Webhook验证
  5. 查阅
    references/sepay/best-practices.md
    确保生产环境就绪

Polar Implementation

Polar实施步骤

  1. Load
    references/polar/overview.md
    for auth and concepts
  2. Load
    references/polar/products.md
    for product setup
  3. Load
    references/polar/checkouts.md
    for payment flows
  4. Load
    references/polar/webhooks.md
    for event handling
  5. Use
    scripts/polar-webhook-verify.js
    for webhook verification
  6. Load
    references/polar/benefits.md
    if automating delivery
  7. Load
    references/polar/best-practices.md
    for production readiness
  1. 查阅
    references/polar/overview.md
    了解认证机制与核心概念
  2. 查阅
    references/polar/products.md
    完成产品配置
  3. 查阅
    references/polar/checkouts.md
    实现支付流程
  4. 查阅
    references/polar/webhooks.md
    处理事件通知
  5. 使用
    scripts/polar-webhook-verify.js
    完成Webhook验证
  6. 若需自动发放权益,查阅
    references/polar/benefits.md
  7. 查阅
    references/polar/best-practices.md
    确保生产环境就绪

Key Capabilities

核心能力

SePay:
  • Payment gateway (QR, bank transfer, cards)
  • Bank account monitoring with webhooks
  • Order-based virtual accounts
  • VietQR generation API
  • 44+ Vietnamese banks supported
  • Rate limit: 2 calls/second
Polar:
  • Merchant of Record (global tax compliance)
  • Subscription lifecycle management
  • Usage-based billing (events, meters)
  • Automated benefits (GitHub, Discord, licenses)
  • Customer portal (self-service)
  • Multi-language SDKs
  • Rate limit: 300 req/min
SePay:
  • 支付网关(二维码、银行转账、银行卡)
  • 银行账户监控与Webhook通知
  • 基于订单的虚拟账户
  • VietQR生成API
  • 支持44+越南本地银行
  • 速率限制:2次调用/秒
Polar:
  • Merchant of Record(MoR,全球税务合规)
  • 订阅生命周期管理
  • 基于使用量的计费(事件、计量)
  • 权益自动发放(GitHub、Discord、许可证)
  • 客户自助门户
  • 多语言SDK
  • 速率限制:300请求/分钟

Instructions

实施说明

When implementing payment integration:
  1. Identify platform based on requirements (Vietnamese vs global, payment types)
  2. Load relevant references progressively as needed
  3. Implement authentication using platform-specific methods
  4. Set up products/pricing according to business model
  5. Implement checkout flow (hosted, embedded, or API-driven)
  6. Configure webhooks with proper verification
  7. Handle payment events (success, failure, refund)
  8. Test thoroughly in sandbox before production
  9. Monitor and optimize using platform analytics
Load only the references needed for current implementation step to maintain context efficiency.
在实施支付集成时:
  1. 根据需求选择平台(越南本地 vs 全球、支付类型)
  2. 按需逐步查阅参考文档
  3. 使用平台专属方式完成认证配置
  4. 根据业务模型设置产品与定价
  5. 实现结账流程(托管式、嵌入式或API驱动)
  6. 配置Webhook并完成验证
  7. 处理支付事件(成功、失败、退款)
  8. 在沙箱环境完成全面测试后再上线生产环境
  9. 使用平台分析工具进行监控与优化
仅加载当前实施步骤所需的参考文档,以保持上下文效率。