Solving PayPal Currency Rejection Errors in Magento
Hello developers! Today we’re going to tackle a common but tricky issue that many Magento store owners face when integrating PayPal - the dreaded currency rejection error. If you’re seeing this message:
PayPal gateway has rejected request. Currency is not supported (#10605: Transaction refused because of an invalid argument. See additional error messages for details). Internal Error (#10001: Transaction failed due to internal error).
Don’t worry, we’ll get to the bottom of it together.
Understanding the Problem
The core issue here is that Magento and PayPal have a mismatch in currency settings somewhere along the line. In your case, you’ve set up the base currency as Indian Rupee (INR) which should work fine for local transactions. However, there seems to be a problem when communicating this information to PayPal.
Step-by-Step Debugging
Let’s approach this systematically and rule out potential causes:
1. Check Your PayPal Merchant Account Settings
Log into your PayPal Developer account, navigate to the merchants section, and ensure that you have activated the currency conversion feature for INR. If it’s not active, you won’t be able to process transactions in this currency.
2. Verify Magento Currency Configuration
Double-check your currency settings in the Magento admin panel:
- Go to Stores > Settings > Currency
- Make sure Indian Rupee is added as a store currency and set as the base currency.
- Ensure all necessary exchange rates are filled out correctly or imported through an API.
3. Inspect PayPal Configuration Files
Open the file app/code/core/Mage/Paypal/Model/Config.php in your favorite code editor. Look for the $allowed_currencies array and make sure it includes ‘INR’:
public static $allowed_currencies = array(
'USD',
'EUR',
// Ensure INR is also included here
);
If you don’t see ‘INR’, add it to this array. Remember to clear your cache after making any changes in the core files.
4. Check Payment Method Settings
In the Magento admin panel, navigate to System > Configuration > Sales > Payment Methods > PayPal All-in-One Solution. Under the “Currency Settings” section:
- Ensure that both “Merchant Country” and “Merchant Currency” are set correctly.
- Verify that the “Transaction Currency” matches your base currency (INR).
- Save the configuration and clear cache.
Code Snippets to Help
If you’re still having issues, let’s take a closer look at some relevant code snippets:
In app/code/core/Mage/Paypal/Model/Config.php
The getAllowedCurrencies() method is where Magento determines which currencies are acceptable for PayPal. Ensure it returns an array containing ‘INR’:
public function getAllowedCurrencies()
{
return $this->allowed_currencies;
}
In app/code/core/Mage/Paypal/Model/Standard.php
The getCurrency() method should be returning the base currency of your Magento store. Verify that it correctly fetches ‘INR’:
public function getCurrency()
{
return Mage::app()->getStore()->getCurrentCurrencyCode();
}
When to Seek Professional Help
If you’ve followed all these steps and are still encountering the currency rejection error, there might be a more complex issue at play.
I highly recommend reaching out to your Magento development partner or a trusted Magento service provider like us. We specialize in troubleshooting these kinds of PayPal integrations and can usually resolve them quickly with remote access.
Conclusion
PayPal currency rejection errors can be frustrating, but with systematic debugging and careful attention to both Magento and PayPal settings, you should be able to resolve this issue most of the time.
Remember that maintaining an up-to-date version of your Magento platform is also crucial for avoiding such compatibility issues. Regular updates ensure you have access to all the latest bug fixes and feature improvements.
Don’t hesitate to reach out if you need further assistance - we’re always here to help!