cURL
$payload = [
"customer_mobile" => "9876543210",
"user_token" => getenv("UPIBRIDGE_USER_TOKEN"),
"amount" => "49.00",
"order_id" => "ord_" . bin2hex(random_bytes(6)),
"redirect_url" => "https://your-site.com/done",
"remark1" => "php-example",
"remark2" => ""
];
$ch = curl_init("https://upibridge.com/api/create-order");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
$payUrl = $data["result"]["payment_url"] ?? null;Redirect: header("Location: " . $payUrl); exit;
Popup: use JavaScript SDK in template.
Confirm with webhooks.