Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/active_merchant/billing/credit_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ class CreditCard
attr_accessor :track_data

def type
self.class.deprecated "CreditCard#type is deprecated and will be removed from a future release of ActiveMerchant. Please use CreditCard#brand instead."
# self.class.deprecated "CreditCard#type is deprecated and will be removed from a future release of ActiveMerchant. Please use CreditCard#brand instead."
brand
end

def type=(value)
self.class.deprecated "CreditCard#type is deprecated and will be removed from a future release of ActiveMerchant. Please use CreditCard#brand instead."
# self.class.deprecated "CreditCard#type is deprecated and will be removed from a future release of ActiveMerchant. Please use CreditCard#brand instead."
self.brand = value
end

Expand Down Expand Up @@ -240,7 +240,8 @@ def validate_card_number #:nodoc:

def validate_card_brand #:nodoc:
errors.add :brand, "is required" if brand.blank? && number.present?
errors.add :brand, "is invalid" unless brand.blank? || CreditCard.card_companies.keys.include?(brand)
# error.add bra
errors.add :brand, "is invalid" unless brand.blank? || CreditCard.card_companies.include?(brand)
end

alias_method :validate_card_type, :validate_card_brand
Expand Down
Loading