diff --git a/.latest-tag-stripe-openapi-sdk b/.latest-tag-stripe-openapi-sdk index 905ce8ea..d1b8380a 100644 --- a/.latest-tag-stripe-openapi-sdk +++ b/.latest-tag-stripe-openapi-sdk @@ -1 +1 @@ -v753 +v755 diff --git a/lib/generated/account.ex b/lib/generated/account.ex index e13018bc..7fc5bbda 100644 --- a/lib/generated/account.ex +++ b/lib/generated/account.ex @@ -66,7 +66,7 @@ defmodule Stripe.Account do ) ( - @typedoc "The individual's primary address." + @typedoc "The company'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 the individual's primary address (Japan only)." + @typedoc "The Kanji variation of the company's primary address (Japan only)." @type address_kanji :: %{ optional(:city) => binary, optional(:country) => binary, @@ -119,8 +119,8 @@ defmodule Stripe.Account do ) ( - @typedoc "The bacs_debit_payments capability." - @type bacs_debit_payments :: %{optional(:requested) => boolean} + @typedoc "Settings specific to Bacs Direct Debit payments." + @type bacs_debit_payments :: %{optional(:display_name) => binary} ) ( @@ -217,13 +217,18 @@ defmodule Stripe.Account do ) ( - @typedoc "The card_issuing capability." - @type card_issuing :: %{optional(:requested) => boolean} + @typedoc "Settings specific to the account's use of the Card Issuing product." + @type card_issuing :: %{optional(:tos_acceptance) => tos_acceptance} ) ( - @typedoc "The card_payments capability." - @type card_payments :: %{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 + } ) ( @@ -333,7 +338,7 @@ defmodule Stripe.Account do ) ( - @typedoc "A document verifying the business." + @typedoc "An identifying document, either a passport or local ID card." @type document :: %{optional(:back) => binary, optional(:front) => binary} ) diff --git a/lib/generated/checkout__session.ex b/lib/generated/checkout__session.ex index c7f510cf..6f93cc82 100644 --- a/lib/generated/checkout__session.ex +++ b/lib/generated/checkout__session.ex @@ -254,15 +254,7 @@ defmodule Stripe.Checkout.Session do ( @typedoc nil - @type custom_fields :: %{ - optional(:dropdown) => dropdown, - optional(:key) => binary, - optional(:label) => label, - optional(:numeric) => numeric, - optional(:optional) => boolean, - optional(:text) => text, - optional(:type) => :dropdown | :numeric | :text - } + @type custom_fields :: %{optional(:name) => binary, optional(:value) => binary} ) ( diff --git a/lib/generated/customer_session.ex b/lib/generated/customer_session.ex new file mode 100644 index 00000000..b1f5f04e --- /dev/null +++ b/lib/generated/customer_session.ex @@ -0,0 +1,65 @@ +defmodule Stripe.CustomerSession do + use Stripe.Entity + + @moduledoc "A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)\ncontrol over a customer." + ( + defstruct [:client_secret, :components, :created, :customer, :expires_at, :livemode, :object] + + @typedoc "The `customer_session` type.\n\n * `client_secret` The client secret of this customer session. Used on the client to set up secure access to the given `customer`.\n\nThe client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.\n * `components` \n * `created` Time at which the object was created. Measured in seconds since the Unix epoch.\n * `customer` The customer the customer session was created for.\n * `expires_at` The timestamp at which this customer session will expire.\n * `livemode` Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.\n * `object` String representing the object's type. Objects of the same type share the same value.\n" + @type t :: %__MODULE__{ + client_secret: binary, + components: term, + created: integer, + customer: binary | Stripe.Customer.t(), + expires_at: integer, + livemode: boolean, + object: binary + } + ) + + ( + @typedoc "Configuration for buy button." + @type buy_button :: %{optional(:enabled) => boolean} + ) + + ( + @typedoc "Configuration for each component. 1 component must be enabled." + @type components :: %{ + optional(:buy_button) => buy_button, + optional(:pricing_table) => pricing_table + } + ) + + ( + @typedoc "Configuration for the pricing table." + @type pricing_table :: %{optional(:enabled) => boolean} + ) + + ( + nil + + @doc "

Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.

\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/customer_sessions`\n" + ( + @spec create( + params :: %{ + optional(:components) => components, + optional(:customer) => binary, + optional(:expand) => list(binary) + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.CustomerSession.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def create(params \\ %{}, opts \\ []) do + path = Stripe.OpenApi.Path.replace_path_params("/v1/customer_sessions", [], []) + + Stripe.Request.new_request(opts) + |> Stripe.Request.put_endpoint(path) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) + |> Stripe.Request.make_request() + end + ) + ) +end diff --git a/lib/generated/payment_intent.ex b/lib/generated/payment_intent.ex index c41c707c..fb4546dd 100644 --- a/lib/generated/payment_intent.ex +++ b/lib/generated/payment_intent.ex @@ -101,7 +101,7 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc nil + @typedoc "Shipping address." @type address :: %{ optional(:city) => binary, optional(:country) => binary, @@ -136,8 +136,8 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account." - @type au_becs_debit :: %{optional(:account_number) => binary, optional(:bsb_number) => binary} + @typedoc nil + @type au_becs_debit :: %{optional(:setup_future_usage) => :none | :off_session | :on_session} ) ( @@ -315,33 +315,8 @@ defmodule Stripe.PaymentIntent do ) ( - @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 - } + @typedoc nil + @type fpx :: %{optional(:setup_future_usage) => :none} ) ( @@ -355,8 +330,25 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc nil - @type ideal :: %{optional(:setup_future_usage) => :none | :off_session} + @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 + } ) ( @@ -365,8 +357,56 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method." - @type klarna :: %{optional(:dob) => dob} + @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 + } ) ( @@ -395,12 +435,17 @@ defmodule Stripe.PaymentIntent 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(:interval_description) => binary, - optional(:payment_schedule) => :combined | :interval | :sporadic, - optional(:transaction_type) => :business | :personal + optional(:amount) => integer, + optional(:amount_type) => :fixed | :maximum, + 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) } ) @@ -428,34 +473,10 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method." + @typedoc nil @type p24 :: %{ - optional(:bank) => - :alior_bank - | :bank_millennium - | :bank_nowy_bfg_sa - | :bank_pekao_sa - | :banki_spbdzielcze - | :blik - | :bnp_paribas - | :boz - | :citi_handlowy - | :credit_agricole - | :envelobank - | :etransfer_pocztowy24 - | :getin_bank - | :ideabank - | :ing - | :inteligo - | :mbank_mtransfer - | :nest_przelew - | :noble_pay - | :pbac_z_ipko - | :plus_bank - | :santander_przelew24 - | :tmobile_usbugi_bankowe - | :toyota_bank - | :volkswagen_bank + optional(:setup_future_usage) => :none, + optional(:tos_shown_and_accepted) => boolean } ) @@ -633,7 +654,7 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc "Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session)." + @typedoc "Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information." @type radar_options :: %{optional(:session) => binary} ) @@ -662,8 +683,11 @@ defmodule Stripe.PaymentIntent do ) ( - @typedoc "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method." - @type sofort :: %{optional(:country) => :AT | :BE | :DE | :ES | :IT | :NL} + @typedoc nil + @type sofort :: %{ + optional(:preferred_language) => :de | :en | :es | :fr | :it | :nl | :pl, + optional(:setup_future_usage) => :none | :off_session + } ) ( diff --git a/lib/generated/payment_link.ex b/lib/generated/payment_link.ex index ee573196..fb0f2e3b 100644 --- a/lib/generated/payment_link.ex +++ b/lib/generated/payment_link.ex @@ -121,15 +121,7 @@ defmodule Stripe.PaymentLink do ( @typedoc nil - @type custom_fields :: %{ - optional(:dropdown) => dropdown, - optional(:key) => binary, - optional(:label) => label, - optional(:numeric) => numeric, - optional(:optional) => boolean, - optional(:text) => text, - optional(:type) => :dropdown | :numeric | :text - } + @type custom_fields :: %{optional(:name) => binary, optional(:value) => binary} ) ( diff --git a/lib/generated/setup_intent.ex b/lib/generated/setup_intent.ex index 4353eeac..9309fc49 100644 --- a/lib/generated/setup_intent.ex +++ b/lib/generated/setup_intent.ex @@ -289,7 +289,13 @@ defmodule Stripe.SetupIntent do ( @typedoc "Additional fields for Mandate creation" - @type mandate_options :: %{optional(:collection_method) => :paper} + @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 + } ) ( @@ -463,12 +469,13 @@ defmodule Stripe.SetupIntent do ) ( - @typedoc "If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options." + @typedoc "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method." @type us_bank_account :: %{ - optional(:financial_connections) => financial_connections, - optional(:mandate_options) => mandate_options, - optional(:networks) => networks, - optional(:verification_method) => :automatic | :instant | :microdeposits + optional(:account_holder_type) => :company | :individual, + optional(:account_number) => binary, + optional(:account_type) => :checking | :savings, + optional(:financial_connections_account) => binary, + optional(:routing_number) => binary } ) diff --git a/lib/generated/token.ex b/lib/generated/token.ex index 1168a725..28633b12 100644 --- a/lib/generated/token.ex +++ b/lib/generated/token.ex @@ -20,12 +20,11 @@ defmodule Stripe.Token do ) ( - @typedoc "Information for the account this token represents." + @typedoc "Details on the legal guardian's acceptance of the main Stripe service agreement." @type account :: %{ - optional(:business_type) => :company | :government_entity | :individual | :non_profit, - optional(:company) => company, - optional(:individual) => individual, - optional(:tos_shown_and_accepted) => boolean + optional(:date) => integer, + optional(:ip) => binary, + optional(:user_agent) => binary | binary } ) @@ -40,7 +39,7 @@ defmodule Stripe.Token do ) ( - @typedoc "The individual's primary address." + @typedoc "The company's primary address." @type address :: %{ optional(:city) => binary, optional(:country) => binary, @@ -52,7 +51,7 @@ defmodule Stripe.Token do ) ( - @typedoc "The Kana variation of the person's address (Japan only)." + @typedoc "The Kana variation of the the individual's primary address (Japan only)." @type address_kana :: %{ optional(:city) => binary, optional(:country) => binary, @@ -65,7 +64,7 @@ defmodule Stripe.Token do ) ( - @typedoc "The Kanji variation of the the individual's primary address (Japan only)." + @typedoc "The Kanji variation of the company's primary address (Japan only)." @type address_kanji :: %{ optional(:city) => binary, optional(:country) => binary, @@ -176,7 +175,7 @@ defmodule Stripe.Token do ) ( - @typedoc "A document verifying the business." + @typedoc "An identifying document, either a passport or local ID card." @type document :: %{optional(:back) => binary, optional(:front) => binary} ) diff --git a/priv/openapi/spec3.sdk.json b/priv/openapi/spec3.sdk.json index 179355c0..4a5eabbe 100644 --- a/priv/openapi/spec3.sdk.json +++ b/priv/openapi/spec3.sdk.json @@ -10623,6 +10623,134 @@ "type": "customer_cash_balance_transaction.created" } }, + "customer_session": { + "description": "A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs)\ncontrol over a customer.", + "properties": { + "client_secret": { + "description": "The client secret of this customer session. Used on the client to set up secure access to the given `customer`.\n\nThe client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret.", + "maxLength": 5000, + "type": "string" + }, + "components": { + "$ref": "#/components/schemas/customer_session_resource_components" + }, + "created": { + "description": "Time at which the object was created. Measured in seconds since the Unix epoch.", + "format": "unix-time", + "type": "integer" + }, + "customer": { + "anyOf": [ + { + "maxLength": 5000, + "type": "string" + }, + { + "$ref": "#/components/schemas/customer" + } + ], + "description": "The customer the customer session was created for.", + "x-expansionResources": { + "oneOf": [ + { + "$ref": "#/components/schemas/customer" + } + ] + } + }, + "expires_at": { + "description": "The timestamp at which this customer session will expire.", + "format": "unix-time", + "type": "integer" + }, + "livemode": { + "description": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", + "type": "boolean" + }, + "object": { + "description": "String representing the object's type. Objects of the same type share the same value.", + "enum": [ + "customer_session" + ], + "type": "string" + } + }, + "required": [ + "client_secret", + "created", + "customer", + "expires_at", + "livemode", + "object" + ], + "title": "CustomerSessionResourceCustomerSession", + "type": "object", + "x-expandableFields": [ + "components", + "customer" + ], + "x-resourceId": "customer_session", + "x-stripeOperations": [ + { + "method_name": "create", + "method_on": "service", + "method_type": "create", + "operation": "post", + "path": "/v1/customer_sessions" + } + ], + "x-stripeResource": { + "class_name": "CustomerSession", + "in_package": "" + } + }, + "customer_session_resource_components": { + "description": "Configuration for the components supported by this customer session.", + "properties": { + "buy_button": { + "$ref": "#/components/schemas/customer_session_resource_components_resource_buy_button" + }, + "pricing_table": { + "$ref": "#/components/schemas/customer_session_resource_components_resource_pricing_table" + } + }, + "title": "CustomerSessionResourceComponents", + "type": "object", + "x-expandableFields": [ + "buy_button", + "pricing_table" + ] + }, + "customer_session_resource_components_resource_buy_button": { + "description": "This hash contains whether the buy button is enabled.", + "properties": { + "enabled": { + "description": "Whether the buy button is enabled.", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "CustomerSessionResourceComponentsResourceBuyButton", + "type": "object", + "x-expandableFields": [] + }, + "customer_session_resource_components_resource_pricing_table": { + "description": "This hash contains whether the pricing table is enabled.", + "properties": { + "enabled": { + "description": "Whether the pricing table is enabled.", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "CustomerSessionResourceComponentsResourcePricingTable", + "type": "object", + "x-expandableFields": [] + }, "customer_tax": { "description": "", "properties": { @@ -73415,6 +73543,109 @@ } } }, + "/v1/customer_sessions": { + "post": { + "description": "

Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources.

", + "operationId": "PostCustomerSessions", + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "encoding": { + "components": { + "explode": true, + "style": "deepObject" + }, + "expand": { + "explode": true, + "style": "deepObject" + } + }, + "schema": { + "additionalProperties": false, + "properties": { + "components": { + "description": "Configuration for each component. 1 component must be enabled.", + "properties": { + "buy_button": { + "description": "Configuration for buy button.", + "properties": { + "enabled": { + "description": "Whether the buy button is enabled.", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "buy_button_param", + "type": "object" + }, + "pricing_table": { + "description": "Configuration for the pricing table.", + "properties": { + "enabled": { + "description": "Whether the pricing table is enabled.", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "title": "pricing_table_param", + "type": "object" + } + }, + "title": "components", + "type": "object" + }, + "customer": { + "description": "The ID of an existing customer for which to create the customer session.", + "maxLength": 5000, + "type": "string" + }, + "expand": { + "description": "Specifies which fields in the response should be expanded.", + "items": { + "maxLength": 5000, + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "components", + "customer" + ], + "type": "object" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/customer_session" + } + } + }, + "description": "Successful response." + }, + "default": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/error" + } + } + }, + "description": "Error response." + } + } + } + }, "/v1/customers": { "get": { "description": "

Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first.

",