PHP code example of diadal / laravel-watu-payment-gateway
1. Go to this page and download the library: Download diadal/laravel-watu-payment-gateway 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/ */
diadal / laravel-watu-payment-gateway example snippets
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Diadal\Watu\Watu;
class InvoiceController extends Controller
{
/**
* __construct
*
* @return void
*/
public function __construct()
{
...
$this->watu = new Watu();
}
// this work with any motheds Api called mainData is default wata data or payload
public function OtherMethods()
{
$data = [];
$data['mainData'] = [
"service_type" => 'watu-pay',
"amount" => '10000',
"currency" => 'NGN',
"payment_type" => 'card'
];
$data['keyType'] = 'publicKey';
$data['requestType'] = 'post';
$data['path'] = '/payment/fees';
$data = $data;
return $this->watu->OtherMethods($data);
}