lib/active_merchant/billing/gateways/card_stream.rb in activemerchant-1.105.0 vs lib/active_merchant/billing/gateways/card_stream.rb in activemerchant-1.106.0

- old
+ new

@@ -171,11 +171,11 @@ end def capture(money, authorization, options = {}) post = {} add_pair(post, :xref, authorization) - add_pair(post, :amount, localized_amount(money, options[:currency] || currency(money)), :required => true) + add_pair(post, :amount, localized_amount(money, options[:currency] || currency(money)), required: true) add_remote_address(post, options) commit('CAPTURE', post) end @@ -223,11 +223,11 @@ private def add_amount(post, money, options) currency = options[:currency] || currency(money) - add_pair(post, :amount, localized_amount(money, currency), :required => true) + add_pair(post, :amount, localized_amount(money, currency), required: true) add_pair(post, :currencyCode, currency_code(currency)) end def add_customer_data(post, options) add_pair(post, :customerEmail, options[:email]) @@ -240,12 +240,12 @@ add_pair(post, :customerCountryCode, 'GB') end end def add_invoice(post, credit_card_or_reference, money, options) - add_pair(post, :transactionUnique, options[:order_id], :required => true) - add_pair(post, :orderRef, options[:description] || options[:order_id], :required => true) + 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) add_pair(post, :item1Quantity, 1) @@ -265,18 +265,18 @@ add_reference(post, credit_card_or_reference.to_s) end end def add_reference(post, reference) - add_pair(post, :xref, reference, :required => true) + add_pair(post, :xref, reference, required: true) end def add_credit_card(post, credit_card) - add_pair(post, :customerName, credit_card.name, :required => true) - add_pair(post, :cardNumber, credit_card.number, :required => true) - add_pair(post, :cardExpiryMonth, format(credit_card.month, :two_digits), :required => true) - add_pair(post, :cardExpiryYear, format(credit_card.year, :two_digits), :required => true) + add_pair(post, :customerName, credit_card.name, required: true) + add_pair(post, :cardNumber, credit_card.number, required: true) + add_pair(post, :cardExpiryMonth, format(credit_card.month, :two_digits), required: true) + add_pair(post, :cardExpiryYear, format(credit_card.year, :two_digits), required: true) add_pair(post, :cardCVV, credit_card.verification_value) end def add_threeds_required(post, options) add_pair(post, :threeDSRequired, options[:threeds_required] || @threeds_required ? 'Y' : 'N') @@ -307,28 +307,28 @@ 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 ['CAPTURE', 'CANCEL'].include?(action) parameters.update( - :merchantID => @options[:login], - :action => action + merchantID: @options[:login], + action: action ) # adds a signature to the post hash/array add_hmac(parameters) response = parse(ssl_post(self.live_url, post_data(action, parameters))) Response.new( response[:responseCode] == '0', response[:responseCode] == '0' ? 'APPROVED' : response[:responseMessage], response, - :test => test?, - :authorization => response[:xref], - :cvv_result => CVV_CODE[response[:avscv2ResponseCode].to_s[0, 1]], - :avs_result => avs_from(response) + test: test?, + authorization: response[:xref], + cvv_result: CVV_CODE[response[:avscv2ResponseCode].to_s[0, 1]], + avs_result: avs_from(response) ) end def avs_from(response) postal_match = AVS_POSTAL_MATCH[response[:avscv2ResponseCode].to_s[1, 1]] @@ -343,12 +343,12 @@ else 'I' end AVSResult.new({ - :code => code, - :postal_match => postal_match, - :street_match => street_match + code: code, + postal_match: postal_match, + street_match: street_match }) end def currency_code(currency) CURRENCY_CODES[currency]