h2akim/billplz

BillPlz Payment Software API

1.0.0 2016-08-11 05:37 UTC

This package is not auto-updated.

Last update: 2024-11-21 04:13:56 UTC


README

Simple library for BillPlz Payment Software API

Getting Started

Composer

composer require h2akim/billplz:*

How to Use

Create a new Collection

Parameters available for collection creation:

  • title
  • logo (optional) - (not tested)
  • split_payment[email] (optional)
  • split_payment[fixed_cut] (optional)
  • split_payment[variable_cut] (optional)
  • object (optional) - return as object (if true)
namespace H2akim\Billplz;

$billplz = new Billplz([
	'api_key' => 'your-api-key'
]);

$billplz->collection()->create([
	'title' => 'My Collection'
]);

Create a new Open Collection

Parameters available for open collection creation:

  • title
  • description
  • amount
  • fixed_amount (optional)
  • fixed_quantity (optional)
  • payment_button (optional)
  • reference_1_label (optional)
  • reference_2_label (optional)
  • email_link (optional)
  • tax (optional)
  • photo (optional) - (not tested)
  • split_payment[email] (optional)
  • split_payment[fixed_cut] (optional)
  • split_payment[variable_cut] (optional)
  • object (optional) - return as object (if true)
namespace H2akim\Billplz;

$billplz = new Billplz([
	'api_key' => 'your-api-key'
]);

$billplz->collection()->createOpen([
	'title' => 'My Collection',
	'description' => 'My Open Collection Description',
	'amount' => 100 // RM1.00
]);

Create a new Bill

Parameters available for bill creation:

  • collection_id
  • email
  • mobile
  • name
  • amount
  • callback_url
  • description
  • due_at (optional)
  • redirect_url (optional)
  • deliver (optional) - SMS if set to true (RM0.15)
  • reference_1_label (optional)
  • reference_1 (optional)
  • reference_2_label (optional)
  • reference_2 (optional)
  • auto_submit (optional) - Skip BillPlz page. [ Value: fpx or paypal ]
  • object (optional) - return as object (if true)
namespace H2akim\Billplz;

$billplz = new Billplz([
	'api_key' => 'your-api-key'
]);

$billplz->bill()->create([
	'collection_id' => 'your-collection-id',
    'email' => 'your.client@email.com',
    'mobile' => '60123456789',
    'name' => 'Mak Jemah',
    'due_at' => '1991-4-21',
    'amount' => 5000, // RM50
    'callback_url' => "http://my-website-with-comic-sans.com/return_url"
]);

Retrieve a Bill

Parameters available for bill retrieval:

  • bill_id (required)
  • object (optional) - return as object (if true)
  • auto_submit (optional) - Skip BillPlz page. [ Value: fpx or paypal ]
namespace H2akim\Billplz;

$billplz = new Billplz([
	'api_key' => 'your-api-key'
]);

$billplz->bill()->get([
	'bill_id' => 'your-bill-id',
]);

Delete a Bill

Parameters available for bill deletion:

  • bill_id (required)
namespace H2akim\Billplz;

$billplz = new Billplz([
	'api_key' => 'your-api-key'
]);

$billplz->bill()->delete([
	'bill_id' => 'your-bill-id',
]);