2017 © Pedro Peláez
 

library moneris-api

Payments with Moneris

image

zone/moneris-api

Payments with Moneris

  • Thursday, September 17, 2015
  • by Botnary
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Simple Moneris gateway.

Usage ``` require_once 'vendor/autoload.php'; use Zone\PaymentGateway; use Zone\PaymentGateway\Helper\CreditCard; use Zone\PaymentGateway\Helper\Transaction; use Zone\PaymentGateway\Integration\Moneris; use Zone\PaymentGateway\Response\CreateCharge; use Zone\PaymentGateway\Response\ValidateCard;, (*1)

$moneris = new Moneris(); $moneris->setCredentials('store5', 'yesguy'); //this are the moneris demo credentials $moneris->getApi()->setTestMode(true); // using test environment $transaction = new Transaction(); $transaction->setTransactionId(sprintf("T%'.020d\n", 8)); $transaction->setTransactionDate(new DateTime('now')); $transaction->setCurrency('CAD'); $transaction->setAmount('10.00'); $transaction->setComment('test transaction');, (*2)

$card = new CreditCard(); $card->setCardNumber('4242424242424242'); $card->setCardExpiry('08', '12'); $card->setCardCVV('198'); $card->setAddress1('201'); $card->setAddress2('Michigan Ave'); $card->setCity('Montreal'); $card->setEmailAddress('test@host.com'); $card->setCountry('Canada'); $card->setZipCode('M1M1M1');, (*3)

$moneris->validateCard($card, function (ValidateCard $response) use ($card, $transaction, $moneris) { //card is valid, continue with the charge. $moneris->createCharge($card, $transaction, function (CreateCharge $response) { //success charge }, function (CreateCharge $response) { //fail charge }); }, function (ValidateCard $response) { //card is invalid });, (*4)

The Versions

17/09 2015

dev-master

9999999-dev

Payments with Moneris

  Sources   Download

The Requires

  • php >=5.4.0

 

moneris