lib/active_merchant/billing/gateways/redsys.rb in activemerchant-1.112.0 vs lib/active_merchant/billing/gateways/redsys.rb in activemerchant-1.113.0

- old
+ new

@@ -474,11 +474,11 @@ params[element.name.downcase.to_sym] = element.text end if validate_signature(params) message = response_text(params[:ds_response]) options[:authorization] = build_authorization(params) - success = is_success_response?(params[:ds_response]) + success = success_response?(params[:ds_response]) else message = 'Response failed validation check' end elsif %w[iniciaPeticion trataPeticion].include?(action) vxml = Nokogiri::XML(data).remove_namespaces!.xpath("//Envelope/Body/#{action}Response/#{action}Return").inner_text @@ -488,11 +488,11 @@ op.children.each do |element| params[element.name.downcase.to_sym] = element.text end message = response_text_3ds(xml, params) options[:authorization] = build_authorization(params) - success = params.size > 0 && is_success_response?(params[:ds_response]) + success = params.size > 0 && success_response?(params[:ds_response]) else # Some kind of programmer error with the request! message = "#{code} ERROR" end @@ -557,10 +557,10 @@ message = response_text(params[:ds_response]) end message end - def is_success_response?(code) + def success_response?(code) (code.to_i < 100) || [400, 481, 500, 900].include?(code.to_i) end def clean_order_id(order_id) cleansed = order_id.gsub(/[^\da-zA-Z]/, '')