Snap Drupal Commerce Integration Steps

  1. Plugin Installation
  2. Transaction Test


  1. Drupal v8.x
  2. Drupal Commerce 8.x-2.xx
  3. PHP v5.4 or greater
  4. MySQL v5.0 or greater
  5. Midtrans plugin for Drupal v8.x [ Github | Zip ]

Installation Process

  1. Download the plugin file to your computer and unzip it, rename folder to commerce_midtrans.
  2. Using an FTP program, or your hosting control panel, upload the unzipped plugin folder to your Drupal modules installation's [Drupal folder]/modules/contrib/ directory.
  3. Open drupal admin page, open menu Extend.
  4. Look for Commerce Midtrans modules under COMMERCE (CONTRIB) group, enable by ticking the checkboxes.
  5. Scroll down and click Install.
  6. Go to Commerce > Configuration > Payment > Payment gateways.
  7. Look for Midtrans and click it.
  8. Fill the following config fields as instructed on each settings description.

    • Fill Display Name with text button that you want to display to customer.
    • Select Mode, Sandbox for testing transaction and Production for real transaction.
    • Fill Client and Server key. You can find this credential on Midtrans MAP Dashboard.
    • Other configuration are optional, you may leave it as is.
      Drupal Config

  9. Login to MAP portal to configure few options below:

    URL Role Redirect URL
    Payment Notification URL http://[your website url]/payment/notify/midtrans
    Finish Redirect URL http://[your website url]
    Error Redirect URL http://[your website url]
    Unfinish Redirect URL http://[your website url]

  1. Perform successful transaction in your online store by inputing a dummy credit card number as followed (Sandbox Mode):

    Type Visa
    Card Number 4811 1111 1111 1114
    CVV 123
    Exp. Month 01
    Exp. Year 2020

  2. Examine a few points below to ensure plugin is installed and performs properly.

    Check Point Expected Result When Unexpected Result Occurs
    Check order status in Drupal back end Order status turns into complete Check endpoint/payment notification URL setting in MAP
    Merchant receives email notification Receive notification Check MAP menu setting - email notification
    Customer receives email notification Receive notification Check MAP menu setting - email notification