Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/254.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 支付通知空白_Php_Post_Opayo - Fatal编程技术网

Php 支付通知空白

Php 支付通知空白,php,post,opayo,Php,Post,Opayo,我有一个问题,我希望有人能帮助我,因为SagePay的支持就像巧克力茶壶一样有用。我有一个与SagePay服务器集成的定制电子商务解决方案,有些运行v2.23,有些运行v3.00。我们有几个网站突然停止工作 SagePay的通知是空白的,完全是空的。这两个网站都没有发布数据。然而,我们有另外两个网站,没有其他问题,一切都很好 这4个站点之间的唯一区别是版本,这需要对发送给SagePay的内容以及它们的宿主位置进行一些细微的更改。这两个工作站点由HeartInternet托管,而不工作的两个站点由

我有一个问题,我希望有人能帮助我,因为SagePay的支持就像巧克力茶壶一样有用。我有一个与SagePay服务器集成的定制电子商务解决方案,有些运行v2.23,有些运行v3.00。我们有几个网站突然停止工作

SagePay的通知是空白的,完全是空的。这两个网站都没有发布数据。然而,我们有另外两个网站,没有其他问题,一切都很好

这4个站点之间的唯一区别是版本,这需要对发送给SagePay的内容以及它们的宿主位置进行一些细微的更改。这两个工作站点由HeartInternet托管,而不工作的两个站点由不同的主机托管,一个是123reg,另一个是未知的美国主机

SagePay已经向我发送了几笔交易的日志,都显示了存在的通知数据,因此就他们而言,他们正在将其发送给我,这是一个服务器问题。我甚至不知道从哪里开始调试这个

不确定是否相关,但我在通知方法的开头添加了:

public function Notify() {

    $this->Load();
    define('LOG_FILE', ROOT_LIB . 'sagepaylog-v2.23.txt');
    error_log(date('c') . " NEW NOTIFICATION" . PHP_EOL, 3, LOG_FILE);
    $input = file_get_contents('php://input');
    $query = $response = array();
    $exp = explode('&', $input);
    foreach($exp as $keyVal) {
        $e = explode('=', $keyVal, 2);
        $response[$e[0]] = urldecode($e[1]);
    }
    /* Comment out the above code and uncomment below when testing using POSTMAN.
    foreach($_POST as $key => $val) {
        $response[$key] = $val;
    }*/

    error_log("Notification Post Data" . PHP_EOL . "-------------------------" . PHP_EOL, 3, LOG_FILE);
    foreach($response as $key => $val) {
        error_log("$key: $val" . PHP_EOL, 3, LOG_FILE);
    }

    //We record the transaction during the initial registration. We need to load the details of that transaction, and of the order for the specified order ID, and make sure they match the details sent to us by SagePay.
    $valid = FALSE;
    $orders = $this->glob->order->LoadOrderHistory("WHERE ordId = " . (int)$response['VendorTxCode'], TRUE);
    if(count($orders)) {
        $order = $orders[$response['VendorTxCode']];
    } else {
        $order = new Order($this->glob);
    }
    $transaction = new Transaction($this->glob, $order->txnId);

原来这是由htaccess将非www重定向到www引起的,通知URL不包含www。这是通过检查URL并在前面添加www(如果还没有)来修复的