Keep Mini QR Paystack checkout fully in-app.
Stop form POSTs from 307ing to ladl.link or redirecting away to checkout.paystack.com, open Paystack Inline with access_code, and use the single-chrome sheet so payment stays on the Mini page.
This commit is contained in:
@@ -19,13 +19,20 @@ class RedirectLegacyQrToLadillLink
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
// Same-origin AJAX from Mini-hosted payment pages (e.g. mini.ladill.com)
|
||||
// must hit local /q/{code}/pay — redirecting to ladl.link breaks CORS and
|
||||
// the checkout sheet never opens.
|
||||
// Same-origin pay from Mini-hosted pages (e.g. mini.ladill.com) must hit
|
||||
// local /q/{code}/pay — redirecting to ladl.link breaks CORS / form POSTs
|
||||
// and used to dump the browser onto checkout.paystack.com.
|
||||
if ($request->ajax() || $request->expectsJson() || $request->wantsJson()) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
// Form POST (and any method) to the Mini pay endpoint stays on Mini so
|
||||
// PaymentController can return JSON or flash payload for in-page Inline.
|
||||
$path = ltrim($request->path(), '/');
|
||||
if (preg_match('#^q/[^/]+/pay(?:/callback)?$#i', $path) === 1) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
return LadillLink::legacyRedirect($request);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user