Simplify card formatting

This commit is contained in:
Matt-Yorkley
2021-12-03 11:18:36 +00:00
parent 4cdb892c75
commit 2408b7f74e

View File

@@ -7,7 +7,6 @@ module Spree
has_many :payments, as: :source
before_validation :reformat_card_type!
before_save :set_last_digits
attr_accessor :verification_value
@@ -118,8 +117,8 @@ module Spree
private
def reformat_card_type!(type = nil)
self[:cc_type] = active_merchant_card_type(type || cc_type)
def reformat_card_type!(type)
self[:cc_type] = active_merchant_card_type(type)
end
# ActiveMerchant requires certain credit card brand names to be stored in a specific format.