lib/active_merchant/billing/gateways/fat_zebra.rb in activemerchant-1.61.0 vs lib/active_merchant/billing/gateways/fat_zebra.rb in activemerchant-1.62.0

- old
+ new

@@ -89,10 +89,21 @@ add_creditcard(post, creditcard) commit(:post, "credit_cards", post) end + def supports_scrubbing? + true + end + + def scrub(transcript) + transcript. + gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]'). + gsub(%r(("card_number\\":\\")[^"\\]*)i, '\1[FILTERED]'). + gsub(%r(("cvv\\":\\")\d+), '\1[FILTERED]') + end + private # Add the money details to the request def add_amount(post, money, options) post[:currency] = (options[:currency] || currency(money)) @@ -123,18 +134,12 @@ extra = {} extra[:ecm] = "32" if options[:recurring] extra[:cavv] = options[:cavv] if options[:cavv] extra[:xid] = options[:cavv] if options[:xid] extra[:sli] = options[:sli] if options[:sli] - add_descriptor(extra, options) + extra[:name] = options[:merchant] if options[:merchant] + extra[:location] = options[:merchant_location] if options[:merchant_location] post[:extra] = extra if extra.any? - end - - def add_descriptor(extra, options) - descriptor = {} - descriptor[:name] = options[:merchant] if options[:merchant] - descriptor[:location] = options[:merchant_location] if options[:merchant_location] - extra[:descriptor] = descriptor if descriptor.any? end def add_order_id(post, options) post[:reference] = options[:order_id] || SecureRandom.hex(15) end