Packages
stripity_stripe
3.3.2
3.3.2
3.3.1
3.2.0
3.1.1
3.1.0
3.0.0
2.17.3
2.17.2
2.17.1
2.17.0
2.16.0
2.15.1
2.15.0
2.14.1
2.14.0
2.13.0
2.12.1
2.12.0
2.11.0
2.10.0
2.9.0
2.8.0
2.7.2
2.7.1
2.7.0
2.6.0
2.5.0
2.4.0
2.3.0
2.2.3
2.2.2
2.2.1
2.2.0
2.1.0
2.0.1
2.0.0
2.0.0-alpha.11
2.0.0-alpha.10
2.0.0-alpha.9
2.0.0-alpha.8
2.0.0-alpha.7
2.0.0-alpha.6
2.0.0-alpha.5
2.0.0-alpha.4
2.0.0-alpha.3
2.0.0-alpha.2
2.0.0-alpha.1
1.6.2
1.6.1
1.6.0
1.4.0
1.3.0
1.2.0
1.1.0
0.5.0
0.4.0
0.3.0
0.2.0
A Stripe client for Elixir.
Current section
Files
Jump to
Current section
Files
lib/generated/financial_connections__session.ex
defmodule Stripe.FinancialConnections.Session do
use Stripe.Entity
@moduledoc "A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts."
(
defstruct [
:account_holder,
:accounts,
:client_secret,
:filters,
:id,
:livemode,
:object,
:permissions,
:prefetch,
:return_url
]
@typedoc "The `financial_connections.session` type.\n\n * `account_holder` The account holder for whom accounts are collected in this session.\n * `accounts` The accounts that were collected as part of this Session.\n * `client_secret` A value that will be passed to the client to launch the authentication flow.\n * `filters` \n * `id` Unique identifier for the object.\n * `livemode` Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.\n * `object` String representing the object's type. Objects of the same type share the same value.\n * `permissions` Permissions requested for accounts collected during this session.\n * `prefetch` Data features requested to be retrieved upon account creation.\n * `return_url` For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.\n"
@type t :: %__MODULE__{
account_holder: term | nil,
accounts: term,
client_secret: binary | nil,
filters: term,
id: binary,
livemode: boolean,
object: binary,
permissions: term,
prefetch: term | nil,
return_url: binary
}
)
(
@typedoc "The account holder to link accounts for."
@type account_holder :: %{
optional(:account) => binary,
optional(:customer) => binary,
optional(:type) => :account | :customer
}
)
(
@typedoc "Filters to restrict the kinds of accounts to collect."
@type filters :: %{
optional(:account_subcategories) =>
list(:checking | :credit_card | :line_of_credit | :mortgage | :savings),
optional(:countries) => list(binary)
}
)
(
nil
@doc "<p>Retrieves the details of a Financial Connections <code>Session</code></p>\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/financial_connections/sessions/{session}`\n"
(
@spec retrieve(
session :: binary(),
params :: %{optional(:expand) => list(binary)},
opts :: Keyword.t()
) ::
{:ok, Stripe.FinancialConnections.Session.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def retrieve(session, params \\ %{}, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/financial_connections/sessions/{session}",
[
%{
__struct__: OpenApiGen.Blueprint.Parameter,
in: "path",
name: "session",
required: true,
schema: %{
__struct__: OpenApiGen.Blueprint.Parameter.Schema,
any_of: [],
items: [],
name: "session",
properties: [],
title: nil,
type: "string"
}
}
],
[session]
)
Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:get)
|> Stripe.Request.make_request()
end
)
)
(
nil
@doc "<p>To launch the Financial Connections authorization flow, create a <code>Session</code>. The session’s <code>client_secret</code> can be used to launch the flow using Stripe.js.</p>\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/financial_connections/sessions`\n"
(
@spec create(
params :: %{
optional(:account_holder) => account_holder,
optional(:expand) => list(binary),
optional(:filters) => filters,
optional(:permissions) =>
list(:balances | :ownership | :payment_method | :transactions),
optional(:prefetch) => list(:balances | :ownership | :transactions),
optional(:return_url) => binary
},
opts :: Keyword.t()
) ::
{:ok, Stripe.FinancialConnections.Session.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def create(params \\ %{}, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params("/v1/financial_connections/sessions", [], [])
Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:post)
|> Stripe.Request.make_request()
end
)
)
end