-
Notifications
You must be signed in to change notification settings - Fork 54
How to Use Installment or Bin Promo
There are few things that needs to be checked before installment can be used.
- MID for installment must be activated (please contact [email protected] to activate MID)
- Setup merchant server to handle checkout request. (Please see this wiki)
In order to use installment in mobile SDK, merchant server must intercept mobile SDK's request and add installment data that sent to Midtrans backend (snap).
Example of installment data.
"installment": {
"required": false,
"terms": {
"bni": [3, 6, 12],
"mandiri": [3, 6, 12],
"cimb": [3],
"bca": [3, 6, 12],
"offline": [6, 12]
}
}
-
required
--> is the installment payment required. -
terms
-> array of available installment terms of supported bank.
To filter only selected card that can use the installment, whitelist_bins
must be added too.
"whitelist_bins": [
"48111111",
"41111111"
],
Mobile SDK and Midtrans backend (snap) will check if the card number first n
digits number contains one of bins available in whitelist_bins
.
This installment object and whitelist bins need to be added at credit_card
object on mobile SDK's request.
So full example of installment data sent to Snap was like this.
{
"transaction_details": {
"order_id": "ORDER-ID",
"gross_amount": 10000
},
"credit_card": {
"secure": true,
"channel": "migs",
"bank": "bca",
"installment": {
"required": false,
"terms": {
"bni": [
3,
6,
12
],
"mandiri": [
3,
6,
12
],
"cimb": [
3
],
"bca": [
3,
6,
12
],
"offline": [
6,
12
]
}
},
"whitelist_bins": [
"48111111",
"41111111"
]
},
"item_details": [
{
"id": "ITEM1",
"price": 10000,
"quantity": 1,
"name": "Midtrans Bear"
}
],
"customer_details": {
"first_name": "TEST",
"last_name": "MIDTRANSER",
"email": "[email protected]",
"phone": "+628123456",
"billing_address": {
"first_name": "TEST",
"last_name": "MIDTRANSER",
"email": "[email protected]",
"phone": "081 2233 44-55",
"address": "Sudirman",
"city": "Jakarta",
"postal_code": "12190",
"country_code": "IDN"
},
"shipping_address": {
"first_name": "TEST",
"last_name": "MIDTRANSER",
"email": "[email protected]",
"phone": "0 8128-75 7-9338",
"address": "Sudirman",
"city": "Jakarta",
"postal_code": "12190",
"country_code": "IDN"
}
}
}
To use bin promo or whitelist bin feature, merchant server must intercept mobile SDK's request and add list of whitelist bin into request.
Whitelist bin object will be like this:
"whitelist_bins": [
"48111111",
"41111111"
]
This object needs to be added into credit_card
field.
So complete bin promo request will be like this:
{
"transaction_details": {
"order_id": "ORDER-ID",
"gross_amount": 10000
},
"credit_card": {
"secure": true,
"whitelist_bins": [
"48111111",
"41111111"
]
},
"item_details": [
{
"id": "ITEM1",
"price": 10000,
"quantity": 1,
"name": "Midtrans Bear"
}
],
"customer_details": {
"first_name": "TEST",
"last_name": "MIDTRANSER",
"email": "[email protected]",
"phone": "+628123456",
"billing_address": {
"first_name": "TEST",
"last_name": "MIDTRANSER",
"email": "[email protected]",
"phone": "081 2233 44-55",
"address": "Sudirman",
"city": "Jakarta",
"postal_code": "12190",
"country_code": "IDN"
},
"shipping_address": {
"first_name": "TEST",
"last_name": "MIDTRANSER",
"email": "[email protected]",
"phone": "0 8128-75 7-9338",
"address": "Sudirman",
"city": "Jakarta",
"postal_code": "12190",
"country_code": "IDN"
}
}
}