#akakmmm_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/1489238455736074302
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- akakmmm_api, 2 days ago, 98 messages
hi! we only speak English here on Discord. if you need support in another language, try https://support.stripe.com/?contact=true
This loading is what we made, used to wait for the loading of the link button
Under normal circumstances, this button should be loaded. Could you please tell me under what circumstances it might not be loaded
Is this the Express Checkout Element?
I can provide you with the website link. Could you ask your front-end colleagues to take a look
yes feel free to send a link where I can reproduce the issue
Log in with a Google account, and then proceed to the shopping cart
can you share a test email/password?
This is a real website, and there is no test account
but can you create an account and share the email/password here?
I can't create account to test your website for privacy reasons.
Can you log in directly using your Google account
no sorry
Got it. I also see the element loading:
Yes, it's because we can't load the link that we keep getting this prompt
and can you share the code you are using for the Express Checkout Element?
thanks, looking into this
Hello, I'm taking over for soma who had to step away. Please give me a few minutes to catch up 🙂
At first glance, I don't see anything wrong with the code you shared. Where is the loading logic? Is there a chance the code to mount the Express Checkout Element is not being executed?
你可以去到那个网站吗
Sorry, we can only provide support in English on Discord. Is that still okay?
Yes, I was able to reproduce the issue. I'm wondering if the code you shared that mounts the Express Checkout Element never executes. What does your code for the loading spinner look like?
Our front-end colleagues are currently offline. Could you view it through the page instead?
I'm sorry but there is a lot of Javascript code and I'm not sure where to look. You'll need to point me to where the loading logic you built is.
You can also add console.log lines before and after expressCheckoutElement.mount('#express-checkout-element'); in the code you shared to see if that is actually executing. If not, the problem is likely with your loading logic.
Are there any other directions for investigation?
Tomorrow, let's have the front-end team investigate this issue in this direction. We are using the same codebase. It works fine for other websites, but not for this particular one - it fails to load.
This thread will close after some time of inactivity. When your team is able to test, I'd recommend verifying that your code to mount the Express Checkout Element actually runs. You can even temporarily remove your loading logic to be sure of this. If it works, this isn't a Stripe issue so you'll need to debug the loading logic to see why it's not properly calling the payinsiderStripe function. If there's still an issue without the loading logic, such as the Express Checkout Element rendering or handling events incorrectly, feel free to reach out again and we will investigate 🙂
That code is for initializing Elements, mounting the Express Checkout Element, and defining it's handlers which all looks normal. But I don't see logic for your loading spinner.
if (event.data.Stripe_link) {
await loadScript('https://js.stripe.com/clover/stripe.js');
Stripe_link = event.data.Stripe_link
}
function loadScript(url) {
return new Promise((resolve, reject) => {
// 检查是否已加载
if (document.querySelector(script[src="${url}"])) {
resolve();
return;
}
const script = document.createElement('script');
script.src = url;
script.type = 'text/javascript';
// 成功加载
script.onload = () => {
resolve(script);
};
// 加载失败
script.onerror = () => {
reject(new Error(`Failed to load script: ${url}`));
};
document.head.appendChild(script);
});
}
Hi there
Taking over as Jazz needs to step away soon
I looked at the website you shared and I see following:
Are you currently updating your site?
Same thing on that link
You may need to work with your front end folks to dig into your own code.
So far, this doesn't seem like a Stripe.js issue but more so related to how you're integrating it.
One thing I'd recommend is to load Stripe.js on page load rather than waiting on some event to load Stripe.js script. This can create issues with Elements life cycle
你重新用这个网站试试
Sorry I can't read that
Try using this website again, please.
Yeah I see the spinner now but I don't see any error/logs from Stripe.js suggesting it being a Stripe issue.
As I mentioned earlier, try loading Stripe.js on page/website load rather than it loading on an event trigger
Since the loading of the link is triggered only under certain conditions, I would like to ask why we use the same set of code, while other websites don't? Could it be because of the problem with the website?
Maybe but I can't say for certain because right now there are no errors/logs
First step here would be to narrow down the scope of the investigation and see if that makes a difference. The fastest way to narrow down would be to remove the loading spinner and event based Stripe.js loading to see if your code loads the Express Checkout Element or if it throws any errors in an attempt to do that
Could other front-end colleagues help take a look at this issue?
I mean since this is your site and your code, you'd need to work with your team to investigate further and provide more details on why you think this is an issue with Stripe
I'm happy to help dig further but you need to try a few things first so that we can eliminate potential causes
Since this website belongs to our merchants, we have two merchants using our link with the same code. It works on Merchant A but not on Merchant B. So we would like to check if there is any conflict with Stripe.
Do you have the two merchant account IDs you're testing with?
acct_xx
I can't see this. Maybe it's not related to the ID? I was still able to wake up normally yesterday.
sorry not sure what you mean by that
Yesterday, I could still access the link using the same ID, but today it doesn't work anymore.
It's possible that the account turned off the supported payment mehods in their payment method settings
\OK, thank you for your support. We'll try the default import of js first tomorrow.
Taking a step back since this thread has gone on for a while without any fruitful investigation:
There could be various reasons behind why Express Checkout Element is not loading on your site for this merchant including
- Integration of Stripe.js is flawed/incorrect
- Merchant account has turned off supported payment methods in their settings
- Your code is somewhat different for both merchants
- Something else
There's no simple way to figure out which one is it without trying out a few things on your end. In order to do that, you need to work with your frontend team to investigate and eliminate potential causes.
My team on discord can help you think and work through integration issues once you have enough clarity on what's going wrong.