- Checkout Session Creation: Your backend calls our API to create a Checkout Session. You must include a
success_urland acancel_urlin your request. - Receiving the Redirect URL: Our API responds with a session that contains a
redirect_url. This URL is used to send your customer to our secure payment page. - Customer Payment Flow: Your customer is redirected to our payment page, where they complete their payment on the Fintoc Widget.
- Return Flow: After the payment, your customer is automatically sent back to your site via the
success_urlorcancel_urlprovided.
Create a Checkout Session
Using your Secret Key, create aCheckout Session on your server with the success_url and cancel_url:
Node
Python
Handling the API Response
After creating the checkout session, you’ll receive a response that includes aredirect_url along with other important parameters. For example:
Handling post-payment events
Fintoc sends acheckout_session.completed event when the payment is complete. Use the webhook guide to receive these events and run actions, such as sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.
Listen for these events rather than waiting on a callback from the client. From the client side, On the client, the customer could close the browser window or quit the app before the callback executes, and malicious clients could manipulate the response.
We recommend handling the following events:
Learn more about webhooksTo learn more about how to create your own webhook endpoint, test your webhook endpoint and security best practices read our Webhooks guide