Skip to content

Instantly share code, notes, and snippets.

@hurlatunde
Created December 6, 2018 19:06
Show Gist options
  • Save hurlatunde/12fcb737c5369eca6a3ef6292da30fe0 to your computer and use it in GitHub Desktop.
Save hurlatunde/12fcb737c5369eca6a3ef6292da30fe0 to your computer and use it in GitHub Desktop.
try {
$url = 'https://api.paystack.co/bank/resolve?account_number='.$bankAccountNumber.'&bank_code='.$bankCode;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 400);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . CFG_PAYSTACK_SECRET_KEY,
'Content-Type: application/x-www-form-urlencoded'
]);
$request = curl_exec($ch);
curl_close($ch);
$response = json_decode($request, true);
} catch (Exception $e) {
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment