lib/active_merchant/billing/gateway.rb in activemerchant-1.79.2 vs lib/active_merchant/billing/gateway.rb in activemerchant-1.80.0
- old
+ new
@@ -56,12 +56,12 @@
include PostsData
include CreditCardFormatting
DEBIT_CARDS = [ :switch, :solo ]
- CREDIT_DEPRECATION_MESSAGE = "Support for using credit to refund existing transactions is deprecated and will be removed from a future release of ActiveMerchant. Please use the refund method instead."
- RECURRING_DEPRECATION_MESSAGE = "Recurring functionality in ActiveMerchant is deprecated and will be removed in a future version. Please contact the ActiveMerchant maintainers if you have an interest in taking ownership of a separate gem that continues support for it."
+ CREDIT_DEPRECATION_MESSAGE = 'Support for using credit to refund existing transactions is deprecated and will be removed from a future release of ActiveMerchant. Please use the refund method instead.'
+ RECURRING_DEPRECATION_MESSAGE = 'Recurring functionality in ActiveMerchant is deprecated and will be removed in a future version. Please contact the ActiveMerchant maintainers if you have an interest in taking ownership of a separate gem that continues support for it.'
# == Standardized Error Codes
#
# :incorrect_number - Card number does not comply with ISO/IEC 7812 numbering standard
# :invalid_number - Card number was not matched by processor
@@ -193,25 +193,25 @@
def supports_scrubbing?
false
end
def scrub(transcript)
- raise RuntimeError.new("This gateway does not support scrubbing.")
+ raise RuntimeError.new('This gateway does not support scrubbing.')
end
def supports_network_tokenization?
false
end
protected # :nodoc: all
def normalize(field)
case field
- when "true" then true
- when "false" then false
- when "" then nil
- when "null" then nil
+ when 'true' then true
+ when 'false' then false
+ when '' then nil
+ when 'null' then nil
else field
end
end
def user_agent
@@ -241,11 +241,11 @@
end
def amount(money)
return nil if money.nil?
cents = if money.respond_to?(:cents)
- ActiveMerchant.deprecated "Support for Money objects is deprecated and will be removed from a future release of ActiveMerchant. Please use an Integer value in cents"
+ ActiveMerchant.deprecated 'Support for Money objects is deprecated and will be removed from a future release of ActiveMerchant. Please use an Integer value in cents'
money.cents
else
money
end
@@ -254,11 +254,11 @@
end
if self.money_format == :cents
cents.to_s
else
- sprintf("%.2f", cents.to_f / 100)
+ sprintf('%.2f', cents.to_f / 100)
end
end
def non_fractional_currency?(currency)
self.currencies_without_fractions.include?(currency.to_s)
@@ -272,19 +272,19 @@
amount = amount(money)
return amount unless non_fractional_currency?(currency) || three_decimal_currency?(currency)
if non_fractional_currency?(currency)
if self.money_format == :cents
- sprintf("%.0f", amount.to_f / 100)
+ sprintf('%.0f', amount.to_f / 100)
else
amount.split('.').first
end
elsif three_decimal_currency?(currency)
if self.money_format == :cents
amount.to_s
else
- sprintf("%.3f", (amount.to_f / 10))
+ sprintf('%.3f', (amount.to_f / 10))
end
end
end
def currency(money)
@@ -295,14 +295,14 @@
return nil unless value
value.to_s[0, max_size]
end
def split_names(full_name)
- names = (full_name || "").split
+ names = (full_name || '').split
return [nil, nil] if names.size == 0
last_name = names.pop
- first_name = names.join(" ")
+ first_name = names.join(' ')
[first_name, last_name]
end
def requires_start_date_or_issue_number?(credit_card)
return false if card_brand(credit_card).blank?