#tomgullen
1 messages · Page 1 of 1 (latest)
result.error is always null, this seems to always return a card object (token.card)
Hello
https://stripe.com/docs/js/tokens/create_token?type=cardElement shows it should return result.error
Hello thanks for looking!
Just trying to get an error message when adding a card
Cards don't decline on tokenization unless they have been flagged in the past which is a production-only thing, they generally decline on authorization which occurs when you attach the Card to a Customer
Yes that's what im trying to do, attach to a customer. What's the best way to get the error when it can't attach?
(This page is for a customer adding a new card to their account)
Well it looks like you are using our legacy APIs here since you are dealing with Tokens so to attach it to the Customer you would add it as a source: https://stripe.com/docs/api/customers/update#update_customer-source
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok understood thank you!