2017 © Pedro Peláez
 

library anz-egate

This is a wrapper for the ANZ payment gateway to make it easier to use.

image

phpieces/anz-egate

This is a wrapper for the ANZ payment gateway to make it easier to use.

  • Thursday, April 27, 2017
  • by jclyons52
  • Repository
  • 4 Watchers
  • 1 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 5 % Grown

The README.md

ANZ Payment Gateway

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads], (*1)

This is a wrapper for the ANZ payment gateway to make it easier to use. THIS IS NOT PRODUCED BY ANZ, it comes without warranty, However the code is thoughoghly tested and used in production, (*2)

Installation

Add the repo to your composer file:, (*3)

{
    "require": {
        "PHPieces/anz-egate": "dev-master"
    }
}

Usage

get fields:, (*4)

use PHPieces\ANZGateway\ChargeRequest;
$fields = ChargeRequest::getFields();

This will give all fields, including those relevant to the merchant details. It is more likely the case that you only want the credit card fields:, (*5)

use PHPieces\ANZGateway\models\Card;
$fields = Card::getFields();

Render:, (*6)

<? foreach($fields as $label => $name) : ?>
    <div class="form-group">
        <label for="<?= $name ?>"><?= $label ?></label>
        <input type="text" class="form-control" id="<?= $name ?>" name="<?= $name ?>" >
    </div>
<? endforeach; ?>

Process:, (*7)

use PHPieces\ANZGateway\enums\FormFields\CardFields;
use PHPieces\ANZGateway\Gateway;

$gateway = Gateway::create();
$gateway->setAccessCode('mycode');
$gateway->setMerchantID('myid');

$response = $gateway->purchase([
    // This field must be unique for every transaction attempt.
    'vpc_MerchTxnRef'              => 'mymerchid',
    // This field will show up on the merchant account and is the primary way to search for transactions.
    'vpc_OrderInfo'                => 'orderid',
    // cents AUD
    'vpc_Amount'                   => '100',
    // using the available enum values for the form fields
    CardFields::CARD_NUMBER        => $_POST[CardFields::CARD_NUMBER],
    //YYmm
    CardFields::CARD_EXPIRY_DATE   => $_POST[CardFields::CARD_EXPIRY_DATE],
    // code from back of card
    CardFields::CARD_SECURITY_CODE => $_POST[CardFields::CARD_SECURITY_CODE],
])->send();

if($response->isSuccess()) {
    //proceed...
} else {
    $error = $response->getMessage();
}

License

The MIT License (MIT). Please see License File for more information., (*8)

The Versions

27/04 2017

dev-master

9999999-dev https://github.com/phpieces/anz-egate

This is a wrapper for the ANZ payment gateway to make it easier to use.

  Sources   Download

MIT

The Requires

 

The Development Requires

phpieces anz-egate

27/04 2017

0.2.0

0.2.0.0 https://github.com/phpieces/anz-egate

This is a wrapper for the ANZ payment gateway to make it easier to use.

  Sources   Download

MIT

The Requires

 

The Development Requires

phpieces anz-egate

13/02 2017

0.1.0

0.1.0.0 https://github.com/phpieces/anz-egate

This is a wrapper for the ANZ payment gateway to make it easier to use.

  Sources   Download

MIT

The Requires

 

The Development Requires

phpieces anz-egate

13/02 2017

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1 https://github.com/phpieces/anz-egate

This is a wrapper for the ANZ payment gateway to make it easier to use.

  Sources   Download

MIT

The Requires

 

The Development Requires

phpieces anz-egate