Back

How We Implemented Stripe Payments for a SaaS App

How We Implemented Stripe Payments for a SaaS App

Booqer is our flagship multi-tenant software as a service platform designed to streamline and manage day-to-day business operations such as tracking timesheets, managing leads, and overseeing HR needs. Its modular structure allows users to purchase licenses for just the modules they need. Each module comes with its own independent free trial period, but once users subscribe, all their modules are billed together in a single monthly invoice. This simplifies the billing process by combining everything into one payment. To manage these subscriptions seamlessly, we use Stripe as our payment processor. Here’s how we implemented Stripe and the challenges we faced, along with the solutions we came up with.

Transparent and Flexible Billing

To make billing transparent, we integrated the Stripe API to handle prorated charges automatically. This way, users only pay for the time they actually use each module. For example, if a user subscribes halfway through a billing cycle, Stripe calculates and charges only for the remaining days.

However, if users downgrade their subscription—by canceling a module or reducing the number of seats—we do not issue prorated refunds. Instead, the next invoice will show the adjusted subscription cost based on the changes.

For instance, if a user purchases 10 seats for the Timesheet module on January 1st at €2 per seat, the invoice would be €20. If the user adds 5 seats for the CRM module on January 15th at €2 per seat and reduces Timesheet seats from 10 to 8, the invoice for that period will include a prorated charge for the new CRM seats (€5). No refund will be given for the reduced Timesheet seats. The next invoice on February 1st will reflect the new subscription levels, totaling €26 (8 Timesheet seats at €2 each and 5 CRM seats at €2 each).

Enhanced Payment Security with Stripe’s 3DS

To improve payment security, we integrated Stripe’s 3D Secure authentication. This requires users to verify transactions through their bank, using methods like passwords or one-time codes, which helps prevent unauthorized transactions. We process and store all the payment information on Stripe, so we don’t have to handle sensitive data ourselves. This is to reduce our risk and to make sure we meet high-security standards.

How It Works on the Frontend

We designed the subscription dashboard of our SaaS application to provide a clear and centralized view for users to manage their subscriptions. Under the Modules tab, users can see a list of Available Subscriptions that they have not yet subscribed to. Once a user subscribes to a module, it moves into the Your Subscriptions table. This table functions like a shopping cart, allowing users to review and confirm any changes to their subscriptions.

Easy Billing and Card Management

We also added a feature that allows users to easily update their billing details and card information.

When users add their card details, they must authorize the card for future charges. This initial step ensures that the card is valid and guarantees future transactions. By completing this step, users can bypass the 3D Secure (3DS) process for most automatic monthly payments and on-site purchases, streamlining their payment experience.

Enhanced Security Measures

Whenever users add or update card details or make payments, they may need to complete Stripe 3D Secure (3DS) verification. However, this only happens if Stripe Radar or the user’s bank flags the transaction as risky. For most subscription upgrades and automatic monthly billing, 3DS is usually skipped, ensuring a smoother payment process.

Simplified Subscription Management

Once the billing details are in place, users can select the number of seats they need for each module, with costs calculated based on the number of seats added.

The interface is clean and user-friendly, allowing users to adjust the number of seats, cancel subscriptions, and view or download invoices easily.

Users also receive detailed invoices automatically, which they can view or download at any time. This gives them clear and accurate records of all subscription changes and charges. Transparent invoicing keeps users informed and in control of their subscription costs.

Real-Time Payment Notifications

We also implemented a notification system to keep users informed about their payment status. This includes updates on successful transactions and any issues that may arise, so users are always aware of their subscription and billing status.

Overcoming Challenges with Stripe Integration

One of the biggest challenges we faced was managing free trials. This was before Stripe added support for discounts to their API. We managed free trials by making multiple updates to Stripe subscription schedules, increasing prices after the trial period ended. Once Stripe introduced support for multiple discounts, we rewrote and simplified our system to use these new discounts.

Handling Failed Payments

Managing failed payments was another significant challenge. When a subscription payment fails, we allow users to attempt 3D Secure (3DS) verification from our app to retry the payment. If a card expires, users can easily complete the checkout process with a new card, ensuring uninterrupted service. Also, if a user fails the 3DS verification, they can retry with a new or existing card. Throughout this process, we do not store any sensitive card data. We only access the card’s expiration date and the last four digits, which are securely displayed to the user who added the card.

Handling Downgrades

Dealing with downgrades presented a new set of challenges. While issuing refunds for downgrades mid-cycle might have been a simpler process technically, we chose to schedule these changes to occur at the end of the current billing period. This decision was based on our preference to avoid offering refunds for mid-cycle changes in this type of licensed software. However, we do consider refund requests under specific circumstances, such as when a user forgets to cancel after a free trial. In such cases, refunds would be processed through email requests.

Connecting Stripe Entities to Our Database

Integrating Stripe with our database was essential for maintaining consistency and ensuring smooth operations. We addressed this by adding metadata to most of our Stripe API calls, which allows us to accurately match Stripe’s data with our own database records. This approach ensures seamless integration and data consistency between Stripe and our internal systems.

Conclusion

Integrating Stripe into the application has significantly enhanced the payment process on this SaaS platform, making it more efficient and user-friendly. This implementation is just one of many steps we’re taking to continuously improve Booqer, ensuring it meets the evolving needs of our users. We’re committed to refining our services and delivering an exceptional experience that empowers businesses to manage their operations with ease.

Back
Do you have a project you need help with?
Get in Touch

By using this website, you agree to our use of cookies. We use cookies to provide you with a great experience and to help our website run effectively.

Accept