#TzarBuba - CardElement

1 messages · Page 1 of 1 (latest)

deft acorn
#

Hello, what issue are you running in to?

south briar
#

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

deft acorn
#

Do you have the ID of a card that you created that way? (card_123 or (pm_123)

south briar
#

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

south briar
deft acorn
#

If you still have the data for any of those events, those will have an ID

#

The setup intent IDs could help

south briar
#

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
},```
deft acorn
#

What is the ID in that event?

#

It should look like pm_123

south briar
#

this

    "id": "pm_1KGn86JwGZkZkKXwRMXARFFD",
...```
deft acorn
#

Thank you

south briar
#

from the same payment_method.attached

deft acorn
#

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

south briar
#

aha

#

My concern was because I don't see it in the dashboard the payment_intents is not automatically handled

south briar
#

but triggered by my demo code

#

ok just to be clear, this have to be done on using react-stripe-js on FE

deft acorn
#

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

south briar
#

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?

deft acorn
#

Of course, always happy to help!