lib/active_merchant/billing/gateways/redsys.rb in activemerchant-1.107.4 vs lib/active_merchant/billing/gateways/redsys.rb in activemerchant-1.108.0

- old
+ new

@@ -563,10 +563,10 @@ (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]/, '') - if cleansed =~ /^\d{4}/ + if /^\d{4}/.match?(cleansed) cleansed[0..11] else '%04d%s' % [rand(0..9999), cleansed[0...8]] end end