PHPackages                             speckcommerce/speck-authnet - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. speckcommerce/speck-authnet

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

speckcommerce/speck-authnet
===========================

A generic module for adding Authorize.net support to a ZF2 application.

3234[1 PRs](https://github.com/speckcommerce/SpeckAuthnet/pulls)PHP

Since Nov 19Pushed 13y ago6 watchersCompare

[ Source](https://github.com/speckcommerce/SpeckAuthnet)[ Packagist](https://packagist.org/packages/speckcommerce/speck-authnet)[ RSS](/packages/speckcommerce-speck-authnet/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

SpeckAuthnet
============

[](#speckauthnet)

A generic module for adding Authorize.net Payments support to a ZF2 application.

Introduction
------------

[](#introduction)

SpeckAuthnet is a module that can be utilized outside of Speck Commerce to accept payments via the Authorize.net payment gateway. This module currently supports Authorize.net AIM API Operations.

To get started visit the [Authorize.net Development Center](http://developer.authorize.net/)

### Authorize.Net API Documentation

[](#authorizenet-api-documentation)

- [AIM guide](http://developer.authorize.net/api/aim/)
- [ECheck guide](http://www.authorize.net/support/eCheck.pdf)
- [Credits / Returns guide](http://www.authorize.net/files/creditreturnsummary.pdf)

To integrate with this module you will want to sign up for an account on Authorize.net. See the developer website for instructions.

This module currently supports the following AIM calls with API version 3.1:

- AUTH\_CAPTURE and AUTH\_ONLY
- CREDIT
- VOID
- ECHECK
- PRIOR\_AUTH\_CAPTURE
- CAPTURE\_ONLY

Requirements
------------

[](#requirements)

The dependencies for SpeckCommerce are set up as Git submodules so you should not hav

- PHP 5.3.3+
- [Zend Framework 2](https://github.com/zendframework/zf2) (latest master)

Contributors
------------

[](#contributors)

- \[Steve Rhoades\] () (aka srhoades) [![Build Status](https://camo.githubusercontent.com/e49c04176a2512d4d3b8c111776162c6b1acf0698b863947282776817ec12a76/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f737465766572686f616465732f537065636b417574686e65742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/steverhoades/SpeckAuthnet)

Community
---------

[](#community)

Join us on the Freenode IRC network: #speckcommerce. Our numbers are few right now, but we're a dedicated small group working on this project full time.

Getting Started
---------------

[](#getting-started)

Move the module.config.php.dist to module.config.php and replace the following values with your own.

- tran\_key - The transaction key provided by Authorize.net
- login - The login is provided by Authorize.net
- mode - Possible values are `sandbox` or `live`

Example Usage
-------------

[](#example-usage)

### The Client

[](#the-client)

SpeckAuth API Name: `SpeckAuthnet\Client`

The SpeckAuthnet module works off a single Client. You will utilize this client to access the API's and make your calls to the Authnet endpoints. The Client provides a fluent interface allowing you to chain method calls.

```
//start by getting an instance of the client, in this example I will be leveraging the ServiceManager.
$client = $sm->get('SpeckAuthnet\Client');
```

There are 3 ways to interact with the APIs via the client.

- use `Client::setData($data)` to set a preconfigured array of key/value pairs on the API. The keys are the same as the fields in the Authorize.net AIM documentation minus the `x_`
- proxy calls to the API via the client
- act on the API itself calling `Client::getApi()`

### Credit Card

[](#credit-card)

SpeckAuthnet API Name: `Aim\CreditCard`

By default the authorization type of the CreditCard API is `AUTH_ONLY`, this can also be configured to be an `AUTH_CAPTURE` call to Authorize.net. The SpeckAuthnet module contains support for all available fields, for a complete list you can look at the unit tests included with the module or consult the documentation available on the Authorize.net developer website.

```
$paymentInfo = array(
    'amount' => '20.00',
    'card_num' => '4111111111111111',
    'exp_date' => '122012',
    'address' => '2065 nestall rd',
    'city' => 'laguna beach',
    'state' => 'california',
    'zip' => '92656',
    'country' => 'US',
    'first_name' => 'steve',
    'last_name' => 'rizzo'
);

//Authorize Only
$response = $client->api('Aim\CreditCard')
	->setData($paymentInfo)
	->send();

//Authorize Capture
$response = $client->api('Aim\CreditCard')
	->setData($paymentInfo)
	->setType('AUTH_CAPTURE')
	->send();

echo $response->isApproved();
```

### Prior Authorization Capture

[](#prior-authorization-capture)

SpeckAuthnet API Name `Aim\PriorAuthCapture`

Calling `AUTH_ONLY` and `PRIOR_AUTH_CAPTURE` represent a single complete transaction. When you are ready to capture an authorized only transaction you will utilize this API call. In addition this API supports splitting captures across multiple authorization requests: @see split tender in the AIM API documentation for details.

```
$response = $client->api('Aim\PriorAuthCapture')
	->setAmount($amountToCapture)
	->setTransactionId($transactionId)
	->send();
echo $response->isSucces();
```

### ECheck

[](#echeck)

SpeckAuthnet API Name: `Aim\ECheck`

Process check tranasctions with this API.

NOTE: this requires additional set up within Authorize.net.

```
$response = $client->api('Aim\ECheck')
	->setAmount('20.00')
	->setBankAbaCode('160000000001')
	->setBankAcctNum('1234567890')
	->setBankAcctType('CHECKING')
	->setBankName('Bank of America')
	->send();

echo $response->isApproved();
```

### Void

[](#void)

SpeckAuthnet API Name: `Aim\Void`

In order to void a transaction you will need the transaction id returned from the original authorization.

```
//
$response = $client->api('Aim\Void')
	->setTransactionid($transactionId)
	->send();
echo $response->isSuccess();
```

### Credit

[](#credit)

SpeckAuthnet API Name: `Aim\Credit`

Credits cannot be applied to Authorization-Only transactions. You can use the full card number, a masked last 4 digit number or simply a last 4 digit number (4111111111111111, XXXX4111, 4111).

NOTE: A credit can only be applied to a settled transaction unless you are doing an unlinked credit.

NOTE: The default credit method is `CC`, this will automatically change to `ECHECK` if bankAbaCode or bankAcctNum is set, likewise you can change the method by calling `setMethod($method);`

NOTE: Unlinked Credits must exclude the transaction id and provide a full credit card number and expiration date.

```
$response = $client->api('Aim\Credit')
	->setCardNum($accountNum)
	->transactionId($transactionId)
	->send();
echo $response->isSuccess();
```

TODO
----

[](#todo)

- improve integration tests
- refactor to relevant exception classes
- add support for CIM

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b8087834faf56438b3af7783f76f1fc251f91355bf8765d1bf10d2a5dd0aa452?d=identicon)[EvanDotPro](/maintainers/EvanDotPro)

![](https://avatars.githubusercontent.com/u/725842?v=4)[Aleksei Khudiakov](/maintainers/Xerkus)[@Xerkus](https://github.com/Xerkus)

---

Top Contributors

[![steverhoades](https://avatars.githubusercontent.com/u/1146668?v=4)](https://github.com/steverhoades "steverhoades (11 commits)")[![EvanDotPro](https://avatars.githubusercontent.com/u/5607?v=4)](https://github.com/EvanDotPro "EvanDotPro (1 commits)")

### Embed Badge

![Health badge](/badges/speckcommerce-speck-authnet/health.svg)

```
[![Health](https://phpackages.com/badges/speckcommerce-speck-authnet/health.svg)](https://phpackages.com/packages/speckcommerce-speck-authnet)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

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