payment-integration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePayment 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的场景:
- 越南市场(越南盾VND结算)
- 银行转账自动化
- VietQR/NAPAS支付
- 本土支付方式
- 银行账户直接监控
选择Polar的场景:
- 全球SaaS产品
- 订阅管理
- 基于使用量的计费
- 自动化权益发放(GitHub、Discord、许可证)
- 收款方(MoR,税务合规)
- 数字产品销售
Quick Reference
快速参考
SePay Integration
SePay集成
- Overview & Auth: - Platform capabilities, API/OAuth2 auth, supported banks
references/sepay/overview.md - API Reference: - Endpoints, transactions, bank accounts, virtual accounts
references/sepay/api.md - Webhooks: - Setup, payload structure, verification, retry logic
references/sepay/webhooks.md - SDK Usage: - Node.js, PHP, Laravel implementations
references/sepay/sdk.md - QR Codes: - VietQR generation, templates, integration
references/sepay/qr-codes.md - Best Practices: - Security, patterns, monitoring
references/sepay/best-practices.md
- 概述与身份验证:- 平台功能、API/OAuth2身份验证、支持的银行
references/sepay/overview.md - API参考:- 接口端点、交易、银行账户、虚拟账户
references/sepay/api.md - Webhook:- 配置、负载结构、验证、重试逻辑
references/sepay/webhooks.md - SDK使用:- Node.js、PHP、Laravel实现示例
references/sepay/sdk.md - 二维码:- VietQR生成、模板、集成方式
references/sepay/qr-codes.md - 最佳实践:- 安全、模式、监控
references/sepay/best-practices.md
Polar Integration
Polar集成
- Overview & Auth: - Platform capabilities, authentication methods, MoR concept
references/polar/overview.md - Products & Pricing: - Product types, pricing models, usage-based billing
references/polar/products.md - Checkouts: - Checkout flows, embedded checkout, links
references/polar/checkouts.md - Subscriptions: - Lifecycle, upgrades, downgrades, trials
references/polar/subscriptions.md - Webhooks: - Event types, signature verification, monitoring
references/polar/webhooks.md - Benefits: - Automated delivery (GitHub, Discord, licenses, files)
references/polar/benefits.md - SDK Usage: - TypeScript, Python, PHP, Go, framework adapters
references/polar/sdk.md - Best Practices: - Security, patterns, monitoring
references/polar/best-practices.md
- 概述与身份验证:- 平台功能、身份验证方式、MoR概念
references/polar/overview.md - 产品与定价:- 产品类型、定价模型、基于使用量的计费
references/polar/products.md - 结账流程:- 结账流程、嵌入式结账、结账链接
references/polar/checkouts.md - 订阅管理:- 订阅生命周期、升级、降级、试用
references/polar/subscriptions.md - Webhook:- 事件类型、签名验证、监控
references/polar/webhooks.md - 权益发放:- 自动化发放(GitHub、Discord、许可证、文件)
references/polar/benefits.md - SDK使用:- TypeScript、Python、PHP、Go、框架适配
references/polar/sdk.md - 最佳实践:- 安全、模式、监控
references/polar/best-practices.md
Integration Scripts
集成脚本
- SePay Webhook Verification: - Verify SePay webhook authenticity
scripts/sepay-webhook-verify.js - Polar Webhook Verification: - Verify Polar webhook signatures
scripts/polar-webhook-verify.js - Checkout Helper: - Generate checkout sessions for both platforms
scripts/checkout-helper.js
- SePay Webhook验证:- 验证SePay Webhook的真实性
scripts/sepay-webhook-verify.js - Polar Webhook验证:- 验证Polar Webhook签名
scripts/polar-webhook-verify.js - 结账辅助工具:- 为两个平台生成结账会话
scripts/checkout-helper.js
Implementation Workflow
实施流程
SePay Implementation
SePay实施步骤
- Load for auth setup
references/sepay/overview.md - Load or
references/sepay/api.mdfor integrationreferences/sepay/sdk.md - Load for payment notifications
references/sepay/webhooks.md - Use for webhook verification
scripts/sepay-webhook-verify.js - Load for production readiness
references/sepay/best-practices.md
- 加载完成身份验证配置
references/sepay/overview.md - 加载或
references/sepay/api.md进行集成开发references/sepay/sdk.md - 加载配置支付通知
references/sepay/webhooks.md - 使用进行Webhook验证
scripts/sepay-webhook-verify.js - 加载确保生产环境就绪
references/sepay/best-practices.md
Polar Implementation
Polar实施步骤
- Load for auth and concepts
references/polar/overview.md - Load for product setup
references/polar/products.md - Load for payment flows
references/polar/checkouts.md - Load for event handling
references/polar/webhooks.md - Use for webhook verification
scripts/polar-webhook-verify.js - Load if automating delivery
references/polar/benefits.md - Load for production readiness
references/polar/best-practices.md
- 加载了解身份验证和核心概念
references/polar/overview.md - 加载完成产品配置
references/polar/products.md - 加载实现支付流程
references/polar/checkouts.md - 加载处理事件通知
references/polar/webhooks.md - 使用进行Webhook验证
scripts/polar-webhook-verify.js - 若需自动化权益发放,加载
references/polar/benefits.md - 加载确保生产环境就绪
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核心功能:
- 收款方MoR(全球税务合规)
- 订阅生命周期管理
- 基于使用量的计费(事件、计量)
- 自动化权益发放(GitHub、Discord、许可证)
- 客户门户(自助服务)
- 多语言SDK
- 速率限制:300次请求/分钟
Instructions
实施指南
When implementing payment integration:
- Identify platform based on requirements (Vietnamese vs global, payment types)
- Load relevant references progressively as needed
- Implement authentication using platform-specific methods
- Set up products/pricing according to business model
- Implement checkout flow (hosted, embedded, or API-driven)
- Configure webhooks with proper verification
- Handle payment events (success, failure, refund)
- Test thoroughly in sandbox before production
- Monitor and optimize using platform analytics
Load only the references needed for current implementation step to maintain context efficiency.
实施支付集成时:
- 选择平台:根据需求(越南本地/全球、支付类型)选择合适的平台
- 按需加载参考文档:逐步加载所需的参考文档
- 实现身份验证:使用平台专属的身份验证方式
- 配置产品与定价:根据业务模型设置产品和定价
- 实现结账流程(托管式、嵌入式或API驱动)
- 配置Webhook并设置正确的验证机制
- 处理支付事件(成功、失败、退款)
- 全面测试:在沙箱环境中完成全面测试后再上线生产环境
- 监控与优化:利用平台分析工具进行监控和优化
仅加载当前实施步骤所需的参考文档,以保持上下文效率。