I don’t believe I’ve seen documented anywhere all of the Square domains that need to be whitelisted when employing Content Security Policy (Content Security Policy (CSP) - HTTP | MDN) in conjunction with the Web Payments SDK. It’s easy enough to figure out by following the breadcrumbs of complaint that a browser will log to the console, but it would be nice if this information was documented and thus a bit more contractual, especially if it were to ever change. Thanks.
(This sample HTML snippet has been very handy and works well, although I think there is opportunity to make it a little less brittle. A topic for another post however…)
I highly doubt it’ll get any traction, but the lack of proper documentation around needed CSP and CORS etc policy for using the square payment web payment SDK is bothersome. Without some sort of documented set of FQDNs that the square payment API uses (in card mode, google pay, apple pay, etc) prevents consumer websites from implementing their own CSP and CORS policies to harden security.