Php 检索JSON值
我正在使用php支付api 我已经成功地完成了每个步骤,但似乎无法在付款后获得返回值以生成收据。我不理解非畅通页面应该做什么 这是我的表格,正在正确张贴:Php 检索JSON值,php,json,Php,Json,我正在使用php支付api 我已经成功地完成了每个步骤,但似乎无法在付款后获得返回值以生成收据。我不理解非畅通页面应该做什么 这是我的表格,正在正确张贴: $action = $_POST["action"]; $pid = $_POST["pid"]; $buyer = $_POST["buyer"]; $total = $_POST["total"]; $comments = $_POST["comment
$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\u dump(json\u decode($result))
,print\u r($result)
和echo$result代码>只是为了看一些东西,但我得到了结果
有人能告诉我,在发布我已经在工作的表单后,如何获取我的返回值 请注意,在继续阅读您的代码之前,您不应该接受来自非SSL主机的推荐,因为这是一个支付网关,他们不会在支付过程中使用非安全域。请给我们一个打印片段。我认为您不能直接与$result对象进行比较。你可能不得不把它当作一个物体。查看您在上一个| |
条件中缺少$referer==
的示例?是在此处输入代码
您添加的内容还是脚本中的内容?PHP解释器将因此给出一个错误。