Stripe SEPA via API
Problem Statement
You want to set up checkout via API for SEPA (Direct Debit) payments using Stripe.
Solution
Use the checkout API to create a checkout URL, open it in Chargebee.JS, and handle the success callback to retrieve the Direct Debit agreement. The workflow below describes how to implement SEPA checkout via API.
Steps to Set It Up
- Create a checkout URL using the Checkout new subscription or Checkout existing subscription API.
- Pass the URL to Chargebee.JS to open checkout as a modal popup.
- Configure checkout callbacks in Chargebee.JS. The
successcallback runs when checkout completes successfully. - In the
successcallback, send the hosted page ID to your backend. - Call the Retrieve a hosted page API with the hosted page ID to get the payment source ID for the customer.
- Use the Retrieve direct debit agreement PDF API to get the Direct Debit agreement.
- The API response includes the URL where the agreement is hosted. Pass this URL to Chargebee.JS to load the agreement in the modal popup.
Was this article helpful?