stripe-js: [BUG]: Please check your internet connection
What happened?
Hey everybody,
We have some integrations with Stripe for a very long time (old Checkout, old Card Elements) and we introduced “Payment Elements” recently into our platform. During the past 6 months we’ve been receiving complaints from our customers saying “they can’t pay”. After months of investigation and adding logs to most variety of places we finally found stripe sdk is returning error below:
{"message":"We are experiencing issues connecting to our payments provider. Please check your internet connection."}
I’ve been tracking this during past months and i can’t find a single evidence that our customers were having internet issues…
- we can see they going back and forward, trying to load the payment form multiple times.
- all requests are fine, not a single one failing
- all react components being loaded fine, no delays
- customer interactions with buttons / sections / etc … all fine, no delays.
- some customers were able to try many times and it suddenly loads and he is able to pay.
- we have print-screens from customers using wifi, mobile 4G, mobile 5G… basically every kind of network
Tracking the issue, seems the most users have issues during the Payment Elements load. See our code below. BUT i need to mention that i’ve found customers having the same issue during the payment form submit.
Payment Elements Form load.
this._elems.link = StripeElements.create('linkAuthentication', { defaultValues: { email: email, phone: phone } });
this._elems.payment = StripeElements.create('payment', {
layout: {
type: 'accordion',
defaultCollapsed: false,
radios: true,
spacedAccordionItems: false
},
fields: {
billingDetails: {
address: {
line1: addressFieldsConfig,
line2: addressFieldsConfig,
city: addressFieldsConfig,
country: addressFieldsConfig,
postalCode: addressFieldsConfig,
},
},
},
defaultValues: {
billingDetails: {
phone: phone,
email: email,
address: {
country: this.options.country,
},
},
},
wallets: {
applePay: 'never',
googlePay: 'never',
},
});
// callbacks
this._elems.link.on('change', this.handleLinkElementChange.bind(this));
this._elems.payment.on('change', this.handlePaymentElementChange.bind(this));
this._elems.payment.on('loaderror', this.onErrorLoadingElements.bind(this));
this._elems.link.on('loaderror', this.onErrorLoadingElements.bind(this));
this._elems.payment.on('ready', this.onFormLoaded.bind(this));
this._elems.link.on('ready', this.onFormLoaded.bind(this));
// render
this._elems.payment.mount(`#${this.$element.id}`);
this._elems.link.mount(`#${this.$linkElement.id}`);
Note1: loaderror listener is not catching this error. The error is being throw globally.
Note2: worth to mention that we have Card Elements and Checkout from Stripe running in the same platform, same code… and we can’t see the same errors being throw there in the past 1 year. So seems restricted to Payment Elements only ?
Note3: it doesnt affect a large number of customers, so for the past 3 days we have 8 errors (thousand of payments).
Note4: unfortunately i was only able to see the right error recently thats why i only have occurrences from Windows 10+ and iOS. But i m pretty sure the error was hidden in an unparseable error message before… so i wouldn’t say it only occurs in those devices.
Dev Stacks:
"react": "18.2.0"
We are injecting https://js.stripe.com/v3/ inline during platform load.
We were never able to reproduce this using any of our devices.
Also, reaching out for “Stripe support” didnt help much… they said we were unable to detect any ongoing issues on our site … thats not clear enough. Would really appreciate a deep looking into this issue, please.
Regards.
Environment
Chrome on WIndows 10+, Safari on iOS 17, 18
Reproduction
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (6 by maintainers)
Just because no one left a comment on the issue for 3 weeks, it doesn’t mean the issue is resolved, the bot forces humans to come back and say up, up, up, every time, quite hostile setup.
We have also encountered this situation. If there is a solution, please let me know.
@brendanm-stripe thanks for your response. You are exactly right. We are enhancing our Stipe integration to leverage the
payment_intent.succeededwebhook for card payments that way if our customers experience internet connectivity issues we can still record the payment properly on our end.In that case yes, using this module would help because you have programmatic control over the loading (even more so using the
purevariant). Similar toconfirmPayment, you can accesserrorin theelements.submit()result.