#bjrn-j_deferred-pi-ui
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1250364780644929557
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
Could you please share the Request ID req_xxx? https://support.stripe.com/questions/finding-the-id-for-an-api-request
There is no request id, because this is a problem with setting up the payment elemnts itself
Where do you see the error exactly, could you please share a screenshot?
When does this error occur exactly?
I cannot really say. It is when loading the Stripe Elements, but it is not failing on my side, the stack says it fails on your side. It happens on page load in my check out
Could you please share the code that creates the Elements?
const loadPaymentElements = () => {
const appearance = {
theme: "stripe",
};
elements = stripe.elements({ appearance, amount: totalAmount.value, currency: "sek", mode: "payment" });
const paymentElementOptions = {
layout: "tabs",
fields: {
billingDetails: {
address: {
country: "never",
postalCode: "never",
},
},
},
};
const paymentElement = elements.create("payment", paymentElementOptions);
paymentElement.on("ready", function (event) {
window.setTimeout(() => (cardPaymentElementLoaded.value = true), 500);
});
if (paymentElement) paymentElement.mount("#payment-element");
};
What does this do exactly?
window.setTimeout(() => (cardPaymentElementLoaded.value = true), 500);
it just changes from a skeleton view to the card elements when they are loaded
Nicer view while they are being loaded
bjrn-j_deferred-pi-ui
๐ taking over for my colleague. Let me catch up.
have you initiated Stripe correctly?
please delete the code you just pasted it has your livemode publishable key
ok let's proceed this way
would you mind sharing an accessible version of your site in test mode where we could try and replicate the issue?
let me check something
just so I understand, does this block anything and prevent the form loading, or is it just an error that appears in the console with no other impact?
It is preventing my elements to load
So right now there is no card payment on my site
This happened when I moved to deferred loading as suggested by your support to create a payment intent when submitting the form instead of doing it on pay load
hmm. Do you have a link to the exact page this happens so I can poke at it in my devtools?
seems to load ok for me
Even if you reload the page?
yep