Snap: Other Features


The tutorial below will assist you in implementing other features with Snap. If further assistance is required, please contact us at support@midtrans.com or visit our support page.

Currently, Snap provides a few additional features:

  1. Choosing of Payment Method
  2. Setting of Custom Expiration

We also provide additional feature for Credit Card Payment:

  1. Installment
  2. BIN Filter


The following provides tutorials to integrate with these features:

Choosing of Payment Method

On Snap – Integration section, all available payments for the merchant are activated by default. Under some condition, you might need to display only some of the payment methods available. You need to add this parameter:


"enabled_payments": [
    "credit_card",
    "mandiri_clickpay",
    "cimb_clicks",
    "bca_klikbca",
    "bca_klikpay",
    "bri_epay",
    "telkomsel_cash",
    "echannel",
    "bbm_money",
    "xl_tunai",
    "indosat_dompetku",
    "mandiri_ecash",
    "permata_va",
    "bca_va",
    "other_va",
    "kioson",
    "Indomaret"
]

An alias refers to a list of payment types. Adding an alias is the equivalent of adding all the payment types it refers to.

Supported aliases:

bank_transfer = permata_va, bca_va.
store = kioson, indomaret.

Example code to use this in php:

<?php
include_once('Veritrans.php');

...

$transaction = array(
    'transaction_details' => array(
        'order_id' => rand(),
        'gross_amount' => 10000 // no decimal allowed
    ),
    'enabled_payments' => array('credit_card')
);

...

?>


The code above will display only credit card payment method on Snap. redirect

Setting of Custom Expiration

Set Custom Expiry feature enables merchant to set an expiry time of payment for every transaction. Following the test transaction on integration, the sample PHP code is:

<?php
include_once('Veritrans.php');

...

$transaction = array(
    'transaction_details' => array(
        'order_id' => rand(),
        'gross_amount' => 10000 // no decimal allowed
    ),

    'expiry' => array (
      "start_time" => "2015-09-08 11:06:53 +0700",
      "unit" => "minute",
      "duration" => 1
    )
);

...

?>


Parameter Description
start_time
String(255)
(optional)
Timestamp in yyyy-MM-dd hh:mm:ss Z format. If not specified, transaction time will be used as start time (when customer charge)
duration
integer
(required)
Expiry duration
unit
String
(required)
Expiry unit. Options: day, hour, minute (plural term also accepted)

Installment

Online Installment

To activate installment feature, merchant has to make an agreement with the bank. For online installment, bank will issue special MID for installment. By using this installment MID, the transaction will be converted automatically into installment. Merchant also needs to contact a Midtrans sales representative if the MID for installment is ready. If MID is ready, merchant simply has to add the parameter installment during obtain Snap token.

Following the test transaction on integration, Example code to use this in php:

<?php
include_once('Veritrans.php');

...

$transaction = array(
    'transaction_details' => array(
        'order_id' => rand(),
        'gross_amount' => 10000
    ),

    'credit_card' => array(
        'secure' => true,
        'installment' => array(
            'required' => true,
            'terms' => array(
                'bni' => [6, 12],
                'mandiri' => [6, 12]
            )
        )
    )
);

...

?>


The following figure displays the Snap payment page with online installment feature:

Snap Installment



Offline Installment

To allow installment feature with banks which do not issue MID Installment, merchant can use offline installment feature. With offline installment feature, the transaction will be charged in full amount and the transaction will be converted into installment later.

Merchant simply has to add the parameter installment during obtain Snap token request with combination bin filter feature. The purpose of bin filter is to limit certain cards from being allowed to do offline installment, based on the agreement between merchant and issuing banks.

Following the test transaction on integration, Example code to use this in php:

<?php
include_once('Veritrans.php');

...

$transaction = array(
    'transaction_details' => array(
        'order_id' => rand(),
        'gross_amount' => 10000
    ),

    'credit_card' => array(
        'secure' => true,
        'installment' => array(
            'required' => true,
            'terms' => array(
                'offline' => [6, 12] //Offline installment terms
            )
        )
    ),
    'whitelist_bins' => array(
        '481111',
        '410505'
    )
);

...

?>


The following figure displays the Snap payment page with offline installment feature: Snap Installment2



BIN Filter

BIN filter is a feature that allows merchant to accept only Credit Card within specific set of BIN numbers, useful for certain bank promo/discount payment by accepting only credit card issued by that bank. BIN (Bank Identification Number) is the first 1-6 digit of a credit card, which identifies the bank that issues the card. A bank generally has more than one BIN.

To use this feature, merchant needs to accumulate the list of BIN that accepts promotion or simply uses the issuing bank's name. This list of BIN or issuing bank name will then become a transaction parameter whitelist_bins. This transaction can only be performed exclusively by the credit card that is included in the BIN list or BIN under particular defined issuing bank.

Following the test transaction on integration, the sample PHP code that we can make use of is:

<?php
include_once('Veritrans.php');

...

$transaction = array(
    'transaction_details' => array(
        'order_id' => rand(),
        'gross_amount' => 10000
    ),

    'whitelist_bins' => array(
        '481111',
        '411111',
        'bni'
    )
);

...

?>


The following figure displays the Snap payment page with BIN Filter feature:

Snap BIN Error
Invalid card number, because 481112 not include in whitelist_bins value.


Snap BIN Success
Valid card number, because 481111 include in whitelist_bins value.