-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Accept both formats of Canadian routing numbers #4568
Accept both formats of Canadian routing numbers #4568
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Kind of a philosophical question, but my original thought when doing this implementation was that if the gateway expects a specific format of routing number, that's something the gateway adapter should handle, rather than requiring someone who's integrating against AM to potentially have to create different payment methods for the same account. Thoughts? |
@therufs It's a good question. I stuck it back in here because I saw this format used to be here. In response to your question, I see these two formats as potentially equally standard, and can't be certain how widely used either is. For example, the format validated for US routing numbers via the checksum is also an MICR format. In that case, it's the only standard format, but I think the Canadian MICR does fit in here as well. I don't consider the retainment and reuse of payment methods to be concerns of Active Merchant. 🤔 What to you think? |
@molbrown I see it less as being relevant to payment method retention, more about presenting an interface that's gateway agnostic -- it seems like (?) some gateways want one format and some want the other, and I don't think an AM user should have to keep track of which gateway wants which behavior. (I know there's a whole options hash that belies this, but if it's avoidable, we should probably avoid it.) I wonder if we could implement a pair of methods on |
ffcd56f
to
e5ede11
Compare
@therufs I like that idea, here's a stab at such an approach, with some mild refactoring (maybe could use more). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aw heck yeah love this 🤩
I don't see anything that obviously wants refactoring, but if there's particular stuff you have in mind, happy to take another look!
Canadian routing numbers are typically handled either in print/MICR format or electronic format (see https://en.wikipedia.org/wiki/Routing_number_(Canada)#Format). Adds ability to send valid MICR formatted Canadian routing numbers, which may still be expected by some gateways. Adds public methods to Check that can be used in a gateway adapter expecting one format of Canadian routing number. Unit tests: 5308 tests, 76382 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed Rubocop: 746 files inspected, no offenses detected ECS-2144
e5ede11
to
862219b
Compare
Canadian routing numbers are typically handled either in print/MICR format or electronic format (see https://en.wikipedia.org/wiki/Routing_number_(Canada)#Format).
Adds ability to send valid MICR formatted Canadian routing numbers, which may still be expected by some gateways.
Unit tests:
5308 tests, 76382 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed
Rubocop:
746 files inspected, no offenses detected
ECS-2144