Skip to content

Commit

Permalink
Fix examples in the Readme to match new logic
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe committed Jun 6, 2018
1 parent 165546b commit 5dc66db
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5dc66db

Please sign in to comment.