dodopayments 2.30.0 → 2.32.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 (46) 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_flags.rb +4 -2
  5. data/lib/dodopayments/models/checkout_session_request.rb +14 -4
  6. data/lib/dodopayments/models/customers/email_policies.rb +3 -2
  7. data/lib/dodopayments/models/refund.rb +22 -1
  8. data/lib/dodopayments/models/refund_list_item.rb +22 -1
  9. data/lib/dodopayments/models/refund_network_reference_type.rb +19 -0
  10. data/lib/dodopayments/models/subscription.rb +10 -1
  11. data/lib/dodopayments/models/subscription_cancelled_by.rb +54 -0
  12. data/lib/dodopayments/models/subscription_list_response.rb +10 -1
  13. data/lib/dodopayments/models/subscription_preview_change_plan_response.rb +18 -7
  14. data/lib/dodopayments/models/update_subscription_plan_req.rb +37 -1
  15. data/lib/dodopayments/models.rb +4 -0
  16. data/lib/dodopayments/resources/checkout_sessions.rb +4 -4
  17. data/lib/dodopayments/resources/subscriptions.rb +10 -2
  18. data/lib/dodopayments/version.rb +1 -1
  19. data/lib/dodopayments.rb +2 -0
  20. data/rbi/dodopayments/models/checkout_session_flags.rbi +8 -4
  21. data/rbi/dodopayments/models/checkout_session_request.rbi +25 -8
  22. data/rbi/dodopayments/models/customers/email_policies.rbi +4 -2
  23. data/rbi/dodopayments/models/refund.rbi +26 -0
  24. data/rbi/dodopayments/models/refund_list_item.rbi +26 -0
  25. data/rbi/dodopayments/models/refund_network_reference_type.rbi +41 -0
  26. data/rbi/dodopayments/models/subscription.rbi +18 -0
  27. data/rbi/dodopayments/models/subscription_cancelled_by.rbi +107 -0
  28. data/rbi/dodopayments/models/subscription_list_response.rbi +18 -0
  29. data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +24 -10
  30. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +62 -3
  31. data/rbi/dodopayments/models.rbi +4 -0
  32. data/rbi/dodopayments/resources/checkout_sessions.rbi +24 -4
  33. data/rbi/dodopayments/resources/subscriptions.rbi +52 -0
  34. data/sig/dodopayments/models/checkout_session_request.rbs +4 -6
  35. data/sig/dodopayments/models/refund.rbs +10 -0
  36. data/sig/dodopayments/models/refund_list_item.rbs +10 -0
  37. data/sig/dodopayments/models/refund_network_reference_type.rbs +20 -0
  38. data/sig/dodopayments/models/subscription.rbs +5 -0
  39. data/sig/dodopayments/models/subscription_cancelled_by.rbs +43 -0
  40. data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
  41. data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +5 -0
  42. data/sig/dodopayments/models/update_subscription_plan_req.rbs +15 -3
  43. data/sig/dodopayments/models.rbs +4 -0
  44. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -2
  45. data/sig/dodopayments/resources/subscriptions.rbs +4 -0
  46. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d255803850b82f08ad10d4dda6adbfc5ed6396443aa10c8bdc7c3e49af841db2
4
- data.tar.gz: e73593617cf7f82d97f9e198f517531358cb32bfd0e30064a4c514757229d5fd
3
+ metadata.gz: 2dd4dba4996639f045859e32a5187ada5f7725cc5c7c0055f800cb2c49935c3f
4
+ data.tar.gz: a2e9ce7d63c520af95f73a8a4b26318f903973402375e2b7e212e29a11233030
5
5
  SHA512:
6
- metadata.gz: '0949b3e69763af13e6d63dec5763e9abba82a251dcc1e1d5f4d3e771cd69b19a55d00f1c1a1f2244c54468a03c518b6a12ca0f35fbae84bba786d289ebcaa00b'
7
- data.tar.gz: 1af8337dcdf57c984bdc58b3964ab384deb407705acf3a13d5f0d4171cfcb560b3b175c39f532b7791018d947022c393b4228491fe00c702fc6e74b6fd95847d
6
+ metadata.gz: 262e8aacde3b258e041f3d9b1ad3b6f34d16ef71a5e0c18153c2c2f15248ce381f5c04ff64aa3ee298a94790e93167e3758c7866f0f5c5ea35717243cea20901
7
+ data.tar.gz: babe2e389f26d85e678383f0a89457a38acd7d5222e29313a1a1117916fc5f9647bef1eb36dc0839f3f38e51b7fd06dbfe2ce69410ee3e8deb303541c9a47789
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.32.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.31.0...v2.32.0) (2026-10-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** change-plan cancel_older_payment_link and return_url ([ab42639](https://github.com/dodopayments/dodopayments-ruby/commit/ab42639341e3c3a4595df8792c706ac6cf13d9ce))
9
+ * **api:** change-plan cancel_older_payment_link and return_url ([2b46789](https://github.com/dodopayments/dodopayments-ruby/commit/2b46789c533195890369df6a54daf324b9c689f7))
10
+
11
+ ## [2.31.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.30.0...v2.31.0) (2026-10-05)
12
+
13
+
14
+ ### Features
15
+
16
+ * **api:** refund network references and subscription cancelled_by ([356d0ed](https://github.com/dodopayments/dodopayments-ruby/commit/356d0edaaf1e6008268bc6abefe9f2567e8f89ab))
17
+ * **api:** refund network references and subscription cancelled_by ([565e4b2](https://github.com/dodopayments/dodopayments-ruby/commit/565e4b2b7843f206e4f327e421fc000ad7e075df))
18
+
3
19
  ## [2.30.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.29.0...v2.30.0) (2026-09-25)
4
20
 
5
21
 
data/README.md CHANGED
@@ -23,7 +23,7 @@ To use this gem, install via Bundler by adding the following to your application
23
23
  <!-- x-release-please-start-version -->
24
24
 
25
25
  ```ruby
26
- gem "dodopayments", "~> 2.30.0"
26
+ gem "dodopayments", "~> 2.32.0"
27
27
  ```
28
28
 
29
29
  <!-- x-release-please-end -->
@@ -114,8 +114,10 @@ module Dodopayments
114
114
  optional :redirect_immediately, Dodopayments::Internal::Type::Boolean
115
115
 
116
116
  # @!attribute require_cardholder_name
117
- # If true, the customer must give the name on the card to pay by card. The
118
- # checkout page enforces this. Other payment methods ignore it.
117
+ # If true, the customer must give the name on the card to pay by card. Apple Pay
118
+ # and Google Pay also collect the payer name, and the payment stores it as the
119
+ # card holder name. The checkout page enforces this. Other payment methods ignore
120
+ # it.
119
121
  #
120
122
  # Default is false
121
123
  #
@@ -31,7 +31,14 @@ module Dodopayments
31
31
  optional :billing_address, -> { Dodopayments::CheckoutSessionBillingAddress }, nil?: true
32
32
 
33
33
  # @!attribute billing_currency
34
- # This field is ingored if adaptive pricing is disabled
34
+ # The currency to charge the customer in.
35
+ #
36
+ # Adaptive pricing must be enabled for the business. The customer then pays in
37
+ # this currency. If you do not set it, the currency comes from the billing
38
+ # country.
39
+ #
40
+ # If adaptive pricing is disabled, the API discards this field. The currency then
41
+ # comes from the product price, or from the billing country.
35
42
  #
36
43
  # @return [Symbol, Dodopayments::Models::Currency, nil]
37
44
  optional :billing_currency, enum: -> { Dodopayments::Currency }, nil?: true
@@ -129,8 +136,11 @@ module Dodopayments
129
136
  # If true, only zipcode is required when confirm is true; other address fields
130
137
  # remain optional
131
138
  #
139
+ # Default is true when `feature_flags.single_page` is true. Otherwise, default is
140
+ # false.
141
+ #
132
142
  # @return [Boolean, nil]
133
- optional :minimal_address, Dodopayments::Internal::Type::Boolean
143
+ optional :minimal_address, Dodopayments::Internal::Type::Boolean, nil?: true
134
144
 
135
145
  # @!attribute payment_method_id
136
146
  # Optional payment method ID to use for this checkout session. Only allowed when
@@ -185,7 +195,7 @@ module Dodopayments
185
195
  #
186
196
  # @param billing_address [Dodopayments::Models::CheckoutSessionBillingAddress, nil] Billing address information for the session
187
197
  #
188
- # @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] This field is ingored if adaptive pricing is disabled
198
+ # @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] The currency to charge the customer in.
189
199
  #
190
200
  # @param cancel_url [String, nil] The URL to redirect the customer if they cancel or go back from the checkout.
191
201
  #
@@ -211,7 +221,7 @@ module Dodopayments
211
221
  #
212
222
  # @param metadata [Hash{Symbol=>String, Float, Boolean}, nil] Additional metadata associated with the payment. Defaults to empty if not provid
213
223
  #
214
- # @param minimal_address [Boolean] If true, only zipcode is required when confirm is true; other address fields rem
224
+ # @param minimal_address [Boolean, nil] If true, only zipcode is required when confirm is true; other address fields rem
215
225
  #
216
226
  # @param payment_method_id [String, nil] Optional payment method ID to use for this checkout session.
217
227
  #
@@ -5,7 +5,8 @@ module Dodopayments
5
5
  module Customers
6
6
  class EmailPolicies < Dodopayments::Internal::Type::BaseModel
7
7
  # @!attribute requires_different_address
8
- # A permanent failure was recorded, so the same address would be a no-op.
8
+ # A permanent failure was recorded, so a send to the same address delivers
9
+ # nothing. It is false for a suppressed address that a resend can clear.
9
10
  #
10
11
  # @return [Boolean]
11
12
  required :requires_different_address, Dodopayments::Internal::Type::Boolean
@@ -43,7 +44,7 @@ module Dodopayments
43
44
  # What the merchant may do with one row. The server decides; the client never
44
45
  # derives eligibility itself.
45
46
  #
46
- # @param requires_different_address [Boolean] A permanent failure was recorded, so the same address would be a no-op.
47
+ # @param requires_different_address [Boolean] A permanent failure was recorded, so a send to the same address delivers
47
48
  #
48
49
  # @param resend_allowed [Boolean] The row was delivered and may be sent again.
49
50
  #
@@ -70,13 +70,30 @@ module Dodopayments
70
70
  # @return [Symbol, Dodopayments::Models::Currency, nil]
71
71
  optional :currency, enum: -> { Dodopayments::Currency }, nil?: true
72
72
 
73
+ # @!attribute network_reference
74
+ # The reference number that the card network or the bank gives to the refund. The
75
+ # customer can give this number to their bank to trace the refund. It is null
76
+ # until the reference is available.
77
+ #
78
+ # @return [String, nil]
79
+ optional :network_reference, String, nil?: true
80
+
81
+ # @!attribute network_reference_type
82
+ # The kind of `network_reference`: ARN, STAN or RRN.
83
+ #
84
+ # @return [Symbol, Dodopayments::Models::RefundNetworkReferenceType, nil]
85
+ optional :network_reference_type, enum: -> { Dodopayments::RefundNetworkReferenceType }, nil?: true
86
+
73
87
  # @!attribute reason
74
88
  # The reason provided for the refund, if any. Optional.
75
89
  #
76
90
  # @return [String, nil]
77
91
  optional :reason, String, nil?: true
78
92
 
79
- # @!method initialize(brand_id:, business_id:, created_at:, customer:, is_partial:, metadata:, payment_id:, refund_id:, status:, amount: nil, currency: nil, reason: nil)
93
+ # @!method initialize(brand_id:, business_id:, created_at:, customer:, is_partial:, metadata:, payment_id:, refund_id:, status:, amount: nil, currency: nil, network_reference: nil, network_reference_type: nil, reason: nil)
94
+ # Some parameter documentations has been truncated, see
95
+ # {Dodopayments::Models::Refund} for more details.
96
+ #
80
97
  # @param brand_id [String] Brand id this refund belongs to
81
98
  #
82
99
  # @param business_id [String] The unique identifier of the business issuing the refund.
@@ -99,6 +116,10 @@ module Dodopayments
99
116
  #
100
117
  # @param currency [Symbol, Dodopayments::Models::Currency, nil] The currency of the refund, represented as an ISO 4217 currency code.
101
118
  #
119
+ # @param network_reference [String, nil] The reference number that the card network or the bank gives to the refund. The
120
+ #
121
+ # @param network_reference_type [Symbol, Dodopayments::Models::RefundNetworkReferenceType, nil] The kind of `network_reference`: ARN, STAN or RRN.
122
+ #
102
123
  # @param reason [String, nil] The reason provided for the refund, if any. Optional.
103
124
  end
104
125
  end
@@ -51,13 +51,30 @@ module Dodopayments
51
51
  # @return [Symbol, Dodopayments::Models::Currency, nil]
52
52
  optional :currency, enum: -> { Dodopayments::Currency }, nil?: true
53
53
 
54
+ # @!attribute network_reference
55
+ # The reference number that the card network or the bank gives to the refund. The
56
+ # customer can give this number to their bank to trace the refund. It is null
57
+ # until the reference is available.
58
+ #
59
+ # @return [String, nil]
60
+ optional :network_reference, String, nil?: true
61
+
62
+ # @!attribute network_reference_type
63
+ # The kind of `network_reference`: ARN, STAN or RRN.
64
+ #
65
+ # @return [Symbol, Dodopayments::Models::RefundNetworkReferenceType, nil]
66
+ optional :network_reference_type, enum: -> { Dodopayments::RefundNetworkReferenceType }, nil?: true
67
+
54
68
  # @!attribute reason
55
69
  # The reason provided for the refund, if any. Optional.
56
70
  #
57
71
  # @return [String, nil]
58
72
  optional :reason, String, nil?: true
59
73
 
60
- # @!method initialize(business_id:, created_at:, is_partial:, payment_id:, refund_id:, status:, amount: nil, currency: nil, reason: nil)
74
+ # @!method initialize(business_id:, created_at:, is_partial:, payment_id:, refund_id:, status:, amount: nil, currency: nil, network_reference: nil, network_reference_type: nil, reason: nil)
75
+ # Some parameter documentations has been truncated, see
76
+ # {Dodopayments::Models::RefundListItem} for more details.
77
+ #
61
78
  # @param business_id [String] The unique identifier of the business issuing the refund.
62
79
  #
63
80
  # @param created_at [Time] The timestamp of when the refund was created in UTC.
@@ -74,6 +91,10 @@ module Dodopayments
74
91
  #
75
92
  # @param currency [Symbol, Dodopayments::Models::Currency, nil] The currency of the refund, represented as an ISO 4217 currency code.
76
93
  #
94
+ # @param network_reference [String, nil] The reference number that the card network or the bank gives to the refund. The
95
+ #
96
+ # @param network_reference_type [Symbol, Dodopayments::Models::RefundNetworkReferenceType, nil] The kind of `network_reference`: ARN, STAN or RRN.
97
+ #
77
98
  # @param reason [String, nil] The reason provided for the refund, if any. Optional.
78
99
  end
79
100
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # The kind of reference number that the card network or the bank gives to a
6
+ # refund.
7
+ module RefundNetworkReferenceType
8
+ extend Dodopayments::Internal::Type::Enum
9
+
10
+ ACQUIRER_REFERENCE_NUMBER = :acquirer_reference_number
11
+ SYSTEM_TRACE_AUDIT_NUMBER = :system_trace_audit_number
12
+ RETRIEVAL_REFERENCE_NUMBER = :retrieval_reference_number
13
+ OTHER = :other
14
+
15
+ # @!method self.values
16
+ # @return [Array<Symbol>]
17
+ end
18
+ end
19
+ end
@@ -183,6 +183,13 @@ module Dodopayments
183
183
  # @return [Time, nil]
184
184
  optional :cancelled_at, Time, nil?: true
185
185
 
186
+ # @!attribute cancelled_by
187
+ # The caller that cancelled the subscription or scheduled its cancel. `null` when
188
+ # no caller is known, for example when the system cancelled the subscription.
189
+ #
190
+ # @return [Dodopayments::Models::SubscriptionCancelledBy, nil]
191
+ optional :cancelled_by, -> { Dodopayments::SubscriptionCancelledBy }, nil?: true
192
+
186
193
  # @!attribute custom_field_responses
187
194
  # Customer's responses to custom fields collected during checkout
188
195
  #
@@ -257,7 +264,7 @@ module Dodopayments
257
264
  # @return [Integer, nil]
258
265
  optional :trial_amount, Integer, nil?: true
259
266
 
260
- # @!method initialize(addons:, billing:, brand_id:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, has_payment_method:, metadata:, meter_credit_entitlement_cart:, 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:, cancellation_comment: nil, cancellation_feedback: nil, cancelled_at: nil, custom_field_responses: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, discounts: nil, expires_at: nil, paused_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil, trial_amount: nil)
267
+ # @!method initialize(addons:, billing:, brand_id:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, has_payment_method:, metadata:, meter_credit_entitlement_cart:, 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:, cancellation_comment: nil, cancellation_feedback: nil, cancelled_at: nil, cancelled_by: nil, custom_field_responses: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, discounts: nil, expires_at: nil, paused_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil, trial_amount: nil)
261
268
  # Some parameter documentations has been truncated, see
262
269
  # {Dodopayments::Models::Subscription} for more details.
263
270
  #
@@ -321,6 +328,8 @@ module Dodopayments
321
328
  #
322
329
  # @param cancelled_at [Time, nil] Cancelled timestamp if the subscription is cancelled
323
330
  #
331
+ # @param cancelled_by [Dodopayments::Models::SubscriptionCancelledBy, nil] The caller that cancelled the subscription or scheduled its cancel.
332
+ #
324
333
  # @param custom_field_responses [Array<Dodopayments::Models::CustomFieldResponse>, nil] Customer's responses to custom fields collected during checkout
325
334
  #
326
335
  # @param customer_business_name [String, nil] Business / legal name associated with the tax id (B2B). When set this is
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class SubscriptionCancelledBy < Dodopayments::Internal::Type::BaseModel
6
+ # @!attribute actor_type
7
+ # The kind of caller.
8
+ #
9
+ # @return [Symbol, Dodopayments::Models::SubscriptionCancelledBy::ActorType]
10
+ required :actor_type, enum: -> { Dodopayments::SubscriptionCancelledBy::ActorType }
11
+
12
+ # @!attribute email
13
+ # Email of the customer or of the dashboard user. `null` for an API key or the
14
+ # Dodo Payments team.
15
+ #
16
+ # @return [String, nil]
17
+ optional :email, String, nil?: true
18
+
19
+ # @!attribute name
20
+ # Name of the customer or of the dashboard user. `null` for an API key or the Dodo
21
+ # Payments team.
22
+ #
23
+ # @return [String, nil]
24
+ optional :name, String, nil?: true
25
+
26
+ # @!method initialize(actor_type:, email: nil, name: nil)
27
+ # Some parameter documentations has been truncated, see
28
+ # {Dodopayments::Models::SubscriptionCancelledBy} for more details.
29
+ #
30
+ # The caller that cancelled a subscription or scheduled its cancel.
31
+ #
32
+ # @param actor_type [Symbol, Dodopayments::Models::SubscriptionCancelledBy::ActorType] The kind of caller.
33
+ #
34
+ # @param email [String, nil] Email of the customer or of the dashboard user. `null` for an API key
35
+ #
36
+ # @param name [String, nil] Name of the customer or of the dashboard user. `null` for an API key
37
+
38
+ # The kind of caller.
39
+ #
40
+ # @see Dodopayments::Models::SubscriptionCancelledBy#actor_type
41
+ module ActorType
42
+ extend Dodopayments::Internal::Type::Enum
43
+
44
+ CUSTOMER = :customer
45
+ MERCHANT_USER = :merchant_user
46
+ API_KEY = :api_key
47
+ DODO_TEAM = :dodo_team
48
+
49
+ # @!method self.values
50
+ # @return [Array<Symbol>]
51
+ end
52
+ end
53
+ end
54
+ end
@@ -146,6 +146,13 @@ module Dodopayments
146
146
  # @return [Time, nil]
147
147
  optional :cancelled_at, Time, nil?: true
148
148
 
149
+ # @!attribute cancelled_by
150
+ # The caller that cancelled the subscription or scheduled its cancel. `null` when
151
+ # no caller is known, for example when the system cancelled the subscription.
152
+ #
153
+ # @return [Dodopayments::Models::SubscriptionCancelledBy, nil]
154
+ optional :cancelled_by, -> { Dodopayments::SubscriptionCancelledBy }, nil?: true
155
+
149
156
  # @!attribute customer_business_name
150
157
  # Business / legal name associated with the tax id (B2B). When set this is used on
151
158
  # the invoice in place of the customer's personal name.
@@ -204,7 +211,7 @@ module Dodopayments
204
211
  # @return [Integer, nil]
205
212
  optional :trial_amount, Integer, nil?: true
206
213
 
207
- # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, discounts:, has_payment_method:, 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, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, paused_at: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil, trial_amount: nil)
214
+ # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, discounts:, has_payment_method:, 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, cancelled_by: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, paused_at: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil, trial_amount: nil)
208
215
  # Some parameter documentations has been truncated, see
209
216
  # {Dodopayments::Models::SubscriptionListResponse} for more details.
210
217
  #
@@ -256,6 +263,8 @@ module Dodopayments
256
263
  #
257
264
  # @param cancelled_at [Time, nil] Cancelled timestamp if the subscription is cancelled
258
265
  #
266
+ # @param cancelled_by [Dodopayments::Models::SubscriptionCancelledBy, nil] The caller that cancelled the subscription or scheduled its cancel.
267
+ #
259
268
  # @param customer_business_name [String, nil] Business / legal name associated with the tax id (B2B). When set this is
260
269
  #
261
270
  # @param discount_cycles_remaining [Integer, nil] DEPRECATED: Use discounts[].cycles_remaining instead.
@@ -325,15 +325,24 @@ module Dodopayments
325
325
  required :currency, enum: -> { Dodopayments::Currency }
326
326
 
327
327
  # @!attribute customer_credits
328
- # Net credit movement in the smallest currency unit (e.g. cents). **Negative** –
329
- # credits were deducted from the customer's balance to offset the charge (typical
330
- # on upgrades). **Positive** – credits were added to the customer's balance,
331
- # either from a downgrade proration refund or from topping-up the wallet to meet a
332
- # gateway minimum-charge threshold. **Zero** – no credit movement occurred.
328
+ # Net credit movement in the smallest unit of `customer_credits_currency` (e.g.
329
+ # cents). Read `customer_credits_currency` for the currency. It can differ from
330
+ # `currency`. **Negative** – credits were deducted from the customer's balance to
331
+ # offset the charge (typical on upgrades). **Positive** – credits were added to
332
+ # the customer's balance, either from a downgrade proration refund or from
333
+ # topping-up the wallet to meet a gateway minimum-charge threshold. **Zero** – no
334
+ # credit movement occurred.
333
335
  #
334
336
  # @return [Integer]
335
337
  required :customer_credits, Integer
336
338
 
339
+ # @!attribute customer_credits_currency
340
+ # This field gives the currency of `customer_credits`. The credit wallet uses the
341
+ # subscription currency.
342
+ #
343
+ # @return [Symbol, Dodopayments::Models::Currency]
344
+ required :customer_credits_currency, enum: -> { Dodopayments::Currency }
345
+
337
346
  # @!attribute settlement_amount
338
347
  #
339
348
  # @return [Integer]
@@ -359,14 +368,16 @@ module Dodopayments
359
368
  # @return [Integer, nil]
360
369
  optional :tax, Integer, nil?: true
361
370
 
362
- # @!method initialize(currency:, customer_credits:, settlement_amount:, settlement_currency:, total_amount:, settlement_tax: nil, tax: nil)
371
+ # @!method initialize(currency:, customer_credits:, customer_credits_currency:, settlement_amount:, settlement_currency:, total_amount:, settlement_tax: nil, tax: nil)
363
372
  # Some parameter documentations has been truncated, see
364
373
  # {Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::Summary}
365
374
  # for more details.
366
375
  #
367
376
  # @param currency [Symbol, Dodopayments::Models::Currency]
368
377
  #
369
- # @param customer_credits [Integer] Net credit movement in the smallest currency unit (e.g. cents).
378
+ # @param customer_credits [Integer] Net credit movement in the smallest unit of `customer_credits_currency` (e.g. ce
379
+ #
380
+ # @param customer_credits_currency [Symbol, Dodopayments::Models::Currency] This field gives the currency of `customer_credits`.
370
381
  #
371
382
  # @param settlement_amount [Integer]
372
383
  #
@@ -36,6 +36,23 @@ module Dodopayments
36
36
  # @return [Array<Dodopayments::Models::AttachAddon>, nil]
37
37
  optional :addons, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::AttachAddon] }, nil?: true
38
38
 
39
+ # @!attribute cancel_older_payment_link
40
+ # Cancel the payment link of a pending plan change, so that this change can
41
+ # replace it.
42
+ #
43
+ # The link is cancelled only if the customer has not started to pay. A paid or
44
+ # in-progress payment gives a `409`. A failed cancel gives a `503`, and a retry is
45
+ # safe.
46
+ #
47
+ # The request is validated before the cancel. A later failure, for example an
48
+ # amount below the minimum, leaves the subscription on its current plan with no
49
+ # open link. A retry is safe.
50
+ #
51
+ # The preview route shares this request body and ignores this field.
52
+ #
53
+ # @return [Boolean, nil]
54
+ optional :cancel_older_payment_link, Dodopayments::Internal::Type::Boolean
55
+
39
56
  # @!attribute cancel_scheduled_change_plan
40
57
  # Replace a scheduled plan change with this one.
41
58
  #
@@ -116,7 +133,22 @@ module Dodopayments
116
133
  enum: -> { Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure },
117
134
  nil?: true
118
135
 
119
- # @!method initialize(product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil)
136
+ # @!attribute return_url
137
+ # The URL that receives the customer after they pay the payment link. Needs
138
+ # `collect_via_payment_link: true`. Without it, the request gets a `422`. A change
139
+ # that collects no money issues no link and does not use the URL. The preview
140
+ # route validates this field but does not use it.
141
+ #
142
+ # The redirect adds `subscription_id`, `payment_id` and `status`. The `status`
143
+ # value is the status of the plan-change payment. It is not the status of the
144
+ # subscription. When that payment fails, the subscription stays active on its
145
+ # current plan. To try again, call this endpoint again to get a new link. The new
146
+ # plan can apply after the redirect, when the payment webhook arrives.
147
+ #
148
+ # @return [String, nil]
149
+ optional :return_url, String, nil?: true
150
+
151
+ # @!method initialize(product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_older_payment_link: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, return_url: nil)
120
152
  # Some parameter documentations has been truncated, see
121
153
  # {Dodopayments::Models::UpdateSubscriptionPlanReq} for more details.
122
154
  #
@@ -130,6 +162,8 @@ module Dodopayments
130
162
  #
131
163
  # @param addons [Array<Dodopayments::Models::AttachAddon>, nil] Addons for the new plan.
132
164
  #
165
+ # @param cancel_older_payment_link [Boolean] Cancel the payment link of a pending plan change, so that this change
166
+ #
133
167
  # @param cancel_scheduled_change_plan [Boolean] Replace a scheduled plan change with this one.
134
168
  #
135
169
  # @param collect_via_payment_link [Boolean] Collect the plan-change amount with a payment link. The customer then
@@ -143,6 +177,8 @@ module Dodopayments
143
177
  # @param metadata [Hash{Symbol=>String, Float, Boolean}, nil] Metadata for the payment. If not passed, the metadata of the subscription will b
144
178
  #
145
179
  # @param on_payment_failure [Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::OnPaymentFailure, nil] Controls behavior when the plan change payment fails.
180
+ #
181
+ # @param return_url [String, nil] The URL that receives the customer after they pay the payment link.
146
182
 
147
183
  # Proration Billing Mode
148
184
  #
@@ -462,6 +462,8 @@ module Dodopayments
462
462
 
463
463
  RefundListParams = Dodopayments::Models::RefundListParams
464
464
 
465
+ RefundNetworkReferenceType = Dodopayments::Models::RefundNetworkReferenceType
466
+
465
467
  RefundRetrieveParams = Dodopayments::Models::RefundRetrieveParams
466
468
 
467
469
  RefundStatus = Dodopayments::Models::RefundStatus
@@ -476,6 +478,8 @@ module Dodopayments
476
478
 
477
479
  SubscriptionCancelChangePlanParams = Dodopayments::Models::SubscriptionCancelChangePlanParams
478
480
 
481
+ SubscriptionCancelledBy = Dodopayments::Models::SubscriptionCancelledBy
482
+
479
483
  SubscriptionCancelledWebhookEvent = Dodopayments::Models::SubscriptionCancelledWebhookEvent
480
484
 
481
485
  SubscriptionChangePlanParams = Dodopayments::Models::SubscriptionChangePlanParams
@@ -14,7 +14,7 @@ module Dodopayments
14
14
  #
15
15
  # @param billing_address [Dodopayments::Models::CheckoutSessionBillingAddress, nil] Billing address information for the session
16
16
  #
17
- # @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] This field is ingored if adaptive pricing is disabled
17
+ # @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] The currency to charge the customer in.
18
18
  #
19
19
  # @param cancel_url [String, nil] The URL to redirect the customer if they cancel or go back from the checkout.
20
20
  #
@@ -40,7 +40,7 @@ module Dodopayments
40
40
  #
41
41
  # @param metadata [Hash{Symbol=>String, Float, Boolean}, nil] Additional metadata associated with the payment. Defaults to empty if not provid
42
42
  #
43
- # @param minimal_address [Boolean] If true, only zipcode is required when confirm is true; other address fields rem
43
+ # @param minimal_address [Boolean, nil] If true, only zipcode is required when confirm is true; other address fields rem
44
44
  #
45
45
  # @param payment_method_id [String, nil] Optional payment method ID to use for this checkout session.
46
46
  #
@@ -101,7 +101,7 @@ module Dodopayments
101
101
  #
102
102
  # @param billing_address [Dodopayments::Models::CheckoutSessionBillingAddress, nil] Billing address information for the session
103
103
  #
104
- # @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] This field is ingored if adaptive pricing is disabled
104
+ # @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] The currency to charge the customer in.
105
105
  #
106
106
  # @param cancel_url [String, nil] The URL to redirect the customer if they cancel or go back from the checkout.
107
107
  #
@@ -127,7 +127,7 @@ module Dodopayments
127
127
  #
128
128
  # @param metadata [Hash{Symbol=>String, Float, Boolean}, nil] Additional metadata associated with the payment. Defaults to empty if not provid
129
129
  #
130
- # @param minimal_address [Boolean] If true, only zipcode is required when confirm is true; other address fields rem
130
+ # @param minimal_address [Boolean, nil] If true, only zipcode is required when confirm is true; other address fields rem
131
131
  #
132
132
  # @param payment_method_id [String, nil] Optional payment method ID to use for this checkout session.
133
133
  #
@@ -209,7 +209,7 @@ module Dodopayments
209
209
  # Some parameter documentations has been truncated, see
210
210
  # {Dodopayments::Models::SubscriptionChangePlanParams} for more details.
211
211
  #
212
- # @overload change_plan(subscription_id, product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, request_options: {})
212
+ # @overload change_plan(subscription_id, product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_older_payment_link: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, return_url: nil, request_options: {})
213
213
  #
214
214
  # @param subscription_id [String] Subscription Id
215
215
  #
@@ -223,6 +223,8 @@ module Dodopayments
223
223
  #
224
224
  # @param addons [Array<Dodopayments::Models::AttachAddon>, nil] Addons for the new plan.
225
225
  #
226
+ # @param cancel_older_payment_link [Boolean] Cancel the payment link of a pending plan change, so that this change
227
+ #
226
228
  # @param cancel_scheduled_change_plan [Boolean] Replace a scheduled plan change with this one.
227
229
  #
228
230
  # @param collect_via_payment_link [Boolean] Collect the plan-change amount with a payment link. The customer then
@@ -237,6 +239,8 @@ module Dodopayments
237
239
  #
238
240
  # @param on_payment_failure [Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::OnPaymentFailure, nil] Controls behavior when the plan change payment fails.
239
241
  #
242
+ # @param return_url [String, nil] The URL that receives the customer after they pay the payment link.
243
+ #
240
244
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
241
245
  #
242
246
  # @return [Dodopayments::Models::SubscriptionChangePlanResponse]
@@ -291,7 +295,7 @@ module Dodopayments
291
295
  # Some parameter documentations has been truncated, see
292
296
  # {Dodopayments::Models::SubscriptionPreviewChangePlanParams} for more details.
293
297
  #
294
- # @overload preview_change_plan(subscription_id, product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, request_options: {})
298
+ # @overload preview_change_plan(subscription_id, product_id:, proration_billing_mode:, quantity:, adaptive_currency_fees_inclusive: nil, addons: nil, cancel_older_payment_link: nil, cancel_scheduled_change_plan: nil, collect_via_payment_link: nil, discount_code: nil, discount_codes: nil, effective_at: nil, metadata: nil, on_payment_failure: nil, return_url: nil, request_options: {})
295
299
  #
296
300
  # @param subscription_id [String] Subscription Id
297
301
  #
@@ -305,6 +309,8 @@ module Dodopayments
305
309
  #
306
310
  # @param addons [Array<Dodopayments::Models::AttachAddon>, nil] Addons for the new plan.
307
311
  #
312
+ # @param cancel_older_payment_link [Boolean] Cancel the payment link of a pending plan change, so that this change
313
+ #
308
314
  # @param cancel_scheduled_change_plan [Boolean] Replace a scheduled plan change with this one.
309
315
  #
310
316
  # @param collect_via_payment_link [Boolean] Collect the plan-change amount with a payment link. The customer then
@@ -319,6 +325,8 @@ module Dodopayments
319
325
  #
320
326
  # @param on_payment_failure [Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::OnPaymentFailure, nil] Controls behavior when the plan change payment fails.
321
327
  #
328
+ # @param return_url [String, nil] The URL that receives the customer after they pay the payment link.
329
+ #
322
330
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
323
331
  #
324
332
  # @return [Dodopayments::Models::SubscriptionPreviewChangePlanResponse]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dodopayments
4
- VERSION = "2.30.0"
4
+ VERSION = "2.32.0"
5
5
  end
data/lib/dodopayments.rb CHANGED
@@ -361,12 +361,14 @@ require_relative "dodopayments/models/refund_create_params"
361
361
  require_relative "dodopayments/models/refund_failed_webhook_event"
362
362
  require_relative "dodopayments/models/refund_list_item"
363
363
  require_relative "dodopayments/models/refund_list_params"
364
+ require_relative "dodopayments/models/refund_network_reference_type"
364
365
  require_relative "dodopayments/models/refund_retrieve_params"
365
366
  require_relative "dodopayments/models/refund_status"
366
367
  require_relative "dodopayments/models/refund_succeeded_webhook_event"
367
368
  require_relative "dodopayments/models/scheduled_plan_change"
368
369
  require_relative "dodopayments/models/subscription_active_webhook_event"
369
370
  require_relative "dodopayments/models/subscription_cancel_change_plan_params"
371
+ require_relative "dodopayments/models/subscription_cancelled_by"
370
372
  require_relative "dodopayments/models/subscription_cancelled_webhook_event"
371
373
  require_relative "dodopayments/models/subscription_change_plan_params"
372
374
  require_relative "dodopayments/models/subscription_change_plan_response"
@@ -137,8 +137,10 @@ module Dodopayments
137
137
  sig { params(redirect_immediately: T::Boolean).void }
138
138
  attr_writer :redirect_immediately
139
139
 
140
- # If true, the customer must give the name on the card to pay by card. The
141
- # checkout page enforces this. Other payment methods ignore it.
140
+ # If true, the customer must give the name on the card to pay by card. Apple Pay
141
+ # and Google Pay also collect the payer name, and the payment stores it as the
142
+ # card holder name. The checkout page enforces this. Other payment methods ignore
143
+ # it.
142
144
  #
143
145
  # Default is false
144
146
  sig { returns(T.nilable(T::Boolean)) }
@@ -256,8 +258,10 @@ module Dodopayments
256
258
  #
257
259
  # Default is false
258
260
  redirect_immediately: nil,
259
- # If true, the customer must give the name on the card to pay by card. The
260
- # checkout page enforces this. Other payment methods ignore it.
261
+ # If true, the customer must give the name on the card to pay by card. Apple Pay
262
+ # and Google Pay also collect the payer name, and the payment stores it as the
263
+ # card holder name. The checkout page enforces this. Other payment methods ignore
264
+ # it.
261
265
  #
262
266
  # Default is false
263
267
  require_cardholder_name: nil,