diff --git a/app/controllers/spree/credit_cards_controller.rb b/app/controllers/spree/credit_cards_controller.rb index 02e23d750c..b084fc4707 100644 --- a/app/controllers/spree/credit_cards_controller.rb +++ b/app/controllers/spree/credit_cards_controller.rb @@ -1,3 +1,5 @@ +require 'stripe/credit_card_clone_destroyer' + module Spree class CreditCardsController < BaseController def new_from_token diff --git a/lib/stripe/credit_card_clone_destroyer.rb b/lib/stripe/credit_card_clone_destroyer.rb index 9ef68892e0..6fa3db9a88 100644 --- a/lib/stripe/credit_card_clone_destroyer.rb +++ b/lib/stripe/credit_card_clone_destroyer.rb @@ -13,7 +13,7 @@ module Stripe next unless stripe_account = customer.enterprise.stripe_account&.stripe_user_id customer_id, _payment_method_id = - CreditCardCloneFinder.new(card, stripe_account).find_cloned_card + Stripe::CreditCardCloneFinder.new(card, stripe_account).find_cloned_card next unless customer_id customer = Stripe::Customer.retrieve(customer_id, stripe_account: stripe_account) diff --git a/lib/stripe/credit_card_cloner.rb b/lib/stripe/credit_card_cloner.rb index 64180b9ffc..441efbe52a 100644 --- a/lib/stripe/credit_card_cloner.rb +++ b/lib/stripe/credit_card_cloner.rb @@ -15,6 +15,8 @@ # clone it and look for a card with the same fingerprint (hash of the card number) and # that metadata key to avoid cloning it multiple times. +require 'stripe/credit_card_clone_finder' + module Stripe class CreditCardCloner def initialize(card, stripe_account) @@ -23,7 +25,7 @@ module Stripe end def find_or_clone - cloned_card = CreditCardCloneFinder.new(@card, @stripe_account).find_cloned_card + cloned_card = Stripe::CreditCardCloneFinder.new(@card, @stripe_account).find_cloned_card cloned_card || clone end