我正在使用 php 支付 api https://simplepay4u.com/developer.php 我已成功完成每一步,但似乎无法获得返回值以在付款后生成收据。我不明白 unotify 页面应该做什么。
这是我正确发布的表格:
$action = $_POST["action"];
$pid = $_POST["pid"];
$buyer = $_POST["buyer"];
$total = $_POST["total"];
$comments = $_POST["comments"];
$referer = $_POST["referer"];
$customid = $_POST["customid"];
$transaction_id = $_POST["customid"];
$val = @json_encode($_POST);
// For Loging $val can be used
if ($referer == "https://simplepay4u.com"
|| $referer == "https://www.simplepay4u.com"
|| "http://sandbox.simplepay4u.com/process.php") //1st level checking
{
if (!empty($transaction_id)) //2nd level checking
{
/*** Server side verification. Your server is communicating with Simplepay Server Internally**/
//$simplepay_url="https://simplepay4u.com/processverify.php"; // Live URL
$simplepay_url = "http://sandbox.simplepay4u.com/processverify.php";
$curldata["cmd"] = "_notify-validate";
foreach ($_REQUEST as $key => $value) {
if ($key != 'view' && $key != 'layout') {
$value = urlencode($value);
$curldata[$key] = $value;
}
}
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $simplepay_url);
curl_setopt($handle, CURLOPT_POST, 1);
curl_setopt($handle, CURLOPT_POSTFIELDS, $curldata);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($handle, CURLOPT_TIMEOUT, 90);
$result = curl_exec($handle);
curl_close($handle);
var_dump(json_decode($result));
enter code here
if ('VERIFIED' == $result) {
// IMPLEMENTATION CODE & aPPLICATION lOGIC WILL GO HER TO UPDATE THE ACCOUNT
}
}
}
我已将我的 ureturn 页面设置为携带上述脚本并尝试过,var_dump(json_decode($result))
只是为了看到一些东西,但我得到了结果。print_r($result)
echo $result;
有人可以告诉我在发布我已经工作的表格后该怎么做才能获得我的返回值吗?