lib/active_merchant/billing/gateways/card_stream.rb in activemerchant-1.108.0 vs lib/active_merchant/billing/gateways/card_stream.rb in activemerchant-1.109.0

- old
+ new

@@ -5,12 +5,12 @@ self.test_url = self.live_url = 'https://gateway.cardstream.com/direct/' self.money_format = :cents self.default_currency = 'GBP' self.currencies_without_fractions = %w(CVE ISK JPY UGX) - self.supported_countries = ['GB', 'US', 'CH', 'SE', 'SG', 'NO', 'JP', 'IS', 'HK', 'NL', 'CZ', 'CA', 'AU'] - self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :jcb, :maestro] + self.supported_countries = %w[GB US CH SE SG NO JP IS HK NL CZ CA AU] + self.supported_cardtypes = %i[visa master american_express diners_club discover jcb maestro] self.homepage_url = 'http://www.cardstream.com/' self.display_name = 'CardStream' CURRENCY_CODES = { 'AED' => '784', @@ -245,11 +245,11 @@ add_pair(post, :transactionUnique, options[:order_id], required: true) add_pair(post, :orderRef, options[:description] || options[:order_id], required: true) add_pair(post, :statementNarrative1, options[:merchant_name]) if options[:merchant_name] add_pair(post, :statementNarrative2, options[:dynamic_descriptor]) if options[:dynamic_descriptor] if credit_card_or_reference.respond_to?(:number) - if ['american_express', 'diners_club'].include?(card_brand(credit_card_or_reference).to_s) + if %w[american_express diners_club].include?(card_brand(credit_card_or_reference).to_s) add_pair(post, :item1Quantity, 1) add_pair(post, :item1Description, (options[:description] || options[:order_id]).slice(0, 15)) add_pair(post, :item1GrossValue, localized_amount(money, options[:currency] || currency(money))) end end @@ -307,10 +307,10 @@ end result end def commit(action, parameters) - parameters.update(countryCode: self.supported_countries[0]) unless ['CAPTURE', 'CANCEL'].include?(action) + parameters.update(countryCode: self.supported_countries[0]) unless %w[CAPTURE CANCEL].include?(action) parameters.update( merchantID: @options[:login], action: action ) # adds a signature to the post hash/array