stripe_plan | R Documentation |
The stripe_plan
object represents the complete set of data required to
manage subscription plans at Stripe. A subscription plan contains the pricing
and billing information to be charged for differen features or products.
With different plans, customers can be charged differently for different
services or levels.
An R6 Class object
create
: Creates a plan on Stripe. Required arguments are:
id
: The id of the plan
name
: Display name of the plan
amount
: The amount of the plan in cents. So a $4.99 plan is 499
currency
: The currency for the amount
interval
: The billing interval for the plan. Should be one of
day, week, month, year
.
retrieve
: Retrieves plan information from Stripe based on the
id
passed to the method.
update
: Updates plan information at Stripe. Using this method
the plan name, statement descriptor, trial days and metadata properties can
be updated.
delete
: Deletes the plan with the provided id at Stripe.
new()
stripe_plan$new(..., metadata = list())
create()
stripe_plan$create( id, amount, currency, interval, nickname, interval_count = NULL, metadata = list(), product = NULL, trial_period_days = NULL )
retrieve()
stripe_plan$retrieve(plan_id)
update()
stripe_plan$update( metadata = NULL, nickname = NULL, product = NULL, trial_period_days = NULL )
delete()
stripe_plan$delete(plan_id)
clone()
The objects of this class are cloneable with this method.
stripe_plan$clone(deep = FALSE)
deep
Whether to make a deep clone.
# Create Test Plan 1 with a monthly charge of $9.99
new_plan <- stripe_plan$new()
new_plan$create(id = "testPlan1", name = "Test Plan 1", amount = 999,
currency = "usd", interval = "month")
# Retrieve and update a plan name
my_plan <- stripe_plan$new()
my_plan$retrieve("testPlan1")
my_plan$update(name = "My Test Plan")
# Delete plan with id "testPlan1".
delete_plan <- stripe_plan$new()
delete_plan$delete("testPlan1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.