-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix examples in the Readme to match new logic
- Loading branch information
1 parent
165546b
commit 5dc66db
Showing
1 changed file
with
10 additions
and
8 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 |
---|---|---|
|
@@ -50,9 +50,9 @@ Below are a few simple examples: | |
|
||
```go | ||
params := &stripe.CustomerParams{ | ||
Balance: -123, | ||
Desc: "Stripe Developer", | ||
Email: "[email protected]", | ||
Balance: stripe.Int64(-123), | ||
Description: stripe.String("Stripe Developer"), | ||
Email: stripe.String("[email protected]"), | ||
} | ||
params.SetSource("tok_1234") | ||
|
||
|
@@ -62,7 +62,7 @@ customer, err := customer.New(params) | |
### Charges | ||
|
||
```go | ||
params := &stripe.ChargeListParams{Customer: customer.ID} | ||
params := &stripe.ChargeListParams{Customer: stripe.String(customer.ID)} | ||
params.Filters.AddFilter("include[]", "", "total_count") | ||
|
||
// set this so you can easily retry your request in case of a timeout | ||
|
@@ -103,17 +103,19 @@ of a connected account, one that uses the `Stripe-Account` header containing an | |
account's ID, and one that uses the account's keys. Usually the former is the | ||
recommended approach. [See the documentation for more information][connect]. | ||
|
||
To use the `Stripe-Account` approach, pass the `StripeAccount` field to a | ||
`ListParams` or `Params` class. For example: | ||
To use the `Stripe-Account` approach, use `SetStripeAccount()` on a `ListParams` | ||
or `Params` class. For example: | ||
|
||
```go | ||
// For a list request | ||
listParams := &stripe.ChargeListParams{StripeAccount: merchantID} | ||
listParams := &stripe.ChargeListParams{} | ||
listParams.SetStripeAccount("acct_123") | ||
``` | ||
|
||
```go | ||
// For any other kind of request | ||
params := &stripe.CustomerParams{StripeAccount: merchantID} | ||
params := &stripe.CustomerParams{} | ||
params.SetStripeAccount("acct_123") | ||
``` | ||
|
||
To use a key, pass it to `API`'s `Init` function: | ||
|