dodopayments 1.56.4 → 1.61.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/dodopayments/models/checkout_session_request.rb +50 -1
- data/lib/dodopayments/models/customer.rb +14 -1
- data/lib/dodopayments/models/customer_create_params.rb +12 -1
- data/lib/dodopayments/models/customer_limited_details.rb +9 -1
- data/lib/dodopayments/models/customer_retrieve_payment_methods_params.rb +14 -0
- data/lib/dodopayments/models/customer_retrieve_payment_methods_response.rb +147 -0
- data/lib/dodopayments/models/customer_update_params.rb +11 -1
- data/lib/dodopayments/models/product_create_params.rb +9 -9
- data/lib/dodopayments/models/subscription.rb +9 -1
- data/lib/dodopayments/models/subscription_list_response.rb +9 -1
- data/lib/dodopayments/models/subscription_update_payment_method_params.rb +41 -0
- data/lib/dodopayments/models/subscription_update_payment_method_response.rb +34 -0
- data/lib/dodopayments/models.rb +4 -0
- data/lib/dodopayments/resources/customers.rb +27 -2
- data/lib/dodopayments/resources/products.rb +3 -3
- data/lib/dodopayments/resources/subscriptions.rb +26 -0
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +4 -0
- data/rbi/dodopayments/models/checkout_session_request.rbi +63 -0
- data/rbi/dodopayments/models/customer.rbi +11 -0
- data/rbi/dodopayments/models/customer_create_params.rbi +17 -1
- data/rbi/dodopayments/models/customer_limited_details.rbi +11 -0
- data/rbi/dodopayments/models/customer_retrieve_payment_methods_params.rbi +32 -0
- data/rbi/dodopayments/models/customer_retrieve_payment_methods_response.rbi +318 -0
- data/rbi/dodopayments/models/customer_update_params.rbi +13 -1
- data/rbi/dodopayments/models/product_create_params.rbi +8 -8
- data/rbi/dodopayments/models/subscription.rbi +8 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +8 -0
- data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +91 -0
- data/rbi/dodopayments/models/subscription_update_payment_method_response.rbi +56 -0
- data/rbi/dodopayments/models.rbi +6 -0
- data/rbi/dodopayments/resources/customers.rbi +25 -1
- data/rbi/dodopayments/resources/products.rbi +3 -3
- data/rbi/dodopayments/resources/subscriptions.rbi +20 -0
- data/sig/dodopayments/models/checkout_session_request.rbs +49 -0
- data/sig/dodopayments/models/customer.rbs +7 -0
- data/sig/dodopayments/models/customer_create_params.rbs +12 -1
- data/sig/dodopayments/models/customer_limited_details.rbs +7 -0
- data/sig/dodopayments/models/customer_retrieve_payment_methods_params.rbs +15 -0
- data/sig/dodopayments/models/customer_retrieve_payment_methods_response.rbs +143 -0
- data/sig/dodopayments/models/customer_update_params.rbs +9 -1
- data/sig/dodopayments/models/product_create_params.rbs +6 -6
- data/sig/dodopayments/models/subscription.rbs +5 -0
- data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
- data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +46 -0
- data/sig/dodopayments/models/subscription_update_payment_method_response.rbs +35 -0
- data/sig/dodopayments/models.rbs +4 -0
- data/sig/dodopayments/resources/customers.rbs +7 -0
- data/sig/dodopayments/resources/products.rbs +1 -1
- data/sig/dodopayments/resources/subscriptions.rbs +8 -0
- metadata +14 -2
|
@@ -9,7 +9,9 @@ module Dodopayments
|
|
|
9
9
|
# Some parameter documentations has been truncated, see
|
|
10
10
|
# {Dodopayments::Models::ProductCreateParams} for more details.
|
|
11
11
|
#
|
|
12
|
-
# @overload create(price:, tax_category:, addons: nil, brand_id: nil, description: nil, digital_product_delivery: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, license_key_enabled: nil, metadata: nil,
|
|
12
|
+
# @overload create(name:, price:, tax_category:, addons: nil, brand_id: nil, description: nil, digital_product_delivery: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, license_key_enabled: nil, metadata: nil, request_options: {})
|
|
13
|
+
#
|
|
14
|
+
# @param name [String] Name of the product
|
|
13
15
|
#
|
|
14
16
|
# @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice] Price configuration for the product
|
|
15
17
|
#
|
|
@@ -33,8 +35,6 @@ module Dodopayments
|
|
|
33
35
|
#
|
|
34
36
|
# @param metadata [Hash{Symbol=>String}] Additional metadata for the product
|
|
35
37
|
#
|
|
36
|
-
# @param name [String, nil] Optional name of the product
|
|
37
|
-
#
|
|
38
38
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
39
39
|
#
|
|
40
40
|
# @return [Dodopayments::Models::Product]
|
|
@@ -283,6 +283,32 @@ module Dodopayments
|
|
|
283
283
|
)
|
|
284
284
|
end
|
|
285
285
|
|
|
286
|
+
# @overload update_payment_method(subscription_id, type:, payment_method_id:, return_url: nil, request_options: {})
|
|
287
|
+
#
|
|
288
|
+
# @param subscription_id [String] Subscription Id
|
|
289
|
+
#
|
|
290
|
+
# @param type [Symbol, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Type]
|
|
291
|
+
#
|
|
292
|
+
# @param payment_method_id [String]
|
|
293
|
+
#
|
|
294
|
+
# @param return_url [String, nil]
|
|
295
|
+
#
|
|
296
|
+
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
297
|
+
#
|
|
298
|
+
# @return [Dodopayments::Models::SubscriptionUpdatePaymentMethodResponse]
|
|
299
|
+
#
|
|
300
|
+
# @see Dodopayments::Models::SubscriptionUpdatePaymentMethodParams
|
|
301
|
+
def update_payment_method(subscription_id, params)
|
|
302
|
+
parsed, options = Dodopayments::SubscriptionUpdatePaymentMethodParams.dump_request(params)
|
|
303
|
+
@client.request(
|
|
304
|
+
method: :post,
|
|
305
|
+
path: ["subscriptions/%1$s/update-payment-method", subscription_id],
|
|
306
|
+
body: parsed,
|
|
307
|
+
model: Dodopayments::Models::SubscriptionUpdatePaymentMethodResponse,
|
|
308
|
+
options: options
|
|
309
|
+
)
|
|
310
|
+
end
|
|
311
|
+
|
|
286
312
|
# @api private
|
|
287
313
|
#
|
|
288
314
|
# @param client [Dodopayments::Client]
|
data/lib/dodopayments/version.rb
CHANGED
data/lib/dodopayments.rb
CHANGED
|
@@ -94,6 +94,8 @@ require_relative "dodopayments/models/customer_list_params"
|
|
|
94
94
|
require_relative "dodopayments/models/customer_portal_session"
|
|
95
95
|
require_relative "dodopayments/models/customer_request"
|
|
96
96
|
require_relative "dodopayments/models/customer_retrieve_params"
|
|
97
|
+
require_relative "dodopayments/models/customer_retrieve_payment_methods_params"
|
|
98
|
+
require_relative "dodopayments/models/customer_retrieve_payment_methods_response"
|
|
97
99
|
require_relative "dodopayments/models/customers/customer_portal_create_params"
|
|
98
100
|
require_relative "dodopayments/models/customers/customer_wallet"
|
|
99
101
|
require_relative "dodopayments/models/customers/wallet_list_params"
|
|
@@ -228,6 +230,8 @@ require_relative "dodopayments/models/subscription_retrieve_usage_history_params
|
|
|
228
230
|
require_relative "dodopayments/models/subscription_retrieve_usage_history_response"
|
|
229
231
|
require_relative "dodopayments/models/subscription_status"
|
|
230
232
|
require_relative "dodopayments/models/subscription_update_params"
|
|
233
|
+
require_relative "dodopayments/models/subscription_update_payment_method_params"
|
|
234
|
+
require_relative "dodopayments/models/subscription_update_payment_method_response"
|
|
231
235
|
require_relative "dodopayments/models/tax_category"
|
|
232
236
|
require_relative "dodopayments/models/time_interval"
|
|
233
237
|
require_relative "dodopayments/models/unsafe_unwrap_webhook_event"
|
|
@@ -528,6 +528,48 @@ module Dodopayments
|
|
|
528
528
|
sig { params(allow_currency_selection: T::Boolean).void }
|
|
529
529
|
attr_writer :allow_currency_selection
|
|
530
530
|
|
|
531
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
532
|
+
attr_reader :allow_customer_editing_city
|
|
533
|
+
|
|
534
|
+
sig { params(allow_customer_editing_city: T::Boolean).void }
|
|
535
|
+
attr_writer :allow_customer_editing_city
|
|
536
|
+
|
|
537
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
538
|
+
attr_reader :allow_customer_editing_country
|
|
539
|
+
|
|
540
|
+
sig { params(allow_customer_editing_country: T::Boolean).void }
|
|
541
|
+
attr_writer :allow_customer_editing_country
|
|
542
|
+
|
|
543
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
544
|
+
attr_reader :allow_customer_editing_email
|
|
545
|
+
|
|
546
|
+
sig { params(allow_customer_editing_email: T::Boolean).void }
|
|
547
|
+
attr_writer :allow_customer_editing_email
|
|
548
|
+
|
|
549
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
550
|
+
attr_reader :allow_customer_editing_name
|
|
551
|
+
|
|
552
|
+
sig { params(allow_customer_editing_name: T::Boolean).void }
|
|
553
|
+
attr_writer :allow_customer_editing_name
|
|
554
|
+
|
|
555
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
556
|
+
attr_reader :allow_customer_editing_state
|
|
557
|
+
|
|
558
|
+
sig { params(allow_customer_editing_state: T::Boolean).void }
|
|
559
|
+
attr_writer :allow_customer_editing_state
|
|
560
|
+
|
|
561
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
562
|
+
attr_reader :allow_customer_editing_street
|
|
563
|
+
|
|
564
|
+
sig { params(allow_customer_editing_street: T::Boolean).void }
|
|
565
|
+
attr_writer :allow_customer_editing_street
|
|
566
|
+
|
|
567
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
568
|
+
attr_reader :allow_customer_editing_zipcode
|
|
569
|
+
|
|
570
|
+
sig { params(allow_customer_editing_zipcode: T::Boolean).void }
|
|
571
|
+
attr_writer :allow_customer_editing_zipcode
|
|
572
|
+
|
|
531
573
|
# If the customer is allowed to apply discount code, set it to true.
|
|
532
574
|
#
|
|
533
575
|
# Default is true
|
|
@@ -568,6 +610,13 @@ module Dodopayments
|
|
|
568
610
|
sig do
|
|
569
611
|
params(
|
|
570
612
|
allow_currency_selection: T::Boolean,
|
|
613
|
+
allow_customer_editing_city: T::Boolean,
|
|
614
|
+
allow_customer_editing_country: T::Boolean,
|
|
615
|
+
allow_customer_editing_email: T::Boolean,
|
|
616
|
+
allow_customer_editing_name: T::Boolean,
|
|
617
|
+
allow_customer_editing_state: T::Boolean,
|
|
618
|
+
allow_customer_editing_street: T::Boolean,
|
|
619
|
+
allow_customer_editing_zipcode: T::Boolean,
|
|
571
620
|
allow_discount_code: T::Boolean,
|
|
572
621
|
allow_phone_number_collection: T::Boolean,
|
|
573
622
|
allow_tax_id: T::Boolean,
|
|
@@ -579,6 +628,13 @@ module Dodopayments
|
|
|
579
628
|
#
|
|
580
629
|
# Default is true
|
|
581
630
|
allow_currency_selection: nil,
|
|
631
|
+
allow_customer_editing_city: nil,
|
|
632
|
+
allow_customer_editing_country: nil,
|
|
633
|
+
allow_customer_editing_email: nil,
|
|
634
|
+
allow_customer_editing_name: nil,
|
|
635
|
+
allow_customer_editing_state: nil,
|
|
636
|
+
allow_customer_editing_street: nil,
|
|
637
|
+
allow_customer_editing_zipcode: nil,
|
|
582
638
|
# If the customer is allowed to apply discount code, set it to true.
|
|
583
639
|
#
|
|
584
640
|
# Default is true
|
|
@@ -603,6 +659,13 @@ module Dodopayments
|
|
|
603
659
|
override.returns(
|
|
604
660
|
{
|
|
605
661
|
allow_currency_selection: T::Boolean,
|
|
662
|
+
allow_customer_editing_city: T::Boolean,
|
|
663
|
+
allow_customer_editing_country: T::Boolean,
|
|
664
|
+
allow_customer_editing_email: T::Boolean,
|
|
665
|
+
allow_customer_editing_name: T::Boolean,
|
|
666
|
+
allow_customer_editing_state: T::Boolean,
|
|
667
|
+
allow_customer_editing_street: T::Boolean,
|
|
668
|
+
allow_customer_editing_zipcode: T::Boolean,
|
|
606
669
|
allow_discount_code: T::Boolean,
|
|
607
670
|
allow_phone_number_collection: T::Boolean,
|
|
608
671
|
allow_tax_id: T::Boolean,
|
|
@@ -23,6 +23,13 @@ module Dodopayments
|
|
|
23
23
|
sig { returns(String) }
|
|
24
24
|
attr_accessor :name
|
|
25
25
|
|
|
26
|
+
# Additional metadata for the customer
|
|
27
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
28
|
+
attr_reader :metadata
|
|
29
|
+
|
|
30
|
+
sig { params(metadata: T::Hash[Symbol, String]).void }
|
|
31
|
+
attr_writer :metadata
|
|
32
|
+
|
|
26
33
|
sig { returns(T.nilable(String)) }
|
|
27
34
|
attr_accessor :phone_number
|
|
28
35
|
|
|
@@ -33,6 +40,7 @@ module Dodopayments
|
|
|
33
40
|
customer_id: String,
|
|
34
41
|
email: String,
|
|
35
42
|
name: String,
|
|
43
|
+
metadata: T::Hash[Symbol, String],
|
|
36
44
|
phone_number: T.nilable(String)
|
|
37
45
|
).returns(T.attached_class)
|
|
38
46
|
end
|
|
@@ -42,6 +50,8 @@ module Dodopayments
|
|
|
42
50
|
customer_id:,
|
|
43
51
|
email:,
|
|
44
52
|
name:,
|
|
53
|
+
# Additional metadata for the customer
|
|
54
|
+
metadata: nil,
|
|
45
55
|
phone_number: nil
|
|
46
56
|
)
|
|
47
57
|
end
|
|
@@ -54,6 +64,7 @@ module Dodopayments
|
|
|
54
64
|
customer_id: String,
|
|
55
65
|
email: String,
|
|
56
66
|
name: String,
|
|
67
|
+
metadata: T::Hash[Symbol, String],
|
|
57
68
|
phone_number: T.nilable(String)
|
|
58
69
|
}
|
|
59
70
|
)
|
|
@@ -20,6 +20,13 @@ module Dodopayments
|
|
|
20
20
|
sig { returns(String) }
|
|
21
21
|
attr_accessor :name
|
|
22
22
|
|
|
23
|
+
# Additional metadata for the customer
|
|
24
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
25
|
+
attr_reader :metadata
|
|
26
|
+
|
|
27
|
+
sig { params(metadata: T::Hash[Symbol, String]).void }
|
|
28
|
+
attr_writer :metadata
|
|
29
|
+
|
|
23
30
|
sig { returns(T.nilable(String)) }
|
|
24
31
|
attr_accessor :phone_number
|
|
25
32
|
|
|
@@ -27,11 +34,19 @@ module Dodopayments
|
|
|
27
34
|
params(
|
|
28
35
|
email: String,
|
|
29
36
|
name: String,
|
|
37
|
+
metadata: T::Hash[Symbol, String],
|
|
30
38
|
phone_number: T.nilable(String),
|
|
31
39
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
32
40
|
).returns(T.attached_class)
|
|
33
41
|
end
|
|
34
|
-
def self.new(
|
|
42
|
+
def self.new(
|
|
43
|
+
email:,
|
|
44
|
+
name:,
|
|
45
|
+
# Additional metadata for the customer
|
|
46
|
+
metadata: nil,
|
|
47
|
+
phone_number: nil,
|
|
48
|
+
request_options: {}
|
|
49
|
+
)
|
|
35
50
|
end
|
|
36
51
|
|
|
37
52
|
sig do
|
|
@@ -39,6 +54,7 @@ module Dodopayments
|
|
|
39
54
|
{
|
|
40
55
|
email: String,
|
|
41
56
|
name: String,
|
|
57
|
+
metadata: T::Hash[Symbol, String],
|
|
42
58
|
phone_number: T.nilable(String),
|
|
43
59
|
request_options: Dodopayments::RequestOptions
|
|
44
60
|
}
|
|
@@ -23,6 +23,13 @@ module Dodopayments
|
|
|
23
23
|
sig { returns(String) }
|
|
24
24
|
attr_accessor :name
|
|
25
25
|
|
|
26
|
+
# Additional metadata associated with the customer
|
|
27
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
28
|
+
attr_reader :metadata
|
|
29
|
+
|
|
30
|
+
sig { params(metadata: T::Hash[Symbol, String]).void }
|
|
31
|
+
attr_writer :metadata
|
|
32
|
+
|
|
26
33
|
# Phone number of the customer
|
|
27
34
|
sig { returns(T.nilable(String)) }
|
|
28
35
|
attr_accessor :phone_number
|
|
@@ -32,6 +39,7 @@ module Dodopayments
|
|
|
32
39
|
customer_id: String,
|
|
33
40
|
email: String,
|
|
34
41
|
name: String,
|
|
42
|
+
metadata: T::Hash[Symbol, String],
|
|
35
43
|
phone_number: T.nilable(String)
|
|
36
44
|
).returns(T.attached_class)
|
|
37
45
|
end
|
|
@@ -42,6 +50,8 @@ module Dodopayments
|
|
|
42
50
|
email:,
|
|
43
51
|
# Full name of the customer
|
|
44
52
|
name:,
|
|
53
|
+
# Additional metadata associated with the customer
|
|
54
|
+
metadata: nil,
|
|
45
55
|
# Phone number of the customer
|
|
46
56
|
phone_number: nil
|
|
47
57
|
)
|
|
@@ -53,6 +63,7 @@ module Dodopayments
|
|
|
53
63
|
customer_id: String,
|
|
54
64
|
email: String,
|
|
55
65
|
name: String,
|
|
66
|
+
metadata: T::Hash[Symbol, String],
|
|
56
67
|
phone_number: T.nilable(String)
|
|
57
68
|
}
|
|
58
69
|
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class CustomerRetrievePaymentMethodsParams < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
extend Dodopayments::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Dodopayments::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Dodopayments::CustomerRetrievePaymentMethodsParams,
|
|
13
|
+
Dodopayments::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(request_options: Dodopayments::RequestOptions::OrHash).returns(
|
|
19
|
+
T.attached_class
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.new(request_options: {})
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
override.returns({ request_options: Dodopayments::RequestOptions })
|
|
27
|
+
end
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Dodopayments
|
|
4
|
+
module Models
|
|
5
|
+
class CustomerRetrievePaymentMethodsResponse < Dodopayments::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse,
|
|
10
|
+
Dodopayments::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
returns(
|
|
16
|
+
T::Array[
|
|
17
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item
|
|
18
|
+
]
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
attr_accessor :items
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
items:
|
|
26
|
+
T::Array[
|
|
27
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::OrHash
|
|
28
|
+
]
|
|
29
|
+
).returns(T.attached_class)
|
|
30
|
+
end
|
|
31
|
+
def self.new(items:)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
items:
|
|
38
|
+
T::Array[
|
|
39
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
def to_hash
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
class Item < Dodopayments::Internal::Type::BaseModel
|
|
48
|
+
OrHash =
|
|
49
|
+
T.type_alias do
|
|
50
|
+
T.any(
|
|
51
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item,
|
|
52
|
+
Dodopayments::Internal::AnyHash
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# PaymentMethod enum from hyperswitch
|
|
57
|
+
#
|
|
58
|
+
# https://github.com/juspay/hyperswitch/blob/ecd05d53c99ae701ac94893ec632a3988afe3238/crates/common_enums/src/enums.rs#L2097
|
|
59
|
+
sig do
|
|
60
|
+
returns(
|
|
61
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
attr_accessor :payment_method
|
|
65
|
+
|
|
66
|
+
sig { returns(String) }
|
|
67
|
+
attr_accessor :payment_method_id
|
|
68
|
+
|
|
69
|
+
sig do
|
|
70
|
+
returns(
|
|
71
|
+
T.nilable(
|
|
72
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card
|
|
73
|
+
)
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
attr_reader :card
|
|
77
|
+
|
|
78
|
+
sig do
|
|
79
|
+
params(
|
|
80
|
+
card:
|
|
81
|
+
T.nilable(
|
|
82
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card::OrHash
|
|
83
|
+
)
|
|
84
|
+
).void
|
|
85
|
+
end
|
|
86
|
+
attr_writer :card
|
|
87
|
+
|
|
88
|
+
sig { returns(T.nilable(Time)) }
|
|
89
|
+
attr_accessor :last_used_at
|
|
90
|
+
|
|
91
|
+
sig do
|
|
92
|
+
returns(T.nilable(Dodopayments::PaymentMethodTypes::TaggedSymbol))
|
|
93
|
+
end
|
|
94
|
+
attr_accessor :payment_method_type
|
|
95
|
+
|
|
96
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
97
|
+
attr_accessor :recurring_enabled
|
|
98
|
+
|
|
99
|
+
sig do
|
|
100
|
+
params(
|
|
101
|
+
payment_method:
|
|
102
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::OrSymbol,
|
|
103
|
+
payment_method_id: String,
|
|
104
|
+
card:
|
|
105
|
+
T.nilable(
|
|
106
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card::OrHash
|
|
107
|
+
),
|
|
108
|
+
last_used_at: T.nilable(Time),
|
|
109
|
+
payment_method_type:
|
|
110
|
+
T.nilable(Dodopayments::PaymentMethodTypes::OrSymbol),
|
|
111
|
+
recurring_enabled: T.nilable(T::Boolean)
|
|
112
|
+
).returns(T.attached_class)
|
|
113
|
+
end
|
|
114
|
+
def self.new(
|
|
115
|
+
# PaymentMethod enum from hyperswitch
|
|
116
|
+
#
|
|
117
|
+
# https://github.com/juspay/hyperswitch/blob/ecd05d53c99ae701ac94893ec632a3988afe3238/crates/common_enums/src/enums.rs#L2097
|
|
118
|
+
payment_method:,
|
|
119
|
+
payment_method_id:,
|
|
120
|
+
card: nil,
|
|
121
|
+
last_used_at: nil,
|
|
122
|
+
payment_method_type: nil,
|
|
123
|
+
recurring_enabled: nil
|
|
124
|
+
)
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
sig do
|
|
128
|
+
override.returns(
|
|
129
|
+
{
|
|
130
|
+
payment_method:
|
|
131
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol,
|
|
132
|
+
payment_method_id: String,
|
|
133
|
+
card:
|
|
134
|
+
T.nilable(
|
|
135
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card
|
|
136
|
+
),
|
|
137
|
+
last_used_at: T.nilable(Time),
|
|
138
|
+
payment_method_type:
|
|
139
|
+
T.nilable(Dodopayments::PaymentMethodTypes::TaggedSymbol),
|
|
140
|
+
recurring_enabled: T.nilable(T::Boolean)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
end
|
|
144
|
+
def to_hash
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# PaymentMethod enum from hyperswitch
|
|
148
|
+
#
|
|
149
|
+
# https://github.com/juspay/hyperswitch/blob/ecd05d53c99ae701ac94893ec632a3988afe3238/crates/common_enums/src/enums.rs#L2097
|
|
150
|
+
module PaymentMethod
|
|
151
|
+
extend Dodopayments::Internal::Type::Enum
|
|
152
|
+
|
|
153
|
+
TaggedSymbol =
|
|
154
|
+
T.type_alias do
|
|
155
|
+
T.all(
|
|
156
|
+
Symbol,
|
|
157
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod
|
|
158
|
+
)
|
|
159
|
+
end
|
|
160
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
161
|
+
|
|
162
|
+
CARD =
|
|
163
|
+
T.let(
|
|
164
|
+
:card,
|
|
165
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
166
|
+
)
|
|
167
|
+
CARD_REDIRECT =
|
|
168
|
+
T.let(
|
|
169
|
+
:card_redirect,
|
|
170
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
171
|
+
)
|
|
172
|
+
PAY_LATER =
|
|
173
|
+
T.let(
|
|
174
|
+
:pay_later,
|
|
175
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
176
|
+
)
|
|
177
|
+
WALLET =
|
|
178
|
+
T.let(
|
|
179
|
+
:wallet,
|
|
180
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
181
|
+
)
|
|
182
|
+
BANK_REDIRECT =
|
|
183
|
+
T.let(
|
|
184
|
+
:bank_redirect,
|
|
185
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
186
|
+
)
|
|
187
|
+
BANK_TRANSFER =
|
|
188
|
+
T.let(
|
|
189
|
+
:bank_transfer,
|
|
190
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
191
|
+
)
|
|
192
|
+
CRYPTO =
|
|
193
|
+
T.let(
|
|
194
|
+
:crypto,
|
|
195
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
196
|
+
)
|
|
197
|
+
BANK_DEBIT =
|
|
198
|
+
T.let(
|
|
199
|
+
:bank_debit,
|
|
200
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
201
|
+
)
|
|
202
|
+
REWARD =
|
|
203
|
+
T.let(
|
|
204
|
+
:reward,
|
|
205
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
206
|
+
)
|
|
207
|
+
REAL_TIME_PAYMENT =
|
|
208
|
+
T.let(
|
|
209
|
+
:real_time_payment,
|
|
210
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
211
|
+
)
|
|
212
|
+
UPI =
|
|
213
|
+
T.let(
|
|
214
|
+
:upi,
|
|
215
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
216
|
+
)
|
|
217
|
+
VOUCHER =
|
|
218
|
+
T.let(
|
|
219
|
+
:voucher,
|
|
220
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
221
|
+
)
|
|
222
|
+
GIFT_CARD =
|
|
223
|
+
T.let(
|
|
224
|
+
:gift_card,
|
|
225
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
226
|
+
)
|
|
227
|
+
OPEN_BANKING =
|
|
228
|
+
T.let(
|
|
229
|
+
:open_banking,
|
|
230
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
231
|
+
)
|
|
232
|
+
MOBILE_PAYMENT =
|
|
233
|
+
T.let(
|
|
234
|
+
:mobile_payment,
|
|
235
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
sig do
|
|
239
|
+
override.returns(
|
|
240
|
+
T::Array[
|
|
241
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod::TaggedSymbol
|
|
242
|
+
]
|
|
243
|
+
)
|
|
244
|
+
end
|
|
245
|
+
def self.values
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
class Card < Dodopayments::Internal::Type::BaseModel
|
|
250
|
+
OrHash =
|
|
251
|
+
T.type_alias do
|
|
252
|
+
T.any(
|
|
253
|
+
Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card,
|
|
254
|
+
Dodopayments::Internal::AnyHash
|
|
255
|
+
)
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# ISO country code alpha2 variant
|
|
259
|
+
sig { returns(T.nilable(Dodopayments::CountryCode::TaggedSymbol)) }
|
|
260
|
+
attr_accessor :card_issuing_country
|
|
261
|
+
|
|
262
|
+
sig { returns(T.nilable(String)) }
|
|
263
|
+
attr_accessor :card_network
|
|
264
|
+
|
|
265
|
+
sig { returns(T.nilable(String)) }
|
|
266
|
+
attr_accessor :card_type
|
|
267
|
+
|
|
268
|
+
sig { returns(T.nilable(String)) }
|
|
269
|
+
attr_accessor :expiry_month
|
|
270
|
+
|
|
271
|
+
sig { returns(T.nilable(String)) }
|
|
272
|
+
attr_accessor :expiry_year
|
|
273
|
+
|
|
274
|
+
sig { returns(T.nilable(String)) }
|
|
275
|
+
attr_accessor :last4_digits
|
|
276
|
+
|
|
277
|
+
sig do
|
|
278
|
+
params(
|
|
279
|
+
card_issuing_country:
|
|
280
|
+
T.nilable(Dodopayments::CountryCode::OrSymbol),
|
|
281
|
+
card_network: T.nilable(String),
|
|
282
|
+
card_type: T.nilable(String),
|
|
283
|
+
expiry_month: T.nilable(String),
|
|
284
|
+
expiry_year: T.nilable(String),
|
|
285
|
+
last4_digits: T.nilable(String)
|
|
286
|
+
).returns(T.attached_class)
|
|
287
|
+
end
|
|
288
|
+
def self.new(
|
|
289
|
+
# ISO country code alpha2 variant
|
|
290
|
+
card_issuing_country: nil,
|
|
291
|
+
card_network: nil,
|
|
292
|
+
card_type: nil,
|
|
293
|
+
expiry_month: nil,
|
|
294
|
+
expiry_year: nil,
|
|
295
|
+
last4_digits: nil
|
|
296
|
+
)
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
sig do
|
|
300
|
+
override.returns(
|
|
301
|
+
{
|
|
302
|
+
card_issuing_country:
|
|
303
|
+
T.nilable(Dodopayments::CountryCode::TaggedSymbol),
|
|
304
|
+
card_network: T.nilable(String),
|
|
305
|
+
card_type: T.nilable(String),
|
|
306
|
+
expiry_month: T.nilable(String),
|
|
307
|
+
expiry_year: T.nilable(String),
|
|
308
|
+
last4_digits: T.nilable(String)
|
|
309
|
+
}
|
|
310
|
+
)
|
|
311
|
+
end
|
|
312
|
+
def to_hash
|
|
313
|
+
end
|
|
314
|
+
end
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
end
|
|
318
|
+
end
|
|
@@ -14,6 +14,10 @@ module Dodopayments
|
|
|
14
14
|
)
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
# Additional metadata for the customer
|
|
18
|
+
sig { returns(T.nilable(T::Hash[Symbol, String])) }
|
|
19
|
+
attr_accessor :metadata
|
|
20
|
+
|
|
17
21
|
sig { returns(T.nilable(String)) }
|
|
18
22
|
attr_accessor :name
|
|
19
23
|
|
|
@@ -22,17 +26,25 @@ module Dodopayments
|
|
|
22
26
|
|
|
23
27
|
sig do
|
|
24
28
|
params(
|
|
29
|
+
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
25
30
|
name: T.nilable(String),
|
|
26
31
|
phone_number: T.nilable(String),
|
|
27
32
|
request_options: Dodopayments::RequestOptions::OrHash
|
|
28
33
|
).returns(T.attached_class)
|
|
29
34
|
end
|
|
30
|
-
def self.new(
|
|
35
|
+
def self.new(
|
|
36
|
+
# Additional metadata for the customer
|
|
37
|
+
metadata: nil,
|
|
38
|
+
name: nil,
|
|
39
|
+
phone_number: nil,
|
|
40
|
+
request_options: {}
|
|
41
|
+
)
|
|
31
42
|
end
|
|
32
43
|
|
|
33
44
|
sig do
|
|
34
45
|
override.returns(
|
|
35
46
|
{
|
|
47
|
+
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
36
48
|
name: T.nilable(String),
|
|
37
49
|
phone_number: T.nilable(String),
|
|
38
50
|
request_options: Dodopayments::RequestOptions
|