Showing posts with label Error: PayPal gateway has rejected request. Currency is not supported Magento. Show all posts
Showing posts with label Error: PayPal gateway has rejected request. Currency is not supported Magento. Show all posts

Wednesday 9 November 2016

PayPal gateway has rejected request. Currency is not supported paypal Express error magento



PayPal gateway has rejected request. Currency is not supported paypal Express error magento

Generally People face this type error becoz of Paypal does not support requested currency. For Example : If you are trying to checkout with Indian Rupee , You would get this type of error due to paypal does not support Indian Rupee. In this condition you have to switch the your base currency to paypal supported currency. But with this solution your store price will be changed. so that here i came with small hack.

I have used small trick to rid this error. It is not good solution but sometime it is useful.

Go to app\code\core\Mage\Paypal\Model\Express\Checkout.php. Find the public function start and find below code

$this->_api->setAmount($this->_quote->getBaseGrandTotal())
            ->setCurrencyCode($this->_quote->getBaseCurrencyCode())
            ->setInvNum($this->_quote->getReservedOrderId())
            ->setReturnUrl($returnUrl)
            ->setCancelUrl($cancelUrl)
            ->setSolutionType($solutionType)
            ->setPaymentAction($this->_config->paymentAction);

Just replace the below code

$this->_api->setAmount($this->_quote->getBaseGrandTotal())
            ->setCurrencyCode('USD')
            ->setInvNum($this->_quote->getReservedOrderId())
            ->setReturnUrl($returnUrl)
            ->setCancelUrl($cancelUrl)
            ->setSolutionType($solutionType)
            ->setPaymentAction($this->_config->paymentAction);

With this trick now you will go to paypal without any error. But you have to convert the price from Base Currency to USD.

Note: This solution is only for Paypal Express Users.

That's it. Enjoy Chandresh Rana's Coding...