Class: Dodopayments::Models::NewCustomer

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

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(email:, name: nil, phone_number: nil) ⇒ Object

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

Parameters:

  • email (String)

    Email is required for creating a new customer

  • name (String, nil) (defaults to: nil)

    Optional full name of the customer. If provided during session creation,

  • phone_number (String, nil) (defaults to: nil)


# File 'lib/dodopayments/models/new_customer.rb', line 25

Instance Attribute Details

#emailString

Email is required for creating a new customer

Parameters:

  • value (String)

Returns:

  • (String)


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

required :email, String

#nameString?

Optional full name of the customer. If provided during session creation, it is persisted and becomes immutable for the session. If omitted here, it can be provided later via the confirm API.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


18
# File 'lib/dodopayments/models/new_customer.rb', line 18

optional :name, String, nil?: true

#phone_numberString?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


23
# File 'lib/dodopayments/models/new_customer.rb', line 23

optional :phone_number, String, nil?: true

Instance Method Details

#to_hash{ email: String, name: String?, phone_number: String? }

Returns:

  • ({ email: String, name: String?, phone_number: String? })


18
# File 'sig/dodopayments/models/new_customer.rbs', line 18

def to_hash: -> { email: String, name: String?, phone_number: String? }