lib/active_merchant/billing/gateways/quickbooks.rb in activemerchant-1.85.0 vs lib/active_merchant/billing/gateways/quickbooks.rb in activemerchant-1.86.0
- old
+ new
@@ -116,11 +116,11 @@
add_payment(post, payment, options)
add_address(post, options)
end
def add_address(post, options)
- return unless post[:card] && post[:card].kind_of?(Hash)
+ return unless post[:card]&.kind_of?(Hash)
card_address = {}
if address = options[:billing_address] || options[:address]
card_address[:streetAddress] = address[:address1]
card_address[:city] = address[:city]
@@ -251,10 +251,10 @@
end
end
def success?(response)
return FRAUD_WARNING_CODES.concat(['0']).include?(response['errors'].first['code']) if response['errors']
-
+
!['DECLINED', 'CANCELLED'].include?(response['status'])
end
def message_from(response)
response['errors'].present? ? response['errors'].map {|error_hash| error_hash['message'] }.join(' ') : response['status']