diff --git a/.latest-tag-stripe-openapi-sdk b/.latest-tag-stripe-openapi-sdk index d1b8380a..e77952bc 100644 --- a/.latest-tag-stripe-openapi-sdk +++ b/.latest-tag-stripe-openapi-sdk @@ -1 +1 @@ -v755 +v756 diff --git a/Makefile b/Makefile index d1d1711d..86ca8633 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,13 @@ gen-changelog: npx auto-changelog --unreleased run-all: - @$(eval LATEST_TAG=$(shell curl -s https://api.github.com/repos/stripe/openapi/releases/latest | jq -r '.tag_name')) + # @$(eval LATEST_TAG=$(shell curl -s https://api.github.com/repos/stripe/openapi/releases/latest | jq -r '.tag_name')) + @$(eval LATEST_TAG="v756") @echo "Latest tag: $(LATEST_TAG)" @echo "Downloading https://raw.githubusercontent.com/stripe/openapi/$(LATEST_TAG)/openapi/spec3.sdk.json to ./priv/openapi/spec3.sdk.json" @curl -o ./priv/openapi/spec3.sdk.json https://raw.githubusercontent.com/stripe/openapi/$(LATEST_TAG)/openapi/spec3.sdk.json + @echo "${LATEST_TAG}" > .latest-tag-stripe-openapi-sdk mix stripe.generate mix format SKIP_STRIPE_MOCK_RUN=true mix test + mix docs diff --git a/lib/generated/account.ex b/lib/generated/account.ex index 7fc5bbda..db3a0867 100644 --- a/lib/generated/account.ex +++ b/lib/generated/account.ex @@ -66,7 +66,7 @@ defmodule Stripe.Account do ) ( - @typedoc "The company's primary address." + @typedoc "The individual's primary address." @type address :: %{ optional(:city) => binary, optional(:country) => binary, @@ -91,7 +91,7 @@ defmodule Stripe.Account do ) ( - @typedoc "The Kanji variation of the company's primary address (Japan only)." + @typedoc "The Kanji variation of the the individual's primary address (Japan only)." @type address_kanji :: %{ optional(:city) => binary, optional(:country) => binary, @@ -119,7 +119,7 @@ defmodule Stripe.Account do ) ( - @typedoc "Settings specific to Bacs Direct Debit payments." + @typedoc "Settings specific to Bacs Direct Debit." @type bacs_debit_payments :: %{optional(:display_name) => binary} ) @@ -217,18 +217,13 @@ defmodule Stripe.Account do ) ( - @typedoc "Settings specific to the account's use of the Card Issuing product." - @type card_issuing :: %{optional(:tos_acceptance) => tos_acceptance} + @typedoc "The card_issuing capability." + @type card_issuing :: %{optional(:requested) => boolean} ) ( - @typedoc "Settings specific to card charging on the account." - @type card_payments :: %{ - optional(:decline_on) => decline_on, - optional(:statement_descriptor_prefix) => binary, - optional(:statement_descriptor_prefix_kana) => binary | binary, - optional(:statement_descriptor_prefix_kanji) => binary | binary - } + @typedoc "The card_payments capability." + @type card_payments :: %{optional(:requested) => boolean} ) ( @@ -338,7 +333,7 @@ defmodule Stripe.Account do ) ( - @typedoc "An identifying document, either a passport or local ID card." + @typedoc "A document verifying the business." @type document :: %{optional(:back) => binary, optional(:front) => binary} ) @@ -583,11 +578,12 @@ defmodule Stripe.Account do ) ( - @typedoc "Details on the account's acceptance of the Stripe Treasury Services Agreement." + @typedoc "Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance)." @type tos_acceptance :: %{ optional(:date) => integer, optional(:ip) => binary, - optional(:user_agent) => binary | binary + optional(:service_agreement) => binary, + optional(:user_agent) => binary } ) @@ -619,49 +615,11 @@ defmodule Stripe.Account do ( nil - @doc "
Retrieves the details of an account.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/account`\n" - ( - @spec retrieve(params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t()) :: - {:ok, Stripe.Account.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/account", [], []) - - 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 "Updates a connected account by setting the values of the parameters passed. Any parameters not provided are\nleft unchanged.
\n\nFor Custom accounts, you can update any information on the account. For other accounts, you can update all information until that\naccount has started to go through Connect Onboarding. Once you create an Account Link\nfor a Standard or Express account, some parameters can no longer be changed. These are marked as Custom Only or Custom and Express\nbelow.
\n\nTo update your own account, use the Dashboard. Refer to our\nConnect documentation to learn more about updating accounts.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/accounts/{account}`\n" + @doc "With Connect, you can delete accounts you manage.
\n\nAccounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
\n\nIf you want to delete your own account, use the account information tab in your account settings instead.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/accounts/{account}`\n" ( - @spec update( - account :: binary(), - params :: %{ - optional(:account_token) => binary, - optional(:business_profile) => business_profile, - optional(:business_type) => - :company | :government_entity | :individual | :non_profit, - optional(:capabilities) => capabilities, - optional(:company) => company, - optional(:default_currency) => binary, - optional(:documents) => documents, - optional(:email) => binary, - optional(:expand) => list(binary), - optional(:external_account) => binary, - optional(:individual) => individual, - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:settings) => settings, - optional(:tos_acceptance) => tos_acceptance - }, - opts :: Keyword.t() - ) :: {:ok, Stripe.Account.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(account, params \\ %{}, opts \\ []) do + @spec delete(account :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedAccount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def delete(account, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/accounts/{account}", @@ -685,8 +643,7 @@ defmodule Stripe.Account do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -695,23 +652,12 @@ defmodule Stripe.Account do ( nil - @doc "Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is empty.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/accounts`\n" + @doc "Retrieves the details of an account.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/account`\n" ( - @spec list( - params :: %{ - optional(:created) => created | integer, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Account.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/accounts", [], []) + @spec retrieve(params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t()) :: + {:ok, Stripe.Account.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def retrieve(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/account", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -725,37 +671,28 @@ defmodule Stripe.Account do ( nil - @doc "With Connect, you can create Stripe accounts for your users.\nTo do this, you’ll first need to register your platform.
\n\nIf you’ve already collected information for your connected accounts, you can prefill that information when\ncreating the account. Connect Onboarding won’t ask for the prefilled information during account onboarding.\nYou can prefill any information on the account.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/accounts`\n" + @doc "Returns a list of accounts connected to your platform via Connect. If you’re not a platform, the list is empty.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/accounts`\n" ( - @spec create( + @spec list( params :: %{ - optional(:account_token) => binary, - optional(:business_profile) => business_profile, - optional(:business_type) => - :company | :government_entity | :individual | :non_profit, - optional(:capabilities) => capabilities, - optional(:company) => company, - optional(:country) => binary, - optional(:default_currency) => binary, - optional(:documents) => documents, - optional(:email) => binary, + optional(:created) => created | integer, + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:external_account) => binary, - optional(:individual) => individual, - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:settings) => settings, - optional(:tos_acceptance) => tos_acceptance, - optional(:type) => :custom | :express | :standard + optional(:limit) => integer, + optional(:starting_after) => binary }, opts :: Keyword.t() - ) :: {:ok, Stripe.Account.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + ) :: + {:ok, Stripe.List.t(Stripe.Account.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/accounts", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -764,14 +701,20 @@ defmodule Stripe.Account do ( nil - @doc "With Connect, you can delete accounts you manage.
\n\nAccounts created using test-mode keys can be deleted at any time. Standard accounts created using live-mode keys cannot be deleted. Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero.
\n\nIf you want to delete your own account, use the account information tab in your account settings instead.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/accounts/{account}`\n" + @doc "Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/accounts/{account}/capabilities`\n" ( - @spec delete(account :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedAccount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(account, opts \\ []) do + @spec capabilities( + account :: binary(), + params :: %{optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Capability.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def capabilities(account, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/accounts/{account}", + "/v1/accounts/{account}/capabilities", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -792,7 +735,8 @@ defmodule Stripe.Account do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -801,17 +745,26 @@ defmodule Stripe.Account do ( nil - @doc "With Connect, you may flag accounts as suspicious.
\n\nTest-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/accounts/{account}/reject`\n" + @doc "Returns a list of people associated with the account’s legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/accounts/{account}/persons`\n" ( - @spec reject( + @spec persons( account :: binary(), - params :: %{optional(:expand) => list(binary), optional(:reason) => binary}, + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:relationship) => relationship, + optional(:starting_after) => binary + }, opts :: Keyword.t() - ) :: {:ok, Stripe.Account.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def reject(account, params \\ %{}, opts \\ []) do + ) :: + {:ok, Stripe.List.t(Stripe.Person.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def persons(account, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/accounts/{account}/reject", + "/v1/accounts/{account}/persons", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -830,6 +783,45 @@ defmodule Stripe.Account do [account] ) + 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 "With Connect, you can create Stripe accounts for your users.\nTo do this, you’ll first need to register your platform.
\n\nIf you’ve already collected information for your connected accounts, you can prefill that information when\ncreating the account. Connect Onboarding won’t ask for the prefilled information during account onboarding.\nYou can prefill any information on the account.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/accounts`\n" + ( + @spec create( + params :: %{ + optional(:account_token) => binary, + optional(:business_profile) => business_profile, + optional(:business_type) => + :company | :government_entity | :individual | :non_profit, + optional(:capabilities) => capabilities, + optional(:company) => company, + optional(:country) => binary, + optional(:default_currency) => binary, + optional(:documents) => documents, + optional(:email) => binary, + optional(:expand) => list(binary), + optional(:external_account) => binary, + optional(:individual) => individual, + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:settings) => settings, + optional(:tos_acceptance) => tos_acceptance, + optional(:type) => :custom | :express | :standard + }, + opts :: Keyword.t() + ) :: {:ok, Stripe.Account.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/accounts", [], []) + Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) @@ -842,26 +834,33 @@ defmodule Stripe.Account do ( nil - @doc "Returns a list of people associated with the account’s legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/accounts/{account}/persons`\n" + @doc "Updates a connected account by setting the values of the parameters passed. Any parameters not provided are\nleft unchanged.
\n\nFor Custom accounts, you can update any information on the account. For other accounts, you can update all information until that\naccount has started to go through Connect Onboarding. Once you create an Account Link\nfor a Standard or Express account, some parameters can no longer be changed. These are marked as Custom Only or Custom and Express\nbelow.
\n\nTo update your own account, use the Dashboard. Refer to our\nConnect documentation to learn more about updating accounts.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/accounts/{account}`\n" ( - @spec persons( + @spec update( account :: binary(), params :: %{ - optional(:ending_before) => binary, + optional(:account_token) => binary, + optional(:business_profile) => business_profile, + optional(:business_type) => + :company | :government_entity | :individual | :non_profit, + optional(:capabilities) => capabilities, + optional(:company) => company, + optional(:default_currency) => binary, + optional(:documents) => documents, + optional(:email) => binary, optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:relationship) => relationship, - optional(:starting_after) => binary + optional(:external_account) => binary, + optional(:individual) => individual, + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:settings) => settings, + optional(:tos_acceptance) => tos_acceptance }, opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Person.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def persons(account, params \\ %{}, opts \\ []) do + ) :: {:ok, Stripe.Account.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def update(account, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/accounts/{account}/persons", + "/v1/accounts/{account}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -883,7 +882,7 @@ defmodule Stripe.Account do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) @@ -892,20 +891,17 @@ defmodule Stripe.Account do ( nil - @doc "Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/accounts/{account}/capabilities`\n" + @doc "With Connect, you may flag accounts as suspicious.
\n\nTest-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/accounts/{account}/reject`\n" ( - @spec capabilities( + @spec reject( account :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{optional(:expand) => list(binary), optional(:reason) => binary}, opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Capability.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def capabilities(account, params \\ %{}, opts \\ []) do + ) :: {:ok, Stripe.Account.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def reject(account, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/accounts/{account}/capabilities", + "/v1/accounts/{account}/reject", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -927,7 +923,7 @@ defmodule Stripe.Account do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/apple_pay_domain.ex b/lib/generated/apple_pay_domain.ex index e29d72be..6fb38bd3 100644 --- a/lib/generated/apple_pay_domain.ex +++ b/lib/generated/apple_pay_domain.ex @@ -17,28 +17,37 @@ defmodule Stripe.ApplePayDomain do ( nil - @doc "List apple pay domains.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/apple_pay/domains`\n" + @doc "Delete an apple pay domain.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/apple_pay/domains/{domain}`\n" ( - @spec list( - params :: %{ - optional(:domain_name) => binary, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.ApplePayDomain.t())} + @spec delete(domain :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedApplePayDomain.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/apple_pay/domains", [], []) + def delete(domain, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/apple_pay/domains/{domain}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "domain", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "domain", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [domain] + ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -47,20 +56,28 @@ defmodule Stripe.ApplePayDomain do ( nil - @doc "Create an apple pay domain.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/apple_pay/domains`\n" + @doc "List apple pay domains.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/apple_pay/domains`\n" ( - @spec create( - params :: %{optional(:domain_name) => binary, optional(:expand) => list(binary)}, + @spec list( + params :: %{ + optional(:domain_name) => binary, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, opts :: Keyword.t() ) :: - {:ok, Stripe.ApplePayDomain.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + {:ok, Stripe.List.t(Stripe.ApplePayDomain.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/apple_pay/domains", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -111,37 +128,20 @@ defmodule Stripe.ApplePayDomain do ( nil - @doc "Delete an apple pay domain.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/apple_pay/domains/{domain}`\n" + @doc "Create an apple pay domain.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/apple_pay/domains`\n" ( - @spec delete(domain :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedApplePayDomain.t()} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def delete(domain, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/apple_pay/domains/{domain}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "domain", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "domain", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [domain] - ) + @spec create( + params :: %{optional(:domain_name) => binary, optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: + {:ok, Stripe.ApplePayDomain.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/apple_pay/domains", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/apps__secret.ex b/lib/generated/apps__secret.ex index e320c479..77865434 100644 --- a/lib/generated/apps__secret.ex +++ b/lib/generated/apps__secret.ex @@ -24,6 +24,36 @@ defmodule Stripe.Apps.Secret do @type scope :: %{optional(:type) => :account | :user, optional(:user) => binary} ) + ( + nil + + @doc "List all secrets stored on the given scope.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/apps/secrets`\n" + ( + @spec list( + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:scope) => scope, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Apps.Secret.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/apps/secrets", [], []) + + 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 @@ -100,34 +130,4 @@ defmodule Stripe.Apps.Secret do end ) ) - - ( - nil - - @doc "List all secrets stored on the given scope.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/apps/secrets`\n" - ( - @spec list( - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:scope) => scope, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Apps.Secret.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/apps/secrets", [], []) - - 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 - ) - ) end diff --git a/lib/generated/bank_account.ex b/lib/generated/bank_account.ex index 37950064..669884a0 100644 --- a/lib/generated/bank_account.ex +++ b/lib/generated/bank_account.ex @@ -50,67 +50,37 @@ defmodule Stripe.BankAccount do ) ( - @typedoc "Owner's address." - @type address :: %{ - optional(:city) => binary, - optional(:country) => binary, - optional(:line1) => binary, - optional(:line2) => binary, - optional(:postal_code) => binary, - optional(:state) => binary - } + @typedoc "One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check." + @type bank_account_ownership_verification :: %{optional(:files) => list(binary)} ) ( - @typedoc nil - @type owner :: %{ - optional(:address) => address, - optional(:email) => binary, - optional(:name) => binary, - optional(:phone) => binary + @typedoc "Documents that may be submitted to satisfy various informational requests." + @type documents :: %{ + optional(:bank_account_ownership_verification) => bank_account_ownership_verification } ) ( nil - @doc "Update a specified source for a given customer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/customers/{customer}/sources/{id}`\n" + @doc "Delete a specified external account for a given account.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/accounts/{account}/external_accounts/{id}`\n" ( - @spec update( - customer :: binary(), - id :: binary(), - params :: %{ - optional(:account_holder_name) => binary, - optional(:account_holder_type) => :company | :individual, - optional(:address_city) => binary, - optional(:address_country) => binary, - optional(:address_line1) => binary, - optional(:address_line2) => binary, - optional(:address_state) => binary, - optional(:address_zip) => binary, - optional(:exp_month) => binary, - optional(:exp_year) => binary, - optional(:expand) => list(binary), - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:name) => binary, - optional(:owner) => owner - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.Card.t() | Stripe.BankAccount.t() | Stripe.Source.t()} + @spec delete(account :: binary(), id :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedExternalAccount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(customer, id, params \\ %{}, opts \\ []) do + def delete(account, id, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}/sources/{id}", + "/v1/accounts/{account}/external_accounts/{id}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", - name: "customer", + name: "account", required: true, schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "customer", + name: "account", title: nil, type: "string", items: [], @@ -132,13 +102,12 @@ defmodule Stripe.BankAccount do } } ], - [customer, id] + [account, id] ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -147,28 +116,45 @@ defmodule Stripe.BankAccount do ( nil - @doc "Delete a specified source for a given customer.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/customers/{customer}/sources/{id}`\n" + @doc "Updates the metadata, account holder name, account holder type of a bank account belonging to a Custom account, and optionally sets it as the default for its currency. Other bank account details are not editable by design.
\n\nYou can re-enable a disabled bank account by performing an update call without providing any arguments or changes.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/accounts/{account}/external_accounts/{id}`\n" ( - @spec delete( - customer :: binary(), + @spec update( + account :: binary(), id :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:account_holder_name) => binary, + optional(:account_holder_type) => :company | :individual, + optional(:account_type) => :checking | :futsu | :savings | :toza, + optional(:address_city) => binary, + optional(:address_country) => binary, + optional(:address_line1) => binary, + optional(:address_line2) => binary, + optional(:address_state) => binary, + optional(:address_zip) => binary, + optional(:default_for_currency) => boolean, + optional(:documents) => documents, + optional(:exp_month) => binary, + optional(:exp_year) => binary, + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:name) => binary + }, opts :: Keyword.t() ) :: - {:ok, Stripe.PaymentSource.t() | Stripe.DeletedPaymentSource.t()} + {:ok, Stripe.ExternalAccount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(customer, id, params \\ %{}, opts \\ []) do + def update(account, id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}/sources/{id}", + "/v1/accounts/{account}/external_accounts/{id}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", - name: "customer", + name: "account", required: true, schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "customer", + name: "account", title: nil, type: "string", items: [], @@ -190,13 +176,13 @@ defmodule Stripe.BankAccount do } } ], - [customer, id] + [account, id] ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/billing_portal__configuration.ex b/lib/generated/billing_portal__configuration.ex index 161dc016..56340704 100644 --- a/lib/generated/billing_portal__configuration.ex +++ b/lib/generated/billing_portal__configuration.ex @@ -167,30 +167,42 @@ defmodule Stripe.BillingPortal.Configuration do ( nil - @doc "Creates a configuration that describes the functionality and behavior of a PortalSession
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/billing_portal/configurations`\n" + @doc "Retrieves a configuration that describes the functionality of the customer portal.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/billing_portal/configurations/{configuration}`\n" ( - @spec create( - params :: %{ - optional(:business_profile) => business_profile, - optional(:default_return_url) => binary | binary, - optional(:expand) => list(binary), - optional(:features) => features, - optional(:login_page) => login_page, - optional(:metadata) => %{optional(binary) => binary} - }, + @spec retrieve( + configuration :: binary(), + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: {:ok, Stripe.BillingPortal.Configuration.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + def retrieve(configuration, params \\ %{}, opts \\ []) do path = - Stripe.OpenApi.Path.replace_path_params("/v1/billing_portal/configurations", [], []) + Stripe.OpenApi.Path.replace_path_params( + "/v1/billing_portal/configurations/{configuration}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "configuration", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "configuration", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [configuration] + ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -199,45 +211,25 @@ defmodule Stripe.BillingPortal.Configuration do ( nil - @doc "Updates a configuration that describes the functionality of the customer portal.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/billing_portal/configurations/{configuration}`\n" + @doc "Creates a configuration that describes the functionality and behavior of a PortalSession
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/billing_portal/configurations`\n" ( - @spec update( - configuration :: binary(), + @spec create( params :: %{ - optional(:active) => boolean, optional(:business_profile) => business_profile, optional(:default_return_url) => binary | binary, optional(:expand) => list(binary), optional(:features) => features, optional(:login_page) => login_page, - optional(:metadata) => %{optional(binary) => binary} | binary + optional(:metadata) => %{optional(binary) => binary} }, opts :: Keyword.t() ) :: {:ok, Stripe.BillingPortal.Configuration.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(configuration, params \\ %{}, opts \\ []) do + def create(params \\ %{}, opts \\ []) do path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/billing_portal/configurations/{configuration}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "configuration", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "configuration", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [configuration] - ) + Stripe.OpenApi.Path.replace_path_params("/v1/billing_portal/configurations", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -251,17 +243,25 @@ defmodule Stripe.BillingPortal.Configuration do ( nil - @doc "Retrieves a configuration that describes the functionality of the customer portal.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/billing_portal/configurations/{configuration}`\n" + @doc "Updates a configuration that describes the functionality of the customer portal.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/billing_portal/configurations/{configuration}`\n" ( - @spec retrieve( + @spec update( configuration :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:active) => boolean, + optional(:business_profile) => business_profile, + optional(:default_return_url) => binary | binary, + optional(:expand) => list(binary), + optional(:features) => features, + optional(:login_page) => login_page, + optional(:metadata) => %{optional(binary) => binary} | binary + }, opts :: Keyword.t() ) :: {:ok, Stripe.BillingPortal.Configuration.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(configuration, params \\ %{}, opts \\ []) do + def update(configuration, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/billing_portal/configurations/{configuration}", @@ -286,7 +286,7 @@ defmodule Stripe.BillingPortal.Configuration do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/card.ex b/lib/generated/card.ex index 39d69b32..74b37677 100644 --- a/lib/generated/card.ex +++ b/lib/generated/card.ex @@ -74,67 +74,37 @@ defmodule Stripe.Card do ) ( - @typedoc "Owner's address." - @type address :: %{ - optional(:city) => binary, - optional(:country) => binary, - optional(:line1) => binary, - optional(:line2) => binary, - optional(:postal_code) => binary, - optional(:state) => binary - } + @typedoc "One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check." + @type bank_account_ownership_verification :: %{optional(:files) => list(binary)} ) ( - @typedoc nil - @type owner :: %{ - optional(:address) => address, - optional(:email) => binary, - optional(:name) => binary, - optional(:phone) => binary + @typedoc "Documents that may be submitted to satisfy various informational requests." + @type documents :: %{ + optional(:bank_account_ownership_verification) => bank_account_ownership_verification } ) ( nil - @doc "Update a specified source for a given customer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/customers/{customer}/sources/{id}`\n" + @doc "Delete a specified external account for a given account.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/accounts/{account}/external_accounts/{id}`\n" ( - @spec update( - customer :: binary(), - id :: binary(), - params :: %{ - optional(:account_holder_name) => binary, - optional(:account_holder_type) => :company | :individual, - optional(:address_city) => binary, - optional(:address_country) => binary, - optional(:address_line1) => binary, - optional(:address_line2) => binary, - optional(:address_state) => binary, - optional(:address_zip) => binary, - optional(:exp_month) => binary, - optional(:exp_year) => binary, - optional(:expand) => list(binary), - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:name) => binary, - optional(:owner) => owner - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.Card.t() | Stripe.BankAccount.t() | Stripe.Source.t()} + @spec delete(account :: binary(), id :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedExternalAccount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(customer, id, params \\ %{}, opts \\ []) do + def delete(account, id, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}/sources/{id}", + "/v1/accounts/{account}/external_accounts/{id}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", - name: "customer", + name: "account", required: true, schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "customer", + name: "account", title: nil, type: "string", items: [], @@ -156,13 +126,12 @@ defmodule Stripe.Card do } } ], - [customer, id] + [account, id] ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -171,28 +140,45 @@ defmodule Stripe.Card do ( nil - @doc "Delete a specified source for a given customer.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/customers/{customer}/sources/{id}`\n" + @doc "Updates the metadata, account holder name, account holder type of a bank account belonging to a Custom account, and optionally sets it as the default for its currency. Other bank account details are not editable by design.
\n\nYou can re-enable a disabled bank account by performing an update call without providing any arguments or changes.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/accounts/{account}/external_accounts/{id}`\n" ( - @spec delete( - customer :: binary(), + @spec update( + account :: binary(), id :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:account_holder_name) => binary, + optional(:account_holder_type) => :company | :individual, + optional(:account_type) => :checking | :futsu | :savings | :toza, + optional(:address_city) => binary, + optional(:address_country) => binary, + optional(:address_line1) => binary, + optional(:address_line2) => binary, + optional(:address_state) => binary, + optional(:address_zip) => binary, + optional(:default_for_currency) => boolean, + optional(:documents) => documents, + optional(:exp_month) => binary, + optional(:exp_year) => binary, + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:name) => binary + }, opts :: Keyword.t() ) :: - {:ok, Stripe.PaymentSource.t() | Stripe.DeletedPaymentSource.t()} + {:ok, Stripe.ExternalAccount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(customer, id, params \\ %{}, opts \\ []) do + def update(account, id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}/sources/{id}", + "/v1/accounts/{account}/external_accounts/{id}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", - name: "customer", + name: "account", required: true, schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "customer", + name: "account", title: nil, type: "string", items: [], @@ -214,13 +200,13 @@ defmodule Stripe.Card do } } ], - [customer, id] + [account, id] ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/charge.ex b/lib/generated/charge.ex index aad5a87c..5b8bf810 100644 --- a/lib/generated/charge.ex +++ b/lib/generated/charge.ex @@ -163,22 +163,26 @@ defmodule Stripe.Charge do ( nil - @doc "Search for charges you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/charges/search`\n" + @doc "Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/charges`\n" ( - @spec search( + @spec list( params :: %{ + optional(:created) => created | integer, + optional(:customer) => binary, + optional(:ending_before) => binary, optional(:expand) => list(binary), optional(:limit) => integer, - optional(:page) => binary, - optional(:query) => binary + optional(:payment_intent) => binary, + optional(:starting_after) => binary, + optional(:transfer_group) => binary }, opts :: Keyword.t() ) :: - {:ok, Stripe.SearchResult.t(Stripe.Charge.t())} + {:ok, Stripe.List.t(Stripe.Charge.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def search(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/charges/search", [], []) + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/charges", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -192,26 +196,63 @@ defmodule Stripe.Charge do ( nil - @doc "Returns a list of charges you’ve previously created. The charges are returned in sorted order, with the most recent charges appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/charges`\n" + @doc "Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/charges/{charge}`\n" ( - @spec list( + @spec retrieve( + charge :: binary(), + params :: %{optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: {:ok, Stripe.Charge.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def retrieve(charge, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/charges/{charge}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "charge", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "charge", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [charge] + ) + + 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 "Search for charges you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/charges/search`\n" + ( + @spec search( params :: %{ - optional(:created) => created | integer, - optional(:customer) => binary, - optional(:ending_before) => binary, optional(:expand) => list(binary), optional(:limit) => integer, - optional(:payment_intent) => binary, - optional(:starting_after) => binary, - optional(:transfer_group) => binary + optional(:page) => binary, + optional(:query) => binary }, opts :: Keyword.t() ) :: - {:ok, Stripe.List.t(Stripe.Charge.t())} + {:ok, Stripe.SearchResult.t(Stripe.Charge.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/charges", [], []) + def search(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/charges/search", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -263,47 +304,6 @@ defmodule Stripe.Charge do ) ) - ( - nil - - @doc "Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/charges/{charge}`\n" - ( - @spec retrieve( - charge :: binary(), - params :: %{optional(:expand) => list(binary)}, - opts :: Keyword.t() - ) :: {:ok, Stripe.Charge.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(charge, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/charges/{charge}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "charge", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "charge", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [charge] - ) - - 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 diff --git a/lib/generated/checkout__session.ex b/lib/generated/checkout__session.ex index 6f93cc82..16ec3ea3 100644 --- a/lib/generated/checkout__session.ex +++ b/lib/generated/checkout__session.ex @@ -970,8 +970,11 @@ defmodule Stripe.Checkout.Session do ) ( - @typedoc "The parameters used to automatically create a Transfer when the payment succeeds.\nFor more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts)." - @type transfer_data :: %{optional(:amount) => integer, optional(:destination) => binary} + @typedoc "If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges." + @type transfer_data :: %{ + optional(:amount_percent) => number, + optional(:destination) => binary + } ) ( @@ -1077,6 +1080,55 @@ defmodule Stripe.Checkout.Session do ) ) + ( + nil + + @doc "When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/checkout/sessions/{session}/line_items`\n" + ( + @spec list_line_items( + session :: binary(), + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Item.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list_line_items(session, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/checkout/sessions/{session}/line_items", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "session", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "session", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [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 @@ -1215,55 +1267,6 @@ defmodule Stripe.Checkout.Session do ) ) - ( - nil - - @doc "When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/checkout/sessions/{session}/line_items`\n" - ( - @spec list_line_items( - session :: binary(), - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Item.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list_line_items(session, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/checkout/sessions/{session}/line_items", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "session", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "session", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [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 diff --git a/lib/generated/climate__order.ex b/lib/generated/climate__order.ex index 290696aa..8497842a 100644 --- a/lib/generated/climate__order.ex +++ b/lib/generated/climate__order.ex @@ -60,6 +60,35 @@ defmodule Stripe.Climate.Order do @type beneficiary :: %{optional(:public_name) => binary} ) + ( + nil + + @doc "Lists all Climate order objects. The orders are returned sorted by creation date, with the\nmost recently created orders appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/climate/orders`\n" + ( + @spec list( + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Climate.Order.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/climate/orders", [], []) + + 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 @@ -102,35 +131,6 @@ defmodule Stripe.Climate.Order do ) ) - ( - nil - - @doc "Lists all Climate order objects. The orders are returned sorted by creation date, with the\nmost recently created orders appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/climate/orders`\n" - ( - @spec list( - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Climate.Order.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/climate/orders", [], []) - - 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 diff --git a/lib/generated/climate__product.ex b/lib/generated/climate__product.ex index 431d61db..01ef6387 100644 --- a/lib/generated/climate__product.ex +++ b/lib/generated/climate__product.ex @@ -29,6 +29,35 @@ defmodule Stripe.Climate.Product do } ) + ( + nil + + @doc "Lists all available Climate product objects.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/climate/products`\n" + ( + @spec list( + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Climate.Product.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/climate/products", [], []) + + 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 @@ -72,33 +101,4 @@ defmodule Stripe.Climate.Product do end ) ) - - ( - nil - - @doc "Lists all available Climate product objects.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/climate/products`\n" - ( - @spec list( - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Climate.Product.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/climate/products", [], []) - - 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 - ) - ) end diff --git a/lib/generated/climate__supplier.ex b/lib/generated/climate__supplier.ex index 93ba0dd9..863a5b06 100644 --- a/lib/generated/climate__supplier.ex +++ b/lib/generated/climate__supplier.ex @@ -16,6 +16,35 @@ defmodule Stripe.Climate.Supplier do } ) + ( + nil + + @doc "Lists all available Climate supplier objects.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/climate/suppliers`\n" + ( + @spec list( + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Climate.Supplier.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/climate/suppliers", [], []) + + 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 @@ -59,33 +88,4 @@ defmodule Stripe.Climate.Supplier do end ) ) - - ( - nil - - @doc "Lists all available Climate supplier objects.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/climate/suppliers`\n" - ( - @spec list( - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Climate.Supplier.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/climate/suppliers", [], []) - - 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 - ) - ) end diff --git a/lib/generated/coupon.ex b/lib/generated/coupon.ex index 8e254f19..2b1bddab 100644 --- a/lib/generated/coupon.ex +++ b/lib/generated/coupon.ex @@ -63,28 +63,35 @@ defmodule Stripe.Coupon do ( nil - @doc "Returns a list of your coupons.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/coupons`\n" + @doc "You can delete coupons via the coupon management page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can’t redeem the coupon. You can also delete coupons via the API.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/coupons/{coupon}`\n" ( - @spec list( - params :: %{ - optional(:created) => created | integer, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Coupon.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/coupons", [], []) + @spec delete(coupon :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedCoupon.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def delete(coupon, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/coupons/{coupon}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "coupon", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "coupon", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [coupon] + ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -93,33 +100,28 @@ defmodule Stripe.Coupon do ( nil - @doc "You can create coupons easily via the coupon management page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.
\n\nA coupon has either a percent_off
or an amount_off
and currency
. If you set an amount_off
, that amount will be subtracted from any invoice’s subtotal. For example, an invoice with a subtotal of amount_off
of amount_off
of
Returns a list of your coupons.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/coupons`\n" ( - @spec create( + @spec list( params :: %{ - optional(:amount_off) => integer, - optional(:applies_to) => applies_to, - optional(:currency) => binary, - optional(:currency_options) => map(), - optional(:duration) => :forever | :once | :repeating, - optional(:duration_in_months) => integer, + optional(:created) => created | integer, + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:id) => binary, - optional(:max_redemptions) => integer, - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:name) => binary, - optional(:percent_off) => number, - optional(:redeem_by) => integer + optional(:limit) => integer, + optional(:starting_after) => binary }, opts :: Keyword.t() - ) :: {:ok, Stripe.Coupon.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + ) :: + {:ok, Stripe.List.t(Stripe.Coupon.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/coupons", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -169,39 +171,28 @@ defmodule Stripe.Coupon do ( nil - @doc "Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/coupons/{coupon}`\n" + @doc "You can create coupons easily via the coupon management page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.
\n\nA coupon has either a percent_off
or an amount_off
and currency
. If you set an amount_off
, that amount will be subtracted from any invoice’s subtotal. For example, an invoice with a subtotal of amount_off
of amount_off
of
You can delete coupons via the coupon management page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can’t redeem the coupon. You can also delete coupons via the API.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/coupons/{coupon}`\n" + @doc "Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/coupons/{coupon}`\n" ( - @spec delete(coupon :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedCoupon.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(coupon, opts \\ []) do + @spec update( + coupon :: binary(), + params :: %{ + optional(:currency_options) => map(), + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:name) => binary + }, + opts :: Keyword.t() + ) :: {:ok, Stripe.Coupon.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def update(coupon, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/coupons/{coupon}", @@ -243,7 +242,8 @@ defmodule Stripe.Coupon do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/credit_note.ex b/lib/generated/credit_note.ex index 339591df..fde2b3d2 100644 --- a/lib/generated/credit_note.ex +++ b/lib/generated/credit_note.ex @@ -87,7 +87,7 @@ defmodule Stripe.CreditNote do ) ( - @typedoc "When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note." + @typedoc nil @type shipping_cost :: %{optional(:shipping_rate) => binary} ) @@ -103,34 +103,70 @@ defmodule Stripe.CreditNote do ( nil - @doc "Issue a credit note to adjust the amount of a finalized invoice. For a status=open
invoice, a credit note reduces\nits amount_due
. For a status=paid
invoice, a credit note does not affect its amount_due
. Instead, it can result\nin any combination of the following:
refund_amount
) or link an existing refund (using refund
).credit_amount
) which will be automatically applied to their next invoice when it’s finalized.out_of_band_amount
).For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
\n\nYou may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s pre_payment_credit_notes_amount
\nor post_payment_credit_notes_amount
depending on its status
at the time of credit note creation.
Returns a list of credit notes.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/credit_notes`\n" ( - @spec create( + @spec list( params :: %{ - optional(:amount) => integer, - optional(:credit_amount) => integer, - optional(:effective_at) => integer, + optional(:customer) => binary, + optional(:ending_before) => binary, optional(:expand) => list(binary), optional(:invoice) => binary, - optional(:lines) => list(lines), - optional(:memo) => binary, - optional(:metadata) => %{optional(binary) => binary}, - optional(:out_of_band_amount) => integer, - optional(:reason) => - :duplicate | :fraudulent | :order_change | :product_unsatisfactory, - optional(:refund) => binary, - optional(:refund_amount) => integer, - optional(:shipping_cost) => shipping_cost + optional(:limit) => integer, + optional(:starting_after) => binary }, opts :: Keyword.t() - ) :: {:ok, Stripe.CreditNote.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + ) :: + {:ok, Stripe.List.t(Stripe.CreditNote.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/credit_notes", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) + |> Stripe.Request.make_request() + end + ) + ) + + ( + nil + + @doc "Retrieves the credit note object with the given identifier.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/credit_notes/{id}`\n" + ( + @spec retrieve( + id :: binary(), + params :: %{optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: {:ok, Stripe.CreditNote.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def retrieve(id, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/credit_notes/{id}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "id", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "id", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [id] + ) + + 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 ) @@ -175,34 +211,35 @@ defmodule Stripe.CreditNote do ( nil - @doc "Retrieves the credit note object with the given identifier.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/credit_notes/{id}`\n" + @doc "When retrieving a credit note preview, you’ll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/credit_notes/preview/lines`\n" ( - @spec retrieve( - id :: binary(), - params :: %{optional(:expand) => list(binary)}, + @spec preview_lines( + params :: %{ + optional(:amount) => integer, + optional(:credit_amount) => integer, + optional(:effective_at) => integer, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:invoice) => binary, + optional(:limit) => integer, + optional(:lines) => list(lines), + optional(:memo) => binary, + optional(:metadata) => %{optional(binary) => binary}, + optional(:out_of_band_amount) => integer, + optional(:reason) => + :duplicate | :fraudulent | :order_change | :product_unsatisfactory, + optional(:refund) => binary, + optional(:refund_amount) => integer, + optional(:shipping_cost) => shipping_cost, + optional(:starting_after) => binary + }, opts :: Keyword.t() - ) :: {:ok, Stripe.CreditNote.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(id, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/credit_notes/{id}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "id", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "id", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [id] - ) + ) :: + {:ok, Stripe.List.t(Stripe.CreditNoteLineItem.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def preview_lines(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/credit_notes/preview/lines", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -216,29 +253,34 @@ defmodule Stripe.CreditNote do ( nil - @doc "Returns a list of credit notes.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/credit_notes`\n" + @doc "Issue a credit note to adjust the amount of a finalized invoice. For a status=open
invoice, a credit note reduces\nits amount_due
. For a status=paid
invoice, a credit note does not affect its amount_due
. Instead, it can result\nin any combination of the following:
refund_amount
) or link an existing refund (using refund
).credit_amount
) which will be automatically applied to their next invoice when it’s finalized.out_of_band_amount
).For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
\n\nYou may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s pre_payment_credit_notes_amount
\nor post_payment_credit_notes_amount
depending on its status
at the time of credit note creation.
When retrieving a credit note preview, you’ll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/credit_notes/preview/lines`\n" - ( - @spec preview_lines( - params :: %{ - optional(:amount) => integer, - optional(:credit_amount) => integer, - optional(:effective_at) => integer, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:invoice) => binary, - optional(:limit) => integer, - optional(:lines) => list(lines), - optional(:memo) => binary, - optional(:metadata) => %{optional(binary) => binary}, - optional(:out_of_band_amount) => integer, - optional(:reason) => - :duplicate | :fraudulent | :order_change | :product_unsatisfactory, - optional(:refund) => binary, - optional(:refund_amount) => integer, - optional(:shipping_cost) => shipping_cost, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.CreditNoteLineItem.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def preview_lines(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/credit_notes/preview/lines", [], []) - - 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 - ) - ) end diff --git a/lib/generated/customer.ex b/lib/generated/customer.ex index 7fe661f0..d05b82b2 100644 --- a/lib/generated/customer.ex +++ b/lib/generated/customer.ex @@ -236,27 +236,37 @@ defmodule Stripe.Customer do ( nil - @doc "Search for customers you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/search`\n" + @doc "Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/customers/{customer}`\n" ( - @spec search( - params :: %{ - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:page) => binary, - optional(:query) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.SearchResult.t(Stripe.Customer.t())} + @spec delete(customer :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedCustomer.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def search(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/customers/search", [], []) + def delete(customer, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/customers/{customer}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "customer", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "customer", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [customer] + ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -265,30 +275,37 @@ defmodule Stripe.Customer do ( nil - @doc "Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers`\n" + @doc "Removes the currently applied discount on a customer.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/customers/{customer}/discount`\n" ( - @spec list( - params :: %{ - optional(:created) => created | integer, - optional(:email) => binary, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary, - optional(:test_clock) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Customer.t())} + @spec delete_discount(customer :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedDiscount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/customers", [], []) + def delete_discount(customer, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/customers/{customer}/discount", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "customer", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "customer", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [customer] + ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -297,43 +314,30 @@ defmodule Stripe.Customer do ( nil - @doc "Creates a new customer object.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/customers`\n" + @doc "Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers`\n" ( - @spec create( + @spec list( params :: %{ - optional(:address) => address | binary, - optional(:balance) => integer, - optional(:cash_balance) => cash_balance, - optional(:coupon) => binary, - optional(:description) => binary, + optional(:created) => created | integer, optional(:email) => binary, + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:invoice_prefix) => binary, - optional(:invoice_settings) => invoice_settings, - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:name) => binary, - optional(:next_invoice_sequence) => integer, - optional(:payment_method) => binary, - optional(:phone) => binary, - optional(:preferred_locales) => list(binary), - optional(:promotion_code) => binary, - optional(:shipping) => shipping | binary, - optional(:source) => binary, - optional(:tax) => tax, - optional(:tax_exempt) => :exempt | :none | :reverse, - optional(:tax_id_data) => list(tax_id_data), - optional(:test_clock) => binary, - optional(:validate) => boolean + optional(:limit) => integer, + optional(:starting_after) => binary, + optional(:test_clock) => binary }, opts :: Keyword.t() - ) :: {:ok, Stripe.Customer.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + ) :: + {:ok, Stripe.List.t(Stripe.Customer.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/customers", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -386,79 +390,25 @@ defmodule Stripe.Customer do ( nil - @doc "Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_due
state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.
This request accepts mostly the same arguments as the customer creation call.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/customers/{customer}`\n" + @doc "Returns a list of transactions that updated the customer’s balances.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/{customer}/balance_transactions`\n" ( - @spec update( + @spec balance_transactions( customer :: binary(), params :: %{ - optional(:address) => address | binary, - optional(:balance) => integer, - optional(:cash_balance) => cash_balance, - optional(:coupon) => binary, - optional(:default_source) => binary, - optional(:description) => binary, - optional(:email) => binary, + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:invoice_prefix) => binary, - optional(:invoice_settings) => invoice_settings, - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:name) => binary, - optional(:next_invoice_sequence) => integer, - optional(:phone) => binary, - optional(:preferred_locales) => list(binary), - optional(:promotion_code) => binary, - optional(:shipping) => shipping | binary, - optional(:source) => binary, - optional(:tax) => tax, - optional(:tax_exempt) => :exempt | :none | :reverse, - optional(:validate) => boolean + optional(:limit) => integer, + optional(:starting_after) => binary }, opts :: Keyword.t() - ) :: {:ok, Stripe.Customer.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(customer, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "customer", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "customer", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [customer] - ) - - 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 - ) - ) - - ( - nil - - @doc "Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/customers/{customer}`\n" - ( - @spec delete(customer :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedCustomer.t()} + ) :: + {:ok, Stripe.List.t(Stripe.CustomerBalanceTransaction.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(customer, opts \\ []) do + def balance_transactions(customer, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}", + "/v1/customers/{customer}/balance_transactions", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -479,7 +429,8 @@ defmodule Stripe.Customer do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -626,42 +577,22 @@ defmodule Stripe.Customer do ( nil - @doc "Returns a list of transactions that updated the customer’s balances.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/{customer}/balance_transactions`\n" + @doc "Search for customers you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/search`\n" ( - @spec balance_transactions( - customer :: binary(), + @spec search( params :: %{ - optional(:ending_before) => binary, optional(:expand) => list(binary), optional(:limit) => integer, - optional(:starting_after) => binary + optional(:page) => binary, + optional(:query) => binary }, opts :: Keyword.t() ) :: - {:ok, Stripe.List.t(Stripe.CustomerBalanceTransaction.t())} + {:ok, Stripe.SearchResult.t(Stripe.Customer.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def balance_transactions(customer, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}/balance_transactions", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "customer", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "customer", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [customer] - ) + def search(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/customers/search", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -675,25 +606,84 @@ defmodule Stripe.Customer do ( nil - @doc "Create an incoming testmode bank transfer
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/customers/{customer}/fund_cash_balance`\n" + @doc "Creates a new customer object.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/customers`\n" ( - @spec fund_cash_balance( + @spec create( + params :: %{ + optional(:address) => address | binary, + optional(:balance) => integer, + optional(:cash_balance) => cash_balance, + optional(:coupon) => binary, + optional(:description) => binary, + optional(:email) => binary, + optional(:expand) => list(binary), + optional(:invoice_prefix) => binary, + optional(:invoice_settings) => invoice_settings, + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:name) => binary, + optional(:next_invoice_sequence) => integer, + optional(:payment_method) => binary, + optional(:phone) => binary, + optional(:preferred_locales) => list(binary), + optional(:promotion_code) => binary, + optional(:shipping) => shipping | binary, + optional(:source) => binary, + optional(:tax) => tax, + optional(:tax_exempt) => :exempt | :none | :reverse, + optional(:tax_id_data) => list(tax_id_data), + optional(:test_clock) => binary, + optional(:validate) => boolean + }, + opts :: Keyword.t() + ) :: {:ok, Stripe.Customer.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/customers", [], []) + + 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 + ) + ) + + ( + nil + + @doc "Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the past_due
state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.
This request accepts mostly the same arguments as the customer creation call.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/customers/{customer}`\n" + ( + @spec update( customer :: binary(), params :: %{ - optional(:amount) => integer, - optional(:currency) => binary, + optional(:address) => address | binary, + optional(:balance) => integer, + optional(:cash_balance) => cash_balance, + optional(:coupon) => binary, + optional(:default_source) => binary, + optional(:description) => binary, + optional(:email) => binary, optional(:expand) => list(binary), - optional(:reference) => binary + optional(:invoice_prefix) => binary, + optional(:invoice_settings) => invoice_settings, + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:name) => binary, + optional(:next_invoice_sequence) => integer, + optional(:phone) => binary, + optional(:preferred_locales) => list(binary), + optional(:promotion_code) => binary, + optional(:shipping) => shipping | binary, + optional(:source) => binary, + optional(:tax) => tax, + optional(:tax_exempt) => :exempt | :none | :reverse, + optional(:validate) => boolean }, opts :: Keyword.t() - ) :: - {:ok, Stripe.CustomerCashBalanceTransaction.t()} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def fund_cash_balance(customer, params \\ %{}, opts \\ []) do + ) :: {:ok, Stripe.Customer.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def update(customer, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/customers/{customer}/fund_cash_balance", + "/v1/customers/{customer}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -773,16 +763,25 @@ defmodule Stripe.Customer do ( nil - @doc "Removes the currently applied discount on a customer.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/customers/{customer}/discount`\n" + @doc "Create an incoming testmode bank transfer
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/customers/{customer}/fund_cash_balance`\n" ( - @spec delete_discount(customer :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedDiscount.t()} + @spec fund_cash_balance( + customer :: binary(), + params :: %{ + optional(:amount) => integer, + optional(:currency) => binary, + optional(:expand) => list(binary), + optional(:reference) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.CustomerCashBalanceTransaction.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete_discount(customer, opts \\ []) do + def fund_cash_balance(customer, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}/discount", + "/v1/test_helpers/customers/{customer}/fund_cash_balance", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -803,7 +802,8 @@ defmodule Stripe.Customer do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/customer_balance_transaction.ex b/lib/generated/customer_balance_transaction.ex index cb03695d..985d3322 100644 --- a/lib/generated/customer_balance_transaction.ex +++ b/lib/generated/customer_balance_transaction.ex @@ -40,21 +40,25 @@ defmodule Stripe.CustomerBalanceTransaction do ( nil - @doc "Retrieves a specific customer balance transaction that updated the customer’s balances.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/{customer}/balance_transactions/{transaction}`\n" + @doc "Returns a list of transactions that updated the customer’s balances.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/{customer}/balance_transactions`\n" ( - @spec retrieve( + @spec list( customer :: binary(), - transaction :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, opts :: Keyword.t() ) :: - {:ok, Stripe.CustomerBalanceTransaction.t()} + {:ok, Stripe.List.t(Stripe.CustomerBalanceTransaction.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(customer, transaction, params \\ %{}, opts \\ []) do + def list(customer, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}/balance_transactions/{transaction}", + "/v1/customers/{customer}/balance_transactions", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -68,22 +72,9 @@ defmodule Stripe.CustomerBalanceTransaction do properties: [], any_of: [] } - }, - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "transaction", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "transaction", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } } ], - [customer, transaction] + [customer] ) Stripe.Request.new_request(opts) @@ -98,25 +89,21 @@ defmodule Stripe.CustomerBalanceTransaction do ( nil - @doc "Returns a list of transactions that updated the customer’s balances.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/{customer}/balance_transactions`\n" + @doc "Retrieves a specific customer balance transaction that updated the customer’s balances.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/{customer}/balance_transactions/{transaction}`\n" ( - @spec list( + @spec retrieve( customer :: binary(), - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, + transaction :: binary(), + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: - {:ok, Stripe.List.t(Stripe.CustomerBalanceTransaction.t())} + {:ok, Stripe.CustomerBalanceTransaction.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(customer, params \\ %{}, opts \\ []) do + def retrieve(customer, transaction, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}/balance_transactions", + "/v1/customers/{customer}/balance_transactions/{transaction}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -130,9 +117,22 @@ defmodule Stripe.CustomerBalanceTransaction do properties: [], any_of: [] } + }, + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "transaction", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "transaction", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } } ], - [customer] + [customer, transaction] ) Stripe.Request.new_request(opts) diff --git a/lib/generated/customer_cash_balance_transaction.ex b/lib/generated/customer_cash_balance_transaction.ex index ca80b6e6..e7b6825c 100644 --- a/lib/generated/customer_cash_balance_transaction.ex +++ b/lib/generated/customer_cash_balance_transaction.ex @@ -44,21 +44,25 @@ defmodule Stripe.CustomerCashBalanceTransaction do ( nil - @doc "Retrieves a specific cash balance transaction, which updated the customer’s cash balance.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/{customer}/cash_balance_transactions/{transaction}`\n" + @doc "Returns a list of transactions that modified the customer’s cash balance.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/{customer}/cash_balance_transactions`\n" ( - @spec retrieve( + @spec list( customer :: binary(), - transaction :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, opts :: Keyword.t() ) :: - {:ok, Stripe.CustomerCashBalanceTransaction.t()} + {:ok, Stripe.List.t(Stripe.CustomerCashBalanceTransaction.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(customer, transaction, params \\ %{}, opts \\ []) do + def list(customer, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}/cash_balance_transactions/{transaction}", + "/v1/customers/{customer}/cash_balance_transactions", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -72,22 +76,9 @@ defmodule Stripe.CustomerCashBalanceTransaction do properties: [], any_of: [] } - }, - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "transaction", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "transaction", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } } ], - [customer, transaction] + [customer] ) Stripe.Request.new_request(opts) @@ -102,25 +93,21 @@ defmodule Stripe.CustomerCashBalanceTransaction do ( nil - @doc "Returns a list of transactions that modified the customer’s cash balance.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/{customer}/cash_balance_transactions`\n" + @doc "Retrieves a specific cash balance transaction, which updated the customer’s cash balance.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/customers/{customer}/cash_balance_transactions/{transaction}`\n" ( - @spec list( + @spec retrieve( customer :: binary(), - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, + transaction :: binary(), + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: - {:ok, Stripe.List.t(Stripe.CustomerCashBalanceTransaction.t())} + {:ok, Stripe.CustomerCashBalanceTransaction.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(customer, params \\ %{}, opts \\ []) do + def retrieve(customer, transaction, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/customers/{customer}/cash_balance_transactions", + "/v1/customers/{customer}/cash_balance_transactions/{transaction}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -134,9 +121,22 @@ defmodule Stripe.CustomerCashBalanceTransaction do properties: [], any_of: [] } + }, + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "transaction", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "transaction", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } } ], - [customer] + [customer, transaction] ) Stripe.Request.new_request(opts) diff --git a/lib/generated/ephemeral_key.ex b/lib/generated/ephemeral_key.ex index 5218a8b8..8840f0b3 100644 --- a/lib/generated/ephemeral_key.ex +++ b/lib/generated/ephemeral_key.ex @@ -15,34 +15,6 @@ defmodule Stripe.EphemeralKey do } ) - ( - nil - - @doc "Creates a short-lived API key for a given resource.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/ephemeral_keys`\n" - ( - @spec create( - params :: %{ - optional(:customer) => binary, - optional(:expand) => list(binary), - optional(:issuing_card) => binary, - optional(:nonce) => binary, - optional(:verification_session) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.EphemeralKey.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/ephemeral_keys", [], []) - - 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 - ) - ) - ( nil @@ -84,4 +56,32 @@ defmodule Stripe.EphemeralKey do end ) ) + + ( + nil + + @doc "Creates a short-lived API key for a given resource.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/ephemeral_keys`\n" + ( + @spec create( + params :: %{ + optional(:customer) => binary, + optional(:expand) => list(binary), + optional(:issuing_card) => binary, + optional(:nonce) => binary, + optional(:verification_session) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.EphemeralKey.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/ephemeral_keys", [], []) + + 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 diff --git a/lib/generated/external_account.ex b/lib/generated/external_account.ex index b5bab04e..93cb7b3e 100644 --- a/lib/generated/external_account.ex +++ b/lib/generated/external_account.ex @@ -19,6 +19,58 @@ defmodule Stripe.ExternalAccount do } ) + ( + nil + + @doc "Delete a specified external account for a given account.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/accounts/{account}/external_accounts/{id}`\n" + ( + @spec delete(account :: binary(), id :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedExternalAccount.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def delete(account, id, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/accounts/{account}/external_accounts/{id}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "account", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "account", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + }, + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "id", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "id", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [account, id] + ) + + Stripe.Request.new_request(opts) + |> Stripe.Request.put_endpoint(path) + |> Stripe.Request.put_method(:delete) + |> Stripe.Request.make_request() + end + ) + ) + ( nil @@ -250,56 +302,4 @@ defmodule Stripe.ExternalAccount do end ) ) - - ( - nil - - @doc "Delete a specified external account for a given account.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/accounts/{account}/external_accounts/{id}`\n" - ( - @spec delete(account :: binary(), id :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedExternalAccount.t()} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def delete(account, id, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/accounts/{account}/external_accounts/{id}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "account", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "account", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - }, - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "id", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "id", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [account, id] - ) - - Stripe.Request.new_request(opts) - |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) - |> Stripe.Request.make_request() - end - ) - ) end diff --git a/lib/generated/fee_refund.ex b/lib/generated/fee_refund.ex index 7f19fef6..3e919aaf 100644 --- a/lib/generated/fee_refund.ex +++ b/lib/generated/fee_refund.ex @@ -21,22 +21,32 @@ defmodule Stripe.FeeRefund do ( nil - @doc "Refunds an application fee that has previously been collected but not yet refunded.\nFunds will be refunded to the Stripe account from which the fee was originally collected.
\n\nYou can optionally refund only part of an application fee.\nYou can do so multiple times, until the entire fee has been refunded.
\n\nOnce entirely refunded, an application fee can’t be refunded again.\nThis method will raise an error when called on an already-refunded application fee,\nor when trying to refund more money than is left on an application fee.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/application_fees/{id}/refunds`\n" + @doc "By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/application_fees/{fee}/refunds/{id}`\n" ( - @spec create( + @spec retrieve( + fee :: binary(), id :: binary(), - params :: %{ - optional(:amount) => integer, - optional(:expand) => list(binary), - optional(:metadata) => %{optional(binary) => binary} - }, + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: {:ok, Stripe.FeeRefund.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(id, params \\ %{}, opts \\ []) do + def retrieve(fee, id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/application_fees/{id}/refunds", + "/v1/application_fees/{fee}/refunds/{id}", [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "fee", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "fee", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + }, %OpenApiGen.Blueprint.Parameter{ in: "path", name: "id", @@ -51,13 +61,13 @@ defmodule Stripe.FeeRefund do } } ], - [id] + [fee, id] ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -115,15 +125,18 @@ defmodule Stripe.FeeRefund do ( nil - @doc "By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/application_fees/{fee}/refunds/{id}`\n" + @doc "Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
\n\nThis request only accepts metadata as an argument.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/application_fees/{fee}/refunds/{id}`\n" ( - @spec retrieve( + @spec update( fee :: binary(), id :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary} | binary + }, opts :: Keyword.t() ) :: {:ok, Stripe.FeeRefund.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(fee, id, params \\ %{}, opts \\ []) do + def update(fee, id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/application_fees/{fee}/refunds/{id}", @@ -161,7 +174,7 @@ defmodule Stripe.FeeRefund do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) @@ -170,35 +183,22 @@ defmodule Stripe.FeeRefund do ( nil - @doc "Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
\n\nThis request only accepts metadata as an argument.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/application_fees/{fee}/refunds/{id}`\n" + @doc "Refunds an application fee that has previously been collected but not yet refunded.\nFunds will be refunded to the Stripe account from which the fee was originally collected.
\n\nYou can optionally refund only part of an application fee.\nYou can do so multiple times, until the entire fee has been refunded.
\n\nOnce entirely refunded, an application fee can’t be refunded again.\nThis method will raise an error when called on an already-refunded application fee,\nor when trying to refund more money than is left on an application fee.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/application_fees/{id}/refunds`\n" ( - @spec update( - fee :: binary(), + @spec create( id :: binary(), params :: %{ + optional(:amount) => integer, optional(:expand) => list(binary), - optional(:metadata) => %{optional(binary) => binary} | binary + optional(:metadata) => %{optional(binary) => binary} }, opts :: Keyword.t() ) :: {:ok, Stripe.FeeRefund.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(fee, id, params \\ %{}, opts \\ []) do + def create(id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/application_fees/{fee}/refunds/{id}", + "/v1/application_fees/{id}/refunds", [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "fee", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "fee", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - }, %OpenApiGen.Blueprint.Parameter{ in: "path", name: "id", @@ -213,7 +213,7 @@ defmodule Stripe.FeeRefund do } } ], - [fee, id] + [id] ) Stripe.Request.new_request(opts) diff --git a/lib/generated/file_link.ex b/lib/generated/file_link.ex index 5ccc14f6..77c497b6 100644 --- a/lib/generated/file_link.ex +++ b/lib/generated/file_link.ex @@ -29,6 +29,38 @@ defmodule Stripe.FileLink do } ) + ( + nil + + @doc "Returns a list of file links.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/file_links`\n" + ( + @spec list( + params :: %{ + optional(:created) => created | integer, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:expired) => boolean, + optional(:file) => binary, + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.FileLink.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/file_links", [], []) + + 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 @@ -140,36 +172,4 @@ defmodule Stripe.FileLink do end ) ) - - ( - nil - - @doc "Returns a list of file links.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/file_links`\n" - ( - @spec list( - params :: %{ - optional(:created) => created | integer, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:expired) => boolean, - optional(:file) => binary, - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.FileLink.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/file_links", [], []) - - 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 - ) - ) end diff --git a/lib/generated/financial_connections__account.ex b/lib/generated/financial_connections__account.ex index 54980761..6b572005 100644 --- a/lib/generated/financial_connections__account.ex +++ b/lib/generated/financial_connections__account.ex @@ -183,23 +183,20 @@ defmodule Stripe.FinancialConnections.Account do ( nil - @doc "Refreshes the data associated with a Financial Connections Account
.
Disables your access to a Financial Connections Account
. You will no longer be able to access data associated with the account (e.g. balances, transactions).
Disables your access to a Financial Connections Account
. You will no longer be able to access data associated with the account (e.g. balances, transactions).
Refreshes the data associated with a Financial Connections Account
.
To launch the Financial Connections authorization flow, create a Session
. The session’s client_secret
can be used to launch the flow using Stripe.js.
To launch the Financial Connections authorization flow, create a Session
. The session’s client_secret
can be used to launch the flow using Stripe.js.
Returns a list of Financial Connections Transaction
objects.
Returns a list of Financial Connections Transaction
objects.
List all verification reports.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/identity/verification_reports`\n" + ( + @spec list( + params :: %{ + optional(:created) => created | integer, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary, + optional(:type) => :document | :id_number, + optional(:verification_session) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Identity.VerificationReport.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params("/v1/identity/verification_reports", [], []) + + 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 @@ -84,37 +117,4 @@ defmodule Stripe.Identity.VerificationReport do end ) ) - - ( - nil - - @doc "List all verification reports.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/identity/verification_reports`\n" - ( - @spec list( - params :: %{ - optional(:created) => created | integer, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary, - optional(:type) => :document | :id_number, - optional(:verification_session) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Identity.VerificationReport.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params("/v1/identity/verification_reports", [], []) - - 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 - ) - ) end diff --git a/lib/generated/identity__verification_session.ex b/lib/generated/identity__verification_session.ex index d49b8418..7bd4de22 100644 --- a/lib/generated/identity__verification_session.ex +++ b/lib/generated/identity__verification_session.ex @@ -67,29 +67,30 @@ defmodule Stripe.Identity.VerificationSession do ( nil - @doc "Creates a VerificationSession object.
\n\nAfter the VerificationSession is created, display a verification modal using the session client_secret
or send your users to the session’s url
.
If your API key is in test mode, verification checks won’t actually process, though everything else will occur as if in live mode.
\n\nRelated guide: Verify your users’ identity documents
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/identity/verification_sessions`\n" + @doc "Returns a list of VerificationSessions
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/identity/verification_sessions`\n" ( - @spec create( + @spec list( params :: %{ + optional(:created) => created | integer, + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:metadata) => %{optional(binary) => binary}, - optional(:options) => options, - optional(:return_url) => binary, - optional(:type) => :document | :id_number + optional(:limit) => integer, + optional(:starting_after) => binary, + optional(:status) => :canceled | :processing | :requires_input | :verified }, opts :: Keyword.t() ) :: - {:ok, Stripe.Identity.VerificationSession.t()} + {:ok, Stripe.List.t(Stripe.Identity.VerificationSession.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/identity/verification_sessions", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -142,30 +143,29 @@ defmodule Stripe.Identity.VerificationSession do ( nil - @doc "Returns a list of VerificationSessions
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/identity/verification_sessions`\n" + @doc "Creates a VerificationSession object.
\n\nAfter the VerificationSession is created, display a verification modal using the session client_secret
or send your users to the session’s url
.
If your API key is in test mode, verification checks won’t actually process, though everything else will occur as if in live mode.
\n\nRelated guide: Verify your users’ identity documents
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/identity/verification_sessions`\n" ( - @spec list( + @spec create( params :: %{ - optional(:created) => created | integer, - optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary, - optional(:status) => :canceled | :processing | :requires_input | :verified + optional(:metadata) => %{optional(binary) => binary}, + optional(:options) => options, + optional(:return_url) => binary, + optional(:type) => :document | :id_number }, opts :: Keyword.t() ) :: - {:ok, Stripe.List.t(Stripe.Identity.VerificationSession.t())} + {:ok, Stripe.Identity.VerificationSession.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(params \\ %{}, opts \\ []) do + def create(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/identity/verification_sessions", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) @@ -174,20 +174,25 @@ defmodule Stripe.Identity.VerificationSession do ( nil - @doc "A VerificationSession object can be canceled when it is in requires_input
status.
Once canceled, future submission attempts are disabled. This cannot be undone. Learn more.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/identity/verification_sessions/{session}/cancel`\n" + @doc "Updates a VerificationSession object.
\n\nWhen the session status is requires_input
, you can use this method to update the\nverification check and options.
Redact a VerificationSession to remove all collected information from Stripe. This will redact\nthe VerificationSession and all objects related to it, including VerificationReports, Events,\nrequest logs, etc.
\n\nA VerificationSession object can be redacted when it is in requires_input
or verified
\nstatus. Redacting a VerificationSession in requires_action
\nstate will automatically cancel it.
The redaction process may take up to four days. When the redaction process is in progress, the\nVerificationSession’s redaction.status
field will be set to processing
; when the process is\nfinished, it will change to redacted
and an identity.verification_session.redacted
event\nwill be emitted.
Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the\nfields that contain personal data will be replaced by the string [redacted]
or a similar\nplaceholder. The metadata
field will also be erased. Redacted objects cannot be updated or\nused for any purpose.
A VerificationSession object can be canceled when it is in requires_input
status.
Once canceled, future submission attempts are disabled. This cannot be undone. Learn more.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/identity/verification_sessions/{session}/cancel`\n" ( - @spec redact( + @spec cancel( session :: binary(), params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() @@ -228,10 +233,10 @@ defmodule Stripe.Identity.VerificationSession do {:ok, Stripe.Identity.VerificationSession.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def redact(session, params \\ %{}, opts \\ []) do + def cancel(session, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/identity/verification_sessions/{session}/redact", + "/v1/identity/verification_sessions/{session}/cancel", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -262,25 +267,20 @@ defmodule Stripe.Identity.VerificationSession do ( nil - @doc "Updates a VerificationSession object.
\n\nWhen the session status is requires_input
, you can use this method to update the\nverification check and options.
Redact a VerificationSession to remove all collected information from Stripe. This will redact\nthe VerificationSession and all objects related to it, including VerificationReports, Events,\nrequest logs, etc.
\n\nA VerificationSession object can be redacted when it is in requires_input
or verified
\nstatus. Redacting a VerificationSession in requires_action
\nstate will automatically cancel it.
The redaction process may take up to four days. When the redaction process is in progress, the\nVerificationSession’s redaction.status
field will be set to processing
; when the process is\nfinished, it will change to redacted
and an identity.verification_session.redacted
event\nwill be emitted.
Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the\nfields that contain personal data will be replaced by the string [redacted]
or a similar\nplaceholder. The metadata
field will also be erased. Redacted objects cannot be updated or\nused for any purpose.
Search for invoices you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/invoices/search`\n" + @doc "Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be voided.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/invoices/{invoice}`\n" ( - @spec search( - params :: %{ - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:page) => binary, - optional(:query) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.SearchResult.t(Stripe.Invoice.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def search(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/invoices/search", [], []) + @spec delete(invoice :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedInvoice.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def delete(invoice, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/invoices/{invoice}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "invoice", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "invoice", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [invoice] + ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -639,38 +647,28 @@ defmodule Stripe.Invoice do ( nil - @doc "At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
\n\nNote that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.
\n\nYou can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date
parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date
returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start]
is equal to the subscription_proration_date
on the upcoming invoice resource.
You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/invoices`\n" ( - @spec upcoming( + @spec list( params :: %{ - optional(:automatic_tax) => automatic_tax, - optional(:coupon) => binary, - optional(:currency) => binary, + optional(:collection_method) => :charge_automatically | :send_invoice, + optional(:created) => created | integer, optional(:customer) => binary, - optional(:customer_details) => customer_details, - optional(:discounts) => list(discounts) | binary, + optional(:due_date) => due_date | integer, + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:invoice_items) => list(invoice_items), - optional(:schedule) => binary, - optional(:subscription) => binary, - optional(:subscription_billing_cycle_anchor) => (:now | :unchanged) | integer, - optional(:subscription_cancel_at) => integer | binary, - optional(:subscription_cancel_at_period_end) => boolean, - optional(:subscription_cancel_now) => boolean, - optional(:subscription_default_tax_rates) => list(binary) | binary, - optional(:subscription_items) => list(subscription_items), - optional(:subscription_proration_behavior) => - :always_invoice | :create_prorations | :none, - optional(:subscription_proration_date) => integer, - optional(:subscription_resume_at) => :now, - optional(:subscription_start_date) => integer, - optional(:subscription_trial_end) => :now | integer, - optional(:subscription_trial_from_plan) => boolean + optional(:limit) => integer, + optional(:starting_after) => binary, + optional(:status) => :draft | :open | :paid | :uncollectible | :void, + optional(:subscription) => binary }, opts :: Keyword.t() - ) :: {:ok, Stripe.Invoice.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def upcoming(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/invoices/upcoming", [], []) + ) :: + {:ok, Stripe.List.t(Stripe.Invoice.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/invoices", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -684,40 +682,14 @@ defmodule Stripe.Invoice do ( nil - @doc "Draft invoices are fully editable. Once an invoice is finalized,\nmonetary values, as well as collection_method
, become uneditable.
If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,\nsending reminders for, or automatically reconciling invoices, pass\nauto_advance=false
.
Retrieves the invoice with the given ID.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/invoices/{invoice}`\n" ( - @spec update( + @spec retrieve( invoice :: binary(), - params :: %{ - optional(:account_tax_ids) => list(binary) | binary, - optional(:application_fee_amount) => integer, - optional(:auto_advance) => boolean, - optional(:automatic_tax) => automatic_tax, - optional(:collection_method) => :charge_automatically | :send_invoice, - optional(:custom_fields) => list(custom_fields) | binary, - optional(:days_until_due) => integer, - optional(:default_payment_method) => binary, - optional(:default_source) => binary | binary, - optional(:default_tax_rates) => list(binary) | binary, - optional(:description) => binary, - optional(:discounts) => list(discounts) | binary, - optional(:due_date) => integer, - optional(:effective_at) => integer | binary, - optional(:expand) => list(binary), - optional(:footer) => binary, - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:on_behalf_of) => binary | binary, - optional(:payment_settings) => payment_settings, - optional(:rendering) => rendering, - optional(:rendering_options) => rendering_options | binary, - optional(:shipping_cost) => shipping_cost | binary, - optional(:shipping_details) => shipping_details | binary, - optional(:statement_descriptor) => binary, - optional(:transfer_data) => transfer_data | binary - }, + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: {:ok, Stripe.Invoice.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(invoice, params \\ %{}, opts \\ []) do + def retrieve(invoice, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/invoices/{invoice}", @@ -742,7 +714,7 @@ defmodule Stripe.Invoice do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -751,47 +723,72 @@ defmodule Stripe.Invoice do ( nil - @doc "Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/invoices/{invoice}/pay`\n" + @doc "Search for invoices you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/invoices/search`\n" ( - @spec pay( - invoice :: binary(), + @spec search( params :: %{ optional(:expand) => list(binary), - optional(:forgive) => boolean, - optional(:mandate) => binary | binary, - optional(:off_session) => boolean, - optional(:paid_out_of_band) => boolean, - optional(:payment_method) => binary, - optional(:source) => binary + optional(:limit) => integer, + optional(:page) => binary, + optional(:query) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.SearchResult.t(Stripe.Invoice.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def search(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/invoices/search", [], []) + + 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 "At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
\n\nNote that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount.
\n\nYou can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date
parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date
returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start]
is equal to the subscription_proration_date
on the upcoming invoice resource.
You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/invoices`\n" + @doc "Draft invoices are fully editable. Once an invoice is finalized,\nmonetary values, as well as collection_method
, become uneditable.
If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,\nsending reminders for, or automatically reconciling invoices, pass\nauto_advance=false
.
Retrieves the invoice with the given ID.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/invoices/{invoice}`\n" - ( - @spec retrieve( - invoice :: binary(), - params :: %{optional(:expand) => list(binary)}, - opts :: Keyword.t() ) :: {:ok, Stripe.Invoice.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(invoice, params \\ %{}, opts \\ []) do + def update(invoice, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/invoices/{invoice}", @@ -971,7 +959,7 @@ defmodule Stripe.Invoice do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) @@ -980,14 +968,17 @@ defmodule Stripe.Invoice do ( nil - @doc "Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be voided.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/invoices/{invoice}`\n" + @doc "Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/invoices/{invoice}/finalize`\n" ( - @spec delete(invoice :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedInvoice.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(invoice, opts \\ []) do + @spec finalize_invoice( + invoice :: binary(), + params :: %{optional(:auto_advance) => boolean, optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: {:ok, Stripe.Invoice.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def finalize_invoice(invoice, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/invoices/{invoice}", + "/v1/invoices/{invoice}/finalize", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -1008,7 +999,8 @@ defmodule Stripe.Invoice do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) @@ -1017,17 +1009,17 @@ defmodule Stripe.Invoice do ( nil - @doc "Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you’d like to finalize a draft invoice manually, you can do so using this method.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/invoices/{invoice}/finalize`\n" + @doc "Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/invoices/{invoice}/mark_uncollectible`\n" ( - @spec finalize_invoice( + @spec mark_uncollectible( invoice :: binary(), - params :: %{optional(:auto_advance) => boolean, optional(:expand) => list(binary)}, + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: {:ok, Stripe.Invoice.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def finalize_invoice(invoice, params \\ %{}, opts \\ []) do + def mark_uncollectible(invoice, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/invoices/{invoice}/finalize", + "/v1/invoices/{invoice}/mark_uncollectible", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -1058,17 +1050,25 @@ defmodule Stripe.Invoice do ( nil - @doc "Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.
\n\nRequests made in test-mode result in no emails being sent, despite sending an invoice.sent
event.
Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your subscriptions settings. However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/invoices/{invoice}/pay`\n" ( - @spec send_invoice( + @spec pay( invoice :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:expand) => list(binary), + optional(:forgive) => boolean, + optional(:mandate) => binary | binary, + optional(:off_session) => boolean, + optional(:paid_out_of_band) => boolean, + optional(:payment_method) => binary, + optional(:source) => binary + }, opts :: Keyword.t() ) :: {:ok, Stripe.Invoice.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def send_invoice(invoice, params \\ %{}, opts \\ []) do + def pay(invoice, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/invoices/{invoice}/send", + "/v1/invoices/{invoice}/pay", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -1099,17 +1099,17 @@ defmodule Stripe.Invoice do ( nil - @doc "Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/invoices/{invoice}/mark_uncollectible`\n" + @doc "Stripe will automatically send invoices to customers according to your subscriptions settings. However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.
\n\nRequests made in test-mode result in no emails being sent, despite sending an invoice.sent
event.
Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/invoiceitems`\n" + @doc "Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/invoiceitems/{invoiceitem}`\n" ( - @spec list( - params :: %{ - optional(:created) => created | integer, - optional(:customer) => binary, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:invoice) => binary, - optional(:limit) => integer, - optional(:pending) => boolean, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Invoiceitem.t())} + @spec delete(invoiceitem :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedInvoiceitem.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/invoiceitems", [], []) + def delete(invoiceitem, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/invoiceitems/{invoiceitem}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "invoiceitem", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "invoiceitem", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [invoiceitem] + ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -124,39 +130,31 @@ defmodule Stripe.Invoiceitem do ( nil - @doc "Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/invoiceitems`\n" + @doc "Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/invoiceitems`\n" ( - @spec create( + @spec list( params :: %{ - optional(:amount) => integer, - optional(:currency) => binary, + optional(:created) => created | integer, optional(:customer) => binary, - optional(:description) => binary, - optional(:discountable) => boolean, - optional(:discounts) => list(discounts) | binary, + optional(:ending_before) => binary, optional(:expand) => list(binary), optional(:invoice) => binary, - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:period) => period, - optional(:price) => binary, - optional(:price_data) => price_data, - optional(:quantity) => integer, - optional(:subscription) => binary, - optional(:tax_behavior) => :exclusive | :inclusive | :unspecified, - optional(:tax_code) => binary | binary, - optional(:tax_rates) => list(binary), - optional(:unit_amount) => integer, - optional(:unit_amount_decimal) => binary + optional(:limit) => integer, + optional(:pending) => boolean, + optional(:starting_after) => binary }, opts :: Keyword.t() - ) :: {:ok, Stripe.Invoiceitem.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + ) :: + {:ok, Stripe.List.t(Stripe.Invoiceitem.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/invoiceitems", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -206,50 +204,34 @@ defmodule Stripe.Invoiceitem do ( nil - @doc "Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it’s attached to is closed.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/invoiceitems/{invoiceitem}`\n" + @doc "Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/invoiceitems`\n" ( - @spec update( - invoiceitem :: binary(), + @spec create( params :: %{ optional(:amount) => integer, + optional(:currency) => binary, + optional(:customer) => binary, optional(:description) => binary, optional(:discountable) => boolean, optional(:discounts) => list(discounts) | binary, optional(:expand) => list(binary), + optional(:invoice) => binary, optional(:metadata) => %{optional(binary) => binary} | binary, optional(:period) => period, optional(:price) => binary, optional(:price_data) => price_data, optional(:quantity) => integer, + optional(:subscription) => binary, optional(:tax_behavior) => :exclusive | :inclusive | :unspecified, optional(:tax_code) => binary | binary, - optional(:tax_rates) => list(binary) | binary, + optional(:tax_rates) => list(binary), optional(:unit_amount) => integer, optional(:unit_amount_decimal) => binary }, opts :: Keyword.t() ) :: {:ok, Stripe.Invoiceitem.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(invoiceitem, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/invoiceitems/{invoiceitem}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "invoiceitem", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "invoiceitem", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [invoiceitem] - ) + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/invoiceitems", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -263,13 +245,30 @@ defmodule Stripe.Invoiceitem do ( nil - @doc "Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/invoiceitems/{invoiceitem}`\n" + @doc "Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it’s attached to is closed.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/invoiceitems/{invoiceitem}`\n" ( - @spec delete(invoiceitem :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedInvoiceitem.t()} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def delete(invoiceitem, opts \\ []) do + @spec update( + invoiceitem :: binary(), + params :: %{ + optional(:amount) => integer, + optional(:description) => binary, + optional(:discountable) => boolean, + optional(:discounts) => list(discounts) | binary, + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:period) => period, + optional(:price) => binary, + optional(:price_data) => price_data, + optional(:quantity) => integer, + optional(:tax_behavior) => :exclusive | :inclusive | :unspecified, + optional(:tax_code) => binary | binary, + optional(:tax_rates) => list(binary) | binary, + optional(:unit_amount) => integer, + optional(:unit_amount_decimal) => binary + }, + opts :: Keyword.t() + ) :: {:ok, Stripe.Invoiceitem.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def update(invoiceitem, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/invoiceitems/{invoiceitem}", @@ -293,7 +292,8 @@ defmodule Stripe.Invoiceitem do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/issuing__authorization.ex b/lib/generated/issuing__authorization.ex index 3ea596a0..0e78305c 100644 --- a/lib/generated/issuing__authorization.ex +++ b/lib/generated/issuing__authorization.ex @@ -744,24 +744,25 @@ defmodule Stripe.Issuing.Authorization do ( nil - @doc "Increment a test-mode Authorization.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/authorizations/{authorization}/increment`\n" + @doc "Capture a test-mode authorization.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/authorizations/{authorization}/capture`\n" ( - @spec increment( + @spec capture( authorization :: binary(), params :: %{ + optional(:capture_amount) => integer, + optional(:close_authorization) => boolean, optional(:expand) => list(binary), - optional(:increment_amount) => integer, - optional(:is_amount_controllable) => boolean + optional(:purchase_details) => purchase_details }, opts :: Keyword.t() ) :: {:ok, Stripe.Issuing.Authorization.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def increment(authorization, params \\ %{}, opts \\ []) do + def capture(authorization, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/issuing/authorizations/{authorization}/increment", + "/v1/test_helpers/issuing/authorizations/{authorization}/capture", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -792,20 +793,20 @@ defmodule Stripe.Issuing.Authorization do ( nil - @doc "Reverse a test-mode Authorization.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/authorizations/{authorization}/reverse`\n" + @doc "Expire a test-mode Authorization.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/authorizations/{authorization}/expire`\n" ( - @spec reverse( + @spec expire( authorization :: binary(), - params :: %{optional(:expand) => list(binary), optional(:reverse_amount) => integer}, + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: {:ok, Stripe.Issuing.Authorization.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def reverse(authorization, params \\ %{}, opts \\ []) do + def expire(authorization, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/issuing/authorizations/{authorization}/reverse", + "/v1/test_helpers/issuing/authorizations/{authorization}/expire", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -836,20 +837,24 @@ defmodule Stripe.Issuing.Authorization do ( nil - @doc "Expire a test-mode Authorization.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/authorizations/{authorization}/expire`\n" + @doc "Increment a test-mode Authorization.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/authorizations/{authorization}/increment`\n" ( - @spec expire( + @spec increment( authorization :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:expand) => list(binary), + optional(:increment_amount) => integer, + optional(:is_amount_controllable) => boolean + }, opts :: Keyword.t() ) :: {:ok, Stripe.Issuing.Authorization.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def expire(authorization, params \\ %{}, opts \\ []) do + def increment(authorization, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/issuing/authorizations/{authorization}/expire", + "/v1/test_helpers/issuing/authorizations/{authorization}/increment", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -880,25 +885,20 @@ defmodule Stripe.Issuing.Authorization do ( nil - @doc "Capture a test-mode authorization.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/authorizations/{authorization}/capture`\n" + @doc "Reverse a test-mode Authorization.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/authorizations/{authorization}/reverse`\n" ( - @spec capture( + @spec reverse( authorization :: binary(), - params :: %{ - optional(:capture_amount) => integer, - optional(:close_authorization) => boolean, - optional(:expand) => list(binary), - optional(:purchase_details) => purchase_details - }, + params :: %{optional(:expand) => list(binary), optional(:reverse_amount) => integer}, opts :: Keyword.t() ) :: {:ok, Stripe.Issuing.Authorization.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def capture(authorization, params \\ %{}, opts \\ []) do + def reverse(authorization, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/issuing/authorizations/{authorization}/capture", + "/v1/test_helpers/issuing/authorizations/{authorization}/reverse", [ %OpenApiGen.Blueprint.Parameter{ in: "path", diff --git a/lib/generated/issuing__card.ex b/lib/generated/issuing__card.ex index c53f0b98..cfb0c642 100644 --- a/lib/generated/issuing__card.ex +++ b/lib/generated/issuing__card.ex @@ -1048,40 +1048,6 @@ defmodule Stripe.Issuing.Card do ) ) - ( - nil - - @doc "Creates an Issuing Card
object.
Creates an Issuing Card
object.
Updates the shipping status of the specified Issuing Card
object to shipped
.
Updates the shipping status of the specified Issuing Card
object to failure
.
Updates the shipping status of the specified Issuing Card
object to failure
.
Updates the shipping status of the specified Issuing Card
object to shipped
.
Creates a new Issuing Cardholder
object that can be issued cards.
Creates a new Issuing Cardholder
object that can be issued cards.
Creates an Issuing Dispute
object. Individual pieces of evidence within the evidence
object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to Dispute reasons and evidence for more details about evidence requirements.
Retrieves an Issuing Dispute
object.
Updates the specified Issuing Dispute
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence
object can be unset by passing in an empty string.
Creates an Issuing Dispute
object. Individual pieces of evidence within the evidence
object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to Dispute reasons and evidence for more details about evidence requirements.
Retrieves an Issuing Dispute
object.
Updates the specified Issuing Dispute
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence
object can be unset by passing in an empty string.
Allows the user to capture an arbitrary amount, also known as a forced capture.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/transactions/create_force_capture`\n" + @doc "Refund a test-mode Transaction.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/transactions/{transaction}/refund`\n" ( - @spec create_force_capture( - params :: %{ - optional(:amount) => integer, - optional(:card) => binary, - optional(:currency) => binary, - optional(:expand) => list(binary), - optional(:merchant_data) => merchant_data, - optional(:purchase_details) => purchase_details - }, + @spec refund( + transaction :: binary(), + params :: %{optional(:expand) => list(binary), optional(:refund_amount) => integer}, opts :: Keyword.t() ) :: {:ok, Stripe.Issuing.Transaction.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create_force_capture(params \\ %{}, opts \\ []) do + def refund(transaction, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/issuing/transactions/create_force_capture", - [], - [] + "/v1/test_helpers/issuing/transactions/{transaction}/refund", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "transaction", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "transaction", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [transaction] ) Stripe.Request.new_request(opts) @@ -597,9 +605,9 @@ defmodule Stripe.Issuing.Transaction do ( nil - @doc "Allows the user to refund an arbitrary amount, also known as a unlinked refund.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/transactions/create_unlinked_refund`\n" + @doc "Allows the user to capture an arbitrary amount, also known as a forced capture.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/transactions/create_force_capture`\n" ( - @spec create_unlinked_refund( + @spec create_force_capture( params :: %{ optional(:amount) => integer, optional(:card) => binary, @@ -613,10 +621,10 @@ defmodule Stripe.Issuing.Transaction do {:ok, Stripe.Issuing.Transaction.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create_unlinked_refund(params \\ %{}, opts \\ []) do + def create_force_capture(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/issuing/transactions/create_unlinked_refund", + "/v1/test_helpers/issuing/transactions/create_force_capture", [], [] ) @@ -633,36 +641,28 @@ defmodule Stripe.Issuing.Transaction do ( nil - @doc "Refund a test-mode Transaction.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/transactions/{transaction}/refund`\n" + @doc "Allows the user to refund an arbitrary amount, also known as a unlinked refund.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/issuing/transactions/create_unlinked_refund`\n" ( - @spec refund( - transaction :: binary(), - params :: %{optional(:expand) => list(binary), optional(:refund_amount) => integer}, + @spec create_unlinked_refund( + params :: %{ + optional(:amount) => integer, + optional(:card) => binary, + optional(:currency) => binary, + optional(:expand) => list(binary), + optional(:merchant_data) => merchant_data, + optional(:purchase_details) => purchase_details + }, opts :: Keyword.t() ) :: {:ok, Stripe.Issuing.Transaction.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def refund(transaction, params \\ %{}, opts \\ []) do + def create_unlinked_refund(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/issuing/transactions/{transaction}/refund", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "transaction", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "transaction", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [transaction] + "/v1/test_helpers/issuing/transactions/create_unlinked_refund", + [], + [] ) Stripe.Request.new_request(opts) diff --git a/lib/generated/payment_intent.ex b/lib/generated/payment_intent.ex index fb4546dd..20c07fda 100644 --- a/lib/generated/payment_intent.ex +++ b/lib/generated/payment_intent.ex @@ -92,11 +92,11 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method." + @typedoc nil @type acss_debit :: %{ - optional(:account_number) => binary, - optional(:institution_number) => binary, - optional(:transit_number) => binary + optional(:mandate_options) => mandate_options, + optional(:setup_future_usage) => :none | :off_session | :on_session, + optional(:verification_method) => :automatic | :instant | :microdeposits } ) @@ -295,8 +295,38 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc nil - @type eps :: %{optional(:setup_future_usage) => :none} + @typedoc "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method." + @type eps :: %{ + optional(:bank) => + :arzte_und_apotheker_bank + | :austrian_anadi_bank_ag + | :bank_austria + | :bankhaus_carl_spangler + | :bankhaus_schelhammer_und_schattera_ag + | :bawag_psk_ag + | :bks_bank_ag + | :brull_kallmus_bank_ag + | :btv_vier_lander_bank + | :capital_bank_grawe_gruppe_ag + | :deutsche_bank_ag + | :dolomitenbank + | :easybank_ag + | :erste_bank_und_sparkassen + | :hypo_alpeadriabank_international_ag + | :hypo_bank_burgenland_aktiengesellschaft + | :hypo_noe_lb_fur_niederosterreich_u_wien + | :hypo_oberosterreich_salzburg_steiermark + | :hypo_tirol_bank_ag + | :hypo_vorarlberg_bank_ag + | :marchfelder_bank + | :oberbank_ag + | :raiffeisen_bankengruppe_osterreich + | :schoellerbank_ag + | :sparda_bank_wien + | :volksbank_gruppe + | :volkskreditbank_ag + | :vr_bank_braunau + } ) ( @@ -315,8 +345,33 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc nil - @type fpx :: %{optional(:setup_future_usage) => :none} + @typedoc "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method." + @type fpx :: %{ + optional(:account_holder_type) => :company | :individual, + optional(:bank) => + :affin_bank + | :agrobank + | :alliance_bank + | :ambank + | :bank_islam + | :bank_muamalat + | :bank_of_china + | :bank_rakyat + | :bsn + | :cimb + | :deutsche_bank + | :hong_leong_bank + | :hsbc + | :kfh + | :maybank2e + | :maybank2u + | :ocbc + | :pb_enterprise + | :public_bank + | :rhb + | :standard_chartered + | :uob + } ) ( @@ -330,25 +385,8 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method." - @type ideal :: %{ - optional(:bank) => - :abn_amro - | :asn_bank - | :bunq - | :handelsbanken - | :ing - | :knab - | :moneyou - | :n26 - | :rabobank - | :regiobank - | :revolut - | :sns_bank - | :triodos_bank - | :van_lanschot - | :yoursafe - } + @typedoc nil + @type ideal :: %{optional(:setup_future_usage) => :none | :off_session} ) ( @@ -357,56 +395,8 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc nil - @type klarna :: %{ - optional(:capture_method) => :manual, - optional(:preferred_locale) => - :"cs-CZ" - | :"da-DK" - | :"de-AT" - | :"de-CH" - | :"de-DE" - | :"el-GR" - | :"en-AT" - | :"en-AU" - | :"en-BE" - | :"en-CA" - | :"en-CH" - | :"en-CZ" - | :"en-DE" - | :"en-DK" - | :"en-ES" - | :"en-FI" - | :"en-FR" - | :"en-GB" - | :"en-GR" - | :"en-IE" - | :"en-IT" - | :"en-NL" - | :"en-NO" - | :"en-NZ" - | :"en-PL" - | :"en-PT" - | :"en-SE" - | :"en-US" - | :"es-ES" - | :"es-US" - | :"fi-FI" - | :"fr-BE" - | :"fr-CA" - | :"fr-CH" - | :"fr-FR" - | :"it-CH" - | :"it-IT" - | :"nb-NO" - | :"nl-BE" - | :"nl-NL" - | :"pl-PL" - | :"pt-PT" - | :"sv-FI" - | :"sv-SE", - optional(:setup_future_usage) => :none - } + @typedoc "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method." + @type klarna :: %{optional(:dob) => dob} ) ( @@ -664,11 +654,8 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc nil - @type sepa_debit :: %{ - optional(:mandate_options) => map(), - optional(:setup_future_usage) => :none | :off_session | :on_session - } + @typedoc "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account." + @type sepa_debit :: %{optional(:iban) => binary} ) ( @@ -734,6 +721,79 @@ defmodule Stripe.PaymentIntent do @type zip :: %{optional(:setup_future_usage) => :none} ) + ( + nil + + @doc "Returns a list of PaymentIntents.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/payment_intents`\n" + ( + @spec list( + params :: %{ + optional(:created) => created | integer, + optional(:customer) => binary, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.PaymentIntent.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/payment_intents", [], []) + + 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 "Retrieves the details of a PaymentIntent that has previously been created.
\n\nYou can retrieve a PaymentIntent client-side using a publishable key when the client_secret
is in the query string.
If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the payment intent object reference for more details.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/payment_intents/{intent}`\n" + ( + @spec retrieve( + intent :: binary(), + params :: %{optional(:client_secret) => binary, optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: + {:ok, Stripe.PaymentIntent.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def retrieve(intent, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/payment_intents/{intent}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "intent", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "intent", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [intent] + ) + + 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 @@ -817,79 +877,6 @@ defmodule Stripe.PaymentIntent do ) ) - ( - nil - - @doc "Returns a list of PaymentIntents.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/payment_intents`\n" - ( - @spec list( - params :: %{ - optional(:created) => created | integer, - optional(:customer) => binary, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.PaymentIntent.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/payment_intents", [], []) - - 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 "Retrieves the details of a PaymentIntent that has previously been created.
\n\nYou can retrieve a PaymentIntent client-side using a publishable key when the client_secret
is in the query string.
If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the payment intent object reference for more details.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/payment_intents/{intent}`\n" - ( - @spec retrieve( - intent :: binary(), - params :: %{optional(:client_secret) => binary, optional(:expand) => list(binary)}, - opts :: Keyword.t() - ) :: - {:ok, Stripe.PaymentIntent.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(intent, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/payment_intents/{intent}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "intent", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "intent", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [intent] - ) - - 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 @@ -956,34 +943,22 @@ defmodule Stripe.PaymentIntent do ( nil - @doc "Confirm that your customer intends to pay with current or provided\npayment method. Upon confirmation, the PaymentIntent will attempt to initiate\na payment.\nIf the selected payment method requires additional authentication steps, the\nPaymentIntent will transition to the requires_action
status and\nsuggest additional actions via next_action
. If payment fails,\nthe PaymentIntent transitions to the requires_payment_method
status or the\ncanceled
status if the confirmation limit is reached. If\npayment succeeds, the PaymentIntent will transition to the succeeded
\nstatus (or requires_capture
, if capture_method
is set to manual
).\nIf the confirmation_method
is automatic
, payment may be attempted\nusing our client SDKs\nand the PaymentIntent’s client_secret.\nAfter next_action
s are handled by the client, no additional\nconfirmation is required to complete the payment.\nIf the confirmation_method
is manual
, all payment attempts must be\ninitiated using a secret key.\nIf any actions are required for the payment, the PaymentIntent will\nreturn to the requires_confirmation
state\nafter those actions are completed. Your server needs to then\nexplicitly re-confirm the PaymentIntent to initiate the next payment\nattempt. Read the expanded documentation\nto learn more about manual confirmation.
Manually reconcile the remaining amount for a customer_balance
PaymentIntent.
Perform an incremental authorization on an eligible\nPaymentIntent. To be eligible, the\nPaymentIntent’s status must be requires_capture
and\nincremental_authorization_supported\nmust be true
.
Incremental authorizations attempt to increase the authorized amount on\nyour customer’s card to the new, higher amount
provided. Similar to the\ninitial authorization, incremental authorizations can be declined. A\nsingle PaymentIntent can call this endpoint multiple times to further\nincrease the authorized amount.
If the incremental authorization succeeds, the PaymentIntent object\nreturns with the updated\namount.\nIf the incremental authorization fails, a\ncard_declined error returns, and no other\nfields on the PaymentIntent or Charge update. The PaymentIntent\nobject remains capturable for the previously authorized amount.
\n\nEach PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.\nAfter it’s captured, a PaymentIntent can no longer be incremented.
\n\nLearn more about incremental authorizations.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_intents/{intent}/increment_authorization`\n" + @doc "Confirm that your customer intends to pay with current or provided\npayment method. Upon confirmation, the PaymentIntent will attempt to initiate\na payment.\nIf the selected payment method requires additional authentication steps, the\nPaymentIntent will transition to the requires_action
status and\nsuggest additional actions via next_action
. If payment fails,\nthe PaymentIntent transitions to the requires_payment_method
status or the\ncanceled
status if the confirmation limit is reached. If\npayment succeeds, the PaymentIntent will transition to the succeeded
\nstatus (or requires_capture
, if capture_method
is set to manual
).\nIf the confirmation_method
is automatic
, payment may be attempted\nusing our client SDKs\nand the PaymentIntent’s client_secret.\nAfter next_action
s are handled by the client, no additional\nconfirmation is required to complete the payment.\nIf the confirmation_method
is manual
, all payment attempts must be\ninitiated using a secret key.\nIf any actions are required for the payment, the PaymentIntent will\nreturn to the requires_confirmation
state\nafter those actions are completed. Your server needs to then\nexplicitly re-confirm the PaymentIntent to initiate the next payment\nattempt. Read the expanded documentation\nto learn more about manual confirmation.
Verifies microdeposits on a PaymentIntent object.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_intents/{intent}/verify_microdeposits`\n" + @doc "Perform an incremental authorization on an eligible\nPaymentIntent. To be eligible, the\nPaymentIntent’s status must be requires_capture
and\nincremental_authorization_supported\nmust be true
.
Incremental authorizations attempt to increase the authorized amount on\nyour customer’s card to the new, higher amount
provided. Similar to the\ninitial authorization, incremental authorizations can be declined. A\nsingle PaymentIntent can call this endpoint multiple times to further\nincrease the authorized amount.
If the incremental authorization succeeds, the PaymentIntent object\nreturns with the updated\namount.\nIf the incremental authorization fails, a\ncard_declined error returns, and no other\nfields on the PaymentIntent or Charge update. The PaymentIntent\nobject remains capturable for the previously authorized amount.
\n\nEach PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.\nAfter it’s captured, a PaymentIntent can no longer be incremented.
\n\nLearn more about incremental authorizations.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_intents/{intent}/increment_authorization`\n" ( - @spec verify_microdeposits( + @spec increment_authorization( intent :: binary(), params :: %{ - optional(:amounts) => list(integer), - optional(:descriptor_code) => binary, - optional(:expand) => list(binary) + optional(:amount) => integer, + optional(:application_fee_amount) => integer, + optional(:description) => binary, + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary}, + optional(:statement_descriptor) => binary, + optional(:transfer_data) => transfer_data }, opts :: Keyword.t() ) :: {:ok, Stripe.PaymentIntent.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def verify_microdeposits(intent, params \\ %{}, opts \\ []) do + def increment_authorization(intent, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/payment_intents/{intent}/verify_microdeposits", + "/v1/payment_intents/{intent}/increment_authorization", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -1207,22 +1194,22 @@ defmodule Stripe.PaymentIntent do ( nil - @doc "Manually reconcile the remaining amount for a customer_balance
PaymentIntent.
Verifies microdeposits on a PaymentIntent object.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_intents/{intent}/verify_microdeposits`\n" ( - @spec apply_customer_balance( + @spec verify_microdeposits( intent :: binary(), params :: %{ - optional(:amount) => integer, - optional(:currency) => binary, + optional(:amounts) => list(integer), + optional(:descriptor_code) => binary, optional(:expand) => list(binary) }, opts :: Keyword.t() ) :: {:ok, Stripe.PaymentIntent.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def apply_customer_balance(intent, params \\ %{}, opts \\ []) do + def verify_microdeposits(intent, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/payment_intents/{intent}/apply_customer_balance", + "/v1/payment_intents/{intent}/verify_microdeposits", [ %OpenApiGen.Blueprint.Parameter{ in: "path", diff --git a/lib/generated/payment_method.ex b/lib/generated/payment_method.ex index 42991cc7..da37c1ff 100644 --- a/lib/generated/payment_method.ex +++ b/lib/generated/payment_method.ex @@ -315,41 +315,15 @@ defmodule Stripe.PaymentMethod do ( nil - @doc "Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.
\n\nInstead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_methods`\n" + @doc "Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the List a Customer’s PaymentMethods API instead.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/payment_methods`\n" ( - @spec create( + @spec list( params :: %{ - optional(:pix) => map(), - optional(:payment_method) => binary, - optional(:fpx) => fpx, - optional(:affirm) => map(), - optional(:acss_debit) => acss_debit, - optional(:bacs_debit) => bacs_debit, - optional(:alipay) => map(), - optional(:giropay) => map(), - optional(:ideal) => ideal, - optional(:revolut_pay) => map(), - optional(:expand) => list(binary), - optional(:card) => card | card, - optional(:radar_options) => radar_options, - optional(:metadata) => %{optional(binary) => binary}, - optional(:link) => map(), - optional(:promptpay) => map(), - optional(:cashapp) => map(), - optional(:oxxo) => map(), - optional(:interac_present) => map(), optional(:customer) => binary, - optional(:us_bank_account) => us_bank_account, - optional(:zip) => map(), - optional(:paypal) => map(), - optional(:boleto) => boleto, - optional(:konbini) => map(), - optional(:billing_details) => billing_details, - optional(:blik) => map(), - optional(:wechat_pay) => map(), - optional(:sofort) => sofort, - optional(:p24) => p24, - optional(:afterpay_clearpay) => map(), + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary, optional(:type) => :acss_debit | :affirm @@ -382,26 +356,20 @@ defmodule Stripe.PaymentMethod do | :sofort | :us_bank_account | :wechat_pay - | :zip, - optional(:grabpay) => map(), - optional(:bancontact) => map(), - optional(:au_becs_debit) => au_becs_debit, - optional(:customer_balance) => map(), - optional(:sepa_debit) => sepa_debit, - optional(:klarna) => klarna, - optional(:paynow) => map(), - optional(:eps) => eps + | :zip }, opts :: Keyword.t() ) :: - {:ok, Stripe.PaymentMethod.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + {:ok, Stripe.List.t(Stripe.PaymentMethod.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/payment_methods", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -452,64 +420,41 @@ defmodule Stripe.PaymentMethod do ( nil - @doc "Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_methods/{payment_method}`\n" + @doc "Creates a PaymentMethod object. Read the Stripe.js reference to learn how to create PaymentMethods via Stripe.js.
\n\nInstead of creating a PaymentMethod directly, we recommend using the PaymentIntents API to accept a payment immediately or the SetupIntent API to collect payment method details ahead of a future payment.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_methods`\n" ( - @spec update( - payment_method :: binary(), + @spec create( params :: %{ - optional(:billing_details) => billing_details, - optional(:card) => card, + optional(:pix) => map(), + optional(:payment_method) => binary, + optional(:fpx) => fpx, + optional(:affirm) => map(), + optional(:acss_debit) => acss_debit, + optional(:bacs_debit) => bacs_debit, + optional(:alipay) => map(), + optional(:giropay) => map(), + optional(:ideal) => ideal, + optional(:revolut_pay) => map(), optional(:expand) => list(binary), + optional(:card) => card | card, + optional(:radar_options) => radar_options, + optional(:metadata) => %{optional(binary) => binary}, optional(:link) => map(), - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:us_bank_account) => us_bank_account - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.PaymentMethod.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(payment_method, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/payment_methods/{payment_method}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "payment_method", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "payment_method", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [payment_method] - ) - - 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 - ) - ) - - ( - nil - - @doc "Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the List a Customer’s PaymentMethods API instead.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/payment_methods`\n" - ( - @spec list( - params :: %{ + optional(:promptpay) => map(), + optional(:cashapp) => map(), + optional(:oxxo) => map(), + optional(:interac_present) => map(), optional(:customer) => binary, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary, + optional(:us_bank_account) => us_bank_account, + optional(:zip) => map(), + optional(:paypal) => map(), + optional(:boleto) => boleto, + optional(:konbini) => map(), + optional(:billing_details) => billing_details, + optional(:blik) => map(), + optional(:wechat_pay) => map(), + optional(:sofort) => sofort, + optional(:p24) => p24, + optional(:afterpay_clearpay) => map(), optional(:type) => :acss_debit | :affirm @@ -542,20 +487,75 @@ defmodule Stripe.PaymentMethod do | :sofort | :us_bank_account | :wechat_pay - | :zip + | :zip, + optional(:grabpay) => map(), + optional(:bancontact) => map(), + optional(:au_becs_debit) => au_becs_debit, + optional(:customer_balance) => map(), + optional(:sepa_debit) => sepa_debit, + optional(:klarna) => klarna, + optional(:paynow) => map(), + optional(:eps) => eps }, opts :: Keyword.t() ) :: - {:ok, Stripe.List.t(Stripe.PaymentMethod.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do + {:ok, Stripe.PaymentMethod.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def create(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/payment_methods", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) + |> Stripe.Request.make_request() + end + ) + ) + + ( + nil + + @doc "Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_methods/{payment_method}`\n" + ( + @spec update( + payment_method :: binary(), + params :: %{ + optional(:billing_details) => billing_details, + optional(:card) => card, + optional(:expand) => list(binary), + optional(:link) => map(), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:us_bank_account) => us_bank_account + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.PaymentMethod.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def update(payment_method, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/payment_methods/{payment_method}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "payment_method", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "payment_method", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [payment_method] + ) + + 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 ) diff --git a/lib/generated/payment_method_configuration.ex b/lib/generated/payment_method_configuration.ex index e26450bb..9ec3766f 100644 --- a/lib/generated/payment_method_configuration.ex +++ b/lib/generated/payment_method_configuration.ex @@ -343,10 +343,9 @@ defmodule Stripe.PaymentMethodConfiguration do ( nil - @doc "Update payment method configuration
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_method_configurations/{configuration}`\n" + @doc "Creates a payment method configuration
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_method_configurations`\n" ( - @spec update( - configuration :: binary(), + @spec create( params :: %{ optional(:fpx) => fpx, optional(:name) => binary, @@ -359,7 +358,6 @@ defmodule Stripe.PaymentMethodConfiguration do optional(:revolut_pay) => revolut_pay, optional(:expand) => list(binary), optional(:card) => card, - optional(:active) => boolean, optional(:link) => link, optional(:promptpay) => promptpay, optional(:cashapp) => cashapp, @@ -379,6 +377,7 @@ defmodule Stripe.PaymentMethodConfiguration do optional(:cartes_bancaires) => cartes_bancaires, optional(:grabpay) => grabpay, optional(:apple_pay_later) => apple_pay_later, + optional(:parent) => binary, optional(:bancontact) => bancontact, optional(:au_becs_debit) => au_becs_debit, optional(:sepa_debit) => sepa_debit, @@ -391,27 +390,9 @@ defmodule Stripe.PaymentMethodConfiguration do {:ok, Stripe.PaymentMethodConfiguration.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(configuration, params \\ %{}, opts \\ []) do + def create(params \\ %{}, opts \\ []) do path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/payment_method_configurations/{configuration}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "configuration", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "configuration", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [configuration] - ) + Stripe.OpenApi.Path.replace_path_params("/v1/payment_method_configurations", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -425,9 +406,10 @@ defmodule Stripe.PaymentMethodConfiguration do ( nil - @doc "Creates a payment method configuration
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_method_configurations`\n" + @doc "Update payment method configuration
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/payment_method_configurations/{configuration}`\n" ( - @spec create( + @spec update( + configuration :: binary(), params :: %{ optional(:fpx) => fpx, optional(:name) => binary, @@ -440,6 +422,7 @@ defmodule Stripe.PaymentMethodConfiguration do optional(:revolut_pay) => revolut_pay, optional(:expand) => list(binary), optional(:card) => card, + optional(:active) => boolean, optional(:link) => link, optional(:promptpay) => promptpay, optional(:cashapp) => cashapp, @@ -459,7 +442,6 @@ defmodule Stripe.PaymentMethodConfiguration do optional(:cartes_bancaires) => cartes_bancaires, optional(:grabpay) => grabpay, optional(:apple_pay_later) => apple_pay_later, - optional(:parent) => binary, optional(:bancontact) => bancontact, optional(:au_becs_debit) => au_becs_debit, optional(:sepa_debit) => sepa_debit, @@ -472,9 +454,27 @@ defmodule Stripe.PaymentMethodConfiguration do {:ok, Stripe.PaymentMethodConfiguration.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + def update(configuration, params \\ %{}, opts \\ []) do path = - Stripe.OpenApi.Path.replace_path_params("/v1/payment_method_configurations", [], []) + Stripe.OpenApi.Path.replace_path_params( + "/v1/payment_method_configurations/{configuration}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "configuration", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "configuration", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [configuration] + ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) diff --git a/lib/generated/payment_method_domain.ex b/lib/generated/payment_method_domain.ex index dc2c98d2..21679b27 100644 --- a/lib/generated/payment_method_domain.ex +++ b/lib/generated/payment_method_domain.ex @@ -31,6 +31,37 @@ defmodule Stripe.PaymentMethodDomain do } ) + ( + nil + + @doc "Lists the details of existing payment method domains.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/payment_method_domains`\n" + ( + @spec list( + params :: %{ + optional(:domain_name) => binary, + optional(:enabled) => boolean, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.PaymentMethodDomain.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/payment_method_domains", [], []) + + 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 @@ -75,37 +106,6 @@ defmodule Stripe.PaymentMethodDomain do ) ) - ( - nil - - @doc "Lists the details of existing payment method domains.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/payment_method_domains`\n" - ( - @spec list( - params :: %{ - optional(:domain_name) => binary, - optional(:enabled) => boolean, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.PaymentMethodDomain.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/payment_method_domains", [], []) - - 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 diff --git a/lib/generated/payout.ex b/lib/generated/payout.ex index bf2acbcb..5a9098ed 100644 --- a/lib/generated/payout.ex +++ b/lib/generated/payout.ex @@ -78,6 +78,39 @@ defmodule Stripe.Payout do } ) + ( + nil + + @doc "Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/payouts`\n" + ( + @spec list( + params :: %{ + optional(:arrival_date) => arrival_date | integer, + optional(:created) => created | integer, + optional(:destination) => binary, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary, + optional(:status) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Payout.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/payouts", [], []) + + 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 @@ -119,39 +152,6 @@ defmodule Stripe.Payout do ) ) - ( - nil - - @doc "Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/payouts`\n" - ( - @spec list( - params :: %{ - optional(:arrival_date) => arrival_date | integer, - optional(:created) => created | integer, - optional(:destination) => binary, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary, - optional(:status) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Payout.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/payouts", [], []) - - 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 diff --git a/lib/generated/person.ex b/lib/generated/person.ex index 807556c3..a25854e7 100644 --- a/lib/generated/person.ex +++ b/lib/generated/person.ex @@ -199,6 +199,56 @@ defmodule Stripe.Person do @type visa :: %{optional(:files) => list(binary | binary)} ) + ( + nil + + @doc "Deletes an existing person’s relationship to the account’s legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener
. If your integration is using the executive
parameter, you cannot delete the only verified executive
on file.
Deletes an existing person’s relationship to the account’s legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener
. If your integration is using the executive
parameter, you cannot delete the only verified executive
on file.
Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/plans/{plan}`\n" + ( + @spec delete(plan :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedPlan.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def delete(plan, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/plans/{plan}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "plan", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "plan", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [plan] + ) + + Stripe.Request.new_request(opts) + |> Stripe.Request.put_endpoint(path) + |> Stripe.Request.put_method(:delete) + |> Stripe.Request.make_request() + end + ) + ) + ( nil @@ -122,46 +159,6 @@ defmodule Stripe.Plan do ) ) - ( - nil - - @doc "You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/plans`\n" - ( - @spec create( - params :: %{ - optional(:active) => boolean, - optional(:aggregate_usage) => :last_during_period | :last_ever | :max | :sum, - optional(:amount) => integer, - optional(:amount_decimal) => binary, - optional(:billing_scheme) => :per_unit | :tiered, - optional(:currency) => binary, - optional(:expand) => list(binary), - optional(:id) => binary, - optional(:interval) => :day | :month | :week | :year, - optional(:interval_count) => integer, - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:nickname) => binary, - optional(:product) => product | binary, - optional(:tiers) => list(tiers), - optional(:tiers_mode) => :graduated | :volume, - optional(:transform_usage) => transform_usage, - optional(:trial_period_days) => integer, - optional(:usage_type) => :licensed | :metered - }, - opts :: Keyword.t() - ) :: {:ok, Stripe.Plan.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/plans", [], []) - - 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 - ) - ) - ( nil @@ -206,41 +203,33 @@ defmodule Stripe.Plan do ( nil - @doc "Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/plans/{plan}`\n" + @doc "You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/plans`\n" ( - @spec update( - plan :: binary(), + @spec create( params :: %{ optional(:active) => boolean, + optional(:aggregate_usage) => :last_during_period | :last_ever | :max | :sum, + optional(:amount) => integer, + optional(:amount_decimal) => binary, + optional(:billing_scheme) => :per_unit | :tiered, + optional(:currency) => binary, optional(:expand) => list(binary), + optional(:id) => binary, + optional(:interval) => :day | :month | :week | :year, + optional(:interval_count) => integer, optional(:metadata) => %{optional(binary) => binary} | binary, optional(:nickname) => binary, - optional(:product) => binary, - optional(:trial_period_days) => integer + optional(:product) => product | binary, + optional(:tiers) => list(tiers), + optional(:tiers_mode) => :graduated | :volume, + optional(:transform_usage) => transform_usage, + optional(:trial_period_days) => integer, + optional(:usage_type) => :licensed | :metered }, opts :: Keyword.t() ) :: {:ok, Stripe.Plan.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(plan, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/plans/{plan}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "plan", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "plan", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [plan] - ) + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/plans", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -254,11 +243,21 @@ defmodule Stripe.Plan do ( nil - @doc "Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/plans/{plan}`\n" + @doc "Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/plans/{plan}`\n" ( - @spec delete(plan :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedPlan.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(plan, opts \\ []) do + @spec update( + plan :: binary(), + params :: %{ + optional(:active) => boolean, + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:nickname) => binary, + optional(:product) => binary, + optional(:trial_period_days) => integer + }, + opts :: Keyword.t() + ) :: {:ok, Stripe.Plan.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def update(plan, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/plans/{plan}", @@ -282,7 +281,8 @@ defmodule Stripe.Plan do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/price.ex b/lib/generated/price.ex index 80d3c1f6..c0015a61 100644 --- a/lib/generated/price.ex +++ b/lib/generated/price.ex @@ -116,22 +116,29 @@ defmodule Stripe.Price do ( nil - @doc "Search for prices you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/prices/search`\n" + @doc "Returns a list of your active prices, excluding inline prices. For the list of inactive prices, set active
to false.
Returns a list of your active prices, excluding inline prices. For the list of inactive prices, set active
to false.
Retrieves the price with the given ID.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/prices/{price}`\n" ( - @spec list( + @spec retrieve( + price :: binary(), + params :: %{optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: {:ok, Stripe.Price.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def retrieve(price, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/prices/{price}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "price", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "price", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [price] + ) + + 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 "Search for prices you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/prices/search`\n" + ( + @spec search( params :: %{ - optional(:active) => boolean, - optional(:created) => created | integer, - optional(:currency) => binary, - optional(:ending_before) => binary, optional(:expand) => list(binary), optional(:limit) => integer, - optional(:lookup_keys) => list(binary), - optional(:product) => binary, - optional(:recurring) => recurring, - optional(:starting_after) => binary, - optional(:type) => :one_time | :recurring + optional(:page) => binary, + optional(:query) => binary }, opts :: Keyword.t() ) :: - {:ok, Stripe.List.t(Stripe.Price.t())} + {:ok, Stripe.SearchResult.t(Stripe.Price.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/prices", [], []) + def search(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/prices/search", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -219,47 +260,6 @@ defmodule Stripe.Price do ) ) - ( - nil - - @doc "Retrieves the price with the given ID.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/prices/{price}`\n" - ( - @spec retrieve( - price :: binary(), - params :: %{optional(:expand) => list(binary)}, - opts :: Keyword.t() - ) :: {:ok, Stripe.Price.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(price, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/prices/{price}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "price", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "price", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [price] - ) - - 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 diff --git a/lib/generated/product.ex b/lib/generated/product.ex index a489e7a4..63c23ac2 100644 --- a/lib/generated/product.ex +++ b/lib/generated/product.ex @@ -97,27 +97,35 @@ defmodule Stripe.Product do ( nil - @doc "Search for products you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/products/search`\n" + @doc "Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good
is only possible if it has no SKUs associated with it.
Creates a new product object.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/products`\n" + @doc "Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/products`\n" ( - @spec create( + @spec list( params :: %{ optional(:active) => boolean, - optional(:default_price_data) => default_price_data, - optional(:description) => binary, + optional(:created) => created | integer, + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:features) => list(features), - optional(:id) => binary, - optional(:images) => list(binary), - optional(:metadata) => %{optional(binary) => binary}, - optional(:name) => binary, - optional(:package_dimensions) => package_dimensions, + optional(:ids) => list(binary), + optional(:limit) => integer, optional(:shippable) => boolean, - optional(:statement_descriptor) => binary, - optional(:tax_code) => binary, + optional(:starting_after) => binary, optional(:type) => :good | :service, - optional(:unit_label) => binary, optional(:url) => binary }, opts :: Keyword.t() - ) :: {:ok, Stripe.Product.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + ) :: + {:ok, Stripe.List.t(Stripe.Product.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/products", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -205,54 +210,27 @@ defmodule Stripe.Product do ( nil - @doc "Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/products/{id}`\n" + @doc "Search for products you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/products/search`\n" ( - @spec update( - id :: binary(), + @spec search( params :: %{ - optional(:active) => boolean, - optional(:default_price) => binary, - optional(:description) => binary | binary, optional(:expand) => list(binary), - optional(:features) => list(features) | binary, - optional(:images) => list(binary) | binary, - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:name) => binary, - optional(:package_dimensions) => package_dimensions | binary, - optional(:shippable) => boolean, - optional(:statement_descriptor) => binary, - optional(:tax_code) => binary | binary, - optional(:unit_label) => binary | binary, - optional(:url) => binary | binary + optional(:limit) => integer, + optional(:page) => binary, + optional(:query) => binary }, opts :: Keyword.t() - ) :: {:ok, Stripe.Product.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(id, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/products/{id}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "id", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "id", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [id] - ) + ) :: + {:ok, Stripe.SearchResult.t(Stripe.Product.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def search(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/products/search", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -261,33 +239,36 @@ defmodule Stripe.Product do ( nil - @doc "Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/products`\n" + @doc "Creates a new product object.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/products`\n" ( - @spec list( + @spec create( params :: %{ optional(:active) => boolean, - optional(:created) => created | integer, - optional(:ending_before) => binary, + optional(:default_price_data) => default_price_data, + optional(:description) => binary, optional(:expand) => list(binary), - optional(:ids) => list(binary), - optional(:limit) => integer, + optional(:features) => list(features), + optional(:id) => binary, + optional(:images) => list(binary), + optional(:metadata) => %{optional(binary) => binary}, + optional(:name) => binary, + optional(:package_dimensions) => package_dimensions, optional(:shippable) => boolean, - optional(:starting_after) => binary, + optional(:statement_descriptor) => binary, + optional(:tax_code) => binary, optional(:type) => :good | :service, + optional(:unit_label) => binary, optional(:url) => binary }, opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Product.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do + ) :: {:ok, Stripe.Product.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def create(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/products", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) @@ -296,11 +277,29 @@ defmodule Stripe.Product do ( nil - @doc "Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good
is only possible if it has no SKUs associated with it.
Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/products/{id}`\n" ( - @spec delete(id :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedProduct.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(id, opts \\ []) do + @spec update( + id :: binary(), + params :: %{ + optional(:active) => boolean, + optional(:default_price) => binary, + optional(:description) => binary | binary, + optional(:expand) => list(binary), + optional(:features) => list(features) | binary, + optional(:images) => list(binary) | binary, + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:name) => binary, + optional(:package_dimensions) => package_dimensions | binary, + optional(:shippable) => boolean, + optional(:statement_descriptor) => binary, + optional(:tax_code) => binary | binary, + optional(:unit_label) => binary | binary, + optional(:url) => binary | binary + }, + opts :: Keyword.t() + ) :: {:ok, Stripe.Product.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def update(id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/products/{id}", @@ -324,7 +323,8 @@ defmodule Stripe.Product do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/promotion_code.ex b/lib/generated/promotion_code.ex index fcd29994..09079abd 100644 --- a/lib/generated/promotion_code.ex +++ b/lib/generated/promotion_code.ex @@ -57,6 +57,40 @@ defmodule Stripe.PromotionCode do } ) + ( + nil + + @doc "Returns a list of your promotion codes.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/promotion_codes`\n" + ( + @spec list( + params :: %{ + optional(:active) => boolean, + optional(:code) => binary, + optional(:coupon) => binary, + optional(:created) => created | integer, + optional(:customer) => binary, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.PromotionCode.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/promotion_codes", [], []) + + 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 @@ -177,38 +211,4 @@ defmodule Stripe.PromotionCode do end ) ) - - ( - nil - - @doc "Returns a list of your promotion codes.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/promotion_codes`\n" - ( - @spec list( - params :: %{ - optional(:active) => boolean, - optional(:code) => binary, - optional(:coupon) => binary, - optional(:created) => created | integer, - optional(:customer) => binary, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.PromotionCode.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/promotion_codes", [], []) - - 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 - ) - ) end diff --git a/lib/generated/quote.ex b/lib/generated/quote.ex index d8d10d93..f6514107 100644 --- a/lib/generated/quote.ex +++ b/lib/generated/quote.ex @@ -150,6 +150,38 @@ defmodule Stripe.Quote do } ) + ( + nil + + @doc "Returns a list of your quotes.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/quotes`\n" + ( + @spec list( + params :: %{ + optional(:customer) => binary, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary, + optional(:status) => :accepted | :canceled | :draft | :open, + optional(:test_clock) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Quote.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/quotes", [], []) + + 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 @@ -194,78 +226,25 @@ defmodule Stripe.Quote do ( nil - @doc "A quote models prices and services for a customer. Default options for header
, description
, footer
, and expires_at
can be set in the dashboard via the quote template.
A quote models prices and services for a customer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/quotes/{quote}`\n" + @doc "When retrieving a quote, there is an includable computed.upfront.line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/quotes/{quote}/computed_upfront_line_items`\n" ( - @spec update( + @spec list_computed_upfront_line_items( quote :: binary(), params :: %{ - optional(:application_fee_amount) => integer | binary, - optional(:application_fee_percent) => number | binary, - optional(:automatic_tax) => automatic_tax, - optional(:collection_method) => :charge_automatically | :send_invoice, - optional(:customer) => binary, - optional(:default_tax_rates) => list(binary) | binary, - optional(:description) => binary | binary, - optional(:discounts) => list(discounts) | binary, + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:expires_at) => integer, - optional(:footer) => binary | binary, - optional(:header) => binary | binary, - optional(:invoice_settings) => invoice_settings, - optional(:line_items) => list(line_items), - optional(:metadata) => %{optional(binary) => binary}, - optional(:on_behalf_of) => binary | binary, - optional(:subscription_data) => subscription_data, - optional(:transfer_data) => transfer_data | binary + optional(:limit) => integer, + optional(:starting_after) => binary }, opts :: Keyword.t() - ) :: {:ok, Stripe.Quote.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(quote, params \\ %{}, opts \\ []) do + ) :: + {:ok, Stripe.List.t(Stripe.Item.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list_computed_upfront_line_items(quote, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/quotes/{quote}", + "/v1/quotes/{quote}/computed_upfront_line_items", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -287,7 +266,7 @@ defmodule Stripe.Quote do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -296,17 +275,25 @@ defmodule Stripe.Quote do ( nil - @doc "Cancels the quote.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/quotes/{quote}/cancel`\n" + @doc "When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/quotes/{quote}/line_items`\n" ( - @spec cancel( + @spec list_line_items( quote :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, opts :: Keyword.t() - ) :: {:ok, Stripe.Quote.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def cancel(quote, params \\ %{}, opts \\ []) do + ) :: + {:ok, Stripe.List.t(Stripe.Item.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list_line_items(quote, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/quotes/{quote}/cancel", + "/v1/quotes/{quote}/line_items", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -325,6 +312,48 @@ defmodule Stripe.Quote do [quote] ) + 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 "A quote models prices and services for a customer. Default options for header
, description
, footer
, and expires_at
can be set in the dashboard via the quote template.
Finalizes the quote.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/quotes/{quote}/finalize`\n" + @doc "A quote models prices and services for a customer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/quotes/{quote}`\n" ( - @spec finalize_quote( + @spec update( quote :: binary(), - params :: %{optional(:expand) => list(binary), optional(:expires_at) => integer}, + params :: %{ + optional(:application_fee_amount) => integer | binary, + optional(:application_fee_percent) => number | binary, + optional(:automatic_tax) => automatic_tax, + optional(:collection_method) => :charge_automatically | :send_invoice, + optional(:customer) => binary, + optional(:default_tax_rates) => list(binary) | binary, + optional(:description) => binary | binary, + optional(:discounts) => list(discounts) | binary, + optional(:expand) => list(binary), + optional(:expires_at) => integer, + optional(:footer) => binary | binary, + optional(:header) => binary | binary, + optional(:invoice_settings) => invoice_settings, + optional(:line_items) => list(line_items), + optional(:metadata) => %{optional(binary) => binary}, + optional(:on_behalf_of) => binary | binary, + optional(:subscription_data) => subscription_data, + optional(:transfer_data) => transfer_data | binary + }, opts :: Keyword.t() ) :: {:ok, Stripe.Quote.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def finalize_quote(quote, params \\ %{}, opts \\ []) do + def update(quote, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/quotes/{quote}/finalize", + "/v1/quotes/{quote}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -419,57 +467,17 @@ defmodule Stripe.Quote do ( nil - @doc "Returns a list of your quotes.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/quotes`\n" - ( - @spec list( - params :: %{ - optional(:customer) => binary, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary, - optional(:status) => :accepted | :canceled | :draft | :open, - optional(:test_clock) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Quote.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/quotes", [], []) - - 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 "When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/quotes/{quote}/line_items`\n" + @doc "Cancels the quote.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/quotes/{quote}/cancel`\n" ( - @spec list_line_items( + @spec cancel( quote :: binary(), - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Item.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list_line_items(quote, params \\ %{}, opts \\ []) do + ) :: {:ok, Stripe.Quote.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def cancel(quote, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/quotes/{quote}/line_items", + "/v1/quotes/{quote}/cancel", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -491,7 +499,7 @@ defmodule Stripe.Quote do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) @@ -500,25 +508,17 @@ defmodule Stripe.Quote do ( nil - @doc "When retrieving a quote, there is an includable computed.upfront.line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/quotes/{quote}/computed_upfront_line_items`\n" + @doc "Finalizes the quote.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/quotes/{quote}/finalize`\n" ( - @spec list_computed_upfront_line_items( + @spec finalize_quote( quote :: binary(), - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, + params :: %{optional(:expand) => list(binary), optional(:expires_at) => integer}, opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Item.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list_computed_upfront_line_items(quote, params \\ %{}, opts \\ []) do + ) :: {:ok, Stripe.Quote.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def finalize_quote(quote, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/quotes/{quote}/computed_upfront_line_items", + "/v1/quotes/{quote}/finalize", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -540,7 +540,7 @@ defmodule Stripe.Quote do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/radar__value_list.ex b/lib/generated/radar__value_list.ex index 6c0df254..069cbabf 100644 --- a/lib/generated/radar__value_list.ex +++ b/lib/generated/radar__value_list.ex @@ -41,6 +41,45 @@ defmodule Stripe.Radar.ValueList do } ) + ( + nil + + @doc "Deletes a ValueList
object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules.
Deletes a ValueList
object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules.
Deletes a ValueListItem
object, removing it from its parent value list.
Deletes a ValueListItem
object, removing it from its parent value list.
Returns a list of Report Runs, with the most recent appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/reporting/report_runs`\n" + ( + @spec list( + params :: %{ + optional(:created) => created | integer, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Reporting.ReportRun.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/reporting/report_runs", [], []) + + 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 @@ -761,34 +791,4 @@ defmodule Stripe.Reporting.ReportRun do end ) ) - - ( - nil - - @doc "Returns a list of Report Runs, with the most recent appearing first.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/reporting/report_runs`\n" - ( - @spec list( - params :: %{ - optional(:created) => created | integer, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Reporting.ReportRun.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/reporting/report_runs", [], []) - - 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 - ) - ) end diff --git a/lib/generated/reporting__report_type.ex b/lib/generated/reporting__report_type.ex index 790e4da6..2ab2fdaf 100644 --- a/lib/generated/reporting__report_type.ex +++ b/lib/generated/reporting__report_type.ex @@ -29,6 +29,27 @@ defmodule Stripe.Reporting.ReportType do } ) + ( + nil + + @doc "Returns a full list of Report Types.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/reporting/report_types`\n" + ( + @spec list(params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t()) :: + {:ok, Stripe.List.t(Stripe.Reporting.ReportType.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/reporting/report_types", [], []) + + 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 @@ -72,25 +93,4 @@ defmodule Stripe.Reporting.ReportType do end ) ) - - ( - nil - - @doc "Returns a full list of Report Types.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/reporting/report_types`\n" - ( - @spec list(params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t()) :: - {:ok, Stripe.List.t(Stripe.Reporting.ReportType.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/reporting/report_types", [], []) - - 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 - ) - ) end diff --git a/lib/generated/setup_intent.ex b/lib/generated/setup_intent.ex index 9309fc49..ea9d8777 100644 --- a/lib/generated/setup_intent.ex +++ b/lib/generated/setup_intent.ex @@ -288,13 +288,18 @@ defmodule Stripe.SetupIntent do ) ( - @typedoc "Additional fields for Mandate creation" + @typedoc "Configuration options for setting up an eMandate for cards issued in India." @type mandate_options :: %{ - optional(:custom_mandate_url) => binary | binary, - optional(:default_for) => list(:invoice | :subscription), - optional(:interval_description) => binary, - optional(:payment_schedule) => :combined | :interval | :sporadic, - optional(:transaction_type) => :business | :personal + optional(:amount) => integer, + optional(:amount_type) => :fixed | :maximum, + optional(:currency) => binary, + optional(:description) => binary, + optional(:end_date) => integer, + optional(:interval) => :day | :month | :sporadic | :week | :year, + optional(:interval_count) => integer, + optional(:reference) => binary, + optional(:start_date) => integer, + optional(:supported_types) => list(:india) } ) @@ -441,8 +446,8 @@ defmodule Stripe.SetupIntent do ) ( - @typedoc "If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options." - @type sepa_debit :: %{optional(:mandate_options) => map()} + @typedoc "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account." + @type sepa_debit :: %{optional(:iban) => binary} ) ( @@ -469,57 +474,15 @@ defmodule Stripe.SetupIntent do ) ( - @typedoc "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method." + @typedoc "If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options." @type us_bank_account :: %{ - optional(:account_holder_type) => :company | :individual, - optional(:account_number) => binary, - optional(:account_type) => :checking | :savings, - optional(:financial_connections_account) => binary, - optional(:routing_number) => binary + optional(:financial_connections) => financial_connections, + optional(:mandate_options) => mandate_options, + optional(:networks) => networks, + optional(:verification_method) => :automatic | :instant | :microdeposits } ) - ( - nil - - @doc "Creates a SetupIntent object.
\n\nAfter you create the SetupIntent, attach a payment method and confirm\nit to collect any required permissions to charge the payment method later.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/setup_intents`\n" - ( - @spec create( - params :: %{ - optional(:attach_to_self) => boolean, - optional(:automatic_payment_methods) => automatic_payment_methods, - optional(:confirm) => boolean, - optional(:customer) => binary, - optional(:description) => binary, - optional(:expand) => list(binary), - optional(:flow_directions) => list(:inbound | :outbound), - optional(:mandate_data) => mandate_data | binary, - optional(:metadata) => %{optional(binary) => binary}, - optional(:on_behalf_of) => binary, - optional(:payment_method) => binary, - optional(:payment_method_configuration) => binary, - optional(:payment_method_data) => payment_method_data, - optional(:payment_method_options) => payment_method_options, - optional(:payment_method_types) => list(binary), - optional(:return_url) => binary, - optional(:single_use) => single_use, - optional(:usage) => :off_session | :on_session, - optional(:use_stripe_sdk) => boolean - }, - opts :: Keyword.t() - ) :: {:ok, Stripe.SetupIntent.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/setup_intents", [], []) - - 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 - ) - ) - ( nil @@ -594,6 +557,47 @@ defmodule Stripe.SetupIntent do ) ) + ( + nil + + @doc "Creates a SetupIntent object.
\n\nAfter you create the SetupIntent, attach a payment method and confirm\nit to collect any required permissions to charge the payment method later.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/setup_intents`\n" + ( + @spec create( + params :: %{ + optional(:attach_to_self) => boolean, + optional(:automatic_payment_methods) => automatic_payment_methods, + optional(:confirm) => boolean, + optional(:customer) => binary, + optional(:description) => binary, + optional(:expand) => list(binary), + optional(:flow_directions) => list(:inbound | :outbound), + optional(:mandate_data) => mandate_data | binary, + optional(:metadata) => %{optional(binary) => binary}, + optional(:on_behalf_of) => binary, + optional(:payment_method) => binary, + optional(:payment_method_configuration) => binary, + optional(:payment_method_data) => payment_method_data, + optional(:payment_method_options) => payment_method_options, + optional(:payment_method_types) => list(binary), + optional(:return_url) => binary, + optional(:single_use) => single_use, + optional(:usage) => :off_session | :on_session, + optional(:use_stripe_sdk) => boolean + }, + opts :: Keyword.t() + ) :: {:ok, Stripe.SetupIntent.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/setup_intents", [], []) + + 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 + ) + ) + ( nil @@ -650,25 +654,21 @@ defmodule Stripe.SetupIntent do ( nil - @doc "Confirm that your customer intends to set up the current or\nprovided payment method. For example, you would confirm a SetupIntent\nwhen a customer hits the “Save” button on a payment method management\npage on your website.
\n\nIf the selected payment method does not require any additional\nsteps from the customer, the SetupIntent will transition to the\nsucceeded
status.
Otherwise, it will transition to the requires_action
status and\nsuggest additional actions via next_action
. If setup fails,\nthe SetupIntent will transition to the\nrequires_payment_method
status or the canceled
status if the\nconfirmation limit is reached.
You can cancel a SetupIntent object when it’s in one of these statuses: requires_payment_method
, requires_confirmation
, or requires_action
.
After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/setup_intents/{intent}/cancel`\n" ( - @spec confirm( + @spec cancel( intent :: binary(), params :: %{ - optional(:expand) => list(binary), - optional(:mandate_data) => mandate_data | binary | mandate_data, - optional(:payment_method) => binary, - optional(:payment_method_data) => payment_method_data, - optional(:payment_method_options) => payment_method_options, - optional(:return_url) => binary, - optional(:use_stripe_sdk) => boolean + optional(:cancellation_reason) => + :abandoned | :duplicate | :requested_by_customer, + optional(:expand) => list(binary) }, opts :: Keyword.t() ) :: {:ok, Stripe.SetupIntent.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def confirm(intent, params \\ %{}, opts \\ []) do + def cancel(intent, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/setup_intents/{intent}/confirm", + "/v1/setup_intents/{intent}/cancel", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -699,21 +699,25 @@ defmodule Stripe.SetupIntent do ( nil - @doc "You can cancel a SetupIntent object when it’s in one of these statuses: requires_payment_method
, requires_confirmation
, or requires_action
.
After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/setup_intents/{intent}/cancel`\n" + @doc "Confirm that your customer intends to set up the current or\nprovided payment method. For example, you would confirm a SetupIntent\nwhen a customer hits the “Save” button on a payment method management\npage on your website.
\n\nIf the selected payment method does not require any additional\nsteps from the customer, the SetupIntent will transition to the\nsucceeded
status.
Otherwise, it will transition to the requires_action
status and\nsuggest additional actions via next_action
. If setup fails,\nthe SetupIntent will transition to the\nrequires_payment_method
status or the canceled
status if the\nconfirmation limit is reached.
List source transactions for a given source.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/sources/{source}/source_transactions`\n" + ( + @spec source_transactions( + source :: binary(), + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.SourceTransaction.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def source_transactions(source, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/sources/{source}/source_transactions", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "source", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "source", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [source] + ) + + 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 @@ -411,53 +460,4 @@ defmodule Stripe.Source do end ) ) - - ( - nil - - @doc "List source transactions for a given source.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/sources/{source}/source_transactions`\n" - ( - @spec source_transactions( - source :: binary(), - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.SourceTransaction.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def source_transactions(source, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/sources/{source}/source_transactions", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "source", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "source", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [source] - ) - - 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 - ) - ) end diff --git a/lib/generated/subscription.ex b/lib/generated/subscription.ex index 164142c5..8045a7ff 100644 --- a/lib/generated/subscription.ex +++ b/lib/generated/subscription.ex @@ -377,27 +377,84 @@ defmodule Stripe.Subscription do ( nil - @doc "Search for subscriptions you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/subscriptions/search`\n" + @doc "Cancels a customer’s subscription immediately. The customer will not be charged again for the subscription.
\n\nNote, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
\n\nBy default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/subscriptions/{subscription_exposed_id}`\n" ( - @spec search( + @spec cancel( + subscription_exposed_id :: binary(), params :: %{ + optional(:cancellation_details) => cancellation_details, optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:page) => binary, - optional(:query) => binary + optional(:invoice_now) => boolean, + optional(:prorate) => boolean }, opts :: Keyword.t() ) :: - {:ok, Stripe.SearchResult.t(Stripe.Subscription.t())} + {:ok, Stripe.Subscription.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def cancel(subscription_exposed_id, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/subscriptions/{subscription_exposed_id}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "subscription_exposed_id", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "subscription_exposed_id", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [subscription_exposed_id] + ) + + Stripe.Request.new_request(opts) + |> Stripe.Request.put_endpoint(path) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:delete) + |> Stripe.Request.make_request() + end + ) + ) + + ( + nil + + @doc "Removes the currently applied discount on a subscription.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/subscriptions/{subscription_exposed_id}/discount`\n" + ( + @spec delete_discount(subscription_exposed_id :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedDiscount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def search(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/subscriptions/search", [], []) + def delete_discount(subscription_exposed_id, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/subscriptions/{subscription_exposed_id}/discount", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "subscription_exposed_id", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "subscription_exposed_id", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [subscription_exposed_id] + ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -455,113 +512,15 @@ defmodule Stripe.Subscription do ( nil - @doc "Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.
\n\nWhen you create a subscription with collection_method=charge_automatically
, the first invoice is finalized as part of the request.\nThe payment_behavior
parameter determines the exact behavior of the initial payment.
To start subscriptions where the first invoice always begins in a draft
status, use subscription schedules instead.\nSchedules provide the flexibility to model more complex billing configurations that change over time.
Updates an existing subscription to match the specified parameters.\nWhen changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.\nTo preview how the proration is calculated, use the upcoming invoice endpoint.
\n\nBy default, we prorate subscription changes. For example, if a customer signs up on May 1 for a
Switching prices does not normally change the billing date or generate an immediate charge unless:
\n\nIn these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date.
\n\nIf you want to charge for an upgrade immediately, pass proration_behavior
as always_invoice
to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations
, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription’s renewal date, you need to manually invoice the customer.
If you don’t want to prorate, set the proration_behavior
option to none
. With this option, the customer is billed proration_behavior
to none
when switching between different billing intervals (for example, from monthly to yearly), we don’t generate any credits for the old subscription’s unused time. We still reset the billing date and bill immediately for the new subscription.
Updating the quantity on a subscription many times in an hour may result in rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing instead.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/subscriptions/{subscription_exposed_id}`\n" + @doc "Retrieves the subscription with the given ID.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/subscriptions/{subscription_exposed_id}`\n" ( - @spec update( + @spec retrieve( subscription_exposed_id :: binary(), - params :: %{ - optional(:add_invoice_items) => list(add_invoice_items), - optional(:application_fee_percent) => number, - optional(:automatic_tax) => automatic_tax, - optional(:billing_cycle_anchor) => :now | :unchanged, - optional(:billing_thresholds) => billing_thresholds | binary, - optional(:cancel_at) => integer | binary, - optional(:cancel_at_period_end) => boolean, - optional(:cancellation_details) => cancellation_details, - optional(:collection_method) => :charge_automatically | :send_invoice, - optional(:coupon) => binary, - optional(:days_until_due) => integer, - optional(:default_payment_method) => binary, - optional(:default_source) => binary | binary, - optional(:default_tax_rates) => list(binary) | binary, - optional(:description) => binary | binary, - optional(:expand) => list(binary), - optional(:items) => list(items), - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:off_session) => boolean, - optional(:on_behalf_of) => binary | binary, - optional(:pause_collection) => pause_collection | binary, - optional(:payment_behavior) => - :allow_incomplete - | :default_incomplete - | :error_if_incomplete - | :pending_if_incomplete, - optional(:payment_settings) => payment_settings, - optional(:pending_invoice_item_interval) => - pending_invoice_item_interval | binary, - optional(:promotion_code) => binary, - optional(:proration_behavior) => :always_invoice | :create_prorations | :none, - optional(:proration_date) => integer, - optional(:transfer_data) => transfer_data | binary, - optional(:trial_end) => :now | integer, - optional(:trial_from_plan) => boolean, - optional(:trial_settings) => trial_settings - }, + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: {:ok, Stripe.Subscription.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(subscription_exposed_id, params \\ %{}, opts \\ []) do + def retrieve(subscription_exposed_id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/subscriptions/{subscription_exposed_id}", @@ -586,7 +545,7 @@ defmodule Stripe.Subscription do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -595,35 +554,22 @@ defmodule Stripe.Subscription do ( nil - @doc "Retrieves the subscription with the given ID.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/subscriptions/{subscription_exposed_id}`\n" + @doc "Search for subscriptions you’ve previously created using Stripe’s Search Query Language.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/subscriptions/search`\n" ( - @spec retrieve( - subscription_exposed_id :: binary(), - params :: %{optional(:expand) => list(binary)}, + @spec search( + params :: %{ + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:page) => binary, + optional(:query) => binary + }, opts :: Keyword.t() ) :: - {:ok, Stripe.Subscription.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(subscription_exposed_id, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/subscriptions/{subscription_exposed_id}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "subscription_exposed_id", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "subscription_exposed_id", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [subscription_exposed_id] - ) + {:ok, Stripe.SearchResult.t(Stripe.Subscription.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def search(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/subscriptions/search", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) @@ -637,45 +583,59 @@ defmodule Stripe.Subscription do ( nil - @doc "Cancels a customer’s subscription immediately. The customer will not be charged again for the subscription.
\n\nNote, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
\n\nBy default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/subscriptions/{subscription_exposed_id}`\n" + @doc "Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.
\n\nWhen you create a subscription with collection_method=charge_automatically
, the first invoice is finalized as part of the request.\nThe payment_behavior
parameter determines the exact behavior of the initial payment.
To start subscriptions where the first invoice always begins in a draft
status, use subscription schedules instead.\nSchedules provide the flexibility to model more complex billing configurations that change over time.
Removes the currently applied discount on a subscription.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/subscriptions/{subscription_exposed_id}/discount`\n" + @doc "Updates an existing subscription to match the specified parameters.\nWhen changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.\nTo preview how the proration is calculated, use the upcoming invoice endpoint.
\n\nBy default, we prorate subscription changes. For example, if a customer signs up on May 1 for a
Switching prices does not normally change the billing date or generate an immediate charge unless:
\n\nIn these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date.
\n\nIf you want to charge for an upgrade immediately, pass proration_behavior
as always_invoice
to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations
, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription’s renewal date, you need to manually invoice the customer.
If you don’t want to prorate, set the proration_behavior
option to none
. With this option, the customer is billed proration_behavior
to none
when switching between different billing intervals (for example, from monthly to yearly), we don’t generate any credits for the old subscription’s unused time. We still reset the billing date and bill immediately for the new subscription.
Updating the quantity on a subscription many times in an hour may result in rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing instead.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/subscriptions/{subscription_exposed_id}`\n" ( - @spec delete_discount(subscription_exposed_id :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedDiscount.t()} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def delete_discount(subscription_exposed_id, opts \\ []) do + @spec update( + subscription_exposed_id :: binary(), + params :: %{ + optional(:add_invoice_items) => list(add_invoice_items), + optional(:application_fee_percent) => number, + optional(:automatic_tax) => automatic_tax, + optional(:billing_cycle_anchor) => :now | :unchanged, + optional(:billing_thresholds) => billing_thresholds | binary, + optional(:cancel_at) => integer | binary, + optional(:cancel_at_period_end) => boolean, + optional(:cancellation_details) => cancellation_details, + optional(:collection_method) => :charge_automatically | :send_invoice, + optional(:coupon) => binary, + optional(:days_until_due) => integer, + optional(:default_payment_method) => binary, + optional(:default_source) => binary | binary, + optional(:default_tax_rates) => list(binary) | binary, + optional(:description) => binary | binary, + optional(:expand) => list(binary), + optional(:items) => list(items), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:off_session) => boolean, + optional(:on_behalf_of) => binary | binary, + optional(:pause_collection) => pause_collection | binary, + optional(:payment_behavior) => + :allow_incomplete + | :default_incomplete + | :error_if_incomplete + | :pending_if_incomplete, + optional(:payment_settings) => payment_settings, + optional(:pending_invoice_item_interval) => + pending_invoice_item_interval | binary, + optional(:promotion_code) => binary, + optional(:proration_behavior) => :always_invoice | :create_prorations | :none, + optional(:proration_date) => integer, + optional(:transfer_data) => transfer_data | binary, + optional(:trial_end) => :now | integer, + optional(:trial_from_plan) => boolean, + optional(:trial_settings) => trial_settings + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.Subscription.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def update(subscription_exposed_id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/subscriptions/{subscription_exposed_id}/discount", + "/v1/subscriptions/{subscription_exposed_id}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -761,7 +760,8 @@ defmodule Stripe.Subscription do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/subscription_item.ex b/lib/generated/subscription_item.ex index d4c1120e..3b20b352 100644 --- a/lib/generated/subscription_item.ex +++ b/lib/generated/subscription_item.ex @@ -56,6 +56,54 @@ defmodule Stripe.SubscriptionItem do } ) + ( + nil + + @doc "Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/subscription_items/{item}`\n" + ( + @spec delete( + item :: binary(), + params :: %{ + optional(:clear_usage) => boolean, + optional(:proration_behavior) => :always_invoice | :create_prorations | :none, + optional(:proration_date) => integer + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.DeletedSubscriptionItem.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def delete(item, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/subscription_items/{item}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "item", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "item", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [item] + ) + + Stripe.Request.new_request(opts) + |> Stripe.Request.put_endpoint(path) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:delete) + |> Stripe.Request.make_request() + end + ) + ) + ( nil @@ -130,6 +178,55 @@ defmodule Stripe.SubscriptionItem do ) ) + ( + nil + + @doc "For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September).
\n\nThe list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn’t ended yet. Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/subscription_items/{subscription_item}/usage_record_summaries`\n" + ( + @spec usage_record_summaries( + subscription_item :: binary(), + params :: %{ + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:limit) => integer, + optional(:starting_after) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.UsageRecordSummary.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def usage_record_summaries(subscription_item, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/subscription_items/{subscription_item}/usage_record_summaries", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "subscription_item", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "subscription_item", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [subscription_item] + ) + + 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 @@ -231,101 +328,4 @@ defmodule Stripe.SubscriptionItem do end ) ) - - ( - nil - - @doc "Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/subscription_items/{item}`\n" - ( - @spec delete( - item :: binary(), - params :: %{ - optional(:clear_usage) => boolean, - optional(:proration_behavior) => :always_invoice | :create_prorations | :none, - optional(:proration_date) => integer - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.DeletedSubscriptionItem.t()} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def delete(item, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/subscription_items/{item}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "item", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "item", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [item] - ) - - Stripe.Request.new_request(opts) - |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:delete) - |> Stripe.Request.make_request() - end - ) - ) - - ( - nil - - @doc "For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September).
\n\nThe list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn’t ended yet. Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/subscription_items/{subscription_item}/usage_record_summaries`\n" - ( - @spec usage_record_summaries( - subscription_item :: binary(), - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.UsageRecordSummary.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def usage_record_summaries(subscription_item, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/subscription_items/{subscription_item}/usage_record_summaries", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "subscription_item", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "subscription_item", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [subscription_item] - ) - - 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 - ) - ) end diff --git a/lib/generated/subscription_schedule.ex b/lib/generated/subscription_schedule.ex index e7bc820c..b522d1f9 100644 --- a/lib/generated/subscription_schedule.ex +++ b/lib/generated/subscription_schedule.ex @@ -234,39 +234,6 @@ defmodule Stripe.SubscriptionSchedule do ) ) - ( - nil - - @doc "Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/subscription_schedules`\n" - ( - @spec create( - params :: %{ - optional(:customer) => binary, - optional(:default_settings) => default_settings, - optional(:end_behavior) => :cancel | :none | :release | :renew, - optional(:expand) => list(binary), - optional(:from_subscription) => binary, - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:phases) => list(phases), - optional(:start_date) => integer | :now - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.SubscriptionSchedule.t()} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def create(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/subscription_schedules", [], []) - - 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 - ) - ) - ( nil @@ -311,6 +278,39 @@ defmodule Stripe.SubscriptionSchedule do ) ) + ( + nil + + @doc "Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/subscription_schedules`\n" + ( + @spec create( + params :: %{ + optional(:customer) => binary, + optional(:default_settings) => default_settings, + optional(:end_behavior) => :cancel | :none | :release | :renew, + optional(:expand) => list(binary), + optional(:from_subscription) => binary, + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:phases) => list(phases), + optional(:start_date) => integer | :now + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.SubscriptionSchedule.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/subscription_schedules", [], []) + + 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 + ) + ) + ( nil diff --git a/lib/generated/tax__calculation.ex b/lib/generated/tax__calculation.ex index 7a0bd225..86c9a37d 100644 --- a/lib/generated/tax__calculation.ex +++ b/lib/generated/tax__calculation.ex @@ -158,38 +158,6 @@ defmodule Stripe.Tax.Calculation do } ) - ( - nil - - @doc "Calculates tax based on input and returns a Tax Calculation
object.
Calculates tax based on input and returns a Tax Calculation
object.
Creates a new Tax Registration
object.
Creates a new Tax Registration
object.
Partially or fully reverses a previously created Transaction
.
Retrieves the line items of a committed standalone transaction as a collection.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/tax/transactions/{transaction}/line_items`\n" ( - @spec create_reversal( + @spec list_line_items( + transaction :: binary(), params :: %{ + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:flat_amount) => integer, - optional(:line_items) => list(line_items), - optional(:metadata) => %{optional(binary) => binary}, - optional(:mode) => :full | :partial, - optional(:original_transaction) => binary, - optional(:reference) => binary, - optional(:shipping_cost) => shipping_cost + optional(:limit) => integer, + optional(:starting_after) => binary }, opts :: Keyword.t() ) :: - {:ok, Stripe.Tax.Transaction.t()} + {:ok, Stripe.List.t(Stripe.Tax.TransactionLineItem.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create_reversal(params \\ %{}, opts \\ []) do + def list_line_items(transaction, params \\ %{}, opts \\ []) do path = - Stripe.OpenApi.Path.replace_path_params("/v1/tax/transactions/create_reversal", [], []) + Stripe.OpenApi.Path.replace_path_params( + "/v1/tax/transactions/{transaction}/line_items", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "transaction", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "transaction", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [transaction] + ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -171,47 +186,32 @@ defmodule Stripe.Tax.Transaction do ( nil - @doc "Retrieves the line items of a committed standalone transaction as a collection.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/tax/transactions/{transaction}/line_items`\n" + @doc "Partially or fully reverses a previously created Transaction
.
Creates a new tax_id
object for a customer.
Retrieves the tax_id
object with the given identifier.
Deletes an existing tax_id
object.
Deletes an existing tax_id
object.
Retrieves the tax_id
object with the given identifier.
Creates a new tax_id
object for a customer.
Creates a new Configuration
object.
Deletes a Configuration
object.
Updates a new Configuration
object.
Creates a new Configuration
object.
Deletes a Configuration
object.
Updates a new Configuration
object.
Retrieves a Location
object.
Deletes a Location
object.
Creates a new Location
object.\nFor further details, including which address fields are required in each country, see the Manage locations guide.
Returns a list of Location
objects.
Updates a Location
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Retrieves a Location
object.
Returns a list of Location
objects.
Creates a new Location
object.\nFor further details, including which address fields are required in each country, see the Manage locations guide.
Deletes a Location
object.
Updates a Location
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Updates a Reader
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Deletes a Reader
object.
Returns a list of Reader
objects.
Returns a list of Reader
objects.
Updates a Reader
object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Deletes a Reader
object.
Initiates a payment flow on a Reader.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/readers/{reader}/process_payment_intent`\n" + @doc "Cancels the current reader action.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/readers/{reader}/cancel_action`\n" ( - @spec process_payment_intent( + @spec cancel_action( reader :: binary(), - params :: %{ - optional(:expand) => list(binary), - optional(:payment_intent) => binary, - optional(:process_config) => process_config - }, + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: {:ok, Stripe.Terminal.Reader.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def process_payment_intent(reader, params \\ %{}, opts \\ []) do + def cancel_action(reader, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/terminal/readers/{reader}/process_payment_intent", + "/v1/terminal/readers/{reader}/cancel_action", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -325,25 +321,24 @@ defmodule Stripe.Terminal.Reader do ( nil - @doc "Initiates a setup intent flow on a Reader.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/readers/{reader}/process_setup_intent`\n" + @doc "Initiates a payment flow on a Reader.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/readers/{reader}/process_payment_intent`\n" ( - @spec process_setup_intent( + @spec process_payment_intent( reader :: binary(), params :: %{ - optional(:customer_consent_collected) => boolean, optional(:expand) => list(binary), - optional(:process_config) => map(), - optional(:setup_intent) => binary + optional(:payment_intent) => binary, + optional(:process_config) => process_config }, opts :: Keyword.t() ) :: {:ok, Stripe.Terminal.Reader.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def process_setup_intent(reader, params \\ %{}, opts \\ []) do + def process_payment_intent(reader, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/terminal/readers/{reader}/process_setup_intent", + "/v1/terminal/readers/{reader}/process_payment_intent", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -374,20 +369,25 @@ defmodule Stripe.Terminal.Reader do ( nil - @doc "Cancels the current reader action.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/readers/{reader}/cancel_action`\n" + @doc "Initiates a setup intent flow on a Reader.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/readers/{reader}/process_setup_intent`\n" ( - @spec cancel_action( + @spec process_setup_intent( reader :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:customer_consent_collected) => boolean, + optional(:expand) => list(binary), + optional(:process_config) => map(), + optional(:setup_intent) => binary + }, opts :: Keyword.t() ) :: {:ok, Stripe.Terminal.Reader.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def cancel_action(reader, params \\ %{}, opts \\ []) do + def process_setup_intent(reader, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/terminal/readers/{reader}/cancel_action", + "/v1/terminal/readers/{reader}/process_setup_intent", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -418,24 +418,28 @@ defmodule Stripe.Terminal.Reader do ( nil - @doc "Sets reader display to show cart details.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/readers/{reader}/set_reader_display`\n" + @doc "Initiates a refund on a Reader
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/readers/{reader}/refund_payment`\n" ( - @spec set_reader_display( + @spec refund_payment( reader :: binary(), params :: %{ - optional(:cart) => cart, + optional(:amount) => integer, + optional(:charge) => binary, optional(:expand) => list(binary), - optional(:type) => :cart + optional(:metadata) => %{optional(binary) => binary}, + optional(:payment_intent) => binary, + optional(:refund_application_fee) => boolean, + optional(:reverse_transfer) => boolean }, opts :: Keyword.t() ) :: {:ok, Stripe.Terminal.Reader.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def set_reader_display(reader, params \\ %{}, opts \\ []) do + def refund_payment(reader, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/terminal/readers/{reader}/set_reader_display", + "/v1/terminal/readers/{reader}/refund_payment", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -466,28 +470,24 @@ defmodule Stripe.Terminal.Reader do ( nil - @doc "Initiates a refund on a Reader
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/readers/{reader}/refund_payment`\n" + @doc "Sets reader display to show cart details.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/readers/{reader}/set_reader_display`\n" ( - @spec refund_payment( + @spec set_reader_display( reader :: binary(), params :: %{ - optional(:amount) => integer, - optional(:charge) => binary, + optional(:cart) => cart, optional(:expand) => list(binary), - optional(:metadata) => %{optional(binary) => binary}, - optional(:payment_intent) => binary, - optional(:refund_application_fee) => boolean, - optional(:reverse_transfer) => boolean + optional(:type) => :cart }, opts :: Keyword.t() ) :: {:ok, Stripe.Terminal.Reader.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def refund_payment(reader, params \\ %{}, opts \\ []) do + def set_reader_display(reader, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/terminal/readers/{reader}/refund_payment", + "/v1/terminal/readers/{reader}/set_reader_display", [ %OpenApiGen.Blueprint.Parameter{ in: "path", diff --git a/lib/generated/test_helpers__test_clock.ex b/lib/generated/test_helpers__test_clock.ex index ecbb944a..15ec864f 100644 --- a/lib/generated/test_helpers__test_clock.ex +++ b/lib/generated/test_helpers__test_clock.ex @@ -21,17 +21,13 @@ defmodule Stripe.TestHelpers.TestClock do ( nil - @doc "Retrieves a test clock.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/test_helpers/test_clocks/{test_clock}`\n" + @doc "Deletes a test clock.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/test_helpers/test_clocks/{test_clock}`\n" ( - @spec retrieve( - test_clock :: binary(), - params :: %{optional(:expand) => list(binary)}, - opts :: Keyword.t() - ) :: - {:ok, Stripe.TestHelpers.TestClock.t()} + @spec delete(test_clock :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedTestHelpers.TestClock.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(test_clock, params \\ %{}, opts \\ []) do + def delete(test_clock, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/test_helpers/test_clocks/{test_clock}", @@ -55,8 +51,7 @@ defmodule Stripe.TestHelpers.TestClock do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:delete) |> Stripe.Request.make_request() end ) @@ -65,26 +60,27 @@ defmodule Stripe.TestHelpers.TestClock do ( nil - @doc "Creates a new test clock that can be attached to new customers and quotes.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/test_clocks`\n" + @doc "Returns a list of your test clocks.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/test_helpers/test_clocks`\n" ( - @spec create( + @spec list( params :: %{ + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:frozen_time) => integer, - optional(:name) => binary + optional(:limit) => integer, + optional(:starting_after) => binary }, opts :: Keyword.t() ) :: - {:ok, Stripe.TestHelpers.TestClock.t()} + {:ok, Stripe.List.t(Stripe.TestHelpers.TestClock.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/test_helpers/test_clocks", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -93,13 +89,17 @@ defmodule Stripe.TestHelpers.TestClock do ( nil - @doc "Deletes a test clock.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/test_helpers/test_clocks/{test_clock}`\n" + @doc "Retrieves a test clock.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/test_helpers/test_clocks/{test_clock}`\n" ( - @spec delete(test_clock :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedTestHelpers.TestClock.t()} + @spec retrieve( + test_clock :: binary(), + params :: %{optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: + {:ok, Stripe.TestHelpers.TestClock.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(test_clock, opts \\ []) do + def retrieve(test_clock, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/test_helpers/test_clocks/{test_clock}", @@ -123,7 +123,36 @@ defmodule Stripe.TestHelpers.TestClock do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:get) + |> Stripe.Request.make_request() + end + ) + ) + + ( + nil + + @doc "Creates a new test clock that can be attached to new customers and quotes.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/test_helpers/test_clocks`\n" + ( + @spec create( + params :: %{ + optional(:expand) => list(binary), + optional(:frozen_time) => integer, + optional(:name) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.TestHelpers.TestClock.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/test_helpers/test_clocks", [], []) + + 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 ) @@ -172,33 +201,4 @@ defmodule Stripe.TestHelpers.TestClock do end ) ) - - ( - nil - - @doc "Returns a list of your test clocks.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/test_helpers/test_clocks`\n" - ( - @spec list( - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.TestHelpers.TestClock.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/test_helpers/test_clocks", [], []) - - 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 - ) - ) end diff --git a/lib/generated/token.ex b/lib/generated/token.ex index 28633b12..225ea004 100644 --- a/lib/generated/token.ex +++ b/lib/generated/token.ex @@ -39,7 +39,7 @@ defmodule Stripe.Token do ) ( - @typedoc "The company's primary address." + @typedoc "The person's address." @type address :: %{ optional(:city) => binary, optional(:country) => binary, @@ -64,7 +64,7 @@ defmodule Stripe.Token do ) ( - @typedoc "The Kanji variation of the company's primary address (Japan only)." + @typedoc "The Kanji variation of the the individual's primary address (Japan only)." @type address_kanji :: %{ optional(:city) => binary, optional(:country) => binary, @@ -175,7 +175,7 @@ defmodule Stripe.Token do ) ( - @typedoc "An identifying document, either a passport or local ID card." + @typedoc "A document verifying the business." @type document :: %{optional(:back) => binary, optional(:front) => binary} ) @@ -268,7 +268,7 @@ defmodule Stripe.Token do ) ( - @typedoc "The individual's registered address." + @typedoc "The person's registered address." @type registered_address :: %{ optional(:city) => binary, optional(:country) => binary, diff --git a/lib/generated/topup.ex b/lib/generated/topup.ex index 88e54bfc..8cd58336 100644 --- a/lib/generated/topup.ex +++ b/lib/generated/topup.ex @@ -63,36 +63,6 @@ defmodule Stripe.Topup do } ) - ( - nil - - @doc "Top up the balance of an account
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/topups`\n" - ( - @spec create( - params :: %{ - optional(:amount) => integer, - optional(:currency) => binary, - optional(:description) => binary, - optional(:expand) => list(binary), - optional(:metadata) => %{optional(binary) => binary} | binary, - optional(:source) => binary, - optional(:statement_descriptor) => binary, - optional(:transfer_group) => binary - }, - opts :: Keyword.t() - ) :: {:ok, Stripe.Topup.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/topups", [], []) - - 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 - ) - ) - ( nil @@ -166,6 +136,36 @@ defmodule Stripe.Topup do ) ) + ( + nil + + @doc "Top up the balance of an account
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/topups`\n" + ( + @spec create( + params :: %{ + optional(:amount) => integer, + optional(:currency) => binary, + optional(:description) => binary, + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:source) => binary, + optional(:statement_descriptor) => binary, + optional(:transfer_group) => binary + }, + opts :: Keyword.t() + ) :: {:ok, Stripe.Topup.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/topups", [], []) + + 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 + ) + ) + ( nil diff --git a/lib/generated/transfer.ex b/lib/generated/transfer.ex index 86c6faf5..fc29b42a 100644 --- a/lib/generated/transfer.ex +++ b/lib/generated/transfer.ex @@ -55,37 +55,6 @@ defmodule Stripe.Transfer do } ) - ( - nil - - @doc "To send funds from your Stripe account to a connected account, you create a new transfer object. Your Stripe balance must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/transfers`\n" - ( - @spec create( - params :: %{ - optional(:amount) => integer, - optional(:currency) => binary, - optional(:description) => binary, - optional(:destination) => binary, - optional(:expand) => list(binary), - optional(:metadata) => %{optional(binary) => binary}, - optional(:source_transaction) => binary, - optional(:source_type) => :bank_account | :card | :fpx, - optional(:transfer_group) => binary - }, - opts :: Keyword.t() - ) :: {:ok, Stripe.Transfer.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/transfers", [], []) - - 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 - ) - ) - ( nil @@ -159,6 +128,37 @@ defmodule Stripe.Transfer do ) ) + ( + nil + + @doc "To send funds from your Stripe account to a connected account, you create a new transfer object. Your Stripe balance must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/transfers`\n" + ( + @spec create( + params :: %{ + optional(:amount) => integer, + optional(:currency) => binary, + optional(:description) => binary, + optional(:destination) => binary, + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary}, + optional(:source_transaction) => binary, + optional(:source_type) => :bank_account | :card | :fpx, + optional(:transfer_group) => binary + }, + opts :: Keyword.t() + ) :: {:ok, Stripe.Transfer.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/transfers", [], []) + + 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 + ) + ) + ( nil diff --git a/lib/generated/transfer_reversal.ex b/lib/generated/transfer_reversal.ex index 19928443..3e56ece6 100644 --- a/lib/generated/transfer_reversal.ex +++ b/lib/generated/transfer_reversal.ex @@ -34,23 +34,22 @@ defmodule Stripe.TransferReversal do ( nil - @doc "When you create a new reversal, you must specify a transfer to create it on.
\n\nWhen reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed.
\n\nOnce entirely reversed, a transfer can’t be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/transfers/{id}/reversals`\n" + @doc "You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit
and starting_after
parameters to page through additional reversals.
You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit
and starting_after
parameters to page through additional reversals.
By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/transfers/{transfer}/reversals/{id}`\n" ( - @spec list( + @spec retrieve( id :: binary(), - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary - }, + transfer :: binary(), + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: - {:ok, Stripe.List.t(Stripe.TransferReversal.t())} + {:ok, Stripe.TransferReversal.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(id, params \\ %{}, opts \\ []) do + def retrieve(id, transfer, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/transfers/{id}/reversals", + "/v1/transfers/{transfer}/reversals/{id}", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -116,9 +111,22 @@ defmodule Stripe.TransferReversal do properties: [], any_of: [] } + }, + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "transfer", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "transfer", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } } ], - [id] + [id, transfer] ) Stripe.Request.new_request(opts) @@ -133,21 +141,26 @@ defmodule Stripe.TransferReversal do ( nil - @doc "By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/transfers/{transfer}/reversals/{id}`\n" + @doc "When you create a new reversal, you must specify a transfer to create it on.
\n\nWhen reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed.
\n\nOnce entirely reversed, a transfer can’t be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/transfers/{id}/reversals`\n" ( - @spec retrieve( + @spec create( id :: binary(), - transfer :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:amount) => integer, + optional(:description) => binary, + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:refund_application_fee) => boolean + }, opts :: Keyword.t() ) :: {:ok, Stripe.TransferReversal.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(id, transfer, params \\ %{}, opts \\ []) do + def create(id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/transfers/{transfer}/reversals/{id}", + "/v1/transfers/{id}/reversals", [ %OpenApiGen.Blueprint.Parameter{ in: "path", @@ -161,28 +174,15 @@ defmodule Stripe.TransferReversal do properties: [], any_of: [] } - }, - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "transfer", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "transfer", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } } ], - [id, transfer] + [id] ) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/treasury__debit_reversal.ex b/lib/generated/treasury__debit_reversal.ex index 85a27447..82e43e25 100644 --- a/lib/generated/treasury__debit_reversal.ex +++ b/lib/generated/treasury__debit_reversal.ex @@ -44,26 +44,31 @@ defmodule Stripe.Treasury.DebitReversal do ( nil - @doc "Reverses a ReceivedDebit and creates a DebitReversal object.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/debit_reversals`\n" + @doc "Returns a list of DebitReversals.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/debit_reversals`\n" ( - @spec create( + @spec list( params :: %{ + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:metadata) => %{optional(binary) => binary}, - optional(:received_debit) => binary + optional(:financial_account) => binary, + optional(:limit) => integer, + optional(:received_debit) => binary, + optional(:resolution) => :lost | :won, + optional(:starting_after) => binary, + optional(:status) => :canceled | :completed | :processing }, opts :: Keyword.t() ) :: - {:ok, Stripe.Treasury.DebitReversal.t()} + {:ok, Stripe.List.t(Stripe.Treasury.DebitReversal.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/debit_reversals", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -116,31 +121,26 @@ defmodule Stripe.Treasury.DebitReversal do ( nil - @doc "Returns a list of DebitReversals.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/debit_reversals`\n" + @doc "Reverses a ReceivedDebit and creates a DebitReversal object.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/debit_reversals`\n" ( - @spec list( + @spec create( params :: %{ - optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:financial_account) => binary, - optional(:limit) => integer, - optional(:received_debit) => binary, - optional(:resolution) => :lost | :won, - optional(:starting_after) => binary, - optional(:status) => :canceled | :completed | :processing + optional(:metadata) => %{optional(binary) => binary}, + optional(:received_debit) => binary }, opts :: Keyword.t() ) :: - {:ok, Stripe.List.t(Stripe.Treasury.DebitReversal.t())} + {:ok, Stripe.Treasury.DebitReversal.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(params \\ %{}, opts \\ []) do + def create(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/debit_reversals", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/treasury__financial_account.ex b/lib/generated/treasury__financial_account.ex index 85eb6c8d..9bd0f058 100644 --- a/lib/generated/treasury__financial_account.ex +++ b/lib/generated/treasury__financial_account.ex @@ -133,28 +133,28 @@ defmodule Stripe.Treasury.FinancialAccount do ( nil - @doc "Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/financial_accounts`\n" + @doc "Returns a list of FinancialAccounts.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/financial_accounts`\n" ( - @spec create( + @spec list( params :: %{ + optional(:created) => created | integer, + optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:features) => features, - optional(:metadata) => %{optional(binary) => binary}, - optional(:platform_restrictions) => platform_restrictions, - optional(:supported_currencies) => list(binary) + optional(:limit) => integer, + optional(:starting_after) => binary }, opts :: Keyword.t() ) :: - {:ok, Stripe.Treasury.FinancialAccount.t()} + {:ok, Stripe.List.t(Stripe.Treasury.FinancialAccount.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/financial_accounts", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -163,22 +163,17 @@ defmodule Stripe.Treasury.FinancialAccount do ( nil - @doc "Updates the details of a FinancialAccount.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/financial_accounts/{financial_account}`\n" + @doc "Retrieves the details of a FinancialAccount.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/financial_accounts/{financial_account}`\n" ( - @spec update( + @spec retrieve( financial_account :: binary(), - params :: %{ - optional(:expand) => list(binary), - optional(:features) => features, - optional(:metadata) => %{optional(binary) => binary}, - optional(:platform_restrictions) => platform_restrictions - }, + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: {:ok, Stripe.Treasury.FinancialAccount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(financial_account, params \\ %{}, opts \\ []) do + def retrieve(financial_account, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/treasury/financial_accounts/{financial_account}", @@ -203,7 +198,7 @@ defmodule Stripe.Treasury.FinancialAccount do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -212,26 +207,17 @@ defmodule Stripe.Treasury.FinancialAccount do ( nil - @doc "Updates the Features associated with a FinancialAccount.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/financial_accounts/{financial_account}/features`\n" + @doc "Retrieves Features information associated with the FinancialAccount.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/financial_accounts/{financial_account}/features`\n" ( - @spec update_features( + @spec retrieve_features( financial_account :: binary(), - params :: %{ - optional(:card_issuing) => card_issuing, - optional(:deposit_insurance) => deposit_insurance, - optional(:expand) => list(binary), - optional(:financial_addresses) => financial_addresses, - optional(:inbound_transfers) => inbound_transfers, - optional(:intra_stripe_flows) => intra_stripe_flows, - optional(:outbound_payments) => outbound_payments, - optional(:outbound_transfers) => outbound_transfers - }, + params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: {:ok, Stripe.Treasury.FinancialAccountFeatures.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update_features(financial_account, params \\ %{}, opts \\ []) do + def retrieve_features(financial_account, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/treasury/financial_accounts/{financial_account}/features", @@ -256,7 +242,7 @@ defmodule Stripe.Treasury.FinancialAccount do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -265,28 +251,28 @@ defmodule Stripe.Treasury.FinancialAccount do ( nil - @doc "Returns a list of FinancialAccounts.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/financial_accounts`\n" + @doc "Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/financial_accounts`\n" ( - @spec list( + @spec create( params :: %{ - optional(:created) => created | integer, - optional(:ending_before) => binary, optional(:expand) => list(binary), - optional(:limit) => integer, - optional(:starting_after) => binary + optional(:features) => features, + optional(:metadata) => %{optional(binary) => binary}, + optional(:platform_restrictions) => platform_restrictions, + optional(:supported_currencies) => list(binary) }, opts :: Keyword.t() ) :: - {:ok, Stripe.List.t(Stripe.Treasury.FinancialAccount.t())} + {:ok, Stripe.Treasury.FinancialAccount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def list(params \\ %{}, opts \\ []) do + def create(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/financial_accounts", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) @@ -295,17 +281,22 @@ defmodule Stripe.Treasury.FinancialAccount do ( nil - @doc "Retrieves the details of a FinancialAccount.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/financial_accounts/{financial_account}`\n" + @doc "Updates the details of a FinancialAccount.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/financial_accounts/{financial_account}`\n" ( - @spec retrieve( + @spec update( financial_account :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:expand) => list(binary), + optional(:features) => features, + optional(:metadata) => %{optional(binary) => binary}, + optional(:platform_restrictions) => platform_restrictions + }, opts :: Keyword.t() ) :: {:ok, Stripe.Treasury.FinancialAccount.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(financial_account, params \\ %{}, opts \\ []) do + def update(financial_account, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/treasury/financial_accounts/{financial_account}", @@ -330,7 +321,7 @@ defmodule Stripe.Treasury.FinancialAccount do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) @@ -339,17 +330,26 @@ defmodule Stripe.Treasury.FinancialAccount do ( nil - @doc "Retrieves Features information associated with the FinancialAccount.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/financial_accounts/{financial_account}/features`\n" + @doc "Updates the Features associated with a FinancialAccount.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/financial_accounts/{financial_account}/features`\n" ( - @spec retrieve_features( + @spec update_features( financial_account :: binary(), - params :: %{optional(:expand) => list(binary)}, + params :: %{ + optional(:card_issuing) => card_issuing, + optional(:deposit_insurance) => deposit_insurance, + optional(:expand) => list(binary), + optional(:financial_addresses) => financial_addresses, + optional(:inbound_transfers) => inbound_transfers, + optional(:intra_stripe_flows) => intra_stripe_flows, + optional(:outbound_payments) => outbound_payments, + optional(:outbound_transfers) => outbound_transfers + }, opts :: Keyword.t() ) :: {:ok, Stripe.Treasury.FinancialAccountFeatures.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve_features(financial_account, params \\ %{}, opts \\ []) do + def update_features(financial_account, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/treasury/financial_accounts/{financial_account}/features", @@ -374,7 +374,7 @@ defmodule Stripe.Treasury.FinancialAccount do Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:get) + |> Stripe.Request.put_method(:post) |> Stripe.Request.make_request() end ) diff --git a/lib/generated/treasury__inbound_transfer.ex b/lib/generated/treasury__inbound_transfer.ex index 12fbc2e9..3588c64f 100644 --- a/lib/generated/treasury__inbound_transfer.ex +++ b/lib/generated/treasury__inbound_transfer.ex @@ -74,75 +74,29 @@ defmodule Stripe.Treasury.InboundTransfer do ( nil - @doc "Cancels an InboundTransfer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/inbound_transfers/{inbound_transfer}/cancel`\n" - ( - @spec cancel( - inbound_transfer :: binary(), - params :: %{optional(:expand) => list(binary)}, - opts :: Keyword.t() - ) :: - {:ok, Stripe.Treasury.InboundTransfer.t()} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def cancel(inbound_transfer, params \\ %{}, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "inbound_transfer", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "inbound_transfer", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [inbound_transfer] - ) - - 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 - ) - ) - - ( - nil - - @doc "Creates an InboundTransfer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/inbound_transfers`\n" + @doc "Returns a list of InboundTransfers sent from the specified FinancialAccount.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/inbound_transfers`\n" ( - @spec create( + @spec list( params :: %{ - optional(:amount) => integer, - optional(:currency) => binary, - optional(:description) => binary, + optional(:ending_before) => binary, optional(:expand) => list(binary), optional(:financial_account) => binary, - optional(:metadata) => %{optional(binary) => binary}, - optional(:origin_payment_method) => binary, - optional(:statement_descriptor) => binary + optional(:limit) => integer, + optional(:starting_after) => binary, + optional(:status) => :canceled | :failed | :processing | :succeeded }, opts :: Keyword.t() ) :: - {:ok, Stripe.Treasury.InboundTransfer.t()} + {:ok, Stripe.List.t(Stripe.Treasury.InboundTransfer.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/inbound_transfers", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -195,29 +149,45 @@ defmodule Stripe.Treasury.InboundTransfer do ( nil - @doc "Returns a list of InboundTransfers sent from the specified FinancialAccount.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/inbound_transfers`\n" + @doc "Transitions a test mode created InboundTransfer to the failed
status. The InboundTransfer must already be in the processing
state.
Transitions a test mode created InboundTransfer to the succeeded
status. The InboundTransfer must already be in the processing
state.
Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded
state.
Transitions a test mode created InboundTransfer to the failed
status. The InboundTransfer must already be in the processing
state.
Transitions a test mode created InboundTransfer to the succeeded
status. The InboundTransfer must already be in the processing
state.
Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded
state.
Creates an InboundTransfer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/inbound_transfers`\n" ( - @spec return_inbound_transfer( - id :: binary(), + @spec create( + params :: %{ + optional(:amount) => integer, + optional(:currency) => binary, + optional(:description) => binary, + optional(:expand) => list(binary), + optional(:financial_account) => binary, + optional(:metadata) => %{optional(binary) => binary}, + optional(:origin_payment_method) => binary, + optional(:statement_descriptor) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.Treasury.InboundTransfer.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/inbound_transfers", [], []) + + 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 + ) + ) + + ( + nil + + @doc "Cancels an InboundTransfer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/inbound_transfers/{inbound_transfer}/cancel`\n" + ( + @spec cancel( + inbound_transfer :: binary(), params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t() ) :: {:ok, Stripe.Treasury.InboundTransfer.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def return_inbound_transfer(id, params \\ %{}, opts \\ []) do + def cancel(inbound_transfer, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/treasury/inbound_transfers/{id}/return", + "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel", [ %OpenApiGen.Blueprint.Parameter{ in: "path", - name: "id", + name: "inbound_transfer", required: true, schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "id", + name: "inbound_transfer", title: nil, type: "string", items: [], @@ -346,7 +346,7 @@ defmodule Stripe.Treasury.InboundTransfer do } } ], - [id] + [inbound_transfer] ) Stripe.Request.new_request(opts) diff --git a/lib/generated/treasury__outbound_payment.ex b/lib/generated/treasury__outbound_payment.ex index d214c407..739dbcee 100644 --- a/lib/generated/treasury__outbound_payment.ex +++ b/lib/generated/treasury__outbound_payment.ex @@ -123,36 +123,30 @@ defmodule Stripe.Treasury.OutboundPayment do ( nil - @doc "Creates an OutboundPayment.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/outbound_payments`\n" + @doc "Returns a list of OutboundPayments sent from the specified FinancialAccount.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/outbound_payments`\n" ( - @spec create( + @spec list( params :: %{ - optional(:amount) => integer, - optional(:currency) => binary, optional(:customer) => binary, - optional(:description) => binary, - optional(:destination_payment_method) => binary, - optional(:destination_payment_method_data) => destination_payment_method_data, - optional(:destination_payment_method_options) => - destination_payment_method_options, - optional(:end_user_details) => end_user_details, + optional(:ending_before) => binary, optional(:expand) => list(binary), optional(:financial_account) => binary, - optional(:metadata) => %{optional(binary) => binary}, - optional(:statement_descriptor) => binary + optional(:limit) => integer, + optional(:starting_after) => binary, + optional(:status) => :canceled | :failed | :posted | :processing | :returned }, opts :: Keyword.t() ) :: - {:ok, Stripe.Treasury.OutboundPayment.t()} + {:ok, Stripe.List.t(Stripe.Treasury.OutboundPayment.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/outbound_payments", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -205,41 +199,9 @@ defmodule Stripe.Treasury.OutboundPayment do ( nil - @doc "Returns a list of OutboundPayments sent from the specified FinancialAccount.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/outbound_payments`\n" - ( - @spec list( - params :: %{ - optional(:customer) => binary, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:financial_account) => binary, - optional(:limit) => integer, - optional(:starting_after) => binary, - optional(:status) => :canceled | :failed | :posted | :processing | :returned - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Treasury.OutboundPayment.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/outbound_payments", [], []) - - 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 "Cancel an OutboundPayment.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/outbound_payments/{id}/cancel`\n" + @doc "Transitions a test mode created OutboundPayment to the failed
status. The OutboundPayment must already be in the processing
state.
Transitions a test mode created OutboundPayment to the failed
status. The OutboundPayment must already be in the processing
state.
Transitions a test mode created OutboundPayment to the posted
status. The OutboundPayment must already be in the processing
state.
Transitions a test mode created OutboundPayment to the posted
status. The OutboundPayment must already be in the processing
state.
Transitions a test mode created OutboundPayment to the returned
status. The OutboundPayment must already be in the processing
state.
Transitions a test mode created OutboundPayment to the returned
status. The OutboundPayment must already be in the processing
state.
Creates an OutboundPayment.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/outbound_payments`\n" ( - @spec return_outbound_payment( - id :: binary(), + @spec create( params :: %{ + optional(:amount) => integer, + optional(:currency) => binary, + optional(:customer) => binary, + optional(:description) => binary, + optional(:destination_payment_method) => binary, + optional(:destination_payment_method_data) => destination_payment_method_data, + optional(:destination_payment_method_options) => + destination_payment_method_options, + optional(:end_user_details) => end_user_details, optional(:expand) => list(binary), - optional(:returned_details) => returned_details + optional(:financial_account) => binary, + optional(:metadata) => %{optional(binary) => binary}, + optional(:statement_descriptor) => binary }, opts :: Keyword.t() ) :: {:ok, Stripe.Treasury.OutboundPayment.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def return_outbound_payment(id, params \\ %{}, opts \\ []) do + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/outbound_payments", [], []) + + 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 + ) + ) + + ( + nil + + @doc "Cancel an OutboundPayment.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/outbound_payments/{id}/cancel`\n" + ( + @spec cancel( + id :: binary(), + params :: %{optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: + {:ok, Stripe.Treasury.OutboundPayment.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def cancel(id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/treasury/outbound_payments/{id}/return", + "/v1/treasury/outbound_payments/{id}/cancel", [ %OpenApiGen.Blueprint.Parameter{ in: "path", diff --git a/lib/generated/treasury__outbound_transfer.ex b/lib/generated/treasury__outbound_transfer.ex index 7ae78380..c23d6a7e 100644 --- a/lib/generated/treasury__outbound_transfer.ex +++ b/lib/generated/treasury__outbound_transfer.ex @@ -81,33 +81,29 @@ defmodule Stripe.Treasury.OutboundTransfer do ( nil - @doc "Creates an OutboundTransfer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/outbound_transfers`\n" + @doc "Returns a list of OutboundTransfers sent from the specified FinancialAccount.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/outbound_transfers`\n" ( - @spec create( + @spec list( params :: %{ - optional(:amount) => integer, - optional(:currency) => binary, - optional(:description) => binary, - optional(:destination_payment_method) => binary, - optional(:destination_payment_method_options) => - destination_payment_method_options, + optional(:ending_before) => binary, optional(:expand) => list(binary), optional(:financial_account) => binary, - optional(:metadata) => %{optional(binary) => binary}, - optional(:statement_descriptor) => binary + optional(:limit) => integer, + optional(:starting_after) => binary, + optional(:status) => :canceled | :failed | :posted | :processing | :returned }, opts :: Keyword.t() ) :: - {:ok, Stripe.Treasury.OutboundTransfer.t()} + {:ok, Stripe.List.t(Stripe.Treasury.OutboundTransfer.t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def create(params \\ %{}, opts \\ []) do + def list(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/outbound_transfers", [], []) Stripe.Request.new_request(opts) |> Stripe.Request.put_endpoint(path) |> Stripe.Request.put_params(params) - |> Stripe.Request.put_method(:post) + |> Stripe.Request.put_method(:get) |> Stripe.Request.make_request() end ) @@ -160,40 +156,9 @@ defmodule Stripe.Treasury.OutboundTransfer do ( nil - @doc "Returns a list of OutboundTransfers sent from the specified FinancialAccount.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/outbound_transfers`\n" - ( - @spec list( - params :: %{ - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:financial_account) => binary, - optional(:limit) => integer, - optional(:starting_after) => binary, - optional(:status) => :canceled | :failed | :posted | :processing | :returned - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Treasury.OutboundTransfer.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/outbound_transfers", [], []) - - 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 "An OutboundTransfer can be canceled if the funds have not yet been paid out.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/outbound_transfers/{outbound_transfer}/cancel`\n" + @doc "Transitions a test mode created OutboundTransfer to the failed
status. The OutboundTransfer must already be in the processing
state.
Transitions a test mode created OutboundTransfer to the failed
status. The OutboundTransfer must already be in the processing
state.
Transitions a test mode created OutboundTransfer to the posted
status. The OutboundTransfer must already be in the processing
state.
Transitions a test mode created OutboundTransfer to the posted
status. The OutboundTransfer must already be in the processing
state.
Transitions a test mode created OutboundTransfer to the returned
status. The OutboundTransfer must already be in the processing
state.
Transitions a test mode created OutboundTransfer to the returned
status. The OutboundTransfer must already be in the processing
state.
Creates an OutboundTransfer.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/outbound_transfers`\n" ( - @spec return_outbound_transfer( - outbound_transfer :: binary(), + @spec create( params :: %{ + optional(:amount) => integer, + optional(:currency) => binary, + optional(:description) => binary, + optional(:destination_payment_method) => binary, + optional(:destination_payment_method_options) => + destination_payment_method_options, optional(:expand) => list(binary), - optional(:returned_details) => returned_details + optional(:financial_account) => binary, + optional(:metadata) => %{optional(binary) => binary}, + optional(:statement_descriptor) => binary }, opts :: Keyword.t() ) :: {:ok, Stripe.Treasury.OutboundTransfer.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def return_outbound_transfer(outbound_transfer, params \\ %{}, opts \\ []) do + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/outbound_transfers", [], []) + + 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 + ) + ) + + ( + nil + + @doc "An OutboundTransfer can be canceled if the funds have not yet been paid out.
\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/treasury/outbound_transfers/{outbound_transfer}/cancel`\n" + ( + @spec cancel( + outbound_transfer :: binary(), + params :: %{optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: + {:ok, Stripe.Treasury.OutboundTransfer.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def cancel(outbound_transfer, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( - "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return", + "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel", [ %OpenApiGen.Blueprint.Parameter{ in: "path", diff --git a/lib/generated/treasury__transaction.ex b/lib/generated/treasury__transaction.ex index f3955517..b8ad74b8 100644 --- a/lib/generated/treasury__transaction.ex +++ b/lib/generated/treasury__transaction.ex @@ -66,6 +66,40 @@ defmodule Stripe.Treasury.Transaction do @type status_transitions :: %{optional(:posted_at) => posted_at | integer} ) + ( + nil + + @doc "Retrieves a list of Transaction objects.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/transactions`\n" + ( + @spec list( + params :: %{ + optional(:created) => created | integer, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:financial_account) => binary, + optional(:limit) => integer, + optional(:order_by) => :created | :posted_at, + optional(:starting_after) => binary, + optional(:status) => :open | :posted | :void, + optional(:status_transitions) => status_transitions + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Treasury.Transaction.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/transactions", [], []) + + 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 @@ -109,38 +143,4 @@ defmodule Stripe.Treasury.Transaction do end ) ) - - ( - nil - - @doc "Retrieves a list of Transaction objects.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/transactions`\n" - ( - @spec list( - params :: %{ - optional(:created) => created | integer, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:financial_account) => binary, - optional(:limit) => integer, - optional(:order_by) => :created | :posted_at, - optional(:starting_after) => binary, - optional(:status) => :open | :posted | :void, - optional(:status_transitions) => status_transitions - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Treasury.Transaction.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/transactions", [], []) - - 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 - ) - ) end diff --git a/lib/generated/treasury__transaction_entry.ex b/lib/generated/treasury__transaction_entry.ex index ceaefbf2..df919abd 100644 --- a/lib/generated/treasury__transaction_entry.ex +++ b/lib/generated/treasury__transaction_entry.ex @@ -57,6 +57,40 @@ defmodule Stripe.Treasury.TransactionEntry do } ) + ( + nil + + @doc "Retrieves a list of TransactionEntry objects.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/transaction_entries`\n" + ( + @spec list( + params :: %{ + optional(:created) => created | integer, + optional(:effective_at) => effective_at | integer, + optional(:ending_before) => binary, + optional(:expand) => list(binary), + optional(:financial_account) => binary, + optional(:limit) => integer, + optional(:order_by) => :created | :effective_at, + optional(:starting_after) => binary, + optional(:transaction) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.List.t(Stripe.Treasury.TransactionEntry.t())} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def list(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/transaction_entries", [], []) + + 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 @@ -100,38 +134,4 @@ defmodule Stripe.Treasury.TransactionEntry do end ) ) - - ( - nil - - @doc "Retrieves a list of TransactionEntry objects.
\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/treasury/transaction_entries`\n" - ( - @spec list( - params :: %{ - optional(:created) => created | integer, - optional(:effective_at) => effective_at | integer, - optional(:ending_before) => binary, - optional(:expand) => list(binary), - optional(:financial_account) => binary, - optional(:limit) => integer, - optional(:order_by) => :created | :effective_at, - optional(:starting_after) => binary, - optional(:transaction) => binary - }, - opts :: Keyword.t() - ) :: - {:ok, Stripe.List.t(Stripe.Treasury.TransactionEntry.t())} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def list(params \\ %{}, opts \\ []) do - path = Stripe.OpenApi.Path.replace_path_params("/v1/treasury/transaction_entries", [], []) - - 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 - ) - ) end diff --git a/lib/generated/webhook_endpoint.ex b/lib/generated/webhook_endpoint.ex index 928c36e1..690fd057 100644 --- a/lib/generated/webhook_endpoint.ex +++ b/lib/generated/webhook_endpoint.ex @@ -35,6 +35,45 @@ defmodule Stripe.WebhookEndpoint do } ) + ( + nil + + @doc "You can also delete webhook endpoints via the webhook endpoint management page of the Stripe dashboard.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/webhook_endpoints/{webhook_endpoint}`\n" + ( + @spec delete(webhook_endpoint :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedWebhookEndpoint.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def delete(webhook_endpoint, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/webhook_endpoints/{webhook_endpoint}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "webhook_endpoint", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "webhook_endpoint", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [webhook_endpoint] + ) + + Stripe.Request.new_request(opts) + |> Stripe.Request.put_endpoint(path) + |> Stripe.Request.put_method(:delete) + |> Stripe.Request.make_request() + end + ) + ) + ( nil @@ -746,43 +785,4 @@ defmodule Stripe.WebhookEndpoint do end ) ) - - ( - nil - - @doc "You can also delete webhook endpoints via the webhook endpoint management page of the Stripe dashboard.
\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/webhook_endpoints/{webhook_endpoint}`\n" - ( - @spec delete(webhook_endpoint :: binary(), opts :: Keyword.t()) :: - {:ok, Stripe.DeletedWebhookEndpoint.t()} - | {:error, Stripe.ApiErrors.t()} - | {:error, term()} - def delete(webhook_endpoint, opts \\ []) do - path = - Stripe.OpenApi.Path.replace_path_params( - "/v1/webhook_endpoints/{webhook_endpoint}", - [ - %OpenApiGen.Blueprint.Parameter{ - in: "path", - name: "webhook_endpoint", - required: true, - schema: %OpenApiGen.Blueprint.Parameter.Schema{ - name: "webhook_endpoint", - title: nil, - type: "string", - items: [], - properties: [], - any_of: [] - } - } - ], - [webhook_endpoint] - ) - - Stripe.Request.new_request(opts) - |> Stripe.Request.put_endpoint(path) - |> Stripe.Request.put_method(:delete) - |> Stripe.Request.make_request() - end - ) - ) end diff --git a/priv/openapi/spec3.sdk.json b/priv/openapi/spec3.sdk.json index 4a5eabbe..2ee69594 100644 --- a/priv/openapi/spec3.sdk.json +++ b/priv/openapi/spec3.sdk.json @@ -177,6 +177,13 @@ ], "x-resourceId": "account", "x-stripeOperations": [ + { + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/accounts/{account}" + }, { "method_name": "retrieve", "method_on": "service", @@ -184,6 +191,13 @@ "operation": "get", "path": "/v1/account" }, + { + "method_name": "list", + "method_on": "service", + "method_type": "list", + "operation": "get", + "path": "/v1/accounts" + }, { "method_name": "retrieve", "method_on": "service", @@ -192,18 +206,18 @@ "path": "/v1/accounts/{account}" }, { - "method_name": "update", + "method_name": "capabilities", "method_on": "service", - "method_type": "update", - "operation": "post", - "path": "/v1/accounts/{account}" + "method_type": "custom", + "operation": "get", + "path": "/v1/accounts/{account}/capabilities" }, { - "method_name": "list", + "method_name": "persons", "method_on": "service", - "method_type": "list", + "method_type": "custom", "operation": "get", - "path": "/v1/accounts" + "path": "/v1/accounts/{account}/persons" }, { "method_name": "create", @@ -213,10 +227,10 @@ "path": "/v1/accounts" }, { - "method_name": "delete", + "method_name": "update", "method_on": "service", - "method_type": "delete", - "operation": "delete", + "method_type": "update", + "operation": "post", "path": "/v1/accounts/{account}" }, { @@ -225,20 +239,6 @@ "method_type": "custom", "operation": "post", "path": "/v1/accounts/{account}/reject" - }, - { - "method_name": "persons", - "method_on": "service", - "method_type": "custom", - "operation": "get", - "path": "/v1/accounts/{account}/persons" - }, - { - "method_name": "capabilities", - "method_on": "service", - "method_type": "custom", - "operation": "get", - "path": "/v1/accounts/{account}/capabilities" } ], "x-stripeResource": { @@ -2161,17 +2161,17 @@ "x-resourceId": "apple_pay_domain", "x-stripeOperations": [ { - "method_name": "list", + "method_name": "delete", "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/apple_pay/domains" + "method_type": "delete", + "operation": "delete", + "path": "/v1/apple_pay/domains/{domain}" }, { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/apple_pay/domains" }, { @@ -2182,11 +2182,11 @@ "path": "/v1/apple_pay/domains/{domain}" }, { - "method_name": "delete", + "method_name": "create", "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/apple_pay/domains/{domain}" + "method_type": "create", + "operation": "post", + "path": "/v1/apple_pay/domains" } ], "x-stripeResource": { @@ -2573,6 +2573,13 @@ ], "x-resourceId": "apps.secret", "x-stripeOperations": [ + { + "method_name": "list", + "method_on": "service", + "method_type": "list", + "operation": "get", + "path": "/v1/apps/secrets" + }, { "method_name": "find", "method_on": "service", @@ -2593,13 +2600,6 @@ "method_type": "custom", "operation": "post", "path": "/v1/apps/secrets/delete" - }, - { - "method_name": "list", - "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/apps/secrets" } ], "x-stripeResource": { @@ -3244,11 +3244,11 @@ "x-resourceId": "bank_account", "x-stripeOperations": [ { - "method_name": "update", + "method_name": "delete", "method_on": "service", - "method_type": "update", - "operation": "post", - "path": "/v1/customers/{customer}/sources/{id}" + "method_type": "delete", + "operation": "delete", + "path": "/v1/accounts/{account}/external_accounts/{id}" }, { "method_name": "delete", @@ -3258,25 +3258,25 @@ "path": "/v1/customers/{customer}/sources/{id}" }, { - "method_name": "verify", + "method_name": "update", "method_on": "service", - "method_type": "custom", + "method_type": "update", "operation": "post", - "path": "/v1/customers/{customer}/sources/{id}/verify" + "path": "/v1/accounts/{account}/external_accounts/{id}" }, { "method_name": "update", "method_on": "service", "method_type": "update", "operation": "post", - "path": "/v1/accounts/{account}/external_accounts/{id}" + "path": "/v1/customers/{customer}/sources/{id}" }, { - "method_name": "delete", + "method_name": "verify", "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/accounts/{account}/external_accounts/{id}" + "method_type": "custom", + "operation": "post", + "path": "/v1/customers/{customer}/sources/{id}/verify" } ], "x-stripeResource": { @@ -3735,6 +3735,13 @@ "operation": "get", "path": "/v1/billing_portal/configurations" }, + { + "method_name": "retrieve", + "method_on": "service", + "method_type": "retrieve", + "operation": "get", + "path": "/v1/billing_portal/configurations/{configuration}" + }, { "method_name": "create", "method_on": "service", @@ -3748,13 +3755,6 @@ "method_type": "update", "operation": "post", "path": "/v1/billing_portal/configurations/{configuration}" - }, - { - "method_name": "retrieve", - "method_on": "service", - "method_type": "retrieve", - "operation": "get", - "path": "/v1/billing_portal/configurations/{configuration}" } ], "x-stripeResource": { @@ -4408,11 +4408,11 @@ "x-resourceId": "card", "x-stripeOperations": [ { - "method_name": "update", + "method_name": "delete", "method_on": "service", - "method_type": "update", - "operation": "post", - "path": "/v1/customers/{customer}/sources/{id}" + "method_type": "delete", + "operation": "delete", + "path": "/v1/accounts/{account}/external_accounts/{id}" }, { "method_name": "delete", @@ -4429,11 +4429,11 @@ "path": "/v1/accounts/{account}/external_accounts/{id}" }, { - "method_name": "delete", + "method_name": "update", "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/accounts/{account}/external_accounts/{id}" + "method_type": "update", + "operation": "post", + "path": "/v1/customers/{customer}/sources/{id}" } ], "x-stripeResource": { @@ -5115,18 +5115,25 @@ "x-resourceId": "charge", "x-stripeOperations": [ { - "method_name": "search", + "method_name": "list", "method_on": "service", - "method_type": "custom", + "method_type": "list", "operation": "get", - "path": "/v1/charges/search" + "path": "/v1/charges" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/charges" + "path": "/v1/charges/{charge}" + }, + { + "method_name": "search", + "method_on": "service", + "method_type": "custom", + "operation": "get", + "path": "/v1/charges/search" }, { "method_name": "create", @@ -5135,13 +5142,6 @@ "operation": "post", "path": "/v1/charges" }, - { - "method_name": "retrieve", - "method_on": "service", - "method_type": "retrieve", - "operation": "get", - "path": "/v1/charges/{charge}" - }, { "method_name": "update", "method_on": "service", @@ -6141,13 +6141,6 @@ "operation": "get", "path": "/v1/checkout/sessions/{session}" }, - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/checkout/sessions" - }, { "method_name": "list_line_items", "method_on": "service", @@ -6155,6 +6148,13 @@ "operation": "get", "path": "/v1/checkout/sessions/{session}/line_items" }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/checkout/sessions" + }, { "method_name": "expire", "method_on": "service", @@ -7191,18 +7191,18 @@ "x-resourceId": "climate.order", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/climate/orders/{order}" + "path": "/v1/climate/orders" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/climate/orders" + "path": "/v1/climate/orders/{order}" }, { "method_name": "create", @@ -7386,18 +7386,18 @@ "x-resourceId": "climate.product", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/climate/products/{product}" + "path": "/v1/climate/products" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/climate/products" + "path": "/v1/climate/products/{product}" } ], "x-stripeResource": { @@ -7501,18 +7501,18 @@ "x-resourceId": "climate.supplier", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/climate/suppliers/{supplier}" + "path": "/v1/climate/suppliers" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/climate/suppliers" + "path": "/v1/climate/suppliers/{supplier}" } ], "x-stripeResource": { @@ -8168,17 +8168,17 @@ "x-resourceId": "coupon", "x-stripeOperations": [ { - "method_name": "list", + "method_name": "delete", "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/coupons" + "method_type": "delete", + "operation": "delete", + "path": "/v1/coupons/{coupon}" }, { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/coupons" }, { @@ -8189,17 +8189,17 @@ "path": "/v1/coupons/{coupon}" }, { - "method_name": "update", + "method_name": "create", "method_on": "service", - "method_type": "update", + "method_type": "create", "operation": "post", - "path": "/v1/coupons/{coupon}" + "path": "/v1/coupons" }, { - "method_name": "delete", + "method_name": "update", "method_on": "service", - "method_type": "delete", - "operation": "delete", + "method_type": "update", + "operation": "post", "path": "/v1/coupons/{coupon}" } ], @@ -8612,12 +8612,19 @@ "x-resourceId": "credit_note", "x-stripeOperations": [ { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/credit_notes" }, + { + "method_name": "retrieve", + "method_on": "service", + "method_type": "retrieve", + "operation": "get", + "path": "/v1/credit_notes/{id}" + }, { "method_name": "preview", "method_on": "service", @@ -8626,17 +8633,17 @@ "path": "/v1/credit_notes/preview" }, { - "method_name": "retrieve", + "method_name": "preview_lines", "method_on": "service", - "method_type": "retrieve", + "method_type": "custom", "operation": "get", - "path": "/v1/credit_notes/{id}" + "path": "/v1/credit_notes/preview/lines" }, { - "method_name": "list", + "method_name": "create", "method_on": "service", - "method_type": "list", - "operation": "get", + "method_type": "create", + "operation": "post", "path": "/v1/credit_notes" }, { @@ -8652,13 +8659,6 @@ "method_type": "custom", "operation": "post", "path": "/v1/credit_notes/{id}/void" - }, - { - "method_name": "preview_lines", - "method_on": "service", - "method_type": "custom", - "operation": "get", - "path": "/v1/credit_notes/preview/lines" } ], "x-stripeResource": { @@ -9346,11 +9346,18 @@ "x-resourceId": "customer", "x-stripeOperations": [ { - "method_name": "search", + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/customers/{customer}" + }, + { + "method_name": "delete_discount", "method_on": "service", "method_type": "custom", - "operation": "get", - "path": "/v1/customers/search" + "operation": "delete", + "path": "/v1/customers/{customer}/discount" }, { "method_name": "list", @@ -9359,13 +9366,6 @@ "operation": "get", "path": "/v1/customers" }, - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/customers" - }, { "method_name": "retrieve", "method_on": "service", @@ -9374,18 +9374,11 @@ "path": "/v1/customers/{customer}" }, { - "method_name": "update", - "method_on": "service", - "method_type": "update", - "operation": "post", - "path": "/v1/customers/{customer}" - }, - { - "method_name": "delete", + "method_name": "balance_transactions", "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/customers/{customer}" + "method_type": "custom", + "operation": "get", + "path": "/v1/customers/{customer}/balance_transactions" }, { "method_name": "list_payment_methods", @@ -9402,18 +9395,25 @@ "path": "/v1/customers/{customer}/payment_methods/{payment_method}" }, { - "method_name": "balance_transactions", + "method_name": "search", "method_on": "service", "method_type": "custom", "operation": "get", - "path": "/v1/customers/{customer}/balance_transactions" + "path": "/v1/customers/search" }, { - "method_name": "fund_cash_balance", + "method_name": "create", "method_on": "service", - "method_type": "custom", + "method_type": "create", "operation": "post", - "path": "/v1/test_helpers/customers/{customer}/fund_cash_balance" + "path": "/v1/customers" + }, + { + "method_name": "update", + "method_on": "service", + "method_type": "update", + "operation": "post", + "path": "/v1/customers/{customer}" }, { "method_name": "create_funding_instructions", @@ -9423,11 +9423,11 @@ "path": "/v1/customers/{customer}/funding_instructions" }, { - "method_name": "delete_discount", + "method_name": "fund_cash_balance", "method_on": "service", "method_type": "custom", - "operation": "delete", - "path": "/v1/customers/{customer}/discount" + "operation": "post", + "path": "/v1/test_helpers/customers/{customer}/fund_cash_balance" } ], "x-stripeResource": { @@ -10400,32 +10400,32 @@ "x-resourceId": "customer_balance_transaction", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "collection", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/customers/{customer}/balance_transactions/{transaction}" + "path": "/v1/customers/{customer}/balance_transactions" }, { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/customers/{customer}/balance_transactions/{transaction}" + "path": "/v1/customers/{customer}/balance_transactions" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "collection", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/customers/{customer}/balance_transactions" + "path": "/v1/customers/{customer}/balance_transactions/{transaction}" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/customers/{customer}/balance_transactions" + "path": "/v1/customers/{customer}/balance_transactions/{transaction}" }, { "method_name": "create", @@ -10570,32 +10570,32 @@ "x-resourceId": "customer_cash_balance_transaction", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "collection", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/customers/{customer}/cash_balance_transactions/{transaction}" + "path": "/v1/customers/{customer}/cash_balance_transactions" }, { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/customers/{customer}/cash_balance_transactions/{transaction}" + "path": "/v1/customers/{customer}/cash_balance_transactions" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "collection", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/customers/{customer}/cash_balance_transactions" + "path": "/v1/customers/{customer}/cash_balance_transactions/{transaction}" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/customers/{customer}/cash_balance_transactions" + "path": "/v1/customers/{customer}/cash_balance_transactions/{transaction}" } ], "x-stripeResource": { @@ -12668,19 +12668,19 @@ "x-expandableFields": [], "x-resourceId": "ephemeral_key", "x-stripeOperations": [ - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/ephemeral_keys" - }, { "method_name": "delete", "method_on": "service", "method_type": "delete", "operation": "delete", "path": "/v1/ephemeral_keys/{key}" + }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/ephemeral_keys" } ], "x-stripeResource": { @@ -13095,6 +13095,13 @@ "x-resourceId": "external_account", "x-stripeBypassValidation": true, "x-stripeOperations": [ + { + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/accounts/{account}/external_accounts/{id}" + }, { "method_name": "list", "method_on": "collection", @@ -13143,13 +13150,6 @@ "method_type": "update", "operation": "post", "path": "/v1/accounts/{account}/external_accounts/{id}" - }, - { - "method_name": "delete", - "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/accounts/{account}/external_accounts/{id}" } ], "x-stripeResource": { @@ -13344,18 +13344,18 @@ "x-resourceId": "fee_refund", "x-stripeOperations": [ { - "method_name": "create", + "method_name": "retrieve", "method_on": "collection", - "method_type": "create", - "operation": "post", - "path": "/v1/application_fees/{id}/refunds" + "method_type": "retrieve", + "operation": "get", + "path": "/v1/application_fees/{fee}/refunds/{id}" }, { - "method_name": "create", + "method_name": "retrieve", "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/application_fees/{id}/refunds" + "method_type": "retrieve", + "operation": "get", + "path": "/v1/application_fees/{fee}/refunds/{id}" }, { "method_name": "list", @@ -13372,25 +13372,25 @@ "path": "/v1/application_fees/{id}/refunds" }, { - "method_name": "retrieve", - "method_on": "collection", - "method_type": "retrieve", - "operation": "get", + "method_name": "update", + "method_on": "service", + "method_type": "update", + "operation": "post", "path": "/v1/application_fees/{fee}/refunds/{id}" }, { - "method_name": "retrieve", - "method_on": "service", - "method_type": "retrieve", - "operation": "get", - "path": "/v1/application_fees/{fee}/refunds/{id}" + "method_name": "create", + "method_on": "collection", + "method_type": "create", + "operation": "post", + "path": "/v1/application_fees/{id}/refunds" }, { - "method_name": "update", + "method_name": "create", "method_on": "service", - "method_type": "update", + "method_type": "create", "operation": "post", - "path": "/v1/application_fees/{fee}/refunds/{id}" + "path": "/v1/application_fees/{id}/refunds" } ], "x-stripeResource": { @@ -13669,6 +13669,13 @@ ], "x-resourceId": "file_link", "x-stripeOperations": [ + { + "method_name": "list", + "method_on": "service", + "method_type": "list", + "operation": "get", + "path": "/v1/file_links" + }, { "method_name": "retrieve", "method_on": "service", @@ -13689,13 +13696,6 @@ "method_type": "update", "operation": "post", "path": "/v1/file_links/{link}" - }, - { - "method_name": "list", - "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/file_links" } ], "x-stripeResource": { @@ -13934,18 +13934,18 @@ "path": "/v1/financial_connections/accounts/{account}/owners" }, { - "method_name": "refresh", + "method_name": "disconnect", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/financial_connections/accounts/{account}/refresh" + "path": "/v1/financial_connections/accounts/{account}/disconnect" }, { - "method_name": "disconnect", + "method_name": "refresh", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/financial_connections/accounts/{account}/disconnect" + "path": "/v1/financial_connections/accounts/{account}/refresh" }, { "method_name": "subscribe", @@ -14339,19 +14339,19 @@ ], "x-resourceId": "financial_connections.session", "x-stripeOperations": [ - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/financial_connections/sessions" - }, { "method_name": "retrieve", "method_on": "service", "method_type": "retrieve", "operation": "get", "path": "/v1/financial_connections/sessions/{session}" + }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/financial_connections/sessions" } ], "x-stripeResource": { @@ -14447,18 +14447,18 @@ "x-resourceId": "financial_connections.transaction", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/financial_connections/transactions/{transaction}" + "path": "/v1/financial_connections/transactions" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/financial_connections/transactions" + "path": "/v1/financial_connections/transactions/{transaction}" } ], "x-stripeResource": { @@ -15645,18 +15645,18 @@ "x-resourceId": "identity.verification_report", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/identity/verification_reports/{report}" + "path": "/v1/identity/verification_reports" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/identity/verification_reports" + "path": "/v1/identity/verification_reports/{report}" } ], "x-stripeResource": { @@ -15814,10 +15814,10 @@ "x-resourceId": "identity.verification_session", "x-stripeOperations": [ { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/identity/verification_sessions" }, { @@ -15828,12 +15828,19 @@ "path": "/v1/identity/verification_sessions/{session}" }, { - "method_name": "list", + "method_name": "create", "method_on": "service", - "method_type": "list", - "operation": "get", + "method_type": "create", + "operation": "post", "path": "/v1/identity/verification_sessions" }, + { + "method_name": "update", + "method_on": "service", + "method_type": "update", + "operation": "post", + "path": "/v1/identity/verification_sessions/{session}" + }, { "method_name": "cancel", "method_on": "service", @@ -15847,13 +15854,6 @@ "method_type": "custom", "operation": "post", "path": "/v1/identity/verification_sessions/{session}/redact" - }, - { - "method_name": "update", - "method_on": "service", - "method_type": "update", - "operation": "post", - "path": "/v1/identity/verification_sessions/{session}" } ], "x-stripeResource": { @@ -16929,32 +16929,39 @@ "x-resourceId": "invoice", "x-stripeOperations": [ { - "method_name": "search", + "method_name": "delete", "method_on": "service", - "method_type": "custom", - "operation": "get", - "path": "/v1/invoices/search" + "method_type": "delete", + "operation": "delete", + "path": "/v1/invoices/{invoice}" }, { - "method_name": "upcoming", + "method_name": "list", "method_on": "service", - "method_type": "custom", + "method_type": "list", "operation": "get", - "path": "/v1/invoices/upcoming" + "path": "/v1/invoices" }, { - "method_name": "update", + "method_name": "retrieve", "method_on": "service", - "method_type": "update", - "operation": "post", + "method_type": "retrieve", + "operation": "get", "path": "/v1/invoices/{invoice}" }, { - "method_name": "pay", + "method_name": "search", "method_on": "service", "method_type": "custom", - "operation": "post", - "path": "/v1/invoices/{invoice}/pay" + "operation": "get", + "path": "/v1/invoices/search" + }, + { + "method_name": "upcoming", + "method_on": "service", + "method_type": "custom", + "operation": "get", + "path": "/v1/invoices/upcoming" }, { "method_name": "upcomingLines", @@ -16971,46 +16978,39 @@ "path": "/v1/invoices" }, { - "method_name": "list", - "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/invoices" - }, - { - "method_name": "retrieve", + "method_name": "update", "method_on": "service", - "method_type": "retrieve", - "operation": "get", + "method_type": "update", + "operation": "post", "path": "/v1/invoices/{invoice}" }, { - "method_name": "delete", + "method_name": "finalize_invoice", "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/invoices/{invoice}" + "method_type": "custom", + "operation": "post", + "path": "/v1/invoices/{invoice}/finalize" }, { - "method_name": "finalize_invoice", + "method_name": "mark_uncollectible", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/invoices/{invoice}/finalize" + "path": "/v1/invoices/{invoice}/mark_uncollectible" }, { - "method_name": "send_invoice", + "method_name": "pay", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/invoices/{invoice}/send" + "path": "/v1/invoices/{invoice}/pay" }, { - "method_name": "mark_uncollectible", + "method_name": "send_invoice", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/invoices/{invoice}/mark_uncollectible" + "path": "/v1/invoices/{invoice}/send" }, { "method_name": "void_invoice", @@ -18112,17 +18112,17 @@ "x-resourceId": "invoiceitem", "x-stripeOperations": [ { - "method_name": "list", + "method_name": "delete", "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/invoiceitems" + "method_type": "delete", + "operation": "delete", + "path": "/v1/invoiceitems/{invoiceitem}" }, { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/invoiceitems" }, { @@ -18133,17 +18133,17 @@ "path": "/v1/invoiceitems/{invoiceitem}" }, { - "method_name": "update", + "method_name": "create", "method_on": "service", - "method_type": "update", + "method_type": "create", "operation": "post", - "path": "/v1/invoiceitems/{invoiceitem}" + "path": "/v1/invoiceitems" }, { - "method_name": "delete", + "method_name": "update", "method_on": "service", - "method_type": "delete", - "operation": "delete", + "method_type": "update", + "operation": "post", "path": "/v1/invoiceitems/{invoiceitem}" } ], @@ -18899,32 +18899,32 @@ "path": "/v1/test_helpers/issuing/authorizations" }, { - "method_name": "increment", + "method_name": "capture", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/issuing/authorizations/{authorization}/increment" + "path": "/v1/test_helpers/issuing/authorizations/{authorization}/capture" }, { - "method_name": "reverse", + "method_name": "expire", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/issuing/authorizations/{authorization}/reverse" + "path": "/v1/test_helpers/issuing/authorizations/{authorization}/expire" }, { - "method_name": "expire", + "method_name": "increment", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/issuing/authorizations/{authorization}/expire" + "path": "/v1/test_helpers/issuing/authorizations/{authorization}/increment" }, { - "method_name": "capture", + "method_name": "reverse", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/issuing/authorizations/{authorization}/capture" + "path": "/v1/test_helpers/issuing/authorizations/{authorization}/reverse" } ], "x-stripeResource": { @@ -19153,13 +19153,6 @@ "operation": "get", "path": "/v1/issuing/cards" }, - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/issuing/cards" - }, { "method_name": "retrieve", "method_on": "service", @@ -19167,6 +19160,13 @@ "operation": "get", "path": "/v1/issuing/cards/{card}" }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/issuing/cards" + }, { "method_name": "update", "method_on": "service", @@ -19182,11 +19182,11 @@ "path": "/v1/test_helpers/issuing/cards/{card}/shipping/deliver" }, { - "method_name": "ship_card", + "method_name": "fail_card", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/issuing/cards/{card}/shipping/ship" + "path": "/v1/test_helpers/issuing/cards/{card}/shipping/fail" }, { "method_name": "return_card", @@ -19196,11 +19196,11 @@ "path": "/v1/test_helpers/issuing/cards/{card}/shipping/return" }, { - "method_name": "fail_card", + "method_name": "ship_card", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/issuing/cards/{card}/shipping/fail" + "path": "/v1/test_helpers/issuing/cards/{card}/shipping/ship" } ], "x-stripeResource": { @@ -19361,13 +19361,6 @@ "operation": "get", "path": "/v1/issuing/cardholders" }, - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/issuing/cardholders" - }, { "method_name": "retrieve", "method_on": "service", @@ -19375,6 +19368,13 @@ "operation": "get", "path": "/v1/issuing/cardholders/{cardholder}" }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/issuing/cardholders" + }, { "method_name": "update", "method_on": "service", @@ -19510,6 +19510,13 @@ "operation": "get", "path": "/v1/issuing/disputes" }, + { + "method_name": "retrieve", + "method_on": "service", + "method_type": "retrieve", + "operation": "get", + "path": "/v1/issuing/disputes/{dispute}" + }, { "method_name": "create", "method_on": "service", @@ -19524,13 +19531,6 @@ "operation": "post", "path": "/v1/issuing/disputes/{dispute}" }, - { - "method_name": "retrieve", - "method_on": "service", - "method_type": "retrieve", - "operation": "get", - "path": "/v1/issuing/disputes/{dispute}" - }, { "method_name": "submit", "method_on": "service", @@ -19972,25 +19972,25 @@ "path": "/v1/issuing/transactions/{transaction}" }, { - "method_name": "create_force_capture", + "method_name": "refund", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/issuing/transactions/create_force_capture" + "path": "/v1/test_helpers/issuing/transactions/{transaction}/refund" }, { - "method_name": "create_unlinked_refund", + "method_name": "create_force_capture", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/issuing/transactions/create_unlinked_refund" + "path": "/v1/test_helpers/issuing/transactions/create_force_capture" }, { - "method_name": "refund", + "method_name": "create_unlinked_refund", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/issuing/transactions/{transaction}/refund" + "path": "/v1/test_helpers/issuing/transactions/create_unlinked_refund" } ], "x-stripeResource": { @@ -26862,20 +26862,6 @@ ], "x-resourceId": "payment_intent", "x-stripeOperations": [ - { - "method_name": "search", - "method_on": "service", - "method_type": "custom", - "operation": "get", - "path": "/v1/payment_intents/search" - }, - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/payment_intents" - }, { "method_name": "list", "method_on": "service", @@ -26890,6 +26876,20 @@ "operation": "get", "path": "/v1/payment_intents/{intent}" }, + { + "method_name": "search", + "method_on": "service", + "method_type": "custom", + "operation": "get", + "path": "/v1/payment_intents/search" + }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/payment_intents" + }, { "method_name": "update", "method_on": "service", @@ -26898,11 +26898,11 @@ "path": "/v1/payment_intents/{intent}" }, { - "method_name": "confirm", + "method_name": "apply_customer_balance", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/payment_intents/{intent}/confirm" + "path": "/v1/payment_intents/{intent}/apply_customer_balance" }, { "method_name": "cancel", @@ -26919,25 +26919,25 @@ "path": "/v1/payment_intents/{intent}/capture" }, { - "method_name": "increment_authorization", + "method_name": "confirm", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/payment_intents/{intent}/increment_authorization" + "path": "/v1/payment_intents/{intent}/confirm" }, { - "method_name": "verify_microdeposits", + "method_name": "increment_authorization", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/payment_intents/{intent}/verify_microdeposits" + "path": "/v1/payment_intents/{intent}/increment_authorization" }, { - "method_name": "apply_customer_balance", + "method_name": "verify_microdeposits", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/payment_intents/{intent}/apply_customer_balance" + "path": "/v1/payment_intents/{intent}/verify_microdeposits" } ], "x-stripeResource": { @@ -30205,10 +30205,10 @@ "x-resourceId": "payment_method", "x-stripeOperations": [ { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/payment_methods" }, { @@ -30219,18 +30219,18 @@ "path": "/v1/payment_methods/{payment_method}" }, { - "method_name": "update", + "method_name": "create", "method_on": "service", - "method_type": "update", + "method_type": "create", "operation": "post", - "path": "/v1/payment_methods/{payment_method}" + "path": "/v1/payment_methods" }, { - "method_name": "list", + "method_name": "update", "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/payment_methods" + "method_type": "update", + "operation": "post", + "path": "/v1/payment_methods/{payment_method}" }, { "method_name": "attach", @@ -31244,18 +31244,18 @@ "path": "/v1/payment_method_configurations/{configuration}" }, { - "method_name": "update", + "method_name": "create", "method_on": "service", - "method_type": "update", + "method_type": "create", "operation": "post", - "path": "/v1/payment_method_configurations/{configuration}" + "path": "/v1/payment_method_configurations" }, { - "method_name": "create", + "method_name": "update", "method_on": "service", - "method_type": "create", + "method_type": "update", "operation": "post", - "path": "/v1/payment_method_configurations" + "path": "/v1/payment_method_configurations/{configuration}" } ], "x-stripeResource": { @@ -33722,18 +33722,18 @@ "x-resourceId": "payment_method_domain", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/payment_method_domains/{payment_method_domain}" + "path": "/v1/payment_method_domains" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/payment_method_domains" + "path": "/v1/payment_method_domains/{payment_method_domain}" }, { "method_name": "create", @@ -36763,18 +36763,18 @@ "x-resourceId": "payout", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/payouts/{payout}" + "path": "/v1/payouts" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/payouts" + "path": "/v1/payouts/{payout}" }, { "method_name": "create", @@ -37170,6 +37170,13 @@ ], "x-resourceId": "person", "x-stripeOperations": [ + { + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/accounts/{account}/persons/{person}" + }, { "method_name": "list", "method_on": "collection", @@ -37218,13 +37225,6 @@ "method_type": "update", "operation": "post", "path": "/v1/accounts/{account}/persons/{person}" - }, - { - "method_name": "delete", - "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/accounts/{account}/persons/{person}" } ], "x-stripeResource": { @@ -37700,17 +37700,17 @@ "x-resourceId": "plan", "x-stripeOperations": [ { - "method_name": "list", + "method_name": "delete", "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/plans" + "method_type": "delete", + "operation": "delete", + "path": "/v1/plans/{plan}" }, { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/plans" }, { @@ -37721,17 +37721,17 @@ "path": "/v1/plans/{plan}" }, { - "method_name": "update", + "method_name": "create", "method_on": "service", - "method_type": "update", + "method_type": "create", "operation": "post", - "path": "/v1/plans/{plan}" + "path": "/v1/plans" }, { - "method_name": "delete", + "method_name": "update", "method_on": "service", - "method_type": "delete", - "operation": "delete", + "method_type": "update", + "operation": "post", "path": "/v1/plans/{plan}" } ], @@ -38710,18 +38710,25 @@ "x-resourceId": "price", "x-stripeOperations": [ { - "method_name": "search", + "method_name": "list", "method_on": "service", - "method_type": "custom", + "method_type": "list", "operation": "get", - "path": "/v1/prices/search" + "path": "/v1/prices" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/prices" + "path": "/v1/prices/{price}" + }, + { + "method_name": "search", + "method_on": "service", + "method_type": "custom", + "operation": "get", + "path": "/v1/prices/search" }, { "method_name": "create", @@ -38730,13 +38737,6 @@ "operation": "post", "path": "/v1/prices" }, - { - "method_name": "retrieve", - "method_on": "service", - "method_type": "retrieve", - "operation": "get", - "path": "/v1/prices/{price}" - }, { "method_name": "update", "method_on": "service", @@ -39019,17 +39019,17 @@ "x-resourceId": "product", "x-stripeOperations": [ { - "method_name": "search", + "method_name": "delete", "method_on": "service", - "method_type": "custom", - "operation": "get", - "path": "/v1/products/search" + "method_type": "delete", + "operation": "delete", + "path": "/v1/products/{id}" }, { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/products" }, { @@ -39040,24 +39040,24 @@ "path": "/v1/products/{id}" }, { - "method_name": "update", + "method_name": "search", "method_on": "service", - "method_type": "update", - "operation": "post", - "path": "/v1/products/{id}" + "method_type": "custom", + "operation": "get", + "path": "/v1/products/search" }, { - "method_name": "list", + "method_name": "create", "method_on": "service", - "method_type": "list", - "operation": "get", + "method_type": "create", + "operation": "post", "path": "/v1/products" }, { - "method_name": "delete", + "method_name": "update", "method_on": "service", - "method_type": "delete", - "operation": "delete", + "method_type": "update", + "operation": "post", "path": "/v1/products/{id}" } ], @@ -39243,6 +39243,13 @@ ], "x-resourceId": "promotion_code", "x-stripeOperations": [ + { + "method_name": "list", + "method_on": "service", + "method_type": "list", + "operation": "get", + "path": "/v1/promotion_codes" + }, { "method_name": "retrieve", "method_on": "service", @@ -39263,13 +39270,6 @@ "method_type": "update", "operation": "post", "path": "/v1/promotion_codes/{promotion_code}" - }, - { - "method_name": "list", - "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/promotion_codes" } ], "x-stripeResource": { @@ -39803,6 +39803,13 @@ ], "x-resourceId": "quote", "x-stripeOperations": [ + { + "method_name": "list", + "method_on": "service", + "method_type": "list", + "operation": "get", + "path": "/v1/quotes" + }, { "method_name": "retrieve", "method_on": "service", @@ -39811,32 +39818,32 @@ "path": "/v1/quotes/{quote}" }, { - "method_name": "create", + "method_name": "list_computed_upfront_line_items", "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/quotes" + "method_type": "custom", + "operation": "get", + "path": "/v1/quotes/{quote}/computed_upfront_line_items" }, { - "method_name": "update", + "method_name": "list_line_items", "method_on": "service", - "method_type": "update", - "operation": "post", - "path": "/v1/quotes/{quote}" + "method_type": "custom", + "operation": "get", + "path": "/v1/quotes/{quote}/line_items" }, { - "method_name": "cancel", + "method_name": "create", "method_on": "service", - "method_type": "custom", + "method_type": "create", "operation": "post", - "path": "/v1/quotes/{quote}/cancel" + "path": "/v1/quotes" }, { - "method_name": "finalize_quote", + "method_name": "update", "method_on": "service", - "method_type": "custom", + "method_type": "update", "operation": "post", - "path": "/v1/quotes/{quote}/finalize" + "path": "/v1/quotes/{quote}" }, { "method_name": "accept", @@ -39846,25 +39853,18 @@ "path": "/v1/quotes/{quote}/accept" }, { - "method_name": "list", - "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/quotes" - }, - { - "method_name": "list_line_items", + "method_name": "cancel", "method_on": "service", "method_type": "custom", - "operation": "get", - "path": "/v1/quotes/{quote}/line_items" + "operation": "post", + "path": "/v1/quotes/{quote}/cancel" }, { - "method_name": "list_computed_upfront_line_items", + "method_name": "finalize_quote", "method_on": "service", "method_type": "custom", - "operation": "get", - "path": "/v1/quotes/{quote}/computed_upfront_line_items" + "operation": "post", + "path": "/v1/quotes/{quote}/finalize" }, { "method_name": "pdf", @@ -40581,6 +40581,13 @@ ], "x-resourceId": "radar.value_list", "x-stripeOperations": [ + { + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/radar/value_lists/{value_list}" + }, { "method_name": "list", "method_on": "service", @@ -40608,13 +40615,6 @@ "method_type": "update", "operation": "post", "path": "/v1/radar/value_lists/{value_list}" - }, - { - "method_name": "delete", - "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/radar/value_lists/{value_list}" } ], "x-stripeResource": { @@ -40677,6 +40677,13 @@ "x-expandableFields": [], "x-resourceId": "radar.value_list_item", "x-stripeOperations": [ + { + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/radar/value_list_items/{item}" + }, { "method_name": "list", "method_on": "service", @@ -40697,13 +40704,6 @@ "method_type": "create", "operation": "post", "path": "/v1/radar/value_list_items" - }, - { - "method_name": "delete", - "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/radar/value_list_items/{item}" } ], "x-stripeResource": { @@ -41140,13 +41140,6 @@ "operation": "get", "path": "/v1/refunds" }, - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/refunds" - }, { "method_name": "retrieve", "method_on": "service", @@ -41154,6 +41147,13 @@ "operation": "get", "path": "/v1/refunds/{refund}" }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/refunds" + }, { "method_name": "update", "method_on": "service", @@ -41530,6 +41530,13 @@ ], "x-resourceId": "reporting.report_run", "x-stripeOperations": [ + { + "method_name": "list", + "method_on": "service", + "method_type": "list", + "operation": "get", + "path": "/v1/reporting/report_runs" + }, { "method_name": "retrieve", "method_on": "service", @@ -41543,13 +41550,6 @@ "method_type": "create", "operation": "post", "path": "/v1/reporting/report_runs" - }, - { - "method_name": "list", - "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/reporting/report_runs" } ], "x-stripeResource": { @@ -41660,18 +41660,18 @@ "x-resourceId": "reporting.report_type", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/reporting/report_types/{report_type}" + "path": "/v1/reporting/report_types" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/reporting/report_types" + "path": "/v1/reporting/report_types/{report_type}" } ], "x-stripeResource": { @@ -43413,13 +43413,6 @@ ], "x-resourceId": "setup_intent", "x-stripeOperations": [ - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/setup_intents" - }, { "method_name": "list", "method_on": "service", @@ -43434,6 +43427,13 @@ "operation": "get", "path": "/v1/setup_intents/{intent}" }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/setup_intents" + }, { "method_name": "update", "method_on": "service", @@ -43442,18 +43442,18 @@ "path": "/v1/setup_intents/{intent}" }, { - "method_name": "confirm", + "method_name": "cancel", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/setup_intents/{intent}/confirm" + "path": "/v1/setup_intents/{intent}/cancel" }, { - "method_name": "cancel", + "method_name": "confirm", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/setup_intents/{intent}/cancel" + "path": "/v1/setup_intents/{intent}/confirm" }, { "method_name": "verify_microdeposits", @@ -44565,6 +44565,13 @@ "operation": "get", "path": "/v1/sources/{source}" }, + { + "method_name": "source_transactions", + "method_on": "service", + "method_type": "custom", + "operation": "get", + "path": "/v1/sources/{source}/source_transactions" + }, { "method_name": "create", "method_on": "service", @@ -44585,13 +44592,6 @@ "method_type": "custom", "operation": "post", "path": "/v1/sources/{source}/verify" - }, - { - "method_name": "source_transactions", - "method_on": "service", - "method_type": "custom", - "operation": "get", - "path": "/v1/sources/{source}/source_transactions" } ], "x-stripeResource": { @@ -46697,33 +46697,26 @@ "x-resourceId": "subscription", "x-stripeOperations": [ { - "method_name": "search", + "method_name": "cancel", "method_on": "service", "method_type": "custom", - "operation": "get", - "path": "/v1/subscriptions/search" + "operation": "delete", + "path": "/v1/subscriptions/{subscription_exposed_id}" }, { - "method_name": "list", + "method_name": "delete_discount", "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/subscriptions" + "method_type": "custom", + "operation": "delete", + "path": "/v1/subscriptions/{subscription_exposed_id}/discount" }, { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/subscriptions" }, - { - "method_name": "update", - "method_on": "service", - "method_type": "update", - "operation": "post", - "path": "/v1/subscriptions/{subscription_exposed_id}" - }, { "method_name": "retrieve", "method_on": "service", @@ -46732,11 +46725,18 @@ "path": "/v1/subscriptions/{subscription_exposed_id}" }, { - "method_name": "cancel", + "method_name": "search", "method_on": "service", "method_type": "custom", - "operation": "delete", - "path": "/v1/subscriptions/{subscription_exposed_id}" + "operation": "get", + "path": "/v1/subscriptions/search" + }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/subscriptions" }, { "method_name": "resume", @@ -46746,11 +46746,11 @@ "path": "/v1/subscriptions/{subscription}/resume" }, { - "method_name": "delete_discount", + "method_name": "update", "method_on": "service", - "method_type": "custom", - "operation": "delete", - "path": "/v1/subscriptions/{subscription_exposed_id}/discount" + "method_type": "update", + "operation": "post", + "path": "/v1/subscriptions/{subscription_exposed_id}" } ], "x-stripeResource": { @@ -46898,6 +46898,13 @@ ], "x-resourceId": "subscription_item", "x-stripeOperations": [ + { + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/subscription_items/{item}" + }, { "method_name": "list", "method_on": "service", @@ -46912,6 +46919,13 @@ "operation": "get", "path": "/v1/subscription_items/{item}" }, + { + "method_name": "usage_record_summaries", + "method_on": "service", + "method_type": "custom", + "operation": "get", + "path": "/v1/subscription_items/{subscription_item}/usage_record_summaries" + }, { "method_name": "create", "method_on": "service", @@ -46925,20 +46939,6 @@ "method_type": "update", "operation": "post", "path": "/v1/subscription_items/{item}" - }, - { - "method_name": "delete", - "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/subscription_items/{item}" - }, - { - "method_name": "usage_record_summaries", - "method_on": "service", - "method_type": "custom", - "operation": "get", - "path": "/v1/subscription_items/{subscription_item}/usage_record_summaries" } ], "x-stripeResource": { @@ -47262,13 +47262,6 @@ "operation": "get", "path": "/v1/subscription_schedules" }, - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/subscription_schedules" - }, { "method_name": "retrieve", "method_on": "service", @@ -47276,6 +47269,13 @@ "operation": "get", "path": "/v1/subscription_schedules/{schedule}" }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/subscription_schedules" + }, { "method_name": "update", "method_on": "service", @@ -48422,19 +48422,19 @@ ], "x-resourceId": "tax.calculation", "x-stripeOperations": [ - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/tax/calculations" - }, { "method_name": "list_line_items", "method_on": "service", "method_type": "custom", "operation": "get", "path": "/v1/tax/calculations/{calculation}/line_items" + }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/tax/calculations" } ], "x-stripeResource": { @@ -48610,13 +48610,6 @@ "operation": "get", "path": "/v1/tax/registrations" }, - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/tax/registrations" - }, { "method_name": "retrieve", "method_on": "service", @@ -48624,6 +48617,13 @@ "operation": "get", "path": "/v1/tax/registrations/{id}" }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/tax/registrations" + }, { "method_name": "update", "method_on": "service", @@ -48888,11 +48888,11 @@ "path": "/v1/tax/transactions/{transaction}" }, { - "method_name": "create_reversal", + "method_name": "list_line_items", "method_on": "service", "method_type": "custom", - "operation": "post", - "path": "/v1/tax/transactions/create_reversal" + "operation": "get", + "path": "/v1/tax/transactions/{transaction}/line_items" }, { "method_name": "create_from_calculation", @@ -48902,11 +48902,11 @@ "path": "/v1/tax/transactions/create_from_calculation" }, { - "method_name": "list_line_items", + "method_name": "create_reversal", "method_on": "service", "method_type": "custom", - "operation": "get", - "path": "/v1/tax/transactions/{transaction}/line_items" + "operation": "post", + "path": "/v1/tax/transactions/create_reversal" } ], "x-stripeResource": { @@ -49288,17 +49288,24 @@ "x-resourceId": "tax_id", "x-stripeOperations": [ { - "method_name": "create", + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/customers/{customer}/tax_ids/{id}" + }, + { + "method_name": "list", "method_on": "collection", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/customers/{customer}/tax_ids" }, { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/customers/{customer}/tax_ids" }, { @@ -49316,25 +49323,18 @@ "path": "/v1/customers/{customer}/tax_ids/{id}" }, { - "method_name": "list", + "method_name": "create", "method_on": "collection", - "method_type": "list", - "operation": "get", + "method_type": "create", + "operation": "post", "path": "/v1/customers/{customer}/tax_ids" }, { - "method_name": "list", + "method_name": "create", "method_on": "service", - "method_type": "list", - "operation": "get", + "method_type": "create", + "operation": "post", "path": "/v1/customers/{customer}/tax_ids" - }, - { - "method_name": "delete", - "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/customers/{customer}/tax_ids/{id}" } ], "x-stripeResource": { @@ -50687,11 +50687,11 @@ "x-resourceId": "terminal.configuration", "x-stripeOperations": [ { - "method_name": "create", + "method_name": "delete", "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/terminal/configurations" + "method_type": "delete", + "operation": "delete", + "path": "/v1/terminal/configurations/{configuration}" }, { "method_name": "list", @@ -50708,17 +50708,17 @@ "path": "/v1/terminal/configurations/{configuration}" }, { - "method_name": "update", + "method_name": "create", "method_on": "service", - "method_type": "update", + "method_type": "create", "operation": "post", - "path": "/v1/terminal/configurations/{configuration}" + "path": "/v1/terminal/configurations" }, { - "method_name": "delete", + "method_name": "update", "method_on": "service", - "method_type": "delete", - "operation": "delete", + "method_type": "update", + "operation": "post", "path": "/v1/terminal/configurations/{configuration}" } ], @@ -50827,6 +50827,20 @@ ], "x-resourceId": "terminal.location", "x-stripeOperations": [ + { + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/terminal/locations/{location}" + }, + { + "method_name": "list", + "method_on": "service", + "method_type": "list", + "operation": "get", + "path": "/v1/terminal/locations" + }, { "method_name": "retrieve", "method_on": "service", @@ -50847,20 +50861,6 @@ "method_type": "update", "operation": "post", "path": "/v1/terminal/locations/{location}" - }, - { - "method_name": "list", - "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/terminal/locations" - }, - { - "method_name": "delete", - "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/terminal/locations/{location}" } ], "x-stripeResource": { @@ -50989,12 +50989,19 @@ "x-resourceId": "terminal.reader", "x-stripeOperations": [ { - "method_name": "update", + "method_name": "delete", "method_on": "service", - "method_type": "update", - "operation": "post", + "method_type": "delete", + "operation": "delete", "path": "/v1/terminal/readers/{reader}" }, + { + "method_name": "list", + "method_on": "service", + "method_type": "list", + "operation": "get", + "path": "/v1/terminal/readers" + }, { "method_name": "retrieve", "method_on": "service", @@ -51010,18 +51017,18 @@ "path": "/v1/terminal/readers" }, { - "method_name": "list", + "method_name": "update", "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/terminal/readers" + "method_type": "update", + "operation": "post", + "path": "/v1/terminal/readers/{reader}" }, { - "method_name": "delete", + "method_name": "cancel_action", "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/terminal/readers/{reader}" + "method_type": "custom", + "operation": "post", + "path": "/v1/terminal/readers/{reader}/cancel_action" }, { "method_name": "process_payment_intent", @@ -51038,11 +51045,11 @@ "path": "/v1/terminal/readers/{reader}/process_setup_intent" }, { - "method_name": "cancel_action", + "method_name": "refund_payment", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/terminal/readers/{reader}/cancel_action" + "path": "/v1/terminal/readers/{reader}/refund_payment" }, { "method_name": "set_reader_display", @@ -51051,13 +51058,6 @@ "operation": "post", "path": "/v1/terminal/readers/{reader}/set_reader_display" }, - { - "method_name": "refund_payment", - "method_on": "service", - "method_type": "custom", - "operation": "post", - "path": "/v1/terminal/readers/{reader}/refund_payment" - }, { "method_name": "present_payment_method", "method_on": "service", @@ -51673,6 +51673,20 @@ "x-expandableFields": [], "x-resourceId": "test_helpers.test_clock", "x-stripeOperations": [ + { + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/test_helpers/test_clocks/{test_clock}" + }, + { + "method_name": "list", + "method_on": "service", + "method_type": "list", + "operation": "get", + "path": "/v1/test_helpers/test_clocks" + }, { "method_name": "retrieve", "method_on": "service", @@ -51687,26 +51701,12 @@ "operation": "post", "path": "/v1/test_helpers/test_clocks" }, - { - "method_name": "delete", - "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/test_helpers/test_clocks/{test_clock}" - }, { "method_name": "advance", "method_on": "service", "method_type": "custom", "operation": "post", "path": "/v1/test_helpers/test_clocks/{test_clock}/advance" - }, - { - "method_name": "list", - "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/test_helpers/test_clocks" } ], "x-stripeResource": { @@ -52214,13 +52214,6 @@ ], "x-resourceId": "topup", "x-stripeOperations": [ - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/topups" - }, { "method_name": "list", "method_on": "service", @@ -52235,6 +52228,13 @@ "operation": "get", "path": "/v1/topups/{topup}" }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/topups" + }, { "method_name": "update", "method_on": "service", @@ -52551,13 +52551,6 @@ ], "x-resourceId": "transfer", "x-stripeOperations": [ - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/transfers" - }, { "method_name": "list", "method_on": "service", @@ -52572,6 +52565,13 @@ "operation": "get", "path": "/v1/transfers/{transfer}" }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/transfers" + }, { "method_name": "update", "method_on": "service", @@ -52812,20 +52812,6 @@ ], "x-resourceId": "transfer_reversal", "x-stripeOperations": [ - { - "method_name": "create", - "method_on": "collection", - "method_type": "create", - "operation": "post", - "path": "/v1/transfers/{id}/reversals" - }, - { - "method_name": "create", - "method_on": "service", - "method_type": "create", - "operation": "post", - "path": "/v1/transfers/{id}/reversals" - }, { "method_name": "list", "method_on": "collection", @@ -52854,6 +52840,20 @@ "operation": "get", "path": "/v1/transfers/{transfer}/reversals/{id}" }, + { + "method_name": "create", + "method_on": "collection", + "method_type": "create", + "operation": "post", + "path": "/v1/transfers/{id}/reversals" + }, + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/transfers/{id}/reversals" + }, { "method_name": "update", "method_on": "service", @@ -53264,10 +53264,10 @@ "x-resourceId": "treasury.debit_reversal", "x-stripeOperations": [ { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/treasury/debit_reversals" }, { @@ -53278,10 +53278,10 @@ "path": "/v1/treasury/debit_reversals/{debit_reversal}" }, { - "method_name": "list", + "method_name": "create", "method_on": "service", - "method_type": "list", - "operation": "get", + "method_type": "create", + "operation": "post", "path": "/v1/treasury/debit_reversals" } ], @@ -53504,45 +53504,45 @@ "x-resourceId": "treasury.financial_account", "x-stripeOperations": [ { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/treasury/financial_accounts" }, { - "method_name": "update", + "method_name": "retrieve", "method_on": "service", - "method_type": "update", - "operation": "post", + "method_type": "retrieve", + "operation": "get", "path": "/v1/treasury/financial_accounts/{financial_account}" }, { - "method_name": "update_features", + "method_name": "retrieve_features", "method_on": "service", "method_type": "custom", - "operation": "post", + "operation": "get", "path": "/v1/treasury/financial_accounts/{financial_account}/features" }, { - "method_name": "list", + "method_name": "create", "method_on": "service", - "method_type": "list", - "operation": "get", + "method_type": "create", + "operation": "post", "path": "/v1/treasury/financial_accounts" }, { - "method_name": "retrieve", + "method_name": "update", "method_on": "service", - "method_type": "retrieve", - "operation": "get", + "method_type": "update", + "operation": "post", "path": "/v1/treasury/financial_accounts/{financial_account}" }, { - "method_name": "retrieve_features", + "method_name": "update_features", "method_on": "service", "method_type": "custom", - "operation": "get", + "operation": "post", "path": "/v1/treasury/financial_accounts/{financial_account}/features" } ], @@ -53817,17 +53817,10 @@ "x-resourceId": "treasury.inbound_transfer", "x-stripeOperations": [ { - "method_name": "cancel", - "method_on": "service", - "method_type": "custom", - "operation": "post", - "path": "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel" - }, - { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/treasury/inbound_transfers" }, { @@ -53838,11 +53831,18 @@ "path": "/v1/treasury/inbound_transfers/{id}" }, { - "method_name": "list", + "method_name": "fail", "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/treasury/inbound_transfers" + "method_type": "custom", + "operation": "post", + "path": "/v1/test_helpers/treasury/inbound_transfers/{id}/fail" + }, + { + "method_name": "return_inbound_transfer", + "method_on": "service", + "method_type": "custom", + "operation": "post", + "path": "/v1/test_helpers/treasury/inbound_transfers/{id}/return" }, { "method_name": "succeed", @@ -53852,18 +53852,18 @@ "path": "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed" }, { - "method_name": "fail", + "method_name": "create", "method_on": "service", - "method_type": "custom", + "method_type": "create", "operation": "post", - "path": "/v1/test_helpers/treasury/inbound_transfers/{id}/fail" + "path": "/v1/treasury/inbound_transfers" }, { - "method_name": "return_inbound_transfer", + "method_name": "cancel", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/treasury/inbound_transfers/{id}/return" + "path": "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel" } ], "x-stripeResource": { @@ -54115,10 +54115,10 @@ "x-resourceId": "treasury.outbound_payment", "x-stripeOperations": [ { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/treasury/outbound_payments" }, { @@ -54129,39 +54129,39 @@ "path": "/v1/treasury/outbound_payments/{id}" }, { - "method_name": "list", + "method_name": "fail", "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/treasury/outbound_payments" + "method_type": "custom", + "operation": "post", + "path": "/v1/test_helpers/treasury/outbound_payments/{id}/fail" }, { - "method_name": "cancel", + "method_name": "post", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/treasury/outbound_payments/{id}/cancel" + "path": "/v1/test_helpers/treasury/outbound_payments/{id}/post" }, { - "method_name": "fail", + "method_name": "return_outbound_payment", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/treasury/outbound_payments/{id}/fail" + "path": "/v1/test_helpers/treasury/outbound_payments/{id}/return" }, { - "method_name": "post", + "method_name": "create", "method_on": "service", - "method_type": "custom", + "method_type": "create", "operation": "post", - "path": "/v1/test_helpers/treasury/outbound_payments/{id}/post" + "path": "/v1/treasury/outbound_payments" }, { - "method_name": "return_outbound_payment", + "method_name": "cancel", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/treasury/outbound_payments/{id}/return" + "path": "/v1/treasury/outbound_payments/{id}/cancel" } ], "x-stripeResource": { @@ -54421,10 +54421,10 @@ "x-resourceId": "treasury.outbound_transfer", "x-stripeOperations": [ { - "method_name": "create", + "method_name": "list", "method_on": "service", - "method_type": "create", - "operation": "post", + "method_type": "list", + "operation": "get", "path": "/v1/treasury/outbound_transfers" }, { @@ -54435,39 +54435,39 @@ "path": "/v1/treasury/outbound_transfers/{outbound_transfer}" }, { - "method_name": "list", + "method_name": "fail", "method_on": "service", - "method_type": "list", - "operation": "get", - "path": "/v1/treasury/outbound_transfers" + "method_type": "custom", + "operation": "post", + "path": "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail" }, { - "method_name": "cancel", + "method_name": "post", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel" + "path": "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post" }, { - "method_name": "fail", + "method_name": "return_outbound_transfer", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail" + "path": "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return" }, { - "method_name": "post", + "method_name": "create", "method_on": "service", - "method_type": "custom", + "method_type": "create", "operation": "post", - "path": "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post" + "path": "/v1/treasury/outbound_transfers" }, { - "method_name": "return_outbound_transfer", + "method_name": "cancel", "method_on": "service", "method_type": "custom", "operation": "post", - "path": "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return" + "path": "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel" } ], "x-stripeResource": { @@ -55135,18 +55135,18 @@ "x-resourceId": "treasury.transaction", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/treasury/transactions/{id}" + "path": "/v1/treasury/transactions" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/treasury/transactions" + "path": "/v1/treasury/transactions/{id}" } ], "x-stripeResource": { @@ -55297,18 +55297,18 @@ "x-resourceId": "treasury.transaction_entry", "x-stripeOperations": [ { - "method_name": "retrieve", + "method_name": "list", "method_on": "service", - "method_type": "retrieve", + "method_type": "list", "operation": "get", - "path": "/v1/treasury/transaction_entries/{id}" + "path": "/v1/treasury/transaction_entries" }, { - "method_name": "list", + "method_name": "retrieve", "method_on": "service", - "method_type": "list", + "method_type": "retrieve", "operation": "get", - "path": "/v1/treasury/transaction_entries" + "path": "/v1/treasury/transaction_entries/{id}" } ], "x-stripeResource": { @@ -56791,6 +56791,13 @@ "x-expandableFields": [], "x-resourceId": "webhook_endpoint", "x-stripeOperations": [ + { + "method_name": "delete", + "method_on": "service", + "method_type": "delete", + "operation": "delete", + "path": "/v1/webhook_endpoints/{webhook_endpoint}" + }, { "method_name": "list", "method_on": "service", @@ -56818,13 +56825,6 @@ "method_type": "update", "operation": "post", "path": "/v1/webhook_endpoints/{webhook_endpoint}" - }, - { - "method_name": "delete", - "method_on": "service", - "method_type": "delete", - "operation": "delete", - "path": "/v1/webhook_endpoints/{webhook_endpoint}" } ], "x-stripeResource": { diff --git a/test/stripe/util_test.exs b/test/stripe/util_test.exs index 80504f9d..b2ac3c05 100644 --- a/test/stripe/util_test.exs +++ b/test/stripe/util_test.exs @@ -37,8 +37,13 @@ defmodule Stripe.UtilTest do assert object_name_to_module("billing_portal.session") == Stripe.BillingPortal.Session assert object_name_to_module("checkout.session") == Stripe.Checkout.Session - assert object_name_to_module("identity.verification_report") == Stripe.Identity.VerificationReport - assert object_name_to_module("identity.verification_session") == Stripe.Identity.VerificationSession + + assert object_name_to_module("identity.verification_report") == + Stripe.Identity.VerificationReport + + assert object_name_to_module("identity.verification_session") == + Stripe.Identity.VerificationSession + assert object_name_to_module("issuing.authorization") == Stripe.Issuing.Authorization assert object_name_to_module("issuing.card") == Stripe.Issuing.Card assert object_name_to_module("issuing.cardholder") == Stripe.Issuing.Cardholder diff --git a/test/support/stripe_mock_test.exs b/test/support/stripe_mock_test.exs index 0ead7b17..ee0f848b 100644 --- a/test/support/stripe_mock_test.exs +++ b/test/support/stripe_mock_test.exs @@ -10,7 +10,7 @@ defmodule Stripe.StripeMockTest do defp assert_port_open(port) do delay() - assert {:ok, socket} = :gen_tcp.connect('localhost', port, []) + assert {:ok, socket} = :gen_tcp.connect(~c"localhost", port, []) :gen_tcp.close(socket) end