71 lines
2.5 KiB
Markdown
71 lines
2.5 KiB
Markdown
---
|
|
name: ck-payment-integration
|
|
description: Integrate payments with SePay (VietQR), Polar, Stripe, Paddle, or Creem.io. Use for checkout flows, subscription management, webhook handling, QR code payments, and software licensing.
|
|
---
|
|
|
|
# Payment Integration
|
|
|
|
Production payment processing across SePay, Polar, Stripe, Paddle, and Creem.io.
|
|
|
|
## When to Use
|
|
|
|
- Setting up payment gateway checkout or processing
|
|
- Building subscription management (trials, upgrades, billing)
|
|
- Handling webhooks with idempotency
|
|
- Implementing QR code payments (VietQR/NAPAS)
|
|
- Software licensing with device activation
|
|
- Multi-provider order management
|
|
|
|
## Don't Use When
|
|
|
|
- Simple donation buttons (use Ko-fi or Buy Me a Coffee embed)
|
|
- Internal transfer tools without customer-facing payments
|
|
|
|
## Platform Selection
|
|
|
|
| Platform | Best For |
|
|
|----------|----------|
|
|
| **SePay** | Vietnamese market, VND, bank transfers, VietQR |
|
|
| **Polar** | Global SaaS, subscriptions, automated benefits |
|
|
| **Stripe** | Enterprise, Connect platforms, custom checkout |
|
|
| **Paddle** | MoR subscriptions, global tax compliance |
|
|
| **Creem.io** | MoR + licensing, revenue splits, no-code checkout |
|
|
|
|
## General Integration Flow
|
|
|
|
```
|
|
auth → products → checkout → webhooks → events
|
|
```
|
|
|
|
## Key Capabilities
|
|
|
|
| Platform | Rate Limit | Highlights |
|
|
|----------|-----------|------------|
|
|
| SePay | 2 req/s | QR/bank/cards, 44+ VN banks |
|
|
| Polar | 300 req/min | MoR, usage billing, GitHub/Discord benefits |
|
|
| Stripe | varies | CheckoutSessions, Billing, Connect, Payment Element |
|
|
| Paddle | varies | MoR overlay/inline, Retain churn prevention, tax |
|
|
| Creem.io | varies | MoR, device licensing, revenue splits |
|
|
|
|
## Security Rules
|
|
|
|
- Store all API keys in environment variables — never hardcode
|
|
- Always verify webhook signatures before processing events
|
|
- Use idempotency keys for checkout and subscription operations
|
|
- Implement proper session token handling for embedded flows
|
|
|
|
## Reference Files
|
|
|
|
- `references/sepay.md` - SePay auth, VietQR, webhooks, SDK
|
|
- `references/polar.md` - Polar products, checkouts, subscriptions, benefits
|
|
- `references/stripe.md` - Stripe best practices, SDKs, CLI, Payment Element
|
|
- `references/paddle.md` - Paddle MoR, overlay/inline checkout, subscriptions
|
|
- `references/creem.md` - Creem MoR, licensing, no-code checkout, webhooks
|
|
- `references/multi-provider.md` - Unified orders, currency conversion patterns
|
|
|
|
## External Docs
|
|
|
|
- Stripe: https://docs.stripe.com/llms.txt
|
|
- Paddle: https://developer.paddle.com/llms.txt
|
|
- Creem: https://docs.creem.io/llms.txt
|