PayPal Express Checkout Install on OpenCart
PayPal Express Checkout Install on OpenCart

How to Setup PayPal Express Checkout for OpenCart and Make a Test Transaction in the Sandbox

The purpose of this guide is to provide step-by-step instructions on how to install and configure PayPal Express Checkout extension for OpenCart and complete an end-to-end transaction using PayPal’s Sandbox mode in the PayPal Developer account.

Before you begin, make sure that you have the following set up:

Step 1: Activate PayPal Express Checkout Extension in OpenCart

The latest version of OpenCart comes with PayPal Express Checkout extension pre-installed. The only thing you’ll need to do is to activate and configure it.

In your Admin panel, go to Extensions, and under “Choose the extension type” select “Payments” in the drop-down box. You’ll see a long list of available payment extensions. Scroll down and locate the “PayPal Express Checkout” extension. Click the “Install” button to activate it:

PayPal Express Checkout OpenCart Extension Install
]3 PayPal Express Checkout OpenCart Extension Install

Next, click on the “Edit” button (the blue button to the left of the “Install” button). You’ll be presented with a screen where you can fill out the configuration options.

API Details:

The first tab is “API Details”. You can get them from PayPal:

  1. Log into your PayPal Business account
  2. Go to “Profile”
  3. In the left nav, select “My selling tools”
  4. Find “API access” and click “Update”

    PayPal Business Account Profile API Access
    ]4 PayPal Business Account Profile API Access
  5. In the “NVP/SOAP API integration” section, click on “View API Signature”:

    PayPal Business Account Profile API Access View API Signature
    ]5 PayPal Business Account Profile API Access View API Signature
  6. Click “show” and copy the API Username, API Password, and Signature:

    PayPal Business Account Profile API Access View API Signature Step 2
    ]6 PayPal Business Account Profile API Access View API Signature Step 2
  7. Paste the API credentials into your OpenCart PayPal settings:

    PayPal Express Checkout OpenCart Extension Settings for API
    PayPal Express Checkout OpenCart Extension Settings for API
  8. In the “General” tab, make selections based on your store preferences, for example, your default currency. Don’t forget to set the “Status” field to “Enabled”:

    PayPal Express Checkout OpenCart Extension Settings General
    PayPal Express Checkout OpenCart Extension Settings General
  9. In the “Order Status” tab, make selections as it fits your store, for example:

    PayPal Express Checkout OpenCart Extension Settings Order Status
    PayPal Express Checkout OpenCart Extension Settings Order Status
  10. Optionally, you can add your custom logo at the “Checkout” tab.
  11. When all done, don’t forget to hit the “save” button to save your settings.

Step 2: Activate the Checkout with PayPal Button

Your PayPal extension is all set up, but for the PayPal button to appear on your checkout page, you need to activate it first.

  1. In your OpenCart Admin, go to “Extensions” – “Extensions”, and select “Modules” from the drop-down menu
  2. Scroll down and locate the “PayPal Express Checkout” option, and click “Install”. When installed, click the “Edit” button, and change the Status field to “Enabled”. Click “Save”.
  3. In your OpenCart Admin, go to “Design” – “Layouts”, locate the Checkout layout, and click the “Edit” button:

    PayPal Express Checkout OpenCart Extension Layouts Checkout
    PayPal Express Checkout OpenCart Extension Layouts Checkout
  4.  The fields in this view will look different depending on the theme you use. Locate a position where you want the PayPal button to appear, open up the drop-down and select “PayPal Express Checkout Button” in the long list of options. After that, click the “plus” icon to add the module:The fields in this view will look different depending on the theme you use. Locate a position where you want the PayPal button to appear, and
  5. Next, click the “Edit” icon, and set the Status field to “Enabled”.
  6.  To test, add a product to your cart, and go to the checkout page. You should see the “Check out with PayPal” button. The position of the button will be different depending on your theme and where you decided to place it:

    PayPal Express Checkout OpenCart Extension Shopping Cart Button
    PayPal Express Checkout OpenCart Extension Shopping Cart Button

Step 3: Make a Test Transaction in the Sandbox

  • Go to developer.paypal.com
  • Log into your developer account using your PayPal Business account credentials
  • Click to enter the dashboard (on developer.paypal.com)
  • Find the “Sandbox” section
  • Click the “Accounts” link
PayPal Sandbox Test Accounts Screen
]3 PayPal Sandbox Test Accounts Screen

You will see two pre-configured test accounts:

  1. A seller account (type: business)
  2. A buyer account (type: personal)

You can use these two accounts to simulate a purchase. You can also create a new business or personal test account.

  • Click to expand the business account, and select “Profile”
  • Select the “API Credentials” tab:
PayPal Sandbox Test Business Account API Credentials
]4 PayPal Sandbox Test Business Account API Credentials
  • Copy the username, password, and signature. Go to your OpenCart Administration, Extensions – Payments – PalPal Express Checkout. Click “edit”. In the “API Details” tab, paste the credentials into the Sandbox section:
PayPal Express Checkout OpenCart Extension Settings for Sandbox API
PayPal Express Checkout OpenCart Extension Settings for Sandbox API
  • Go to the “General” tab, and enable the Sandbox mode:
PayPal Express Checkout OpenCart Extension Settings Enable Sandbox
]6 PayPal Express Checkout OpenCart Extension Settings Enable Sandbox

Time to Make a Test Purchase

  • Go to your store, and log out of your administrator account if you are logged in. Add a product to the shopping cart, and proceed to checkout. Select “Checkout with PayPal”.
  • When prompted for login, enter the credentials for the “personal” test account in your Sandbox: “paypal-buyer@yourdomain.com”. Follow the prompts through the checkout process:
PayPal Express Checkout OpenCart Extension Sandbox Step 1
]7 PayPal Express Checkout OpenCart Extension Sandbox Step 1
  • Eventually, you’ll be redirected back to your store, with the option to complete the transaction:
PayPal Express Checkout OpenCart Extension Sandbox Step 2 Confirm Order
]8 PayPal Express Checkout OpenCart Extension Sandbox Step 2 Confirm Order

When you are satisfied with your testing and are ready to start receiving live orders, turn off the “Sandbox” mode in the “General” settings.

12 comments

  1. Awesome. the one step I was missing,

    In your OpenCart Admin, go to “Extensions” – “Extensions”, and select “Modules” from the drop-down menu

    Took a few reads and clicks to figure this out.
    Thanks for taking the time.

    • Dear Natalie Banegas!

      I would like to ask you, how I can pay with PayPal Express on my testwebshop on sandbox mode, because the button on chechout part doesn’t direct to the correct site to pay. It directs same site where I start write pay’s details.

      I use Opencart 1.5.6.4 version, and it has only one api username, key, signature.

      I have a sandbox account.

      Could you help me?

      Thanks.

  2. Natasha Banegas says:

    Thanks for your feedback David! Funny enough, it took me a few reads to figure out how to get to the “Modules” menu, too 🙂 In fact, it triggered me to write this post so I would have it documented.

  3. Hello Natasha,

    Thanks for the great post.. Now one thing i am unable to understand is, whenever i click on the “Checkout With Paypal” button, i am returned to my website’s checkout page as if i hit the page’s refresh button.

    Could you please let me know how do i setup the payment buttons for the express checkout option? It would be very much appreciated of you.

    Please note that i am using Opencart Version 1.5.6.4 and would be keen to understand how do i even start creating the Paypal Express Checkout button on the website.

    Theme i am using is Journal 2.0

    Thanks a million for your help in advance.

    Best regards,
    Essam from Egypt

    • Natalie Banegas says:

      Thank you for your question Essam, and I hope you found a resolution. It’s hard to troubleshoot without having access to your setup, as there may be many causes for your error. I learned from experience that themes are given unrestricted control over the base OpenCart system, and many themes abuse this design flaw. I would start by testing if PayPal works using a fresh OpenCart installation and the default theme.

  4. D.Karakashev says:

    Hi Natasha,
    I`m having a little problem. Everything goes good until the test. When I press the “Checkout With PayPal” I got this error: ” Security header is not valid” and it`s stucking on the same page. Any idea how to fix it?

    • Natalie Banegas says:

      Thanks for your question D, I hope you could resolve your issue. It’s hard to pinpoint the error without access to your setup. If you are testing PayPal integration on a live website, you need to have an SSL certificate installed.

  5. Niraj Budhathoki says:

    Hi Natalie,
    This was awesome and extremely helpful. Exactly got what I wanted.
    Please keep on posting such helpful article.
    Thanks again
    Niraj

  6. John says:

    Hello Natalie Banegas
    Thanks for this post – so helpful — I did the sandbox test and it worked.
    I just need to make sure that I am doing the right thing before I set my site to live mode.
    When I check on history —- the sandbox test worked BUT the order status ins “Cancelled” —- is there something wrong??? or because it is sandbox testing that is why the status of this transaction showed ‘Cancelled”?

    1. I have issue when build my site as I installed my site as a sub-domain http://store.lure-retriever.com/Store —- it is causing me problems. I can not have SSL certificate for the sub-domain — it is not working on my homepage when I have the url with SSL — this forcing me to use http — there is not problem if I have to re-install and put it as primary domain (https://lure-retriever.com)

    Please help me answer these questions. Thank You and God Bless.

  7. Chris says:

    Do you know why the PayPal Express button does not show if there are:
    a) Downloads associated with product
    b) Cart is empty (this makes sense on checkout, but not on product pages).

    FYI, I am struggling to use PP Express on product details page. A writeup on that would be awesome. Thanks for this great walk-through as well. It is the most comprehensive I have found, and it is explicit and thorough!

  8. Roel Elzinga says:

    I have nothing in the dropwown box….
    on your Admin panel, go to Extensions, and under “Choose the extension type” select “Payments” in the drop-down box.

    Website is a test site, starting to work with opencart. Version 2.3.0.2

    Best reagrds,
    Roel

Leave a Reply

Your email address will not be published. Required fields are marked *