Created
December 6, 2018 19:06
-
-
Save hurlatunde/12fcb737c5369eca6a3ef6292da30fe0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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