#matty_elements-csp
1 messages ¡ Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- matty_api, 17 hours ago, 19 messages
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1270414889923383480
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
looking!
Thank you!
Unfortunately, no... this appears to be happening only on local dev which is no open to the outside.
I figured this was a shot in the dark unfortunately.
No worries. Have you seen https://docs.stripe.com/security/guide?csp=csp-js#content-security-policy and confirmed you have the right CSP?
We wouldn't have anything that is blocking this... but this should help me track it down if there is an unknown. I appreciate the hlep.
sure thing. CSP errors can be quite painful with localhost
I'd recommend trying https://ngrok.com and see if that makes the error go away
Awesome. Thanks!
I have a completely different question about input validation. Should I open another thread?
Here is the question:
I am trying to determine if the user has entered anything into the payment field before setting up the intent. Is there a way to do this?
Here is the beginning of the JS code:
`// Create an instance of the card Element.
var card = elements.create('card', { style: styles, hidePostalCode: true });
// Add an instance of the card Element into the card-element <div>.
card.mount('#card-element');`
We have the change callback/event you can use, see https://docs.stripe.com/js/element/events/on_change?type=cardElement
I use that, but if someone doesn't put anything into the field, then it's never called.... I guess thinking about it, if the change is never called, they haven't done anything so it would be empty?
exactly
Well that's easy. Thanks again. Have a great day.