lib/active_merchant/billing/gateways/paypal.rb in activemerchant-1.45.0 vs lib/active_merchant/billing/gateways/paypal.rb in activemerchant-1.46.0

- old
+ new

@@ -1,8 +1,8 @@ -require File.dirname(__FILE__) + '/paypal/paypal_common_api' -require File.dirname(__FILE__) + '/paypal/paypal_recurring_api' -require File.dirname(__FILE__) + '/paypal_express' +require 'active_merchant/billing/gateways/paypal/paypal_common_api' +require 'active_merchant/billing/gateways/paypal/paypal_recurring_api' +require 'active_merchant/billing/gateways/paypal_express' module ActiveMerchant #:nodoc: module Billing #:nodoc: class PaypalGateway < Gateway include PaypalCommonAPI @@ -34,9 +34,21 @@ end end def express @express ||= PaypalExpressGateway.new(@options) + end + + def supports_scrubbing? + true + end + + def scrub(transcript) + transcript. + gsub(%r((<n1:Password>).+(</n1:Password>)), '\1[FILTERED]\2'). + gsub(%r((<n1:Username>).+(</n1:Username>)), '\1[FILTERED]\2'). + gsub(%r((<n2:CreditCardNumber>).+(</n2:CreditCardNumber)), '\1[FILTERED]\2'). + gsub(%r((<n2:CVV2>).+(</n2:CVV2)), '\1[FILTERED]\2') end private def define_transaction_type(transaction_arg)