Payments

Supersaas comes with a unified payments componsable that works with both Stripe and Lemonsqueezy.

Users can create checkout links, manage their billing, cancel subscriptions, update payment methods etc.

Stripe

The most popular payment processor.

Lemonsqueezy

Payments platform that handles taxes as well.

Coming Soon

Paddle

An alternative to Stripe and Lemonsqueezy.

The usePayments() composable

I thought a lot about how to make payments and billing easy for SaaS projects and I actually came up with a solution that I think is the best. It's a unified interface called usePayment().

I realised both Stripe and Lemonsqueezy do the same thing but with different APIs. I unified it into a single interface that you can use in your site.

All you have to do it just import the `usePayment()` composable and use it in your code and pass in the payment provider you want to use.

All you have to do it just import the `usePayment()` composable and use it in your code and pass in the payment provider you want to use.

usePayment('stripe')usePayment('lemonsqueezy')

Actions available

MethodParametersReturns
getAllPlans()NAPlans[]
createCheckoutLink options: { variantId: string; email?: string, name?: string, userId: string, redirectUrl?: string } CheckoutLink
createCustomerPortalLink options: { id?: string | number, customerId: string, redirectUrl?: string,
flowData?: FlowData, flow?: "update-plan" | "update-payment-info" | "cancel" }
CustomerPortalLink
pauseSubscriptionid: stringvoid
cancelSubscriptionid: stringvoid
resumeSubscriptionuserId: stringvoid
deleteOneTimePasswordid: stringvoid
updateSubscriptionid: stringvoid
listAllTransactionsNATransaction[]
getInvoiceinvoiceId: stringInvoiceURL