Search code examples
magentopaypalpaymentmessage

Magento 1.8 CE Paypal Payments Pro error messages: edit customer error messages


I'm running magento 1.8 ce with Paypal Payments Pro, I'm trying to find a way to customise the error messages that are show to customers. When a payment fails due to the customer's card they see this message: "PayPal gateway has rejected request. This transaction cannot be processed (#15005: Processor Decline)." which isn't clear to a customer what the problem is.

Is there a way to change the error messages into more 'customer friendly' wording? For example "Sorry, your card has been declined, please try another method." I'm assuming Paypal generates the response message outside of Magento, so would it be possible for magento to 'read' and then overwrite them with custom versions?

So far, research has yielded very little, am I right in thinking that the messages are generated from paypal and not natively in magento?


Solution

  • app/code/core/Mage/Paypal/Model/Api/Nvp.php

    protected function _handleCallErrors($response) 
    

    { ... ...

    $exception->setMessage(Mage::helper('paypal')->__('PayPal gateway has rejected request. %s', $errorMessages));

    .... ... }