Module: Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::PaymentMethod

Extended by:
Internal::Type::Union
Defined in:
lib/dodopayments/models/subscription_update_payment_method_params.rb

Defined Under Namespace

Classes: Existing, New

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, dump, hash, inspect, to_sorbet_type, variants

Methods included from Internal::Util::SorbetRuntimeSupport

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

Methods included from Internal::Type::Converter

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

Instance Method Details

#initialize(allowed_payment_method_types: nil, return_url: nil, type: :new) ⇒ Object

Some parameter documentations has been truncated, see New for more details.

Parameters:

  • allowed_payment_method_types (Array<Symbol, Dodopayments::Models::PaymentMethodTypes>, nil) (defaults to: nil)

    List of payment methods allowed during checkout.

  • return_url (String, nil) (defaults to: nil)
  • type (Symbol, :new) (defaults to: :new)


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/dodopayments/models/subscription_update_payment_method_params.rb', line 25

module PaymentMethod
  extend Dodopayments::Internal::Type::Union

  discriminator :type

  variant :new, -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New }

  variant :existing, -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing }

  class New < Dodopayments::Internal::Type::BaseModel
    # @!attribute type
    #
    #   @return [Symbol, :new]
    required :type, const: :new

    # @!attribute allowed_payment_method_types
    #   List of payment methods allowed during checkout.
    #
    #   Customers will **never** see payment methods that are **not** in this list.
    #   However, adding a method here **does not guarantee** customers will see it.
    #   Availability still depends on other factors (e.g., customer location, merchant
    #   settings).
    #
    #   @return [Array<Symbol, Dodopayments::Models::PaymentMethodTypes>, nil]
    optional :allowed_payment_method_types,
             -> { Dodopayments::Internal::Type::ArrayOf[enum: Dodopayments::PaymentMethodTypes] },
             nil?: true

    # @!attribute return_url
    #
    #   @return [String, nil]
    optional :return_url, String, nil?: true

    # @!method initialize(allowed_payment_method_types: nil, return_url: nil, type: :new)
    #   Some parameter documentations has been truncated, see
    #   {Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New}
    #   for more details.
    #
    #   @param allowed_payment_method_types [Array<Symbol, Dodopayments::Models::PaymentMethodTypes>, nil] List of payment methods allowed during checkout.
    #
    #   @param return_url [String, nil]
    #
    #   @param type [Symbol, :new]
  end

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

    # @!attribute type
    #
    #   @return [Symbol, :existing]
    required :type, const: :existing

    # @!method initialize(payment_method_id:, type: :existing)
    #   @param payment_method_id [String]
    #   @param type [Symbol, :existing]
  end

  # @!method self.variants
  #   @return [Array(Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::PaymentMethod::New, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::PaymentMethod::Existing)]
end