Skip to content

Commit

Permalink
add redirect ioption to standard payment
Browse files Browse the repository at this point in the history
  • Loading branch information
seunex17 committed Nov 5, 2024
1 parent eb34ef0 commit f64da28
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Flutterwave/CollectPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CollectPayment extends FlutterwaveConfig
/**
* @throws Exception
*/
public static function standard(array $data): RedirectResponse
public static function standard(array $data, bool $redirect = true)
{
$client = Services::curlrequest();
$config = new Flutterwave();
Expand Down Expand Up @@ -50,7 +50,12 @@ public static function standard(array $data): RedirectResponse
throw new Exception($response->message);
}

return redirect()->to($response->data->link);
if ($redirect)
{
return redirect()->to($response->data->link);
}

return json_encode($response);
}

/**
Expand Down

0 comments on commit f64da28

Please sign in to comment.