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

- old
+ new

@@ -90,13 +90,13 @@ private def build_void_or_capture_request(type, money, authorization, options) parsed_authorization = parse_authorization_string(authorization) - xml = Builder::XmlMarkup.new :indent => 2 + xml = Builder::XmlMarkup.new indent: 2 xml.instruct! - xml.tag! :Request, :version => '2' do + xml.tag! :Request, version: '2' do add_authentication(xml) xml.tag! :Transaction do xml.tag! :HistoricTxn do xml.tag! :reference, parsed_authorization[:reference] @@ -105,34 +105,34 @@ end if money xml.tag! :TxnDetails do xml.tag! :merchantreference, format_reference_number(options[:order_id]) - xml.tag! :amount, amount(money), :currency => options[:currency] || currency(money) + xml.tag! :amount, amount(money), currency: options[:currency] || currency(money) xml.tag! :capturemethod, 'ecomm' end end end end xml.target! end def build_purchase_or_authorization_request_with_credit_card_request(type, money, credit_card, options) - xml = Builder::XmlMarkup.new :indent => 2 + xml = Builder::XmlMarkup.new indent: 2 xml.instruct! - xml.tag! :Request, :version => '2' do + xml.tag! :Request, version: '2' do add_authentication(xml) xml.tag! :Transaction do - xml.tag! :ContAuthTxn, :type => 'setup' if options[:set_up_continuous_authority] + xml.tag! :ContAuthTxn, type: 'setup' if options[:set_up_continuous_authority] xml.tag! :CardTxn do xml.tag! :method, type add_credit_card(xml, credit_card, options[:billing_address]) end xml.tag! :TxnDetails do xml.tag! :merchantreference, format_reference_number(options[:order_id]) - xml.tag! :amount, amount(money), :currency => options[:currency] || currency(money) + xml.tag! :amount, amount(money), currency: options[:currency] || currency(money) xml.tag! :capturemethod, 'ecomm' end end end xml.target! @@ -140,35 +140,35 @@ def build_purchase_or_authorization_request_with_continuous_authority_reference_request(type, money, authorization, options) parsed_authorization = parse_authorization_string(authorization) raise ArgumentError, 'The continuous authority reference is required for continuous authority transactions' if parsed_authorization[:ca_reference].blank? - xml = Builder::XmlMarkup.new :indent => 2 + xml = Builder::XmlMarkup.new indent: 2 xml.instruct! - xml.tag! :Request, :version => '2' do + xml.tag! :Request, version: '2' do add_authentication(xml) xml.tag! :Transaction do - xml.tag! :ContAuthTxn, :type => 'historic' + xml.tag! :ContAuthTxn, type: 'historic' xml.tag! :HistoricTxn do xml.tag! :reference, parsed_authorization[:ca_reference] xml.tag! :method, type end xml.tag! :TxnDetails do xml.tag! :merchantreference, format_reference_number(options[:order_id]) - xml.tag! :amount, amount(money), :currency => options[:currency] || currency(money) + xml.tag! :amount, amount(money), currency: options[:currency] || currency(money) xml.tag! :capturemethod, 'cont_auth' end end end xml.target! end def build_transaction_refund_request(money, authorization) parsed_authorization = parse_authorization_string(authorization) - xml = Builder::XmlMarkup.new :indent => 2 + xml = Builder::XmlMarkup.new indent: 2 xml.instruct! - xml.tag! :Request, :version => '2' do + xml.tag! :Request, version: '2' do add_authentication(xml) xml.tag! :Transaction do xml.tag! :HistoricTxn do xml.tag! :reference, parsed_authorization[:reference] xml.tag! :method, TRANSACTION_REFUND_TYPE @@ -183,13 +183,13 @@ end xml.target! end def build_credit_request(money, credit_card, options) - xml = Builder::XmlMarkup.new :indent => 2 + xml = Builder::XmlMarkup.new indent: 2 xml.instruct! - xml.tag! :Request, :version => '2' do + xml.tag! :Request, version: '2' do add_authentication(xml) xml.tag! :Transaction do xml.tag! :CardTxn do xml.tag! :method, REFUND_TYPE add_credit_card(xml, credit_card, options[:billing_address]) @@ -233,38 +233,38 @@ # All of the following elements MUST be present for the # xml to be valid (or can drop the ExtendedPolicy and use # a predefined one xml.tag! :ExtendedPolicy do xml.tag! :cv2_policy, - :notprovided => POLICY_REJECT, - :notchecked => POLICY_REJECT, - :matched => POLICY_ACCEPT, - :notmatched => POLICY_REJECT, - :partialmatch => POLICY_REJECT + notprovided: POLICY_REJECT, + notchecked: POLICY_REJECT, + matched: POLICY_ACCEPT, + notmatched: POLICY_REJECT, + partialmatch: POLICY_REJECT xml.tag! :postcode_policy, - :notprovided => POLICY_ACCEPT, - :notchecked => POLICY_ACCEPT, - :matched => POLICY_ACCEPT, - :notmatched => POLICY_REJECT, - :partialmatch => POLICY_ACCEPT + notprovided: POLICY_ACCEPT, + notchecked: POLICY_ACCEPT, + matched: POLICY_ACCEPT, + notmatched: POLICY_REJECT, + partialmatch: POLICY_ACCEPT xml.tag! :address_policy, - :notprovided => POLICY_ACCEPT, - :notchecked => POLICY_ACCEPT, - :matched => POLICY_ACCEPT, - :notmatched => POLICY_REJECT, - :partialmatch => POLICY_ACCEPT + notprovided: POLICY_ACCEPT, + notchecked: POLICY_ACCEPT, + matched: POLICY_ACCEPT, + notmatched: POLICY_REJECT, + partialmatch: POLICY_ACCEPT end end end end def commit(request) response = parse(ssl_post(test? ? self.test_url : self.live_url, request)) Response.new(response[:status] == '1', response[:reason], response, - :test => test?, - :authorization => "#{response[:datacash_reference]};#{response[:authcode]};#{response[:ca_reference]}" + test: test?, + authorization: "#{response[:datacash_reference]};#{response[:authcode]};#{response[:ca_reference]}" ) end def format_date(month, year) "#{format(month, :two_digits)}/#{format(year, :two_digits)}" @@ -294,10 +294,10 @@ number.to_s.gsub(/[^A-Za-z0-9]/, '').rjust(6, '0').first(30) end def parse_authorization_string(authorization) reference, auth_code, ca_reference = authorization.to_s.split(';') - {:reference => reference, :auth_code => auth_code, :ca_reference => ca_reference} + {reference: reference, auth_code: auth_code, ca_reference: ca_reference} end end end end