lib/active_merchant/billing/gateways/redsys.rb in activemerchant-1.52.0 vs lib/active_merchant/billing/gateways/redsys.rb in activemerchant-1.53.0

- old
+ new

@@ -36,28 +36,35 @@ self.supported_cardtypes = [:visa, :master, :american_express, :jcb, :diners_club] self.homepage_url = "http://www.redsys.es/" self.display_name = "Redsys" CURRENCY_CODES = { + "AED" => '784', "ARS" => '32', "AUD" => '36', "BRL" => '986', "BOB" => '68', "CAD" => '124', "CHF" => '756', "CLP" => '152', "COP" => '170', + "CZK" => '203', "EUR" => '978', "GBP" => '826', "GTQ" => '320', + "HUF" => '348', "JPY" => '392', "MYR" => '458', "MXN" => '484', + "NOK" => '578', "NZD" => '554', "PEN" => '604', + "PLN" => '616', "RUB" => '643', + "SEK" => '752', "SGD" => '702', + "THB" => '764', "USD" => '840', "UYU" => '858' } # The set of supported transactions for this gateway. @@ -224,9 +231,22 @@ def verify(creditcard, options = {}) MultiResponse.run(:use_first_response) do |r| r.process { authorize(100, creditcard, options) } r.process(:ignore_result) { void(r.authorization, options) } end + end + + def supports_scrubbing + true + end + + def scrub(transcript) + transcript. + gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]'). + gsub(%r((%3CDS_MERCHANT_PAN%3E)\d+(%3C%2FDS_MERCHANT_PAN%3E))i, '\1[FILTERED]\2'). + gsub(%r((%3CDS_MERCHANT_CVV2%3E)\d+(%3C%2FDS_MERCHANT_CVV2%3E))i, '\1[FILTERED]\2'). + gsub(%r((<DS_MERCHANT_PAN>)\d+(</DS_MERCHANT_PAN>))i, '\1[FILTERED]\2'). + gsub(%r((<DS_MERCHANT_CVV2>)\d+(</DS_MERCHANT_CVV2>))i, '\1[FILTERED]\2') end private def add_action(data, action)