#TzarBuba - CardElement
1 messages · Page 1 of 1 (latest)
oh your avatar is the vagabond from root
sorry
ok I will give you some context
using @stripe/react-stripe-js
CardElement
.confirmCardSetup(clientSecret, {
payment_method: {
card: elements.getElement(CardElement),
billing_details: {
name,
email,
},
},
})```
and from this part of the code I expect to update customer details: card and billing_details
in stripe dashboard billing_details looks correct
but for card I'm unable to see anything saved
hmm have to give you more context
apologise for my english, I will try my best to explain myself
the flow im currently doing is https://stripe.com/docs/payments/save-and-reuse
Do you have the ID of a card that you created that way? (card_123 or (pm_123)
coded the flow as in the documentation and these are my events:
customer.created
setup_intent.created
payment_method.attached
setup_intent.succeeded
payment_intent.created
charge.succeeded
payment_intent.succeeded
let me see, not sure where to check it
If you still have the data for any of those events, those will have an ID
The setup intent IDs could help
Otherwise your dashboard logs will have them https://dashboard.stripe.com/test/logs
that is so much more convenient way to check data, im still a stripe rookie
I'm expecting the card after setup intents, but there is none
My aim to add the card details to customer and if I succeed it would be visible here?
in payment_method.attached I have this:
"brand": "visa",
"checks": {
"address_line1_check": null,
"address_postal_code_check": "pass",
"cvc_check": "pass"
},
"country": "US",
"exp_month": 4,
"exp_year": 2042,
"fingerprint": "KcmZQOfl72nrmFyq",
"funding": "credit",
"generated_from": null,
"last4": "4242",
"networks": {
"available": [
"visa"
],
"preferred": null
},
"three_d_secure_usage": {
"supported": true
},
"wallet": null
},```
this
"id": "pm_1KGn86JwGZkZkKXwRMXARFFD",
...```
Thank you
from the same payment_method.attached
So that payment method is attached to the customer https://dashboard.stripe.com/test/customers/cus_KwgVavsHsjOipL
If you want it to show up in the dashboard I think you will want to set it as the default payment method for the customer
aha
My concern was because I don't see it in the dashboard the payment_intents is not automatically handled
You can set it via the dashboard or by setting these fields in the API:
https://stripe.com/docs/api/customers/object#customer_object-default_source
https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method
but triggered by my demo code
ok just to be clear, this have to be done on using react-stripe-js on FE
Setting the default payment method on a customer would be a backend call. So you would be doing that from the node library on your server
or the goal is to update the customer by targeting him and
default_payment_method
with pm id
oh yea, you type it faster
ok, sounds like I will do that next, if i have troubles can i type here?
Of course, always happy to help!