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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -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 +147 -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 +318 -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 +143 -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: afa870f3b10ee7c4dd9a9d2156a7638a066348093868c2edad5c46c313e0a30d
4
+ data.tar.gz: 0a1a2dda4d124310539b26985049c1b77dbdbae3732cbb4a1b25fe84620cef6e
5
5
  SHA512:
6
- metadata.gz: 1bb6591747447b4ed03a1808cef250ec12cd6db967fa7ae62ce82324b68c5b0db2f17597787eb0c510f9055340858f57b4f7d340d759e0f01eb525e8712cd021
7
- data.tar.gz: dd5a3ab5bbab2a2cde57c36358906142d473a39992d85c4ee673b9f8aaeb1a0c24f70641b69c5febe310b14e3f08436d949fde1a389fdedf2de69c245789716d
6
+ metadata.gz: 948a0c253d5c12a8686389e6df1d2934fb01c5310f96439356b1f93a340e2274f1d442066572214a33f8334b4ec82fa11dde09e0959683b32ddb692ad0d5d7c5
7
+ data.tar.gz: 6d29cf15facbaf1ada5bd27912789be96e90cd3eec6b5c83c315692502839944f408658bf0ff2c39a563ed0a545bb8b528b5c959cd5e4cd5e42ad2b59cefd19d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.61.5 (2025-11-17)
4
+
5
+ Full Changelog: [v1.60.0...v1.61.5](https://github.com/dodopayments/dodopayments-ruby/compare/v1.60.0...v1.61.5)
6
+
7
+ ### Features
8
+
9
+ * **api:** updated openapi spec to v1.61.5 ([a0dec2d](https://github.com/dodopayments/dodopayments-ruby/commit/a0dec2de23324bd4391bbdecab3d0c627f9c8faf))
10
+
11
+ ## 1.60.0 (2025-11-14)
12
+
13
+ Full Changelog: [v1.56.4...v1.60.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.56.4...v1.60.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** added update payment method and updated openapi spec to v1.60.0 ([b81478b](https://github.com/dodopayments/dodopayments-ruby/commit/b81478b3e319f4ce09de51766a37688e0cc24b08))
18
+
3
19
  ## 1.56.4 (2025-11-05)
4
20
 
5
21
  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.61.5"
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,147 @@
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 payment_method
18
+ # PaymentMethod enum from hyperswitch
19
+ #
20
+ # https://github.com/juspay/hyperswitch/blob/ecd05d53c99ae701ac94893ec632a3988afe3238/crates/common_enums/src/enums.rs#L2097
21
+ #
22
+ # @return [Symbol, Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod]
23
+ required :payment_method,
24
+ enum: -> { Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod }
25
+
26
+ # @!attribute payment_method_id
27
+ #
28
+ # @return [String]
29
+ required :payment_method_id, String
30
+
31
+ # @!attribute card
32
+ #
33
+ # @return [Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card, nil]
34
+ optional :card,
35
+ -> { Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card },
36
+ nil?: true
37
+
38
+ # @!attribute last_used_at
39
+ #
40
+ # @return [Time, nil]
41
+ optional :last_used_at, Time, nil?: true
42
+
43
+ # @!attribute payment_method_type
44
+ #
45
+ # @return [Symbol, Dodopayments::Models::PaymentMethodTypes, nil]
46
+ optional :payment_method_type, enum: -> { Dodopayments::PaymentMethodTypes }, nil?: true
47
+
48
+ # @!attribute recurring_enabled
49
+ #
50
+ # @return [Boolean, nil]
51
+ optional :recurring_enabled, Dodopayments::Internal::Type::Boolean, nil?: true
52
+
53
+ # @!method initialize(payment_method:, payment_method_id:, card: nil, last_used_at: nil, payment_method_type: nil, recurring_enabled: nil)
54
+ # Some parameter documentations has been truncated, see
55
+ # {Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item} for more
56
+ # details.
57
+ #
58
+ # @param payment_method [Symbol, Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::PaymentMethod] PaymentMethod enum from hyperswitch
59
+ #
60
+ # @param payment_method_id [String]
61
+ #
62
+ # @param card [Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item::Card, nil]
63
+ #
64
+ # @param last_used_at [Time, nil]
65
+ #
66
+ # @param payment_method_type [Symbol, Dodopayments::Models::PaymentMethodTypes, nil]
67
+ #
68
+ # @param recurring_enabled [Boolean, nil]
69
+
70
+ # PaymentMethod enum from hyperswitch
71
+ #
72
+ # https://github.com/juspay/hyperswitch/blob/ecd05d53c99ae701ac94893ec632a3988afe3238/crates/common_enums/src/enums.rs#L2097
73
+ #
74
+ # @see Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item#payment_method
75
+ module PaymentMethod
76
+ extend Dodopayments::Internal::Type::Enum
77
+
78
+ CARD = :card
79
+ CARD_REDIRECT = :card_redirect
80
+ PAY_LATER = :pay_later
81
+ WALLET = :wallet
82
+ BANK_REDIRECT = :bank_redirect
83
+ BANK_TRANSFER = :bank_transfer
84
+ CRYPTO = :crypto
85
+ BANK_DEBIT = :bank_debit
86
+ REWARD = :reward
87
+ REAL_TIME_PAYMENT = :real_time_payment
88
+ UPI = :upi
89
+ VOUCHER = :voucher
90
+ GIFT_CARD = :gift_card
91
+ OPEN_BANKING = :open_banking
92
+ MOBILE_PAYMENT = :mobile_payment
93
+
94
+ # @!method self.values
95
+ # @return [Array<Symbol>]
96
+ end
97
+
98
+ # @see Dodopayments::Models::CustomerRetrievePaymentMethodsResponse::Item#card
99
+ class Card < Dodopayments::Internal::Type::BaseModel
100
+ # @!attribute card_issuing_country
101
+ # ISO country code alpha2 variant
102
+ #
103
+ # @return [Symbol, Dodopayments::Models::CountryCode, nil]
104
+ optional :card_issuing_country, enum: -> { Dodopayments::CountryCode }, nil?: true
105
+
106
+ # @!attribute card_network
107
+ #
108
+ # @return [String, nil]
109
+ optional :card_network, String, nil?: true
110
+
111
+ # @!attribute card_type
112
+ #
113
+ # @return [String, nil]
114
+ optional :card_type, String, nil?: true
115
+
116
+ # @!attribute expiry_month
117
+ #
118
+ # @return [String, nil]
119
+ optional :expiry_month, String, nil?: true
120
+
121
+ # @!attribute expiry_year
122
+ #
123
+ # @return [String, nil]
124
+ optional :expiry_year, String, nil?: true
125
+
126
+ # @!attribute last4_digits
127
+ #
128
+ # @return [String, nil]
129
+ optional :last4_digits, String, nil?: true
130
+
131
+ # @!method initialize(card_issuing_country: nil, card_network: nil, card_type: nil, expiry_month: nil, expiry_year: nil, last4_digits: nil)
132
+ # @param card_issuing_country [Symbol, Dodopayments::Models::CountryCode, nil] ISO country code alpha2 variant
133
+ #
134
+ # @param card_network [String, nil]
135
+ #
136
+ # @param card_type [String, nil]
137
+ #
138
+ # @param expiry_month [String, nil]
139
+ #
140
+ # @param expiry_year [String, nil]
141
+ #
142
+ # @param last4_digits [String, nil]
143
+ end
144
+ end
145
+ end
146
+ end
147
+ 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
@@ -9,11 +9,16 @@ module Dodopayments
9
9
  # @return [Dodopayments::Resources::Customers::Wallets]
10
10
  attr_reader :wallets
11
11
 
12
- # @overload create(email:, name:, phone_number: nil, request_options: {})
12
+ # @overload create(email:, name:, metadata: nil, phone_number: nil, request_options: {})
13
13
  #
14
14
  # @param email [String]
15
+ #
15
16
  # @param name [String]
17
+ #
18
+ # @param metadata [Hash{Symbol=>String}] Additional metadata for the customer
19
+ #
16
20
  # @param phone_number [String, nil]
21
+ #
17
22
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
18
23
  #
19
24
  # @return [Dodopayments::Models::Customer]
@@ -48,10 +53,12 @@ module Dodopayments
48
53
  )
49
54
  end
50
55
 
51
- # @overload update(customer_id, name: nil, phone_number: nil, request_options: {})
56
+ # @overload update(customer_id, metadata: nil, name: nil, phone_number: nil, request_options: {})
52
57
  #
53
58
  # @param customer_id [String] Customer Id
54
59
  #
60
+ # @param metadata [Hash{Symbol=>String}, nil] Additional metadata for the customer
61
+ #
55
62
  # @param name [String, nil]
56
63
  #
57
64
  # @param phone_number [String, nil]
@@ -97,6 +104,24 @@ module Dodopayments
97
104
  )
98
105
  end
99
106
 
107
+ # @overload retrieve_payment_methods(customer_id, request_options: {})
108
+ #
109
+ # @param customer_id [String] Customer Id
110
+ #
111
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
112
+ #
113
+ # @return [Dodopayments::Models::CustomerRetrievePaymentMethodsResponse]
114
+ #
115
+ # @see Dodopayments::Models::CustomerRetrievePaymentMethodsParams
116
+ def retrieve_payment_methods(customer_id, params = {})
117
+ @client.request(
118
+ method: :get,
119
+ path: ["customers/%1$s/payment-methods", customer_id],
120
+ model: Dodopayments::Models::CustomerRetrievePaymentMethodsResponse,
121
+ options: params[:request_options]
122
+ )
123
+ end
124
+
100
125
  # @api private
101
126
  #
102
127
  # @param client [Dodopayments::Client]