Payment Integration Mastery
Production-proven multi-provider payment processing with Stripe, Paddle, SePay, Polar, and Creem.io.
Platform Selection
| Platform |
Best For |
Tax Handling |
Pricing |
| Stripe |
Enterprise, custom flows, Connect platforms |
You handle tax |
2.9% + 30¢ |
| Paddle |
SaaS subscriptions, global sales |
MoR (they handle tax) |
5% + 50¢ |
| SePay |
Vietnam market, VND, bank transfers |
You handle |
Low fees |
| Polar |
Open-source SaaS, subscriptions |
MoR |
5% |
| Creem.io |
MoR + software licensing |
MoR |
Varies |
Implementation Flow (All Providers)
1. Auth (API keys, secrets)
2. Create Products/Prices
3. Implement Checkout
4. Handle Webhooks
5. Manage Subscriptions
6. Monitor & Reconcile
Reference Navigation
Stripe
- Stripe Integration — Checkout Sessions, Payment Element, Billing Portal, Connect
- Stripe Webhooks — Event handling, signature verification, idempotency
Paddle
- Paddle Integration — MoR model, overlay/inline checkout, subscription lifecycle
- Paddle Webhooks — SHA256 verification, event types, Retain
Vietnam & Others
- SePay VietQR — Vietnamese bank integration, QR code payments, webhook setup
- Polar & Creem — Global SaaS billing, software licensing, benefits delivery
Architecture
- Multi-Provider Patterns — Unified order management, provider abstraction, currency handling
Quick Start (Stripe)
// Server: Create checkout session
import Stripe from 'stripe'
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!)
const session = await stripe.checkout.sessions.create({
line_items: [{
price: 'price_xxx',
quantity: 1
}],
mode: 'subscription',
success_url: 'https://myapp.com/success?session_id={CHECKOUT_SESSION_ID}',
cancel_url: 'https://myapp.com/cancel'
})
// Redirect to session.url
// Webhook handler
import { buffer } from 'micro'
export async function POST(req: Request) {
const body = await req.text()
const sig = req.headers.get('stripe-signature')!
const event = stripe.webhooks.constructEvent(body, sig, process.env.STRIPE_WEBHOOK_SECRET!)
switch (event.type) {
case 'checkout.session.completed':
await handleCheckoutComplete(event.data.object)
break
case 'invoice.payment_succeeded':
await handlePaymentSuccess(event.data.object)
break
case 'customer.subscription.deleted':
await handleSubscriptionCancelled(event.data.object)
break
}
return new Response('ok')
}
Best Practices
- Always verify webhook signatures — Never trust unverified webhooks
- Idempotent webhook handlers — Process each event exactly once
- Store provider IDs — Map Stripe/Paddle IDs to your internal IDs
- Handle edge cases — Failed payments, disputed charges, refunds
- Test with CLI tools —
stripe listen --forward-to localhost:3000/webhook
- Use MoR for global — Paddle/Creem handle tax compliance for you
Related Skills
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: payments3description: Multi-provider payment integration — Stripe (checkout, billing, Connect), Paddle (MoR subscriptions), SePay (VietQR, Vietnamese banks), Polar (global SaaS), Creem.io (MoR + licensing). Checkout flows, webhooks, subscriptions, QR payments, multi-provider management. Use when this capability is needed.4---56# Payment Integration Mastery78Production-proven multi-provider payment processing with Stripe, Paddle, SePay, Polar, and Creem.io.910## Platform Selection1112| Platform | Best For | Tax Handling | Pricing |13|----------|----------|-------------|---------|14| **Stripe** | Enterprise, custom flows, Connect platforms | You handle tax | 2.9% + 30¢ |15| **Paddle** | SaaS subscriptions, global sales | MoR (they handle tax) | 5% + 50¢ |16| **SePay** | Vietnam market, VND, bank transfers | You handle | Low fees |17| **Polar** | Open-source SaaS, subscriptions | MoR | 5% |18| **Creem.io** | MoR + software licensing | MoR | Varies |1920## Implementation Flow (All Providers)21```221. Auth (API keys, secrets)232. Create Products/Prices243. Implement Checkout254. Handle Webhooks265. Manage Subscriptions276. Monitor & Reconcile28```2930## Reference Navigation3132### Stripe33- **[Stripe Integration](references/stripe-integration.md)** — Checkout Sessions, Payment Element, Billing Portal, Connect34- **[Stripe Webhooks](references/stripe-webhooks.md)** — Event handling, signature verification, idempotency3536### Paddle37- **[Paddle Integration](references/paddle-integration.md)** — MoR model, overlay/inline checkout, subscription lifecycle38- **[Paddle Webhooks](references/paddle-webhooks.md)** — SHA256 verification, event types, Retain3940### Vietnam & Others41- **[SePay VietQR](references/sepay-vietqr.md)** — Vietnamese bank integration, QR code payments, webhook setup42- **[Polar & Creem](references/polar-creem.md)** — Global SaaS billing, software licensing, benefits delivery4344### Architecture45- **[Multi-Provider Patterns](references/multi-provider-patterns.md)** — Unified order management, provider abstraction, currency handling4647## Quick Start (Stripe)4849```typescript50// Server: Create checkout session51import Stripe from 'stripe'52const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!)5354const session = await stripe.checkout.sessions.create({55 line_items: [{56 price: 'price_xxx',57 quantity: 158 }],59 mode: 'subscription',60 success_url: 'https://myapp.com/success?session_id={CHECKOUT_SESSION_ID}',61 cancel_url: 'https://myapp.com/cancel'62})6364// Redirect to session.url65```6667```typescript68// Webhook handler69import { buffer } from 'micro'7071export async function POST(req: Request) {72 const body = await req.text()73 const sig = req.headers.get('stripe-signature')!74 75 const event = stripe.webhooks.constructEvent(body, sig, process.env.STRIPE_WEBHOOK_SECRET!)76 77 switch (event.type) {78 case 'checkout.session.completed':79 await handleCheckoutComplete(event.data.object)80 break81 case 'invoice.payment_succeeded':82 await handlePaymentSuccess(event.data.object)83 break84 case 'customer.subscription.deleted':85 await handleSubscriptionCancelled(event.data.object)86 break87 }88 89 return new Response('ok')90}91```9293## Best Practices94951. **Always verify webhook signatures** — Never trust unverified webhooks962. **Idempotent webhook handlers** — Process each event exactly once973. **Store provider IDs** — Map Stripe/Paddle IDs to your internal IDs984. **Handle edge cases** — Failed payments, disputed charges, refunds995. **Test with CLI tools** — `stripe listen --forward-to localhost:3000/webhook`1006. **Use MoR for global** — Paddle/Creem handle tax compliance for you101102## Related Skills103104| Skill | When to Use |105|-------|-------------|106| [rust-backend-advance](../rust-backend-advance/SKILL.md) | Webhook handling, payment APIs |107| [databases](../databases/SKILL.md) | Order/payment data storage |108| [nextjs-turborepo](../nextjs-turborepo/SKILL.md) | Checkout UI, payment forms |109| [testing](../testing/SKILL.md) | Payment flow E2E testing |110| [devops](../devops/SKILL.md) | Webhook security, secrets management |111112---113> Converted and distributed by [TomeVault](https://tomevault.io/claim/thienty1207) — claim your Tome and manage your conversions.114<!-- tomevault:4.0:skill_md:2026-04-15 -->