stripity_stripe v2.2.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

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

Link to this section Types

Link to this type body() View Source
body() :: {:multipart, list()} | map()
Link to this type headers() View Source
headers() :: %{optional(String.t()) => String.t()} | %{}
Link to this type method() View Source
method() :: :get | :post | :put | :delete | :patch

Link to this section Functions

Link to this function oauth_request(method, endpoint, body) View Source
oauth_request(method(), String.t(), map()) ::
  {:ok, map()} | {:error, Stripe.Error.t()}

A low level utility function to make an OAuth request to the Stripe API

Link to this function request(body, method, endpoint, headers, opts) View Source
request(body(), method(), String.t(), headers(), list()) ::
  {:ok, map()} | {:error, Stripe.Error.t()}

A low level utility function to make a direct request to the Stripe API

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")
Link to this function request_file_upload(body, method, endpoint, headers, opts) View Source
request_file_upload(body(), method(), String.t(), headers(), list()) ::
  {:ok, map()} | {:error, Stripe.Error.t()}
request_file_upload(body(), method(), String.t(), headers(), list()) ::
  {:ok, map()} | {:error, Stripe.Error.t()}

Link to this section Callbacks

Link to this callback oauth_request(method, arg1, map) View Source
oauth_request(method(), String.t(), map()) :: {:ok, map()}