lib/active_merchant/billing/gateways/optimal_payment.rb in activemerchant-1.77.0 vs lib/active_merchant/billing/gateways/optimal_payment.rb in activemerchant-1.78.0

- old
+ new

@@ -57,9 +57,20 @@ def capture(money, authorization, options = {}) options[:confirmationNumber] = authorization commit('ccSettlement', money, options) end + def supports_scrubbing? + true + end + + def scrub(transcript) + transcript. + gsub(%r((%3CstorePwd%3E).*(%3C(%2F|/)storePwd%3E))i, '\1[FILTERED]\2'). + gsub(%r((%3CcardNum%3E)\d*(%3C(%2F|/)cardNum%3E))i, '\1[FILTERED]\2'). + gsub(%r((%3Ccvd%3E)\d*(%3C(%2F|/)cvd%3E))i, '\1[FILTERED]\2') + end + private def parse_card_or_auth(card_or_auth, options) if card_or_auth.respond_to?(:number) @credit_card = card_or_auth