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)

Most upvoted comments

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.

@ashtonlclark I can’t really speak to the communication issue with your e-commerce platform, but given that failure combined with the error being discussed here it sounds like the customer has an unreliable connection. This happens occasionally and should be expected (transient connection issues).

It sounds like your integration is relying on a client-side signal to process orders, which should not be your only method for tracking. We strongly recommend listening to webhooks (in particular payment_intent.succeeded) to monitor for order/payment success. This provides notification of payment success directly from Stripe to your backend that work even if your customer has a flaky connection, and allows you to manage order fulfillment. If necessary for reconciliation, you can include metadata on your payment intents to track which payment goes with which order in your system. https://docs.stripe.com/metadata/use-cases#order-or-cart-id

@brendanm-stripe thanks for your response. You are exactly right. We are enhancing our Stipe integration to leverage thepayment_intent.succeeded webhook 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 pure variant). Similar to confirmPayment, you can access error in the elements.submit() result.