Flutterwave / PHP-v3

PHP Library for Flutterwave v3 APIs
MIT License
18 stars 17 forks source link

transfers/fee endpoint is returning Application error in PHP #56

Closed Philiptebandeke closed 1 year ago

Philiptebandeke commented 1 year ago

Hello i am calling endpoint 'https://api.flutterwave.com/v3/transfers/fee' but getting response {"error_id":"ERRNO994507623T1678851511558","message":"Application error. Please contact support","code":"app_error"} for the last 3 days

my PHP code is;

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.flutterwave.com/v3/transfers/fee'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt( $ch, CURLOPT_POSTFIELDS, [ "type" => "mobilemoney", "amount" => 2000, "currency" => "UGX", ] ); $headers = array(); $headers[] = 'Authorization: Bearer ' . $fl_secret; $headers[] = 'Content-Type: application/json'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { mylog('Error:' . curl_error($ch)); echo '{"status":"error","message":"' . curl_error($ch) . '"}'; curl_close($ch); exit; } curl_close($ch);

bajoski34 commented 1 year ago

Hi @Philiptebandeke Thank you for choosing Flutterwave.

Please note that the endpoint handles get request and as a result it expects query parameters and not CURLOPT_POSTFIELDS. please kindly add the query parameters and try again.

example : https://api.flutterwave.com/v3/transfers/fee?amount=:amount&currency=:currency&type=:momotype

Philiptebandeke commented 1 year ago

Thank you it is now fixed