Restore Paystack Inline in-page sheet/modal; stop separate-browser checkout.
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:
isaacclad
2026-07-21 19:12:24 +00:00
parent 42257ab444
commit 86d2dcbf0b
9 changed files with 280 additions and 96 deletions
@@ -44,10 +44,12 @@ class MiniPaymentCheckoutTest extends TestCase
->assertSee('md:items-center', false)
->assertSee('Complete your payment', false)
->assertSee('data-ladill-pay-sheet', false)
->assertSee('resumeTransaction', false)
->assertSee('/q/'.$qr->short_code.'/pay', false)
->assertDontSee('https://ladl.link/'.$qr->short_code.'/pay', false)
->assertDontSee('MTN MoMo number', false)
->assertDontSee('Pay with MTN MoMo', false)
->assertDontSee('Continue to Paystack', false)
->assertDontSee('Paystack checkout', false);
}
@@ -81,6 +83,8 @@ class MiniPaymentCheckoutTest extends TestCase
'id' => 100,
'reference' => 'LP-TESTMINIAjax01',
'checkout_url' => 'https://checkout.paystack.com/mini-ajax',
'access_code' => 'mini-ajax',
'public_key' => 'pk_test_x',
'provider' => 'paystack',
'platform_fee_minor' => 15,
'merchant_amount_minor' => 985,
@@ -93,6 +97,7 @@ class MiniPaymentCheckoutTest extends TestCase
])
->assertOk()
->assertJsonPath('checkout_url', 'https://checkout.paystack.com/mini-ajax')
->assertJsonPath('access_code', 'mini-ajax')
->assertJsonPath('provider', 'paystack');
}
@@ -131,6 +136,8 @@ class MiniPaymentCheckoutTest extends TestCase
'id' => 99,
'reference' => 'LP-TESTMINIPAY001',
'checkout_url' => 'https://checkout.paystack.com/mini-test',
'access_code' => 'mini-test',
'public_key' => 'pk_test_x',
'provider' => 'paystack',
'platform_fee_minor' => 38,
'merchant_amount_minor' => 2462,
@@ -143,6 +150,7 @@ class MiniPaymentCheckoutTest extends TestCase
])
->assertOk()
->assertJsonPath('checkout_url', 'https://checkout.paystack.com/mini-test')
->assertJsonPath('access_code', 'mini-test')
->assertJsonPath('provider', 'paystack');
$this->assertDatabaseHas('mini_payments', [
@@ -18,7 +18,7 @@ class ResponsivePaystackSheetTest extends TestCase
$this->assertStringContainsString('data-ladill-pay-panel', $html);
$this->assertStringContainsString('data-ladill-pay-backdrop', $html);
$this->assertStringContainsString('data-ladill-pay-handle', $html);
$this->assertStringContainsString('data-ladill-pay-continue', $html);
$this->assertStringContainsString('data-ladill-pay-inline-status', $html);
$this->assertStringContainsString('md:items-center', $html);
$this->assertStringContainsString('rounded-t-2xl', $html);
$this->assertStringContainsString('md:rounded-2xl', $html);
@@ -26,9 +26,14 @@ class ResponsivePaystackSheetTest extends TestCase
$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('resumeTransaction', $html);
$this->assertStringContainsString('js.paystack.co/v2/inline.js', $html);
$this->assertStringContainsString('Starting secure checkout', $html);
$this->assertStringContainsString('prepare:', $html);
$this->assertStringContainsString('not in a separate browser', $html);
// Must not push Paystack to a separate browser as the primary path.
$this->assertStringNotContainsString('Continue to Paystack', $html);
$this->assertStringNotContainsString('window.open(', $html);
// Must not use Tailwind `hidden` + x-show on the panel (desktop stays invisible).
$this->assertStringNotContainsString('hidden w-full max-w-lg', $html);
$this->assertStringNotContainsString('Paystack checkout', $html);
}