p2flux/laravel
A Laravel integration for P2Flux that registers a service provider, facade, and publishable config, making the P2Flux client available throughout your app. Install via Composer, publish the config, and use it in controllers, jobs, and Artisan commands.
Architecture fit
p2flux/sdk-php; v0.5.1 changes nothing structurally — it is a pass-through of two parameters (return_url on request, checkout_url on response).P2Flux::createPayment(), P2Flux::createPaymentLink()) is idiomatic Laravel and keeps vendor calls behind a single seam, which is the right shape for a TPM-owned integration: swapping or wrapping the vendor later does not require touching controllers.return_url reinforces this — the buyer is redirected to our site only after payment completes on vendor-hosted pages.Integration feasibility
composer require, publish config, set credentials in .env, call the facade from a checkout controller, handle the redirect back. A single Laravel developer can prototype end-to-end in a sandbox in under a day.return_url is the practical unlock for product UX: previously (implied) there was no documented way to bring the buyer back, so confirmation pages, order-state polling, and conversion analytics were awkward. Now the flow can close the loop on our domain.Technical risk
p2flux/sdk-php 0.13" may mean the constraint was widened (0.12 and 0.13 permitted) or the floor was raised (0.12 dropped). The latter is a silent breaking change for anyone pinned to 0.12 — must be verified against composer.json, not release prose.return_url. If any part of that value is user- or tenant-supplied, it becomes an open-redirect vector. It must be derived from configuration or an allowlist, never from request input.checkout_url is vendor-controlled data. Treat it as untrusted before issuing a redirect; validate scheme/host rather than blindly redirect()->away().return_url is a UX signal only. Without a webhook or a server-side status fetch, a user can hit the return URL directly, replay it, or never return at all (closed tab, network drop).Key questions
return_url the only completion signal? If the latter, what is the reconciliation API?return_url against registered/allowlisted domains server-side?createPaymentLink() produce single-use or reusable links, and does it carry expiry?createPayment()?checkout_url a stable contract or subject to change without notice?Stack fit
.env with config caching; per-environment keys (sandbox vs. live) should be separated at the config layer, not in code.PaymentGateway interface so vendor churn is absorbed in one place.Migration path
checkout_url if we want resumable checkouts).Compatibility
composer.lock for production and treat SDK bumps as reviewed changes, not routine composer update fallout — 0.x carets are effectively wildcards.Sequencing
createPayment → hosted checkout → return_url → confirmation end-to-end.return_url construction and checkout_url validation.createPaymentLink() for email/quote use cases separately.Maintenance
Support
Scaling
createPayment and surface a retry path; a hung call must not hang the checkout page.Failure modes
createPayment times out after the vendor created a payment; without idempotency keys this can double-charge on retry.return_url — a typo or a localhost value in production strands paying users on a dead page; validate config at boot.return_url turns our domain into a phishing hop; enforce allowlisting.composer update silently changes payment behaviour; guard with lockfile discipline and a smoke test.Ramp-up
How can I help you explore Laravel packages today?