-
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.
- Loading branch information
Showing
1 changed file
with
15 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,36 +20,29 @@ $stripe = new Stripe("your_api_key"); | |
|
||
#### Customers calls | ||
```php | ||
use Stripe\Request\Customers\CreateCustomerRequest; | ||
use Stripe\Request\Cards\CreateCardRequest; | ||
|
||
// create a customer | ||
$request = new CreateCustomerRequest(); | ||
$request = $stripe->customers->createCustomerRequest(); | ||
$request->setEmail("[email protected]")->setDescription("A customer!"); | ||
$customer = $stripe->customers()->createCustomer($request); | ||
$request->setCard(new CreateCardRequest("4242424242424242", 1, 2020)); | ||
$customer = $stripe->customers->createCustomer($request); | ||
// get the newly-created customer's id | ||
$customerId = $customer->getId(); | ||
|
||
// retrieve a customer | ||
$customer = $stripe->customers()->getCustomer("customer_id"); | ||
``` | ||
|
||
#### Charges calls | ||
```php | ||
// create a charge | ||
$request = $stripe->charges->createChargeRequest(350, "usd")->setCustomer($customer->getId()); | ||
$stripe->charges->createCharge($request); | ||
|
||
// retrieve a charge | ||
$charge = $stripe->charges->getCharge("charge_id"); | ||
``` | ||
|
||
## Development Status | ||
This library is a work in progress. Currently, handling of the following resources has been implemented: | ||
|
||
* accounts | ||
* application fees | ||
* balance | ||
* cards | ||
* charges | ||
* coupons | ||
* customers | ||
* discounts | ||
* disputes | ||
* events | ||
* invoice items | ||
* invoices | ||
* plans | ||
* recipients | ||
* subscriptions | ||
* tokens | ||
* transfers | ||
Currently, all Stripe API calls which do not require [Stripe Connect](https://stripe.com/docs/connect) have been implemented. Documentation and Stripe Connect calls are next on the to-do list. |