Skip to content

Instantly share code, notes, and snippets.

@coderbyheart
Created April 11, 2013 15:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coderbyheart/5364454 to your computer and use it in GitHub Desktop.
Save coderbyheart/5364454 to your computer and use it in GitHub Desktop.
Patch for Payone Magento 3.1.2: Use customermessage instead of generic error description

Patch for Payone Magento 3.1.2

The API response contains a detailed error message, which is masked by a generic message in Payone_Core_Model_Service_Payment_Abstract::execute().

This patch creates the Mage exception with the customermessage.

diff --git a/magento/app/code/community/Payone/Core/Model/Service/Payment/Abstract.php b/magento/app/code/community/Payone/Core/Model/Service/Payment/Abstract.php
index 27bdcd1..60f0bfa 100644
--- a/magento/app/code/community/Payone/Core/Model/Service/Payment/Abstract.php
+++ b/magento/app/code/community/Payone/Core/Model/Service/Payment/Abstract.php
@@ -85,7 +85,7 @@ abstract class Payone_Core_Model_Service_Payment_Abstract
if ($response instanceof Payone_Api_Response_Error) {
/** @var $response Payone_Api_Response_Error */
- $this->throwMageException('There has been an error processing your payment');
+ $this->throwMageException($response->getCustomermessage());
}
return $response;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment