0

数日前に Magento ベースの Web サイトに realex 拡張機能をインストールしましたが、うまく動作しませんでした。注文を完了しようとするとエラーが発生します - 一般的なポップアップが表示されます:

ご注文の処理中に問題が発生しました

Realex 自身に連絡した後、彼らは、私たちが接続しようとしていることがわかり、最終的には問題ではなかったとのことでした。

ウェブサイトのエラーログを確認したところ、次のことがわかりました。

2013-05-02T08:47:50+00:00 ERR (3): 
exception 'Ampersand_Realex_Model_Exception_Hash' with message 'Hash does not match.' in /home/excellen/public_html/app/code/community/Ampersand/Realex/Model/Adapter/Remote/Abstract.php:41
Stack trace:
#0 /home/excellen/public_html/app/code/community/Ampersand/Realex/Model/Adapter/Remote/AuthCaptureAbstract.php(299): Ampersand_Realex_Model_Adapter_Remote_Abstract->_validateResponseHash()
#1 /home/excellen/public_html/app/code/core/Ampersand/PaymentGateway/Model/Service/Abstract.php(585): Ampersand_Realex_Model_Adapter_Remote_AuthCaptureAbstract->callbackForFinalAuth()
#2 /home/excellen/public_html/app/code/core/Ampersand/PaymentGateway/Model/Service/Abstract.php(249): Ampersand_PaymentGateway_Model_Service_Abstract->_processServiceMessages()
#3 /home/excellen/public_html/app/code/core/Ampersand/PaymentGateway/Model/Service/Abstract.php(220): Ampersand_PaymentGateway_Model_Service_Abstract->_authorizeAndCapture(Object(Mage_Sales_Model_Order_Payment), '40')
#4 /home/excellen/public_html/app/code/core/Ampersand/PaymentGateway/Model/Method/DirectAbstract.php(203): Ampersand_PaymentGateway_Model_Service_Abstract->capture(Object(Mage_Sales_Model_Order_Payment), '40')
#5 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(408): Ampersand_PaymentGateway_Model_Method_DirectAbstract->capture(Object(Mage_Sales_Model_Order_Payment), '40')
#6 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Order/Invoice.php(385): Mage_Sales_Model_Order_Payment->capture(Object(Mage_Sales_Model_Order_Invoice))
#7 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(569): Mage_Sales_Model_Order_Invoice->capture()
#8 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(375): Mage_Sales_Model_Order_Payment->_invoice()
#9 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Order/Payment.php(317): Mage_Sales_Model_Order_Payment->capture(NULL)
#10 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Order.php(877): Mage_Sales_Model_Order_Payment->place()
#11 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Order.php(1095): Mage_Sales_Model_Order->_placePayment()
#12 /home/excellen/public_html/app/code/core/Mage/Core/Model/Resource/Transaction.php(105): Mage_Sales_Model_Order->place()
#13 /home/excellen/public_html/app/code/core/Mage/Core/Model/Resource/Transaction.php(159): Mage_Core_Model_Resource_Transaction->_runCallbacks(Array)
#14 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(189): Mage_Core_Model_Resource_Transaction->save()
#15 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder()
#16 /home/excellen/public_html/app/code/core/Mage/Checkout/Model/Type/Onepage.php(774): Mage_Sales_Model_Service_Quote->submitAll()
#17 /home/excellen/public_html/app/code/core/Mage/Checkout/controllers/OnepageController.php(511): Mage_Checkout_Model_Type_Onepage->saveOrder()
#18 /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Checkout_OnepageController->saveOrderAction()
#19 /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch()
#20 /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match('saveOrder')
#21 /home/excellen/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch(Object(Mage_Core_Controller_Request_Http))
#22 /home/excellen/public_html/app/Mage.php(683): Mage_Core_Model_App->run()
#23 /home/excellen/public_html/index.php(87): Mage::run(Array)
#24 {main}

これは、問題があることを示しているファイルのセクションです。

/**
 * Validate the response hash from Realex.
 */
protected function _validateResponseHash()
{
    $hash = $this->_getHelper()->generateSha1Hash(
        $this->_getConfig()->getSharedSecret(),
        $this->getResponse()->getTimestamp(),
        $this->getResponse()->getMerchantId(),
        $this->getResponse()->getUniqueOrderId(),
        $this->getResponse()->getResult(),
        $this->getResponse()->getMessage(),
        $this->getResponse()->getPasref(),
        $this->getResponse()->getAuthCode()
    );

    if ($hash != $this->getResponse()->getSha1Hash()) {
        throw new Ampersand_Realex_Model_Exception_Hash(
            $this->_getHelper()->__('Hash does not match.')
        );
    }

    return $this;
}

この時点で、本当に私の知識の限界に達しました!2 つのハッシュが一致していないことは理解できますが、何が原因で、どうすれば修正できますか?

バニラ バージョンの Magento で問題を再現しようとしていますが、誰かが問題の原因を特定できる場合、または同様の問題が発生した場合は、助けていただければ幸いです。


アップデート:

クレジット カードの支払いを処理する拡張機能をさらに 2 つインストールしようとしました。以下は、SagePay プラグインのエラー ログです。

    2013-05-02T10:15:57+00:00 ERR (3): 
exception 'Mage_Core_Exception' with message 'Payment has failed, please reload checkout page and try again. Your card has not been charged.' in /home/excellen/public_html/app/Mage.php:594
Stack trace:
#0 /home/excellen/public_html/app/code/local/Ebizmarts/SagePaySuite/Model/Observer/Sales.php(127): Mage::throwException('Payment has fai...')
#1 /home/excellen/public_html/app/code/core/Mage/Core/Model/App.php(1338): Ebizmarts_SagePaySuite_Model_Observer_Sales->saveAfter(Object(Varien_Event_Observer))
#2 /home/excellen/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Ebizmarts_SagePaySuite_Model_Observer_Sales), 'saveAfter', Object(Varien_Event_Observer))
#3 /home/excellen/public_html/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('sales_order_sav...', Array)
#4 /home/excellen/public_html/app/code/core/Mage/Core/Model/Abstract.php(466): Mage::dispatchEvent('sales_order_sav...', Array)
#5 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Abstract.php(53): Mage_Core_Model_Abstract->_afterSave()
#6 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Order.php(2155): Mage_Sales_Model_Abstract->_afterSave()
#7 /home/excellen/public_html/app/code/core/Mage/Core/Model/Abstract.php(319): Mage_Sales_Model_Order->_afterSave()
#8 /home/excellen/public_html/app/code/core/Mage/Core/Model/Resource/Transaction.php(151): Mage_Core_Model_Abstract->save()
#9 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(189): Mage_Core_Model_Resource_Transaction->save()
#10 /home/excellen/public_html/app/code/core/Mage/Sales/Model/Service/Quote.php(249): Mage_Sales_Model_Service_Quote->submitOrder()
#11 /home/excellen/public_html/app/code/core/Mage/Checkout/Model/Type/Onepage.php(774): Mage_Sales_Model_Service_Quote->submitAll()
#12 /home/excellen/public_html/app/code/core/Mage/Checkout/controllers/OnepageController.php(511): Mage_Checkout_Model_Type_Onepage->saveOrder()
#13 /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Checkout_OnepageController->saveOrderAction()
#14 /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#15 /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#16 /home/excellen/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#17 /home/excellen/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#18 /home/excellen/public_html/index.php(87): Mage::run('', 'store')
#19 {main}
2013-05-02T10:15:58+00:00 ERR (3): 
exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. mail() has been disabled for security reasons' in /home/excellen/public_html/lib/Zend/Mail/Transport/Sendmail.php:137
Stack trace:
#0 /home/excellen/public_html/lib/Zend/Mail/Transport/Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 /home/excellen/public_html/lib/Zend/Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 /home/excellen/public_html/app/code/core/Mage/Core/Model/Email/Template.php(454): Zend_Mail->send()
#3 /home/excellen/public_html/app/code/core/Mage/Core/Model/Email/Template.php(506): Mage_Core_Model_Email_Template->send('david@excellent...', 'Excellent Sciss...', Array)
#4 /home/excellen/public_html/app/code/core/Mage/Checkout/Helper/Data.php(221): Mage_Core_Model_Email_Template->sendTransactional('checkout_paymen...', 'general', 'david@excellent...', 'Excellent Sciss...', Array)
#5 /home/excellen/public_html/app/code/core/Mage/Checkout/controllers/OnepageController.php(528): Mage_Checkout_Helper_Data->sendPaymentFailedEmail(Object(Mage_Sales_Model_Quote), 'Payment has fai...')
#6 /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Checkout_OnepageController->saveOrderAction()
#7 /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('saveOrder')
#8 /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 /home/excellen/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#10 /home/excellen/public_html/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#11 /home/excellen/public_html/index.php(87): Mage::run('', 'store')
#12 {main}

テスト モードで実行していたので、管理セクションに入力した詳細に関連する問題ではありませんでした。クレジット カードの支払い方法に問題があるようです (PayPal またはその他の方法を選択すると注文を正常に完了することができるため)。

本当にこれにこだわっています。誰かが助けてくれることを願っています! :(


更新: system.log 出力:

2013-05-03T08:44:20+00:00 ERR (3): Warning: include() [<a href='function.include'>function.include</a>]: Failed opening 'Mage/Realex/Model/Remote.php' for inclusion (include_path='/home/excellen/public_html/app/code/local:/home/excellen/public_html/app/code/community:/home/excellen/public_html/app/code/core:/home/excellen/public_html/lib:.:/usr/lib/php:/usr/local/lib/php')  in /home/excellen/public_html/lib/Varien/Autoload.php on line 93
2013-05-03T08:45:10+00:00 ERR (3): Warning: include(Mage/Realex/Model/Remote.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory  in /home/excellen/public_html/lib/Varien/Autoload.php on line 93
2013-05-03T08:45:10+00:00 ERR (3): Warning: include(Mage/Realex/Model/Remote.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory  in /home/excellen/public_html/lib/Varien/Autoload.php on line 93
2013-05-03T08:45:10+00:00 ERR (3): Warning: include() [<a href='function.include'>function.include</a>]: Failed opening 'Mage/Realex/Model/Remote.php' for inclusion (include_path='/home/excellen/public_html/app/code/local:/home/excellen/public_html/app/code/community:/home/excellen/public_html/app/code/core:/home/excellen/public_html/lib:.:/usr/lib/php:/usr/local/lib/php')  in /home/excellen/public_html/lib/Varien/Autoload.php on line 93
2013-05-03T08:45:19+00:00 DEBUG (7): HEADERS ALREADY SENT: <pre>[0] /home/excellen/public_html/app/code/core/Mage/Core/Controller/Response/Http.php:52
[1] /home/excellen/public_html/lib/Zend/Controller/Response/Abstract.php:766
[2] /home/excellen/public_html/app/code/core/Mage/Core/Controller/Response/Http.php:83
[3] /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php:188
[4] /home/excellen/public_html/app/code/core/Mage/Core/Model/App.php:354
[5] /home/excellen/public_html/app/Mage.php:683
[6] /home/excellen/public_html/index.php:87
</pre>
2013-05-03T08:45:38+00:00 DEBUG (7): HEADERS ALREADY SENT: <pre>[0] /home/excellen/public_html/app/code/core/Mage/Core/Controller/Response/Http.php:52
[1] /home/excellen/public_html/lib/Zend/Controller/Response/Abstract.php:766
[2] /home/excellen/public_html/app/code/core/Mage/Core/Controller/Response/Http.php:83
[3] /home/excellen/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php:188
[4] /home/excellen/public_html/app/code/core/Mage/Core/Model/App.php:354
[5] /home/excellen/public_html/app/Mage.php:683
[6] /home/excellen/public_html/index.php:87
</pre>
4

1 に答える 1

0

そのコードを編集してログを取得できますか? もしそうなら、データを印刷して結果をここに投稿できますか?

if ()コード内のステートメントの直前に次の行を追加します。使用できる便利なロギング ヘルパーがあるかどうかわからないので、STDOUT に出力しています...

print "Data to hash: " . $this->getResponse()->getTimestamp() . "." .
  $this->getResponse()->getMerchantId() . "." .
  $this->getResponse()->getUniqueOrderId() . "." .
  $this->getResponse()->getResult() . "." .
  $this->getResponse()->getMessage() . "." .
  $this->getResponse()->getPasref() . "." .
  $this->getResponse()->getAuthCode() . "\n";

print "Local hash: " . $hash . "\n";
print "Hash from XML: " . $this->getResponse()->getSha1Hash() . "\n";

(共有シークレットを印刷したり、ここに投稿したりしないでください!)

オーウェン

于 2013-05-02T14:16:35.733 に答える