Skip to content

Commit

Permalink
Update services based on v755 of Stripe OpenApi SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
web-flow committed Jan 12, 2024
1 parent ea52d3c commit bb129f8
Show file tree
Hide file tree
Showing 9 changed files with 427 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .latest-tag-stripe-openapi-sdk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v753
v755
23 changes: 14 additions & 9 deletions lib/generated/account.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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}
)

(
Expand Down Expand Up @@ -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
}
)

(
Expand Down Expand Up @@ -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}
)

Expand Down
10 changes: 1 addition & 9 deletions lib/generated/checkout__session.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)

(
Expand Down
65 changes: 65 additions & 0 deletions lib/generated/customer_session.ex
Original file line number Diff line number Diff line change
@@ -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 "<p>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.</p>\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
162 changes: 93 additions & 69 deletions lib/generated/payment_intent.ex
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ defmodule Stripe.PaymentIntent do
)

(
@typedoc nil
@typedoc "Shipping address."
@type address :: %{
optional(:city) => binary,
optional(:country) => binary,
Expand Down Expand Up @@ -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}
)

(
Expand Down Expand Up @@ -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}
)

(
Expand All @@ -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
}
)

(
Expand All @@ -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
}
)

(
Expand Down Expand Up @@ -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)
}
)

Expand Down Expand Up @@ -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
}
)

Expand Down Expand Up @@ -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}
)

Expand Down Expand Up @@ -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
}
)

(
Expand Down
10 changes: 1 addition & 9 deletions lib/generated/payment_link.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)

(
Expand Down
Loading

0 comments on commit bb129f8

Please sign in to comment.