lib/active_merchant/billing/gateways/blue_pay.rb in activemerchant-1.86.0 vs lib/active_merchant/billing/gateways/blue_pay.rb in activemerchant-1.87.0

- old
+ new

@@ -328,11 +328,11 @@ parse(ssl_post(url, post_data(action, fields))) end def parse_recurring(response_fields, opts={}) # expected status? parsed = {} - response_fields.each do |k,v| + response_fields.each do |k, v| mapped_key = REBILL_FIELD_MAP.include?(k) ? REBILL_FIELD_MAP[k] : k parsed[mapped_key] = v end success = parsed[:status] != 'error' @@ -343,18 +343,18 @@ :authorization => parsed[:rebill_id]) end def parse(body) # The bp20api has max one value per form field. - response_fields = Hash[CGI::parse(body).map{|k,v| [k.upcase,v.first]}] + response_fields = Hash[CGI::parse(body).map { |k, v| [k.upcase, v.first] }] if response_fields.include? 'REBILL_ID' return parse_recurring(response_fields) end parsed = {} - response_fields.each do |k,v| + response_fields.each do |k, v| mapped_key = FIELD_MAP.include?(k) ? FIELD_MAP[k] : k parsed[mapped_key] = v end # normalize message @@ -372,11 +372,11 @@ message = parsed[:message] if(parsed[:response_code].to_i == 2) if CARD_CODE_ERRORS.include?(parsed[:card_code]) message = CVVResult.messages[parsed[:card_code]] elsif AVS_ERRORS.include?(parsed[:avs_result_code]) - message = AVSResult.messages[ parsed[:avs_result_code] ] + message = AVSResult.messages[parsed[:avs_result_code]] else message = message.chomp('.') end elsif message == 'Missing ACCOUNT_ID' message = 'The merchant login ID or password is invalid' @@ -508,10 +508,10 @@ ].join('') ) end def handle_response(response) - if ignore_http_status || (200...300).include?(response.code.to_i) + if ignore_http_status || (200...300).cover?(response.code.to_i) return response.body end raise ResponseError.new(response) end end