Module: Spree::UserPaymentSource

Extended by:
ActiveSupport::Concern
Included in:
UserMethods
Defined in:
app/models/concerns/spree/user_payment_source.rb

Instance Method Summary collapse

Instance Method Details

#default_credit_cardObject



9
10
11
# File 'app/models/concerns/spree/user_payment_source.rb', line 9

def default_credit_card
  credit_cards.default.first
end

#drop_payment_source(source) ⇒ Object



17
18
19
20
21
# File 'app/models/concerns/spree/user_payment_source.rb', line 17

def drop_payment_source(source)
  Spree::Deprecation.warn("User#drop_payment_source is deprecated", caller)
  gateway = source.payment_method
  gateway.disable_customer_profile(source)
end

#payment_sourcesObject



13
14
15
# File 'app/models/concerns/spree/user_payment_source.rb', line 13

def payment_sources
  credit_cards.with_payment_profile
end