lib/active_merchant/billing/gateways/realex.rb in activemerchant-1.83.0 vs lib/active_merchant/billing/gateways/realex.rb in activemerchant-1.84.0
- old
+ new
@@ -24,19 +24,16 @@
CARD_MAPPING = {
'master' => 'MC',
'visa' => 'VISA',
'american_express' => 'AMEX',
'diners_club' => 'DINERS',
- 'switch' => 'SWITCH',
- 'solo' => 'SWITCH',
- 'laser' => 'LASER',
'maestro' => 'MC'
}
self.money_format = :cents
self.default_currency = 'EUR'
- self.supported_cardtypes = [ :visa, :master, :american_express, :diners_club, :switch, :solo, :laser ]
+ self.supported_cardtypes = [ :visa, :master, :american_express, :diners_club ]
self.supported_countries = %w(IE GB FR BE NL LU IT US CA ES)
self.homepage_url = 'http://www.realexpayments.com/'
self.display_name = 'Realex'
SUCCESS, DECLINED = 'Successful', 'Declined'
@@ -87,15 +84,16 @@
true
end
def scrub(transcript)
transcript.
- gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
- gsub(%r((<number>)\d+(</number>))i, '\1[FILTERED]\2')
+ gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
+ gsub(%r((<number>)\d+(</number>))i, '\1[FILTERED]\2')
end
private
+
def commit(request)
response = parse(ssl_post(self.live_url, request))
Response.new(
(response[:result] == '00'),
@@ -243,11 +241,11 @@
xml.tag! 'card' do
xml.tag! 'number', credit_card.number
xml.tag! 'expdate', expiry_date(credit_card)
xml.tag! 'chname', credit_card.name
xml.tag! 'type', CARD_MAPPING[card_brand(credit_card).to_s]
- xml.tag! 'issueno', credit_card.issue_number
+ xml.tag! 'issueno', ''
xml.tag! 'cvn' do
xml.tag! 'number', credit_card.verification_value
xml.tag! 'presind', (options['presind'] || (credit_card.verification_value? ? 1 : nil))
end
end
@@ -265,10 +263,10 @@
end
end
def format_address_code(address)
code = [address[:zip].to_s, address[:address1].to_s + address[:address2].to_s]
- code.collect{|e| e.gsub(/\D/, '')}.reject{|e| e.empty?}.join('|')
+ code.collect{|e| e.gsub(/\D/, '')}.reject(&:empty?).join('|')
end
def new_timestamp
Time.now.strftime('%Y%m%d%H%M%S')
end