Magento 2 Barclaycard Direct Payments

Magento 2 Barclaycard Direct Payments by Meetanshi ensures secure online payment for Magento 2 store through UK's leading Barclaycard payment gateway.

 

Table of Content

  1. Extension Installation Guide
  2. Barclaycard Account Signup and Login
  3. Configuration
  4. Barclaycard Direct Payment in Frontend
  5. Barclaycard Payment Details in Order View Backend
  6. Barclaycard Payment Method for Backend Order
  7. Refund Online for Authorized Orders

 

  1. Extension Installation
    • For Magento Marketplace Customers

      Find the extension’s Composer name and version in its composer.json file.

      • Login to your SSH and run:
        • composer require meetanshi/magento2-barclaycard-direct-payments
      • 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 is installed properly, run the command:
        • php bin/magento module:status Meetanshi_Barclaycard
      • By default, the extension is probably disabled. Enable the extension and clear static view files:
        • php bin/magento module:enable Meetanshi_Barclaycard --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. Barclaycard Account Signup and Login
    To integrate Barclaycard in Magento 2, you need to signup to create a merchant account. Simply fill the details and submit to successfully register with Barclaycard Payment Gateway.

 

  • Once you get registration details, login to either test or production account using your PSID and password.

 

  1. Configuration
    For configuring the extension, login to Magento 2, move to Stores à Configuration à Sales à Payment Methods, find the Barclaycard Direct Payment to configure.
  2. Enabled: Enable or disable Barclaycard Direct Payment extension from here.
  3. Title: Enter title for the Barclaycard Direct Payment to show in frontend.
  4. 3D Secure: Enable 3D secure.

Note: Login to Barclaycard, go to Advanced > Fraud Detection and select “Request 3D Secure” to enable the option for usage when testing.

 

  • PSPID: Enter your payment service provider ID (PSPID) you got while registration.
  • User ID: Enter user ID. Go to Barclaycard Configuration à Users to find your User ID.

 

While creating user, make sure you have ticked “Special User for API” to integrate the payment gateway in Magento 2 using this user.

 

  • Password: Enter password for the user.
  • Alias: Enter alias. Go to Barclaycard Configuration à Alias to create or find your stored alias.

 

  • Hash Algorithm: Here, you have to select the same hash algorithm you set while account creation. To find it, go to Barclaycard Configuration à Technical Information à Global Security Parameters à Hash Algorithm.

 

  • SHA-in Pass Phrase Direct Link Method: Enter SHA-in pass phrase for direct link method. You can find it at Barclaycard Configuration à Technical Information à Data & Origin Verification à Checks for Barclaycard Direct Link

 

  • Add Post Payment Page URLs: Merchants have to add post payment page URLs in Barclaycard. Go to Barclaycard Configuration à Technical Information à Transaction Feedback and find Direct HTTP Server to Server Request and add below URLs in both the fields respectively.
    • If the payment’s status is “accepted”, “on hold” or “uncertain”: Enter URL yourwebsite.com/barclaycard/payment/acceptPayment/
    • If the payment’s status is “Cancelled by the Client” or “too many rejections by the acquirer”: Enter URL yourwebsite.com/barclaycard/payment/declinePayment/

 

Note: Make sure you have selected the exact 10 parameters listed below under Barclaycard Configuration à Technical Information à Transaction Feedback à Dynamic E-Commerce parameters.

ALIASEMAIL
AMOUNTNCERROR
CARDNOORDERID
CNPAYID
CURRENCYSTATUS
ED 

 

  • Sandbox Mode: Set YES to enable sandbox mode for the payment gateway.
  • Order Prefix: Enter prefix or the orders.
  • Payment Action: Select one of the payment actions for the orders placed through Barclaycard. 
    • Authorize: Only authorizes the payment and captures the amount after invoice generation
    • Authorize and Capture: Authorizes and captures the amount and generates invoice for the orders.
  • New Order Status: Select status for the new orders.
  • Credit Card Types: Select credit card types to allow payment using them.
  • Payment from Applicable Countries: Select countries to allow use of payment method.
  • Enable Debug: Set YES to enable debug.
  • Sort Order: Enter sort order of the payment method to show in frontend.

 

 

  1. Barclaycard Direct Payment in Frontend
    Once the extension is configured, it can be seen enabled on frontend. Simply add products to cart and at checkout, you can see payment method enabled. Select it, add card details and click to finish payment and place order.

 

  • Authenticate Payment Transaction
    If 3D secure is enabled from the configuration, customers will have to authenticate the payment transaction. This authentication step may vary based on your card and bank type. Simply follow the authentication steps and submit for the successful payment.

 

  • Payment Success Message on Barclaycard Hosted Payment Page
    On successful payment, Barclaycard hosted payment page shows success message and redirects back to merchant’s website.

 

  • Barclaycard Payment Details in My Account Section
    Immediately after the order is placed, the Barclaycard payment details like payment type, card number, pay ID and status can be seen in order view under My Account section.

 

 

  1. Barclaycard Payment Details in Order View Backend
    Apart from the My Account section, Barclaycard payment details can be found in Sales à Orders à Order View section.

  1. Barclaycard Payment Method for Backend Order
    Just as frontend, Barclaycard payment method also works with backend orders. Admin needs to create new order and select Barclaycard payment method, add card details and click submit order to place order from backend using Barclaycard payment method.

 

  1. Refund Online for Authorized Orders
    If you have set “Authorize” under the “Payment Action”, you have to create an invoice for the orders manually. Go to Sales > Orders > Order View and click “Submit Invoice” to generate invoice for the order.

 

  • Online Refund for Barclaycard Authorized Orders
    If you have set “Authorize” under the “Payment Action”, to refund online for the orders, go to Sales > Orders > Order View > Invoice and click on “Credit Memo” and you can click “Refund” button to refund online for the authorized only orders.