dodopayments 2.30.0 → 2.31.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 (40) 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_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.rb +4 -0
  15. data/lib/dodopayments/resources/checkout_sessions.rb +4 -4
  16. data/lib/dodopayments/version.rb +1 -1
  17. data/lib/dodopayments.rb +2 -0
  18. data/rbi/dodopayments/models/checkout_session_flags.rbi +8 -4
  19. data/rbi/dodopayments/models/checkout_session_request.rbi +25 -8
  20. data/rbi/dodopayments/models/customers/email_policies.rbi +4 -2
  21. data/rbi/dodopayments/models/refund.rbi +26 -0
  22. data/rbi/dodopayments/models/refund_list_item.rbi +26 -0
  23. data/rbi/dodopayments/models/refund_network_reference_type.rbi +41 -0
  24. data/rbi/dodopayments/models/subscription.rbi +18 -0
  25. data/rbi/dodopayments/models/subscription_cancelled_by.rbi +107 -0
  26. data/rbi/dodopayments/models/subscription_list_response.rbi +18 -0
  27. data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +24 -10
  28. data/rbi/dodopayments/models.rbi +4 -0
  29. data/rbi/dodopayments/resources/checkout_sessions.rbi +24 -4
  30. data/sig/dodopayments/models/checkout_session_request.rbs +4 -6
  31. data/sig/dodopayments/models/refund.rbs +10 -0
  32. data/sig/dodopayments/models/refund_list_item.rbs +10 -0
  33. data/sig/dodopayments/models/refund_network_reference_type.rbs +20 -0
  34. data/sig/dodopayments/models/subscription.rbs +5 -0
  35. data/sig/dodopayments/models/subscription_cancelled_by.rbs +43 -0
  36. data/sig/dodopayments/models/subscription_list_response.rbs +5 -0
  37. data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +5 -0
  38. data/sig/dodopayments/models.rbs +4 -0
  39. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -2
  40. 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: b84caccdcf2ae495a3104820015c83363b0ca9ed6d0454ed2dc7b660405741be
4
+ data.tar.gz: 7083c71ad3de46a2477962c45f2113231035b6574381fa6aeb6d4c8ae1c6197f
5
5
  SHA512:
6
- metadata.gz: '0949b3e69763af13e6d63dec5763e9abba82a251dcc1e1d5f4d3e771cd69b19a55d00f1c1a1f2244c54468a03c518b6a12ca0f35fbae84bba786d289ebcaa00b'
7
- data.tar.gz: 1af8337dcdf57c984bdc58b3964ab384deb407705acf3a13d5f0d4171cfcb560b3b175c39f532b7791018d947022c393b4228491fe00c702fc6e74b6fd95847d
6
+ metadata.gz: f0da4567068ad0098087e6fd29467ebe1d2a3fc9ab5ea5f40acc7c26e3041ebc938056dd61e6b932417c30048d377cd1d5edf6f79843f9c958ed290660495db3
7
+ data.tar.gz: 6330325f9b0552f28ca67baede7caddbd43f0507a2d3b02ce308b0efbd6c7c0b67de14e194056baba3cc86c8109b664fce3aae9dbedcc6c4583de8e0e03b9d9b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.31.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.30.0...v2.31.0) (2026-10-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** refund network references and subscription cancelled_by ([356d0ed](https://github.com/dodopayments/dodopayments-ruby/commit/356d0edaaf1e6008268bc6abefe9f2567e8f89ab))
9
+ * **api:** refund network references and subscription cancelled_by ([565e4b2](https://github.com/dodopayments/dodopayments-ruby/commit/565e4b2b7843f206e4f327e421fc000ad7e075df))
10
+
3
11
  ## [2.30.0](https://github.com/dodopayments/dodopayments-ruby/compare/v2.29.0...v2.30.0) (2026-09-25)
4
12
 
5
13
 
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.31.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 payment processor sends it.
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 payment processor sends it.
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
  #
@@ -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
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dodopayments
4
- VERSION = "2.30.0"
4
+ VERSION = "2.31.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,
@@ -40,7 +40,14 @@ module Dodopayments
40
40
  end
41
41
  attr_writer :billing_address
42
42
 
43
- # This field is ingored if adaptive pricing is disabled
43
+ # The currency to charge the customer in.
44
+ #
45
+ # Adaptive pricing must be enabled for the business. The customer then pays in
46
+ # this currency. If you do not set it, the currency comes from the billing
47
+ # country.
48
+ #
49
+ # If adaptive pricing is disabled, the API discards this field. The currency then
50
+ # comes from the product price, or from the billing country.
44
51
  sig { returns(T.nilable(Dodopayments::Currency::OrSymbol)) }
45
52
  attr_accessor :billing_currency
46
53
 
@@ -133,11 +140,11 @@ module Dodopayments
133
140
 
134
141
  # If true, only zipcode is required when confirm is true; other address fields
135
142
  # remain optional
143
+ #
144
+ # Default is true when `feature_flags.single_page` is true. Otherwise, default is
145
+ # false.
136
146
  sig { returns(T.nilable(T::Boolean)) }
137
- attr_reader :minimal_address
138
-
139
- sig { params(minimal_address: T::Boolean).void }
140
- attr_writer :minimal_address
147
+ attr_accessor :minimal_address
141
148
 
142
149
  # Optional payment method ID to use for this checkout session. Only allowed when
143
150
  # `confirm` is true. If provided, existing customer id must also be provided.
@@ -208,7 +215,7 @@ module Dodopayments
208
215
  mandate_min_amount_inr_paise: T.nilable(Integer),
209
216
  metadata:
210
217
  T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
211
- minimal_address: T::Boolean,
218
+ minimal_address: T.nilable(T::Boolean),
212
219
  payment_method_id: T.nilable(String),
213
220
  product_collection_id: T.nilable(String),
214
221
  return_url: T.nilable(String),
@@ -232,7 +239,14 @@ module Dodopayments
232
239
  allowed_payment_method_types: nil,
233
240
  # Billing address information for the session
234
241
  billing_address: nil,
235
- # This field is ingored if adaptive pricing is disabled
242
+ # The currency to charge the customer in.
243
+ #
244
+ # Adaptive pricing must be enabled for the business. The customer then pays in
245
+ # this currency. If you do not set it, the currency comes from the billing
246
+ # country.
247
+ #
248
+ # If adaptive pricing is disabled, the API discards this field. The currency then
249
+ # comes from the product price, or from the billing country.
236
250
  billing_currency: nil,
237
251
  # The URL to redirect the customer if they cancel or go back from the checkout. If
238
252
  # not provided, the back button will not be displayed.
@@ -271,6 +285,9 @@ module Dodopayments
271
285
  metadata: nil,
272
286
  # If true, only zipcode is required when confirm is true; other address fields
273
287
  # remain optional
288
+ #
289
+ # Default is true when `feature_flags.single_page` is true. Otherwise, default is
290
+ # false.
274
291
  minimal_address: nil,
275
292
  # Optional payment method ID to use for this checkout session. Only allowed when
276
293
  # `confirm` is true. If provided, existing customer id must also be provided.
@@ -318,7 +335,7 @@ module Dodopayments
318
335
  mandate_min_amount_inr_paise: T.nilable(Integer),
319
336
  metadata:
320
337
  T.nilable(T::Hash[Symbol, Dodopayments::MetadataItem::Variants]),
321
- minimal_address: T::Boolean,
338
+ minimal_address: T.nilable(T::Boolean),
322
339
  payment_method_id: T.nilable(String),
323
340
  product_collection_id: T.nilable(String),
324
341
  return_url: T.nilable(String),
@@ -12,7 +12,8 @@ module Dodopayments
12
12
  )
13
13
  end
14
14
 
15
- # A permanent failure was recorded, so the same address would be a no-op.
15
+ # A permanent failure was recorded, so a send to the same address delivers
16
+ # nothing. It is false for a suppressed address that a resend can clear.
16
17
  sig { returns(T::Boolean) }
17
18
  attr_accessor :requires_different_address
18
19
 
@@ -46,7 +47,8 @@ module Dodopayments
46
47
  ).returns(T.attached_class)
47
48
  end
48
49
  def self.new(
49
- # A permanent failure was recorded, so the same address would be a no-op.
50
+ # A permanent failure was recorded, so a send to the same address delivers
51
+ # nothing. It is false for a suppressed address that a resend can clear.
50
52
  requires_different_address:,
51
53
  # The row was delivered and may be sent again.
52
54
  resend_allowed:,