Class: Dodopayments::Models::CheckoutSessionRequest::ProductCart

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/checkout_session_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(product_cart: , allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, confirm: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, force_3ds: nil, metadata: nil, return_url: nil, show_saved_payment_methods: nil, subscription_data: nil) ⇒ Object

Some parameter documentations has been truncated, see Dodopayments::Models::CheckoutSessionRequest for more details.

Parameters:



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/dodopayments/models/checkout_session_request.rb', line 128

class ProductCart < Dodopayments::Internal::Type::BaseModel
  # @!attribute product_id
  #   unique id of the product
  #
  #   @return [String]
  required :product_id, String

  # @!attribute quantity
  #
  #   @return [Integer]
  required :quantity, Integer

  # @!attribute addons
  #   only valid if product is a subscription
  #
  #   @return [Array<Dodopayments::Models::AttachAddon>, nil]
  optional :addons, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::AttachAddon] }, nil?: true

  # @!attribute amount
  #   Amount the customer pays if pay_what_you_want is enabled. If disabled then
  #   amount will be ignored Represented in the lowest denomination of the currency
  #   (e.g., cents for USD). For example, to charge $1.00, pass `100`. Only applicable
  #   for one time payments
  #
  #   If amount is not set for pay_what_you_want product, customer is allowed to
  #   select the amount.
  #
  #   @return [Integer, nil]
  optional :amount, Integer, nil?: true

  # @!method initialize(product_id:, quantity:, addons: nil, amount: nil)
  #   Some parameter documentations has been truncated, see
  #   {Dodopayments::Models::CheckoutSessionRequest::ProductCart} for more details.
  #
  #   @param product_id [String] unique id of the product
  #
  #   @param quantity [Integer]
  #
  #   @param addons [Array<Dodopayments::Models::AttachAddon>, nil] only valid if product is a subscription
  #
  #   @param amount [Integer, nil] Amount the customer pays if pay_what_you_want is enabled. If disabled then amoun
end

Instance Attribute Details

#addonsArray<Dodopayments::Models::AttachAddon>?

only valid if product is a subscription

Returns:



144
# File 'lib/dodopayments/models/checkout_session_request.rb', line 144

optional :addons, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::AttachAddon] }, nil?: true

#amountInteger?

Amount the customer pays if pay_what_you_want is enabled. If disabled then amount will be ignored Represented in the lowest denomination of the currency (e.g., cents for USD). For example, to charge $1.00, pass ‘100`. Only applicable for one time payments

If amount is not set for pay_what_you_want product, customer is allowed to select the amount.

Returns:

  • (Integer, nil)


156
# File 'lib/dodopayments/models/checkout_session_request.rb', line 156

optional :amount, Integer, nil?: true

#product_idString

unique id of the product

Returns:

  • (String)


133
# File 'lib/dodopayments/models/checkout_session_request.rb', line 133

required :product_id, String

#quantityInteger

Returns:

  • (Integer)


138
# File 'lib/dodopayments/models/checkout_session_request.rb', line 138

required :quantity, Integer