PHPackages                             burnbright/silverstripe-omnipay - 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. burnbright/silverstripe-omnipay

Abandoned → [silverstripe/silverstripe-omnipay](/?search=silverstripe%2Fsilverstripe-omnipay)Silverstripe-vendormodule[Payment Processing](/categories/payments)

burnbright/silverstripe-omnipay
===============================

SilverStripe Omnipay Payment Module

3.2.0(4y ago)3812.4k70[14 issues](https://github.com/burnbright/silverstripe-omnipay/issues)BSD-3-ClausePHPCI failing

Since Dec 16Pushed 1mo ago14 watchersCompare

[ Source](https://github.com/burnbright/silverstripe-omnipay)[ Packagist](https://packagist.org/packages/burnbright/silverstripe-omnipay)[ RSS](/packages/burnbright-silverstripe-omnipay/feed)WikiDiscussions main Synced 2mo ago

READMEChangelog (10)Dependencies (9)Versions (35)Used By (0)

SilverStripe Payments via Omnipay
=================================

[](#silverstripe-payments-via-omnipay)

[![CI](https://github.com/silverstripe/silverstripe-omnipay/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/silverstripe-omnipay/actions/workflows/ci.yml)[![Code Coverage](https://camo.githubusercontent.com/2b98575b600435f9654db3a0fe630641365e608dd17bede870bdaba236078ba6/68747470733a2f2f636f6465636f762e696f2f67682f73696c7665727374726970652f73696c7665727374726970652d6f6d6e697061792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/silverstripe/silverstripe-omnipay)[![Latest Stable Version](https://camo.githubusercontent.com/75adef28524e9ffbe55c567d15018b3cccab4b4a2d20dd14d1dc47fc2851e772/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f73696c7665727374726970652d6f6d6e697061792f762f737461626c652e706e67)](https://packagist.org/packages/silverstripe/silverstripe-omnipay)[![Total Downloads](https://camo.githubusercontent.com/e76b42e4fbbff80bb51d05026a6051f0319857745fcc929971a2ab994cbd3abb/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f73696c7665727374726970652d6f6d6e697061792f646f776e6c6f6164732e706e67)](https://packagist.org/packages/silverstripe/silverstripe-omnipay)[![Latest Unstable Version](https://camo.githubusercontent.com/9010c2b2a930483f4e246dbf2a38db2751af6d981f4300fb6192a765e20de3c1/68747470733a2f2f706f7365722e707567782e6f72672f73696c7665727374726970652f73696c7665727374726970652d6f6d6e697061792f762f756e737461626c652e706e67)](https://packagist.org/packages/silverstripe/silverstripe-omnipay)

Live chat: [!\[Gitter\](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/silverstripe/silverstripe-omnipay?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

The aim of this module is to make it easy for developers to add online payments to their SilverStripe application. In a nutshell, it wraps the PHP Omnipay payments library and provides some additional functionality. To understand more about omnipay, see:

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

[](#requirements)

- PHP 8.3+
- [silverstripe framework](https://github.com/silverstripe/silverstripe-framework) v6 +
- [omnipay](https://github.com/omnipay/common) 3 &amp; its dependencies - which include guzzle and some symphony libraries.

Features
--------

[](#features)

- Gateway configuration via YAML config.
- Payment / transaction model handling.
- Detailed + structured logging in the database.
- Provide visitors with one, or many gateways to choose from.
- Provides form fields, which can change per-gateway.
- Caters for different types of gateways: on-site capturing, off-site capturing, and manual payment.
- Wraps the [Omnipay](https://github.com/thephpleague/omnipay) php library.
- Multiple currencies.

Compatible Payment Gateways
---------------------------

[](#compatible-payment-gateways)

There are many [gateways](https://github.com/thephpleague/omnipay#payment-gateways) available, which you can install separately.

Searching packagist is useful:

It is not too difficult to write your own gateway integration either, if needed.

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

[](#installation)

[Composer](http://doc.silverstripe.org/framework/en/installation/composer) is currently the only supported way to set up this module:

```
composer require silverstripe/silverstripe-omnipay ^3@dev

```

You will also need to pull in your payment adapter of choice. Have a look at where the second column is the package name.

For example, if your site uses PayPal you would also need to run:

```
composer require omnipay/paypal

```

There's also short guide how to enable [manual payments](docs/en/ManualPaymentSetup.md) or [PayPal Express](docs/en/PayPalExpressSetup.md) available.

Configuration
-------------

[](#configuration)

Silverstripe Omnipay offers a lot of configuration options. A full list can be found in our [dedicated configuration documentation](docs/en/Configuration.md).

Gateway naming conventions
--------------------------

[](#gateway-naming-conventions)

The way gateways are named is dictated by the Omnipay module. Since there might be different gateways in one Omnipay-Payment-Driver, we need a way to address these via different names.

The rules are pretty simple: Class names beginning with a namespace marker (`\`) are left intact. Non-namespaced classes are expected to be in the `\Omnipay` namespace. In non-namespaced classes, underscores or slashes (`\`) are used to denote a specific gateway instance.

Examples:

- `\Custom\Gateway` → `\Custom\Gateway`
- `\Custom_Gateway` → `\Custom_Gateway`
- `Stripe` → `\Omnipay\Stripe\Gateway`
- `PayPal\Express` → `\Omnipay\PayPal\ExpressGateway`
- `PayPal_Express` → `\Omnipay\PayPal\ExpressGateway`

And another example: [Omnipay PayPal](https://github.com/thephpleague/omnipay-paypal) comes with three different gateway implementations: `ExpressGateway`, `ProGateway` and `RestGateway`. The gateway names for these gateways would be: `PayPal_Express`, `PayPal_Pro` and `PayPal_Rest`.

Please follow the rules above to choose the correct gateway name in your configuration files.

Throughout the documentation and examples of this module, you'll find the syntax with underscores. It's easier to read and less error-prone (escaping) than the syntax with namespace markers (`\`).

Usage
-----

[](#usage)

We have produced a comprehensive [getting started guide](docs/en/GettingStarted.md) in our documentation pages

### The Payment Services and Service Factory

[](#the-payment-services-and-service-factory)

There are currently five payment services available, which map to methods exposed by Omnipay. Which one you can use in practice depends on the capabilities of the individual gateway. Some gateways will support all services, while some support only a few (eg. the "Manual" gateway doesn't support "purchase").

The services are:

- `PurchaseService` : Directly purchase/capture an amount.
- `AuthorizeService`: Authorize an amount.
- `CaptureService`: Capture a previously authorized amount.
- `RefundService`: Refund a previously captured amount.
- `VoidService`: Void/Cancel an authorized payment.

Each of these services implements an `initiate` and a `complete` method. The `initiate` method is always required and initiates a service. Depending on how the gateway handles requests, you might also need the `complete` method.

This is the case with offsite payment forms, where `initiate` will redirect the user to the payment form and once he returns from the offsite form, `complete` will be called to finalize the payment.

Another (less common) case is, when the payment provider uses asynchronous notifications to confirm changes to payments.

While you can instantiate the services explicitly, the recommended approach is to use the `ServiceFactory`. The service factory allows easy customization of which classes should be instantiated for which intent. The service-factory can also automatically return an `AuthorizeService` or `PurchaseService`, depending on what was configured for the chosen Gateway.

The following constants are available to instantiate Services:

- `INTENT_PURCHASE` requests a purchase service.
- `INTENT_AUTHORIZE` requests an authorize service.
- `INTENT_CAPTURE` requests a capture service.
- `INTENT_REFUND` requests a refund service.
- `INTENT_VOID` requests a void service.
- `INTENT_PAYMENT` returns authorize- or purchase-service, depending on selected Gateway.

In code:

```
$payment = Payment::create()->init("PxPayGateway", 100, "NZD");

// The service will be a `PurchaseService`
$service = ServiceFactory::create()->getService($payment, ServiceFactory::INTENT_PURCHASE);

// Initiate the payment
$response = $service->initiate($data);
```

### Passing correct data to the purchase function

[](#passing-correct-data-to-the-purchase-function)

The omnipay library has a defined set of parameters that need to be passed in. Here is a list of parameters that you should map your data to:

```
transactionId
firstName
lastName
email
company
billingAddress1
billingAddress2
billingCity
billingPostcode
billingState
billingCountry
billingPhone
shippingAddress1
shippingAddress2
shippingCity
shippingPostcode
shippingState
shippingCountry
shippingPhone

```

**Note:** `transactionId` can be a reference that identifies the thing you are paying for, such as an order reference id. It usually shows up on bank statements for reconciliation purposes, but ultimately depends how the gateway uses it.

Security
--------

[](#security)

When customizing the payment flow (e.g. subclassing `PaymentForm` or `OrderProcessor`), please take care to only pass whitelisted user input to `PurchaseService` and the underlying omnipay gateways. The easiest way to ensure no arbitrary data can be injected is by using `Form->getData()` rather than acessing `$_REQUEST` directly, since this will only return you data for fields originally defined in the form.

Debugging payments
------------------

[](#debugging-payments)

Please read the [logging documentation](docs/en/Logging.md) on how to set up logging.

Renaming gateways and translation
---------------------------------

[](#renaming-gateways-and-translation)

You can change the front-end visible name of a gateway using the translation system. The gateway name must match what you entered in the `allowed_gateways` YAML config.

For example, inside `mysite/lang/en.yml`:

```
en:
  Gateway:
    Paystation_Hosted: "Credit Card"
    PayPal_Express: "PayPal"
```

This approach can also be used to provide different translations. For further information about module translations, please read [docs/en/Translating.md](docs/en/Translating.md)

Further Documentation
---------------------

[](#further-documentation)

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance52

Moderate activity, may be stable

Popularity36

Limited adoption so far

Community32

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~90 days

Recently: every ~68 days

Total

33

Last Release

1651d ago

Major Versions

1.2.x-dev → 2.0-alpha2016-04-19

1.3.0 → 2.0.02016-07-06

2.4.0 → 3.0.0-alpha12018-06-13

2.5.0 → 3.0.0-alpha22018-07-16

2.x-dev → 3.0.12020-12-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/485dfc9fc93cad085c83c3276f19b6e9322ee910ab0e1685de0db42228dbf97b?d=identicon)[markguinn](/maintainers/markguinn)

![](https://avatars.githubusercontent.com/u/1356335?v=4)[Jeremy Shipman](/maintainers/jedateach)[@jedateach](https://github.com/jedateach)

---

Top Contributors

[![jedateach](https://avatars.githubusercontent.com/u/1356335?v=4)](https://github.com/jedateach "jedateach (175 commits)")[![bummzack](https://avatars.githubusercontent.com/u/1006185?v=4)](https://github.com/bummzack "bummzack (108 commits)")[![wilr](https://avatars.githubusercontent.com/u/101629?v=4)](https://github.com/wilr "wilr (35 commits)")[![chillu](https://avatars.githubusercontent.com/u/111025?v=4)](https://github.com/chillu "chillu (17 commits)")[![lozcalver](https://avatars.githubusercontent.com/u/1655548?v=4)](https://github.com/lozcalver "lozcalver (13 commits)")[![mlewis-everley](https://avatars.githubusercontent.com/u/687143?v=4)](https://github.com/mlewis-everley "mlewis-everley (5 commits)")[![AntonyThorpe](https://avatars.githubusercontent.com/u/1023740?v=4)](https://github.com/AntonyThorpe "AntonyThorpe (3 commits)")[![zanderwar](https://avatars.githubusercontent.com/u/13566916?v=4)](https://github.com/zanderwar "zanderwar (3 commits)")[![hchokshi](https://avatars.githubusercontent.com/u/10136407?v=4)](https://github.com/hchokshi "hchokshi (2 commits)")[![tractorcow](https://avatars.githubusercontent.com/u/936064?v=4)](https://github.com/tractorcow "tractorcow (2 commits)")[![laminbarrow](https://avatars.githubusercontent.com/u/199055?v=4)](https://github.com/laminbarrow "laminbarrow (2 commits)")[![wernerkrauss](https://avatars.githubusercontent.com/u/1043925?v=4)](https://github.com/wernerkrauss "wernerkrauss (2 commits)")[![catharsisjelly](https://avatars.githubusercontent.com/u/510747?v=4)](https://github.com/catharsisjelly "catharsisjelly (2 commits)")[![fb3rasp](https://avatars.githubusercontent.com/u/121368?v=4)](https://github.com/fb3rasp "fb3rasp (2 commits)")[![madmatt](https://avatars.githubusercontent.com/u/893117?v=4)](https://github.com/madmatt "madmatt (1 commits)")[![mikeyc7m](https://avatars.githubusercontent.com/u/6045159?v=4)](https://github.com/mikeyc7m "mikeyc7m (1 commits)")[![cjsewell](https://avatars.githubusercontent.com/u/1856199?v=4)](https://github.com/cjsewell "cjsewell (1 commits)")[![nspyke](https://avatars.githubusercontent.com/u/901747?v=4)](https://github.com/nspyke "nspyke (1 commits)")[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (1 commits)")[![StephenHonor](https://avatars.githubusercontent.com/u/6010639?v=4)](https://github.com/StephenHonor "StephenHonor (1 commits)")

---

Tags

silverstripepaymentomnipay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/burnbright-silverstripe-omnipay/health.svg)

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

###  Alternatives

[silverstripe/silverstripe-omnipay

SilverStripe Omnipay Payment Module

38106.0k15](/packages/silverstripe-silverstripe-omnipay)[sudiptpa/omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

1017.2k](/packages/sudiptpa-omnipay-nabtransact)

PHPackages © 2026

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