lib/active_merchant/billing/gateways/decidir_plus.rb in activemerchant-1.133.0 vs lib/active_merchant/billing/gateways/decidir_plus.rb in activemerchant-1.137.0
- old
+ new
@@ -319,11 +319,14 @@
def error_message(response)
return error_code_from(response) unless validation_errors = response.dig('validation_errors')
validation_errors = validation_errors[0]
+ message = "#{validation_errors&.dig('code')}: #{validation_errors&.dig('param')}"
+ return message unless message == ': '
- "#{validation_errors.dig('code')}: #{validation_errors.dig('param')}"
+ errors = response['validation_errors'].map { |k, v| "#{k}: #{v}" }.join(', ')
+ "#{response['error_type']} - #{errors}"
end
def rejected?(response)
return response.dig('status') == 'rejected'
end