Fix Paystack sheet: stop iframe embeds that Paystack blocks.
Deploy Ladill Link / deploy (push) Successful in 59s

Paystack checkout.paystack.com returns X-Frame-Options: SAMEORIGIN, so the shared sheet opened empty. Keep mobile sheet/desktop modal chrome, launch checkout in a named window with a Continue CTA fallback, and escape payment-return via window.opener or top.
This commit is contained in:
isaacclad
2026-07-21 17:35:43 +00:00
parent 93548afdb4
commit ecfb98940e
3 changed files with 201 additions and 5 deletions
@@ -0,0 +1,42 @@
<?php
namespace Tests\Feature;
use Tests\TestCase;
class ResponsivePaystackSheetTest extends TestCase
{
public function test_checkout_sheet_partial_has_mobile_sheet_and_desktop_modal(): void
{
$html = view('partials.paystack-sheet', [
'audience' => 'buyer',
])->render();
$this->assertStringContainsString('role="dialog"', $html);
$this->assertStringContainsString('aria-modal="true"', $html);
$this->assertStringContainsString('md:items-center', $html);
$this->assertStringContainsString('rounded-t-2xl', $html);
$this->assertStringContainsString('md:h-[min(720px,85vh)]', $html);
$this->assertStringContainsString('Complete your payment', $html);
$this->assertStringContainsString('safe-area-inset-bottom', $html);
$this->assertStringContainsString('LadillPayCheckout', $html);
$this->assertStringContainsString('Continue to Paystack', $html);
$this->assertStringContainsString('ladill_pay_checkout', $html);
$this->assertStringNotContainsString('Paystack checkout', $html);
}
public function test_payment_return_escapes_popup_and_iframe_to_opener_or_top(): void
{
$html = view('public.payment-return', [
'redirect' => 'https://example.test/paid',
])->render();
$this->assertStringContainsString('Confirming your payment', $html);
$this->assertStringContainsString('window.opener', $html);
$this->assertStringContainsString('window.top.location.replace', $html);
$this->assertTrue(
str_contains($html, 'https://example.test/paid')
|| str_contains($html, 'https:\/\/example.test\/paid')
);
}
}