About using PayPal within Stripe or Paddle Payments

Paying with PayPal might open a blank dialog window when using Stripe or Paddle payment gateways. To fix this, make sure to set Cross-Origin-Opener-Policy to "unsafe-none".

In Django project settings, set:

1
2
3
4
5
6
MIDDLEWARE = [
    # ...
    "django.middleware.security.SecurityMiddleware",
]

SECURE_CROSS_ORIGIN_OPENER_POLICY = "unsafe-none"

Or set it just to the views which open your payments for better security:

1
response.headers["Cross-Origin-Opener-Policy"] = "unsafe-none"

Tips and Tricks Programming Security Django 4.2