Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 检索JSON值_Php_Json - Fatal编程技术网

Php 检索JSON值

Php 检索JSON值,php,json,Php,Json,我正在使用php支付api 我已经成功地完成了每个步骤,但似乎无法在付款后获得返回值以生成收据。我不理解非畅通页面应该做什么 这是我的表格,正在正确张贴: $action = $_POST["action"]; $pid = $_POST["pid"]; $buyer = $_POST["buyer"]; $total = $_POST["total"]; $comments = $_POST["comment

我正在使用php支付api 我已经成功地完成了每个步骤,但似乎无法在付款后获得返回值以生成收据。我不理解非畅通页面应该做什么

这是我的表格,正在正确张贴:

$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解释器将因此给出一个错误。