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
/** | |
* Obtain Paystack payment information | |
* @return void | |
*/ | |
public function handleUserFeeViaPaystackCallback(Request $request) | |
{ | |
//Instantiate Laravel Http get request to Paystack Veryify API route | |
//passing paystack secret key as Bearer token. | |
$paystack_client = Http::withToken(config('paystack.secretKey')) | |
//----------------------------------------------> attach the transaction ref from the request URl |
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
public function userPayFeeViaPaystack() | |
{ | |
//instantiate Laravel Http Client and pass paystack secret key as a bearer token | |
$paystack = Http::withToken(config('paystack.secretKey')) | |
->post('https://api.paystack.co/transaction/initialize', [ | |
//email for the user making the payments | |
'email' => '[email protected], | |
//amount must be in kobo hence: the multiplication by 100 | |
'amount' => 1500 * 100, | |
'quantity' => 1, |