lib/active_merchant/billing/gateways/moneris_us.rb in activemerchant-1.76.0 vs lib/active_merchant/billing/gateways/moneris_us.rb in activemerchant-1.77.0
- old
+ new
@@ -135,9 +135,20 @@
post[:data_key] = data_key
post[:crypt_type] = options[:crypt_type] || @options[:crypt_type]
commit('us_res_update_cc', post)
end
+ def supports_scrubbing?
+ true
+ end
+
+ def scrub(transcript)
+ transcript.
+ gsub(%r((<pan>)[^<]*(</pan>))i, '\1[FILTERED]\2').
+ gsub(%r((<api_token>)[^<]*(</api_token>))i, '\1[FILTERED]\2').
+ gsub(%r((<cvd_value>)[^<]*(</cvd_value>))i, '\1[FILTERED]\2')
+ end
+
private # :nodoc: all
def expdate(creditcard)
sprintf("%.4i", creditcard.year)[-2..-1] + sprintf("%.2i", creditcard.month)
end