Why Multiple Payment Gateways?
Selling globally means accepting payments locally. While Lemon Squeezy handles international payments beautifully, Indian customers prefer UPI and local cards. Enter Dodo Payments.
Architecture Overview
I built an abstraction layer that routes payments based on user location:
interface PaymentProvider {
createCheckout(options: CheckoutOptions): Promise;
handleWebhook(payload: WebhookPayload): Promise;
cancelSubscription(subscriptionId: string): Promise;
}
class LemonSqueezyProvider implements PaymentProvider {
// Implementation
}
class DodoPaymentsProvider implements PaymentProvider {
// Implementation
}
Lemon Squeezy Integration
Perfect for international customers. Handles tax calculations, invoicing, and chargebacks automatically.
Dodo Payments Setup
For the Indian market - supports UPI, Indian credit/debit cards, and net banking with lower fees.
Key Lessons