基本货币INR的Magento paypal快速结账问题

时间:2014-08-22 09:10:29

标签: php magento paypal currency express-checkout

我已经在Magento中配置了Paypal express checkout,当我将美元设置为基础货币时,它工作正常,但是我们知道Paypal不接受使用INR货币代码付款,然后它会抛出异常情况。货币不受支持'

我必须将基础货币设置为INR,是否有人遇到过这个问题?

3 个答案:

答案 0 :(得分:1)

此外,要转换INR货币值并在Paypal中显示美元金额,请按照以下步骤操作。

打开app / code / core / Mage / Paypal / Block / Standard / Redirect.php

搜索:

foreach ($standard->getStandardCheckoutFormFields() as $field=>$value) {

$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));

}

替换为:

foreach ($standard->getStandardCheckoutFormFields() as $field=>$value) {
if($field == 'amount_1'):
$from = 'INR';
$to = 'USD';
$price = $value;
$newPrice = number_format(Mage::helper('directory')->currencyConvert($price, $from, $to),2);
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$newPrice));
elseif($field == 'amount_2'):
$from = 'INR';
$to = 'USD';
$price = $value;
$newPrice = number_format(Mage::helper('directory')->currencyConvert($price, $from, $to),2);
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$newPrice));
else:
       $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
endif;
   }

它保存并关闭文件。

答案 1 :(得分:0)

当客户重定向到paypal时,您可以使用此插件修复INR及其转换为USD的问题。请参阅 here

答案 2 :(得分:-1)

在此处Magento Paypal issues with base currency INR

查看此问题

插件可用http://www.magentocommerce.com/magento-connect/paypal-all-currencies.html

或查看关于magento commerce http://www.magentocommerce.com/wiki/3_-_store_setup_and_management/payment/tweak_paypal_standard_for_non-supported_base_currency

的这篇文章

或者转到此博客以获取答案http://chandreshrana.blogspot.in/2013/12/paypal-payment-method-not-display-with.html

代码

Go to app/code/core/Mage/Paypal/Model/Config.php

Change this array
protected $_supportedCurrencyCodes = array('AUD', 'CAD', 'CZK', 'DKK', 'EUR', 'HKD', 'HUF', 'ILS', 'JPY', 'MXN','NOK', 'NZD', 'PLN', 'GBP', 'SGD', 'SEK', 'CHF', 'USD', 'TWD', 'THB');

To

protected $_supportedCurrencyCodes = array('AUD', 'CAD', 'CZK', 'DKK', 'EUR', 'HKD', 'HUF', 'ILS', 'JPY', 'MXN','NOK', 'NZD', 'PLN', 'GBP', 'SGD', 'SEK', 'CHF', 'USD', 'TWD', 'THB','INR');

Another trick :

Go to app/code/core/Mage/Paypal/Model/Standard.php

Then change this function

public function canUseForCurrency($currencyCode)
    {
return $this->getConfig()->isCurrencyCodeSupported($currencyCode);
    }

To

public function canUseForCurrency($currencyCode)
    {
   if($currencyCode == 'INR')
{
$currencyCode = 'USD';
}
return $this->getConfig()->isCurrencyCodeSupported($currencyCode);
    }