Download the PHP package jomweb/billplz without Composer
On this page you can find all versions of the php package jomweb/billplz. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jomweb/billplz
More information about jomweb/billplz
Files in jomweb/billplz
Package billplz
Short Description PHP Agnostic library for working with BillPlz API
License MIT
Informations about the package billplz
PHP framework agnostic library for working with BillPlz API v3 and beyond...
- Installation
- Getting Started
- Creating Client
- Using Sandbox
- API Version
- Usages
- Collection
- Create a Collection
- List of Collections
- Get existing Collection
- Deactivate a collection
- Activate a collection
- Open Collection
- Create an Open Collection
- List of Open Collections
- Get existing Open Collection
- Bill
- Create a Bill
- Get existing Bill
- Delete a Bill
- Payment Completion
- Redirect
- Callback
- Transaction
- List of Transactions
- Banking
- Registration Check by Bank Account
- Get FPX Banks List
- Payment Order Collection
- Create a Payment Order Collection
- Get existing Payment Order Collection
- Payment Order
- Create a Payment Order
- Get existing Payment Order
- Get Payment Order Limit
- Collection
- Handling Response
- Getting the Response
- Checking the Response HTTP Status
- Checking the Response Header
Installation
Composer
To install through composer by using the following command:
composer require php-http/guzzle7-adapter jomweb/billplz:^4.1
HTTP Adapter
Instead of utilizing php-http/guzzle7-adapter
you might want to use any other adapter that implements php-http/client-implementation
. Check Clients & Adapters for PHP-HTTP.
PHAR
If Composer isn't available on your application, you can opt for use Billplz PHAR which can be downloaded from the most recent GitHub Release. This build uses guzzlehttp/guzzle
under the hood for all request to Billplz API.
You should received billplz.phar
file which you can include to your project.
Getting Started
Creating Client
You can start by creating a Billplz client by using the following code (which uses php-http/guzzle6-adapter
and php-http/discovery
to automatically pick available adapter installed via composer):
You can also send X-Signature
key by doing the following:
Alternatively, you could also manually configure Http\Client\Common\HttpMethodsClient
directly:
Using Sandbox
You can set to use development/sandbox environment by adding the following code:
API Version
By default jomweb/billplz
would use v4
API version for any request, however you can customize this in future when new API version is available.
Usages
Collection
Now you can create an instance of Collection:
You can also manually set the API version by doing
$billplz->collection('v3');
. You can also use$billplz->uses('Collection');
to get the same result.
Create a Collection
You can add a new collection by calling the following code:
You can also create new collection with optional parameters:
List of Collections
You can get Collection index by calling following code:
u also can provide optional parameters (page, status):
Get existing Collection
You can get existing collection by calling the following code:
Deactivate a collection
To use activate()
and deactivate()
function, you must explicitely use version v3
.
You can deactivate a collection by calling the following code:
Activate a collection
You can deactivate a collection by calling the following code:
Open Collection
Now you can create an instance of Collection:
You can also manually set the API version by doing
$billplz->openCollection('v3');
. You can also use$billplz->uses('OpenCollection');
to get the same result.
Create an Open Collection
List of Open Collections
You can get Open Collection index by calling following code:
u also can provide optional parameters (page, status):
Get existing Open Collection
You can get existing open collection by calling the following code:
Bill
Now you can create an instance of Bill:
You can also manually set the API version by doing
$billplz->bill('v3');
. You can also use$billplz->uses('Bill');
to get the same result.
Create a Bill
You can add a new bill by calling the following code:
redirect_url
can be passed on the 8th parameters which is(array) $optional
Alternative Way to Set Redirect URL
Get existing Bill
Delete a Bill
Payment Completion
Redirect
You can setup a redirect page where user will be redirected after payment is completed. Billplz will redirect user to your specified redirect page along with few URL parameters. In order to capture all the URL parameters, do the following.
If you enabled "Extra Payment Completion information" on your Billplz API Setting, You will receive the following output
Callback
You can setup a webhook to receive POST request from Billplz. In order to accept the response, all you to do is write the following.
If you enabled "Extra Payment Completion information" on your Billplz API Setting, You will receive the following output
Transaction
Now you can create an instance of Transaction:
You can also manually set the API version by doing
$billplz->transaction('v3');
. You can also use$billplz->uses('Bill.Transaction');
to get the same result.
List of Transactions
You can get Transaction index by calling following code:
You also can provide optional parameters (page, status):
Banking
Now you can create an instance of Bank:
You can also manually set the API version by doing
$billplz->bank('v3');
. You can also use$billplz->uses('Bank');
to get the same result.
Create A Bank Account
Request Bank Account Direct Verification Service by creating bank records thru this API.
Get A Bank Account
Query Billplz Bank Account Direct Verification Service by passing single account number arguement. This API will only return latest, single matched bank account.
Registration Check by Bank Account
At any given time, you can request to check on a registration status by bank account number.
Get FPX Banks List
If you want to use Bank Direct Feature in Billplz, you need list of FPX Banks to send in create bill request.
You can get supported bank for FPX by calling following code:
Note: You will hit 401, Invalid access error if you have not enabled Bank Direct by Billplz. Contact Billplz for information.
Payment Order Collection
Create an instance of Payment Order Collection:
Create Payment Order Collection
Get Payment Order Collection
Payment Order
Create an instance of Payment Order:
Create Payment Order
Note: You will hit 422, You do not have enough payments error if you are trying to make a payment with total that are exceeding your Payment Order Limit.
Get Payment Order
Get Payment Order Limit
Handling Response
Every request made to Billplz would return \Laravie\Codex\Response
which can fallback to \Psr\Http\Message\ResponseInterface
which would allow developer to further inspect the response.
Getting the Response
You can get the raw response using the following:
However we also create a method to parse the return JSON string to array.
Checking the Response HTTP Status
You can get the response status code via:
Checking the Response Header
You can also check the response header via the following code:
All versions of billplz with dependencies
jomweb/ringgit Version ^3.0
laravie/codex Version ^6.1
laravie/codex-filter Version ^2.0
php-http/multipart-stream-builder Version ^1.0