Appearance
Cancel VA V2
Information PG3
Key | Value |
---|---|
Hostname | https://api-stage.ifortepay.id |
Path | /va/cancel |
HTTP Method | POST |
##Headers
Key | Format | Required | Value |
---|---|---|---|
Content-Type | application/json | M | |
Authorization | String | M | { Authorization } |
x-req-signature | String | M | { x-req-signature } |
x-version | String | M | v3 |
##Example |
Body raw
json
{
"external_id":"",
"order_id":"",
"transaction_id":"",
"payment_method":"BANK_TRANSFER",
"payment_channel":"{{channel}}"
}
Example Request
shell
curl --location 'https://api-stage.ifortepay.id/va/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: {{Authorization}}' \
--header 'x-req-signature: {{x-req-signature}}' \
--header 'x-version: v3' \
--data '{
"external_id":"39482906889734",
"order_id":"13499387088062",
"transaction_id":"604b987e-8e51-4470-9a18-6d8b58b45472",
"payment_method":"BANK_TRANSFER",
"payment_channel":"BCA-POLYTRON"
}'
go
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api-stage.ifortepay.id/va/cancel"
method := "POST"
payload := strings.NewReader(`{
"external_id":"39482906889734",
"order_id":"13499387088062",
"transaction_id":"604b987e-8e51-4470-9a18-6d8b58b45472",
"payment_method":"BANK_TRANSFER",
"payment_channel":"BCA-POLYTRON"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "{{Authorization}}")
req.Header.Add("x-req-signature", "{{x-req-signature}}")
req.Header.Add("x-version", "v3")
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 = JSON.stringify({
"external_id": "39482906889734",
"order_id": "13499387088062",
"transaction_id": "604b987e-8e51-4470-9a18-6d8b58b45472",
"payment_method": "BANK_TRANSFER",
"payment_channel": "BCA-POLYTRON"
});
var config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api-stage.ifortepay.id/va/cancel',
headers: {
'Content-Type': 'application/json',
'Authorization': '{{Authorization}}',
'x-req-signature': '{{x-req-signature}}',
'x-version': 'v3'
},
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 = [
'Content-Type' => 'application/json',
'Authorization' => '{{Authorization}}',
'x-req-signature' => '{{x-req-signature}}',
'x-version' => 'v3'
];
$body = '{
"external_id": "39482906889734",
"order_id": "13499387088062",
"transaction_id": "604b987e-8e51-4470-9a18-6d8b58b45472",
"payment_method": "BANK_TRANSFER",
"payment_channel": "BCA-POLYTRON"
}';
$request = new Request('POST', 'https://api-stage.ifortepay.id/va/cancel', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Example Response
json
{
"transaction_id": "604b987e-8e51-4470-9a18-6d8b58b45472",
"external_id": "39482906889734",
"order_id": "13499387088062",
"payment_method": "BANK_TRANSFER",
"payment_channel": "BCA-POLYTRON",
"transaction_status": "CANCELED",
"response_code": "00"
}