Customer Redirects
After the customer completes or cancels a payment, their browser is redirected to the URL you specified when creating the Payment Intent.
Redirect outcomes
Section titled “Redirect outcomes”| Outcome | Redirect to |
|---|---|
| Payment successful | success_redirect_url |
| Payment failed | failed_redirect_url |
| Customer cancelled | cancel_redirect_url |
Embedding data in redirect URLs
Section titled “Embedding data in redirect URLs”You know all booking details when creating the Payment Intent, so build them into the redirect URL:
https://yoursite.com/payment-ok?ref=BOOKING-001&amount=1000&cur=ZARExample — building the URL dynamically
Section titled “Example — building the URL dynamically”reference = "BOOKING-2026-001"amount = 1000currency = "ZAR"email = "jean@example.com"
success_url = ( f"https://www.yoursite.com/payment-ok" f"?ref={reference}&amount={amount}&cur={currency}&email={email}")
# Pass as success_redirect_url when creating the Payment Intentvar successUrl = $"https://www.yoursite.com/payment_ok.aspx" + $"?r=ok&k={Uri.EscapeDataString(reference)}" + $"&a={amount}&cur={currency}" + $"&email={Uri.EscapeDataString(email)}";Do not rely solely on redirect URLs to confirm payment status. Always verify payment status server-side using webhooks or callbacks.