こんにちは、Magentoの:PaypalのAPI IPNエンドポイントからの空の応答
我々のクライアントは述べ早朝電子メール通知を受け取っ:
をPayPalの即時支払い通知(IPN)を扱うサーバーを確認してください。以下のURL(複数可)に送信された即時支払い通知が失敗している:
https://www.domain1.com/paypal/ipn
https://www.domain2.com/paypal/ipn
を私はこれらのエンドポイントを扱うコードを見ていたし、例外が原因空に投げされていることがわかりましたアプリケーション/コード/コア/メイジ/ペイパル/モデル/ Ipn.php(133)で
https://www.paypal.com/cgi-bin/webscr
コード:
次エンドポイントからの応答protected function _postBack(Zend_Http_Client_Adapter_Interface $httpAdapter)
{
$postbackQuery = http_build_query($this->_request) . '&cmd=_notify-validate';
$postbackUrl = $this->_config->getPaypalUrl();
$this->_debugData['postback_to'] = $postbackUrl;
$httpAdapter->setConfig(array('verifypeer' => $this->_config->verifyPeer));
$httpAdapter->write(
Zend_Http_Client::POST,
$postbackUrl,
'1.1',
array('Connection: close'),
$postbackQuery
);
try {
$postbackResult = $httpAdapter->read();
} catch (Exception $e) {
$this->_debugData['http_error'] = array('error' => $e->getMessage(), 'code' => $e->getCode());
throw $e;
}
/*
* Handle errors on PayPal side.
*/
$responseCode = Zend_Http_Response::extractCode($postbackResult);
if (empty($postbackResult) || in_array($responseCode, array('500', '502', '503'))) {
if (empty($postbackResult)) {
$reason = 'Empty response.';
} else {
$reason = 'Response code: ' . $responseCode . '.';
}
$this->_debugData['exception'] = 'PayPal IPN postback failure. ' . $reason;
throw new Mage_Paypal_UnavailableException($reason);
}
$response = preg_split('/^\r?$/m', $postbackResult, 2);
$response = trim($response[1]);
if ($response != 'VERIFIED') {
$this->_debugData['postback'] = $postbackQuery;
$this->_debugData['postback_result'] = $postbackResult;
throw new Exception('PayPal IPN postback failure. See ' . self::DEFAULT_LOG_FILE . ' for details.');
}
}
私は同じサイトのサンドボックスバージョンを設定し、支払いは応答が空であるため、私はまだhttps://www.sandbox.paypal.com/cgi-bin/webscr
から空の応答を受け付けており、処理されている間、例外がスローされており、レスポンスヘッダーが503 Service Unavailableに設定されています。これは私のクライアントが受け取った電子メールをトリガしたと考えられるものです。
私はここでいくつかの同様の質問を見ましたが、何が実際に応答を空にしているのかについて決定的なものは何もありません。これはPaypalの問題ですか、あるいは何かが間違っていますか?完全性のために、私たちは最近、新しいサーバーに移行しました(ただし、この問題は最終日に発生したようです)。