bitpay / magento2-plugin

Magento2.x payment plugin for Bitpay.com
MIT License
13 stars 24 forks source link

IPN handler responds with HTTP 503 #23

Open pieterpoorthuis opened 7 years ago

pieterpoorthuis commented 7 years ago

bitpay_payment.log shows nothing suspicious, but IPN script returns HTTP 503 (instead of HTTP 200): [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Controller\Ipn::indexAction(), Incoming IPN message from BitPay: "{\"id\":\"asdfhjklasdfhjklas\",\"url\":\"https:\/\/test.bitpay.com\/invoice?id=asdfhjklasdfhjklas\",\"posData\":\"{\\\"orderId\\\":\\\"000000049\\\"}\",\"status\":\"paid\",\"btcPrice\":\"0.000253\",\"price\":1,\"currency\":\"USD\",\"invoiceTime\":1506431424351,\"expirationTime\":1506432324351,\"currentTime\":1506431453053,\"btcPaid\":\"0.000253\",\"btcDue\":\"0.000000\",\"rate\":3959.3,\"exceptionStatus\":false,\"buyerFields\":{\"buyerName\":\"\",\"buyerAddress1\":\"\",\"buyerAddress2\":\"\",\"buyerCity\":\"d\",\"buyerState\":\"AL\",\"buyerZip\":\"1234\",\"buyerCountry\":\"US\",\"buyerEmail\":\"test@test.com\",\"buyerPhone\":\"1234\",\"buyerNotify\":null}}" [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: {"id":"asdfhjklasdfhjklas","url":"https:\/\/test.bitpay.com\/invoice?id=asdfhjklasdfhjklas","posData":{"orderId":"000000049"},"status":"paid","btcPrice":"0.000253","price":1,"currency":"USD","invoiceTime":1506431424351,"expirationTime":1506432324351,"currentTime":1506431453053,"btcPaid":"0.000253","btcDue":"0.000000","rate":3959.3,"exceptionStatus":false,"buyerFields":{"buyerName":"","buyerAddress1":"","buyerAddress2":"","buyerCity":"d","buyerState":"AL","buyerZip":"1234","buyerCountry":"US","buyerEmail":"test@test.com","buyerPhone":"1234","buyerNotify":null}} [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Model\Method\Bitcoin::fetchInvoice(): function called with id Am3QEsA5Nskejy21c7c5ck [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getBitpayClient(): successfully created new BitPay Client object. [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getPublicKey(): did not find an existing public key, attempting to load one from the key manager. [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getKeyManager(): successfully created new BitPay KeyManager object. [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] Call to MagentoStorage::load($id) with the id of payment/bitpay/public_key successfully decrypted & unserialized the entity 0:2:...[] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getPublicKey(): successfully loaded public key from the key manager, returning that. [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getPrivateKey(): did not find an existing private key, attempting to load one from the key manager. [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] Call to MagentoStorage::load($id) with the id of payment/bitpay/private_key successfully decrypted & unserialized the entity 0:2:.... [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getPrivateKey(): successfully loaded private key from the key manager, returning that. [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Helper\Data::getToken(): successfully created new BitPay Token object. [] [] [2017-09-26 13:11:58] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Model\Method\Bitcoin::fetchInvoice(): obtained BitPay client successfully. [] [] [2017-09-26 13:11:59] Bitpay.DEBUG: [INFO] In \Bitpay\Core\Model\Method\Bitcoin::fetchInvoice(): successfully retrieved invoice id asdfhjklasdfhjklas from BitPay. [] [] [2017-09-26 13:11:59] Bitpay.DEBUG: am herepaid [] []

MarcinKozak commented 6 years ago

@pieterpoorthuis This may be occurred due fact the Magento need a lot server resources. At the same time not all errors can be reported in the payment log file. To find cause of error there is need to check another 3 different places.

By developing fixes for the module I did not received this error. Maybe reason is that I have made several fixes which fixes that issue in "background".