Fast Pay
Live demo

Pay, and watch it get verified.

This page is a real integration in a single PHP file. It creates an order through the API, shows the payment inside this page — or on the hosted payment page, your choice — and verifies the result on the server.

Make a test payment

A real UPI payment to the account connected to the API key.

What happens when you press the button

Open demo.php in an editor — every step is commented.

  1. Your server creates the orderPOST /api/create-order with the amount, your own order_id and a callback_url.
  2. The customer paysInside this page: AntoPay.open({ url: payment_url }) shows the QR in a box on top of your page. Payment page: you redirect to payment_url. Either way they scan the QR in any UPI app.
  3. Your server verifies the resultBack on callback_url you call POST /api/check-status. Deliver only when payment_status is success.
// the two calls this page makes
[$code, $res] = gateway_call($apiBase . '/create-order', $apiKey, [
    'amount'       => '10.00',
    'order_id'     => $orderId,
    'customer_name'=> $name,
    'callback_url' => $selfUrl . '?action=callback',
]);
header('Location: ' . $res['data']['payment_url']);

// …after the customer comes back
[$code, $res] = gateway_call($apiBase . '/check-status', $apiKey,
    ['order_id' => $orderId]);
$paid = $res['data']['payment_status'] === 'success';
In production, also add a webhook so your server is told about the payment even if the customer closes the browser. See Webhooks.