Sha256: d42e95628773764247cd70ed5f254af4186edb7bb3db9a70a14d40fe6baba8cb
Contents?: true
Size: 547 Bytes
Versions: 12
Compression:
Stored size: 547 Bytes
Contents
module Spree module UserPaymentSource extend ActiveSupport::Concern included do has_many :credit_cards, class_name: "Spree::CreditCard", foreign_key: :user_id end def default_credit_card credit_cards.default.first end def payment_sources credit_cards.with_payment_profile end 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 end end
Version data entries
12 entries across 12 versions & 1 rubygems