Fix Mini Paystack checkout by redirecting instead of iframe embed.
Deploy Ladill Mini / deploy (push) Successful in 29s
Deploy Ladill Mini / deploy (push) Successful in 29s
Paystack blocks checkout in third-party iframes, so payment QRs now navigate to the hosted checkout URL and prefer authorization_url from the initialize response. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -71,9 +71,18 @@ class MiniPaymentService
|
||||
],
|
||||
]);
|
||||
|
||||
$checkoutUrl = $paystackData['authorization_url']
|
||||
?? (isset($paystackData['access_code']) && $paystackData['access_code'] !== ''
|
||||
? 'https://checkout.paystack.com/'.$paystackData['access_code']
|
||||
: '');
|
||||
|
||||
if ($checkoutUrl === '') {
|
||||
throw new RuntimeException('Could not start Paystack checkout. Please try again.');
|
||||
}
|
||||
|
||||
return [
|
||||
'payment' => $payment,
|
||||
'checkout_url' => 'https://checkout.paystack.com/'.($paystackData['access_code'] ?? ''),
|
||||
'checkout_url' => $checkoutUrl,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user