Sha256: a107ebb12206dbf39c5fe1d6cf1192e36f438d7bf2200c386a432563e534d58b
Contents?: true
Size: 380 Bytes
Versions: 10
Compression:
Stored size: 380 Bytes
Contents
Spree::User.class_eval do has_many :subscriptions def find_or_create_stripe_customer(token) return api_customer if stripe_customer_id? customer = Stripe::Customer.create(description: email, email: email, card: token) update_column(:stripe_customer_id, customer.id) customer end def api_customer Stripe::Customer.retrieve(stripe_customer_id) end end
Version data entries
10 entries across 10 versions & 1 rubygems