Jump to content

HOWTO: Sandbox tests and PayPalAPI module


Recommended Posts

There seems to be some confusion (I have been there) for using a PayPal Sandbox account for tests with PrestaShop PayPalAPI module. Below I give a small HOWTO in the hope this will save some time for others. This post does not attempt to answer any problems/error messages you may get.

There are two scenarios:
a) You just want to activate PayPal payments in PrestaShop using PayPalAPI module,
B) You want to activate PayPal payments in PrestaShop using PayPalAPI module AND you want to see the checkout experience from a customer point of view without using any real financial details, or actually buying stuff.

For scenario (a) all you have to do is to activate the PayPalAPI module, follow the steps given in module documentation at the bottom to obtain API settings and enter them into relevant boxes, ensure sandbox mode is set to "No" and you are ready to go (one hopes). If this describes you, you can safely ignore the rest of this post.

For scenario (B) you need a PayPal Developer account to use PayPal's sandbox facility, independent of any other PayPal accounts you may have as a seller or buyer. The sandbox facility comprises of a sandbox dashboard and a sandboxed clone of the real PayPal site.

Short version:

Create PayPal developer account
Create PayPal seller account in sandbox
Create PayPal buyer account(s) in sandbox
Create PrestaShop customer account(s) in PrestaShop
Make purchase and use PayPal as payment method

Long version:

1) PayPal developer account: Create a PayPal Sandbox account at https://developer.paypal.com/. Again, this account has no relation to your existing PayPal buyer/seller account (if you have one) and is only used for tests. After a while you will get a confirmation email to the email address you provided. Follow the instructions in the confirmation email and you will be granted access to the PayPal Sandbox dashboard. This is your control panel for all test related activities; you can create dummy buyer and seller accounts, watch transactions and transaction related emails in this dashboard. Also, this account is not website specific. You can use it with more than one website to run tests, and even for developing PayPalAPI like modules.

In PayPal Sandbox dashboard:

2) PayPal seller account: Create a seller account. There are two options: "Preconfigured" or "Create Manually". Unless you have a specific requirement, use a preconfigured one; it is easier. The financial details you assign to the account are not relevant but later during tests the balance of this account should change as transactions are applied to it. Login email is not externally routable so provide any prefix; PayPal will add some suffix and the domain name of the email you provided during step 1. Make a note of the email and password for later use.

You can now login to sandboxed PayPal clone as this account holder just as you would login to real PayPal website. Select the account and use "Use Sandbox Test Site" button. This will take you to a sandboxed PayPal clone. Use the credentials you noted earlier to login. If you do, remember to logout and return to your sandbox dashboard before next step.

3) After creating the seller account, under "API Credentials" menu item you will have necessary details you can use with the PrestaShop PayPalAPI module. Make a note of those API settings for later use.

4) PayPal buyer account: Create at least one (probably more) buyer account of desired configuration (country, credit card, bank balance) for tests. Again selecting "Preconfigured" will save time and effort. You can give this account any financial ability. Login email is not externally routable so provide any prefix; PayPal will add some suffix and the domain name of the email you provided during step 1. Make a note of email and password for later use. After creating the account, you can also set whether payments from this account to any seller should be processed or held for review by the seller (Payment Review: enabled/disabled), or account should be verified or not (accounts have some requirement for becoming verified, see below). After making some transactions using the test account, the account balance will be going down. You can use "Reset" to return the account to creation state.

You can now login to sandboxed PayPal clone as this account holder just as you would login to real PayPal website. Select the account and use "Use Sandbox Test Site" button. This will take you to a sandboxed PayPal clone. Use the credentials you noted earlier to login. If you do, remember to logout and return to your sandbox dashboard before next step.

Continued below...

  • Like 1
Link to comment
Share on other sites

...continued from above

In PrestaShop:

5) PrestaShop customer account: Create one (or more) PrestaShop user account which will correspond to the PayPal buyer you created in step 4. This will be your test buyer. During the account creation, you will need an email. You cannot use the one from PayPal sandbox, it is not routable. Also, there is PrestaShop one email/one account restriction. So create some free accounts with GMail, Yahoo! etc. Using a real email will allow you to see/test emails sent by PrestaShop after a purchase. Make a note of email and password.

6) Install PayPalAPI module, ensure Sandbox mode is selected and enter the API settings you obtained from step 3.

7) Login to PrestaShop as a customer using the credentials from step 5 and make a purchase, select PayPal as payment method and proceed with the checkout. When you are taken to sandboxed PayPal login, use the credentials from step 4 and complete your purchase.

8) Assuming everything is in order, after the purchase is complete, in your sandbox dashboard there should be emails under "Test Email" menu, one for the seller, one for the buyer (there may be other account activation etc emails too). You can also login to PayPal sandbox as PayPal buyer or PayPal seller (select relevant account and use "Enter Sandbox Test Site" button) and see the transactions applied to accounts. You should also have emails sent by PrestaShop in inbox of the email address you provided in step 5.

Note: After tests remember to turn off sandbox mode and replace API settings with your real PayPal account's API settings in the PayPalAPI module of PrestaShop
Note: requirements for making PayPal buyer accounts in sandbox "Verified":

Country - Give the account
----------------------------------------------
United States - Bank Account
Canada - Bank Account
Australia - Bank Account
United Kingdom - Bank Account
Germany - Bank Account or Credit Card
France - Bank Account or Credit Card
Spain - Bank Account or Credit Card
Italy - Credit Card
Netherlands - Bank Account or Credit Card

  • Like 2
Link to comment
Share on other sites

  • 6 months later...
  • 3 months later...
  • 3 years later...

hello, i'm using paypal europe module for test transaction using sandbox when i try to payment using paypal sandbox login it gives me error "We are unable to validate your information. Please try again." "At this time, we are unable to process your request. Please return to facilitator account's Test Store and try another option."

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...