Checkout Redirect

This article explains how to configure the redirect checkout and how to handle the captured payment intent on your backend or if you need to do anything at all.

Configuring debit items

When creating a new debit item that defines the parameters of the checkout and the subscription, you need to add a redirect url. This parameter is the only parameter you are allowed to alter after creating your item. It must point to a valid link on your website where you wish to redirect to.

The URL configured here will redirect the user after they have successfully created a subscription payment intent with their account and ready to start making payments.

The website will redirect using this schema:

${redirectUrl}?paymentIntent=${paymentIntent}`

Where the redirect url is a valid url you have supplied, and the paymentIntent query parameter is a parameter used to identify the payment intent.

The paymentIntent variable is a poseidon hash used with the zero-knowledge proof cryptography. It identifies individual zkSnarks created with the same account and nullifies them after they have been processed. All cryptography is handled by Debitllama and you just need to use this variable as an identifier. It will let you query the API and also the blockchain.

How to use?

Use this variable to fetch details about the subscription status using the payment_intents endpoints. Learn more about how to use them here:

/api/v1/payment_intents/[slug]

For fixed priced subscriptions by default you don't need to do anything. After the payment intent has been created the payments will be processed automatically. For dynamic priced subscriptions you will need to trigger a payment request on the front-end or via the API. For this you will need to use the paymentIntent as an identifier.

Learn about how to create access tokens on the next page, before you start using the API!

Last updated