Class: Dodopayments::Models::ProductItemReq

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/product_item_req.rb,
sig/dodopayments/models/product_item_req.rbs

Defined Under Namespace

Classes: CreditEntitlement

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

#initializeObject



23
# File 'sig/dodopayments/models/product_item_req.rbs', line 23

def initialize: (

Instance Attribute Details

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

only valid if product is a subscription

Parameters:

Returns:



21
# File 'lib/dodopayments/models/product_item_req.rb', line 21

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.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


33
# File 'lib/dodopayments/models/product_item_req.rb', line 33

optional :amount, Integer, nil?: true

#credit_entitlementsArray<Dodopayments::Models::ProductItemReq::CreditEntitlement>?

Per-checkout-session overrides for credit entitlements already attached to this product. Each entry overrides the credits_amount granted by the referenced credit entitlement when this checkout session is fulfilled. The credit_entitlement_id must already be attached to the product.

Parameters:

  • value (::Array[Dodopayments::ProductItemReq::CreditEntitlement], nil)

Returns:



42
43
44
# File 'lib/dodopayments/models/product_item_req.rb', line 42

optional :credit_entitlements,
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductItemReq::CreditEntitlement] },
nil?: true

#product_idString

unique id of the product

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/dodopayments/models/product_item_req.rb', line 10

required :product_id, String

#quantityInteger

Parameters:

  • value (Integer)

Returns:

  • (Integer)


15
# File 'lib/dodopayments/models/product_item_req.rb', line 15

required :quantity, Integer

Instance Method Details

#to_hash{

Returns:

  • ({)


31
# File 'sig/dodopayments/models/product_item_req.rbs', line 31

def to_hash: -> {