Magento 2 Order Verification

Magento 2 Order Verification extension help prevent fake orders by validating the orders at the checkout, via OTP sent to the mobile numbers.

Table of Content

  1. Extension Installation Guide
  2. Msg91 Registration
  3. Twilio Registration
  4. Configuration
  5. API Settings
  6. OTP Custom Message Settings
  7. Order Verification in Frontend

 

  1. Extension Installation
  • 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:
    • composer require twilio/sdk
    • 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
  • That’s it.

Note: Don’t forget to install Twilio library even if you are not using Twilio SMS gateway for our extension.

 

  1. Msg91 Registration
    The extension allows the configuration of the Msg91 SMS gateway to send OTP for the order verification. If you choose to use Msg91 SMS gateway integration, follow the steps below to get the sender ID and API key.


 

  • You will get and code or a magic link in the Email to verify the Email address.




 

  • You will be asked to enter the mobile number for verification.




 

  • Enter the OTP to verify the mobile number and you will be registered successfully. Login with the credentials.




 

  • Under the settings, you can find the Sender ID which you need to copy and paste in the Magento configuration.




 

  • Now move to API, where you can find the API key for the Magento configuration.





 

  • You can find the Message type under the Send SMS tab. Select the SMS type in Msg91 configuration in Magento as per your requirement.




 

  1. Twilio Registration
    If you are going to use Twilio as an SMS gateway to send OTP for the order verification, you need to register with the Twilio to get Account SID, Auth Token and Twilio Phone Number.
  • First of all, Sign Up for the Twilio account. Add the details and click to get started.




 

  • After the Email verification, enter your mobile number and click to “Verify”.



 

  • Once you click “Verify”, you will get an OTP on the added mobile number. Enter the OTP and verify the mobile number. Now move to Settings > General where you can see API details both for live and testing. Copy the Account SID and Auth Token to use them in Magento backend configuration for Twilio account.




 

  • Now, click three dots from the left sidebar, go to Programmable SMS and click Build under the Learn and Build option. From here, you can get Twilio phone number to use for sending the SMSs. Click on the “Get a number” button.




 

  • You will get a number to choose. Click “Choose This Number”.




 

  • Once you click the button, you will get a Twilio phone number. Copy this number and set it in the Magento backend configuration for Twilio account. 




 

  1. Configuration
    For configuring the extension, login to Magento 2, move to Stores > Configuration > Order Verification where you can find various settings to enable the extension.
  • Order Verification: Enable the Order Verification extension from here.
  • Enable for Payment methods: Select payment methods for which you want to enable order verification.
  • Allowed Customer Groups: Select the customer groups for which you want to enable order verification.


  

  1. API Settings
    Here, you can select the SMS gateway to send SMS for the order verification. Make SMS gateway API settings here.
  • API Provider: Select the SMS gateway API.
  • Sender ID: Enter sender ID provided by the SMS gateway while registration.
  • API Key: Enter API key provided by the SMS gateway while registration.
  • API URL: Enter API URL provided by the SMS gateway while registration.
  • Message Type: Select the message type you are going to send for the order verification.
  • OTP Length: Set length of the OTP for the order verification.


 

  1. OTP Custom Message Settings
    Here, you can set custom text for the OTP SMS you will be sending to the customers for the order verification.
  • Send OTP Text: Add text for sending OTP to the customers.
  • Resend OTP Text: Enter text for the resend OTP message to the customers.


  

  1. Order Verification in Frontend
    Once the extension is enabled, whenever a customer of a specific customer group tries to place an order using a specified payment method, he gets OTP message on the registered mobile number for the order verification.


 

  • OTP SMS on Registered Mobile Number
    Customers get OTP SMS on their registered mobile number.


  

  • Resend OTP
    If customers don’t get OTP SMS, they request “Resend OTP” and they get another OTP SMS on their registered mobile number.


  

  • Order Verification Successful
    Once customer enters the correct OTP and click verify button, order verification success message is displayed and order gets placed successfully.