chargily/chargily-pay
Laravel package for integrating Chargily Pay, the Algerian payment gateway. Create checkouts, redirect customers, verify webhooks, and manage payments through a simple, configurable API designed for PHP and Laravel applications.
Architecture fit. chargily/chargily-pay is a thin, framework-agnostic PHP SDK over the Chargily Pay V2 REST API. It is not a Laravel package in the conventional sense — expect no service provider, config publish, or facade unless the vendor has added one since. That is not a blocker: the SDK slots in as an infrastructure adapter behind a domain-level payment port (createCheckout(), verifyWebhook(), refund()), and Laravel's container can bind it in a small custom provider we own. The architectural risk is therefore low if we treat it as an implementation detail rather than leaking its DTOs into application code. Fit is good for a Laravel monolith or modular monolith; it is a poor fit if we need a multi-PSP abstraction layer with provider-agnostic semantics, because Chargily's checkout/resource model (products, prices, checkouts, webhook events) is idiosyncratic and will not map cleanly onto a generic "payment intent" abstraction.
Integration feasibility. High. The integration surface is small: HTTP client with secret key, checkout session creation returning a redirect URL, and signed webhook callbacks. A competent Laravel engineer can produce a working sandbox checkout in under a day. The real effort is not the SDK call — it is the surrounding lifecycle: order state machine, idempotent webhook processing, reconciliation of asynchronous settlement, and refund handling. Budget 1–2 engineer-weeks for a production-grade integration including tests, not the 1–2 days the SDK's simplicity implies.
Technical risk. The dominant risk is adoption and bus factor, not code quality. 17 stars and 0 dependents means effectively zero public production usage we can point to; there is no community to surface bugs, no Stack Overflow corpus, and no third-party security review. A defect in webhook signature verification or in retry/idempotency handling would be discovered by us, in production, with money attached. Secondary risks: (a) the library tracks a V2 API that the vendor controls unilaterally — minor version bumps may carry behavioural changes; (b) it is a vendor-published SDK, which cuts both ways — best possible alignment with API changes, worst-case alignment with vendor priorities and release cadence; (c) regional payment rails (DZD, CIB/Edahabia cards) have their own failure semantics — declines, timeouts, and delayed settlement — that generic retry logic will handle wrongly. MIT licence and no transitive dependency weight keep legal and supply-chain risk negligible.
Key questions.
Stack fit. Clean fit for PHP 8.1+ / Laravel 10–12. No framework coupling means no version-lock friction. The SDK's only meaningful dependencies will be an HTTP client (likely Guzzle or PSR-18) and a JSON parser — both already present in any Laravel install, so composer resolution risk is near zero. The one thing to confirm before committing is whether the SDK pulls its own HTTP client version constraint that conflicts with Laravel's pinned Guzzle.
Migration path. There is nothing to migrate from unless we already use Chargily V1 — in which case this is a hard cutover, since V2 changes resource shapes and the V1 SDK is not forwards-compatible. Plan the cutover as a parallel-run: stand up V2 checkout alongside V1 behind a per-merchant flag, reconcile both against settlement reports for one full billing cycle, then retire V1. If we are greenfield, skip migration entirely and go straight to the adapter design.
Compatibility. Two axes to verify. Vertical: PHP and Laravel version support declared in composer.json versus our fleet's floor. Horizontal: whether the SDK's error model (exceptions vs. result objects) composes with Laravel's exception handler and our existing logging/alerting. The SDK's exception taxonomy should be mapped to our domain errors at the adapter boundary — do not let Chargily\...\ApiException escape into controllers.
Sequencing.
PaymentGateway interface and domain DTOs before writing adapter code, so the SDK stays quarantined in one namespace.auth middleware, verify signature before parsing, persist raw payload, enqueue a job, return 200 fast. Idempotency keyed on the vendor event ID.Deliberately defer refunds and partial-capture semantics to phase two — they are the least-exercised code paths in any low-adoption SDK and deserve their own verification pass.
Maintenance. Low ongoing effort if the API surface we use stays narrow. Realistically 1–2 days per quarter for dependency bumps, plus whatever the vendor's release notes force. The MIT licence and small dependency footprint mean no licence-audit overhead. The absent dependents figure means we will not benefit from community patch velocity — assume we are the ones who will find the bugs.
Support. Support channel is GitHub issues against the vendor repo. Expect timezone and language considerations (Algeria-based vendor), and no commercial SLA tied to the SDK itself. Mitigation: keep the integration shallow enough that we can bypass the SDK and call the REST API with plain HTTP within a day if the library stalls. That escape hatch is the single most important operational property and should be documented in the runbook.
Scaling. The SDK is stateless per request; scaling characteristics are entirely those of the upstream gateway. Our side scales horizontally with no shared state. The genuine scaling constraints are vendor-side: rate limits on checkout creation, webhook delivery throughput, and settlement latency. Model these explicitly — do not assume the gateway handles a flash-sale burst, and queue outbound checkout creation so our own request threads are not held open on a slow vendor.
Failure modes.
Ramp-up. A mid-level Laravel engineer reaches productive velocity in roughly half a day on the SDK itself; the payment-lifecycle concepts (idempotency, webhook trust boundaries, reconciliation) take longer and are the actual training cost. Recommend one engineer own the integration end-to-end through production, then a written runbook covering: how to replay a webhook, how to reconcile a stuck order, how to rotate keys, and how to swap to direct HTTP calls if the SDK is abandoned. Onboarding a second engineer is cheap once the adapter boundary exists, which is the strongest argument for writing that boundary on day one rather than calling the SDK from controllers.
How can I help you explore Laravel packages today?