stripity_stripe v2.5.0 Stripe.API behaviour View Source
Low-level utilities for interacting with the Stripe API.
Usually the utilities in Stripe.Request
are a better way to write custom interactions with
the API.
Link to this section Summary
Functions
In config.exs your implicit or expicit configuration is: config :stripity_stripe,
A low level utility function to make an OAuth request to the Stripe API
A low level utility function to make a direct request to the Stripe API
A low level utility function to make a direct request to the files Stripe API
Link to this section Types
body() View Source
headers() View Source
method()
View Source
method() :: :get | :post | :put | :delete | :patch
method() :: :get | :post | :put | :delete | :patch
Link to this section Functions
json_library()
View Source
json_library() :: module()
json_library() :: module()
In config.exs your implicit or expicit configuration is: config :stripity_stripe,
json_library: Poison # defaults to Jason but can be configured to Poison
oauth_request(method, endpoint, body, api_key \\ nil, opts \\ []) View Source
A low level utility function to make an OAuth request to the Stripe API
request(body, method, endpoint, headers, opts) View Source
A low level utility function to make a direct request to the Stripe API
Setting the api key
request(%{}, :get, "/customers", %{}, api_key: "bogus key")
Setting api version
The api version defaults to 2019-05-16 but a custom version can be passed in as follows:
request(%{}, :get, "/customers", %{}, api_version: "2018-11-04")
Connect Accounts
If you'd like to make a request on behalf of another Stripe account utilizing the Connect program, you can pass the other Stripe account's ID to the request function as follows:
request(%{}, :get, "/customers", %{}, connect_account: "acc_134151")
request_file_upload(body, method, endpoint, headers, opts) View Source
A low level utility function to make a direct request to the files Stripe API