Paypal Setup For Magento

Magento by default supports Paypal. But Paypal will not support all currencies of Magento as of now, for E-commerce websites which has base currencies not supported by paypal has to change their base currencies to Paypal supported Currencies. I have implemented some tricks to work with non-supported paypal currencies and tested with PayPal Website Payments Standard, note that Paypal Express Checkout is not tested.

This article is followed by the article Magento Multiple Currency Support For Paypal

Follow below steps to setup Paypal account for magento or for any platform,

Step-1 : Create a Paypal account from the Paypal developer website , if you already have normal paypal account , login to the paypal developer website with the same credentials.

Step-2 : Once you loggedin to Paypal developer website, click DashBoard on the top, and then click on the Accounts under Sandbox. Refer below image

Paypal developer account setup

Step-3 : Now you can see default Paypal Facilitator account on the list, click Clone icon on right side(3 icons marked together)of the list to duplicate the business account, a popup will open and enter the following values

New First Name & New last name -> Enter Your Store Name
New Email Address -> Enter your original Paypal Merchant Account
Paypal Balance -> Enter any dummy number less than 10000
Passowrd -> Enter passowrd which can be used for your sandbox merchant account password

and press Create New Account button to create the new sandbox account.

Step-4 : New bussiness account will be created and shows in the list, Again to create sandbox personal account, click Create Account button on the top, Create Test account form will open, enter the following values.

Country -> United States
Account Type -> Personal
Email Address -> a new email address for creating personal sandbox account.(Go with different email address other than bussiness account email to differentiate credit and debit)

Enter Password, First Name and Last Name.

Paypal balance -> enter any number less than 10000
Bank Verified Account -> Yes
Select Payment card -> Paypal
Credit Card Type -> Visa

and finally press “Create Account” Button. Now your personal account will show in the list.

Step-5 : Login to paypal sandbox account using your paypal bussiness account from Step-3(Created in paypal developer website)

Step-6 : Once you logged in to paypal sandbox account, click Profile->My Selling Tools, then selling online->website preferences click update link on the right, a new window will open to update website preferences, enter below values

Auto Return: -> On
Return URL: -> http://www.your-domain-name.com/paypal/standard/success/
Payment Data Transfer: -> On

Refer below image

Paypal Integration Website Preference

then press Save button.
You are done with Paypal setup for magento or for any platform. Like I mentioned in the article Magento Multiple Currency Support For Paypal,
Make a checkout process to test your integration and watch whether your website redirecting to Paypal sandbox account(This can be setup in magento admin system->configuration) and after completion of the payment through Paypal should automatically redirecting to your website. Once this process is completed check your magento admin panel sales->order for the status of the order. If the order status is Fraud/Suspended, then you need to do the following,

On your return page http://www.your-domain-name.com/paypal/standard/success/, pture the values transaction reference(tx), status(st) and order reference number(order_ref) and do check status == completed and whether transaction reference is blank or not, then with the order reference number update the status of the order. i.e)

$tx = $this->getRequest()->getParam(‘tx’);
$sts = $this->getRequest()->getParam(‘st’);
$orderId $this->getRequest()->getParam(‘order_ref’);
if($tx && $tx == ‘Completed’) {
//do your coding here
}

If you want any assitance, Please contact me by commenting on this article.

Leave a Comment