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

- old
+ new

@@ -136,12 +136,12 @@ def initialize(options = {}) requires!(options, :login) @options = { - :result => 'LIVE', - :pem => LinkpointGateway.pem_file + result: 'LIVE', + pem: LinkpointGateway.pem_file }.update(options) raise ArgumentError, "You need to pass in your pem file using the :pem parameter or set it globally using ActiveMerchant::Billing::LinkpointGateway.pem_file = File.read( File.dirname(__FILE__) + '/../mycert.pem' ) or similar" if @options[:pem].blank? @options[:pem].strip! @@ -170,26 +170,26 @@ ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE requires!(options, [:periodicity, :bimonthly, :monthly, :biweekly, :weekly, :yearly, :daily], :installments, :order_id) options.update( - :ordertype => 'SALE', - :action => options[:action] || 'SUBMIT', - :installments => options[:installments] || 12, - :startdate => options[:startdate] || 'immediate', - :periodicity => options[:periodicity].to_s || 'monthly', - :comments => options[:comments] || nil, - :threshold => options[:threshold] || 3 + ordertype: 'SALE', + action: options[:action] || 'SUBMIT', + installments: options[:installments] || 12, + startdate: options[:startdate] || 'immediate', + periodicity: options[:periodicity].to_s || 'monthly', + comments: options[:comments] || nil, + threshold: options[:threshold] || 3 ) commit(money, creditcard, options) end # Buy the thing def purchase(money, creditcard, options={}) requires!(options, :order_id) options.update( - :ordertype => 'SALE' + ordertype: 'SALE' ) commit(money, creditcard, options) end # @@ -198,11 +198,11 @@ # Reserves the funds on the customer's credit card, but does not charge the card. # def authorize(money, creditcard, options = {}) requires!(options, :order_id) options.update( - :ordertype => 'PREAUTH' + ordertype: 'PREAUTH' ) commit(money, creditcard, options) end # @@ -211,21 +211,21 @@ # Captures the funds from an authorized transaction. # Order_id must be a valid order id from a prior authorized transaction. # def capture(money, authorization, options = {}) options.update( - :order_id => authorization, - :ordertype => 'POSTAUTH' + order_id: authorization, + ordertype: 'POSTAUTH' ) commit(money, nil, options) end # Void a previous transaction def void(identification, options = {}) options.update( - :order_id => identification, - :ordertype => 'VOID' + order_id: identification, + ordertype: 'VOID' ) commit(nil, nil, options) end # @@ -233,12 +233,12 @@ # # identification must be a valid order id previously submitted by SALE # def refund(money, identification, options = {}) options.update( - :ordertype => 'CREDIT', - :order_id => identification + ordertype: 'CREDIT', + order_id: identification ) commit(money, nil, options) end def credit(money, identification, options = {}) @@ -262,14 +262,14 @@ # Commit the transaction by posting the XML file to the LinkPoint server def commit(money, creditcard, options = {}) response = parse(ssl_post(test? ? self.test_url : self.live_url, post_data(money, creditcard, options))) Response.new(successful?(response), response[:message], response, - :test => test?, - :authorization => response[:ordernum], - :avs_result => { :code => response[:avs].to_s[2, 1] }, - :cvv_result => response[:avs].to_s[3, 1] + test: test?, + authorization: response[:ordernum], + avs_result: { code: response[:avs].to_s[2, 1] }, + cvv_result: response[:avs].to_s[3, 1] ) end def successful?(response) response[:approved] == 'APPROVED' @@ -323,59 +323,59 @@ # Set up the parameters hash just once so we don't have to do it # for every action. def parameters(money, creditcard, options = {}) params = { - :payment => { - :subtotal => amount(options[:subtotal]), - :tax => amount(options[:tax]), - :vattax => amount(options[:vattax]), - :shipping => amount(options[:shipping]), - :chargetotal => amount(money) + payment: { + subtotal: amount(options[:subtotal]), + tax: amount(options[:tax]), + vattax: amount(options[:vattax]), + shipping: amount(options[:shipping]), + chargetotal: amount(money) }, - :transactiondetails => { - :transactionorigin => options[:transactionorigin] || 'ECI', - :oid => options[:order_id], - :ponumber => options[:ponumber], - :taxexempt => options[:taxexempt], - :terminaltype => options[:terminaltype], - :ip => options[:ip], - :reference_number => options[:reference_number], - :recurring => options[:recurring] || 'NO', # DO NOT USE if you are using the periodic billing option. - :tdate => options[:tdate] + transactiondetails: { + transactionorigin: options[:transactionorigin] || 'ECI', + oid: options[:order_id], + ponumber: options[:ponumber], + taxexempt: options[:taxexempt], + terminaltype: options[:terminaltype], + ip: options[:ip], + reference_number: options[:reference_number], + recurring: options[:recurring] || 'NO', # DO NOT USE if you are using the periodic billing option. + tdate: options[:tdate] }, - :orderoptions => { - :ordertype => options[:ordertype], - :result => @options[:result] + orderoptions: { + ordertype: options[:ordertype], + result: @options[:result] }, - :periodic => { - :action => options[:action], - :installments => options[:installments], - :threshold => options[:threshold], - :startdate => options[:startdate], - :periodicity => options[:periodicity], - :comments => options[:comments] + periodic: { + action: options[:action], + installments: options[:installments], + threshold: options[:threshold], + startdate: options[:startdate], + periodicity: options[:periodicity], + comments: options[:comments] }, - :telecheck => { - :routing => options[:telecheck_routing], - :account => options[:telecheck_account], - :checknumber => options[:telecheck_checknumber], - :bankname => options[:telecheck_bankname], - :dl => options[:telecheck_dl], - :dlstate => options[:telecheck_dlstate], - :void => options[:telecheck_void], - :accounttype => options[:telecheck_accounttype], - :ssn => options[:telecheck_ssn], + telecheck: { + routing: options[:telecheck_routing], + account: options[:telecheck_account], + checknumber: options[:telecheck_checknumber], + bankname: options[:telecheck_bankname], + dl: options[:telecheck_dl], + dlstate: options[:telecheck_dlstate], + void: options[:telecheck_void], + accounttype: options[:telecheck_accounttype], + ssn: options[:telecheck_ssn], } } if creditcard params[:creditcard] = { - :cardnumber => creditcard.number, - :cardexpmonth => creditcard.month, - :cardexpyear => format_creditcard_expiry_year(creditcard.year), - :track => nil + cardnumber: creditcard.number, + cardexpmonth: creditcard.month, + cardexpyear: format_creditcard_expiry_year(creditcard.year), + track: nil } if creditcard.verification_value? params[:creditcard][:cvmvalue] = creditcard.verification_value params[:creditcard][:cvmindicator] = 'provided' @@ -429,10 +429,10 @@ # <r_score></r_score> # <r_authresponse></r_authresponse> # <r_approved>APPROVED</r_approved> # <r_avs></r_avs> - response = {:message => 'Global Error Receipt', :complete => false} + response = {message: 'Global Error Receipt', complete: false} xml = REXML::Document.new("<response>#{xml}</response>") xml.root&.elements&.each do |node| response[node.name.downcase.sub(/^r_/, '').to_sym] = normalize(node.text) end