SePay 与 Polar 支付集成
payment-integration
使用 SePay(越南支付网关,支持 VietQR、银行转账、银行卡)和 Polar(全球 SaaS 货币化平台,支持订阅、按用量计费、自动化权益发放)实现支付集成。适用于集成支付处理、实现结账流程、管理订阅、处理 Webhook、处理银行转账、生成二维码、自动化权益发放或构建计费系统。支持身份认证(API 密钥、OAuth2)、产品管理、客户门户、税务合规(Polar 作为 MoR 商户记录方),以及全面的 SDK 集成(Node.js、PHP、Python、Go、Laravel、Next.js)。
- License 许可
- MIT
- 最近更新
- 2025-12-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- payment-integration
- license
- MIT
- version
- 1.0.0
- description
- Implement payment integrations with SePay (Vietnamese payment gateway with VietQR, bank transfers, cards) and Polar (global SaaS monetization platform with subscriptions, usage-based billing, automated benefits). Use when integrating payment processing, implementing checkout flows, managing subscriptions, handling webhooks, processing bank transfers, generating QR codes, automating benefit delivery, or building billing systems. Supports authentication (API keys, OAuth2), product management, customer portals, tax compliance (Polar as MoR), and comprehensive SDK integrations (Node.js, PHP, Python, Go, Laravel, Next.js).
02 资源文件 22
- 参考文档evals/evals.json5.8 KB
- 参考文档README.md5.9 KB
- 参考文档references/polar/benefits.md8.2 KB
- 参考文档references/polar/best-practices.md10.9 KB
- 参考文档references/polar/checkouts.md6.2 KB
- 参考文档references/polar/overview.md4.6 KB
- 参考文档references/polar/products.md5.2 KB
- 参考文档references/polar/sdk.md9.3 KB
- 参考文档references/polar/subscriptions.md7.4 KB
- 参考文档references/polar/webhooks.md8.9 KB
- 参考文档references/sepay/api.md3.2 KB
- 参考文档references/sepay/best-practices.md8.2 KB
- 参考文档references/sepay/overview.md3.5 KB
- 参考文档references/sepay/qr-codes.md5.0 KB
- 参考文档references/sepay/sdk.md4.7 KB
- 参考文档references/sepay/webhooks.md4.6 KB
- 脚本scripts/.env.example619 B
- 脚本scripts/checkout-helper.js7.2 KB
- 脚本scripts/package.json324 B
- 脚本scripts/polar-webhook-verify.js5.5 KB
- 脚本scripts/sepay-webhook-verify.js5.4 KB
- 脚本scripts/test-scripts.js7.5 KB
03 SKILL.md 正文
Payment Integration
Implement payment processing with SePay (Vietnamese payments) and Polar (global SaaS monetization).
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
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
Quick Reference
SePay Integration
- 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
Polar Integration
- 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
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
Implementation Workflow
SePay Implementation
- Load
references/sepay/overview.mdfor auth setup - Load
references/sepay/api.mdorreferences/sepay/sdk.mdfor integration - Load
references/sepay/webhooks.mdfor payment notifications - Use
scripts/sepay-webhook-verify.jsfor webhook verification - Load
references/sepay/best-practices.mdfor production readiness
Polar Implementation
- Load
references/polar/overview.mdfor auth and concepts - Load
references/polar/products.mdfor product setup - Load
references/polar/checkouts.mdfor payment flows - Load
references/polar/webhooks.mdfor event handling - Use
scripts/polar-webhook-verify.jsfor webhook verification - Load
references/polar/benefits.mdif automating delivery - Load
references/polar/best-practices.mdfor production readiness
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
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.
04 同仓库更多 Skills
Next.js 全栈应用开发
web-frameworks
使用 Next.js(App Router、Server Components、RSC、PPR、SSR、SSG、ISR)、Turborepo(monorepo 管理、任务管道、远程缓存、并行执行)和 RemixIcon(3100+ SVG 图标,线性/填充样式)构建现代全栈 Web 应用。适用于创建 React 应用、实现服务端渲染、搭建含多个包的 monorepo、优化构建性能与缓存策略、添加图标库、管理共享依赖,或开发 TypeScript 全栈项目。
UI 界面样式设计与实现
ui-styling
使用 shadcn/ui 组件(基于 Radix UI + Tailwind 构建)、Tailwind CSS 实用工具优先的样式设计以及基于画布的视觉设计,创建美观、无障碍的用户界面。适用于构建用户界面、实现设计系统、创建响应式布局、添加无障碍组件(对话框、下拉菜单、表单、表格)、定制主题与配色、实现深色模式、生成视觉设计和海报,或在各应用间建立一致的样式模式。
Three.js 三维场景开发
threejs
使用 Three.js 构建沉浸式 3D 网页体验——这是一个 WebGL/WebGPU 库,涵盖场景、相机、几何体、材质、灯光、动画、加载器、后处理、着色器(包括基于节点的 TSL)、计算、物理、VR/XR 以及高级渲染。适用于创建 3D 可视化、游戏、交互式图形、数据可视化、产品配置器、建筑漫游或 WebGL/WebGPU 应用程序。涵盖 OrbitControls、GLTF/FBX 加载、PBR 材质、阴影映射、后处理效果(bloom、SSAO、SSR)、自定义着色器、实例化、LOD、动画系统和 WebXR。
结构化分步思考
sequential-thinking
针对需要多步分析、修订能力和假设验证的复杂任务,运用结构化、反思式的问题解决方法。适用于复杂问题分解、自适应规划、需要中途纠偏的分析、范围不明确的问题、多步骤解决方案以及假设驱动的工作。
技术方案调研
research
当你需要调研、分析和规划可扩展、安全且可维护的技术方案时使用。
技术方案规划
planning
当您需要规划可扩展、安全且可维护的技术方案时使用。