Fix POS Paystack double modal and keep checkout in-app.

Pass access_code into the payment sheet, launch Paystack Inline only,
and hide Ladill chrome after Inline loads so register Card/MoMo shows
a single payment interface.
This commit is contained in:
isaacclad
2026-07-21 21:23:21 +00:00
parent 4dcc46e319
commit 5c23df9561
8 changed files with 147 additions and 105 deletions
@@ -235,6 +235,7 @@ class RegisterController extends Controller
$result = $this->sales->initiatePayCheckout($sale, $merchant);
$checkoutUrl = $result['checkout_url'] ?? null;
$accessCode = $result['access_code'] ?? null;
$this->customerDisplays->pushPayment($location, $sale->fresh(['lines']), [
'checkout_url' => $checkoutUrl,
@@ -246,6 +247,7 @@ class RegisterController extends Controller
if ($request->expectsJson() || $request->ajax()) {
return response()->json([
'checkout_url' => $checkoutUrl,
'access_code' => $accessCode,
'sale_id' => $sale->id,
]);
}
@@ -253,6 +255,7 @@ class RegisterController extends Controller
return redirect()
->route('pos.sales.show', $sale)
->with('checkout_url', $checkoutUrl)
->with('access_code', $accessCode)
->with('success', 'Payment sheet ready — customer screen shows the QR; till sheet is for the operator.');
} catch (RuntimeException $e) {
return back()->withInput()->with('error', $e->getMessage());
@@ -230,6 +230,7 @@ class TicketController extends Controller
if ($request->expectsJson() || $request->ajax()) {
return response()->json([
'checkout_url' => $result['checkout_url'],
'access_code' => $result['access_code'] ?? '',
'sale_id' => $sale->id,
]);
}
@@ -237,6 +238,7 @@ class TicketController extends Controller
return redirect()
->route('pos.tickets.show', $sale)
->with('checkout_url', $result['checkout_url'])
->with('access_code', $result['access_code'] ?? '')
->with('success', 'Payment sheet ready — hand the device to the customer for card or MoMo.');
} catch (RuntimeException $e) {
return back()->with('error', $e->getMessage());