PHP code example of kidino / billplz

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

    

kidino / billplz example snippets


use Kidino\Billplz\Billplz;

$bplz = new Billplz(array('api_key' => 'your api key'));
$bplz->set_data('title','Home Tutoring');
$bplz->set_data('logo','/xampp/htdocs/billplz/logo.png');
$result = $bplz->create_collection();
list($rheader, $rbody) = explode("\n\n", $result);
$bplz_result = json_decode($rbody);

use Kidino\Billplz\Billplz;

$bplz = new Billplz(array('api_key' => 'your api key'));
$bplz->set_data(array(
	'collection_id' => 'your collection id',
	'email' => '[email protected]',
	'mobile' => '60123456789',
	'name' => "Jone Doe",
	'due_at' => "2016-1-1",
	'amount' => 2000, // RM20
	'callback_url' => "http://yourwebsite.com/return_url"
));

$result = $bplz->create_bill();
list($rheader, $rbody) = explode("\n\n", $result);
$bplz_result = json_decode($rbody);

use Kidino\Billplz\Billplz;

$bplz = new Billplz(array('api_key' => 'your api key'));
$result = $bplz->get_bill( 'your bill id' );
list($rheader, $rbody) = explode("\n\n", $result);
$bplz_result = json_decode($rbody);

use Kidino\Billplz\Billplz;

$bplz = new Billplz(array('api_key' => 'your api key'));
$result = $bplz->delete_bill( 'your bill id' );
list($rheader, $rbody) = explode("\n\n", $result);
$bplz_result = json_decode($rbody);