lib/active_merchant/billing/gateways/paymentez.rb in activemerchant-1.103.0 vs lib/active_merchant/billing/gateways/paymentez.rb in activemerchant-1.104.0
- old
+ new
@@ -234,14 +234,17 @@
end
def card_success_from(response)
return false if response.include?('error')
return true if response['message'] == 'card deleted'
+
response['card']['status'] == 'valid'
end
def message_from(response)
+ return response['detail'] if response['detail'].present?
+
if !success_from(response) && response['error']
response['error'] && response['error']['type']
else
response['transaction'] && response['transaction']['message']
end
@@ -272,9 +275,10 @@
JSON.dump(parameters)
end
def error_code_from(response)
return if success_from(response)
+
if response['transaction']
detail = response['transaction']['status_detail']
return STANDARD_ERROR_CODE[STANDARD_ERROR_CODE_MAPPING[detail]] if STANDARD_ERROR_CODE_MAPPING.include?(detail)
elsif response['error']
return STANDARD_ERROR_CODE[:config_error]