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的场景:
- 越南市场(越南盾结算)
- 银行转账自动化
- VietQR/NAPAS支付
- 本地支付方式
- 银行账户实时监控
选择Polar的场景:
- 全球SaaS产品
- 订阅管理
- 基于使用量的计费
- 权益自动发放(GitHub、Discord、许可证)
- Merchant of Record(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:
- Merchant of Record(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.
在实施支付集成时:
- 根据需求选择平台(越南本地 vs 全球、支付类型)
- 按需逐步查阅参考文档
- 使用平台专属方式完成认证配置
- 根据业务模型设置产品与定价
- 实现结账流程(托管式、嵌入式或API驱动)
- 配置Webhook并完成验证
- 处理支付事件(成功、失败、退款)
- 在沙箱环境完成全面测试后再上线生产环境
- 使用平台分析工具进行监控与优化
仅加载当前实施步骤所需的参考文档,以保持上下文效率。