gocardless-pro-php
Official GoCardless Pro PHP client for Direct Debit payments and the GoCardless API.
Repository Health
Technical Analysis
gocardless-pro is the official PHP client library for the GoCardless Pro API, the platform for collecting recurring and one-off Direct Debit payments. It exposes every GoCardless resource - customers, mandates, payments, subscriptions, payouts, refunds, and more - through service objects with consistent list, get, create, and update methods.
The client handles authentication, sandbox versus live environments, pagination, idempotency, and webhook signature verification, so PHP applications can integrate bank-to-bank payments without dealing with raw HTTP.
What You Get
- A configured
GoCardlessPro\Clientwith sandbox and live environment switching - Service accessors for every GoCardless resource (customers, mandates, payments, subscriptions, payouts)
- Consistent list/get/create/update methods returning typed resource objects
- Built-in pagination via ListResponse records and cursor helpers
- Idempotency-key support and webhook signature verification helpers
Common Use Cases
- Collecting recurring Direct Debit subscription payments
- Setting up customer bank mandates and one-off payments
- Reconciling payouts and refunds from a PHP backend
- Verifying and processing GoCardless webhook events
Under The Hood
Architecture - A GoCardlessPro\Client (lib/Client.php) builds an internal API client and lazily instantiates per-resource service objects under lib/Services, each backed by shared request/response and pagination machinery in lib/Core; resources under lib/Resources model the typed entities returned by the API. Tech Stack - PHP client built on Guzzle for HTTP, using CircleCI for continuous integration and PHPUnit for its test suite, organized under a PSR-4 GoCardlessPro namespace. Code Quality - The library ships an extensive tests/ tree (Core, Integration, Resources, Support, and JSON fixtures) that exercises services against recorded responses, giving good coverage of the generated service layer. API Design - The $client->customers()->list() / ->get($id) / ->create([...]) pattern is uniform across every resource, with an options array as the final argument for URL params and idempotency, making the surface predictable once one resource is learned.