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:
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.
The first tab is “API Details”. You can get them from PayPal:
- Log into your PayPal Business account
- Go to “Profile”
- In the left nav, select “My selling tools”
- Find “API access” and click “Update”
- In the “NVP/SOAP API integration” section, click on “View API Signature”:
- Click “show” and copy the API Username, API Password, and Signature:
- Paste the API credentials into your OpenCart PayPal settings:
- 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”:
- In the “Order Status” tab, make selections as it fits your store, for example:
- Optionally, you can add your custom logo at the “Checkout” tab.
- 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.
- In your OpenCart Admin, go to “Extensions” – “Extensions”, and select “Modules” from the drop-down menu
- 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”.
- In your OpenCart Admin, go to “Design” – “Layouts”, locate the Checkout layout, and click the “Edit” button:
- 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:
- Next, click the “Edit” icon, and set the Status field to “Enabled”.
- 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:
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
You will see two pre-configured test accounts:
- A seller account (type: business)
- 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:
- 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:
- Go to the “General” tab, and enable the Sandbox mode:
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: “email@example.com”. Follow the prompts through the checkout process:
- Eventually, you’ll be redirected back to your store, with the option to complete the transaction:
When you are satisfied with your testing and are ready to start receiving live orders, turn off the “Sandbox” mode in the “General” settings.