Skip to content

Commit

Permalink
Add a README section for globally configuration an API version
Browse files Browse the repository at this point in the history
I don't remember why I wrote this originally, but found it sitting
locally uncommitted. It seems like a useful example to have in the
README, so add it in.
  • Loading branch information
brandur committed May 4, 2018
1 parent 21b0514 commit 76e6383
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,20 @@ require "stripe"

Stripe::Charge.list(
{},
:api_key => "sk_test_...",
:stripe_account => "acct_..."
{
:api_key => "sk_test_...",
:stripe_account => "acct_...",
:stripe_version => "2018-02-28"
}
)

Stripe::Charge.retrieve(
"ch_18atAXCdGbJFKhCuBAa4532Z",
:api_key => "sk_test_...",
:stripe_account => "acct_..."
{
:api_key => "sk_test_...",
:stripe_account => "acct_...",
:stripe_version => "2018-02-28"
}
)
```

Expand All @@ -108,6 +114,15 @@ end
puts resp.request_id
```

### Configuration an API Version

By default, the library will use the API version pinned to the account making
a request. This can be overridden with this global option:

Stripe.api_version = "2018-02-28"

See [versioning in the API reference][versioning] for more information.

### Configuring CA Bundles

By default, the library will use its own internal bundle of known CA
Expand Down Expand Up @@ -204,6 +219,7 @@ Update the bundled [stripe-mock] by editing the version number found in
[faraday]: https://github.com/lostisland/faraday
[idempotency-keys]: https://stripe.com/docs/api/ruby#idempotent_requests
[stripe-mock]: https://github.com/stripe/stripe-mock
[versioning]: https://stripe.com/docs/api/ruby#versioning

<!--
# vim: set tw=79:
Expand Down

0 comments on commit 76e6383

Please sign in to comment.