#EzequielCalcanat - Payment Element data
1 messages ยท Page 1 of 1 (latest)
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?
No, and that is by design. If you handle those raw numbers directly you need to conform to much higher compliance standards. You can read about it here. https://stripe.com/guides/pci-compliance
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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?
Hello ๐
Taking over here
Give me a moment to catch up, thanks ๐
thanks
Thanks for your patience
So if I understand it correctly, you're having trouble associating payment method collected from PaymentElement to a PaymentIntent?
If you've integrated PaymentElement correctly, it should create a payment method and confirm the PaymentIntent with it
We have an example here that you can take a look at
https://stripe.com/docs/payments/quickstart
ok ok, and we can use the paymentMethod ID to make new charges?
Depends. Will you be charging the customer off_session?
If so, you'd need to set the card up for future usage.
When we make a paymentIntent, automatically generates paymentMethod?
No, PaymentIntent and PaymentMethods are two separate things/concepts.
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?
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
ok ok ok, thats what I need to know, maybe I used the wrong terms haha
Thanks hanzo!
๐
NP! ๐ Happy to help