Skip to content

Instantly share code, notes, and snippets.

Created March 24, 2017 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/237573620bae416900827db0f3ec11fa to your computer and use it in GitHub Desktop.
Save anonymous/237573620bae416900827db0f3ec11fa to your computer and use it in GitHub Desktop.
Example creating a subscription on a connected account
<?php
$connectedAccount = "acct_XXXXX";
// Create a plan on the connected account
$plan = \Stripe\Plan::create(
array(
"amount" => "10000",
"currency" => "usd",
"id" => "myplan",
"name" => "myplan",
"interval" => "month",
),
array("stripe_account" => $connectedAccount)
);
// Create a customer on the connected account
// and a subscription to the plan
$customer = \Stripe\Customer::create(
array(
"email" => "testing@example.com",
"source" => "tok_XXXXXXXX",
"plan" => $plan->id,
),
array("stripe_account" => $connectedAccount)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment