PHPackages                             ironkeith/moneris-eselectplus-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. ironkeith/moneris-eselectplus-api

ActiveLibrary[Payment Processing](/categories/payments)

ironkeith/moneris-eselectplus-api
=================================

A much less awful way to access the Moneris eSELECTplus API.

0.3.1(5y ago)024.6k↓100%MITPHP &gt;=5.2.4

Since Jun 2Pushed 5y agoCompare

[ Source](https://github.com/ironkeith/moneris-eselectplus-api)[ Packagist](https://packagist.org/packages/ironkeith/moneris-eselectplus-api)[ Docs](https://github.com/ironkeith/moneris-eselectplus-api)[ RSS](/packages/ironkeith-moneris-eselectplus-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (7)Used By (0)

Moneris-eSELECTplus-API
=======================

[](#moneris-eselectplus-api)

The PHP API Moneris supplies for eSelectPlus is a terrible mess that throws warnings like they were candy at a parade. This is a simple replacement for people who like PHP5, and hate errors.

**Note:** as of right now, I've only writting support for purchase, verify, pre-auth, capture, and refund operations. I've also included support for AVS/CVD verification.

Get Started
-----------

[](#get-started)

The first step is to set up your config, and get your Moneris gateway object:

```
$config = array(
	'api_key' => 'yesguy',
	'store_id' => 'store1',
	'environment' => Moneris::ENV_TESTING
);
$moneris = Moneris::create($config);

```

There are some handy optional params for the config as well:

```
$config = array(
	'api_key' => 'yesguy',
	'store_id' => 'store1',
	'environment' => Moneris::ENV_TESTING,
	// optional:
	'require_avs' => true, // default: false
	'avs_codes' => array('A','B', 'D', 'M', 'P', 'W', 'X', 'Y', 'Z'), // default
	'require_cvd' => true, // default: true
	'cvd_codes' => array('M', 'Y', 'P', 'S', 'U') // default
);

```

To make a purchase is pretty straight forward:

```
// set up $moneris like we did ^^ up there
$params = array(
	'cc_number' => '4242424242424242',
	'order_id' => 'test' . date("dmy-G:i:s"),
	'amount' => '20.00',
	'expiry_month' => date('m', $time),
	'expiry_year' => date('y', $time)
);
$result = $moneris->purchase($params);

```

The result object lets you know how everything went:

```
$result->was_successful(); // did the transaction work?
$result->failed_avs(); // did the transaction pass the AVS check?
$result->failed_cvd(); // did the transaction pass the CVD check?
$result->error_message(); // if something went wrong, what was it?

```

A common workflow might look like this:

```
$errors = array();
$result = $moneris->purchase($params);

if ($result->was_successful()) {
	// HOORAY! Party like it's 1999.
} else {
	$errors[] = $result->error_message();
}

```

There's one caveat though! If a transaction fails AVS/CVD, you still have to void it! An easy way to work around that is to verify the card first!

```
$errors = array();
$verification_result = $moneris->verify($params);

if ($verification_result->was_successful() && $verification_result->passed_avs() && $verification_result->passed_cvd()) {

	$purchase_result = $moneris->purchase($params);

	if ($purchase_result->was_successful()) {
		// HOORAY! Party like it's 1999.
	} else {
		$errors[] = $result->error_message();
	}

}

```

Or:

```
$errors = array();
$purchase_result = $moneris->purchase($params);

if ($purchase_result->was_successful() && ( $purchase->failed_avs() || $purchase_result->failed_cvd() )) {
	$errors[] = $purchase_result->error_message();
	$void = $moneris->void($purchase_result->transaction());
} else if (! $purchase_result->was_successful()) {
	$errors[] = $purchase_result->error_message();
} else {
	// OMG we're rich!
}

```

You can view the transaction details via the transaction object.

```
$result = $moneris->purchase($params);
$transaction = $result->transaction();

```

You can learn some nift stuff from it, as well as see the XML returned by Moneris.

```
$transaction->number(); // receipt->TransID from the Moneris XML response
$transaction->amount(); // amount processed
$transaction->response(); // the SimpleXMLElement from the parsed Moneris response.

```

The capture, void, and refund methods can all accept a transaction object as the first param:

```
$result = $moneris->purchase($params);
$moneris->refund($result->transaction()); // refund the full purchase
$moneris->refund($result->transaction(), null, '5.00'); // refund $5.00
// OR
$moneris->refund($result->transaction()->number(), $params['order_id'], $params['amount']); // refund the full purchase
$moneris->refund($result->transaction()->number(), $params['order_id'], '5.00'); // refund $5.00

$result = $moneris->preauth($params);
$moneris->capture($result->transaction());
// OR
$moneris->capture($result->transaction()->number(), $params['order_id'], $params['amount']);

$result = $moneris->purchase($params);
$moneris->void($result->transaction());
// OR
$moneris->void($result->transaction()->number(), $params['order_id']);

```

Lemme know if you have any questions. @ironkeith on the Twitters.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~444 days

Recently: every ~555 days

Total

6

Last Release

2138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f32978f1227456b47a05ad66f649635182e03b053fc5da58de3c2f732b22cbe?d=identicon)[ironkeith](/maintainers/ironkeith)

---

Top Contributors

[![kslgrd](https://avatars.githubusercontent.com/u/367342?v=4)](https://github.com/kslgrd "kslgrd (19 commits)")[![alekseykuleshov](https://avatars.githubusercontent.com/u/6037974?v=4)](https://github.com/alekseykuleshov "alekseykuleshov (5 commits)")[![bigwhoop](https://avatars.githubusercontent.com/u/242589?v=4)](https://github.com/bigwhoop "bigwhoop (1 commits)")

---

Tags

moneriseSELECTplus

### Embed Badge

![Health badge](/badges/ironkeith-moneris-eselectplus-api/health.svg)

```
[![Health](https://phpackages.com/badges/ironkeith-moneris-eselectplus-api/health.svg)](https://phpackages.com/packages/ironkeith-moneris-eselectplus-api)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[aktive_merchant/aktive_merchant

Aktive-Merchant provides a common interface to process payments using multiple gateways.

15036.8k](/packages/aktive-merchant-aktive-merchant)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
