- Create a checkout session: Your backend calls the Fintoc API to create a Checkout Session. Include
success_urlandcancel_urlin your request. - Receive the redirect URL: The API returns a session that contains
redirect_url. Use this URL to send your customer to the Fintoc payment page. - Complete the payment: Your customer completes the payment in the Fintoc Widget.
- Return to your site: Fintoc sends your customer to the provided
success_urlorcancel_urlafter the payment flow.
Create a Checkout Session
Use your secret key to create a Checkout Session on your server. Includesuccess_url and cancel_url in the request:
Node
Python
Handle the API response
The API returns the checkout session with itsredirect_url. For example:
Handle post-payment events
Fintoc sends acheckout_session.completed event when the payment is complete. Use the webhook guide to receive these events. You can then send an order confirmation email, log the sale, or start a shipping workflow.
Listen for these events instead of waiting for a client-side callback. Your customer might close the browser or app before the callback runs. A malicious client could also manipulate the response.
We recommend handling the following events:
Learn more about webhooksRead the webhooks guide to create and test your webhook endpoint and follow security best practices.