Sha256: af1197ce71bc60352c630e9f9619359be0e6fa1c6bca8c2c4ccc55b3e2df2d82
Contents?: true
Size: 680 Bytes
Versions: 5
Compression:
Stored size: 680 Bytes
Contents
module Spree class Recurring < Spree::Base class StripeRecurring < Spree::Recurring module ApiHandler module SubscriptionApiHandler def subscribe(subscription) raise_invalid_object_error(subscription, Spree::Subscription) customer = subscription.user.find_or_create_stripe_customer(subscription.card_token) customer.subscriptions.create(plan: subscription.api_plan_id) end def unsubscribe(subscription) raise_invalid_object_error(subscription, Spree::Subscription) subscription.user.api_customer.cancel_subscription end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems