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

  1. The payer completes (or abandons) the payment on the gateway/bank page.
  2. The gateway sends the browser back to Cartino Pay (https://pay.cartino.net/callbacks/{gateway}), never directly to you.
  3. Cartino Pay verifies the payment server-to-server with the gateway.
  4. Cartino Pay redirects the browser to your callback_url with the outcome appended:
https://cartino.cloud/payment/callback?payment_id=PAY_01J9…&order_id=CLOUD-12345&status=paid

Good practice