-
-
Save anonymous/237573620bae416900827db0f3ec11fa to your computer and use it in GitHub Desktop.
Example creating a subscription on a connected account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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