Embed POS checkouts in a modal/sheet using the seller email.
Deploy Ladill POS / deploy (push) Successful in 40s
Deploy Ladill POS / deploy (push) Successful in 40s
Card/MoMo always initializes with the merchant email, and Paystack/Flutterwave/Hubtel open in-page (desktop modal, mobile bottomsheet) instead of a full redirect. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -176,7 +176,17 @@ class RegisterController extends Controller
|
||||
|
||||
$result = $this->sales->initiatePayCheckout($sale, $merchant);
|
||||
|
||||
return redirect()->away($result['checkout_url']);
|
||||
if ($request->expectsJson() || $request->ajax()) {
|
||||
return response()->json([
|
||||
'checkout_url' => $result['checkout_url'],
|
||||
'sale_id' => $sale->id,
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->route('pos.sales.show', $sale)
|
||||
->with('checkout_url', $result['checkout_url'])
|
||||
->with('success', 'Complete the payment to finish this sale.');
|
||||
} catch (RuntimeException $e) {
|
||||
return back()->withInput()->with('error', $e->getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user