#Erik Ekberg-paymentelement-error

1 messages · Page 1 of 1 (latest)

devout stump
#

hello, it wasn't clear, are you losing functionality on PaymentElement too?

#

also checking in parallel one sec

fresh prairie
#

@devout stump yes, as shown in the GIF the entire Payment Element is erroring out when we reopen it.

devout stump
#

mind sharing what you're doing in code, so I can try to replicate it?

like what are you doing with the PaymentElement when you click that first button

fresh prairie
#

This is a rough example of what we are doing in our code.

import React, { useState } from 'react';
import { PaymentElement } from '@stripe/react-stripe-js';

// ! Container wraps component in <Elements> with valid
// ! Stripe Promise and Setup Intent Client Secret
export function OurGoodDogForm() {
  const [showPaymentElement, setShowPaymentElement] = useState(false);

  return (
    <form>
      <button
        type="button"
        onClick={() => {
          setShowPaymentElement(!showPaymentElement);
        }}
      >
        Toggle Stripe Element
      </button>
      {showPaymentElement && <PaymentElement />}
      <button type="submit">Submit</button>
    </form>
  );
}

#

like what are you doing with the PaymentElement when you click that first button

After the page loads, we first click on the "Add new payment method button" in the GIF, which toggles the "show" state for the Stripe Payment Element. Then, we click on the "US Bank Account" button inside the Stripe Payment Element. Then, we "hide" the Stripe Payment Element. Then, we "show" the Stripe Payment Element again and it errors out as seen.

This only seems to happen when clicking on the "US Bank Account" button in the Stripe Payment Element, not the "Card" button.

#

@devout stump

devout stump
#

thanks, exactly what I was looking for

#

let me try to repro, might take a bit since I don't have a ready-to-go React integration locally

devout stump
#

ok finally in a working state, now to actually test the thing you were doing by clicking on ACH button

devout stump
#

ok I can repro, I'll file with the Stripe.js team

fresh prairie
#

Is there some way for us to handle this error in the meantime?

devout stump
#

I don't think there is, the error seems to be within Stripe.js code.