#tarek-expired-card
1 messages · Page 1 of 1 (latest)
yeah you can't create a PaymentMethod with expired dates
look at the card number 4000000000000069 from https://stripe.com/docs/testing#cards-responses
use any non-expired dates but the card decliens when you charge it
Thank you for your response, this is the card# that we're using to test error message when a customer enters an expired card.
However, For our specific scenario, we save cards in our database for users, when they create a card, we make sure it's a valid card, but now what we're testing is that when their saved cards get expired, we need to show custom error message and redirect them to certain page. Can we create a valid card then force expire it?
so in that case you just need to "mock" your response
you have pm_123 with expiry 01/2024, you just need to "mock" that it expires and is now 01/2020 and you display whatever you have to in your UI