Live Chat Software by Kayako
Knowledgebase: nop-commerce
HOW TO: PayPal Standard Setup
Posted by Thang Le Toan on 15 May 2016 05:55 AM

I have successfully added PayPal Standard as my only payment option on my nopCommerce site.  Here is the way I did it/helpful notes.  This is written for the novice.  Clicking on the underlined links will take you to the mentioned sites:

NOTE:  Usually, it takes long enough between steps that the various sites will require you to re-log in, so write those passwords down and keep them handy.

1) PayPal has a "sandbox" where you can test the PayPal functionality of your site without using real accounts/money/personal information. Register to create a sandbox account.

2) Register for and watch the PayPal sandbox "on-demand" video tutorial and do as it instructs to set up a simulated buyer and seller sandbox account.  You will use these fake accounts (with fake money) to test out your websites PayPal integration.

TIP: Follow along with the video while you set up your sandbox in another window.  When you create the sandbox test buyer and seller accounts, change the provided random passwords to uncomplicated 8-character passwords like 12345678 or 11111111.  These are fake accounts, so the passwords aren't critical and you'll have to type these passwords several times in testing.


3) Once you have test buyer and seller accounts set up, open up the administration area of your nopCommerce store website in another window.  Go to configuration\payment\payment methods and go down to the PayPal Standard line and click "edit."

4) Check off the "Active" checkbox in the top section of the page.

5) Check off the "Use sandbox" checkbox in the bottom section of the page.

6) In the box that says "Business Email" fill in the email address of the test seller account you have created in the sandbox.  It is easiest to just highlight and copy this from the Test Accounts page in the sandbox and paste it in the "Business Email" box in your NopCommerce admin page.  Make sure it is the test seller e-mail address, not the test buyer address.

NOTE: When you create the test seller account in the sandbox, you supply an e-mail address for the seller, for example: seller@yourstore.com .  Please note that when the test buyer and seller accounts are established, the e-mail addresses you have supplied will have other characters inserted into them, for example: seller_1259675003_per@yourstore.com .  Use the e-mail address with the inserted characters.

7) Go back to the sandbox Test Accounts page and make sure the SELLER account is selected, then press the yellow "Enter Sandbox Test Site" button.

8) You are taken to a mirror PayPal test site which is exactly like the real, live PayPal site except that it is for testing use only.  Log in as the test seller using the password you used in setting up the user test account (12345678 or 11111111 or whatever you used).

9) Once you're logged in as the seller, click the Proflie/More Options menu.

10) Select Website Payment Preferences in the Seller Preferences column.

11) Set "Auto Return" to ON

12) In the "Return URL" box, put:  http://www.yoursite.com/PaypalPDTHandler.aspx , substituting your actual nopCommerce store website for the "www.yoursite.com" part.

NOTE: Eventually, you will set up PayPal for real (not using the sandbox for testing, but using your actual PayPal Standard account).  Use this same address for the "Return URL" when you go live.

13) Set "Payment Data Transfer" to ON

14) Keep the other selections the way they are and click the "Save" button on the bottom of the page.

15) Once you do this, a yellow shaded box will appear at the top of the page.  This yellow box will include an identity token that uniquely identifies the account.  Highlight the identity token and copy it.

NOTE: The identity token can also be found by going back to the Profile\More Options\Website Payment Preferences section and scrolling down to the "Payment Data Transfer (optional)' section.

16) Go back to your NopCommerce admin window and paste the identity token into the "PTI Identity Token" box.

17) Click "Save" near the top of the page.

18) Open a copy of your storefront in another window, log in and buy an item in your store.  Go through the entire checkout procedure, using PayPal Standard as the method of payment.

19) When you are redirected to the PayPal website, make sure it says "test store" at the top and "test site" at the bottom of the page, then log in to PayPal using the test BUYER e-mail and password you set up in the sandbox.  

NOTE: Remember that there were other characters inserted in the test buyer email in the sandbox, so it's easiest to just copy and paste the test buyer e-mail address from the test accounts page in the sandbox.  The password is the one you set up for the test buyer account (12345678 or 11111111 or whatever you used.

20) On the next page that pops up, review the order then click the "Pay Now" button.

21) You should be redirected back to your store's "Thank You" web page, where you can review the details of your order (providing your browser is set to accept redirects).  If you get an error or are redirected someplace else, recheck to make sure you have completed step 12 correctly and accurately.

22) Now go back to the PayPal sandbox and click the "Test Email" tab on the left side of the page.  This will show you the (simulated) e-mails that were sent out to the seller and buyer indicating that the transaction is complete (hopefully) and that payment has been made.

23) Go to the "Test Accounts"  section and view the details of each test account.  The buyer's account balance should have gone down the cost of the product.  The seller's account should be increased by the same amount.

24) Go back to your nopCommerce store's admin section and click on Sales\Orders.  Click on the blue "Search" button in the top right side of the page.  There should be a sale listed there--It should be the item you purchased and the payment status should indicate "paid".  If not, make sure you have completed steps 11, 12 and 13 correctly.

NOTE: This is important--I see lots of posts about error messages when PayPal sandbox redirects the buyer back to the NopCommerce website after paying.  This is because the Auto Return URL (step 12) is wrong or the identity token (step 16) is wrong.   If you reset the seller account on the sandbox Test Accounts page, you will clear the auto return URL and identity token and must start again from step 7!

25) If all looks OK, then you are ready to do it for real.  Log into your REAL PayPal Account and do steps 9-16 on your REAL PayPal account.  USE THE SAME AUTO RETURN URL as you used in your sandbox test.

26) On your store's PayPal Standard setup page, uncheck "Use Sandbox"

27) Change the "Business Email" to the business email you use as your login for your REAL PayPal Standard account.

28) Double  check to make sure your PTI identity token is the one from you REAL PayPal Standard Account (step 15 & 16)

29) Click the blue "save" button in the top right of the PayPal payment method admin page and you should be ready to go.  I like to verify this by creating a 5-cent test product in my nopCommerce store and then purchase it to make sure that all is OK on my live storefront.

Hope this helps....

--Mark

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Kayako