我想使用Curl从我的PHP服务器重定向到PayUMoney支付网关。
我正在使用Laravel框架,但我不想使用HTML/Blade方法来触发支付网关。
$posted = array();
$posted['key'] = $MERCHANT_KEY;
$posted['hash'] = $hash;
$posted['txnid'] = $txnid;
$posted['firstname'] = $firstname;
$posted['email'] = $email;
$posted['phone'] = $phone;
$posted['amount'] = $amount;
$posted['productinfo'] = $productinfo;
$posted['surl'] = $surl;
$posted['furl'] = $furl;
ini_set('display_errors', 1);
$c = curl_init();
$url = "https://test.payu.in/_payment";
curl_setopt_array($c, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => 0,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $posted,
));
$response = curl_exec($c);
但是这段代码显示的输出如下,因此无法完全重定向到支付网关(https://i.stack.imgur.com/WmDFS.png)。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号