Opening Credit Card Tab by default using PayPal Express Checkout in Magento

One of our client wanted to have the credit card tab opened when user proceeds to checkout using PayPal. I had to search for hours doing so. Later i resolved it going through certain documentation of PayPal and searching for codes in Magento API calls for PayPal.

This is what i did. I originally posted the answer in my Stack exchange profile too.  The link for it is Adding Credit Card Tab

Please check the image for it

yK80x

So, what i did was

1) I checked for PayPal’s API Calls from developer profile. The link for it is PayPal API
To open the credit card option by default you need to pass the API with parameters LANDINGPAGE=Billing.

2) Searched for API calls in Magento for PayPal and found the file Nvp.php at app/code/core/Mage/Paypal/Model/Api/Nvp.php

3) Search for the function callSetExpressCheckout() after $this->_exportLineItems($request); enter the following line $request[‘LANDINGPAGE’] = ‘Billing’;

This is it. Now the credit card tab will be opened by default. This method will work only with PayPal Express Checkout and not with PayPal Standard checkout.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s