active_merchant icon indicating copy to clipboard operation
active_merchant copied to clipboard

Openpay: able to set endpoint URL by merchant country flag

Open edgarv09 opened this issue 2 years ago • 1 comments

Summary: Add support to set service URL by setting the merchant country flag, with this capability openpay knows from which region is happening the transaction.

Remote: 25 tests, 83 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 96% passed

Unit: 22 tests, 113 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed

Rubocop: 753 files inspected, no offenses detected

edgarv09 avatar Nov 24 '22 21:11 edgarv09

I think it would be good to update gateway_url to use live_url and test_url just to keep in pattern to what we do in AM.

Hi! @almalee24 I understood your point but I check other gateways to have an idea of how to handle this behavior following the patterns and I found in so many cases the pattern of having a method to return a URL is present.

if you do a search using the keyword def url you will find 69 matches across 68 files.

Jetpay behavior is so similar to openpay case https://github.com/activemerchant/active_merchant/blob/c728c5265ec4d6edf26d6a70bece17be6f9a4de0/lib/active_merchant/billing/gateways/jetpay.rb#L296-L299

https://github.com/activemerchant/active_merchant/blob/c728c5265ec4d6edf26d6a70bece17be6f9a4de0/lib/active_merchant/billing/gateways/iats_payments.rb#L212-L215

https://github.com/activemerchant/active_merchant/blob/c728c5265ec4d6edf26d6a70bece17be6f9a4de0/lib/active_merchant/billing/gateways/iats_payments.rb#L4

other examples:

https://github.com/activemerchant/active_merchant/blob/c728c5265ec4d6edf26d6a70bece17be6f9a4de0/lib/active_merchant/billing/gateways/litle.rb#L617-L620

https://github.com/activemerchant/active_merchant/blob/c728c5265ec4d6edf26d6a70bece17be6f9a4de0/lib/active_merchant/billing/gateways/element.rb#L365-L372

https://github.com/activemerchant/active_merchant/blob/c728c5265ec4d6edf26d6a70bece17be6f9a4de0/lib/active_merchant/billing/gateways/jetpay_v2.rb#L308-L311

https://github.com/activemerchant/active_merchant/blob/c728c5265ec4d6edf26d6a70bece17be6f9a4de0/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb#L258-L262

https://github.com/activemerchant/active_merchant/blob/c728c5265ec4d6edf26d6a70bece17be6f9a4de0/lib/active_merchant/billing/gateways/merchant_ware.rb#L287-L291

edgarv09 avatar Dec 07 '22 14:12 edgarv09