Redirecting the User
After creating a payment, send the payer's browser to payment_url:
// Laravel
return redirect()->away($payment['payment_url']);
// Express
res.redirect(302, payment.payment_url);
<!-- Plain HTML fallback -->
<a href="https://payment.zarinpal.com/pg/StartPay/A0000…">Pay now</a>
What happens next
- The payer completes (or abandons) the payment on the gateway/bank page.
- The gateway sends the browser back to Cartino Pay (
https://pay.cartino.net/callbacks/{gateway}), never directly to you. - Cartino Pay verifies the payment server-to-server with the gateway.
- Cartino Pay redirects the browser to your
callback_urlwith the outcome appended:
https://cartino.cloud/payment/callback?payment_id=PAY_01J9…&order_id=CLOUD-12345&status=paid
Good practice
- Do the redirect from a server-rendered response or a
window.locationassignment; do not open the gateway inside an iframe (banks block it). - Show the payer a "returning to the shop…" state on your callback page while you look up the payment.
- Keep
payment_urlserver-side; the URL alone lets anyone pay that particular payment, which is harmless, but it also reveals the gateway you use. - Payments expire (
expires_at). If the payer comes back late, create a new payment rather than reusing an old URL.