Fix Paystack Fullscreen permission policy for Inline iframes.
Deploy Ladill Mini / deploy (push) Successful in 44s

Pre-set allow=fullscreen on Paystack iframes before navigation (createElement
hook + MutationObserver on allow/src/id), re-apply if Paystack overwrites
allow, and send Permissions-Policy HTTP headers so checkout.paystack.com can
use fullscreen inside the in-app sheet.
This commit is contained in:
isaacclad
2026-07-21 22:17:14 +00:00
parent 4291d95518
commit bd8764523c
5 changed files with 166 additions and 22 deletions
@@ -0,0 +1,31 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Delegate payment-related browser features to Paystack Inline iframes.
*
* Cross-origin checkout.paystack.com needs the top-level document to allow
* fullscreen (and payment/clipboard) via Permissions-Policy. Meta tags are
* not reliably honored this must be an HTTP response header.
*/
class PaystackPermissionsPolicy
{
public const HEADER_VALUE = 'payment=*, fullscreen=*, clipboard-read=*, clipboard-write=*, publickey-credentials-get=*';
public function handle(Request $request, Closure $next): Response
{
/** @var Response $response */
$response = $next($request);
if (! $response->headers->has('Permissions-Policy')) {
$response->headers->set('Permissions-Policy', self::HEADER_VALUE);
}
return $response;
}
}