
Introducing @hazeljs/payment: One API, Any Provider
We're shipping @hazeljs/payment — a multi-provider payment package for HazelJS. Use Stripe today; plug in PayPal, Paddle, or your own gateway tomorrow, with one interface and no vendor lock-in. Why a payment package? Most apps need payments at some point: one-time purchases, subscriptions, or both. The usual approach is to wire the Stripe SDK (or PayPal, Paddle, etc.) directly into your controllers. That works, but when you want to support a second provider, run A/B tests, or switch gateways, you end up with if (provider === 'stripe') scattered everywhere and duplicated logic for checkout, customers, and webhooks. We wanted a single API that works across providers. Same methods for creating checkout sessions, managing customers, listing subscriptions, and handling webhooks — so your business logic stays provider-agnostic and you can add or swap providers by configuration. What's in the box One API, many providers PaymentService — createCheckoutSession() , createCustomer() , getCustomer
Continue reading on Dev.to Webdev
Opens in a new tab




