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
iATS Payments gateway support #1133
Conversation
@rwdaigle ActiveMerchant has a deprecation facility; easiest to observe by grepping for As for the new |
This commit adds support for the `purchase` and `refund` operations on the iATS Payments gateway. This replaces the existing iATS implementation (http://cl.ly/V8DE) and supersedes another, existing, pull request (http://cl.ly/V88q).
@ntalbott commit amended with backwards-compatible options: https://github.com/rwdaigle/active_merchant/blob/c50a18b7ce459bbb5aecf621a93d83d1f8e59a27/lib/active_merchant/billing/gateways/iats_payments.rb#L19-L24 |
Merged. |
Hi - thanks very much for merging this!
|
@stephenbiats in the original patch (#977) the determination of region was done based on the credit card's country, which is an error-prone check that's really outside the scope of ActiveMerchant, and often not possible since country is not always supplied with credit card data. That said, you seem to be implying now that the determination should be made based on currency, which I think we could do within ActiveMerchant. Please confirm: can the region be determined solely based on USD/CAD vs. other currencies? |
@stephenbiats RE refunds, that is a Shopify issue, not an ActiveMerchant issue, so you should take it up with Shopify's payments team directly. |
@ntalbott You are correct, the cr card country is not the correct determination of the region. |
@stephenbiats we've discussed this more internally here at Spreedly, and I've got another question for you: will the same set of merchant credentials ever need to interact with both urls? Or will a given merchant always be interacting with one of the urls? |
I'd be interested to know as well, it may be that we could use |
@ntalbott No, the merchant credentials are unique to a currency - so there will not be a case where the same set of merchant credentials will interact with both URL's. If a client wants a USD store and funds deposited in USD - they will get one set of merchant credentials, and another set if they have a GBP store and funds deposited into GBP account. |
@stephenbiats based on that I think the current implementation is correct: the region should be specified as one of the credentials. In Spreedly for instance the region is always required when setting up a gateway: https://docs.spreedly.com/payment-gateways/iats-payments. It seems like the real issue is not the adapter, but rather that Shopify should expose the region as a configuration value; maybe @bslobodin can help with that? The other option would be for iATS to fix this on their side, since it really seems like one URL should be provided and then iATS should be making the determination internally as to how to route the request. But if this must be pushed down into the client, I think it has to be exposed to the merchant as a gateway setup option. |
@ntalbott I think the best solution at this stage is for iATS to have 2 services in AM - iATS NA (for all NA transactions) and iATS EU (for all transactions outside NA). Then a client just needs to choose the correct one based on where they are and what iATS account they have. Could this work? |
@stephenbiats that's exactly the effect of specifying the region with the credentials; the code needs no changes to support that approach. Of course users of the code such as Shopify are free to present the selection of the region however they'd like, including making it look as though two different gateways are being picked between, but you should take that up with them directly. |
I like the distinct gateways idea, mostly because our configuration options are currently limited to text fields and it would be awkward to have to ask merchants to type something like |
@bslobodin I'm very much against creating gateway subclasses simply for presentation purposes - I think it clutters up the AM codebase, and would like to actually go through and eliminate all the gateway subclasses that don't add or modify behavior in the future. I know that in the Spreedly codebase we have our own wrappers around the ActiveMerchant gateways which allow us to use the same AM gateway class for two different "presented" gateways if we choose - perhaps something like that would work for Shopify? |
Ya, let's leave it as is, I'll see what I can do. |
Please let me know if there is anything you would like me to do to help. Can create 2 AM bases, rename (NA and Euro) and do pull request if like? |
Nope, I already made a change on our end. In Shopify there will be 2 options |
FANTASTIC!!! Thank you! Please let me know when done and I will go in an test. |
@stephenbiats will do, probably will get deployed by the end of the week. In the meantime, it'll just be defaulting to 'na'. |
@bslobodin hi, any news on this, did you manage to get it done this week? |
Not quite. Turns out, we have a freeze on a specific component undergoing |
Thank you! |
@bslobodin Hi, any news on this? |
@stephenbiats it may be a bit still. |
Hi - just following up - any news on this yet? |
@bslobodin @ntalbott Hi, any news on this? Has this been completed yet? Please let me know if there is anything need to do my side. Have more EU customers keen to use Shopify and iATS and waiting for this release. |
@stephenbiats this is out of my bailiwick now; I think @odorcicd is the person you'll need to take Shopify issues up with these days. |
Thanks @ntalbott. @odorcicd @bslobodin can you help please? |
This commit adds support for the
purchase
andrefund
operations on the iATS Payments gateway. This replaces the existing iATS implementation (http://cl.ly/V8DE) and supersedes another, existing, pull request (http://cl.ly/V88q).There is a backwards-incompatible change which I'd like advice on how to handle: The original implementation used credentials named
login
andpassword
whereas this implementation sticks with gateway-specific naming ofagent_code
andpassword
, and requires an additionalregion
option. I don't believe the current implementation is being used, but do want to know how such changes should be handled.