Software to help you build a better store
SEARCH
January 17, 2006

Configuring StoreFront to use PayPal Express Checkout on a development box

A customer recently reported that if his customer used PayPal Express Checkout then Shipper did not include the ShipToEmail address. As I mentioned here, this turned out to be a small bug or oversight in StoreFront 6.7.0. To reach that point I needed to enable PayPal Express Checkout on my development/debugging site. This post explains what I did. I frequently refer to an article called "API Certificate" on the PayPal Integration Center. The article covers many of the same steps.

1. Get a PayPal API Certificate

PayPalTestAccountsI did not want to use a "real" PayPal account for testing, so I decided to get a "sandbox" account. First I signed up for an account at PayPal Developer Central. Then I created two Test Accounts. One to be the customer and one to be the merchant (which must be a Business or Premier Account). I also funded both with some funny money.

PayPalTestCertificateNext I requested an API Certificate from the test merchant account. Then I downloaded the Test Certificate that was generated (it shows up in Developer Central).

Please see Step 1 of the API Certificate article for details.

2. Encrypt the Certificate

After downloading the API certificate, I visited http://paypaltech.com/tools/pem2p12.php to encrypt the certificate into PKCS12 format. I did not follow Step 3 of the API Certificate article. They accomplish the same thing, but the web page is much easier to use. Note: if you use the web page, do not include spaces in your security phrase. I saved the encrypted certificate on my computer as sandbox_cert.p12.

3. Install the Certificate on my Server

In my testing, StoreFront will be running on my development box as an IIS5 application. Therefore, when a test "customer" uses PayPal Express Checkout, my copy of IIS will be the "client" to PayPal. That means I need to install the certificate where IIS can find it. To do this, I used WinHttpCertCfg.exe to install the encrypted certificate for the ASPNET user:

WinHttpCertCfg -i sandbox_cert.p12 -p securityphrase -c LOCAL_MACHINE\My -a ASPNET

I used the same security phrase that I used in step 2 to encrypt the certificate.

Please see Step 4 of the API Certificate article for details and a link to download WinHttpCertCfg.exe.

4. Configure StoreFront to Use the Sandbox Server

Open the StoreFront database and the PaymentProcessors table. Find the PayPal record and change TestMode from 0 to 1.

StoreFront will now correctly contact the sandbox server to start the Express Checkout transaction, but it will send the test customer to the live checkout pages. This will not work since the live and sandbox servers do not work together. So I made one small change to CPayPalExpress.vb. Note: this is only required if you are using the sandbox to test PayPal Express Checkout.

        Public Sub New()
            MyBase.New()
            MyBase.fillProcessorInfo("PayPal")
            'AFM - Fill in test server URI if in testmode
            If Me.Proc_live = 0 Then
                Me.URI = "https://www.sandbox.paypal.com/cgi-bin/webscr"
            End If
            'AFM - End
        End Sub

5. Finally, Configure StoreFront to Use PayPal Express Checkout

This is the easiest part now that everything is in place,

  • Selected Merchant Tools > Payments
  • Selected PayPal and entered,
    • Accept PayPal as a Payment Method: Checked
      this is optional
    • Accept PayPal Express Checkout: Checked
    • Certificate Type: First Party
    • PayPal Merchant ID: merchant_api1.structured-solutions.net
      this is the API Username not the merchant sandbox account name
    • PayPal Merchant Password: *******
      this is the merchant sandbox account password
    • Private-Key Password: ******
      this is the security phrase used in steps 2 and 3 above
    • Payment Type: Authorize
      you can choose Authorize or Sale for testing
  • Clicked on Save

That's it. PayPal Express Checkout worked and I was able to duplicate the error my customer reported.

This site looks much better in a browser that supports current web standards, but it is accessible to any browser. Download one now This link is to a third party web site which will open in a new window

Some parts of this site will not work effectively on this older browser.
Please consider updating your browser This link is to a third party web site which will open in a new window

SSL