Skip to content

Instantly share code, notes, and snippets.

@ehongyu
Created January 12, 2017 23:26
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 ehongyu/96dee71e016effcb3488a7e324b1448b to your computer and use it in GitHub Desktop.
Save ehongyu/96dee71e016effcb3488a7e324b1448b to your computer and use it in GitHub Desktop.
Link a recipient card to a managed account
// create a new debit card recipient
$token = \Stripe\Token::create(array(
'card' => $this->debit_card,
));
$recipient = \Stripe\Recipient::create(array(
"name" => $this->name,
"type" => "individual",
'card' => $token->id
));
// Link the debit card to the managed account
$seller = \Stripe\Account::retrieve($account->id);
$seller->external_accounts->create([
'external_account' => $recipient->cards->data[0]->id
]);
$seller->save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment