Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

This is an old revision of the document!


PayPal

The setup of PayPal for osCMax store is a common area for questions within the forums. The first question you need to ask yourself is Standard or Pro?

Standard or Pro?

There are two types of service that they provide. Below is an extract from their website.

StandardPro
No technical knowledge requiredRequires some technical knowledge - .NET SDK or Java SDK or HTTPS Service
Customer is redirected to PayPal to pay and then returns to your siteCustomer remains on your site to pay – you add the functionality your site
No monthly fee. You only pay a percentage on each sale that goes through PayPal.Low monthly fee plus transaction fee
No approval requiredApproval required (approx 3-5 days)

As a rule of thumb - if you are just setting up and are expecting a reasonably light order flow as you build your new online presence then Standard is for you.

  • Once you have a decent flow or orders, ironed out all the kinks in your code, got repeat business then you can upgrade to the pay monthly Pro platform.

The PayPal Modules

Once you have made this decision you will need to pick which method you want to use within osCMax. There are a number of different PayPal modules which is the initial source of some confusion.

Standard PayPal Modules

Pro PayPal Modules

PayPal Setup v1.0

By Ulrich Iserloh - October 09, 2005

Check osCMax forum for up-to-date discussion: http://oscdox.com/PNphpBB2-viewtopic-t-5675.html

The following instructions provide step-by-step instructions on how to get PayPal IPN to work with osCMax v2.0 RC2. Four things need to be accomplished to get it to work:

  1. generating a public/private key to encrypt transmissions between osC and PayPal; this is done with OpenSSL
  2. creating an account at PayPal that serves for your live store (PayPal.com)
  3. creating a developer account at developer.PayPal.com that allows you to test transactions via the Sandbox
  4. configuring osCMax v2.0 to work with the Sandbox, and later with the live PayPal account

These instructions are based on two tutorials at http://helpdesk.lunarpages.com/faq.php?do=article&articleid=412 (OpenSSL, PayPal, osCMax) and http://www.devsource.com/article2/0,1895,1724635,00.asp (PayPal sandbox, by Paul Kimmel) which are fairly straightforward.


1. Creating Your Public Certificate and Private Key Using OpenSSL (PC)

1.1 Download and install OpenSSL on your PC if it is not already installed: http://www.slproweb.com/products/Win32OpenSSL.html OpenSSL comes for Linux and Windows. Remember where it is installed. c:\openssl is a good place.

1.2 In WindowsXP, click on Start, then Run. Type in “cmd” without the quotes to open the DOS prompt.

1.3 Creating Your Private Key with OpenSSL Using the openssl program and assuming it is installed in c:\openssl, enter the following command to create your private key. The command generates a 1024-bit RSA private key. The private key is stored in the file my-prvkey.pem :

c:\openssl\bin\openssl genrsa -out my-prvkey.pem 1024

1.4 Creating Your Public Certificate Using OpenSSL To create your certificate, enter the following openssl command, which generates a public certificate in the file my-pubcert.pem :

c:\openssl\bin\openssl req -new -key my-prvkey.pem -x509 -days 365 -out my-pubcert.pem

You will be asked several questions: Country, State, City, Company, Name, Unit (Division), Common Name (Your Name), Email Address The two files will be saved in the \bin folder where you ran openssl from. If you can't find the files, use the Finder to locate the files. You'll need them in step 2.4.4.


1. Creating Your Public Certificate and Private Key Using OpenSSL (OS-X)

(added Dec 21, 2011 JRR)

1.1 If using OSX 10.6.8 (only version I have tested) then you will find OpenSSL in your /usr/bin directory. Use Terminal and change to /usr/bin (“cd /usr/bin”) then you need to sign in as admin to be able to run OpenSSL (“login name”, Password: “whatever”). Result should be the admin name as the Prompt. Should work with earlier versions of OS-X and may work with Lion (10.7)

1.2 Test the version of OpenSSL by typing “openssl version” - should come up with something like “OpenSSL 0.9.8r 8 Feb 2011”. You need to be in /usr/bin to do this. Start OpenSSL by typing “openssl”, you should see “OpenSSL>” as the prompt.

1.3 Creating Your Private Key with OpenSSL.

Using the now running openssl program enter the following command to create your private key. The command generates a 1024-bit RSA private key. The private key is stored in the file my-prvkey.pem :

genrsa -out my-prvkey.pem 1024

1.4 Creating Your Public Certificate with OpenSSL.

To create your certificate, enter the following OpenSSL command, which generates a public certificate in the file my-pubcert.pem :

req -new -key my-prvkey.pem -x509 -days 365 -out my-pubcert.pem

You will be asked several questions: Country, State, City, Company, Name, Unit (Division), Common Name (Your Name), Email Address

1.5 Exit OpenSSL by typing “exit” to return to the root user.

The two files should be saved in the \bin folder where you ran openssl from - use the command “ls” to list the /bin directory - you should see files “my-prvkey.pem” and my-pubcert.pem“ files. If you can't find the files, use the Finder to locate the files. You'll need them in step 2.4.4.

2. Creating a PayPal Account to work with your Live Store

2.1 As I found out, this account will be the one that you are going to use with your live store, once your store has been adequately tested with the PayPal Sandbox (see 3). Hence, make sure that your choice of login and password is a smart one.

2.2 Create a new account Go to https://www.PayPal.com and click Sign Up in the top right, and select on the next page Business Account (the personal account does not allow you to accept credit cards). Follow the prompts on the next pages. Once you have your account set up, an email will be sent to the address that you just established. Click on the link to confirm that email address.

2.3 To become a verified member, you need to add and confirm a bank account.

2.4 Configure the encrypted payment settings

2.4.1 Login to your PayPal account and click on the Profile tab under My Account.

2.4.2 Click on the link on the right for Encrypted Payment Settings under Selling Preferences.

2.4.3 Click on Download to download the PayPal Public Cert. Change the name after download to PayPal_cert.pem

2.4.4 Click on Add to upload your public cert (my-pubcert.pem) that you created under step 1.4. Browse to it (c:\openssl\bin possibly) and then click Add.

2.4.5 When you get back to the Website Payment Certificates screen, you will see a Cert ID which you willl need to type in later in osCMax. Make a note of it.

2.4.6 Logout.


3. Creating a PayPal Sandbox Account for Testing Purposes

3.1 The PayPal sandbox account is somewhat confusing because the page layout is too similar to distinguish it from the account used for the (a) live store, (b) the developer account and the © testing accounts created inside the developer account. Sign-up for any of these accounts goes through a standard page layout, and only the URL allows you to figure out what you are currently accessing. I had a hell of a time login in, until I realized that I was trying to login with the right ID into the wrong URL. So, the only way to distinguish the three is to check the URL each time.

3.2 To create a PayPal developer account

3.2.1 Open your browser and browse to https://developer.PayPal.com/

3.2.2 Click the Sign Up Now link

3.2.3 Complete the sign-up process by following the instructions and clicking the Sign Up button at the bottom of that page. I suggest you use an email address that's different from the one that you used in step 2.2

3.3 After you sign up, PayPal sends you a verification e-mail. You need to follow the link as described in the message and verify that the e-mail address used belongs to you.

3.4 To create PayPal Sandbox test accounts The view of the sandbox is very straightforward, but establishing and verifying accounts can be confusing. Multiple instances of your browser are opened, and the process quickly wanders away from developer central area. It would be better if PayPal kept developers squarely planted on this page and incorporated a wizard-like approach for working in the sandbox. See also comment under step 3.1. You will need to do the following:

  • Create a fictional buyer account in the sandbox (see 3.4.1)
  • Verify the buyer's fictional e-mail address in the sandbox (see 3.4.2)
  • Add fictional bank information for buyer (see 3.4.3)
  • Verify the fictional bank information in the sandbox (see 3.4.4)
  • Create a fictional store owner account in the sandbox (see 3.4.5)

3.4.1 Creating a fictional buyer account in the sandbox

3.4.1.1 Login to your developer.PayPal.com account (established under step 3.2)

3.4.1.2 Click on the Sandbox tab. On the new page, click the Create Account link to create account for a fictional buyer.

3.4.1.3 A second browser instance opens. Follow the instructions for creating a personal or business account. For testing, it doesn't matter which you create. You'll be able to tell that you are in a testing area by the presence of a PayPal SandBox logo in the upper-right area of the page.

Your account is associated with your e-mail address, so never use a real e-mail address or a real PayPal account in the sandbox. A fictional email address such as “buyer@xyz.com” will do fine, although you have to choose an email address that's not yet in PayPal's Sandbox system.

3.4.2 Verifying Your E-mail Address After you create the account (remember to use a fictional e-mail address) the confirmation will be sent to the e-mail inbox found on the e-mail tab on the Developer Central page. To get to it, don't close the sandbox page, simply switch to the developer page's e-mail tab and look for the message with a subject “Activate Your PayPal Account”. All of your test account e-mail messages go here. Your developer account is used to distinguish your sandbox from every other developers' sandbox.

Open the activation e-mail and activate the test account by pasting the confirmation URL into a new browser window. This process is almost identical to activating a developer account. You will be prompted to enter your password that you established for this account under 3.4.1.3

3.4.3 Associating a Bank Account with Your PayPal Account After you sign in to your sandbox.PayPal.com (for fictional buyer), the next step is some instructions indicating how to verify the account. Just click continue, and you will be taken to your account page.

Your test account is “unverified”. Verification simply means to add a bank or credit card to the account. Click on Add Bank Account in left column and fill out the wizard. You can select a phony bank name, the phony routing numbers are already provided.

3.4.4 Verify the phony bank information in the sandbox You can check back in your developer.PayPal.com account under the Sandbox tab to see the updated status for your test account (“verified”)

3.5 Creating a fictional store owner account in the sandbox&&& In steps 3.4.1 through 3.4.4, you established a test account for a seller. Now repeat the same steps for a store owner, using an email address such as “store@xyz.com”.


4. Configuring PayPal IPN in osCMax v2.0 RC2

4.1 Upload your public cert, private key, and the PayPal public cert to the /admin folder. That folder should be password protected by Web Protect in Cpanel.

4.2 Install the PayPal IPN (Credit card Debit card) in the OsCommerce Admin panel (modules/payments/)

4.3 Edit the PayPal IPN module by highlighting PayPal (Credit card Debit card), then click on Edit on right

4.4 Most of the fields are self-explanatory. The main ones are:

  • Enable PayPal IPN Module: true
  • Email address: set to your seller email address on sandbox.PayPal.com (see 3.4.1.3)
    • Once you want to send the store live, set this to your email address established in step 2.2
  • Payment Zone: –none–
  • Set Preparing Order Status: Preparing PayPal IPN
  • Set PayPal Acknowledged Order Status: Processing
  • Gateway Server: Testing
    • Once you want to send the store live, set this to “Live”
  • Page Style: this can be selected at PayPal under your Profile
  • Debug E-mail Address: an address to send errors to if using testing mode first.
    • Be sure to delete the address here when done or it will keep sending emails
  • Enable Encrypted Web Payments: false
    • I tested my store transactions without encryption - if you want to check with encryption you'll need to upload a public cert that's configured for the sandbox (the one you downloaded in step 2.4.3 is for the live store)
    • Once you want to send the store live, set this to “true”
  • Your Private Key: the full home path to your private key ie like /home/username/public_html/store/admin/my-prvkey.pem (change username to your cpanel username)
  • Your public certificate: the full home path to your public cert ie like /home/username/public_html/store/admin/my-pubcert.pem
  • PayPal's public certificate: the full home path to PayPal's public cert you uploaded ie like /home/username/public_html/store/admin/PayPal_cert.pem
  • Your PayPal Public Certificate ID: the ID for the public cert you uploaded to PayPal (see 2.4.5)
  • Working directory: a temp folder under your oscommerce folder most likely exists, enter the full home path here ie like /home/username/public_html/store/temp
  • OpenSSL Location: /usr/bin/openssl

4.5 Click on Update. That is it!

4.6 Implement fix discussed by Michael Sasek in osCMax forums to make sure PayPal returns to the correct page in your shopping cart.

4.7 Make a test purchase in your store, using a fictional buyer Place items into your shopping cart, then checkout. Establish new buyer account, go through the checkout wizard. The checkout will eventually lead you to the sandbox.PayPal.com site. Login with your seller email/password established under 3.4.1.3. Confirm purchase. Paypal should return you from sandbox.PayPal.com back to your store to complete the purchase process.

4.8 Login to your sandbox.PayPal.com account (store@xyz.com) and confirm that the money from the buyer was credited. Login to your sandbox.PayPal.com account (buyer@xyz.com) and confirm that the money was deducted.

4.9 To Send Your Store Live Change settings for the following options in step 4.4:

  • Email address: set to your live store email address on www.PayPal.com (see 2.2)
  • Gateway server: Live
  • Debug E-mail Address: remove email address
  • Enable Encrypted Web Payments: true

5. Notes

5.1 If a customer fails to return to your store, the order will still process but their cart will not be emptied. You (as the store owner) will need to do it manually. The fix in step 4.6 should remedy this.

5.2 Your cert will expire in 365 days at which time you will need to regenerate it and upload it to PayPal. If you change the name, you will need to change it in your ipn settings in the oscommerce admin. You can regenerate it sooner for security.

5.3 Different currencies: Whatever currency paypal is set to use, you must also create that currency in osc admin (localization→currencies). By default only USD and EUR are setup. If the currency that paypal is set to use doesn't exist, paypal will show to total of zero during checkout (although the total shows in order confirmation).

  • Bookmark at
  • Bookmark "PayPal" at Digg
  • Bookmark "PayPal" at Furl
  • Bookmark "PayPal" at Reddit
  • Bookmark "PayPal" at Google
  • Bookmark "PayPal" at StumbleUpon
  • Bookmark "PayPal" at Technorati
  • Bookmark "PayPal" at Facebook
  • Bookmark "PayPal" at Twitter
  • Bookmark "PayPal" at Slashdot
setting_up_paypal_ipn_in_oscmax_2.0.1324513304.txt.gz · Last modified: 2011/12/21 18:21 by jrr
You are here: startsetting_up_paypal_ipn_in_oscmax_2.0
Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0