AGENT SKILL

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

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

  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

Polar Implementation

  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

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:

  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.

04 同仓库更多 Skills

hungtrandigital
hungtrandigital/ResidentOne

Next.js 全栈应用开发

web-frameworks

使用 Next.js(App Router、Server Components、RSC、PPR、SSR、SSG、ISR)、Turborepo(monorepo 管理、任务管道、远程缓存、并行执行)和 RemixIcon(3100+ SVG 图标,线性/填充样式)构建现代全栈 Web 应用。适用于创建 React 应用、实现服务端渲染、搭建含多个包的 monorepo、优化构建性能与缓存策略、添加图标库、管理共享依赖,或开发 TypeScript 全栈项目。

软件开发工程师前端开发与界面实现
★ 0
hungtrandigital
hungtrandigital/ResidentOne

UI 界面样式设计与实现

ui-styling

使用 shadcn/ui 组件(基于 Radix UI + Tailwind 构建)、Tailwind CSS 实用工具优先的样式设计以及基于画布的视觉设计,创建美观、无障碍的用户界面。适用于构建用户界面、实现设计系统、创建响应式布局、添加无障碍组件(对话框、下拉菜单、表单、表格)、定制主题与配色、实现深色模式、生成视觉设计和海报,或在各应用间建立一致的样式模式。

界面设计师前端开发与界面实现
★ 0
hungtrandigital
hungtrandigital/ResidentOne

Three.js 三维场景开发

threejs

使用 Three.js 构建沉浸式 3D 网页体验——这是一个 WebGL/WebGPU 库,涵盖场景、相机、几何体、材质、灯光、动画、加载器、后处理、着色器(包括基于节点的 TSL)、计算、物理、VR/XR 以及高级渲染。适用于创建 3D 可视化、游戏、交互式图形、数据可视化、产品配置器、建筑漫游或 WebGL/WebGPU 应用程序。涵盖 OrbitControls、GLTF/FBX 加载、PBR 材质、阴影映射、后处理效果(bloom、SSAO、SSR)、自定义着色器、实例化、LOD、动画系统和 WebXR。

软件开发工程师前端开发与界面实现
★ 0
hungtrandigital
hungtrandigital/ResidentOne

结构化分步思考

sequential-thinking

针对需要多步分析、修订能力和假设验证的复杂任务,运用结构化、反思式的问题解决方法。适用于复杂问题分解、自适应规划、需要中途纠偏的分析、范围不明确的问题、多步骤解决方案以及假设驱动的工作。

软件开发工程师任务规划与分解
★ 0
hungtrandigital
hungtrandigital/ResidentOne

技术方案调研

research

当你需要调研、分析和规划可扩展、安全且可维护的技术方案时使用。

软件开发工程师技术预研与概念验证
★ 0
hungtrandigital
hungtrandigital/ResidentOne

技术方案规划

planning

当您需要规划可扩展、安全且可维护的技术方案时使用。

系统架构师任务规划与分解
★ 0