lib/active_merchant/billing/gateways/clearhaus.rb in activemerchant-1.100.0 vs lib/active_merchant/billing/gateways/clearhaus.rb in activemerchant-1.101.0

- old
+ new

@@ -128,13 +128,11 @@ card = {} card[:pan] = payment.number card[:expire_month] = '%02d'% payment.month card[:expire_year] = payment.year - if payment.verification_value? - card[:csc] = payment.verification_value - end + card[:csc] = payment.verification_value if payment.verification_value? post[:card] = card if card.any? end def headers(api_key) @@ -159,16 +157,17 @@ rescue OpenSSL::PKey::RSAError => e return Response.new(false, e.message) end end - response = begin - parse(ssl_post(url, body, headers)) - rescue ResponseError => e - raise unless(e.response.code.to_s =~ /400/) - parse(e.response.body) - end + response = + begin + parse(ssl_post(url, body, headers)) + rescue ResponseError => e + raise unless(e.response.code.to_s =~ /400/) + parse(e.response.body) + end Response.new( success_from(response), message_from(response), response, @@ -209,12 +208,10 @@ "#{@options[:signing_key]} RS256-hex #{hex}" end def error_code_from(response) - unless success_from(response) - response['status']['code'] - end + response['status']['code'] unless success_from(response) end end end end