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

- old
+ new

@@ -6,13 +6,13 @@ module ActiveMerchant #:nodoc: module Billing #:nodoc: class PayflowGateway < Gateway include PayflowCommonAPI - RECURRING_ACTIONS = Set.new([:add, :modify, :cancel, :inquiry, :reactivate, :payment]) + RECURRING_ACTIONS = Set.new(%i[add modify cancel inquiry reactivate payment]) - self.supported_cardtypes = [:visa, :master, :american_express, :jcb, :discover, :diners_club] + self.supported_cardtypes = %i[visa master american_express jcb discover diners_club] self.homepage_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_payflow-pro-overview-outside' self.display_name = 'PayPal Payflow Pro' def authorize(money, credit_card_or_reference, options = {}) request = build_sale_or_authorization_request(:authorization, money, credit_card_or_reference, options) @@ -316,22 +316,22 @@ xml = Builder::XmlMarkup.new xml.tag! 'RecurringProfiles' do xml.tag! 'RecurringProfile' do xml.tag! action.to_s.capitalize do - unless [:cancel, :inquiry].include?(action) + unless %i[cancel inquiry].include?(action) xml.tag! 'RPData' do xml.tag! 'Name', options[:name] unless options[:name].nil? xml.tag! 'TotalAmt', amount(money), 'Currency' => options[:currency] || currency(money) xml.tag! 'PayPeriod', get_pay_period(options) xml.tag! 'Term', options[:payments] unless options[:payments].nil? xml.tag! 'Comment', options[:comment] unless options[:comment].nil? xml.tag! 'RetryNumDays', options[:retry_num_days] unless options[:retry_num_days].nil? xml.tag! 'MaxFailPayments', options[:max_fail_payments] unless options[:max_fail_payments].nil? if initial_tx = options[:initial_transaction] - requires!(initial_tx, [:type, :authorization, :purchase]) + requires!(initial_tx, %i[type authorization purchase]) requires!(initial_tx, :amount) if initial_tx[:type] == :purchase xml.tag! 'OptionalTrans', TRANSACTIONS[initial_tx[:type]] xml.tag! 'OptionalTransAmt', amount(initial_tx[:amount]) unless initial_tx[:amount].blank? end @@ -360,10 +360,10 @@ end end end def get_pay_period(options) - requires!(options, [:periodicity, :bimonthly, :monthly, :biweekly, :weekly, :yearly, :daily, :semimonthly, :quadweekly, :quarterly, :semiyearly]) + requires!(options, %i[periodicity bimonthly monthly biweekly weekly yearly daily semimonthly quadweekly quarterly semiyearly]) case options[:periodicity] when :weekly then 'Weekly' when :biweekly then 'Bi-weekly' when :semimonthly then 'Semi-monthly' when :quadweekly then 'Every four weeks'