Appearance
Notification Callback Payment Page
MCP API is returning the mcp-signature
in header. This is the digital signature for your request. Always check and compare our mcp-signature header with your order signature first, to ensure that the callback is true and match with your order detail, before you update your transaction order status based on the callback value.
Please make sure to always return these to MCP :
1. Http Status Code 200
2. Header content type: application/json
3. Body Response JSON, e.g: {"message":"SUCCESS"}
Our Notification Callback will retrying 3 times if the requirement above doesn't satisfied.
Transaction Status List
Below is all the possible value of transaction_status that merchant can get on callback.
Name | Description |
---|---|
SUCCESS | Transaction has been paid |
FAILED | Transaction request has been failed. Failure transaction can be caused by various reasons, but mostly it is caused when issuer fails to respond. This occurs rarely. This callback will send every attempt payment that failed. |
EXPIRED | Transaction Expired. This callback still be sent as final callback when all attempt payment failed. |
##Information
Hostname | |
---|---|
HTTP Method | POST |
Headers
Key | Format | Required | Value |
---|---|---|---|
Content-Type | application/json | M | |
mcp-signature | sha256(transactionid + x-req-signature) | mcp-signature | sha256(transactionid + x-req-signature) |
Example
Body raw
json
{
"transaction_id": "{{transaction_id}}",
"order_id": "{{order_id}}",
"external_id": "{{external_id}}",
"currency": "IDR",
"transaction_status": "{{transaction_status: SUCCESS / EXPIRED / FAILED}}",
"response_message": "{{response message transaction}}",
"payment_method": "CARD",
"payment_channel": "CARD",
"acq": "{{acquirer}}",
"paid_date": "{{paid_date, e.g:2021-06-10T11:10:02.168Z}}",
"amount": {{amount}},
"selected_channels": [
{
"channel": "{{selected channel, e.g: CARD}}",
"acq": "{{selected acquirer, e.g: BCACC}}"
}
],
"is_customer_paying_fee": false,
"item_details": [
{
"item_id": "{{item_id}}",
"name": "{{item_name}}",
"amount": {{item_price_amount}},
"qty": {{item_qty}}
},
...
],
"save_card": false,
"customer_details": {
"full_name": "{{customer_fullname}}",
"email": "{{customer_email}}",
"phone": "{{customer_phone}}",
"address": "{{customer_address}}",
"is_email_show": false,
"is_phone_show": false
},
"shipping_address": {
"full_name": "{{shipping_fullname}}",
"phone": "{{shipping_phone}}",
"address": "{{shipping_address}}",
"city": "{{shipping_city}}",
"postal_code": "{{shipping_postal_code}}",
"country": "{{shipping_country}}"
},
"billing_address": {
"full_name": "{{billing_fullname}}",
"phone": "{{billing_phone}}",
"address": "{{billing_address}}",
"city": "{{billing_city}}",
"postal_code": "{{billing_postal_code}}",
"country": "{{billing_country}}"
},
"callback_url": "{{merchant_callback_url}}",
"success_redirect_url": "{{merchant_success_redirect_url}}",
"failed_redirect_url": "{{merchant_failed_redirect_url}}",
"expired_time": "{{order_expired_time, e.g: 2021-06-10T11:06:57.856+07:00}}"
}
Example Request
shell
curl --location -g '{{merchant_callback_urll}}' \
--header 'mcp-signature: 1234123131313131' \
--data '{
"transaction_id": "{{transaction_id}}",
"order_id": "{{order_id}}",
"external_id": "{{external_id}}",
"currency": "IDR",
"transaction_status": "{{transaction_status: SUCCESS / EXPIRED / FAILED}}",
"response_message":"{{response message transaction}}",
"payment_method": "CARD",
"payment_channel": "CARD",
"acq": "{{acquirer}}",
"paid_date": "{{paid_date, e.g:2021-06-10T11:10:02.168Z}}",
"amount": {{amount}},
"selected_channels": [
{
"channel": "{{selected channel, e.g: CARD}}",
"acq": "{{selected acquirer, e.g: BCACC}}"
}
],
"is_customer_paying_fee": false,
"item_details": [
{
"item_id": "{{item_id}}",
"name": "{{item_name}}",
"amount": {{item_price_amount}},
"qty": {{item_qty}}
},
...
],
"save_card": false,
"customer_details": {
"full_name": "{{customer_fullname}}",
"email": "{{customer_email}}",
"phone": "{{customer_phone}}",
"address": "{{customer_address}}",
"is_email_show":false,
"is_phone_show":false
},
"shipping_address": {
"full_name": "{{shipping_fullname}}",
"phone": "{{shipping_phone}}",
"address": "{{shipping_address}}",
"city": "{{shipping_city}}",
"postal_code": "{{shipping_postal_code}}",
"country": "{{shipping_country}}"
},
"billing_address": {
"full_name": "{{billing_fullname}}",
"phone": "{{billing_phone}}",
"address": "{{billing_address}}",
"city": "{{billing_city}}",
"postal_code": "{{billing_postal_code}}",
"country": "{{billing_country}}"
},
"callback_url": "{{merchant_callback_url}}",
"success_redirect_url": "{{merchant_success_redirect_url}}",
"failed_redirect_url": "{{merchant_failed_redirect_url}}",
"expired_time": "{{order_expired_time, e.g: 2021-06-10T11:06:57.856+07:00}}"
}'
go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "{{merchant_callback_urll}}"
method := "POST"
payload := strings.NewReader(`{
"transaction_id": "{{transaction_id}}",
"order_id": "{{order_id}}",
"external_id": "{{external_id}}",
"currency": "IDR",
"transaction_status": "{{transaction_status: SUCCESS / EXPIRED / FAILED}}",
"response_message":"{{response message transaction}}",
"payment_method": "CARD",
"payment_channel": "CARD",
"acq": "{{acquirer}}",
"paid_date": "{{paid_date, e.g:2021-06-10T11:10:02.168Z}}",
"amount": {{amount}},
"selected_channels": [
{
"channel": "{{selected channel, e.g: CARD}}",
"acq": "{{selected acquirer, e.g: BCACC}}"
}
],
"is_customer_paying_fee": false,
"item_details": [
{
"item_id": "{{item_id}}",
"name": "{{item_name}}",
"amount": {{item_price_amount}},
"qty": {{item_qty}}
},
...
],
"save_card": false,
"customer_details": {
"full_name": "{{customer_fullname}}",
"email": "{{customer_email}}",
"phone": "{{customer_phone}}",
"address": "{{customer_address}}",
"is_email_show":false,
"is_phone_show":false
},
"shipping_address": {
"full_name": "{{shipping_fullname}}",
"phone": "{{shipping_phone}}",
"address": "{{shipping_address}}",
"city": "{{shipping_city}}",
"postal_code": "{{shipping_postal_code}}",
"country": "{{shipping_country}}"
},
"billing_address": {
"full_name": "{{billing_fullname}}",
"phone": "{{billing_phone}}",
"address": "{{billing_address}}",
"city": "{{billing_city}}",
"postal_code": "{{billing_postal_code}}",
"country": "{{billing_country}}"
},
"callback_url": "{{merchant_callback_url}}",
"success_redirect_url": "{{merchant_success_redirect_url}}",
"failed_redirect_url": "{{merchant_failed_redirect_url}}",
"expired_time": "{{order_expired_time, e.g: 2021-06-10T11:06:57.856+07:00}}"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("mcp-signature", "1234123131313131")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
js
var axios = require('axios');
var data = '{\n "transaction_id": "{{transaction_id}}",\n "order_id": "{{order_id}}",\n "external_id": "{{external_id}}",\n "currency": "IDR",\n "transaction_status": "{{transaction_status: SUCCESS / EXPIRED / FAILED}}",\n "response_message":"{{response message transaction}}",\n "payment_method": "CARD",\n "payment_channel": "CARD",\n "acq": "{{acquirer}}",\n "paid_date": "{{paid_date, e.g:2021-06-10T11:10:02.168Z}}",\n "amount": {{amount}},\n "selected_channels": [\n {\n "channel": "{{selected channel, e.g: CARD}}",\n "acq": "{{selected acquirer, e.g: BCACC}}"\n }\n ],\n "is_customer_paying_fee": false,\n "item_details": [\n {\n "item_id": "{{item_id}}",\n "name": "{{item_name}}",\n "amount": {{item_price_amount}},\n "qty": {{item_qty}}\n },\n ...\n ],\n "save_card": false,\n "customer_details": {\n "full_name": "{{customer_fullname}}",\n "email": "{{customer_email}}",\n "phone": "{{customer_phone}}",\n "address": "{{customer_address}}",\n "is_email_show":false,\n "is_phone_show":false\n },\n "shipping_address": {\n "full_name": "{{shipping_fullname}}",\n "phone": "{{shipping_phone}}",\n "address": "{{shipping_address}}",\n "city": "{{shipping_city}}",\n "postal_code": "{{shipping_postal_code}}",\n "country": "{{shipping_country}}"\n },\n "billing_address": {\n "full_name": "{{billing_fullname}}",\n "phone": "{{billing_phone}}",\n "address": "{{billing_address}}",\n "city": "{{billing_city}}",\n "postal_code": "{{billing_postal_code}}",\n "country": "{{billing_country}}"\n },\n "callback_url": "{{merchant_callback_url}}",\n "success_redirect_url": "{{merchant_success_redirect_url}}",\n "failed_redirect_url": "{{merchant_failed_redirect_url}}",\n "expired_time": "{{order_expired_time, e.g: 2021-06-10T11:06:57.856+07:00}}"\n}';
var config = {
method: 'post',
maxBodyLength: Infinity,
url: '{{merchant_callback_urll}}',
headers: {
'mcp-signature': '1234123131313131'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
php
use Guzzle\Client;
$client = new Client();
$headers = [
'mcp-signature' => '1234123131313131'
];
$body = '{
"transaction_id": "{{transaction_id}}",
"order_id": "{{order_id}}",
"external_id": "{{external_id}}",
"currency": "IDR",
"transaction_status": "{{transaction_status: SUCCESS / EXPIRED / FAILED}}",
"response_message":"{{response message transaction}}",
"payment_method": "CARD",
"payment_channel": "CARD",
"acq": "{{acquirer}}",
"paid_date": "{{paid_date, e.g:2021-06-10T11:10:02.168Z}}",
"amount": {{amount}},
"selected_channels": [
{
"channel": "{{selected channel, e.g: CARD}}",
"acq": "{{selected acquirer, e.g: BCACC}}"
}
],
"is_customer_paying_fee": false,
"item_details": [
{
"item_id": "{{item_id}}",
"name": "{{item_name}}",
"amount": {{item_price_amount}},
"qty": {{item_qty}}
},
...
],
"save_card": false,
"customer_details": {
"full_name": "{{customer_fullname}}",
"email": "{{customer_email}}",
"phone": "{{customer_phone}}",
"address": "{{customer_address}}",
"is_email_show":false,
"is_phone_show":false
},
"shipping_address": {
"full_name": "{{shipping_fullname}}",
"phone": "{{shipping_phone}}",
"address": "{{shipping_address}}",
"city": "{{shipping_city}}",
"postal_code": "{{shipping_postal_code}}",
"country": "{{shipping_country}}"
},
"billing_address": {
"full_name": "{{billing_fullname}}",
"phone": "{{billing_phone}}",
"address": "{{billing_address}}",
"city": "{{billing_city}}",
"postal_code": "{{billing_postal_code}}",
"country": "{{billing_country}}"
},
"callback_url": "{{merchant_callback_url}}",
"success_redirect_url": "{{merchant_success_redirect_url}}",
"failed_redirect_url": "{{merchant_failed_redirect_url}}",
"expired_time": "{{order_expired_time, e.g: 2021-06-10T11:06:57.856+07:00}}"
}';
$request = new Request('POST', '{{merchant_callback_urll}}', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();