Skip to content

Pure PHP implementation of Buy-Line SWIG API for Bank of New Zealand payment gateway

Notifications You must be signed in to change notification settings

rpfilomeno/Buyline-CardsAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Bank of New Zealand BNZ Buyline-CardsAPI

Join the chat at https://gitter.im/rpfilomeno/Buyline-CardsAPI

Pure PHP implementation of Buy-Line SWIG API used by BNZ

Do you hate it why BNZ Buy-Line requires you to use SWIG 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

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);

About

Pure PHP implementation of Buy-Line SWIG API for Bank of New Zealand payment gateway

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages