Return URLs
Return URLs determine where your customers are redirected after completing, canceling, or failing a payment. Configuring these URLs ensures a smooth checkout experience on your website.
What are return URLs
When a customer completes a payment through the ZAFA PAY hosted checkout page, they need to be redirected back to your website. Return URLs tell our system where to send customers based on the outcome of their payment attempt.
There are three return URL types, each corresponding to a different payment outcome: success, failure, and cancellation.
Configure return URLs
Set up your return URLs from the Merchant Portal:
- 1Log in to the Merchant Portal and go to Merchant Settings.
- 2Click the Edit button on your profile to enter edit mode.
- 3Scroll to the return URL fields and enter your URLs:
- Success URL — where to redirect after a successful payment
- Failure URL — where to redirect after a failed payment
- Cancel URL — where to redirect if the customer cancels
- 4Click Save to apply your changes.
URL types
Each return URL serves a different purpose:
Success URL
The customer is redirected here after a successful payment. This is typically an order confirmation or thank-you page on your website. You can use query parameters to display the order details.
Failure URL
The customer is redirected here if the payment fails (e.g., declined card, processing error). Consider showing an error message and offering the customer a way to retry the payment.
Cancel URL
The customer is redirected here if they choose to cancel the payment before completing it. This is typically your cart or checkout page, so the customer can start the process again if they choose.
Testing your URLs
After configuring your return URLs, test them to ensure customers are redirected correctly:
- 1Test in sandbox: Use your sandbox environment to process test transactions and verify that each URL works as expected.
- 2Verify all three outcomes: Test successful payments, failed payments (using test card numbers), and cancellations to confirm each URL redirects correctly.
- 3Check for HTTPS: Ensure all return URLs use HTTPS to protect your customers' data in transit.
- 4Handle query parameters: ZAFA PAY may append query parameters (such as the transaction ID) to the return URL. Make sure your pages can handle these gracefully.
If you need help testing or configuring your return URLs, please contact our support team.