Fix ladl.link CORS for Mini payment assets and pay URL.
Deploy Ladill Mini / deploy (push) Successful in 44s
Deploy Ladill Mini / deploy (push) Successful in 44s
Allow cross-origin module loads of Mini build assets and use a same-origin pay path when HTML is proxied through ladl.link so fetch and Vite JS work.
This commit is contained in:
@@ -2,9 +2,13 @@
|
||||
$content = $qrCode->content();
|
||||
$businessName = $content['business_name'] ?? $qrCode->label;
|
||||
$currency = $content['currency'] ?? 'GHS';
|
||||
// Same-origin pay endpoint — ladl.link publicPath is cross-origin from
|
||||
// mini.ladill.com and has no CORS headers, so fetch() never reaches showSheet.
|
||||
$payUrl = url('/q/'.$qrCode->short_code.'/pay');
|
||||
// Public scans stay on ladl.link/{code} (HTML proxied to Mini). Prefer a
|
||||
// same-origin pay path so fetch() does not cross to mini.ladill.com.
|
||||
// Direct visits on mini.ladill.com keep the local /q/{code}/pay route.
|
||||
$isProxiedPublicScan = request()->headers->get('X-Ladill-Internal') === '1';
|
||||
$payUrl = $isProxiedPublicScan
|
||||
? '/'.$qrCode->short_code.'/pay'
|
||||
: url('/q/'.$qrCode->short_code.'/pay');
|
||||
$csrf = csrf_token();
|
||||
@endphp
|
||||
<!DOCTYPE html>
|
||||
|
||||
Reference in New Issue
Block a user