#EzequielCalcanat - Payment Element data

1 messages ยท Page 1 of 1 (latest)

quartz sand
#

Hello, what PaymentMethod info you you looking for here?

sudden galleon
#

We have this element on our website, and we need to register customers and paymentMethods, I found that function to add the paymentMethod but we need the card number, the exp_month, exp_year, cvc and the type from this element.
Is it possible to get that data from there?

quartz sand
#

It is possible to handle the raw card number yourself but it is typically discouraged and you would have to make your own custom UI for it.

#

Can you tell me more about why you need those numbers? You can get the last 4 digits of the card number and the expiration month/year from the PaymentMethod you create. Would that be helpful for what you are looking to do? https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-exp_month

sudden galleon
#

its because when we make a paymentIntent we need to associate the paymentMethod to that paymentIntent adding the id there (payment_method)

#

its adding automatically?

ocean tundra
#

Hello ๐Ÿ‘‹
Taking over here
Give me a moment to catch up, thanks ๐Ÿ™‚

sudden galleon
#

thanks

ocean tundra
#

Thanks for your patience

#

So if I understand it correctly, you're having trouble associating payment method collected from PaymentElement to a PaymentIntent?

sudden galleon
#

ok ok, and we can use the paymentMethod ID to make new charges?

ocean tundra
#

Depends. Will you be charging the customer off_session?
If so, you'd need to set the card up for future usage.

sudden galleon
#

When we make a paymentIntent, automatically generates paymentMethod?

ocean tundra
#

No, PaymentIntent and PaymentMethods are two separate things/concepts.

sudden galleon
#

yeah

#

but, well

#

we are using the test cards, (424242424, etc)

#

but when we make a payment correctly and I check the payment data JSON, there is a field called payment_method and have an ID from a paymentMethod, if a user uses a new card, will the paymentMethod be created and added here?

ocean tundra
#

But that's not happening when you create a PaymentIntent.
It is when you confirm a PaymentIntent.

#

Yes, if a new card is entered, a PaymentMethod will be created and used to confirm a PaymentIntent

sudden galleon
#

ok ok ok, thats what I need to know, maybe I used the wrong terms haha

#

Thanks hanzo!

#

๐Ÿ‘

ocean tundra
#

NP! ๐Ÿ™‚ Happy to help