README.md in stripe-10.10.0.pre.beta.1 vs README.md in stripe-10.10.0

- old
+ new

@@ -129,10 +129,28 @@ `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 resource properties + +Both indexer and accessors can be used to retrieve values of resource properties. + +```ruby +customer = Stripe::Customer.retrieve('cus_123456789') +puts customer['id'] +puts customer.id +``` + +NOTE: If the resource property is not defined, the accessors will raise an exception, while the indexer will return `nil`. + +```ruby +customer = Stripe::Customer.retrieve('cus_123456789') +puts customer['unknown'] # nil +puts customer.unknown # raises NoMethodError +``` + ### Accessing a response object Get access to response objects by initializing a client and using its `request` method: @@ -320,20 +338,9 @@ If your beta feature requires a `Stripe-Version` header to be sent, use the `Stripe.api_version` field to set it: ```python Stripe.api_version += "; feature_beta=v3" -``` - -### Custom requests - -If you would like to send a request to an undocumented API (for example you are in a private beta), or if you prefer to bypass the method definitions in the library and specify your request details directly, you can use the `raw_request` method on `Stripe`. - -```ruby -resp = Stripe.raw_request(:post, "/v1/beta_endpoint", {param: 123}, {stripe_version: "2022-11-15; feature_beta=v3"}) - -# (Optional) resp is a StripeResponse. You can use `Stripe.deserialize` to get a StripeObject. -deserialized_resp = Stripe.deserialize(resp.http_body) ``` ## Support New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.