Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • This package is a thin Laravel integration layer (service provider + facade) over 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).
  • The facade pattern (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.
  • Payment capture is delegated to a hosted checkout. That is the architecturally significant fact: no card data transits our application, keeping PCI scope at SAQ-A rather than a cardholder-data environment. The new return_url reinforces this — the buyer is redirected to our site only after payment completes on vendor-hosted pages.

Integration feasibility

  • Very low integration cost: 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.
  • Remaining work is ours, not the package's: a return route that resolves the order, verifies payment status server-side, and renders a confirmation or pending state; plus idempotent order-state transitions.

Technical risk

  • 0.x versioning is the dominant risk. Both the wrapper (0.5.1) and the SDK (0.13) are pre-1.0. Semver gives no stability guarantee, and minor bumps can break call signatures.
  • Ambiguity in the constraint change. "Allows 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.
  • Trust boundary on 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().
  • The redirect is not proof of payment. 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

  1. Does 0.5.1 raise the minimum SDK to 0.13, and does that break existing installs on 0.12?
  2. Is there a webhook/signed notification channel, or is return_url the only completion signal? If the latter, what is the reconciliation API?
  3. Does the vendor validate return_url against registered/allowlisted domains server-side?
  4. What are the supported Laravel and PHP version ranges for 0.5.1?
  5. Does createPaymentLink() produce single-use or reusable links, and does it carry expiry?
  6. Is there a sandbox/test mode, and documented idempotency keys for createPayment()?
  7. Is checkout_url a stable contract or subject to change without notice?

Integration Approach

Stack fit

  • Standard Laravel package shape (provider, facade, publishable config). No queue, cache, or database coupling is implied, so it drops into an existing app without touching infrastructure.
  • Credentials belong in .env with config caching; per-environment keys (sandbox vs. live) should be separated at the config layer, not in code.
  • Fits naturally into an existing checkout service class; keep the facade behind our own PaymentGateway interface so vendor churn is absorbed in one place.

Migration path

  • Greenfield: install, configure, implement a checkout controller and a return route, ship behind a feature flag.
  • Existing integrations on SDK 0.12: do not bump blindly. Resolve the new constraint in a branch, run the full sandbox flow, and only then merge. If 0.12 remains allowed, defer the SDK bump and adopt only the wrapper.
  • Replacing an incumbent PSP: run both in parallel behind the interface, route a small traffic slice to P2Flux, and reconcile settlements daily before cutover.
  • No database migration is anticipated; the only schema need is whatever fields already track order/payment status (plus storage for vendor payment ID and checkout_url if we want resumable checkouts).

Compatibility

  • Pin exact versions in composer.lock for production and treat SDK bumps as reviewed changes, not routine composer update fallout — 0.x carets are effectively wildcards.
  • Verify the wrapper's Laravel constraint against our current major version before committing; older Laravel majors are the most likely mismatch.
  • Confirm PHP floor matches our runtime; a raised PHP requirement in the SDK can block deployment independently of the wrapper.

Sequencing

  1. Confirm the composer constraint delta (widened vs. raised floor) — this determines whether it is a patch or a breaking change for us.
  2. Stand up sandbox credentials and prove createPayment → hosted checkout → return_url → confirmation end-to-end.
  3. Implement server-side payment-status verification before wiring the return page, so the redirect is never the source of truth.
  4. Add allowlisted return_url construction and checkout_url validation.
  5. Ship to one flow/product behind a flag; measure drop-off at the redirect boundary.
  6. Broaden to all flows, then evaluate createPaymentLink() for email/quote use cases separately.

Operational Impact

Maintenance

  • The wrapper itself is small and cheap to maintain; the real recurring cost is tracking a pre-1.0 SDK. Assume a version bump every few weeks and budget a standing owner plus a regression checklist.
  • Watch the vendor's release feed and security advisories; a 0.x SDK has no long-term support promise, so plan for a forced upgrade at least once per quarter.

Support

  • Card-data handling questions disappear from our support queue — a genuine operational win from hosted checkout.
  • In exchange, checkout-page failures (declined cards, 3DS loops, broken redirects) become "the vendor's problem" with a thin wrapper in between; support staff need a documented escalation path and the vendor's status page.
  • First-line runbook must cover the most common ticket: "money left my account but the order is still pending." That is answered by status reconciliation, not by the return URL.

Scaling

  • Our side stays stateless: one outbound HTTPS call per checkout initiation, plus a return-route handler. Trivial horizontal scaling.
  • Throughput is bounded by the vendor's hosted checkout and API rate limits, not by our infrastructure. Confirm rate limits and timeout behaviour before a campaign or high-traffic launch.
  • Set aggressive-but-sane HTTP timeouts on createPayment and surface a retry path; a hung call must not hang the checkout page.

Failure modes

  • Return without payment — user navigates to the return URL directly or edits query params; mitigated only by server-side status checks.
  • Replayed return URL — repeated hits must be idempotent against order state.
  • Abandoned checkout — user closes the tab; the order stays pending forever unless a webhook or sweeper job resolves it.
  • Unknown state on timeout — createPayment times out after the vendor created a payment; without idempotency keys this can double-charge on retry.
  • Vendor outage — checkout initiation fails; needs a graceful error state, not a 500, and a fallback plan if P2Flux becomes a single point of conversion failure.
  • Misconfigured return_url — a typo or a localhost value in production strands paying users on a dead page; validate config at boot.
  • Open redirect — user-controlled return_url turns our domain into a phishing hop; enforce allowlisting.
  • SDK drift — an unreviewed composer update silently changes payment behaviour; guard with lockfile discipline and a smoke test.

Ramp-up

  • Engineering ramp-up is measured in hours: the API surface is two methods and a redirect.
  • TPM ramp-up is dominated by the non-code work — confirming the vendor's data-protection terms and PCI responsibility split, defining the authoritative payment-status source, and agreeing the "paid but pending" reconciliation policy with finance/support.
  • Recommend a short written decision record for this release: why the SDK floor moved, whether 0.12 remains supported, and which signal (webhook vs. status fetch vs. redirect) is authoritative for order fulfilment.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib