Skip to content

cedricblondeau/php-moneris-eselectplus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-moneris-eselectplus Build Status

An alternative and modern way to access the Moneris eSELECTplus API with PHP 5.3+.

This library was initially a fork of ironkeith/moneris-eselectplus-api.

Motivation

I needed to integrate Moneris with a nice and modern PHP project and did not want to include the source code they provide.

Keith Silgard did an awesome job by writing an alternative library but I wanted something with namespaces, PSR-4 support, unit testing and Vault API functions, so I decided to fork it and finally, to fully redesign and rewrite it for PHP 5.3+.

Usage example

use CedricBlondeau\Moneris;

// Config
$config = new Config('test_api_key', 'store1');
$config->setEnvironment(Config::ENV_TESTING);

// Purchase transaction
$transaction = new Moneris\Transaction\Basic\Purchase($config, array(
    'cc_number' => '4242424242424242',
    'expiry_month' => 10,
    'expiry_year' => 18,
    'order_id' => 'test' . date("dmy-G:i:s"),
    'amount' => 100
));

// CURL
$httpClient = new Moneris\Http\Client\Curl($transaction);
$result = $httpClient->execute();