#flyingace68

1 messages ยท Page 1 of 1 (latest)

ionic flumeBOT
fallow grail
#

Hi ๐Ÿ‘‹

Can you clarify what it is you are attempting to do?

#

What APIs are you using, what are they returning?

#

And thee cards are intended to fail when making a payment. Are you attempting to charge them?

ionic flumeBOT
atomic sparrow
#

I'm attempting to submit a credit card for approval but not for payment. I need to generate a token for the card. I'm using stripe.createToken and the docs indicate that I should get a promise that returns either result.token or result.error. I want to be able to see the shape of the errors I might get. How can I do this?

fallow grail
atomic sparrow
#

Right. We're not going to be using the Payment Intents API at the moment because we're moving from a legacy system that still uses it.

#

Hello? So does this mean that there's no way to simulate errors for stripe.createToken?

sleek comet
#

๐Ÿ‘‹ hopping in since snufkin had to head out

#

sorry for the wait

#

There's no way to "validate" a card is valid or not just be creating a token - you'd have to attach it to a customer or use it in a charge for the validation to actually happen

atomic sparrow
#

So then what situations can result in stripe.createToken returning result.error?

sleek comet
#

I believe it'd fail if you pass a card that wouln't pass the luhn check

atomic sparrow
#

luhn check?

sleek comet
#

Yeah - it's just making sure the card number is a valid format