Created
January 12, 2017 23:26
-
-
Save ehongyu/96dee71e016effcb3488a7e324b1448b to your computer and use it in GitHub Desktop.
Link a recipient card to a managed account
This file contains hidden or 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
// 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