π³ Subscriptions & One-time Payments
Springular integrates with Stripe to handle both subscriptions and one-time payments. This makes it easy to manage payments for your SaaS application.
Stripe Integrationβ
Springular supports Stripe out of the box, enabling easy management of customer subscriptions and one-time payments. Here's how you can set it up:
-
API Keys: You can get your Stripe API keys by logging into your Stripe account and navigating to the API keys section. Use the Publishable Key and Secret Key and set them up as environment variables for security and configuration purposes.
-
Webhook Configuration: Webhooks are used to listen to Stripe events like payment success, subscription updates, etc. To set up a webhook:
- Go to the Webhooks section in your Stripe dashboard.
- Add a new webhook with the endpoint URL:
http://localhost:8081/api/webhook/
(This URL is an example and should be updated for your production environment). - Subscribe to the following events:
checkout.session.completed
customer.subscription.deleted
invoice.payment_failed
invoice.paid
User Panelβ
Subscription Managementβ
Users have access to a Subscription Panel where they can:
- View Subscription Status: See the current status of their subscription (active, canceled, etc.).
- Select Plans: If the user does not have an active subscription, they can view and choose from available plans.
- Manage Subscription: Users can update their subscription or change plans.
Customer Portalβ
Users can manage their account, update billing details, and more through the Customer Portal, which is powered by Stripeβs integration. The portal provides:
- Billing Information Management: Update payment methods, billing addresses, etc.
- Subscription Management: Pause, cancel, or change subscriptions.
- Invoice Management: Users can access and download past invoices.
All changes made through the Customer Portal are synced and applied directly to their Stripe account.
Webhook Handlingβ
Springular handles the following Stripe events through webhooks:
-
checkout.session.completed
-
customer.subscription.deleted
-
invoice.payment_failed
-
invoice.paid
These events are automatically handled by Springular, ensuring that the system stays updated with the latest subscription and payment statuses.