PHP code example of neonexxa / billplz-wrapper

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

    

neonexxa / billplz-wrapper example snippets


Neonexxa\BillplzWrapperV3\BillplzServiceProvider::class,

composer dump-autoload && php artisan config:cache && php artisan cache:clear
php artisan vendor:publish --provider="Neonexxa\BillplzWrapperV3\BillplzServiceProvider"

use Neonexxa\BillplzWrapperV3\BillplzCollection;

$res = new BillplzCollection;
$res->title = "New Collection";
// and other optional params
$res = $res->create_collection();
list($rheader, $rbody, $rurl) = explode("\n\r\n", $res);
$bplz_result = json_decode($rurl);

use Neonexxa\BillplzWrapperV3\BillplzCollection;
$res1 = new BillplzCollection;
$res1->collection_id = "xxxxxx";
$res1 = $res1->get_collection();
list($rheader, $rbody, $rurl) = explode("\n\r\n", $res1);
$bplz_result = json_decode($rurl);

use Neonexxa\BillplzWrapperV3\BillplzCollection;
$res2 = new BillplzCollection;
$res2 = $res2->get_collection();
list($rheader, $rbody, $rurl) = explode("\n\r\n", $res2);
$bplz_result = json_decode($rurl);

use Neonexxa\BillplzWrapperV3\BillplzCollection;
$res5 = new BillplzCollection;
$res5->collection_id = "xxxxxx";
$res5 = $res5->activate_collection();

use Neonexxa\BillplzWrapperV3\BillplzCollection;
$res4 = new BillplzCollection;
$res4->collection_id = "xxxxxx";
$res4->activate = false ;
$res4 = $res4->activate_collection();
list($rheader, $rbody, $rurl) = explode("\n\r\n", $res4);
$bplz_result = json_decode($rurl);

$res = new BillplzOpenCollection;
$res->title = "New Open collection";
$res->description = "New Open collection desc";
// $res->fixed_amount = false;
$res->amount = 2*100;
$res = $res->create_opencollection();
list($rheader, $rbody, $rurl) = explode("\n\r\n", $res);
$bplz_result = json_decode($rurl);

$res2 = new BillplzOpenCollection;
$res2->collection_id = $bplz_result->id;
$res2 = $res2->get_opencollection();

$res3 = new BillplzOpenCollection;
$res3 = $res3->get_opencollection();

$res0 = new BillplzBill;
$res0->collection_id = "xxxxxx"; // which collection you want to park this bill under
$res0->description = "New BIll"; // bill description
$res0->email = "[email protected]"; // client email
$res0->name = "receipientname"; // cleint name
$res0->amount = 2*100; // by default in cent
$res0->callback_url = "[email protected]"; // callback url after execution
// and other optional params
$res0 = $res0->create_bill();
list($rhead ,$rbody, $rurl) = explode("\n\r\n", $res0);
$bplz_result = json_decode($rurl);

$res = new BillplzBill;
$res->bill_id = $bplz_result->id;
$res = $res->get_bill();
list($rhead ,$rbody, $rurl) = explode("\n\r\n", $res);
$bplz_result = json_decode($rurl);

$res2 = new BillplzBill;
$res2->bill_id = $bplz_result->id;
$res2 = $res2->delete_bill();