PHPackages                             ockle/gocardless-webhook - 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. [API Development](/categories/api)
4. /
5. ockle/gocardless-webhook

ActiveLibrary[API Development](/categories/api)

ockle/gocardless-webhook
========================

Process webhooks from GoCardless

v1.0.3(9y ago)21.1k2MITPHPPHP &gt;=5.6

Since Dec 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ockle/gocardless-webhook)[ Packagist](https://packagist.org/packages/ockle/gocardless-webhook)[ RSS](/packages/ockle-gocardless-webhook/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

GoCardless Webhook
==================

[](#gocardless-webhook)

[![Build Status](https://camo.githubusercontent.com/30b03742b797c28673e0d9f59c426198f0b9e4c63509a9f060a572cd86a16b23/68747470733a2f2f7472617669732d63692e6f72672f6f636b6c652f676f636172646c6573732d776562686f6f6b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ockle/gocardless-webhook)[![Coverage Status](https://camo.githubusercontent.com/5f96e4e18aeac6790254abe996873cd52f9d54255701448678af4fe06f1e704d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6f636b6c652f676f636172646c6573732d776562686f6f6b2f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/ockle/gocardless-webhook?branch=master)

A PHP library to aid is the processing of webhooks from GoCardless (see [API documentation](https://developer.gocardless.com/pro/2015-07-06/#webhooks-overview) for more information).

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

[](#installation)

Install the library using Composer. Add the following to your composer.json:

```
{
    "require": {
        "ockle/gocardless-webhook": "~1.0"
    }
}
```

and then run:

```
composer update ockle/gocardless-webhook
```

Usage
-----

[](#usage)

Instantaiate a new webhook service:

```
// $secret is the string entered in the GoCardless admin when setting up a webhook endpoint
$webhook = new \Ockle\GoCardlessWebhook\Service($secret, new \Symfony\Component\EventDispatcher\EventDispatcher);
```

Then attach event listeners, e.g.:

```
$webhook->onMandate(function (\Ockle\GoCardlessWebhook\Events\MandateEvent $event) use ($client) {
    // Do stuff when a mandate event occurs

    // You can check what the action is:
    if ($event->actionIs(\Ockle\GoCardlessWebhook\Events\MandateEvent::ACTION_CREATED)) {
        // Mandate has been created
    }

    // However, it is advised that you don't do any important business logic based off this, but
    // rather do an API call to get the current status of the mandate and act on that as the accurate
    // source of mandate information. This is due to the fact that events may be received in any order.

    // There are methods to get information about the event, e.g.:
    $mandateId = $event->getMandateId();
});
```

Next, process the webhook, which will trigger your event listeners as necessary:

```
$webhook->process($webhookSignatureFromHeaders, $rawPostBody);
```

Finally, return the correct HTTP status code is your response, which can be got by calling:

```
$webhook->getResponseStatus();
```

License
-------

[](#license)

MIT

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~141 days

Total

4

Last Release

3440d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2755069?v=4)[ockle](/maintainers/ockle)[@ockle](https://github.com/ockle)

---

Top Contributors

[![ockle](https://avatars.githubusercontent.com/u/2755069?v=4)](https://github.com/ockle "ockle (11 commits)")[![mikeSimonson](https://avatars.githubusercontent.com/u/907613?v=4)](https://github.com/mikeSimonson "mikeSimonson (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ockle-gocardless-webhook/health.svg)

```
[![Health](https://phpackages.com/badges/ockle-gocardless-webhook/health.svg)](https://phpackages.com/packages/ockle-gocardless-webhook)
```

###  Alternatives

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k853.6M8.3k](/packages/symfony-http-kernel)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k246.0M11.1k](/packages/symfony-framework-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k181.3M2.2k](/packages/symfony-security-bundle)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)

PHPackages © 2026

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