-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from Raistlfiren/accounts
Accounts
- Loading branch information
Showing
26 changed files
with
3,040 additions
and
37 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,36 @@ | ||
# [Accounts](https://github.com/jlinn/stripe-api-php/blob/master/src/Api/Accounts.php) | ||
## Retrieve account data | ||
## Retrieve default account data | ||
```php | ||
$account = $stripe->accounts->getAccount(); | ||
``` | ||
|
||
## Create an account | ||
The `createAccount()` method takes a [`CreateAccountRequest`](https://github.com/jlinn/stripe-api-php/blob/master/src/Request/Accounts/CreateAccountRequest.php) object as its only parameter. This parameter is optional. | ||
```php | ||
$newAccount = new CreateAccountRequest(); | ||
$newAccount->setManaged(true); | ||
$request = $stripe->accounts->createAccount($newAccount); | ||
``` | ||
|
||
## Retrieve a connected account | ||
```php | ||
$customer = $stripe->accounts->getConnectedAccount("account_id"); | ||
``` | ||
|
||
## Update an account | ||
The `UpdateAccount()` method takes an [`UpdateAccountRequest`](https://github.com/jlinn/stripe-api-php/blob/master/src/Request/Accounts/UpdateAccountRequest.php) object as its second parameter. | ||
```php | ||
$newAccount = new UpdateAccountRequest(); | ||
$newAccount->setManaged(false); | ||
$request = $stripe->accounts->updateAccount($accountId, $newAccount); | ||
``` | ||
|
||
## Delete an account | ||
```php | ||
$stripe->accounts->deleteAccount("$accountId"); | ||
``` | ||
|
||
## List accounts | ||
```php | ||
$accounts = $stripe->accounts->listAccounts(); | ||
``` |
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
Oops, something went wrong.