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 you do not have an Openpay account, you need to create one.

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

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

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

If one clicks on Submit Plan, and the plan is successful, the browser will be redirected to your site with “Your order has been placed” 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

Partial Refund

Choose an Openpay order you wish to partially refund.

Order Status of that order should be either ‘Complete’ or ‘Processing’. (Example: Order ID# 000000185)

Navigate from Magento Admin Panel to Sales > Orders > Choose the Openpay order you wish to partially refund and click on View. Click on Invoices > View Now, we have to create a Credit Memo for this order.

Click Credit Memo from the right upper corner. To double check if this plan is active log on to your Openpay Retailer Portal in this instance the Openpay Plan ID is ‘3000000058648’. (This is just an example your Openpay plan id will be different).

Plan Status column on Openpay dashboard will show the plan Active as we haven’t refunded the plan yet. Back to your Magento admin scroll down to Qty to Refund Under Qty to Refund change the quantity to ‘0’ on all the products except the one you want to refund and click Update Qty’s.

See the screenshot below If you wish you can refund the shipping amount by changing the value on Refund Shipping or adjust the refund manually by changing the value on Adjustment Refund and click on > Refund. Refunded order will show as follows. Back on Openpay Retailer’s Portal, after the partial refund, we can see the Openpay plan is updated, and under the ‘Purchase’ column amount has changed from $209.20 to $176.00. The plan will still show Active as the balance amount is yet to be paid off. On Magento admin, the order status will show ‘Processing’ for a partial refund. Please Note: The order can be partially refund n number of times until the full amount is refunded. You have to repeat the same process to make another partial refund.

Full Refund

Choose an Openpay order you wish to fully refund.

Order Status of that order should be either ‘Complete’ or ‘Processing’. (Example: Order ID# 000000185) Navigate from Magento Admin Panel to Sales > Orders > Choose the Openpay order you wish to partially refund and click on View. Click on Invoices > View Now, we have to create a Credit Memo for this order. Click Credit Memo from the right upper corner. To double check if this plan is active Openpay log on to your Openpay Retailer Portal in this instance the Openpay Plan ID is ‘3000000058648’. (This is just an example your Openpay plan id will be different).

Plan Status column on Openpay dashboard will show the plan Active as we haven’t refunded the plan yet. Back to your Magento admin scroll down to Refund Totals and click on Refund button this will refund the full order amount. Now the Status will be updated to ‘Closed’ You have now fully refunded the Magento Order.

You may confirm the refund on Openpay Retailers Dashboard the Openpay Plan Status will be changed to Refunded and the Purchase amount will change to $0.00

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
6 July 2020 5.5.3 Allow status code 100 and 200