Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,201,899 members, 7,980,164 topics. Date: Sunday, 20 October 2024 at 07:35 AM |
Nairaland Forum / Science/Technology / Programming / Help! Webscraping With PHP Curl Is Not Working (245 Views)
Problems Using Php Curl / [Tutorial Post] How To Integrate Paystack Payment System With PHP / Download A Url’s Content Using PHP Curl (2) (3) (4)
Help! Webscraping With PHP Curl Is Not Working by Moonlight111(m): 9:37am On Mar 31 |
Hello programmers, I have a website where i sell and receive payment via flutterwave. I have been using curl for months to get payment information from my payment gateway (Flutterwave) and it works fine. All of a sudden it started giving me this error Failed to connect to api.flutterwave.com port 443 after 1103 ms: Couldn't connect to server Here is my code public function getBankName(){ $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://api.flutterwave.com/v3/banks/NG", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "Authorization: Bearer MY_SECRET_KEY" ) )); $response = curl_exec($curl); if (curl_errno($curl)) { echo curl_error($curl).$this->eror; print_r(curl_getinfo($curl)); } curl_close($curl); $response = json_decode($response); $banknames = array(); if($response = json_decode(json_encode($response), true)){ for($i=0; $i<sizeof($response['data']); $i++){ $banknames[] = $response['data'][$i]['name']; } return $banknames; } else{ return false; } } |
Re: Help! Webscraping With PHP Curl Is Not Working by Mrviktor(m): 9:45am On Mar 31 |
Senior man this endpoint is to get bank name nd codes |
Re: Help! Webscraping With PHP Curl Is Not Working by Moonlight111(m): 9:47am On Mar 31 |
Mrviktor:Yes and it has stopped working. |
Re: Help! Webscraping With PHP Curl Is Not Working by chukwuebuka65(m): 11:50am On Mar 31 |
It could be from flutterwave. |
Re: Help! Webscraping With PHP Curl Is Not Working by Moonlight111(m): 12:10pm On Mar 31 |
chukwuebuka65:i have sent them emails, no go solution yet |
Re: Help! Webscraping With PHP Curl Is Not Working by Mrviktor(m): 4:52pm On Mar 31 |
Moonlight111: U can hardcode it for now.. nd test the endpoint with postman. I don't think there has been any new banks in the past year or two.. |
Re: Help! Webscraping With PHP Curl Is Not Working by stanliwise(m): 9:04pm On Mar 31 |
If it was a problem with curl then try it locally using postman |
Re: Help! Webscraping With PHP Curl Is Not Working by Moonlight111(m): 9:04pm On Mar 31 |
Thanks to all those who responded, it started working on it's own. |
Re: Help! Webscraping With PHP Curl Is Not Working by Shedrick: 12:38pm On Apr 03 |
Next time just know it is a problem from the second party server side. |
(1) (Reply)
Free Remote Internship / � / Programming
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 12 |