Magento 2 Worldpay for Business

 

Magento 2 Worldpay for Business by Meetanshi integrates Worldpay Business Payment Gateway with Magento 2 to accept secure online payments.

 

Table of Content

  1. Extension Installation Guide
  2. Payment Gateway Setup
  3. Configuration
  4. Worldpay for Business in Frontend
  5. Worldpay for Business in Backend

 

  1. Extension Installation
  • Find the Composer name and version of the extension in the extension’s composer.json file.
  • Login to your SSH and run:
    • composer require meetanshi/magento-2-worldpay-business --ignore-platform-reqs
  • Enter your authentication keys. Your public key is your username; your private key is your password.
  • Wait for Composer to finish updating your project dependencies and make sure there aren’t any errors.
  • To verify that the extension installed properly, run the command:
    • php bin/magento module:status Meetanshi_WorldpayHosted --ignore-platform-reqs
  • By default, the extension is probably disabled.
  • Enable the extension and clear static view files:
    • php bin/magento module:enable Meetanshi_WorldpayHosted --clear-static-content
    • php bin/magento setup:upgrade
    • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
    • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
    • php bin/magento cache:flush

 

  • For Meetanshi Customers
  • Extract the zip folder and upload our extension to the root of your Magento 2 directory via FTP.
  • Login to your SSH and run below commands step by step:
  • php bin/magento setup:upgrade
  • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
  • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
  • php bin/magento cache:flush
 
  1. Payment Gateway Setup
    Prior to configuring the extension, you must have configured the payment gateway. Login to your account, go to Setup > Installations, select your account where you need to make below settings.
  • Add <wpdisplay item="MC_callback"> in the “Payment Response URL” option.
  • Add <wpdisplay item="MC_returnurl"> in the Shopper Redirect URL” option.
  • Mark the checkbox for “Payment Response Enabled?”, “Shopper Redirect Button Enabled?”, and “Enable Mobile Pages?” options.
  • Copy the “Merchant Code” from the left sidebar and paste in the relevant field in Magento 2 extension backend.
  • If you add “MD5 secret for Transactions” here, make sure to paste the same MD5 secret code in the relevant field in Magento 2 extensions backend.
  • Add currency:amount:testMode:instId under “SignatureFields” option here.

  

  • Edit Payment Pages
    Again move to Setup > Installations and click to “Edit Payment Pages” button.




 

  • Choose Installation ID
    Now, select the Installation ID of the account for which you want to edit the page.


  

  • File Uploads
    After the installation ID selection, you will be shown with the page edit options. Select File Management from the left pane. Download files from https://meetanshi.com/media/worldpay/resultCY.zip, extract the zip and upload both the resultC.html and resultY.html files here.


  • Copy to Production
    After uploading the files, go to File Menu à Copy to Production. Here, you need to allow to copy the uploaded files to the production environment to appear on live payment page. Select “YES” copy installation files to the production environment which may take up to siz hours to finish.


  1. Configuration
    For configuring the extension, login to Magento 2, move to Sales > Payment Methods > Worldpay for Business where you can find various settings to configure the extension.
  • Enabled: Set YES to enable Worldpay for Business payment method from here.
  • Title: Enter the title of the payment method.
  • Show Worldpay Logo: Set YES to show Worldpay logo along with the payment method.
  • Sandbox Mode: Set “YES” to enable the sandbox mode.
  • Installation ID: Enter the installation ID received while registration with Worldpay.
  • Gateway URL: Enter the gateway URL received while registration with Worldpay.
  • Merchant Code: Enter the merchant code received while registration with Worldpay.
  • MD5 Secret: Enter the MD5 secret you have set while payment gateway configuration.
  • Allow Refund: Set YES to allow refunding Worldpay orders.
    • Remote Admin Installation ID: Enter remote admin installation ID received while registration with Worldpay.
    • Remote Admin Password: Enter remote admin password received while registration with Worldpay.
  • Capture Delay: Select the time (in seconds) to delay a transaction to be captured once it has been authorized. The Capture Delay parameter should be the same as you have currently set in your WorldPay account.
  • Allow Delivery Address: Set YES to allow sending the delivery address to the payment gateway
  • Fixed Contact Details: Set YES to allow customers to only see the billing details that your system has passed through to the payment gateway but not let them edit them.
  • Hide Contact Details: Set YES to hide the billing details that your system has passed through to the payment gateway from the customers.
  • Allow Auto Invoice: Set YES to automate invoice generation for the orders placed through Worldpay.
  • Payment from Applicable Countries: Select the countries to allow using this payment method.
  • Additional Information: Enter additional information to show on the checkout page.
  • Sort Order: Enter the sort order of the payment method.


 

  1. Worldpay for Business in Frontend
    Once the extension is configured, you can see Worldpay for Business enabled in frontend. When a customer adds products to cart and proceeds to checkout, he gets the options to select the payment method and continue to payment.


  

  • Redirection to Hosted Payment Page
    Once the user clicks “Continue to Payment” button from the checkout page, he gets redirected to the hosted payment page to select the payment method.


  

  • Enter Card Details
    Once you select the payment method, you can add card details based on the method selected. Verify the reCAPTCHA and make payment.


  

  • Acquirer Responses
    You need to select one of the acquirer responses and continue.


 

 

  • Worldpay for Business Details in “My Account”
    Once the payment is successful, the user will be redirected back to the website. User can see the payment details in My Account section under “My Orders” tab with the details like card type, transaction ID, authentication message, authentication code, and transaction status.


  

  1. Worldpay for Business in Backend
    The admin can also see Worldpay for Business payment method details from the backend under Sales > Orders > Order view section.