lib/active_merchant/billing/gateways/linkpoint.rb in activemerchant-1.43.3 vs lib/active_merchant/billing/gateways/linkpoint.rb in activemerchant-1.44.0

- old
+ new

@@ -164,10 +164,12 @@ # :daily # :threshold Tells how many times to retry the transaction (if it fails) before contacting the merchant. # :comments Uh... comments # def recurring(money, creditcard, options={}) + 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", @@ -237,11 +239,11 @@ ) commit(money, nil, options) end def credit(money, identification, options = {}) - deprecated CREDIT_DEPRECATION_MESSAGE + ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE refund(money, identification, options) end private # Commit the transaction by posting the XML file to the LinkPoint server @@ -275,11 +277,11 @@ for key, value in params elem = order.add_element(key.to_s) if key == :items build_items(elem, value) else - for k, v in params[key] + for k, _ in params[key] elem.add_element(k.to_s).text = params[key][k].to_s if params[key][k] end end # Linkpoint doesn't understand empty elements: order.delete(elem) if elem.size == 0 @@ -424,20 +426,9 @@ xml.root.elements.each do |node| response[node.name.downcase.sub(/^r_/, '').to_sym] = normalize(node.text) end unless xml.root.nil? response - end - - # Make a ruby type out of the response string - def normalize(field) - case field - when "true" then true - when "false" then false - when "" then nil - when "null" then nil - else field - end end def format_creditcard_expiry_year(year) sprintf("%.4i", year)[-2..-1] end