There are two broad types of payment flows -
Where customer is redirected to a third party page (bank OTP page, app login page, etc.)
Where customer needs to approve the payment through an asynchronous process (example - by approving a payment request on their phone).
While the former requires a redirection to the third party page, the latter does not. In case the customer is redirected from your website to a third party page, you would also want them to return back to your application. The `return_url
` provided in the create order API call is used for this.
Return URL
Once the customer has completed the payment on the banks OTP page, we will redirect them back to your `
return_url
`. This will be a link based redirection, so if you have provided a return_url of the format - `https://b8af79f41056.eu.ngrok.io?order_id={order_id}&order_token={order_token}
` - the customer will be redirected to the url - `https://b8af79f41056.eu.ngrok.io?order_id=order_271vfuhh1o4h6bQIigqyOx74YiJ1T&order_token=LGi51C905Z3uVgjzi1YS
`
Once you receive a request on this URL, you must first confirm if the order_token and the order_id belong to the same order. You must then check the status of the order in your system. If the system is already paid, you do not need to fulfil the order again. However, if the order is still in an ACTIVE state, you need to fetch the order status from Cashfree. You must fetch the order status from your backend using the `/orders/:orderID
` API call as below.