#mattwoberts - card validation

1 messages ยท Page 1 of 1 (latest)

dire nimbus
#

Hi there! Pasting your other message here:

I've got a pm if that helps -> pm_0Lae2oEHSdXPilfDdBIArv0f

#

I think that's normal, since Stripe will not do the card validation when creating the Payment Method. It should happen when you attach the Payment Method to a customer.

#

Can you clarify what is your payment flow and what are you trying to achieve?

main yarrow
#

Yeah sure - so the scenario is that someone is entering a card for LATER payment.

#

So they use our web app and enter a card, and using the JS lib we call into stripe (in this flow we're calling createPaymentMethod to create a new payment method)

#

Stripe confirms, we tell the user that all is OK and they can go and do something else.

#

Then, behind the scenes we attach that card to a customer, and we may take a payment if we deem that one is needed - this can then fail, but the customer is offline, so we can't inform them

#

I was sure that the JS lib would validate that the card is valid?

dire nimbus
#

in this flow we're calling createPaymentMethod to create a new payment method
I would recommend to use this instead: https://stripe.com/docs/payments/save-and-reuse?platform=web
This is the recommended flow, and it will automatically attach the payment method to the customer to validate the payment method

main yarrow
#

Hmm, thing is, we've been using this flow for many years, and it's mostly working. It's just lately we're getting some tickets from customers telling us that the card is accepted but then they still get failed payment messages.... I'm not opposed to changing the flow but has something changed to make this a thing?

#

I just looked into this some more from our side...

dire nimbus
#

It's just lately we're getting some tickets from customers telling us that the card is accepted but then they still get failed payment messages....
This can always happen, right? Like once you try to make a payment, it's completely up to the bank to accept/decline the payment. So that's something that your integration needs to manage anyways.
but has something changed to make this a thing?
No I don't think so. Another option would be to directly attach the PaymentMethod to the customer to see if it generates an error.

main yarrow
#

The flow that seems to be causing this is when the customer is "locked" out of our app. In order to continue, they need to enter a card, which we will use to create a new subscription, and then take payment immediately. So perhaps we need to rethink this flow

dire nimbus
#

If you need a PaymentMethod to start a subscription, then the correct flow should be:

main yarrow
#

Ok thanks for this. So just to confirm - it's normal for a card to be accepted via createPaymentMethod, even if the card number is invalid?

dire nimbus
#

There are some basic checks that are made by createPaymentMethod, like the luhn check (https://www.tokenex.com/blog/ab-what-is-a-luhn-check). However to check if the number is correct Stripe needs to talk to a bank. And this usually happen when the card is attached to a customer (not when calling createPaymentMethod).

main yarrow
#

Thanks again, appreciate your help here ๐Ÿ™‚

dire nimbus
#

Happy to help ๐Ÿ™‚