【发布时间】:2014-09-15 12:20:11
【问题描述】:
我有一个问题,我希望有人能够帮助我,因为 SagePay 支持就像巧克力茶壶一样有用。我有一个带有 SagePay 服务器集成的定制电子商务解决方案,其中一些运行 v2.23 其他 v3.00。我们有几个网站突然停止工作。
来自 SagePay 的通知是空白的,完全是空的。这两个网站中的任何一个都没有发布数据。但是我们还有另外两个网站没有其他问题,一切正常。
这 4 个站点之间的唯一区别是版本,这需要对发送到 SagePay 的内容和托管位置进行一些小的更改。两个工作站点由 HeartInternet 托管,而两个不工作的站点由不同的主机托管,一个由 123reg 托管,一个由未知的美国主机托管。
SagePay 已向我发送了他们的几笔交易日志,均显示存在通知数据,因此就他们而言,他们将其发送给我很好,这是服务器问题。我什至不确定从哪里开始调试。
不确定它是否相关,但我已在 Notification 方法的开头添加:
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);
【问题讨论】: