Skip to content

Instantly share code, notes, and snippets.

@adamjstevenson
Last active December 15, 2017 12:58
Show Gist options
  • Save adamjstevenson/67cfe00ad1fd1e22f31a1aa496be81f7 to your computer and use it in GitHub Desktop.
Save adamjstevenson/67cfe00ad1fd1e22f31a1aa496be81f7 to your computer and use it in GitHub Desktop.
Create a subscription on a connected account
# Create a subscription and take a 10% commission
subscription = Stripe::Subscription.create(
{
customer: "cus_BcNDyG0NuHZn4i", # The ID of the customer on the connected account to charge
items: [
{
plan: "29_monthly" # The ID of the plan to which the customer will be subscribed
}
],
application_fee_percent: 10
},
{
stripe_account: "acct_j1cXUEAksEpalsjc3Xl3" # The ID of the Stripe account connected to your platform
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment