PHPackages                             bennetgallein/omnipay-gocardlessv2 - 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. bennetgallein/omnipay-gocardlessv2

ActiveLibrary[Payment Processing](/categories/payments)

bennetgallein/omnipay-gocardlessv2
==================================

GoCardless gateway for Omnipay payment processing library, using the v2 GoCardless API

v0.0.12(1y ago)0292MITPHPPHP ^7|^8

Since Nov 27Pushed 1y agoCompare

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

READMEChangelogDependencies (7)Versions (13)Used By (0)

Omnipay: GoCardlessV2
=====================

[](#omnipay-gocardlessv2)

**Go Cardless driver for the Omnipay PHP payment processing library using the GoCardless v2 API**

[![Build Status](https://camo.githubusercontent.com/fd35e0fa1934083fff69a4cffcb1a0073d5c4f451c8335df3acc7a5e1e8bb8bc/68747470733a2f2f7472617669732d63692e6f72672f62656e6e657467616c6c65696e2f6f6d6e697061792d676f636172646c65737376322e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/bennetgallein/omnipay-gocardlessv2)[![Coverage Status](https://camo.githubusercontent.com/eb32c1d22ac66c161bb5a89bb4fe911098db6ca417e5dab888a76159aeaeb7c1/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f62656e6e657467616c6c65696e2f6f6d6e697061792d676f636172646c65737376322f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/bennetgallein/omnipay-gocardlessv2?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/f42d650b01fd8e7f30f5ff34d7457b869010d15cae63f63276fd5d31cc0fe5b0/68747470733a2f2f706f7365722e707567782e6f72672f62656e6e657467616c6c65696e2f6f6d6e697061792d676f636172646c65737376322f76657273696f6e2e706e67)](https://packagist.org/packages/bennetgallein/omnipay-gocardlessv2)[![Total Downloads](https://camo.githubusercontent.com/fc217799026cf46bae8816abc702ada7f81325a6388d9deb4d7ddb7ee8920d10/68747470733a2f2f706f7365722e707567782e6f72672f62656e6e657467616c6c65696e2f6f6d6e697061792d676f636172646c65737376322f642f746f74616c2e706e67)](https://packagist.org/packages/bennetgallein/omnipay-gocardlessv2)

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

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
composer require digitickets/gocardlessv2:"^0"

```

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

[](#basic-usage)

The following gateways are provided by this package:

- GoCardless Pro - Release Candidate
- GoCardless Pro (JS Flow) - Release Candidate
- GoCardless Redirect Flow - Alpha Release

Please let us know if you are using these release candidates in a production envrionment and we will make a formal release - until that time we may push breaking changes!

Don't know which gateway to use?

- If you are using GoCardless' own payment screens on their site you want the RedirectGateway.
- If you are using the GoCardless Javascript to process the card details and return a token then the JSFlowGateway is for you.
- If you are handling the bank account details on your own server (accepting the highest level of PCI responsibility) then the Pro Gateway is for you.

All the gateways wrap a common core with a lot of shared methods but they differ in mechanism for creating customers, bank accounts and mandates. Redirect returns you a mandate with customer / bank account created behind the scenes. JSFlow returns you a bank account token so you can create a customer, bank account and mandate yourself without handling the bank account details. Pro requires you to submit all the data yourself in individual steps. Creating a subscription or taking a single payment is common to all.

This is still in Development - Only the JS Flow gateway is currently stable.

You need to set your `access_token`. Setting `testMode` to true will use the `sandbox` environment.

This gateway supports single payments or scheduled subscriptions via bank mandate only. For more details about what this gateway supports please consult [the documentation](https://developer.gocardless.com/api-reference/)

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)repository.

Driver specific usage
---------------------

[](#driver-specific-usage)

This driver supports multiple methods of implementation available via GoCardless. Please consult their documentation to confirm which methods are correct for your situation. Not all methods are applicable to every route. This driver does not provide access to the list methods - data may only be retrieved by primary key.

### Create customer

[](#create-customer)

```
$customer = $gateway->createCustomer([
    'customerData' => array(
                            'card' => new \Omnipay\Common\CreditCard( // use the standard omnipay card to hold the customer data
                                [
                                    'firstName' => 'Mike',
                                    'lastName' => 'Jones',
                                    'email' => 'mike.jones@example.com',
                                    'address1' => 'Iconic Song House, 47 Penny Lane',
                                    'address2' => 'Wavertree',
                                    'city' => 'Liverpool',
                                    'company' => 'Mike Jones Enterprises',
                                    'country' => 'GB',
                                    'postal_code' => 'L18 1DE',
                                    'state' => 'Merseyside',
                                ]
                            ),
                            'customerMetaData' => [
                                'meta1' => 'Lorem Ipsom Dolor Est',
                                'meta2' => 'Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts.',
                                'meta567890123456789012345678901234567890123456789' => 'Separated they live in Bookmarksgrove right at the coast of the Semantics, a large language ocean. A small river named Duden flows by their place and supplies it with the necessary regelialia.',
                            ],
                            'swedishIdentityNumber' => '123',
            ),
])->send();
```

You can find full list of options [here](https://developer.gocardless.com/api-reference/#customers-create-a-customer).

### Find customer (By id)

[](#find-customer-by-id)

```
$customer = $gateway->findCustomer(1)->send();
```

### Parse webhook notification

[](#parse-webhook-notification)

```
$notification = $gateway->parseNotification(
                                getallheaders(),
                                file_get_contents('php://input'),
                                'MySecurityToken'
                            )
                        ->send();
```

This will fetch the event associated with the web hook.

### Process repeat billing

[](#process-repeat-billing)

TODO - this. Use the standard repeatePurchase() format (see sagepay for example structure)

### Suggested generic omnipay driver flow

[](#suggested-generic-omnipay-driver-flow)

We are exploring using a simplified set of functions to allow agnostic processing. Each step checks if the method exists on the driver and if it does call it accordingly, before calling getXyzRefernce and adding it to the data passed around. It is hoped that this structure should work with several major gateways - we have considered Stripe, Paypal and the various GoCardless options.

1. CreateCustomer
2. completeCustomer
3. createPaymentMethod (either create card or create bank account)
4. completePaymentMethod (either complete card or complete bank account)
5. createMandate
6. completeMandate

\---- above this point is setting up the customer data (effectively taking it to the point of having an authorisation token), below is creating the transaction data

7. createPlan
8. completePlan
9. createSubscription
10. completeSubscription

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) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/bennetgallein/omnipay-gocardlessv2e/issues), or better yet, fork the library and submit a pull request.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance40

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 70.8% 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 ~3 days

Recently: every ~9 days

Total

12

Last Release

502d ago

### Community

Maintainers

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

---

Top Contributors

[![bennetgallein](https://avatars.githubusercontent.com/u/15325891?v=4)](https://github.com/bennetgallein "bennetgallein (17 commits)")[![hkwak](https://avatars.githubusercontent.com/u/6288972?v=4)](https://github.com/hkwak "hkwak (3 commits)")[![hillelcoren](https://avatars.githubusercontent.com/u/4629496?v=4)](https://github.com/hillelcoren "hillelcoren (2 commits)")[![pedanticantic](https://avatars.githubusercontent.com/u/7499073?v=4)](https://github.com/pedanticantic "pedanticantic (1 commits)")[![rquadling](https://avatars.githubusercontent.com/u/12801?v=4)](https://github.com/rquadling "rquadling (1 commits)")

---

Tags

paymentgatewaypaymerchantomnipaypurchasegocardless

### Embed Badge

![Health badge](/badges/bennetgallein-omnipay-gocardlessv2/health.svg)

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

###  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)
