ahmard/cbs-client

There is no license information available for the latest version (1.0.2) of this package.

CBS(Central Billing System) Client

1.0.2 2021-06-02 07:56 UTC

This package is auto-updated.

Last update: 2024-11-29 06:52:47 UTC


README

Central Billing System(CBS) Client.

Installation

composer require ahmard/cbs-client

Usage

use CBS\Client\Invoice;

require 'vendor/autoload.php';

$clientId = '';
$clientSecret = '';

$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('gizo@tatsuniya.test')
        ->recipient('Gizon Tastuniya')
        ->execute();

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