#bjrn-j_deferred-pi-ui

1 messages ยท Page 1 of 1 (latest)

cunning forgeBOT
#

๐Ÿ‘‹ 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.

spring jewel
#

Hi, let me help you with this.

nova harness
#

There is no request id, because this is a problem with setting up the payment elemnts itself

spring jewel
#

Where do you see the error exactly, could you please share a screenshot?

nova harness
#

This is from developer console

spring jewel
#

When does this error occur exactly?

nova harness
#

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

spring jewel
#

Could you please share the code that creates the Elements?

nova harness
#

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");
};

spring jewel
#

What does this do exactly?

window.setTimeout(() => (cardPaymentElementLoaded.value = true), 500);
cunning forgeBOT
nova harness
#

it just changes from a skeleton view to the card elements when they are loaded

#

Nicer view while they are being loaded

cunning forgeBOT
#

bjrn-j_deferred-pi-ui

mystic wave
#

๐Ÿ‘‹ 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?

nova harness
#

The problem is that it is only on live version

#

In dev it is working perfetly

mystic wave
#

let me check something

light birchBOT
rocky barn
#

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?

cunning forgeBOT
nova harness
#

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

rocky barn
#

hmm. Do you have a link to the exact page this happens so I can poke at it in my devtools?

nova harness
#

Not sure it works if you have nothing in cart but you can try

rocky barn
#

seems to load ok for me

nova harness
#

Even if you reload the page?

rocky barn
#

yep