-
Notifications
You must be signed in to change notification settings - Fork 170
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
add is_valid fake method to enable beanstream credit cards #115
base: master
Are you sure you want to change the base?
Conversation
7a2e2e7
to
a03a355
Compare
Might be better to limit this to |
Do you mean in the validate_card method? |
Well, something like:
This way if someone passes |
Here's a different approach I like better since it extends to all cards and avoids monkey patches as well as an extra lookup of is_valid. |
I think it's far better to just get rid of validation in |
You would know better. I agree that combining libraries with the same method signatures is dangerous as well, but is probably just one of those unfortunate choices that are outside of our control and we just have to deal with. However, because I'm unaware if other cards may have the same issue, I opted to add this logic here. It's a hard choice, for instance you can convert everything to a merchant CC and reject anything that isn't a subclass of it to avoid complications arising from common attributes, but then you'd have to keep up with god knows how many APIs that using their own CC instance handles. |
The credit card beanstream uses does not have an is_valid method so the validation method fails. This puts in a fake is_valid method if one doesn't exist (so if they ever do add a method it will work seamlessly).