lemonway/php-sdk
PHP SDK for Lemon Way that wraps the payment API in convenient classes, covering authentication, wallet management, SEPA transfers, payment operations, and transaction status calls. Designed to simplify Lemon Way integration in Laravel and other PHP apps.
Architecture fit. Despite the Composer-style name, lemonway/php-sdk is not an SDK — it is a reference implementation (php-client-directkit-xml, "PHP example calling DirectKit XML API with simple HTTP request"). It hand-builds XML envelopes and POSTs them to a Lemonway endpoint; there is no PSR-4 autoloading, no versioned release history, no tests, and no framework wiring. From a TPM's perspective, treat it as protocol documentation you can execute, not a dependency you install. If it enters the codebase at all, it must sit behind a PaymentGateway port in an infrastructure adapter. It should never surface XML strings or Lemonway vocabulary (wallets, wlLogin, wlRef) in the domain layer, or provider choice becomes a rewrite instead of a config change.
Integration feasibility. The valuable asset here is knowledge, not code: endpoint shapes for sandbox vs. production (/mb/{account}/directkitxml/), the required auth parameters per call (wlLogin, wlPass, walletIp, language, version), IP whitelisting, and request/response envelopes for wallet creation, card registration, MoneyInWebInit/MoneyIn, KYC upload, SEPA transfers, and refunds. That is several days of reverse-engineering removed from the estimate. The code itself will be copied and rewritten, not required. Realistic scoping: a two-week discovery-plus-adapter effort, dominated by Lemonway semantics and compliance onboarding, not by HTTP plumbing.
Technical risk.
Key questions.
Stack fit. Laravel 8+/PHP 8.x with Composer is fine, but the sample predates modern conventions and will need porting rather than requiring. Natural home: app/Infrastructure/Payments/Lemonway/, promoted to a private Composer package (acme/lemonway-client) if more than one service consumes it. Configuration belongs in config/services.php with env-backed credentials, never in source.
Migration path.
GetWalletDetails or GetWalletStatus on a manually created wallet — to validate credentials, IP whitelist, and XML parsing in one step. Do not open with MoneyIn/SendPayment; they are irreversible and noisy to debug.Http client. That single change buys timeouts, retry with backoff, Http::fake() for tests, request/response events, and centralized logging.LemonwayClient implements the PaymentGateway port; requests and responses become DTOs/value objects, not SimpleXMLElement. Map Lemonway error codes into a domain error taxonomy instead of leaking raw XML. Bind it as a singleton so config, logging, and instrumentation live in one place.MoneyInWebInit returns a redirect URL; terminal state arrives via return URL and/or server callback. Persist intent before redirect, key on wlRef/reference, and reconcile with a scheduled job.Compatibility. Audit for PHP 5.x/7.x idioms and removed functions before porting. Assume no composer.json platform constraints, no namespaces, no type declarations, and no DI — nothing is mockable until it is rewritten. Budget the port accordingly rather than assuming it is a drop-in.
Sequencing recommendation. Gate the work: protocol spike first, then a go/no-go on XML versus JSON. If XML is on a short deprecation runway, stop and build against JSON from day one. If XML is confirmed stable, proceed to adapter, then a read-only call, then a sandbox money-in, then reconciliation, then production. Each step is a checkpoint a TPM can report against; each is independently abortable.
Maintenance. Zero upstream maintenance — you own every line forever. Mitigate by forking into your own VCS with a real composer.json, a version tag, and tests around XML serialization and error mapping, so it becomes a controlled internal asset rather than a vendored mystery. Budget recurring effort for protocol drift and for the eventual JSON migration.
Support. No OSS community (6 stars, 0 dependents, no issue-tracker signal). Support is entirely commercial, through the Lemonway contract — meaning your incident response depends on a third party's business hours in a French regulatory context. That belongs in the risk register, not just the vendor file.
Scaling. The sample is synchronous and single-request: no connection reuse, no batching, no rate-limit awareness. Lemonway enforces its own limits, so throughput will be bounded by the provider, not by the PHP layer. Design accordingly: queue money-moving operations, exponential backoff on 5xx and network errors, never retry a non-idempotent call without a stored reference, and keep a per-account concurrency cap. Architect for the ceiling rather than discovering it at peak.
Failure modes to instrument explicitly.
Ramp-up. Code complexity is trivial; domain complexity is not. Expect one to two weeks for a competent Laravel engineer to be productive, most of it spent on Lemonway semantics rather than the sample: wallet vs. account, fees and commission models, IBAN/BIC validation, SEPA direct debit, KYC document types, and PSD2/SCA rules. Someone on the team must own payments domain knowledge — reconciliation, refunds, and disputes are where these projects actually fail, and no SDK solves them.
TPM verdict. Fund this as a timeboxed discovery spike and adapter build, not an install. Its leverage is that it prices the "buy" side of a build-vs-buy decision and surfaces real integration surface area before contract signature. Adopt the knowledge, fork the code, wrap it behind an interface, confirm the XML deprecation timeline as a hard gate, and staff a payments domain owner alongside the engineer. The dominant costs will be KYC/compliance onboarding and reconciliation — plan and communicate the budget around those, not around the HTTP calls.
How can I help you explore Laravel packages today?