Class: Dodopayments::Models::PaymentCreateResponse::ProductCart

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/payment_create_response.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_id:, quantity:, amount: nil) ⇒ Object

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

Parameters:

  • product_id (String)
  • quantity (Integer)
  • amount (Integer, nil) (defaults to: nil)

    Amount the customer pays if pay_what_you_want is enabled. If disabled then amoun



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/dodopayments/models/payment_create_response.rb', line 86

class ProductCart < Dodopayments::Internal::Type::BaseModel
  # @!attribute product_id
  #
  #   @return [String]
  required :product_id, String

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

  # @!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`.
  #
  #   @return [Integer, nil]
  optional :amount, Integer, nil?: true

  # @!method initialize(product_id:, quantity:, amount: nil)
  #   Some parameter documentations has been truncated, see
  #   {Dodopayments::Models::PaymentCreateResponse::ProductCart} for more details.
  #
  #   @param product_id [String]
  #
  #   @param quantity [Integer]
  #
  #   @param amount [Integer, nil] Amount the customer pays if pay_what_you_want is enabled. If disabled then amoun
end

Instance Attribute Details

#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`.

Returns:

  • (Integer, nil)


103
# File 'lib/dodopayments/models/payment_create_response.rb', line 103

optional :amount, Integer, nil?: true

#product_idString

Returns:

  • (String)


90
# File 'lib/dodopayments/models/payment_create_response.rb', line 90

required :product_id, String

#quantityInteger

Returns:

  • (Integer)


95
# File 'lib/dodopayments/models/payment_create_response.rb', line 95

required :quantity, Integer