#chris-paymentelement-csp

1 messages · Page 1 of 1 (latest)

harsh wharfBOT
still lion
#

@twilit warren can you give me a bit more context? Are you the developer? How was this integrated? Is there a place I can reproduce or some more info you can share?

twilit warren
#

I am the developer

go here: https://test.stubs.net/

In the search bar, search for "tech expo"
Select general addmission and go to checkout

#

I'm using the payment element

still lion
#

can you share the code of your you initialize Elements too?

#

chris-paymentelement-csp

twilit warren
#

this.elements = this.stripe.elements();

            const paymentOptions = {
                paymentMethodOrder: ['card', 'apple_pay', 'google_pay', 'cashapp', 'link', 'klarna'],

                fields: {
                    billingDetails: this.billingDefaults
                }
            };

            this.paymentElement = this.elements.create("payment", paymentOptions);
            this.paymentElement.mount("#payment-element");
#

Pretty basic...

still lion
#

where do you pass the image though?

still lion
#

hum

twilit warren
#

If you look in the console after you submit payment you'll see the CSP error

still lion
#

when does the CSP error appear?

twilit warren
#

See above.... If you click review and use a test credit card on the payment screen you'll see it

still lion
#

ah okay it's really just inside our own test page

twilit warren
#

the site I sent you is a test site

still lion
#

then it's totally fine, just ignore

twilit warren
#

got nuts

#

I mean I get it, but why don't your fix your CSP policy

#

if you add "data:" it'll stop erroring

still lion
#

Sure and I'll flag it and hopefully someone can fix it, it's just not a big deal

twilit warren
#

agreed, it's a one line change in your CSP, just wanted to point it out so you guys could fix it

still lion
#

yep I'll report it internally, hopefully someone can fix!