Appearance
Notification Callback VA PG3
Ifortepay will send a callback notification to the registered merchant callback URL after the transaction is completed. Upon receiving the callback, the merchant must respond with HTTP status code 200. If the merchant responds with any other HTTP status code, we will retry the callback 2 times. Information
Hostname | |
---|---|
HTTP Method | POST |
Headers
Key | Format | Required | Value |
---|---|---|---|
Content-Type | application/json | M | |
mcp-signature | String | M |
Example
Body raw
json
{
"transaction_id": "{{ifp_transaction_id}}",
"external_id": "{{merchant_external_id}}",
"order_id": "{{merchant_order_id}}",
"reference_id": "{{transaction_reference_id}}",
"currency": "IDR",
"payment_method": "BANK_TRANSFER",
"payment_channel": "{{channel, e.g: BRI, MANDIRI, BCA, etc}}",
"payment_system": "{{e.g : OPEN, CLOSED, PARTIAL}}",
"transaction_status": "{{refer to transaction status table}}",
"transaction_time": "2021-04-28T10:06:20.592+07:00",
"payment_details": {
"amount": {{payment_amount}},
"expired_time": "2021-04-28T10:21:20.163+07:00",
"transaction_description": "{{trx_description}}",
"total_amount": {{total_amount}},
"paid_time": "{{paid time, e.g: 2021-04-28T10:08:14.136+07:00}}"
},
"customer_details": {
"phone": "{{customer_phone}}",
"email": "{{customer_email}}",
"full_name": "{{customer_fullname}}"
},
"item_details": [
{
"item_id": "{{item_id}}",
"name": "{{item_name}}",
"amount": {{item_price}},
"qty": {{item_qty}},
"description": "{{item_description}}"
}
],
"billing_address": {
"phone": "{{billing_phone}}",
"address": "{{billing_address}}",
"city": "{{billing_city}}",
"postal_code": "{{billing_postal_code}}",
"country": "{{billing_country}}",
"full_name": "{{billing_fullname}}"
},
"shipping_address": {
"phone": "{{shipping_price}}",
"address": "{{shipping_address}}",
"city": "{{shipping_city}}",
"postal_code": "{{shipping_postal_code}}",
"country": "{{shipping_country}}",
"full_name": "{{shipping_fullname}}"
},
"response_code": "{{refer to response code table}}",
"issuer": "{{issuer_name, e.g: BCA, BNI, BRI, .etc. Note : only shown on transactions whose status is paid}} ",
"additional_data": "{{free text}}",
//Note: refund_history will be displayed only on refunded status
"refund_history": [
{
"refund_time": "2022-03-11T14:31:20.939+07:00",
"refund_amount": 1000
}
],
//Note: void_history will be displayed only on void status
"payment_history":[
{
"paid_amount":{{paid_amount}},
"paid_time":"{{paid_time, e.g: 2021-04-28T10:08:14.136+07:00}}",
"reference_id":"{{reference_id}}"
}
],
"transaction_type":"on_us" // on_us || off_us for identify transaction after payment
}
Example Request
shell
curl --location -g '{{merchant_callback_url}}' \
--header 'mcp-signature: {{mcp-signature}}' \
--data '{
"response_code":"00",
"transaction_id":"{{ifp_transaction_id}}",
"external_id":"{{merchant_external_id}}",
"order_id":"{{merchant_order_id}}",
"currency":"IDR",
"transaction_status":"{{refer to transaction status table}}",
"transaction_time":"{{transaction time, e.g: 2021-04-28T10:08:14.136+07:00}}",
"payment_method":"BANK_TRANSFER",
"payment_channel":"{{channel, e.g: BNI, BRI, BCA, MANDIRI, etc}}",
"additional_data":"{{additional_data}}",
"callback_url":"{{callback_url_merchant}}",
"customer_details":{
"email":"{{email}}",
"full_name":"{{full_name}}",
"phone":"{{phone}}"
},
"item_details":[
{
"item_id":"{{item_id}}",
"name":"{{item_name}}",
"amount":{{amount_of_item}},
"qty":{{quantity_item}},
"description":"{{item_description}}"
}
],
//Note : payment_history will be display only if transaction has been paid
"payment_history":[
{
"paid_amount":{{paid_amount}},
"paid_time":"{{paid_time, e.g: 2021-04-28T10:08:14.136+07:00}}",
"reference_id":"{{reference_id}}"
}
],
"payment_details":{
"payment_system":"{{ex : CLOSED,OPEN,PARTIAL}}",
"billing_name":"{{billing_name}}",
"va_number":"{{va_number}}",
"amount":{{amount}},
"total_fee_amount":{{total_fee_amount}},
"total_promo_amount":{{total_promo_amount}},
"total_amount":{{total_amount}},
"total_paid_amount":{{total_paid_amount}},
"is_multi_use":{{true/false}},
"is_customer_paying_fee":{{true/false}},
"expired_time":"expired_time, e.g: 2021-04-28T10:08:14.136+07:00",
"transaction_description":"{{transaction_description}}"
},
"billing_address": {
"phone": "{{billing_phone}}",
"address": "{{billing_address}}",
"city": "{{billing_city}}",
"postal_code": "{{billing_postal_code}}",
"country": "{{billing_country}}",
"full_name": "{{billing_fullname}}"
},
"shipping_address": {
"phone": "{{shipping_price}}",
"address": "{{shipping_address}}",
"city": "{{shipping_city}}",
"postal_code": "{{shipping_postal_code}}",
"country": "{{shipping_country}}",
"full_name": "{{shipping_fullname}}"
},
"response_code": "{{refer to response code table}}",
"issuer": "{{issuer_name, e.g: BRI, BCA, Mandiri, .etc}}",
"additional_data": "{{free text}}"
}'
go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "{{merchant_callback_url}}"
method := "POST"
payload := strings.NewReader(`{
"response_code":"00",
"transaction_id":"{{ifp_transaction_id}}",
"external_id":"{{merchant_external_id}}",
"order_id":"{{merchant_order_id}}",
"currency":"IDR",
"transaction_status":"{{refer to transaction status table}}",
"transaction_time":"{{transaction time, e.g: 2021-04-28T10:08:14.136+07:00}}",
"payment_method":"BANK_TRANSFER",
"payment_channel":"{{channel, e.g: BNI, BRI, BCA, MANDIRI, etc}}",
"additional_data":"{{additional_data}}",
"callback_url":"{{callback_url_merchant}}",
"customer_details":{
"email":"{{email}}",
"full_name":"{{full_name}}",
"phone":"{{phone}}"
},
"item_details":[
{
"item_id":"{{item_id}}",
"name":"{{item_name}}",
"amount":{{amount_of_item}},
"qty":{{quantity_item}},
"description":"{{item_description}}"
}
],
//Note : payment_history will be display only if transaction has been paid
"payment_history":[
{
"paid_amount":{{paid_amount}},
"paid_time":"{{paid_time, e.g: 2021-04-28T10:08:14.136+07:00}}",
"reference_id":"{{reference_id}}"
}
],
"payment_details":{
"payment_system":"{{ex : CLOSED,OPEN,PARTIAL}}",
"billing_name":"{{billing_name}}",
"va_number":"{{va_number}}",
"amount":{{amount}},
"total_fee_amount":{{total_fee_amount}},
"total_promo_amount":{{total_promo_amount}},
"total_amount":{{total_amount}},
"total_paid_amount":{{total_paid_amount}},
"is_multi_use":{{true/false}},
"is_customer_paying_fee":{{true/false}},
"expired_time":"expired_time, e.g: 2021-04-28T10:08:14.136+07:00",
"transaction_description":"{{transaction_description}}"
},
"billing_address": {
"phone": "{{billing_phone}}",
"address": "{{billing_address}}",
"city": "{{billing_city}}",
"postal_code": "{{billing_postal_code}}",
"country": "{{billing_country}}",
"full_name": "{{billing_fullname}}"
},
"shipping_address": {
"phone": "{{shipping_price}}",
"address": "{{shipping_address}}",
"city": "{{shipping_city}}",
"postal_code": "{{shipping_postal_code}}",
"country": "{{shipping_country}}",
"full_name": "{{shipping_fullname}}"
},
"response_code": "{{refer to response code table}}",
"issuer": "{{issuer_name, e.g: BRI, BCA, Mandiri, .etc}}",
"additional_data": "{{free text}}"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("mcp-signature", "{{mcp-signature}}")
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 = '{\t\n "response_code":"00",\t\n "transaction_id":"{{ifp_transaction_id}}",\t\n "external_id":"{{merchant_external_id}}",\t\n "order_id":"{{merchant_order_id}}",\t\n "currency":"IDR",\t\n "transaction_status":"{{refer to transaction status table}}",\t\n "transaction_time":"{{transaction time, e.g: 2021-04-28T10:08:14.136+07:00}}",\t\n "payment_method":"BANK_TRANSFER",\t\n "payment_channel":"{{channel, e.g: BNI, BRI, BCA, MANDIRI, etc}}",\t\n "additional_data":"{{additional_data}}",\t\n "callback_url":"{{callback_url_merchant}}",\t\n "customer_details":{\t\n "email":"{{email}}",\t\n "full_name":"{{full_name}}",\t\n "phone":"{{phone}}"\t\n },\t\n "item_details":[\t\n {\t\n "item_id":"{{item_id}}",\t\n "name":"{{item_name}}",\t\n "amount":{{amount_of_item}},\t\n "qty":{{quantity_item}},\t\n "description":"{{item_description}}"\t\n }\t\n ],\n //Note : payment_history will be display only if transaction has been paid\t\n "payment_history":[\t\n {\t\n "paid_amount":{{paid_amount}},\t\n "paid_time":"{{paid_time, e.g: 2021-04-28T10:08:14.136+07:00}}",\t\n "reference_id":"{{reference_id}}"\t\n }\t\n ],\t\n "payment_details":{\t\n "payment_system":"{{ex : CLOSED,OPEN,PARTIAL}}",\t\n "billing_name":"{{billing_name}}",\t\n "va_number":"{{va_number}}",\t\n "amount":{{amount}},\t\n "total_fee_amount":{{total_fee_amount}},\t\n "total_promo_amount":{{total_promo_amount}},\t\n "total_amount":{{total_amount}},\t\n "total_paid_amount":{{total_paid_amount}},\t\n "is_multi_use":{{true/false}},\t\n "is_customer_paying_fee":{{true/false}},\t\n "expired_time":"expired_time, e.g: 2021-04-28T10:08:14.136+07:00",\t\n "transaction_description":"{{transaction_description}}"\t\n },\t\n "billing_address": {\n "phone": "{{billing_phone}}",\n "address": "{{billing_address}}",\n "city": "{{billing_city}}",\n "postal_code": "{{billing_postal_code}}",\n "country": "{{billing_country}}",\n "full_name": "{{billing_fullname}}"\n },\n "shipping_address": {\n "phone": "{{shipping_price}}",\n "address": "{{shipping_address}}",\n "city": "{{shipping_city}}",\n "postal_code": "{{shipping_postal_code}}",\n "country": "{{shipping_country}}",\n "full_name": "{{shipping_fullname}}"\n },\n "response_code": "{{refer to response code table}}",\n "issuer": "{{issuer_name, e.g: BRI, BCA, Mandiri, .etc}}",\n "additional_data": "{{free text}}"\n}';
var config = {
method: 'post',
maxBodyLength: Infinity,
url: '{{merchant_callback_url}}',
headers: {
'mcp-signature': '{{mcp-signature}}'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
php
use GuzzleHttp\Client;
$client = new Client();
$headers = [
'mcp-signature' => '{{mcp-signature}}'
];
$body = '{
"response_code":"00",
"transaction_id":"{{ifp_transaction_id}}",
"external_id":"{{merchant_external_id}}",
"order_id":"{{merchant_order_id}}",
"currency":"IDR",
"transaction_status":"{{refer to transaction status table}}",
"transaction_time":"{{transaction time, e.g: 2021-04-28T10:08:14.136+07:00}}",
"payment_method":"BANK_TRANSFER",
"payment_channel":"{{channel, e.g: BNI, BRI, BCA, MANDIRI, etc}}",
"additional_data":"{{additional_data}}",
"callback_url":"{{callback_url_merchant}}",
"customer_details":{
"email":"{{email}}",
"full_name":"{{full_name}}",
"phone":"{{phone}}"
},
"item_details":[
{
"item_id":"{{item_id}}",
"name":"{{item_name}}",
"amount":{{amount_of_item}},
"qty":{{quantity_item}},
"description":"{{item_description}}"
}
],
//Note : payment_history will be display only if transaction has been paid
"payment_history":[
{
"paid_amount":{{paid_amount}},
"paid_time":"{{paid_time, e.g: 2021-04-28T10:08:14.136+07:00}}",
"reference_id":"{{reference_id}}"
}
],
"payment_details":{
"payment_system":"{{ex : CLOSED,OPEN,PARTIAL}}",
"billing_name":"{{billing_name}}",
"va_number":"{{va_number}}",
"amount":{{amount}},
"total_fee_amount":{{total_fee_amount}},
"total_promo_amount":{{total_promo_amount}},
"total_amount":{{total_amount}},
"total_paid_amount":{{total_paid_amount}},
"is_multi_use":{{true/false}},
"is_customer_paying_fee":{{true/false}},
"expired_time":"expired_time, e.g: 2021-04-28T10:08:14.136+07:00",
"transaction_description":"{{transaction_description}}"
},
"billing_address": {
"phone": "{{billing_phone}}",
"address": "{{billing_address}}",
"city": "{{billing_city}}",
"postal_code": "{{billing_postal_code}}",
"country": "{{billing_country}}",
"full_name": "{{billing_fullname}}"
},
"shipping_address": {
"phone": "{{shipping_price}}",
"address": "{{shipping_address}}",
"city": "{{shipping_city}}",
"postal_code": "{{shipping_postal_code}}",
"country": "{{shipping_country}}",
"full_name": "{{shipping_fullname}}"
},
"response_code": "{{refer to response code table}}",
"issuer": "{{issuer_name, e.g: BRI, BCA, Mandiri, .etc}}",
"additional_data": "{{free text}}"
}';
$request = new Request('POST', '{{merchant_callback_url}}', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();