PHP code example of towoju5 / bitnob

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

    

towoju5 / bitnob example snippets


// enroll user for card creation
$data = [
    'customerEmail'     => '[email protected]',
    'idNumber'          => 'A00100010',
    'idType'            => 'PASSPORT',
    'firstName'         => 'Smith',
    'lastName'          => 'John',
    'phoneNumber'       => '08012345678',
    'city'              => 'ILORIN',
    'state'             => 'KWARA',
    'country'           => 'NIGERIA',
    'zipCode'           => '90011',
    'line1'             => 'ABC street, klotovan road',
    'houseNumber'       => 15,
    'idImage'           => 'https://example.com/image.png',
];
app('bitnob')->regUser($data);
bash
    $bitnob = new Bitnob();
    $customer = $bitnob->customer();
    $createCustomer = $customer->createCustomer(array $data);
    $updateCustomer = $customer->updateCustomer(string $id, array $data);
    $listCustomer   = $customer->listCustomer(string $id);
    $getCustomer    = $customer->getCustomer(string $id);
bash
    $bitnob = new Bitnob();
    $beneficiary        = $bitnob->beneficiary();
    $createBeneficiary  = $beneficiary->createBeneficiary(array $data)
    $listBeneficiaries  = $beneficiary->listBeneficiaries()
    $getBeneficiary     = $beneficiary->getBeneficiary($beneficiary_id)
bash
    $bitnob = new Bitnob();
    $checkout = $bitnob->checkout();
    $createHostedCheckout   = $checkout->createHostedCheckout(array $data)
    $getCheckoutStatus      = $checkout->getCheckoutStatus($checkoutId)
    $getCheckouts           = $checkout->getCheckouts($param = null)
    $getCheckout            = $checkout->getCheckout($checkoutId)

 $arr = [
    'cardId'    => $data['cardId'],
    'reference' => $data['reference'],
    'amount'    => $data['amount'],
];
app('bitnob')->topup($arr);