Magento 2.X Community Edition – Openpay Payment Plugin / Extension

Integration Guide

Objectives and Target Audience

This guide describes how to install and configure the Openpay Payment Gateway Extension to Magento 2.X Community Edition. You should have an existing Magento installed.

Introduction

What is Magento Payment Extension?

Magento is an eCommerce platform built on open source technology, which provides online merchants with not only a flexible shopping cart system, but also control over the look‐and‐feel, content and the functionality of their online store. Magento has been fully integrated with Openpay’s online payment solutions. Installing and configuring the Hosted Payment Solution module of Openpay provide a simple, secure and convenient option for connecting to Openpay’s online payment processing platform via Magento.

Signing up for Openpay merchant account

In order to start taking payments through Openpay, you need to sign up and get approval for an Openpay merchant account. Once your application is approved, you can configure Openpay Hosted Payment Solution module and start taking payments.

Openpay provides a test account and users for training and testing purpose.

Installing and Configuring Openpay Payment Extension

Prerequisites

Before installing the Openpay module, make sure that your web server meets the following criteria:

  • Magento should be pre-installed on your web server. The Openpay module is compatible with Magento version 2.x. The installation procedure described here has been tested on Magento version 2.x
  • Supported Web Servers: Apache / nginx
  • SSL: A valid security certificate is required to work over a secure channel (HTTPS) from the Magento Admin Panel or while submitting the form data from the store‐front. Self‐signed SSL certificates are not supported
  • MySQL database with sample data
  • At least 5.6 or the later version of PHP, MySQL and web browser
  • Curl (version 7.20.0 ‐ 7.44.0)

For further details on PHP compatibility, MySQL, supported Web servers and other requirements, please refer to the Magento website: http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements2.html

Running Magento on a Windows server

Magento can be run on a Windows server.

Installation Steps

To install the extension, download and extract the zip file.

Copy and paste all the files within the Root Folder

Using server SSH Access, please go to /bin folder and run the following commands:

Then run these commands:

php magento setup:upgrade

php magento setup:di:compile

php magento setup:static-content:deploy

php magento cache:flush

Or, you can do it manually from the admin by following the path: System > Tools > Cache Management and then clicking on the ‘Flush Magento Cache’ button.

Check the status of the module by running this command: php bin/magento module:status. If Openpay_AddWidgets comes in the ‘List of enabled modules’, then you know that the module is running properly.

Admin Setup

Log in to your Magento admin account. If cron is not configured properly, you will get this error. On instructions to setup the Magento cron properly click here.

Navigate to Stores > Configuration > (on left panel) Sales > Payment Methods > Openpay Payment Method

 

  • Title: Openpay Payment Method
  • Enabled: Yes
  • Jam Auth Token: Please enter Jam Auth Token provided by Openpay
    Use the Test Jam Token below for testing:
    30000000000001183|abfea8e7-9c15-4889-bc44-0df8a05ad73c
  • Test Mode: If the website is live then set it to ‘No’. If the website is under production or under development, then set it to ‘Yes’.
  • Payment from Applicable Countries: Specific Countries
  • Payment from Specific Countries: Select Australia.
  • Run Min – Max: Click ‘Run Now!’ to get the min max amount.
    (Order amount should be greater than minimum and less than maximum to enable Openpay payment method on the frontend of your site. This value is displayed on the on Jam Token provided.)
  • Automatically Create Openpay Pending Orders: Set ‘Yes’. This will automatically cancel Openpay pending orders.
  • Automatically Create Invoice: Set ‘Yes’.
  • Frequency: Set to ‘After one hour’.
  • Debug: ‘Yes’.
  • Click ‘Save Config’ to save the settings.

Magento 2 Payment Extension

Important Note: Please setup Magento cron, otherwise auto-cancel for incomplete orders will not work. It will check the orders with status ‘Pending Openpay Approval’. If the order has Openpay active plan then it will change the order status to the processing otherwise it will cancel the orders.

How does Openpay work

If the customer chooses to checkout with items that are worth less than the total amount provided in the admin total, then Openpay will not show on the “Payment Method”.

If the amount is greater than the Minimum Order Value and Less than the Maximum Order Value which is set on admin configuration, it will allow the users to pay using Openpay Payment Method.

Click on the “Continue” tab, and the Order Review Option will be shown.

Click on the ‘Place Order’ and it will be redirected to the Openpay Payment Gateway. This will perform a HTTP POST request to Openpay.

Openpay Plan Creation

If the customer is already registered with Openpay, the following screen will be displayed:

If customer does not have an Openpay account, they will need to create one.

If the customer continues to login, then the following page will be displayed

We do not email verification code on training mode please use 123456 for verification.

.

If the customer clicks Return to Shop, the browser will return back to the checkout page.

We do not send SMS on training mode please use 111111 for verification.

If the customer clicks on ‘Submit Plan‘, a Plan Successfully Submitted page will be shown along with Today’s payment and the customer will be redirected to your site on Thank you page with order completion message.

Demo Site

Shows the placement of all the Openpay widgets and assets. You can test an Openpay plan creation on this site.

Testing

This section provides the credentials for test user and test merchant account on Openpay Training Environment to create and check your Openpay plan.

Test User

Username: testmagento@xx.yy
Password: Testing123

Test Merchant / Retailers Account

https://retailer.myopenpay.com.au/training
Username: adminmag
Password: Test123

Magento 2 Order Status

Pending Openpay Approval
If somehow a payment was declined or not completed after order placement, the order will be ‘Pending Openpay Approval’. Do not dispatch Openpay order on this status.

Processing
After successful payment order status will be ‘Processing’.

Complete
If the order is shipped or dispatch by the admin then orders status change to complete. If there is any partial refund it also changes the order to ‘Completed’.

Cancelled
If the order is cancelled by an admin user, or if ‘Automatically Cancel Openpay Pending Orders’ is set ‘Yes’ in Openpay payment settings, it will cancel the order based on the frequency of which it is configured. Openpay recommends that this frequency is set to ‘After one hour’.

Close
If the order is fully refunded by an admin user, then orders status change to ‘Close’.

Below is the detailed order status to share with your staff who look after orders, dispatch and refunds.

Refund

A refund can be done easily from the Admin panel of Magento. Choose the Openpay order you wish to refund. Order status should be Complete. (Example: order id# 000000231)

Navigate from Magento Admin Panel to Sales > Orders > Choose the Openpay order you wish to refund.

On Openpay Retailer Portal we have a plan id ‘1000001615727’.

Plan Status column on Openpay dashboard still shows the plan as Active as we haven’t refunded the plan.

Now, we have to create a credit memo for this order. 

Click on ‘Credit Memo’ button from the Magento admin order section and for that click on the Invoices (from the left panel) > Order details.

Now click on View to open invoice and click Credit Memo from the right upper corner.

Scroll down to Qty to Refund  > add qty to 1 and the refund amount as $64 with $10 shipping amount and click Refund

The Balance amount is shown below.

After the partial refund, we can see that the plan is updated and the ‘Purchase’ column amount has changed from $118 to $54.00.

On admin, the order status will show ‘Processing’ for Partial Refund.

Please Note: The order can partially refund n number of times until the full amount is refunded. You have to repeat the process the same to process another partial refund.

Full Refund

Now we are going make a full refund (Example: order id# 000000231)

Below order status is in processing mode, now we are going to create the Credit Memo the same as before.

Openpay Retailers Dashboard is showing the plan as Active (please see the screenshot below).

 For full refund navigate to Qty to Refund  > add qty to 1 and the refund amount as $54 and click Refund

On Openpay Dashboard, the Status is updated with ‘Refunded’ and worth column is showing ‘$0’. (please see the below screenshot).

 On Magento admin the order Status is ‘Closed’, with that the order is now fully refunded.

Uninstallation

In order to disable the extension, please go to Store > Configuration and then navigate to Advanced > Advanced > Disable modules output > Aopen_Openpay > Disable

FAQ

Q: For a successful purchase, what is the status in Magento?

A: After successful payment order status will be ‘Processing’ by default.

Q: When does a processing order status change to complete?

A: If the order is shipped or dispatch by the admin then the order status change to complete. Also, if there is any partial refund the order status change to complete.

Version Control Table

# Date Version Description
1 September 2017 1.1 Created payment plugin
2 July 2019 5.2 Updated payment plugin to API 5.2 
3 September 2019 5.5 Updated payment plugin to API 5.5
4 May 2020 5.5.1 Added Mutiple partial refund
5 June 2020 5.5.2 Updated the security patches