PHPackages                             cboxdk/laravel-billing-mollie - 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. cboxdk/laravel-billing-mollie

ActiveLibrary[Payment Processing](/categories/payments)

cboxdk/laravel-billing-mollie
=============================

Cbox Billing — Mollie payment-gateway adapter: a PaymentGateway implementation backed by Mollie, for cboxdk/laravel-billing.

v0.5.1(1mo ago)07↓75%MITPHPPHP ^8.4CI passing

Since Jul 15Pushed 3w agoCompare

[ Source](https://github.com/cboxdk/laravel-billing-mollie)[ Packagist](https://packagist.org/packages/cboxdk/laravel-billing-mollie)[ RSS](/packages/cboxdk-laravel-billing-mollie/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (7)Dependencies (18)Versions (10)Used By (0)

Cbox Billing — Mollie
=====================

[](#cbox-billing--mollie)

**`cboxdk/laravel-billing-mollie`** — a Mollie payment-gateway adapter for [`cboxdk/laravel-billing`](https://github.com/cboxdk/laravel-billing). It implements billing's `PaymentGateway` contract backed by Mollie.

Install
-------

[](#install)

```
composer require cboxdk/laravel-billing-mollie
```

```
// .env
MOLLIE_KEY=live_...
MOLLIE_REDIRECT_URL=https://your-app.test/billing/return
```

With a key set, the provider binds `Cbox\Billing\Payment\Contracts\PaymentGateway`to the Mollie gateway. Mollie is redirect-based, so a payment starts `open`(pending) until the customer completes it and Mollie confirms `paid`.

Design
------

[](#design)

- **SDK isolated behind a seam** (`MollieIntentCreator`): the real `MollieApiIntentCreator` wraps the Mollie SDK; a `FakeMollieIntentCreator` drives the tests — so status-mapping and error handling are unit-tested without the network.
- **Never throws.** An API failure becomes a failed `PaymentResult`; Mollie statuses map to `succeeded` (paid) / `pending` (open) / `requires_action`(authorized) / `failed`.
- **Customers and mandates.** `createCustomer()` mints a Mollie customer (`cst_…`), stamping the host's account key into its metadata so it reconciles from the Mollie dashboard; a customer that never reached Mollie is never returned. In Mollie a saved recurring "payment method" *is* a mandate, so `detachPaymentMethod($account, $paymentMethodId)` treats `$paymentMethodId` as a mandate id and `$account` as the owning customer reference, and **revokes** that mandate. The revoke is idempotent — an already-revoked or unknown mandate (Mollie 410 / 404) is a no-op.
- **Idempotent webhooks on the shared seam.** `MollieApiWebhookVerifier` implements billing's canonical `Cbox\Billing\Payment\Contracts\WebhookVerifier`: it proves the Mollie signature via the SDK (deny-by-default), fetches the payment's authoritative state through the `PaymentFetcher` seam (a Mollie webhook carries only the payment id), and normalises the delivery onto the engine's shared `WebhookEvent`. `MollieWebhookHandler` then hands that event to the engine's own `WebhookIngest`, which applies the paid effect to the invoice exactly once per reference — collapsing gateway re-deliveries and crash-retries. The adapter only overrides the shared dedup/settle stores with durable database implementations; it owns no webhook contracts of its own. Charges carry a scoped external idempotency key so a crash-and-retry never duplicates a payment. Set `MOLLIE_WEBHOOK_SECRET` to enable it. See [docs/core-concepts/webhooks.md](docs/core-concepts/webhooks.md).

> The SDK wrapper implements Mollie's documented API shape — verify against the live Mollie API before relying on it in production.

Running the live integration tests
----------------------------------

[](#running-the-live-integration-tests)

The default suite proves the gateway's mapping and error handling against the `FakeMollieIntentCreator` — no network. A separate suite in [`tests/Integration/MollieLiveTest.php`](tests/Integration/MollieLiveTest.php)(Pest group `integration`) exercises the **real** Mollie API path (`MollieApiIntentCreator` + `MolliePaymentGateway`) against **Mollie test mode**.

It is gated on a `test_…` key in `MOLLIE_TEST_KEY` — deliberately distinct from a production `MOLLIE_KEY` so the two can never collide. Without the key the suite skips cleanly, so `composer qa` / `vendor/bin/pest` stay green (skips reported) and the suite is excluded from CI. No secret lives in the repo.

Run it explicitly:

```
MOLLIE_TEST_KEY=test_… vendor/bin/pest --group=integration
```

It hits Mollie **test mode only** (a `test_…` key forces test mode on every request, so no live money moves), and it creates then revokes **throwaway** test objects — a stored customer (`cst_…`) and a `directdebit` mandate (`mdt_…`) established headlessly with Mollie's documented test IBAN — deleting the customer on teardown. What it covers end-to-end, unattended:

- `createCustomer()` → a `cst_…` id with the host account stamped into `metadata.account`.
- a `directdebit` mandate created directly via the customer-mandates API (no redirect).
- `detachPaymentMethod()` revokes the mandate (it becomes `invalid`/gone), and calling it **again** is an idempotent no-op (Mollie 410/404) — also proven against a never-created mandate id.

**Manual step (not covered).** The `first`-sequence **setup-payment** path (`createSetupIntent()`) returns a Mollie hosted-checkout URL a human must complete in a browser to establish the mandate, so it cannot run unattended and is **not** exercised here. The headless `directdebit`-mandate route above stands in for it to prove the revoke/detach lifecycle; the redirect-completed setup flow must be verified manually.

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

[](#requirements)

PHP `^8.4`; Laravel `^12 || ^13`; `mollie/mollie-api-php` `^3.13`; `cboxdk/laravel-billing`.

License
-------

[](#license)

MIT.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance94

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

9

Last Release

35d ago

### Community

Maintainers

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

---

Top Contributors

[![sylvesterdamgaard](https://avatars.githubusercontent.com/u/2431914?v=4)](https://github.com/sylvesterdamgaard "sylvesterdamgaard (12 commits)")

---

Tags

billingcboxgatewaylaravelmolliepaymentslaravelbillingpaymentsgatewaymolliecbox

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cboxdk-laravel-billing-mollie/health.svg)

```
[![Health](https://phpackages.com/badges/cboxdk-laravel-billing-mollie/health.svg)](https://phpackages.com/packages/cboxdk-laravel-billing-mollie)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.1k6.4M360](/packages/laravel-ai)[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k59.5M714](/packages/laravel-scout)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k31.8M166](/packages/laravel-cashier)[spatie/laravel-health

Monitor the health of a Laravel application

89313.5M195](/packages/spatie-laravel-health)[illuminate/queue

The Illuminate Queue package.

20433.5M1.9k](/packages/illuminate-queue)

PHPackages © 2026

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