stripe_subscription | R Documentation |
The stripe_subscription
object represents the data and methods needed
to manage customer subscriptions. Subscriptions allow you to charge a
customer's card on a recurring basis. A subscription ties a customer to a
particular plan that was previously created.
An R6 Class object
create
: Creates a subscription for a customer on Stripe.
Required arguments are:
plan_id
: The id of the plan that the customer is subscribing to
customer_id
: The id of the customer that the subscription
should be created for.
retrieve
: Retrieves subscription information from Stripe based
on the id
passed to the method.
update
: Updates subscription information at Stripe. Using this method
the plan name, statement descriptor, trial days and metadata properties can
be updated.
cancel
: Cancels the subscription with the provided id at Stripe.
new()
stripe_subscription$new(..., plan = NULL, metadata = list())
create()
stripe_subscription$create( plan_id, customer_id, card_token = NULL, exp_month = NULL, exp_year = NULL, number = NULL, cvc = NULL, name = NULL, address_city = NULL, address_country = NULL, address_line1 = NULL, address_line2 = NULL, address_state = NULL, address_zip = NULL, currency = NULL, default_for_currency = NULL, card_metadata = list(), coupon = NULL, items = list(), application_fee_percent = NULL, quantity = NULL, tax_percent = NULL, trial_end = NULL, trial_period_days = NULL )
retrieve()
stripe_subscription$retrieve(sub_id)
update()
stripe_subscription$update( plan = NULL, cancel_at_period_end = NULL, coupon = NULL, items = list(), prorate = NULL, proration_date = NULL, source = NULL, application_fee_percent = NULL, metadata = list(), tax_percent = NULL, trial_end = NULL )
cancelSub()
stripe_subscription$cancelSub()
clone()
The objects of this class are cloneable with this method.
stripe_subscription$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.