Thursday, June 7, 2012

Testing PayPal on Website

PayPal provides a testing tool called PayPal Sandbox to test website's PayPal's deployment. We can create pseudo buyer and seller accounts, provide the accounts with pseudo money and cards, and test the transaction and user experience. All this without putting up real money or fees. They have a User's Guide here. However, the basic steps are simple:
  • Create a Sandbox account first with some email other than the regular PayPal email. 
  • Login to the account. 
  • Inside this account, click on 'Create Preconfigured Account" and create a couple of buyer accounts and one seller account. Once these accounts are created, they are assigned a randomly generated email address. This is the login email address for that account.
  • Now, click on the radio button near buyer's account and then click on "Enter Sandbox Test Site" button below the form. This will direct you to login with buyer's generated email account and password. Without this step, Paypal will not recognize the buyer's sandbox account when we try to psedo-pay the seller later. 
  • In the website's code where the PalPal form was created, set the business email address to the sandbox's seller account's generated email address.
    <form action="" method="post">
      <input name="business" type="hidden" value="" />
      <input name="cmd" type="hidden" ...
    </form type="submit" value="PayPal">
  • Once the Sandbox seller account is set as business, all the payments go to that account, and no fees are charged
  • Now, go through the buyer's transaction. When Paypal asks for login to pay, use the Sandbox buyer generated email and pwd and login to pay with the Sandbox buyer. 
Thus the complete website flow can be tested. To check the emails PayPal will send to your account on completion of transaction, click on 'Test Email' link in Sandbox nav-bar.

Normally Sandbox transactions do not go through IPN. However, Sandbox provides separate hooks to test this. Go to the 'Test Tools' bar in the Sandbox nav-bar. Here they have IPN Simulator with which the all the different configurations of IPN can be tested.

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog.
    Really very informative post you shared here. Kindly keep blogging.
    If anyone wants to become a Front end developer learn from Javascript Online Training from India .
    or learn thru JavaScript Online Training from India.
    Nowadays JavaScript has tons of job opportunities on various vertical industry. ES6 Training in Chennai