PHP code example of ahmard / cbs-client

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

    

ahmard / cbs-client example snippets


use CBS\Client\Invoice;

Secret = '';

$invoice = Invoice::create($clientId, $clientSecret)
        ->revenueHeadId(16)
        ->amount(3455)
        ->invoiceDescription('Payment Description')
        ->categoryId(1)
        ->endpoint('')
        ->callBackUrl('http://tatsuniya.test/webhook')
        ->requestReference(uniqid())
        ->phoneNumber('07035636394')
        ->address('Malumfashi')
        ->email('[email protected]')
        ->recipient('Gizon Tastuniya')
        ->execute();

if ($invoice->isSuccess()){
    header("Location: {$invoice->paymentURL()}");
}else{
    echo $invoice->getResponse()->getBody()->getContents();
}