#coryschires - Card Token

1 messages · Page 1 of 1 (latest)

lilac hollow
#

Hello. One moment while I catch up here

vale solar
#

Sorry, I know this is a hard question, given the info I am providing.

#

And, being honest, I bet the issue is most likely in our code somewhere.

#

But, bc we're stumped, I wanted to just see if anything pops out to y'all (e.g. if you've had other customers experiencing similar issues).

fresh axle
#

Hey @vale solar !

#

Not an issue I've personally heard of I'm afraid. Can you provide more details, or perhaps share an example of your integration code with Stripe.js?

vale solar
#

As I am debugging this issue, I have one other specific question... Is there a way to trigger an error response from the Stripe Elements widget (e.g. a specific card number or something)

#

Specifically, how to trigger an error with the createToken method

fresh axle
vale solar
#

Correct me if I am wrong... These card numbers error when you attempt to charge them on the server. I am looking for a way to trigger an error on the client (i.e. when stripe is creating the token) rather than later, when the card token has already made it to the server.

#

Because my problem is that the card token is not making making it to the server – but only now and then, which is odd.

#

So I am wonder if there are any conditions under which createToken would respond with an an error, as that seems like what I am encountering (at least based on the limited info that I have).

fresh axle
#

Your integration sounds quite dated (i.e. before PIs etc), but this sounds like your code isn't waiting for createToken to resolve (successfully) before making the server-side call

vale solar
#

We do use PIs in other areas.

#

Is there any reason to think that upgrading to PIs would help fix this problem?

fresh axle
#

Well, it's not necessary to fix the issue no. It's just a bit different to how we recommend integrations are built now

#

With Payment Intents, you'd create the PI first and then capture the payment info (with Elements) and then 'confirm' the payment with Stripe.js, passing the PI 'secret' and the Element instance

vale solar
#

Makes sense. Thanks for the help! We'll keep investigating.