View Source ExOAPI.Stripe.SDK.Checkout (exoapi_stripe v0.1.3)

Link to this section Summary

Functions

description: <p>Returns a list of Checkout Sessions.</p>

description: <p>Retrieves a Session object.</p>

description: <p>When retrieving a Checkout Session, there is an includable <strong>line_items</strong> property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p>

description: <p>Creates a Session object.</p>

description: <p>A Session can be expired when it is in one of these statuses: <code>open</code> </p>

Link to this section Types

Link to this type

get_checkout_sessions_opts()

View Source
@type get_checkout_sessions_opts() ::
  {:subscription, String.t()}
  | {:starting_after, String.t()}
  | {:payment_intent, String.t()}
  | {:limit, String.t()}
  | {:expand, String.t()}
  | {:ending_before, String.t()}
Link to this type

get_checkout_sessions_session_line_items_opts()

View Source
@type get_checkout_sessions_session_line_items_opts() ::
  {:starting_after, String.t()}
  | {:limit, String.t()}
  | {:expand, String.t()}
  | {:ending_before, String.t()}
Link to this type

get_checkout_sessions_session_opts()

View Source
@type get_checkout_sessions_session_opts() :: {:expand, String.t()}

Link to this section Functions

Link to this function

get_checkout_sessions(client, opts \\ [])

View Source
@spec get_checkout_sessions(client :: ExOAPI.Client.t(), [
  get_checkout_sessions_opts()
]) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | %{
       url: String.t(),
       object: String.t() | :list,
       has_more: boolean(),
       data: [ExOAPI.Stripe.Schemas.Checkout_session.t()]
     }
   | map()}
  | {:error, any()}

description: <p>Returns a list of Checkout Sessions.</p>

Link to this function

get_checkout_sessions_session(client, session, opts \\ [])

View Source
@spec get_checkout_sessions_session(
  client :: ExOAPI.Client.t(),
  session :: String.t(),
  [get_checkout_sessions_session_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.Checkout_session.t()
   | map()}
  | {:error, any()}

description: <p>Retrieves a Session object.</p>

Link to this function

get_checkout_sessions_session_line_items(client, session, opts \\ [])

View Source
@spec get_checkout_sessions_session_line_items(
  client :: ExOAPI.Client.t(),
  session :: String.t(),
  [get_checkout_sessions_session_line_items_opts()]
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | %{
       url: String.t(),
       object: String.t() | :list,
       has_more: boolean(),
       data: [ExOAPI.Stripe.Schemas.Item.t()]
     }
   | map()}
  | {:error, any()}

description: <p>When retrieving a Checkout Session, there is an includable <strong>line_items</strong> property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.</p>

Link to this function

post_checkout_sessions(client, body)

View Source
@spec post_checkout_sessions(
  client :: ExOAPI.Client.t(),
  body ::
    %{
      tax_id_collection: %{enabled: boolean()},
      success_url: String.t(),
      subscription_data: %{
        trial_period_days: integer(),
        trial_end: integer(),
        transfer_data: %{destination: String.t(), amount_percent: number()},
        metadata: map(),
        items: [
          %{tax_rates: [String.t()], quantity: integer(), plan: String.t()}
        ],
        default_tax_rates: [String.t()],
        application_fee_percent: number()
      },
      submit_type: String.t() | :auto | :book | :donate | :pay,
      shipping_options: [
        %{
          shipping_rate_data: %{
            type: String.t() | :fixed_amount,
            tax_code: String.t(),
            tax_behavior: String.t() | :exclusive | :inclusive | :unspecified,
            metadata: map(),
            fixed_amount: %{currency: String.t(), amount: integer()},
            display_name: String.t(),
            delivery_estimate: %{
              minimum: %{
                value: integer(),
                unit: String.t() | :business_day | :day | :hour | :month | :week
              },
              maximum: %{
                value: integer(),
                unit: String.t() | :business_day | :day | :hour | :month | :week
              }
            }
          },
          shipping_rate: String.t()
        }
      ],
      shipping_address_collection: %{
        allowed_countries: [
          String.t()
          | :AC
          | :AD
          | :AE
          | :AF
          | :AG
          | :AI
          | :AL
          | :AM
          | :AO
          | :AQ
          | :AR
          | :AT
          | :AU
          | :AW
          | :AX
          | :AZ
          | :BA
          | :BB
          | :BD
          | :BE
          | :BF
          | :BG
          | :BH
          | :BI
          | :BJ
          | :BL
          | :BM
          | :BN
          | :BO
          | :BQ
          | :BR
          | :BS
          | :BT
          | :BV
          | :BW
          | :BY
          | :BZ
          | :CA
          | :CD
          | :CF
          | :CG
          | :CH
          | :CI
          | :CK
          | :CL
          | :CM
          | :CN
          | :CO
          | :CR
          | :CV
          | :CW
          | :CY
          | :CZ
          | :DE
          | :DJ
          | :DK
          | :DM
          | :DO
          | :DZ
          | :EC
          | :EE
          | :EG
          | :EH
          | :ER
          | :ES
          | :ET
          | :FI
          | :FJ
          | :FK
          | :FO
          | :FR
          | :GA
          | :GB
          | :GD
          | :GE
          | :GF
          | :GG
          | :GH
          | :GI
          | :GL
          | :GM
          | :GN
          | :GP
          | :GQ
          | :GR
          | :GS
          | :GT
          | :GU
          | :GW
          | :GY
          | :HK
          | :HN
          | :HR
          | :HT
          | :HU
          | :ID
          | :IE
          | :IL
          | :IM
          | :IN
          | :IO
          | :IQ
          | :IS
          | :IT
          | :JE
          | :JM
          | :JO
          | :JP
          | :KE
          | :KG
          | :KH
          | :KI
          | :KM
          | :KN
          | :KR
          | :KW
          | :KY
          | :KZ
          | :LA
          | :LB
          | :LC
          | :LI
          | :LK
          | :LR
          | :LS
          | :LT
          | :LU
          | :LV
          | :LY
          | :MA
          | :MC
          | :MD
          | :ME
          | :MF
          | :MG
          | :MK
          | :ML
          | :MM
          | :MN
          | :MO
          | :MQ
          | :MR
          | :MS
          | :MT
          | :MU
          | :MV
          | :MW
          | :MX
          | :MY
          | :MZ
          | :NA
          | :NC
          | :NE
          | :NG
          | :NI
          | :NL
          | :NO
          | :NP
          | :NR
          | :NU
          | :NZ
          | :OM
          | :PA
          | :PE
          | :PF
          | :PG
          | :PH
          | :PK
          | :PL
          | :PM
          | :PN
          | :PR
          | :PS
          | :PT
          | :PY
          | :QA
          | :RE
          | :RO
          | :RS
          | :RU
          | :RW
          | :SA
          | :SB
          | :SC
          | :SE
          | :SG
          | :SH
          | :SI
          | :SJ
          | :SK
          | :SL
          | :SM
          | :SN
          | :SO
          | :SR
          | :SS
          | :ST
          | :SV
          | :SX
          | :SZ
          | :TA
          | :TC
          | :TD
          | :TF
          | :TG
          | :TH
          | :TJ
          | :TK
          | :TL
          | :TM
          | :TN
          | :TO
          | :TR
          | :TT
          | :TV
          | :TW
          | :TZ
          | :UA
          | :UG
          | :US
          | :UY
          | :UZ
          | :VA
          | :VC
          | :VE
          | :VG
          | :VN
          | :VU
          | :WF
          | :WS
          | :XK
          | :YE
          | :YT
          | :ZA
          | :ZM
          | :ZW
          | :ZZ
        ]
      },
      setup_intent_data: %{
        on_behalf_of: String.t(),
        metadata: map(),
        description: String.t()
      },
      phone_number_collection: %{enabled: boolean()},
      payment_method_types: [
        String.t()
        | :acss_debit
        | :afterpay_clearpay
        | :alipay
        | :au_becs_debit
        | :bacs_debit
        | :bancontact
        | :boleto
        | :card
        | :eps
        | :fpx
        | :giropay
        | :grabpay
        | :ideal
        | :klarna
        | :konbini
        | :oxxo
        | :p24
        | :paynow
        | :sepa_debit
        | :sofort
        | :us_bank_account
        | :wechat_pay
      ],
      payment_method_options: %{
        wechat_pay: %{
          client: String.t() | :android | :ios | :web,
          app_id: String.t()
        },
        us_bank_account: %{
          verification_method: String.t() | :automatic | :instant
        },
        oxxo: %{expires_after_days: integer()},
        konbini: %{expires_after_days: String.t() | integer()},
        boleto: %{expires_after_days: integer()},
        acss_debit: %{
          verification_method:
            String.t() | :automatic | :instant | :microdeposits,
          mandate_options: %{
            transaction_type: String.t() | :business | :personal,
            payment_schedule: String.t() | :combined | :interval | :sporadic,
            interval_description: String.t(),
            default_for: [String.t() | :invoice | :subscription],
            custom_mandate_url: String.t()
          },
          currency: String.t() | :cad | :usd
        }
      },
      payment_intent_data: %{
        transfer_group: String.t(),
        transfer_data: %{destination: String.t(), amount: integer()},
        statement_descriptor_suffix: String.t(),
        statement_descriptor: String.t(),
        shipping: %{
          tracking_number: String.t(),
          phone: String.t(),
          name: String.t(),
          carrier: String.t(),
          address: %{
            state: String.t(),
            postal_code: String.t(),
            line2: String.t(),
            line1: String.t(),
            country: String.t(),
            city: String.t()
          }
        },
        setup_future_usage: String.t() | :off_session | :on_session,
        receipt_email: String.t(),
        on_behalf_of: String.t(),
        metadata: map(),
        description: String.t(),
        capture_method: String.t() | :automatic | :manual,
        application_fee_amount: integer()
      },
      mode: String.t() | :payment | :setup | :subscription,
      metadata: map(),
      locale:
        String.t()
        | :auto
        | :bg
        | :cs
        | :da
        | :de
        | :el
        | :en
        | :"en-GB"
        | :es
        | :"es-419"
        | :et
        | :fi
        | :fil
        | :fr
        | :"fr-CA"
        | :hr
        | :hu
        | :id
        | :it
        | :ja
        | :ko
        | :lt
        | :lv
        | :ms
        | :mt
        | :nb
        | :nl
        | :pl
        | :pt
        | :"pt-BR"
        | :ro
        | :ru
        | :sk
        | :sl
        | :sv
        | :th
        | :tr
        | :vi
        | :zh
        | :"zh-HK"
        | :"zh-TW",
      line_items: [
        %{
          tax_rates: [String.t()],
          quantity: integer(),
          price_data: %{
            unit_amount_decimal: String.t(),
            unit_amount: integer(),
            tax_behavior: String.t() | :exclusive | :inclusive | :unspecified,
            recurring: %{
              interval_count: integer(),
              interval: String.t() | :day | :month | :week | :year
            },
            product_data: %{
              tax_code: String.t(),
              name: String.t(),
              metadata: map(),
              images: [String.t()],
              description: String.t()
            },
            product: String.t(),
            currency: String.t()
          },
          price: String.t(),
          dynamic_tax_rates: [String.t()],
          adjustable_quantity: %{
            minimum: integer(),
            maximum: integer(),
            enabled: boolean()
          }
        }
      ],
      expires_at: integer(),
      expand: [String.t()],
      discounts: [%{promotion_code: String.t(), coupon: String.t()}],
      customer_update: %{
        shipping: String.t() | :auto | :never,
        name: String.t() | :auto | :never,
        address: String.t() | :auto | :never
      },
      customer_email: String.t(),
      customer_creation: String.t() | :always | :if_required,
      customer: String.t(),
      consent_collection: %{promotions: String.t() | :auto},
      client_reference_id: String.t(),
      cancel_url: String.t(),
      billing_address_collection: String.t() | :auto | :required,
      automatic_tax: %{enabled: boolean()},
      allow_promotion_codes: boolean(),
      after_expiration: %{
        recovery: %{enabled: boolean(), allow_promotion_codes: boolean()}
      }
    }
    | map()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.Checkout_session.t()
   | map()}
  | {:error, any()}

description: <p>Creates a Session object.</p>

Link to this function

post_checkout_sessions_session_expire(client, body, session)

View Source
@spec post_checkout_sessions_session_expire(
  client :: ExOAPI.Client.t(),
  body :: %{expand: [String.t()]} | map(),
  session :: String.t()
) ::
  {:ok,
   ExOAPI.Stripe.Schemas.Error.t()
   | ExOAPI.Stripe.Schemas.Checkout_session.t()
   | map()}
  | {:error, any()}

description: <p>A Session can be expired when it is in one of these statuses: <code>open</code> </p>

After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired.