From 2408b7f74e07221309cd21d7e9d5de45751f9cdf Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 3 Dec 2021 11:18:36 +0000 Subject: [PATCH] Simplify card formatting --- app/models/spree/credit_card.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/spree/credit_card.rb b/app/models/spree/credit_card.rb index 9bf584ea46..984ede7796 100644 --- a/app/models/spree/credit_card.rb +++ b/app/models/spree/credit_card.rb @@ -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.