PHPackages                             academe/omnipay-elavon - 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. academe/omnipay-elavon

ActiveLibrary[Payment Processing](/categories/payments)

academe/omnipay-elavon
======================

Elavon Payment Gateway (EPG) driver for the Omnipay PHP payment processing library

1.0.0(4mo ago)00MITPHPPHP ^8.1

Since Jan 4Pushed 4mo agoCompare

[ Source](https://github.com/academe/omnipay-elavon)[ Packagist](https://packagist.org/packages/academe/omnipay-elavon)[ Docs](https://github.com/academe/omnipay-elavon)[ RSS](/packages/academe-omnipay-elavon/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

Omnipay: Elavon EPG
===================

[](#omnipay-elavon-epg)

**Elavon Payment Gateway (EPG) driver for the Omnipay PHP payment processing library**

[![Latest Stable Version](https://camo.githubusercontent.com/c93ed2b05d3ac6cf5826b6ca8c43b10bf9906ce2409603322baff221b98975aa/68747470733a2f2f706f7365722e707567782e6f72672f61636164656d652f6f6d6e697061792d656c61766f6e2f76657273696f6e)](https://packagist.org/packages/academe/omnipay-elavon)[![Total Downloads](https://camo.githubusercontent.com/70f46d9c70931eea8e93049278ffd5ab8cec60b685a715f0c70a48855da6f9ba/68747470733a2f2f706f7365722e707567782e6f72672f61636164656d652f6f6d6e697061792d656c61766f6e2f646f776e6c6f616473)](https://packagist.org/packages/academe/omnipay-elavon)[![License](https://camo.githubusercontent.com/587903da426bf855091a37d0420bb36beef4ca2ae02f222bde7fef80851a1789/68747470733a2f2f706f7365722e707567782e6f72672f61636164656d652f6f6d6e697061792d656c61766f6e2f6c6963656e7365)](https://packagist.org/packages/academe/omnipay-elavon)

[Omnipay](https://github.com/thephpleague/omnipay) is a framework-agnostic, multi-gateway payment processing library for PHP. This package implements Elavon Payment Gateway (EPG) support for Omnipay.

This driver uses Elavon's Hosted Payment Page (HPP) for secure card entry and 3DS authentication. All card details are entered on Elavon's hosted form, keeping your application out of PCI scope.

This package uses [academe/elavon-epg-psr7](https://github.com/academe/elavon-epg-psr7) as the underlying API message driver and for DTOs.

Installation
------------

[](#installation)

```
composer require academe/omnipay-elavon
```

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

[](#requirements)

- PHP 8.1 or higher
- Omnipay 3.x
- An Elavon EPG merchant account with API credentials

Basic Usage
-----------

[](#basic-usage)

### Gateway Setup

[](#gateway-setup)

```
use Omnipay\Omnipay;

$gateway = Omnipay::create('Elavon\Hpp');

$gateway->setMerchantAlias('your-merchant-alias');
$gateway->setApiKey('your-api-key');
$gateway->setRegion('eu'); // 'eu' or 'na'
$gateway->setTestMode(true); // Use sandbox environment
```

### Hosted Payment Page Flow

[](#hosted-payment-page-flow)

The HPP gateway uses a redirect flow where the customer enters their card details on Elavon's secure hosted page:

1. Create an order and payment session
2. Redirect customer to Elavon's hosted payment page
3. Customer enters card details and completes 3DS authentication
4. Customer is redirected back to your site
5. Verify the transaction result

#### Authorize (Two-step flow)

[](#authorize-two-step-flow)

An authorization reserves funds on the cardholder's account but does not capture them. Use `capture()` to complete the transaction later.

```
// Step 1: Create the authorization request
$response = $gateway->authorize([
    'amount' => '10.00',
    'currency' => 'USD',
    'transactionId' => 'order-123',
    'returnUrl' => 'https://example.com/payment/return',
    'cancelUrl' => 'https://example.com/payment/cancel',
])->send();

// Step 2: Redirect to Elavon's hosted payment page
if ($response->isRedirect()) {
    $response->redirect();
}

// Step 3: On return, verify the transaction
$response = $gateway->completeAuthorize([
    'transactionReference' => $_GET['transaction'],
])->send();

if ($response->isSuccessful()) {
    $transactionReference = $response->getTransactionReference();
    // Store this reference to capture later
}
```

#### Purchase (Single-step flow)

[](#purchase-single-step-flow)

A purchase authorizes and captures payment in one step.

```
$response = $gateway->purchase([
    'amount' => '10.00',
    'currency' => 'USD',
    'transactionId' => 'order-124',
    'returnUrl' => 'https://example.com/payment/return',
    'cancelUrl' => 'https://example.com/payment/cancel',
])->send();

if ($response->isRedirect()) {
    $response->redirect();
}

// On return, the payment is already captured
```

### Capture

[](#capture)

Capture a previously authorized transaction.

```
$response = $gateway->capture([
    'transactionReference' => $transactionReference,
])->send();

if ($response->isSuccessful()) {
    echo 'Payment captured successfully!';
}
```

### Refund

[](#refund)

Refund a captured/settled transaction.

```
$response = $gateway->refund([
    'transactionReference' => $transactionReference,
    'amount' => '5.00', // Partial or full refund
    'currency' => 'USD',
])->send();

if ($response->isSuccessful()) {
    echo 'Refund processed successfully!';
}
```

### Void

[](#void)

Void an authorized transaction before capture.

```
$response = $gateway->void([
    'transactionReference' => $transactionReference,
])->send();

if ($response->isSuccessful()) {
    echo 'Transaction voided successfully!';
}
```

### Fetch Transaction

[](#fetch-transaction)

Retrieve details of a transaction.

```
$response = $gateway->fetchTransaction([
    'transactionReference' => $transactionReference,
])->send();

if ($response->isSuccessful()) {
    echo 'State: ' . $response->getState();
    echo 'Amount: ' . $response->getAmount();
}
```

Gateway Parameters
------------------

[](#gateway-parameters)

ParameterDescription`merchantAlias`Your Elavon merchant alias`apiKey`Your API key for authentication`region`API region: 'eu' or 'na'`testMode`Set to `true` for sandbox environmentRequest Parameters
------------------

[](#request-parameters)

### Common Parameters

[](#common-parameters)

ParameterDescription`amount`Transaction amount (e.g., '10.00')`currency`Three-letter ISO currency code (e.g., 'USD')`transactionId`Your unique order/transaction ID`transactionReference`Gateway's transaction reference (href URL)`returnUrl`URL to redirect after successful payment`cancelUrl`URL to redirect if payment is cancelledResponse Methods
----------------

[](#response-methods)

All responses provide these common methods:

```
$response->isSuccessful();           // Was the transaction successful?
$response->isRedirect();             // Does this require a redirect?
$response->getTransactionReference(); // Gateway's transaction reference
$response->getTransactionId();       // Your order ID
$response->getMessage();             // Response message
$response->getCode();                // Response code
```

Demo Scripts
------------

[](#demo-scripts)

The `demo/` directory contains working examples demonstrating the HPP payment flow:

- **hpp-form.php** - Payment form with authorize/purchase option
- **hpp-checkout.php** - Creates order and redirects to HPP
- **hpp-return.php** - Handles return after payment
- **hpp-capture.php** - Captures authorized payments
- **hpp-cancel.php** - Handles cancelled payments
- **transactions.php** - View and manage transactions (void/refund)
- **transaction-detail.php** - View transaction details

### Running the Demos

[](#running-the-demos)

Start the web server:

```
php -S localhost:8000 -t demo
```

Then open:

### Configuration

[](#configuration)

Copy `demo/config.php.example` to `demo/config.php` and add your credentials:

```
return [
    'merchantAlias' => 'your-merchant-alias',
    'apiKey' => 'your-api-key',
    'region' => 'eu', // or 'na'
    'testMode' => true,
];
```

Testing
-------

[](#testing)

```
composer test
```

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay).

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/academe/omnipay-elavon/issues).

License
-------

[](#license)

This package is released under the MIT License. See the [LICENSE](LICENSE) file for details.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance76

Regular maintenance activity

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

128d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/395934?v=4)[Jason Judge](/maintainers/judgej)[@judgej](https://github.com/judgej)

---

Top Contributors

[![judgej](https://avatars.githubusercontent.com/u/395934?v=4)](https://github.com/judgej "judgej (11 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (8 commits)")

---

Tags

elavonelavon-epgomnipayomnipay-gatewaypayment-gatewayphppaymentgatewaypaymerchantomnipaypurchaseelavonepg

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/academe-omnipay-elavon/health.svg)

```
[![Health](https://phpackages.com/badges/academe-omnipay-elavon/health.svg)](https://phpackages.com/packages/academe-omnipay-elavon)
```

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

587421.0k11](/packages/lokielse-omnipay-alipay)

PHPackages © 2026

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