lib/active_merchant/billing/gateways/paymentez.rb in activemerchant-1.126.0 vs lib/active_merchant/billing/gateways/paymentez.rb in activemerchant-1.129.0

- old
+ new

@@ -135,10 +135,14 @@ def unstore(identification, options = {}) post = { card: { token: identification }, user: { id: options[:user_id] } } commit_card('delete', post) end + def inquire(authorization, options = {}) + commit_transaction('inquire', authorization) + end + def supports_scrubbing? true end def scrub(transcript) @@ -230,15 +234,23 @@ def parse(body) JSON.parse(body) end def commit_raw(object, action, parameters) - url = "#{(test? ? test_url : live_url)}#{object}/#{action}" - - begin - raw_response = ssl_post(url, post_data(parameters), headers) - rescue ResponseError => e - raw_response = e.response.body + if action == 'inquire' + url = "#{(test? ? test_url : live_url)}#{object}/#{parameters}" + begin + raw_response = ssl_get(url, headers) + rescue ResponseError => e + raw_response = e.response.body + end + else + url = "#{(test? ? test_url : live_url)}#{object}/#{action}" + begin + raw_response = ssl_post(url, post_data(parameters), headers) + rescue ResponseError => e + raw_response = e.response.body + end end begin parse(raw_response) rescue JSON::ParserError