Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe payments api card fingerprint is undefined

Having successfully created a token for a card, I can successfully access attributes like:

token.card.id            # => "card_1E4YHkEyZ1SEBQHCiMrFatPq"
token.card.brand         # => "Visa"
token.card.name          # => "Jenny Rosen"

However, this fails:

token.card.fingerprint   # => undefined

Any ideas why? Has anyone else had this problem?

like image 749
Bazley Avatar asked Dec 30 '25 09:12

Bazley


1 Answers

The token.card.fingerprint property is only accessible with your Secret Key for security reasons. If you want to make use of this property, you should:

  1. Generate a token from card details your front-end using Stripe.js or Checkout, passing the resulting id (tok_xxyyyzz) to your back-end.
  2. In your backend, before using the token to create a charge or saving it to a customer, retrieve the token and grab the fingerprint (using https://stripe.com/docs/api/tokens/retrieve + your secret key)
like image 190
duck Avatar answered Jan 02 '26 04:01

duck