#red_api
1 messages ¡ Page 1 of 1 (latest)
đ 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/1432359231302140020
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, can you say more please? When did this start happening? At what stage does this happen? What integration documentation are you following?
paymentElement.on('change', paymentChanged);
paymentElement.on('ready', paymentElementReady);
I hide the Stripe form first and display a loading page
when paymentElementReady(event) fires, I make it visible
but then it proceeds to display on the page
as in proceeds to load
Can you share your URL where I can reproduce this?
sure - it's part of booking an event for our Event Venue
select a Sunday, enter dummy info
you should see the "made visible" alert which occurs in the ready method
I put a bunch of error debug in the console too
" paymentElementReady with event: xxx"
I select the date, then I see the "made visible" alert, and then the page loads. I'm unclear what you expect vs. what is exactly happening. Can you share more details please? Or record a screenshare?
console.error("in paymentElementReady with event: " + JSON.stringify(event));
console.error("in paymentElementReady with event: " + JSON.stringify(event));
console.error("in paymentElementReady with event: " + JSON.stringify(event));
console.error("in paymentElementReady with event: " + JSON.stringify(event));
console.error("in paymentElementReady with event: " + JSON.stringify(event));
showStripeForm();
}
function showStripeForm() {
var loadingDiv = document.getElementById('loading');
loadingDiv.style.display = "none";
var topDiv = document.getElementById('main');
topDiv.style.display = "block";
console.error("made topDiv visible");
console.error("STRIPE FORM MADE VISIBLE");
alert("made visibile");
console.error("alert fired ");
}
the alert happens AFTER the ready event fires
so the payment elements should all be loaded by then?
I want to hide the form until everything is laid out
Is not the form hidden until after the "made visible" alert?
yes
but then it should all be "ready", not starting to load
The overall strategy is:
Use CSS to initially hide the element in a way that reserves its space on the page.
Use a JavaScript event listener that fires after the DOM is ready to remove the hiding class.```
Can you log less event please? While trying to debug, there are too many events and it looks like the event is fired accordingly when it's ready, and then the UI appears