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