Restore Paystack Inline in-page sheet/modal; stop separate-browser checkout.
Deploy Ladill Mini / deploy (push) Successful in 1m4s
Deploy Ladill Mini / deploy (push) Successful in 1m4s
Pass access_code through pay responses and launch PaystackPop from the shared sheet instead of window.open.
This commit is contained in:
@@ -44,6 +44,10 @@ class PaymentController extends Controller
|
||||
if ($request->expectsJson()) {
|
||||
return response()->json([
|
||||
'checkout_url' => $result['checkout_url'],
|
||||
'access_code' => $result['access_code'] ?? null,
|
||||
'public_key' => $result['public_key'] ?? null,
|
||||
'callback_url' => $result['callback_url'] ?? null,
|
||||
'reference' => $result['reference'] ?? null,
|
||||
'provider' => $result['provider'] ?? null,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class MiniPaymentService
|
||||
|
||||
/**
|
||||
* @param array{amount: float, customer_phone?: string} $data
|
||||
* @return array{payment: MiniPayment, checkout_url: string, provider: string}
|
||||
* @return array{payment: MiniPayment, checkout_url: string, access_code: ?string, public_key: ?string, callback_url: string, reference: ?string, provider: string}
|
||||
*/
|
||||
public function initiate(QrCode $qrCode, array $data): array
|
||||
{
|
||||
@@ -101,6 +101,10 @@ class MiniPaymentService
|
||||
return [
|
||||
'payment' => $payment->fresh(),
|
||||
'checkout_url' => $checkoutUrl,
|
||||
'access_code' => isset($payOrder['access_code']) ? (string) $payOrder['access_code'] : null,
|
||||
'public_key' => isset($payOrder['public_key']) ? (string) $payOrder['public_key'] : null,
|
||||
'callback_url' => url('/q/'.$qrCode->short_code.'/pay/callback'),
|
||||
'reference' => isset($payOrder['reference']) ? (string) $payOrder['reference'] : null,
|
||||
'provider' => (string) ($payOrder['provider'] ?? ''),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user