PHP code example of obrainwave / paygate

1. Go to this page and download the library: Download obrainwave/paygate 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/ */

    

obrainwave / paygate example snippets


use Paygate;

$payload = array(
  'provider' => 'paystack',
  'provider_token' => 'PAYSTACK_SECRET_KEY', // Make sure you don't expose this in your code
  'amount' => 250,
  'email' => '[email protected]',
  'reference' => 'T2CZ143DUMG',
  'redirect_url' => 'https://mydomain.com/verify-payment',
  'name' => 'Akeem Salau', 
  'contract_code' => '32904826734',
  'payment_methods' => ["card", "bank", "ussd", "qr", "mobile_money", "bank_transfer", "eft"]
  'pass_charge' => False
  'title' => "Ola's Store"
  'logo' => 'https://mydomain.com/logo.png'
  'phone_number' => '08022999871'
 );

$payment = Paygate::initiatePayment($payload);

use Paygate;

$payload = array(
  'provider' => 'gtpay',
  'provider_token' => 'GTPAY_SECRET_KEY', // Make sure you don't expose this in your code
  'reference' => 'T2CZ143DUMG',
  
 );

$payment = Paygate::verifyPayment($payload);
bash
php artisan vendor:publish --tag="paygate-config"