dodopayments 2.11.1 → 2.12.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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/balance_ledger_entry.rb +1 -0
  5. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +1 -0
  6. data/lib/dodopayments/models/discount.rb +4 -8
  7. data/lib/dodopayments/models/discount_create_params.rb +5 -9
  8. data/lib/dodopayments/models/discount_detail.rb +2 -2
  9. data/lib/dodopayments/models/discount_list_params.rb +2 -2
  10. data/lib/dodopayments/models/discount_update_params.rb +5 -8
  11. data/lib/dodopayments/models/payment.rb +11 -1
  12. data/lib/dodopayments/models/product_collection.rb +131 -1
  13. data/lib/dodopayments/models/product_collection_create_params.rb +123 -1
  14. data/lib/dodopayments/models/product_collection_update_params.rb +123 -1
  15. data/lib/dodopayments/resources/discounts.rb +5 -5
  16. data/lib/dodopayments/resources/product_collections.rb +28 -2
  17. data/lib/dodopayments/version.rb +1 -1
  18. data/rbi/dodopayments/models/balance_ledger_entry.rbi +5 -0
  19. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +5 -0
  20. data/rbi/dodopayments/models/discount.rbi +4 -12
  21. data/rbi/dodopayments/models/discount_create_params.rbi +6 -14
  22. data/rbi/dodopayments/models/discount_detail.rbi +2 -2
  23. data/rbi/dodopayments/models/discount_list_params.rbi +2 -2
  24. data/rbi/dodopayments/models/discount_update_params.rbi +6 -12
  25. data/rbi/dodopayments/models/payment.rbi +12 -0
  26. data/rbi/dodopayments/models/product_collection.rbi +307 -3
  27. data/rbi/dodopayments/models/product_collection_create_params.rbi +310 -0
  28. data/rbi/dodopayments/models/product_collection_update_params.rbi +310 -0
  29. data/rbi/dodopayments/resources/discounts.rbi +7 -14
  30. data/rbi/dodopayments/resources/product_collections.rbi +70 -0
  31. data/sig/dodopayments/models/balance_ledger_entry.rbs +2 -0
  32. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +2 -0
  33. data/sig/dodopayments/models/payment.rbs +5 -0
  34. data/sig/dodopayments/models/product_collection.rbs +95 -3
  35. data/sig/dodopayments/models/product_collection_create_params.rbs +93 -1
  36. data/sig/dodopayments/models/product_collection_update_params.rbs +93 -1
  37. data/sig/dodopayments/resources/product_collections.rbs +10 -0
  38. metadata +1 -1
@@ -24,6 +24,24 @@ module Dodopayments
24
24
  # @return [String, nil]
25
25
  optional :description, String, nil?: true
26
26
 
27
+ # @!attribute effective_at_on_downgrade
28
+ # Effective_at setting for downgrades: Some(Some(val)) = set, Some(None) = clear
29
+ # (inherit), None = no change
30
+ #
31
+ # @return [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::EffectiveAtOnDowngrade, nil]
32
+ optional :effective_at_on_downgrade,
33
+ enum: -> { Dodopayments::ProductCollectionUpdateParams::EffectiveAtOnDowngrade },
34
+ nil?: true
35
+
36
+ # @!attribute effective_at_on_upgrade
37
+ # Effective_at setting for upgrades: Some(Some(val)) = set, Some(None) = clear
38
+ # (inherit), None = no change
39
+ #
40
+ # @return [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::EffectiveAtOnUpgrade, nil]
41
+ optional :effective_at_on_upgrade,
42
+ enum: -> { Dodopayments::ProductCollectionUpdateParams::EffectiveAtOnUpgrade },
43
+ nil?: true
44
+
27
45
  # @!attribute group_order
28
46
  # Optional new order for groups (array of group UUIDs in desired order)
29
47
  #
@@ -42,20 +60,124 @@ module Dodopayments
42
60
  # @return [String, nil]
43
61
  optional :name, String, nil?: true
44
62
 
45
- # @!method initialize(id:, brand_id: nil, description: nil, group_order: nil, image_id: nil, name: nil, request_options: {})
63
+ # @!attribute on_payment_failure
64
+ # On payment failure behavior: Some(Some(val)) = set, Some(None) = clear
65
+ # (inherit), None = no change
66
+ #
67
+ # @return [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::OnPaymentFailure, nil]
68
+ optional :on_payment_failure,
69
+ enum: -> { Dodopayments::ProductCollectionUpdateParams::OnPaymentFailure },
70
+ nil?: true
71
+
72
+ # @!attribute proration_billing_mode_on_downgrade
73
+ # Proration billing mode for downgrades: Some(Some(val)) = set, Some(None) = clear
74
+ # (inherit), None = no change
75
+ #
76
+ # @return [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::ProrationBillingModeOnDowngrade, nil]
77
+ optional :proration_billing_mode_on_downgrade,
78
+ enum: -> { Dodopayments::ProductCollectionUpdateParams::ProrationBillingModeOnDowngrade },
79
+ nil?: true
80
+
81
+ # @!attribute proration_billing_mode_on_upgrade
82
+ # Proration billing mode for upgrades: Some(Some(val)) = set, Some(None) = clear
83
+ # (inherit), None = no change
84
+ #
85
+ # @return [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::ProrationBillingModeOnUpgrade, nil]
86
+ optional :proration_billing_mode_on_upgrade,
87
+ enum: -> { Dodopayments::ProductCollectionUpdateParams::ProrationBillingModeOnUpgrade },
88
+ nil?: true
89
+
90
+ # @!method initialize(id:, brand_id: nil, description: nil, effective_at_on_downgrade: nil, effective_at_on_upgrade: nil, group_order: nil, image_id: nil, name: nil, on_payment_failure: nil, proration_billing_mode_on_downgrade: nil, proration_billing_mode_on_upgrade: nil, request_options: {})
91
+ # Some parameter documentations has been truncated, see
92
+ # {Dodopayments::Models::ProductCollectionUpdateParams} for more details.
93
+ #
46
94
  # @param id [String]
47
95
  #
48
96
  # @param brand_id [String, nil] Optional brand_id update
49
97
  #
50
98
  # @param description [String, nil] Optional description update - pass null to remove, omit to keep unchanged
51
99
  #
100
+ # @param effective_at_on_downgrade [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::EffectiveAtOnDowngrade, nil] Effective_at setting for downgrades: Some(Some(val)) = set, Some(None) = clear (
101
+ #
102
+ # @param effective_at_on_upgrade [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::EffectiveAtOnUpgrade, nil] Effective_at setting for upgrades: Some(Some(val)) = set, Some(None) = clear (in
103
+ #
52
104
  # @param group_order [Array<String>, nil] Optional new order for groups (array of group UUIDs in desired order)
53
105
  #
54
106
  # @param image_id [String, nil] Optional image update - pass null to remove, omit to keep unchanged
55
107
  #
56
108
  # @param name [String, nil] Optional new name for the collection
57
109
  #
110
+ # @param on_payment_failure [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::OnPaymentFailure, nil] On payment failure behavior: Some(Some(val)) = set, Some(None) = clear (inherit)
111
+ #
112
+ # @param proration_billing_mode_on_downgrade [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::ProrationBillingModeOnDowngrade, nil] Proration billing mode for downgrades: Some(Some(val)) = set, Some(None) = clear
113
+ #
114
+ # @param proration_billing_mode_on_upgrade [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::ProrationBillingModeOnUpgrade, nil] Proration billing mode for upgrades: Some(Some(val)) = set, Some(None) = clear (
115
+ #
58
116
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
117
+
118
+ # Effective_at setting for downgrades: Some(Some(val)) = set, Some(None) = clear
119
+ # (inherit), None = no change
120
+ module EffectiveAtOnDowngrade
121
+ extend Dodopayments::Internal::Type::Enum
122
+
123
+ IMMEDIATELY = :immediately
124
+ NEXT_BILLING_DATE = :next_billing_date
125
+
126
+ # @!method self.values
127
+ # @return [Array<Symbol>]
128
+ end
129
+
130
+ # Effective_at setting for upgrades: Some(Some(val)) = set, Some(None) = clear
131
+ # (inherit), None = no change
132
+ module EffectiveAtOnUpgrade
133
+ extend Dodopayments::Internal::Type::Enum
134
+
135
+ IMMEDIATELY = :immediately
136
+ NEXT_BILLING_DATE = :next_billing_date
137
+
138
+ # @!method self.values
139
+ # @return [Array<Symbol>]
140
+ end
141
+
142
+ # On payment failure behavior: Some(Some(val)) = set, Some(None) = clear
143
+ # (inherit), None = no change
144
+ module OnPaymentFailure
145
+ extend Dodopayments::Internal::Type::Enum
146
+
147
+ PREVENT_CHANGE = :prevent_change
148
+ APPLY_CHANGE = :apply_change
149
+
150
+ # @!method self.values
151
+ # @return [Array<Symbol>]
152
+ end
153
+
154
+ # Proration billing mode for downgrades: Some(Some(val)) = set, Some(None) = clear
155
+ # (inherit), None = no change
156
+ module ProrationBillingModeOnDowngrade
157
+ extend Dodopayments::Internal::Type::Enum
158
+
159
+ PRORATED_IMMEDIATELY = :prorated_immediately
160
+ FULL_IMMEDIATELY = :full_immediately
161
+ DIFFERENCE_IMMEDIATELY = :difference_immediately
162
+ DO_NOT_BILL = :do_not_bill
163
+
164
+ # @!method self.values
165
+ # @return [Array<Symbol>]
166
+ end
167
+
168
+ # Proration billing mode for upgrades: Some(Some(val)) = set, Some(None) = clear
169
+ # (inherit), None = no change
170
+ module ProrationBillingModeOnUpgrade
171
+ extend Dodopayments::Internal::Type::Enum
172
+
173
+ PRORATED_IMMEDIATELY = :prorated_immediately
174
+ FULL_IMMEDIATELY = :full_immediately
175
+ DIFFERENCE_IMMEDIATELY = :difference_immediately
176
+ DO_NOT_BILL = :do_not_bill
177
+
178
+ # @!method self.values
179
+ # @return [Array<Symbol>]
180
+ end
59
181
  end
60
182
  end
61
183
  end
@@ -11,9 +11,9 @@ module Dodopayments
11
11
  #
12
12
  # @overload create(amount:, type:, code: nil, expires_at: nil, metadata: nil, name: nil, preserve_on_plan_change: nil, restricted_to: nil, subscription_cycles: nil, usage_limit: nil, request_options: {})
13
13
  #
14
- # @param amount [Integer] The discount amount.
14
+ # @param amount [Integer] The discount amount in **basis points** (e.g. `540` means `5.4%`, `10000` means
15
15
  #
16
- # @param type [Symbol, Dodopayments::Models::DiscountType] The discount type (e.g. `percentage`, `flat`, or `flat_per_unit`).
16
+ # @param type [Symbol, Dodopayments::Models::DiscountType] The discount type. Currently only `percentage` is supported.
17
17
  #
18
18
  # @param code [String, nil] Optionally supply a code (will be uppercased).
19
19
  #
@@ -76,7 +76,7 @@ module Dodopayments
76
76
  #
77
77
  # @param discount_id [String] Discount Id
78
78
  #
79
- # @param amount [Integer, nil] If present, update the discount amount:
79
+ # @param amount [Integer, nil] If present, update the discount amount in **basis points** (e.g., `540` = `5.4%`
80
80
  #
81
81
  # @param code [String, nil] If present, update the discount code (uppercase).
82
82
  #
@@ -92,7 +92,7 @@ module Dodopayments
92
92
  #
93
93
  # @param subscription_cycles [Integer, nil] Number of subscription billing cycles this discount is valid for.
94
94
  #
95
- # @param type [Symbol, Dodopayments::Models::DiscountType, nil] If present, update the discount type.
95
+ # @param type [Symbol, Dodopayments::Models::DiscountType, nil] If present, update the discount type. Currently only `percentage` is supported.
96
96
  #
97
97
  # @param usage_limit [Integer, nil]
98
98
  #
@@ -120,7 +120,7 @@ module Dodopayments
120
120
  #
121
121
  # @param code [String] Filter by discount code (partial match, case-insensitive)
122
122
  #
123
- # @param discount_type [Symbol, Dodopayments::Models::DiscountType] Filter by discount type (percentage)
123
+ # @param discount_type [Symbol, Dodopayments::Models::DiscountType] Filter by discount type
124
124
  #
125
125
  # @param page_number [Integer] Page number (default = 0).
126
126
  #
@@ -6,7 +6,10 @@ module Dodopayments
6
6
  # @return [Dodopayments::Resources::ProductCollections::Groups]
7
7
  attr_reader :groups
8
8
 
9
- # @overload create(groups:, name:, brand_id: nil, description: nil, request_options: {})
9
+ # Some parameter documentations has been truncated, see
10
+ # {Dodopayments::Models::ProductCollectionCreateParams} for more details.
11
+ #
12
+ # @overload create(groups:, name:, brand_id: nil, description: nil, effective_at_on_downgrade: nil, effective_at_on_upgrade: nil, on_payment_failure: nil, proration_billing_mode_on_downgrade: nil, proration_billing_mode_on_upgrade: nil, request_options: {})
10
13
  #
11
14
  # @param groups [Array<Dodopayments::Models::ProductCollections::ProductCollectionGroupDetails>] Groups of products in this collection
12
15
  #
@@ -16,6 +19,16 @@ module Dodopayments
16
19
  #
17
20
  # @param description [String, nil] Optional description of the product collection
18
21
  #
22
+ # @param effective_at_on_downgrade [Symbol, Dodopayments::Models::ProductCollectionCreateParams::EffectiveAtOnDowngrade, nil] Default effective_at setting for subscription plan downgrades (NULL = inherit fr
23
+ #
24
+ # @param effective_at_on_upgrade [Symbol, Dodopayments::Models::ProductCollectionCreateParams::EffectiveAtOnUpgrade, nil] Default effective_at setting for subscription plan upgrades (NULL = inherit from
25
+ #
26
+ # @param on_payment_failure [Symbol, Dodopayments::Models::ProductCollectionCreateParams::OnPaymentFailure, nil] Default behavior for subscription plan changes on payment failure (NULL = inheri
27
+ #
28
+ # @param proration_billing_mode_on_downgrade [Symbol, Dodopayments::Models::ProductCollectionCreateParams::ProrationBillingModeOnDowngrade, nil] Default proration billing mode for subscription plan downgrades (NULL = inherit
29
+ #
30
+ # @param proration_billing_mode_on_upgrade [Symbol, Dodopayments::Models::ProductCollectionCreateParams::ProrationBillingModeOnUpgrade, nil] Default proration billing mode for subscription plan upgrades (NULL = inherit fr
31
+ #
19
32
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
20
33
  #
21
34
  # @return [Dodopayments::Models::ProductCollection]
@@ -50,7 +63,10 @@ module Dodopayments
50
63
  )
51
64
  end
52
65
 
53
- # @overload update(id, brand_id: nil, description: nil, group_order: nil, image_id: nil, name: nil, request_options: {})
66
+ # Some parameter documentations has been truncated, see
67
+ # {Dodopayments::Models::ProductCollectionUpdateParams} for more details.
68
+ #
69
+ # @overload update(id, brand_id: nil, description: nil, effective_at_on_downgrade: nil, effective_at_on_upgrade: nil, group_order: nil, image_id: nil, name: nil, on_payment_failure: nil, proration_billing_mode_on_downgrade: nil, proration_billing_mode_on_upgrade: nil, request_options: {})
54
70
  #
55
71
  # @param id [String] Product Collection Id
56
72
  #
@@ -58,12 +74,22 @@ module Dodopayments
58
74
  #
59
75
  # @param description [String, nil] Optional description update - pass null to remove, omit to keep unchanged
60
76
  #
77
+ # @param effective_at_on_downgrade [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::EffectiveAtOnDowngrade, nil] Effective_at setting for downgrades: Some(Some(val)) = set, Some(None) = clear (
78
+ #
79
+ # @param effective_at_on_upgrade [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::EffectiveAtOnUpgrade, nil] Effective_at setting for upgrades: Some(Some(val)) = set, Some(None) = clear (in
80
+ #
61
81
  # @param group_order [Array<String>, nil] Optional new order for groups (array of group UUIDs in desired order)
62
82
  #
63
83
  # @param image_id [String, nil] Optional image update - pass null to remove, omit to keep unchanged
64
84
  #
65
85
  # @param name [String, nil] Optional new name for the collection
66
86
  #
87
+ # @param on_payment_failure [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::OnPaymentFailure, nil] On payment failure behavior: Some(Some(val)) = set, Some(None) = clear (inherit)
88
+ #
89
+ # @param proration_billing_mode_on_downgrade [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::ProrationBillingModeOnDowngrade, nil] Proration billing mode for downgrades: Some(Some(val)) = set, Some(None) = clear
90
+ #
91
+ # @param proration_billing_mode_on_upgrade [Symbol, Dodopayments::Models::ProductCollectionUpdateParams::ProrationBillingModeOnUpgrade, nil] Proration billing mode for upgrades: Some(Some(val)) = set, Some(None) = clear (
92
+ #
67
93
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
68
94
  #
69
95
  # @return [nil]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dodopayments
4
- VERSION = "2.11.1"
4
+ VERSION = "2.12.0"
5
5
  end
@@ -207,6 +207,11 @@ module Dodopayments
207
207
  :dunning_fees,
208
208
  Dodopayments::BalanceLedgerEntry::EventType::TaggedSymbol
209
209
  )
210
+ PAYMENT_RETRY_FEE =
211
+ T.let(
212
+ :payment_retry_fee,
213
+ Dodopayments::BalanceLedgerEntry::EventType::TaggedSymbol
214
+ )
210
215
 
211
216
  sig do
212
217
  override.returns(
@@ -1005,6 +1005,11 @@ module Dodopayments
1005
1005
  :dunning_fees,
1006
1006
  Dodopayments::BalanceRetrieveLedgerParams::EventType::TaggedSymbol
1007
1007
  )
1008
+ PAYMENT_RETRY_FEE =
1009
+ T.let(
1010
+ :payment_retry_fee,
1011
+ Dodopayments::BalanceRetrieveLedgerParams::EventType::TaggedSymbol
1012
+ )
1008
1013
 
1009
1014
  sig do
1010
1015
  override.returns(
@@ -8,11 +8,7 @@ module Dodopayments
8
8
  T.any(Dodopayments::Discount, Dodopayments::Internal::AnyHash)
9
9
  end
10
10
 
11
- # The discount amount.
12
- #
13
- # - If `discount_type` is `percentage`, this is in **basis points** (e.g., 540 =>
14
- # 5.4%).
15
- # - Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).
11
+ # The discount amount in **basis points** (e.g., 540 => 5.4%).
16
12
  sig { returns(Integer) }
17
13
  attr_accessor :amount
18
14
 
@@ -48,7 +44,7 @@ module Dodopayments
48
44
  sig { returns(Integer) }
49
45
  attr_accessor :times_used
50
46
 
51
- # The type of discount, e.g. `percentage`, `flat`, or `flat_per_unit`.
47
+ # The type of discount. Currently only `percentage` is supported.
52
48
  sig { returns(Dodopayments::DiscountType::TaggedSymbol) }
53
49
  attr_accessor :type
54
50
 
@@ -89,11 +85,7 @@ module Dodopayments
89
85
  ).returns(T.attached_class)
90
86
  end
91
87
  def self.new(
92
- # The discount amount.
93
- #
94
- # - If `discount_type` is `percentage`, this is in **basis points** (e.g., 540 =>
95
- # 5.4%).
96
- # - Otherwise, this is **USD cents** (e.g., 100 => `$1.00`).
88
+ # The discount amount in **basis points** (e.g., 540 => 5.4%).
97
89
  amount:,
98
90
  # The business this discount belongs to.
99
91
  business_id:,
@@ -111,7 +103,7 @@ module Dodopayments
111
103
  restricted_to:,
112
104
  # How many times this discount has been used.
113
105
  times_used:,
114
- # The type of discount, e.g. `percentage`, `flat`, or `flat_per_unit`.
106
+ # The type of discount. Currently only `percentage` is supported.
115
107
  type:,
116
108
  # Optional date/time after which discount is expired.
117
109
  expires_at: nil,
@@ -14,18 +14,14 @@ module Dodopayments
14
14
  )
15
15
  end
16
16
 
17
- # The discount amount.
18
- #
19
- # - If `discount_type` is **not** `percentage`, `amount` is in **USD cents**. For
20
- # example, `100` means `$1.00`. Only USD is allowed.
21
- # - If `discount_type` **is** `percentage`, `amount` is in **basis points**. For
22
- # example, `540` means `5.4%`.
17
+ # The discount amount in **basis points** (e.g. `540` means `5.4%`, `10000` means
18
+ # `100%`).
23
19
  #
24
20
  # Must be at least 1.
25
21
  sig { returns(Integer) }
26
22
  attr_accessor :amount
27
23
 
28
- # The discount type (e.g. `percentage`, `flat`, or `flat_per_unit`).
24
+ # The discount type. Currently only `percentage` is supported.
29
25
  sig { returns(Dodopayments::DiscountType::OrSymbol) }
30
26
  attr_accessor :type
31
27
 
@@ -88,16 +84,12 @@ module Dodopayments
88
84
  ).returns(T.attached_class)
89
85
  end
90
86
  def self.new(
91
- # The discount amount.
92
- #
93
- # - If `discount_type` is **not** `percentage`, `amount` is in **USD cents**. For
94
- # example, `100` means `$1.00`. Only USD is allowed.
95
- # - If `discount_type` **is** `percentage`, `amount` is in **basis points**. For
96
- # example, `540` means `5.4%`.
87
+ # The discount amount in **basis points** (e.g. `540` means `5.4%`, `10000` means
88
+ # `100%`).
97
89
  #
98
90
  # Must be at least 1.
99
91
  amount:,
100
- # The discount type (e.g. `percentage`, `flat`, or `flat_per_unit`).
92
+ # The discount type. Currently only `percentage` is supported.
101
93
  type:,
102
94
  # Optionally supply a code (will be uppercased).
103
95
  #
@@ -8,7 +8,7 @@ module Dodopayments
8
8
  T.any(Dodopayments::DiscountDetail, Dodopayments::Internal::AnyHash)
9
9
  end
10
10
 
11
- # The discount amount (basis points for percentage, USD cents for flat)
11
+ # The discount amount in **basis points** (e.g., 540 => 5.4%).
12
12
  sig { returns(Integer) }
13
13
  attr_accessor :amount
14
14
 
@@ -96,7 +96,7 @@ module Dodopayments
96
96
  ).returns(T.attached_class)
97
97
  end
98
98
  def self.new(
99
- # The discount amount (basis points for percentage, USD cents for flat)
99
+ # The discount amount in **basis points** (e.g., 540 => 5.4%).
100
100
  amount:,
101
101
  # The business this discount belongs to
102
102
  business_id:,
@@ -28,7 +28,7 @@ module Dodopayments
28
28
  sig { params(code: String).void }
29
29
  attr_writer :code
30
30
 
31
- # Filter by discount type (percentage)
31
+ # Filter by discount type
32
32
  sig { returns(T.nilable(Dodopayments::DiscountType::OrSymbol)) }
33
33
  attr_reader :discount_type
34
34
 
@@ -72,7 +72,7 @@ module Dodopayments
72
72
  active: nil,
73
73
  # Filter by discount code (partial match, case-insensitive)
74
74
  code: nil,
75
- # Filter by discount type (percentage)
75
+ # Filter by discount type
76
76
  discount_type: nil,
77
77
  # Page number (default = 0).
78
78
  page_number: nil,
@@ -17,11 +17,8 @@ module Dodopayments
17
17
  sig { returns(String) }
18
18
  attr_accessor :discount_id
19
19
 
20
- # If present, update the discount amount:
21
- #
22
- # - If `discount_type` is `percentage`, this represents **basis points** (e.g.,
23
- # `540` = `5.4%`).
24
- # - Otherwise, this represents **USD cents** (e.g., `100` = `$1.00`).
20
+ # If present, update the discount amount in **basis points** (e.g., `540` =
21
+ # `5.4%`, `10000` = `100%`).
25
22
  #
26
23
  # Must be at least 1 if provided.
27
24
  sig { returns(T.nilable(Integer)) }
@@ -57,7 +54,7 @@ module Dodopayments
57
54
  sig { returns(T.nilable(Integer)) }
58
55
  attr_accessor :subscription_cycles
59
56
 
60
- # If present, update the discount type.
57
+ # If present, update the discount type. Currently only `percentage` is supported.
61
58
  sig { returns(T.nilable(Dodopayments::DiscountType::OrSymbol)) }
62
59
  attr_accessor :type
63
60
 
@@ -82,11 +79,8 @@ module Dodopayments
82
79
  end
83
80
  def self.new(
84
81
  discount_id:,
85
- # If present, update the discount amount:
86
- #
87
- # - If `discount_type` is `percentage`, this represents **basis points** (e.g.,
88
- # `540` = `5.4%`).
89
- # - Otherwise, this represents **USD cents** (e.g., `100` = `$1.00`).
82
+ # If present, update the discount amount in **basis points** (e.g., `540` =
83
+ # `5.4%`, `10000` = `100%`).
90
84
  #
91
85
  # Must be at least 1 if provided.
92
86
  amount: nil,
@@ -106,7 +100,7 @@ module Dodopayments
106
100
  # provided, the discount will be applied indefinitely to all recurring payments
107
101
  # related to the subscription.
108
102
  subscription_cycles: nil,
109
- # If present, update the discount type.
103
+ # If present, update the discount type. Currently only `percentage` is supported.
110
104
  type: nil,
111
105
  usage_limit: nil,
112
106
  request_options: {}
@@ -60,6 +60,12 @@ module Dodopayments
60
60
  sig { returns(T::Array[Dodopayments::RefundListItem]) }
61
61
  attr_accessor :refunds
62
62
 
63
+ # Retry attempt number for subscription renewal payments. `0` for the original
64
+ # payment, `1`+ for each scheduled off-session retry after a failed renewal.
65
+ # Always `0` for non-subscription payments.
66
+ sig { returns(Integer) }
67
+ attr_accessor :retry_attempt
68
+
63
69
  # The amount that will be credited to your Dodo balance after currency conversion
64
70
  # and processing. Especially relevant for adaptive pricing where the customer's
65
71
  # payment currency differs from your settlement currency.
@@ -188,6 +194,7 @@ module Dodopayments
188
194
  metadata: T::Hash[Symbol, String],
189
195
  payment_id: String,
190
196
  refunds: T::Array[Dodopayments::RefundListItem::OrHash],
197
+ retry_attempt: Integer,
191
198
  settlement_amount: Integer,
192
199
  settlement_currency: Dodopayments::Currency::OrSymbol,
193
200
  total_amount: Integer,
@@ -241,6 +248,10 @@ module Dodopayments
241
248
  payment_id:,
242
249
  # List of refunds issued for this payment
243
250
  refunds:,
251
+ # Retry attempt number for subscription renewal payments. `0` for the original
252
+ # payment, `1`+ for each scheduled off-session retry after a failed renewal.
253
+ # Always `0` for non-subscription payments.
254
+ retry_attempt:,
244
255
  # The amount that will be credited to your Dodo balance after currency conversion
245
256
  # and processing. Especially relevant for adaptive pricing where the customer's
246
257
  # payment currency differs from your settlement currency.
@@ -319,6 +330,7 @@ module Dodopayments
319
330
  metadata: T::Hash[Symbol, String],
320
331
  payment_id: String,
321
332
  refunds: T::Array[Dodopayments::RefundListItem],
333
+ retry_attempt: Integer,
322
334
  settlement_amount: Integer,
323
335
  settlement_currency: Dodopayments::Currency::TaggedSymbol,
324
336
  total_amount: Integer,