#vcomposieux_code

1 messages ¡ Page 1 of 1 (latest)

chrome lionBOT
#

👋 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/1224821652098125864

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

tranquil mistBOT
chrome lionBOT
brave rivet
#

It is quite odd for it to not resolve without any specific errors/response.

What are you seeing in your network console?

tight isle
#

Unfortunately I don't have any issue in the console

#

On the network tab, I see some requests that goes to r.stripe.com/b which seems to be a tracing service

brave rivet
#

confirmPayment should call the confirm PaymentIntent API /v1/payment_intents/:id/confirm endpoint

Is that not being called?

tight isle
#

No, I don't see this call in the network console

brave rivet
#

That means confirmPayment isn't really being called

#

How exactly is that function being called? is it part of a form submit handler?
I'd recommend adding some console logs in your code to see whats going on

tight isle
#

Here is the Javascript code:

const stripe = Stripe("pk_live_...");

document.querySelector("#payment-form")
        .addEventListener("submit", handleSubmit);

const elements = stripe.elements({ clientSecret: "pi_..." });
const paymentElement = elements.create("payment");

paymentElement.mount("#payment-element");

async function handleSubmit(e) {
    e.preventDefault();

    const { error } = await stripe.confirmPayment({
        elements,
        confirmParams: {
            return_url: "https://www.goodmecano.com/billing/return?appointment_id=4816088",
        },
    });

    if (error.type === "card_error" || error.type === "validation_error") {
        showMessage(error.message);
    } else {
        showMessage("Une erreur est survenue lors de votre paiement.");
    }
}
}
#

That's strange because it worked in production and this issue occurs since 4 days with apparently no reason

#

@brave rivet Sorry for de disturb, I just found that a JS code has been added and it make the Promise call fail

#

When I remove this part of JS it works properly, so there is not a Stripe issue