#ricky-element-react

1 messages · Page 1 of 1 (latest)

gloomy pewter
#

@plain flume happy to help, what's blocking you?

plain flume
#

const paymentElement = elements.getElement(PaymentElement);

if (paymentElement) {
  const { paymentMethod: payment, error } =
    await stripe.createPaymentMethod({
      type: 'card',
      card: PaymentElement,
    });
gloomy pewter
#

you seem to be mixing up ~everything

#

Payment Element is a completely different product/UI

plain flume
#

Thank you @gloomy pewter

From what I read I need to import this
PaymentElement
but its not working for me.

Am I going about this correctly or should I keep CardElement

gloomy pewter
#

are you trying to use Elements? Do something else?

#

Step 1 is understand what the end goal is

plain flume
#

The only goal is to separate the checkout into different fields

gloomy pewter
#

why?

plain flume
#

We are hitting auto complete issues having the one long input and would like to separate into different input fields

gloomy pewter
#

I think that's a mistake honestly.

#

My advice is to purely use the PaymentElement, it does everything for you

plain flume
#

Because the ZIP only appears once a card # is detected, auto complete won't fill in the ZIP

gloomy pewter
#

it does split the fields already

#

So does the PaymentElement work for you?

plain flume
#

That is what I would like to use and move away from CardElement

#

Just having trouble swapping it out to start using PaymentElement

gloomy pewter
#

I understand but you're really trying to go too fast, change one line of code, that won't work really

#

so I'm trying to understand your end goal, because if you are re-designing this, maybe you'd be better off moving to PaymentElement entirely

plain flume
#

I'll take it slower, good note - Yes we want to ditch CardElement and go to PE

gloomy pewter
#

okay

#

so replacing with PE will require changes to your integration since you don't "Create a PaymentMethod" anymore, you confirm a PaymentIntent or SetupIntent

#

so it won't be a one line change

#

Separately, with that out of the way: we do support "split fields" on the card element

#

you basically have to create a card number, expiry and cvc element separately

#

trying to find docs

plain flume
#

Thank you, I can give that a go - I didn't know the CardElement supported that

gloomy pewter
#

still trying to find a concrete example

#

it's not react but it should help

plain flume
#

The github is a 404 but looking at the docs link

gloomy pewter
#

huh soory I thought that was public 😕

#

wow we don't make it easy to find lol

plain flume
#

thank you I'll check this out!