https://github.com/rpfilomeno/buyline-cardsapi
Pure PHP implementation of Buy-Line SWIG API for Bank of New Zealand payment gateway
https://github.com/rpfilomeno/buyline-cardsapi
api api-client banking bnz payment-integration php
Last synced: 2 months ago
JSON representation
Pure PHP implementation of Buy-Line SWIG API for Bank of New Zealand payment gateway
- Host: GitHub
- URL: https://github.com/rpfilomeno/buyline-cardsapi
- Owner: rpfilomeno
- Created: 2017-06-15T07:43:19.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-04-05T12:14:09.000Z (2 months ago)
- Last Synced: 2025-04-05T13:23:35.659Z (2 months ago)
- Topics: api, api-client, banking, bnz, payment-integration, php
- Language: PHP
- Homepage:
- Size: 3.38 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bank of New Zealand BNZ Buyline-CardsAPI
[](https://gitter.im/rpfilomeno/Buyline-CardsAPI?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Pure PHP implementation of [Buy-Line SWIG API used by BNZ](https://www.bnz.co.nz/about-us/open-banking/bnz-apis)
Do you hate it why BNZ Buy-Line requires you to use [SWIG](https://www.swig.org/) and compile their SDK as PHP module?
Do you hate it when they haven't forked it to support PHP7?
Here is your answer, a PHP Class that implements the API is pure PHP sockets.## Example
```php
require_once "Buyline_CardsAPI.php";$buyline = new Buyline_CardsAPI();
//connection details
$buyline->setHost("trans.buylineplus.co.nz");
$buyline->setPort("3008");
$buyline->setTimeout(5);//authentication
$buyline->setClientId("10000000");
$buyline->setPemFile("BNZTest.cer");
$buyline->setPassPhrase("You certificate password");//debug setting
$buyline->setDebug(true);
$buyline->setVerbose(true);
$buyline->setLogfile("webpay.log");//transaction
try {
$buyline->purchase("4564456445644564", "1020", "10", "4564");
echo 'Transaction Code: '. $buyline->getResponseCode(). "\n";
echo 'Transaction Text: '. $buyline->getResponseText(). "\n";
}catch (Exception $e) {
echo 'Caught exception: '. $e->getMessage(). "\n";
}$x = $buyline->getResult();
var_dump($x);
```