PHP code example of adelowo / laravel-gbowo

1. Go to this page and download the library: Download adelowo/laravel-gbowo library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

adelowo / laravel-gbowo example snippets


Gbowo\Bridge\Laravel\GbowoServiceProvider::class


//...other config values
"gbowo" => [
    "default" => "paystack"
];
 


"Gbowo" : Gbowo\Bridge\Laravel\Facades::class



class BillingController extends Controller
{
    public function chargeCustomer(Request $request)
    {
        $adapter = app("gbowo")->adapter("paystack");
        // $adapter = app("gbowo")->adapter("amplifypay");

        
        $data = ["email" => $request->get('email') , "amount" => $request->get('amount')];
        
        return redirect($adapter->charge($data));
    }
}



$config = ["key" => "value", "other" => "stuff"]; //some bootstrap options your adapter might need.

$this->app["gbowo"]->extend("voguepay" , function() use ($config)){
    return new VoguePayAdapter($config);
});



$voguePay = app("gbowo")->adapter("voguePay");

$voguePay->charge(['c' => 'd']);



use Gbowo\Bridge\Laravel\Facades

Gbowo::adapter("paystack")->charge([])

//You can call any method on the facade as you would in the normal instance. Do check the api methods