-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Credit Card Expiry Date Format #1781
Comments
@DevinWalker @mathetos I would like to suggest dropdown for expiry date instead of input field which has js for expiry date formatting. @amjad Can you handle this case with PHP code. I think it is good to take expiry date in |
Where can this be overridden in PHP? Dropdown would be nice to avoid errors. Correct me if I'm wrong, but isn't MM/YY format the standard? I haven't seen any cards with MM/YYYY on them, at least not in US. |
Example from Amazon.com, uses a dropdown and YYYY Stripe checkout is a number field with YY So it seems there isn't a clear standard, but obviously we don't want cards failing. Seems we need to implement some sort of validation that is determined by the payment gateway itself to display the year either with 2 digits or 4. With that in mind, I can see that it makes sense to do it with a Dropdown because it will be a consistent user experience but you can format the year programmatically... I just personally think it takes LONGER to enter the year with a dropdown than by typing, so my vote would be a number field instead. I'm sure we can still do YY validation even with a number field. Just my two cents. |
@amjad before sending data to payment gateway server, you can fix expiry date according to your format. |
@ravinderk is there a way to limit input to MM/YY rather than formatting before sending to gateway? |
Dropdowns should be the UI of last resort, especially on mobile. They introduce unnecessary complexity in this case. See https://www.lukew.com/ff/entry.asp?1950. A text field with an input mask is the better UX, and we can still do client-side and server-side validation to ensure the data is in the right format. As for what the format should be, I believe it should be Recommended Next StepsIf we know the |
@amjad currently you can achieve that with custom js only. |
I just tried the Stripe demo (click Donate to Watsi) and although the placeholder says In light of that, I'm changing my recommendation... We should leave the behavior as is and if a certain gateway requires a special format, that formatting can be handled in the add-on. |
@kevinwhoffman I want to suggest adding some js validation before submitting donation form. I reviewed code and we are adding we can address this issue within |
@ravinderk If we can improve JS validation, I am all for it. I just don't think it requires a dropdown to do so. |
@ravinderk I have fixed this issue for our gateway. Now when user enters 17 or 2017 as year it will send to payment server as 17. Thanks everyone! |
@am Glad, you fixed it. We will close this soon, need to add some fix to make it future proof. |
Some gateways accept the expiry date as MM/YY only. But the form takes MM/YYYY too and this is causing transactions to fail because of if people enter the full year our gateway send back an error of invalid expiry date.
How can we override this and allow only MM/YY as input?
The text was updated successfully, but these errors were encountered: