dodopayments 1.56.4 → 1.60.0

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/checkout_session_request.rb +50 -1
  5. data/lib/dodopayments/models/customer.rb +14 -1
  6. data/lib/dodopayments/models/customer_create_params.rb +12 -1
  7. data/lib/dodopayments/models/customer_limited_details.rb +9 -1
  8. data/lib/dodopayments/models/customer_retrieve_payment_methods_params.rb +14 -0
  9. data/lib/dodopayments/models/customer_retrieve_payment_methods_response.rb +183 -0
  10. data/lib/dodopayments/models/customer_update_params.rb +11 -1
  11. data/lib/dodopayments/models/product_create_params.rb +9 -9
  12. data/lib/dodopayments/models/subscription.rb +9 -1
  13. data/lib/dodopayments/models/subscription_list_response.rb +9 -1
  14. data/lib/dodopayments/models/subscription_update_payment_method_params.rb +41 -0
  15. data/lib/dodopayments/models/subscription_update_payment_method_response.rb +34 -0
  16. data/lib/dodopayments/models.rb +4 -0
  17. data/lib/dodopayments/resources/customers.rb +27 -2
  18. data/lib/dodopayments/resources/products.rb +3 -3
  19. data/lib/dodopayments/resources/subscriptions.rb +26 -0
  20. data/lib/dodopayments/version.rb +1 -1
  21. data/lib/dodopayments.rb +4 -0
  22. data/rbi/dodopayments/models/checkout_session_request.rbi +63 -0
  23. data/rbi/dodopayments/models/customer.rbi +11 -0
  24. data/rbi/dodopayments/models/customer_create_params.rbi +17 -1
  25. data/rbi/dodopayments/models/customer_limited_details.rbi +11 -0
  26. data/rbi/dodopayments/models/customer_retrieve_payment_methods_params.rbi +32 -0
  27. data/rbi/dodopayments/models/customer_retrieve_payment_methods_response.rbi +392 -0
  28. data/rbi/dodopayments/models/customer_update_params.rbi +13 -1
  29. data/rbi/dodopayments/models/product_create_params.rbi +8 -8
  30. data/rbi/dodopayments/models/subscription.rbi +8 -0
  31. data/rbi/dodopayments/models/subscription_list_response.rbi +8 -0
  32. data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +91 -0
  33. data/rbi/dodopayments/models/subscription_update_payment_method_response.rbi +56 -0
  34. data/rbi/dodopayments/models.rbi +6 -0
  35. data/rbi/dodopayments/resources/customers.rbi +25 -1
  36. data/rbi/dodopayments/resources/products.rbi +3 -3
  37. data/rbi/dodopayments/resources/subscriptions.rbi +20 -0
  38. data/sig/dodopayments/models/checkout_session_request.rbs +49 -0
  39. data/sig/dodopayments/models/customer.rbs +7 -0
  40. data/sig/dodopayments/models/customer_create_params.rbs +12 -1
  41. data/sig/dodopayments/models/customer_limited_details.rbs +7 -0
  42. data/sig/dodopayments/models/customer_retrieve_payment_methods_params.rbs +15 -0
  43. data/sig/dodopayments/models/customer_retrieve_payment_methods_response.rbs +180 -0
  44. data/sig/dodopayments/models/customer_update_params.rbs +9 -1
  45. data/sig/dodopayments/models/product_create_params.rbs +6 -6
  46. data/sig/dodopayments/models/subscription.rbs +5 -0
  47. data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
  48. data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +46 -0
  49. data/sig/dodopayments/models/subscription_update_payment_method_response.rbs +35 -0
  50. data/sig/dodopayments/models.rbs +4 -0
  51. data/sig/dodopayments/resources/customers.rbs +7 -0
  52. data/sig/dodopayments/resources/products.rbs +1 -1
  53. data/sig/dodopayments/resources/subscriptions.rbs +8 -0
  54. metadata +14 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e87a36ea54d7bec5d0cfd23f516b508eb98921982d150de3a7a9915f035991a
4
- data.tar.gz: 43cfde45462e61c446f009697d73bcef8fe05f8ba132f2ff7e532f2611cf6396
3
+ metadata.gz: 5a2542c87a868ce65838f0d44fddaae7c63261cf29ab503511e421c992669233
4
+ data.tar.gz: e7b3e2c9cdb76c08f3f718f2b44996ccbdb12f2f8be38352be583f3bbf444ab7
5
5
  SHA512:
6
- metadata.gz: 1bb6591747447b4ed03a1808cef250ec12cd6db967fa7ae62ce82324b68c5b0db2f17597787eb0c510f9055340858f57b4f7d340d759e0f01eb525e8712cd021
7
- data.tar.gz: dd5a3ab5bbab2a2cde57c36358906142d473a39992d85c4ee673b9f8aaeb1a0c24f70641b69c5febe310b14e3f08436d949fde1a389fdedf2de69c245789716d
6
+ metadata.gz: 468530fb6f1a33332c0e5f3f7c16c3a012eb945291e2c3bc63739bbc4e2c9a5dfe09217e361c9c721157d4ff3f27edb16948e5af9f73fe52e7d43de0c57281b8
7
+ data.tar.gz: e11e7e99dbf0c553ec5d96182684e2c27dbba593adb4736afeb4f5eedc35d30af1d7e8e797bc5641ff1ccc55b0445e1b15ac6c226131313864105b4a943bebd5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.60.0 (2025-11-14)
4
+
5
+ Full Changelog: [v1.56.4...v1.60.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.56.4...v1.60.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** added update payment method and updated openapi spec to v1.60.0 ([b81478b](https://github.com/dodopayments/dodopayments-ruby/commit/b81478b3e319f4ce09de51766a37688e0cc24b08))
10
+
3
11
  ## 1.56.4 (2025-11-05)
4
12
 
5
13
  Full Changelog: [v1.56.3...v1.56.4](https://github.com/dodopayments/dodopayments-ruby/compare/v1.56.3...v1.56.4)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "dodopayments", "~> 1.56.4"
20
+ gem "dodopayments", "~> 1.60.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -287,6 +287,41 @@ module Dodopayments
287
287
  # @return [Boolean, nil]
288
288
  optional :allow_currency_selection, Dodopayments::Internal::Type::Boolean
289
289
 
290
+ # @!attribute allow_customer_editing_city
291
+ #
292
+ # @return [Boolean, nil]
293
+ optional :allow_customer_editing_city, Dodopayments::Internal::Type::Boolean
294
+
295
+ # @!attribute allow_customer_editing_country
296
+ #
297
+ # @return [Boolean, nil]
298
+ optional :allow_customer_editing_country, Dodopayments::Internal::Type::Boolean
299
+
300
+ # @!attribute allow_customer_editing_email
301
+ #
302
+ # @return [Boolean, nil]
303
+ optional :allow_customer_editing_email, Dodopayments::Internal::Type::Boolean
304
+
305
+ # @!attribute allow_customer_editing_name
306
+ #
307
+ # @return [Boolean, nil]
308
+ optional :allow_customer_editing_name, Dodopayments::Internal::Type::Boolean
309
+
310
+ # @!attribute allow_customer_editing_state
311
+ #
312
+ # @return [Boolean, nil]
313
+ optional :allow_customer_editing_state, Dodopayments::Internal::Type::Boolean
314
+
315
+ # @!attribute allow_customer_editing_street
316
+ #
317
+ # @return [Boolean, nil]
318
+ optional :allow_customer_editing_street, Dodopayments::Internal::Type::Boolean
319
+
320
+ # @!attribute allow_customer_editing_zipcode
321
+ #
322
+ # @return [Boolean, nil]
323
+ optional :allow_customer_editing_zipcode, Dodopayments::Internal::Type::Boolean
324
+
290
325
  # @!attribute allow_discount_code
291
326
  # If the customer is allowed to apply discount code, set it to true.
292
327
  #
@@ -320,12 +355,26 @@ module Dodopayments
320
355
  # @return [Boolean, nil]
321
356
  optional :always_create_new_customer, Dodopayments::Internal::Type::Boolean
322
357
 
323
- # @!method initialize(allow_currency_selection: nil, allow_discount_code: nil, allow_phone_number_collection: nil, allow_tax_id: nil, always_create_new_customer: nil)
358
+ # @!method initialize(allow_currency_selection: nil, allow_customer_editing_city: nil, allow_customer_editing_country: nil, allow_customer_editing_email: nil, allow_customer_editing_name: nil, allow_customer_editing_state: nil, allow_customer_editing_street: nil, allow_customer_editing_zipcode: nil, allow_discount_code: nil, allow_phone_number_collection: nil, allow_tax_id: nil, always_create_new_customer: nil)
324
359
  # Some parameter documentations has been truncated, see
325
360
  # {Dodopayments::Models::CheckoutSessionRequest::FeatureFlags} for more details.
326
361
  #
327
362
  # @param allow_currency_selection [Boolean] if customer is allowed to change currency, set it to true
328
363
  #
364
+ # @param allow_customer_editing_city [Boolean]
365
+ #
366
+ # @param allow_customer_editing_country [Boolean]
367
+ #
368
+ # @param allow_customer_editing_email [Boolean]
369
+ #
370
+ # @param allow_customer_editing_name [Boolean]
371
+ #
372
+ # @param allow_customer_editing_state [Boolean]
373
+ #
374
+ # @param allow_customer_editing_street [Boolean]
375
+ #
376
+ # @param allow_customer_editing_zipcode [Boolean]
377
+ #
329
378
  # @param allow_discount_code [Boolean] If the customer is allowed to apply discount code, set it to true.
330
379
  #
331
380
  # @param allow_phone_number_collection [Boolean] If phone number is collected from customer, set it to rue
@@ -29,17 +29,30 @@ module Dodopayments
29
29
  # @return [String]
30
30
  required :name, String
31
31
 
32
+ # @!attribute metadata
33
+ # Additional metadata for the customer
34
+ #
35
+ # @return [Hash{Symbol=>String}, nil]
36
+ optional :metadata, Dodopayments::Internal::Type::HashOf[String]
37
+
32
38
  # @!attribute phone_number
33
39
  #
34
40
  # @return [String, nil]
35
41
  optional :phone_number, String, nil?: true
36
42
 
37
- # @!method initialize(business_id:, created_at:, customer_id:, email:, name:, phone_number: nil)
43
+ # @!method initialize(business_id:, created_at:, customer_id:, email:, name:, metadata: nil, phone_number: nil)
38
44
  # @param business_id [String]
45
+ #
39
46
  # @param created_at [Time]
47
+ #
40
48
  # @param customer_id [String]
49
+ #
41
50
  # @param email [String]
51
+ #
42
52
  # @param name [String]
53
+ #
54
+ # @param metadata [Hash{Symbol=>String}] Additional metadata for the customer
55
+ #
43
56
  # @param phone_number [String, nil]
44
57
  end
45
58
  end
@@ -17,15 +17,26 @@ module Dodopayments
17
17
  # @return [String]
18
18
  required :name, String
19
19
 
20
+ # @!attribute metadata
21
+ # Additional metadata for the customer
22
+ #
23
+ # @return [Hash{Symbol=>String}, nil]
24
+ optional :metadata, Dodopayments::Internal::Type::HashOf[String]
25
+
20
26
  # @!attribute phone_number
21
27
  #
22
28
  # @return [String, nil]
23
29
  optional :phone_number, String, nil?: true
24
30
 
25
- # @!method initialize(email:, name:, phone_number: nil, request_options: {})
31
+ # @!method initialize(email:, name:, metadata: nil, phone_number: nil, request_options: {})
26
32
  # @param email [String]
33
+ #
27
34
  # @param name [String]
35
+ #
36
+ # @param metadata [Hash{Symbol=>String}] Additional metadata for the customer
37
+ #
28
38
  # @param phone_number [String, nil]
39
+ #
29
40
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
30
41
  end
31
42
  end
@@ -21,19 +21,27 @@ module Dodopayments
21
21
  # @return [String]
22
22
  required :name, String
23
23
 
24
+ # @!attribute metadata
25
+ # Additional metadata associated with the customer
26
+ #
27
+ # @return [Hash{Symbol=>String}, nil]
28
+ optional :metadata, Dodopayments::Internal::Type::HashOf[String]
29
+
24
30
  # @!attribute phone_number
25
31
  # Phone number of the customer
26
32
  #
27
33
  # @return [String, nil]
28
34
  optional :phone_number, String, nil?: true
29
35
 
30
- # @!method initialize(customer_id:, email:, name:, phone_number: nil)
36
+ # @!method initialize(customer_id:, email:, name:, metadata: nil, phone_number: nil)
31
37
  # @param customer_id [String] Unique identifier for the customer
32
38
  #
33
39
  # @param email [String] Email address of the customer
34
40
  #
35
41
  # @param name [String] Full name of the customer
36
42
  #
43
+ # @param metadata [Hash{Symbol=>String}] Additional metadata associated with the customer
44
+ #
37
45
  # @param phone_number [String, nil] Phone number of the customer
38
46
  end
39
47
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Customers#retrieve_payment_methods
6
+ class CustomerRetrievePaymentMethodsParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,183 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Customers#retrieve_payment_methods
6
+ class CustomerRetrievePaymentMethodsResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute items
8
+ #
9
+ # @return [Array<Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item>]
10
+ required :items,
11
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item] }
12
+
13
+ # @!method initialize(items:)
14
+ # @param items [Array<Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item>]
15
+
16
+ class Item < Dodopayments::Internal::Type::BaseModel
17
+ # @!attribute connector_payment_methods
18
+ #
19
+ # @return [Hash{Symbol=>Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::ConnectorPaymentMethod}]
20
+ required :connector_payment_methods,
21
+ -> { Dodopayments::Internal::Type::HashOf[Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::ConnectorPaymentMethod] }
22
+
23
+ # @!attribute payment_method
24
+ # PaymentMethod enum from hyperswitch
25
+ #
26
+ # https://github.com/juspay/hyperswitch/blob/ecd05d53c99ae701ac94893ec632a3988afe3238/crates/common_enums/src/enums.rs#L2097
27
+ #
28
+ # @return [Symbol, Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod]
29
+ required :payment_method,
30
+ enum: -> { Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod }
31
+
32
+ # @!attribute payment_method_id
33
+ #
34
+ # @return [String]
35
+ required :payment_method_id, String
36
+
37
+ # @!attribute profile_map
38
+ #
39
+ # @return [Hash{Symbol=>String}]
40
+ required :profile_map, Dodopayments::Internal::Type::HashOf[String]
41
+
42
+ # @!attribute card
43
+ #
44
+ # @return [Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card, nil]
45
+ optional :card,
46
+ -> { Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card },
47
+ nil?: true
48
+
49
+ # @!attribute last_used_at
50
+ #
51
+ # @return [Time, nil]
52
+ optional :last_used_at, Time, nil?: true
53
+
54
+ # @!attribute recurring_enabled
55
+ #
56
+ # @return [Boolean, nil]
57
+ optional :recurring_enabled, Dodopayments::Internal::Type::Boolean, nil?: true
58
+
59
+ # @!method initialize(connector_payment_methods:, payment_method:, payment_method_id:, profile_map:, card: nil, last_used_at: nil, recurring_enabled: nil)
60
+ # Some parameter documentations has been truncated, see
61
+ # {Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item} for more
62
+ # details.
63
+ #
64
+ # @param connector_payment_methods [Hash{Symbol=>Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::ConnectorPaymentMethod}]
65
+ #
66
+ # @param payment_method [Symbol, Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod] PaymentMethod enum from hyperswitch
67
+ #
68
+ # @param payment_method_id [String]
69
+ #
70
+ # @param profile_map [Hash{Symbol=>String}]
71
+ #
72
+ # @param card [Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card, nil]
73
+ #
74
+ # @param last_used_at [Time, nil]
75
+ #
76
+ # @param recurring_enabled [Boolean, nil]
77
+
78
+ class ConnectorPaymentMethod < Dodopayments::Internal::Type::BaseModel
79
+ # @!attribute connector_mandate_id
80
+ #
81
+ # @return [String]
82
+ required :connector_mandate_id, String
83
+
84
+ # @!attribute original_payment_authorized_amount
85
+ #
86
+ # @return [Integer]
87
+ required :original_payment_authorized_amount, Integer
88
+
89
+ # @!attribute original_payment_authorized_currency
90
+ #
91
+ # @return [Symbol, Dodopayments::Models::Currency]
92
+ required :original_payment_authorized_currency, enum: -> { Dodopayments::Currency }
93
+
94
+ # @!attribute payment_method_type
95
+ #
96
+ # @return [Symbol, Dodopayments::Models::PaymentMethodTypes, nil]
97
+ optional :payment_method_type, enum: -> { Dodopayments::PaymentMethodTypes }, nil?: true
98
+
99
+ # @!method initialize(connector_mandate_id:, original_payment_authorized_amount:, original_payment_authorized_currency:, payment_method_type: nil)
100
+ # @param connector_mandate_id [String]
101
+ # @param original_payment_authorized_amount [Integer]
102
+ # @param original_payment_authorized_currency [Symbol, Dodopayments::Models::Currency]
103
+ # @param payment_method_type [Symbol, Dodopayments::Models::PaymentMethodTypes, nil]
104
+ end
105
+
106
+ # PaymentMethod enum from hyperswitch
107
+ #
108
+ # https://github.com/juspay/hyperswitch/blob/ecd05d53c99ae701ac94893ec632a3988afe3238/crates/common_enums/src/enums.rs#L2097
109
+ #
110
+ # @see Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item#payment_method
111
+ module PaymentMethod
112
+ extend Dodopayments::Internal::Type::Enum
113
+
114
+ CARD = :card
115
+ CARD_REDIRECT = :card_redirect
116
+ PAY_LATER = :pay_later
117
+ WALLET = :wallet
118
+ BANK_REDIRECT = :bank_redirect
119
+ BANK_TRANSFER = :bank_transfer
120
+ CRYPTO = :crypto
121
+ BANK_DEBIT = :bank_debit
122
+ REWARD = :reward
123
+ REAL_TIME_PAYMENT = :real_time_payment
124
+ UPI = :upi
125
+ VOUCHER = :voucher
126
+ GIFT_CARD = :gift_card
127
+ OPEN_BANKING = :open_banking
128
+ MOBILE_PAYMENT = :mobile_payment
129
+
130
+ # @!method self.values
131
+ # @return [Array<Symbol>]
132
+ end
133
+
134
+ # @see Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item#card
135
+ class Card < Dodopayments::Internal::Type::BaseModel
136
+ # @!attribute card_issuing_country
137
+ # ISO country code alpha2 variant
138
+ #
139
+ # @return [Symbol, Dodopayments::Models::CountryCode, nil]
140
+ optional :card_issuing_country, enum: -> { Dodopayments::CountryCode }, nil?: true
141
+
142
+ # @!attribute card_network
143
+ #
144
+ # @return [String, nil]
145
+ optional :card_network, String, nil?: true
146
+
147
+ # @!attribute card_type
148
+ #
149
+ # @return [String, nil]
150
+ optional :card_type, String, nil?: true
151
+
152
+ # @!attribute expiry_month
153
+ #
154
+ # @return [String, nil]
155
+ optional :expiry_month, String, nil?: true
156
+
157
+ # @!attribute expiry_year
158
+ #
159
+ # @return [String, nil]
160
+ optional :expiry_year, String, nil?: true
161
+
162
+ # @!attribute last4_digits
163
+ #
164
+ # @return [String, nil]
165
+ optional :last4_digits, String, nil?: true
166
+
167
+ # @!method initialize(card_issuing_country: nil, card_network: nil, card_type: nil, expiry_month: nil, expiry_year: nil, last4_digits: nil)
168
+ # @param card_issuing_country [Symbol, Dodopayments::Models::CountryCode, nil] ISO country code alpha2 variant
169
+ #
170
+ # @param card_network [String, nil]
171
+ #
172
+ # @param card_type [String, nil]
173
+ #
174
+ # @param expiry_month [String, nil]
175
+ #
176
+ # @param expiry_year [String, nil]
177
+ #
178
+ # @param last4_digits [String, nil]
179
+ end
180
+ end
181
+ end
182
+ end
183
+ end
@@ -7,6 +7,12 @@ module Dodopayments
7
7
  extend Dodopayments::Internal::Type::RequestParameters::Converter
8
8
  include Dodopayments::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute metadata
11
+ # Additional metadata for the customer
12
+ #
13
+ # @return [Hash{Symbol=>String}, nil]
14
+ optional :metadata, Dodopayments::Internal::Type::HashOf[String], nil?: true
15
+
10
16
  # @!attribute name
11
17
  #
12
18
  # @return [String, nil]
@@ -17,9 +23,13 @@ module Dodopayments
17
23
  # @return [String, nil]
18
24
  optional :phone_number, String, nil?: true
19
25
 
20
- # @!method initialize(name: nil, phone_number: nil, request_options: {})
26
+ # @!method initialize(metadata: nil, name: nil, phone_number: nil, request_options: {})
27
+ # @param metadata [Hash{Symbol=>String}, nil] Additional metadata for the customer
28
+ #
21
29
  # @param name [String, nil]
30
+ #
22
31
  # @param phone_number [String, nil]
32
+ #
23
33
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
24
34
  end
25
35
  end
@@ -7,6 +7,12 @@ module Dodopayments
7
7
  extend Dodopayments::Internal::Type::RequestParameters::Converter
8
8
  include Dodopayments::Internal::Type::RequestParameters
9
9
 
10
+ # @!attribute name
11
+ # Name of the product
12
+ #
13
+ # @return [String]
14
+ required :name, String
15
+
10
16
  # @!attribute price
11
17
  # Price configuration for the product
12
18
  #
@@ -77,16 +83,12 @@ module Dodopayments
77
83
  # @return [Hash{Symbol=>String}, nil]
78
84
  optional :metadata, Dodopayments::Internal::Type::HashOf[String]
79
85
 
80
- # @!attribute name
81
- # Optional name of the product
82
- #
83
- # @return [String, nil]
84
- optional :name, String, nil?: true
85
-
86
- # @!method initialize(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, name: nil, request_options: {})
86
+ # @!method initialize(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: {})
87
87
  # Some parameter documentations has been truncated, see
88
88
  # {Dodopayments::Models::ProductCreateParams} for more details.
89
89
  #
90
+ # @param name [String] Name of the product
91
+ #
90
92
  # @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice] Price configuration for the product
91
93
  #
92
94
  # @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Tax category applied to this product
@@ -109,8 +111,6 @@ module Dodopayments
109
111
  #
110
112
  # @param metadata [Hash{Symbol=>String}] Additional metadata for the product
111
113
  #
112
- # @param name [String, nil] Optional name of the product
113
- #
114
114
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
115
115
 
116
116
  class DigitalProductDelivery < Dodopayments::Internal::Type::BaseModel
@@ -162,13 +162,19 @@ module Dodopayments
162
162
  # @return [Time, nil]
163
163
  optional :expires_at, Time, nil?: true
164
164
 
165
+ # @!attribute payment_method_id
166
+ # Saved payment method id used for recurring charges
167
+ #
168
+ # @return [String, nil]
169
+ optional :payment_method_id, String, nil?: true
170
+
165
171
  # @!attribute tax_id
166
172
  # Tax identifier provided for this subscription (if applicable)
167
173
  #
168
174
  # @return [String, nil]
169
175
  optional :tax_id, String, nil?: true
170
176
 
171
- # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, metadata:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil, tax_id: nil)
177
+ # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, metadata:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil, payment_method_id: nil, tax_id: nil)
172
178
  # Some parameter documentations has been truncated, see
173
179
  # {Dodopayments::Models::Subscription} for more details.
174
180
  #
@@ -226,6 +232,8 @@ module Dodopayments
226
232
  #
227
233
  # @param expires_at [Time, nil] Timestamp when the subscription will expire
228
234
  #
235
+ # @param payment_method_id [String, nil] Saved payment method id used for recurring charges
236
+ #
229
237
  # @param tax_id [String, nil] Tax identifier provided for this subscription (if applicable)
230
238
 
231
239
  class Meter < Dodopayments::Internal::Type::BaseModel
@@ -144,13 +144,19 @@ module Dodopayments
144
144
  # @return [String, nil]
145
145
  optional :discount_id, String, nil?: true
146
146
 
147
+ # @!attribute payment_method_id
148
+ # Saved payment method id used for recurring charges
149
+ #
150
+ # @return [String, nil]
151
+ optional :payment_method_id, String, nil?: true
152
+
147
153
  # @!attribute tax_id
148
154
  # Tax identifier provided for this subscription (if applicable)
149
155
  #
150
156
  # @return [String, nil]
151
157
  optional :tax_id, String, nil?: true
152
158
 
153
- # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, tax_id: nil)
159
+ # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, payment_method_id: nil, tax_id: nil)
154
160
  # Some parameter documentations has been truncated, see
155
161
  # {Dodopayments::Models::SubscriptionListResponse} for more details.
156
162
  #
@@ -202,6 +208,8 @@ module Dodopayments
202
208
  #
203
209
  # @param discount_id [String, nil] The discount id if discount is applied
204
210
  #
211
+ # @param payment_method_id [String, nil] Saved payment method id used for recurring charges
212
+ #
205
213
  # @param tax_id [String, nil] Tax identifier provided for this subscription (if applicable)
206
214
  end
207
215
  end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Subscriptions#update_payment_method
6
+ class SubscriptionUpdatePaymentMethodParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute type
11
+ #
12
+ # @return [Symbol, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Type]
13
+ required :type, enum: -> { Dodopayments::SubscriptionUpdatePaymentMethodParams::Type }
14
+
15
+ # @!attribute return_url
16
+ #
17
+ # @return [String, nil]
18
+ optional :return_url, String, nil?: true
19
+
20
+ # @!attribute payment_method_id
21
+ #
22
+ # @return [String]
23
+ required :payment_method_id, String
24
+
25
+ # @!method initialize(type:, payment_method_id:, return_url: nil, request_options: {})
26
+ # @param type [Symbol, Dodopayments::Models::SubscriptionUpdatePaymentMethodParams::Type]
27
+ # @param payment_method_id [String]
28
+ # @param return_url [String, nil]
29
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
30
+
31
+ module Type
32
+ extend Dodopayments::Internal::Type::Enum
33
+
34
+ EXISTING = :existing
35
+
36
+ # @!method self.values
37
+ # @return [Array<Symbol>]
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Subscriptions#update_payment_method
6
+ class SubscriptionUpdatePaymentMethodResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute client_secret
8
+ #
9
+ # @return [String, nil]
10
+ optional :client_secret, String, nil?: true
11
+
12
+ # @!attribute expires_on
13
+ #
14
+ # @return [Time, nil]
15
+ optional :expires_on, Time, nil?: true
16
+
17
+ # @!attribute payment_id
18
+ #
19
+ # @return [String, nil]
20
+ optional :payment_id, String, nil?: true
21
+
22
+ # @!attribute payment_link
23
+ #
24
+ # @return [String, nil]
25
+ optional :payment_link, String, nil?: true
26
+
27
+ # @!method initialize(client_secret: nil, expires_on: nil, payment_id: nil, payment_link: nil)
28
+ # @param client_secret [String, nil]
29
+ # @param expires_on [Time, nil]
30
+ # @param payment_id [String, nil]
31
+ # @param payment_link [String, nil]
32
+ end
33
+ end
34
+ end
@@ -103,6 +103,8 @@ module Dodopayments
103
103
 
104
104
  CustomerRetrieveParams = Dodopayments::Models::CustomerRetrieveParams
105
105
 
106
+ CustomerRetrievePaymentMethodsParams = Dodopayments::Models::CustomerRetrievePaymentMethodsParams
107
+
106
108
  Customers = Dodopayments::Models::Customers
107
109
 
108
110
  CustomerUpdateParams = Dodopayments::Models::CustomerUpdateParams
@@ -295,6 +297,8 @@ module Dodopayments
295
297
 
296
298
  SubscriptionUpdateParams = Dodopayments::Models::SubscriptionUpdateParams
297
299
 
300
+ SubscriptionUpdatePaymentMethodParams = Dodopayments::Models::SubscriptionUpdatePaymentMethodParams
301
+
298
302
  TaxCategory = Dodopayments::Models::TaxCategory
299
303
 
300
304
  TimeInterval = Dodopayments::Models::TimeInterval