Home » Magento

Magento: PayPal Website Payments Standard not displayed

9 August 2010 3,225 views Popularity: 7% Share/Bookmark

email

Problem:

I am having problem in displaying PayPal payment method in payment method section of onepage checkout in Magento.

I am using “PayPal Website Payments Standard“.

I have enabled this module from backend (System -> Configuration -> SALES -> Payment Methods -> PayPal Website Payments Standard).

I have also entered the Business Name and Business Account at “Website Payments Standard” (System -> Configuration -> SALES -> PayPal Accounts -> Website Payments Standard). I have set Sandbox Flag = Yes and Debug Flag = Yes. I am using Sandbox business name and account.

After doing all this, I think I should see the PayPal payment method option in my Checkout page on Payment methods section. But PayPal payment option is not displayed there.

Cause:

The possible cause is because base currency of your shop is not supported by PayPal.

Solution:

PayPal supports the following currencies:-

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

The above code is present in the class Mage_Paypal_Model_Standard. You can add your shop’s base currency code to the array.

Like, I have base currency code as NPR. To show PayPal payment method in my shop, I need to add NPR in the array. Like the following way:-

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

Now, PayPal payment option is displayed in payment methods section of onepage checkout.

And, to change the data sent from your site to paypal, you have to modify getStandardCheckoutFormFields() function of Mage_Paypal_Model_Standard class. This function returns an array ($rArr) with some necessary parameters. You need to change the value of ‘currency_code‘ and ‘amount‘ of the array. Currency_code can be any currency code that is supported by PayPal and Amount must be converted from your base currency to that particular currency code.

Hope this helps. Thanks.

Related posts:

  1. How Paypal works? Send and receive money from Paypal
  2. Magento: Authorize.net not displayed in Payment Information section while Checkout
  3. Magento: Payment method not displayed in Multiple Shipping Adresses Checkout
  4. Magento: Convert Price from Current Currency to Base Currency and vice-versa
  5. Magento: How to get Currency Rates?
  6. Magento: Setup Multiple Website
  7. Magento: How to change Currency symbol by Model Override ?
  8. Magento: Setup multiple currency shop
  9. Solution: Google Adsense not showing on my website blog
  10. Magento: Show Currency Selector in header
  • Newberemis

    Cuando haces pruebas con sandbox pon a ==> Debug Flag = No a mi tampoco me funcionaba pero ahora si me funciona

  • http://mobileinindia.in ritikaa

    Yes, you are very much right, you cannot open a PayPal account for Charity, if your charity is registered in India, same thing happened with me also, I applied a Charity account for my client and after completing all the formalities they just denied for the account.
    I have a suggestion for you, apply for a normal account with some other website and then use it for your Charity website, I have list of websites who are doing the same thing.
    You can also try some other Payment Gateways like CCavenue, but in case you are using Vbulletin script, I don’t think so that it may help you. The first suggestion may work for you.

  • Suzie

    You’ve got a great magento tutorials. Thanks. I got a doubt about the above post….
    Where do I find this “The above code is present in the class Mage_Paypal_Model_Standard. You can add your shop’s base currency code to the array.”
    Can you please be more specific as to where and how I should change it “you have to modify getStandardCheckoutFormFields() function of Mage_Paypal_Model_Standard class. This function returns an array ($rArr) with some necessary parameters. You need to change the value of ‘currency_code‘ and ‘amount‘ of the array.”

    My customers are in India (Rs.). Bank account in US. I would like to enter prices in Rs. in “Catalog” >Manage Products> Prices. Please help! Thanks – Suzie

  • Vinsanity68

    Mukesh, I need help on this topic. I am using magento 1.4.1.1 and protected $_allowCurrencyCode is not in the Standard Class.

  • http://blog.chapagain.com.np/ Mukesh

    It’s in Mage_Paypal_Model_Config class. And it’s in $_supportedCurrencyCodes variable.

    In Magento 1.4.*, you have to rewrite the following classes:-

    - Rewrite Mage_Paypal_Model_Config class to allow Your Currency as supported currency.
    - Rewrite Mage_Paypal_Model_Standard class to change the array parameters sent to Paypal.

    Thanks.

  • COBAY

    very useful posting !
    thank you !

  • COBAY

    thak you for kindly answer.

  • COBAY

    the below is example of your override class.

    class [your-package-name]_[your_module_name]_Model_Standard extends Mage_Paypal_Model_Standard {

    public function getStandardCheckoutFormFields(){
    $arr_paypal = parent::getStandardCheckoutFormFields();

    $original_currency_code = $arr_paypal['currency_code'];
    $original_amount = $arr_paypal['amount'];

    //convert from original amount to target amount
    //……..you should put converting code here
    //$converted_amount = ~~~~~~~~~;

    //converted value
    $arr_paypal['currency_code'] =’USD’; //one of paypal supported currencies.
    $arr_paypal['amount'] =$converted_amount;

    Mage::log(print_r($arr_paypal,true)); // [home]/var/log/system.log

    return $arr_paypal;
    }

    }

  • Sonia Reynold

    Hi anyone can tell where I can write the currency conversion code. I couldnt see no appropriate place in  Mage_Paypal_Model_Standard class to insert the code, am using Magento ver. 1.4.2.0