Easier PCI DSS compliance for payment pages (#4273)

* Assign names to compressed scripts

* Make PCI-relevant pages detectable

* Make payment summary markup more consistant to easy work in tracking plugin

* Add docs note
This commit is contained in:
Raphael Michel
2024-07-31 13:11:38 +02:00
committed by GitHub
parent 78cfbd6460
commit 13720e731e
12 changed files with 68 additions and 20 deletions

View File

@@ -26,6 +26,7 @@ from pretix.base.signals import (
register_payment_providers, register_sales_channel_types,
register_ticket_outputs,
)
from pretix.presale.signals import html_head
@receiver(register_ticket_outputs, dispatch_uid="output_dummy")
@@ -61,3 +62,11 @@ class FoobarSalesChannel(SalesChannelType):
@receiver(register_sales_channel_types, dispatch_uid="sc_dummy")
def register_sc(sender, **kwargs):
return [FoobarSalesChannel, FoobazSalesChannel]
@receiver(html_head, dispatch_uid="dummy_html_head")
def html_head_presale(sender, request=None, **kwargs):
if getattr(request, 'pci_dss_payment_page', False):
# No tracking scripts on PCI DSS relevant payment pages
return ""
return "<script>alert('BAD TRACKING SCRIPT')</script>"