All about Magento E-commerce Store.......MagentoForum: Magento: PayPal Website Payments Standard not displayed

Wednesday, August 24, 2011

Magento: PayPal Website Payments Standard not displayed


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.

No comments:

Post a Comment