Payment Integration
Integrate payments with SePay (VietQR), Polar, Stripe, Paddle (MoR subscriptions), Creem.io (licensing). Checkout, webhooks, subscriptions, QR codes,
Category: development Source: mrgoonie/claudekit-skillsWhat Is Payment Integration?
Payment Integration is a modular skill designed for developers seeking to embed robust payment capabilities into their applications or services. This skill streamlines the connection to multiple payment providers, including SePay (Vietnamese bank payments via VietQR), Polar (global SaaS payments), Stripe (enterprise-grade infrastructure), Paddle (Merchant of Record subscriptions), and Creem.io (licensing and MoR). The integration covers a wide array of payment scenarios—checkout flows, subscription management, webhook processing, QR code payments, and revenue splitting—enabling rapid deployment of reliable, scalable payment solutions.
Why Use Payment Integration?
Integrating payments is a critical step for any business or product that monetizes digital goods, SaaS subscriptions, or licenses. The Payment Integration skill abstracts the complexity of dealing with diverse payment APIs, compliance requirements, and unique regional standards. With production-proven connectors and unified workflows, developers can:
- Accelerate time-to-market by reusing prebuilt integrations.
- Minimize risk via tested webhook handling and idempotency logic.
- Support multiple monetization models (one-time, recurring, licensing).
- Expand globally by leveraging the strengths of each provider: SePay for Vietnam, Stripe and Paddle for worldwide reach, Polar for SaaS automation, and Creem.io for licensing and revenue splits.
By using this skill, teams avoid costly custom development and ensure their payment stack is flexible, maintainable, and secure.
How to Get Started
To incorporate Payment Integration into your project, follow these steps:
1. Installation
Clone or add the skill to your ClaudeKit-enabled project:
git clone https://github.com/mrgoonie/claudekit-skills.git
## Copy or symlink .claude/skills/payment-integration into your project
Ensure your environment is configured for Node.js, PHP, or Laravel if you intend to use the supplied SDKs.
2. Provider Configuration
Each provider requires specific configuration. For example, to set up SePay:
const { SePay } = require('payment-integration/sepay');
const sepay = new SePay({
apiKey: process.env.SEPAY_API_KEY,
secret: process.env.SEPAY_SECRET,
bank: 'VCB', // Vietcombank
});
For Stripe:
const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
Refer to the provider’s reference documentation (e.g., references/sepay/api.md, references/stripe/api.md) for endpoint and credential details.
3. Initiate a Checkout
Example: Create a checkout session with Stripe.
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
line_items: [
{ price: 'price_12345', quantity: 1 },
],
mode: 'subscription',
success_url: 'https://yourapp.com/success',
cancel_url: 'https://yourapp.com/cancel',
});
For SePay (VietQR):
const paymentUrl = await sepay.createPayment({
amount: 500000,
currency: 'VND',
description: 'Pro Subscription',
returnUrl: 'https://yourapp.com/return',
});
4. Handle Webhooks
Webhook endpoints must be configured to receive and verify events from each payment provider. For example, with Paddle:
app.post('/webhooks/paddle', (req, res) => {
// Validate signature
// Process subscription event
res.sendStatus(200);
});
Key Features
1. Multi-Provider Support:
Integrate with SePay (optimized for Vietnam), Polar (automated SaaS benefits), Stripe (enterprise payments), Paddle (global MoR), and Creem.io (licensing and revenue splits).
2. Unified Checkout and Subscriptions:
Rapidly deploy checkout pages, process one-time or recurring payments, and handle complex subscription lifecycles including trials, upgrades, and downgrades.
3. Secure Webhook Handling:
Receive, validate, and process webhook notifications for transaction status, subscription changes, or license activations, ensuring data consistency and idempotency.
4. QR Code Payments:
Support QR code-based payments (e.g., VietQR, NAPAS) for seamless, user-friendly transactions in the Vietnamese market.
5. Licensing and Device Activation:
Automate software licensing, device activation, and entitlement checks via Creem.io integration.
6. Multi-Provider Order Management:
Create orders spanning multiple providers or handle revenue splits and commissions, ideal for marketplaces or reseller scenarios.
Best Practices
- Environment Segregation: Use separate credentials for production and development. Never expose secrets in client-side code.
- Webhook Verification: Always validate webhook signatures to prevent spoofed requests. Store event IDs to enforce idempotency.
- Compliance: Adhere to data privacy and tax regulations, especially when handling user info or operating cross-border.
- Graceful Error Handling: Log and monitor payment failures, timeouts, or webhook retries for prompt resolution.
- User Experience: Present clear error messages and guidance during checkout. For QR payments, ensure QR codes are clearly displayed and mobile-friendly.
- Testing: Use sandbox/test modes for each provider before going live. Validate all flows including subscription upgrades, downgrades, and cancellations.
Important Notes
- Provider Limitations: Some providers (e.g., Paddle, Creem.io) act as Merchant of Record, impacting how tax, refunds, and compliance are handled. Understand each provider’s terms before integration.
- Currency Support: Not all providers support all currencies. SePay is VND-centric; Stripe and Paddle are more global.
- Licensing Flows: When using Creem.io or similar, ensure your licensing logic (activation, revocation) is tightly coupled with payment and webhook events.
- Security: Always use HTTPS for all endpoints. Rotate API keys periodically and enforce least-privilege access.
- Documentation: Refer to the skill’s references (e.g.,
references/sepay/overview.md,references/stripe/api.md) for up-to-date API and integration details.
By leveraging the Payment Integration skill, developers can offer seamless, secure, and scalable payment experiences tailored to their market and business model, while reducing operational overhead and technical complexity.