lib/active_merchant/billing/gateway.rb in activemerchant-1.58.0 vs lib/active_merchant/billing/gateway.rb in activemerchant-1.59.0
- old
+ new
@@ -55,11 +55,10 @@
class Gateway
include PostsData
include CreditCardFormatting
DEBIT_CARDS = [ :switch, :solo ]
- CURRENCIES_WITHOUT_FRACTIONS = %w(BIF BYR CLP CVE DJF GNF HUF ISK JPY KMF KRW PYG RWF UGX VND VUV XAF XOF XPF)
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
@@ -118,10 +117,13 @@
# The supported card types for the gateway
class_attribute :supported_cardtypes
self.supported_cardtypes = []
+ class_attribute :currencies_without_fractions
+ self.currencies_without_fractions = %w(BIF BYR CLP CVE DJF GNF HUF ISK JPY KMF KRW PYG RWF UGX VND VUV XAF XOF XPF)
+
class_attribute :homepage_url
class_attribute :display_name
class_attribute :test_url, :live_url
@@ -130,11 +132,11 @@
self.abstract_class = false
# The application making the calls to the gateway
# Useful for things like the PayPal build notation (BN) id fields
class_attribute :application_id, instance_writer: false
- self.application_id = 'ActiveMerchant'
+ self.application_id = nil
attr_reader :options
# Use this method to check if your gateway of interest supports a credit card of some type
def self.supports?(card_type)
@@ -250,10 +252,10 @@
sprintf("%.2f", cents.to_f / 100)
end
end
def non_fractional_currency?(currency)
- CURRENCIES_WITHOUT_FRACTIONS.include?(currency.to_s)
+ self.currencies_without_fractions.include?(currency.to_s)
end
def localized_amount(money, currency)
amount = amount(money)