From 93ea15fb46bfc1451edc033bbb077d54693ec35a Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Fri, 1 Nov 2019 10:09:45 -0700 Subject: [PATCH] Add additional per-request configuration documentation (#876) --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index d17983e0..62fbc02e 100644 --- a/README.md +++ b/README.md @@ -110,8 +110,26 @@ Stripe::Charge.retrieve( api_key: "sk_test_...", } ) + +Stripe::Charge.capture( + "ch_18atAXCdGbJFKhCuBAa4532Z", + {}, + { + stripe_version: "2018-02-28", + api_key: "sk_test_...", + } +) ``` +Keep in mind that there are different method signatures depending on the action: +- When operating on a collection (e.g. `.list`, `.create`) the method signature is + `method(params, opts)`. +- When operating on resource (e.g. `.capture`, `.update`) the method signature is + `method(id, params, opts)`. +- One exception is that `retrieve`, despite being an operation on a resource, has the signature + `retrieve(id, opts)`. In addition, it will accept a Hash for the `id` param but will extract the + `id` key out and use the others as options. + ### Accessing a response object Get access to response objects by initializing a client and using its `request`