Magento 2 Setup Guide

Introduction

DNA Payments are committed to providing secure eCommerce processing to as many merchants as possible. One of the ways this can be achieved is by developing plugins for the global eCommerce marketplaces - allowing merchants to add payment processing to their websites quickly with minimal setup required.

Reflecting this commitment DNA Payments are pleased to offer the DNA Payments plugin for the Magento 2 platform.

Magento 2 is the latest incarnation of the leading enterprise-class ecommerce platform, utilised by over 200,000 online retailers. In fact, it is estimated that 1 in 4 businesses are using the Magento software.

This guide details the steps needed to configure the DNA Payments plugin for Magento 2.

Plugin Pre-requisites

Before starting the setup, process there are a small number of pre-requisites which need to be in place.

  1. Create a merchant account with DNA Payments - if this has not already been done please visit https://signup.dnapayments.com to complete an application.
  2. Create an account with Magento 2 and setup your test and live websites.
  3. Obtain the installation resources and credentials.

Magento 2 Requirements

To function correctly the DNA Payments Magento plugin has a few minimum requirements as shown below.

ProductMinimum Version
Magento 2.3.0Version 7.1.3+ or 7.2.x
Magento 2.3.3Version 7.3

Credentials

CredentialDescription
Test Client IDID issued by DNA Payments for each test merchant.
Test Client SecretSecret issued by DNA Payments for each test merchant.
Test Terminal IDTest terminal ID issued by DNA Payments - unique to each merchant site.

Should any of the above details be missing please contact DNA Payments.

Installing the DNA Payments Plugin

DNA Payments are currently working with Magento to add the plugin to the Magento 2 store. Until this has been completed the plugin will need to be manually installed.

All required resources for the installation are located at https://github.com/DNA-Payments/magento-v2

The steps for the installation are detailed below.

Using Composer

Installation

No. InstructionComposer Command
1Install payment module.composer require dna/magento-2
2Upgrade modules.
php bin/magento setup:upgrade
php bin/magento setup:di:compile
3Clean Cache.
php bin/magento cache:flush
php bin/magento cache:clean
4Compile and deploy the module’s static files in Magento in production mode.
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Upgrades

No. InstructionComposer Command
1Uninstall the old version of payment modulecomposer remove dna/magento-2
2Install payment module.composer require dna/magento-2
3Upgrade modules.
php bin/magento setup:upgrade
php bin/magento setup:di:compile
4Clean Cache.
php bin/magento cache:flush
php bin/magento cache:clean
5Compile and deploy the module’s static files in Magento in production mode.
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Uninstallation

No. InstructionComposer Command
1Uninstall the old version of payment modulecomposer remove dna/magento-2
2Upgrade modules.
php bin/magento setup:upgrade
php bin/magento setup:di:compile
3Clean Cache.
php bin/magento cache:flush
php bin/magento cache:clean
4Compile and deploy the module’s static files in Magento in production mode.
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Configuring the DNA Payments Plugin

Now the installation has been completed the DNA Payments plugin needs to be configured with the test or live credentials as outlined in this page.

Step 1

From the dashboard go to Stores > Configuration > Sales >Payment Methods

Config 1

Step 2

Under the Payment Methods option all available payment methods will be displayed. Expand DNA Payments and three options will appear as shown above.

Config 2

Step 3

Firstly, expand Credentials. Enter the details as supplied by DNA Payments.

Config 3

Detailed information about fields
FieldStateDescription
EnabledMandatoryChooses whether to enable to disable the DNA Payments plugin
TitleMandatoryDescriptive text displayed to the consumer during the checkout process
Client IDConditionalMandatory if processing on live. LIVE Client ID issued by DNA Payments
Client SecretConditionalMandatory if processing on live. LIVE Secret issued by DNA Payments
Terminal IDConditionalMandatory if processing on live. LIVE Terminal ID issued by DNA Payments
Back LinkOptionalTells the DNA Payments plugin where to re-direct the consumer following the completion of a transaction
Failure Back LinkOptionalTells the DNA Payments plugin where to re-direct the consumer following the completion of an unsuccessful transaction. If this field is not populated the ‘Back Link’ will be used for all transactions regardless of result.
Gateway Order DescriptionMandatoryMessage that will appear in the DNA Payments Merchant Portal against every transaction.
Test ModeConditionalWhen selected processes all transactions against the DNA Payments test platform

Step 4

Once the Credentials have been updated the test details need to be configured should the site need to process test transactions (e.g. pre-launch or for QA testing when making site updates). Expand the Test mode account section and enter the information provided.

Config 4

Detailed information about fields

FieldStateDescription
Test Terminal IDConditionalMandatory if processing on test. Test Terminal ID issued by DNA Payments
Test Client IDConditionalMandatory if processing on test. Test Client ID issued by DNA Payments
Test SecretConditionalMandatory if processing on test. Test Secret issued by DNA Payments

Step 5

Lastly the plugin requires the user to confirm two options regarding how orders should be managed.

Payment Action - Confirms what type of payment should be processed.

ActionDescription
SaleThe payment will be authorised and automatically confirmed. A refund is required to return the money to the consumer if required.
AuthorizationThe payment will be authorised, and the funds reserved. The “Accept Payment” option must be used to accept the payment/charge the card. If the order needs to be cancelled the “Deny Payment” option should be used - the authorisation is then cancelled and a reversal attempted.
DefaultConfiguration stored in the Merchant Portal is used.

Order Status When Payment is Success - Defines the order status which should be used when the payment has been processed successfully.

This completes the configuration.

Additional Payment Actions

Accepting the Payment

When the “Payment Action” is configured as “Authorization” the payment must be accepted/charged before the goods are dispatched. The process to accept the payment is defined below.

Step 1

Select the order which requires charging by clicking the corresponding “View” option.

Accept 1

Step 2

Choose the “Accept Payment” option to charge the payment card/method used.

Accept 2

Step 3

Press “OK” to confirm the acceptance of the payment.

Accept 3

Step 4

Magento 2 confirms that the payment has been accepted.

Accept 4

Denying a Payment

In scenarios where the order is no longer required and the “Payment Action” is configured as “Authorization” the payment must be cancelled. The process to charge the order is defined below.

Step 1

Select the order which requires charging by clicking the corresponding “View” option.

Deny 1

Step 2

Choose the “Deny Payment” option to return the funds to the payment card/method used.

Deny 2

Step 3

Press “OK” to confirm the rejection of the payment.

Deny 3

Step 4

Magento 2 confirms that the payment has been denied/rejected.

Deny 4

Performing a Refund

The steps required to perform a reversal or refund are shown below.

Step 1

In the order that requires refunding select the “Invoices” option.

Refund 1

Step 2

View the invoice that requires refunding.

Refund 2

Step 3

Select the “Credit Memo” option.

Refund 3

Step 4

Update the values to reflect the amount required to refund and click the “Refund” option.

Deny 4

Step 5

When the refund has been processed Magento 2 will confirm as per the message shown above.

The audit log and totals will also show that an online refund has been processed.

Deny 5

Deny 5_2