Get Available Bank (Direct Deposit)
This service provides an available bank account (IBAN) for the user to transfer their deposit amount directly, without using an iframe checkout.
Endpoint
POST https://api.pancpay.org/payment/api/get-available-bank
Params
| Parameter | Type | Description | Requirement |
|---|---|---|---|
| api_id | integer | API Id for Merchant | Yes |
| api_key | string | API Key for Merchant | Yes |
| amount | decimal | The required deposit amount to find an eligible bank account | Yes |
Response
{
"code": 200,
"type": "success",
"message": "Your request has been received.",
"bank_account": {
"bankName": "Akbank",
"accountName": "Ahmet Yilmaz",
"iban": "TR000000000000000000000000"
},
"hash": "9eNhXm40VI1faX2eoqZFd7nncRYf3JLCo3be0eO923xFNAnaOF"
}
Example PHP Code
$parameters = [
'api_id' => 1,
'api_key' => 'x3dfjkasdo12332',
'amount' => 250.00
];
$url = 'https://api.pancpay.org/payment/api/get-available-bank';
$fields_string = http_build_query($parameters);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
$response = curl_exec($ch);
curl_close($ch);
$json = json_decode($response);
if ($json->code == 200) {
echo "Banka: " . $json->bank_account->bankName . "
";
echo "Hesap Sahibi: " . $json->bank_account->accountName . "
";
echo "IBAN: " . $json->bank_account->iban . "
";
} else {
echo $json->message;
}