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.
p2flux/sdk-php 0.13 if you want return_url / checkout_url support:
composer require p2flux/laravel
composer update p2flux/sdk-php
.env.config/p2flux.php if present,P2Flux facade,p2flux/sdk-php createPayment() / createPaymentLink() signatures.return_url, then redirect the buyer to the returned checkout_url.use P2Flux;
$payment = P2Flux::createPayment([
'amount' => 4999,
'currency' => 'USD',
'return_url' => route('checkout.return'),
// other required payment fields per README/SDK
]);
return redirect()->away($payment['checkout_url']);
For payment links, pass return_url similarly and redirect to the returned checkout_url:
$link = P2Flux::createPaymentLink([
'amount' => 4999,
'currency' => 'USD',
'return_url' => route('checkout.return'),
]);
return redirect()->away($link['checkout_url']);
return_url, e.g. route('checkout.return'), so the hosted checkout can return buyers to a stable page.checkout_url and your local payment identifier before redirecting. This makes debugging and reconciliation easier.createPayment() for one-off checkout flows and createPaymentLink() when you need a reusable hosted payment link..env / config, never in controllers or committed code.return_url only controls where the buyer lands after hosted checkout. It is not proof that payment succeeded.checkout_url must be used as the redirect target after createPayment() / createPaymentLink(). Guard against it being missing if the SDK version or response shape is unexpected.p2flux/sdk-php 0.13 and passes return_url / checkout_url through the facade. Existing calls should continue working.return_url may not be available or may not behave as expected. Run composer show p2flux/sdk-php to confirm the installed version.localhost URLs outside local development.return_url query parameters. Prefer a signed route or an opaque payment/order reference.checkout_url during integration/debugging, but redact credentials and sensitive buyer data.How can I help you explore Laravel packages today?