dodopayments 1.19.0 → 1.22.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 (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +57 -0
  3. data/README.md +5 -5
  4. data/lib/dodopayments/client.rb +4 -0
  5. data/lib/dodopayments/internal/default_page_number_pagination.rb +2 -2
  6. data/lib/dodopayments/internal/transport/base_client.rb +3 -3
  7. data/lib/dodopayments/internal/type/base_model.rb +1 -9
  8. data/lib/dodopayments/internal/type/request_parameters.rb +2 -8
  9. data/lib/dodopayments/internal/util.rb +20 -4
  10. data/lib/dodopayments/models/addon_cart_response_item.rb +23 -0
  11. data/lib/dodopayments/models/addon_create_params.rb +58 -0
  12. data/lib/dodopayments/models/addon_list_params.rb +30 -0
  13. data/lib/dodopayments/models/addon_response.rb +93 -0
  14. data/lib/dodopayments/models/addon_retrieve_params.rb +14 -0
  15. data/lib/dodopayments/models/addon_update_images_params.rb +14 -0
  16. data/lib/dodopayments/models/addon_update_images_response.rb +22 -0
  17. data/lib/dodopayments/models/addon_update_params.rb +66 -0
  18. data/lib/dodopayments/models/currency.rb +158 -0
  19. data/lib/dodopayments/models/dispute.rb +9 -2
  20. data/lib/dodopayments/models/dispute_list_response.rb +76 -0
  21. data/lib/dodopayments/models/dispute_retrieve_response.rb +99 -0
  22. data/lib/dodopayments/models/payment.rb +46 -315
  23. data/lib/dodopayments/models/payment_create_params.rb +3 -158
  24. data/lib/dodopayments/models/payment_list_response.rb +3 -157
  25. data/lib/dodopayments/models/payout_list_response.rb +3 -157
  26. data/lib/dodopayments/models/price.rb +6 -314
  27. data/lib/dodopayments/models/product.rb +3 -19
  28. data/lib/dodopayments/models/product_create_params.rb +3 -17
  29. data/lib/dodopayments/models/product_list_response.rb +6 -176
  30. data/lib/dodopayments/models/product_update_params.rb +3 -17
  31. data/lib/dodopayments/models/refund.rb +3 -157
  32. data/lib/dodopayments/models/subscription.rb +21 -158
  33. data/lib/dodopayments/models/subscription_change_plan_params.rb +31 -1
  34. data/lib/dodopayments/models/subscription_create_params.rb +30 -159
  35. data/lib/dodopayments/models/subscription_create_response.rb +10 -1
  36. data/lib/dodopayments/models/subscription_list_response.rb +179 -0
  37. data/lib/dodopayments/models/subscription_update_params.rb +19 -1
  38. data/lib/dodopayments/models/tax_category.rb +19 -0
  39. data/lib/dodopayments/models.rb +167 -0
  40. data/lib/dodopayments/resources/addons.rb +141 -0
  41. data/lib/dodopayments/resources/disputes.rb +4 -4
  42. data/lib/dodopayments/resources/invoices/payments.rb +3 -2
  43. data/lib/dodopayments/resources/payments.rb +1 -1
  44. data/lib/dodopayments/resources/products.rb +2 -2
  45. data/lib/dodopayments/resources/subscriptions.rb +15 -6
  46. data/lib/dodopayments/version.rb +1 -1
  47. data/lib/dodopayments.rb +14 -0
  48. data/rbi/dodopayments/client.rbi +3 -0
  49. data/rbi/dodopayments/errors.rbi +1 -1
  50. data/rbi/dodopayments/internal/util.rbi +5 -1
  51. data/rbi/dodopayments/models/addon_cart_response_item.rbi +20 -0
  52. data/rbi/dodopayments/models/addon_create_params.rbi +69 -0
  53. data/rbi/dodopayments/models/addon_list_params.rbi +45 -0
  54. data/rbi/dodopayments/models/addon_response.rbi +103 -0
  55. data/rbi/dodopayments/models/addon_retrieve_params.rbi +19 -0
  56. data/rbi/dodopayments/models/addon_update_images_params.rbi +19 -0
  57. data/rbi/dodopayments/models/addon_update_images_response.rbi +19 -0
  58. data/rbi/dodopayments/models/addon_update_params.rbi +77 -0
  59. data/rbi/dodopayments/models/currency.rbi +161 -0
  60. data/rbi/dodopayments/models/dispute.rbi +11 -3
  61. data/rbi/dodopayments/models/dispute_list_response.rbi +85 -0
  62. data/rbi/dodopayments/models/dispute_retrieve_response.rbi +112 -0
  63. data/rbi/dodopayments/models/payment.rbi +47 -318
  64. data/rbi/dodopayments/models/payment_create_params.rbi +3 -159
  65. data/rbi/dodopayments/models/payment_list_response.rbi +3 -159
  66. data/rbi/dodopayments/models/payout_list_response.rbi +3 -159
  67. data/rbi/dodopayments/models/price.rbi +6 -318
  68. data/rbi/dodopayments/models/product.rbi +3 -20
  69. data/rbi/dodopayments/models/product_create_params.rbi +3 -21
  70. data/rbi/dodopayments/models/product_list_response.rbi +6 -180
  71. data/rbi/dodopayments/models/product_update_params.rbi +3 -21
  72. data/rbi/dodopayments/models/refund.rbi +3 -159
  73. data/rbi/dodopayments/models/subscription.rbi +19 -159
  74. data/rbi/dodopayments/models/subscription_change_plan_params.rbi +26 -0
  75. data/rbi/dodopayments/models/subscription_create_params.rbi +27 -160
  76. data/rbi/dodopayments/models/subscription_create_response.rbi +8 -0
  77. data/rbi/dodopayments/models/subscription_list_response.rbi +190 -0
  78. data/rbi/dodopayments/models/subscription_update_params.rbi +37 -1
  79. data/rbi/dodopayments/models/tax_category.rbi +22 -0
  80. data/rbi/dodopayments/models.rbi +167 -0
  81. data/rbi/dodopayments/resources/addons.rbi +97 -0
  82. data/rbi/dodopayments/resources/disputes.rbi +2 -2
  83. data/rbi/dodopayments/resources/invoices/payments.rbi +1 -1
  84. data/rbi/dodopayments/resources/payments.rbi +1 -1
  85. data/rbi/dodopayments/resources/products.rbi +2 -2
  86. data/rbi/dodopayments/resources/subscriptions.rbi +19 -2
  87. data/sig/dodopayments/client.rbs +2 -0
  88. data/sig/dodopayments/internal/util.rbs +2 -0
  89. data/sig/dodopayments/models/addon_cart_response_item.rbs +15 -0
  90. data/sig/dodopayments/models/addon_create_params.rbs +39 -0
  91. data/sig/dodopayments/models/addon_list_params.rbs +24 -0
  92. data/sig/dodopayments/models/addon_response.rbs +54 -0
  93. data/sig/dodopayments/models/addon_retrieve_params.rbs +15 -0
  94. data/sig/dodopayments/models/addon_update_images_params.rbs +15 -0
  95. data/sig/dodopayments/models/addon_update_images_response.rbs +15 -0
  96. data/sig/dodopayments/models/addon_update_params.rbs +43 -0
  97. data/sig/dodopayments/models/currency.rbs +302 -0
  98. data/sig/dodopayments/models/dispute.rbs +6 -2
  99. data/sig/dodopayments/models/dispute_list_response.rbs +46 -0
  100. data/sig/dodopayments/models/dispute_retrieve_response.rbs +58 -0
  101. data/sig/dodopayments/models/payment.rbs +26 -604
  102. data/sig/dodopayments/models/payment_create_params.rbs +3 -302
  103. data/sig/dodopayments/models/payment_list_response.rbs +3 -302
  104. data/sig/dodopayments/models/payout_list_response.rbs +3 -302
  105. data/sig/dodopayments/models/price.rbs +6 -604
  106. data/sig/dodopayments/models/product.rbs +3 -16
  107. data/sig/dodopayments/models/product_create_params.rbs +3 -16
  108. data/sig/dodopayments/models/product_list_response.rbs +6 -318
  109. data/sig/dodopayments/models/product_update_params.rbs +3 -16
  110. data/sig/dodopayments/models/refund.rbs +3 -302
  111. data/sig/dodopayments/models/subscription.rbs +11 -302
  112. data/sig/dodopayments/models/subscription_change_plan_params.rbs +17 -1
  113. data/sig/dodopayments/models/subscription_create_params.rbs +19 -302
  114. data/sig/dodopayments/models/subscription_create_response.rbs +4 -0
  115. data/sig/dodopayments/models/subscription_list_response.rbs +98 -0
  116. data/sig/dodopayments/models/subscription_update_params.rbs +14 -0
  117. data/sig/dodopayments/models/tax_category.rbs +16 -0
  118. data/sig/dodopayments/models.rbs +165 -0
  119. data/sig/dodopayments/resources/addons.rbs +43 -0
  120. data/sig/dodopayments/resources/disputes.rbs +2 -2
  121. data/sig/dodopayments/resources/invoices/payments.rbs +1 -1
  122. data/sig/dodopayments/resources/payments.rbs +1 -1
  123. data/sig/dodopayments/resources/products.rbs +2 -2
  124. data/sig/dodopayments/resources/subscriptions.rbs +5 -2
  125. metadata +49 -4
@@ -0,0 +1,190 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ class SubscriptionListResponse < Dodopayments::Internal::Type::BaseModel
6
+ sig { returns(Dodopayments::Models::BillingAddress) }
7
+ attr_reader :billing
8
+
9
+ sig { params(billing: T.any(Dodopayments::Models::BillingAddress, Dodopayments::Internal::AnyHash)).void }
10
+ attr_writer :billing
11
+
12
+ # Timestamp when the subscription was created
13
+ sig { returns(Time) }
14
+ attr_accessor :created_at
15
+
16
+ sig { returns(Dodopayments::Models::Currency::TaggedSymbol) }
17
+ attr_accessor :currency
18
+
19
+ sig { returns(Dodopayments::Models::CustomerLimitedDetails) }
20
+ attr_reader :customer
21
+
22
+ sig do
23
+ params(customer: T.any(Dodopayments::Models::CustomerLimitedDetails, Dodopayments::Internal::AnyHash)).void
24
+ end
25
+ attr_writer :customer
26
+
27
+ sig { returns(T::Hash[Symbol, String]) }
28
+ attr_accessor :metadata
29
+
30
+ # Timestamp of the next scheduled billing. Indicates the end of current billing
31
+ # period
32
+ sig { returns(Time) }
33
+ attr_accessor :next_billing_date
34
+
35
+ # Wether the subscription is on-demand or not
36
+ sig { returns(T::Boolean) }
37
+ attr_accessor :on_demand
38
+
39
+ # Number of payment frequency intervals
40
+ sig { returns(Integer) }
41
+ attr_accessor :payment_frequency_count
42
+
43
+ sig { returns(Dodopayments::Models::TimeInterval::TaggedSymbol) }
44
+ attr_accessor :payment_frequency_interval
45
+
46
+ # Timestamp of the last payment. Indicates the start of current billing period
47
+ sig { returns(Time) }
48
+ attr_accessor :previous_billing_date
49
+
50
+ # Identifier of the product associated with this subscription
51
+ sig { returns(String) }
52
+ attr_accessor :product_id
53
+
54
+ # Number of units/items included in the subscription
55
+ sig { returns(Integer) }
56
+ attr_accessor :quantity
57
+
58
+ # Amount charged before tax for each recurring payment in smallest currency unit
59
+ # (e.g. cents)
60
+ sig { returns(Integer) }
61
+ attr_accessor :recurring_pre_tax_amount
62
+
63
+ sig { returns(Dodopayments::Models::SubscriptionStatus::TaggedSymbol) }
64
+ attr_accessor :status
65
+
66
+ # Unique identifier for the subscription
67
+ sig { returns(String) }
68
+ attr_accessor :subscription_id
69
+
70
+ # Number of subscription period intervals
71
+ sig { returns(Integer) }
72
+ attr_accessor :subscription_period_count
73
+
74
+ sig { returns(Dodopayments::Models::TimeInterval::TaggedSymbol) }
75
+ attr_accessor :subscription_period_interval
76
+
77
+ # Indicates if the recurring_pre_tax_amount is tax inclusive
78
+ sig { returns(T::Boolean) }
79
+ attr_accessor :tax_inclusive
80
+
81
+ # Number of days in the trial period (0 if no trial)
82
+ sig { returns(Integer) }
83
+ attr_accessor :trial_period_days
84
+
85
+ # Cancelled timestamp if the subscription is cancelled
86
+ sig { returns(T.nilable(Time)) }
87
+ attr_accessor :cancelled_at
88
+
89
+ # The discount id if discount is applied
90
+ sig { returns(T.nilable(String)) }
91
+ attr_accessor :discount_id
92
+
93
+ # Response struct representing subscription details
94
+ sig do
95
+ params(
96
+ billing: T.any(Dodopayments::Models::BillingAddress, Dodopayments::Internal::AnyHash),
97
+ created_at: Time,
98
+ currency: Dodopayments::Models::Currency::OrSymbol,
99
+ customer: T.any(Dodopayments::Models::CustomerLimitedDetails, Dodopayments::Internal::AnyHash),
100
+ metadata: T::Hash[Symbol, String],
101
+ next_billing_date: Time,
102
+ on_demand: T::Boolean,
103
+ payment_frequency_count: Integer,
104
+ payment_frequency_interval: Dodopayments::Models::TimeInterval::OrSymbol,
105
+ previous_billing_date: Time,
106
+ product_id: String,
107
+ quantity: Integer,
108
+ recurring_pre_tax_amount: Integer,
109
+ status: Dodopayments::Models::SubscriptionStatus::OrSymbol,
110
+ subscription_id: String,
111
+ subscription_period_count: Integer,
112
+ subscription_period_interval: Dodopayments::Models::TimeInterval::OrSymbol,
113
+ tax_inclusive: T::Boolean,
114
+ trial_period_days: Integer,
115
+ cancelled_at: T.nilable(Time),
116
+ discount_id: T.nilable(String)
117
+ )
118
+ .returns(T.attached_class)
119
+ end
120
+ def self.new(
121
+ billing:,
122
+ # Timestamp when the subscription was created
123
+ created_at:,
124
+ currency:,
125
+ customer:,
126
+ metadata:,
127
+ # Timestamp of the next scheduled billing. Indicates the end of current billing
128
+ # period
129
+ next_billing_date:,
130
+ # Wether the subscription is on-demand or not
131
+ on_demand:,
132
+ # Number of payment frequency intervals
133
+ payment_frequency_count:,
134
+ payment_frequency_interval:,
135
+ # Timestamp of the last payment. Indicates the start of current billing period
136
+ previous_billing_date:,
137
+ # Identifier of the product associated with this subscription
138
+ product_id:,
139
+ # Number of units/items included in the subscription
140
+ quantity:,
141
+ # Amount charged before tax for each recurring payment in smallest currency unit
142
+ # (e.g. cents)
143
+ recurring_pre_tax_amount:,
144
+ status:,
145
+ # Unique identifier for the subscription
146
+ subscription_id:,
147
+ # Number of subscription period intervals
148
+ subscription_period_count:,
149
+ subscription_period_interval:,
150
+ # Indicates if the recurring_pre_tax_amount is tax inclusive
151
+ tax_inclusive:,
152
+ # Number of days in the trial period (0 if no trial)
153
+ trial_period_days:,
154
+ # Cancelled timestamp if the subscription is cancelled
155
+ cancelled_at: nil,
156
+ # The discount id if discount is applied
157
+ discount_id: nil
158
+ ); end
159
+ sig do
160
+ override
161
+ .returns(
162
+ {
163
+ billing: Dodopayments::Models::BillingAddress,
164
+ created_at: Time,
165
+ currency: Dodopayments::Models::Currency::TaggedSymbol,
166
+ customer: Dodopayments::Models::CustomerLimitedDetails,
167
+ metadata: T::Hash[Symbol, String],
168
+ next_billing_date: Time,
169
+ on_demand: T::Boolean,
170
+ payment_frequency_count: Integer,
171
+ payment_frequency_interval: Dodopayments::Models::TimeInterval::TaggedSymbol,
172
+ previous_billing_date: Time,
173
+ product_id: String,
174
+ quantity: Integer,
175
+ recurring_pre_tax_amount: Integer,
176
+ status: Dodopayments::Models::SubscriptionStatus::TaggedSymbol,
177
+ subscription_id: String,
178
+ subscription_period_count: Integer,
179
+ subscription_period_interval: Dodopayments::Models::TimeInterval::TaggedSymbol,
180
+ tax_inclusive: T::Boolean,
181
+ trial_period_days: Integer,
182
+ cancelled_at: T.nilable(Time),
183
+ discount_id: T.nilable(String)
184
+ }
185
+ )
186
+ end
187
+ def to_hash; end
188
+ end
189
+ end
190
+ end
@@ -15,6 +15,19 @@ module Dodopayments
15
15
  end
16
16
  attr_writer :billing
17
17
 
18
+ sig { returns(T.nilable(Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand)) }
19
+ attr_reader :disable_on_demand
20
+
21
+ sig do
22
+ params(
23
+ disable_on_demand: T.nilable(
24
+ T.any(Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand, Dodopayments::Internal::AnyHash)
25
+ )
26
+ )
27
+ .void
28
+ end
29
+ attr_writer :disable_on_demand
30
+
18
31
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
19
32
  attr_accessor :metadata
20
33
 
@@ -27,6 +40,9 @@ module Dodopayments
27
40
  sig do
28
41
  params(
29
42
  billing: T.nilable(T.any(Dodopayments::Models::BillingAddress, Dodopayments::Internal::AnyHash)),
43
+ disable_on_demand: T.nilable(
44
+ T.any(Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand, Dodopayments::Internal::AnyHash)
45
+ ),
30
46
  metadata: T.nilable(T::Hash[Symbol, String]),
31
47
  status: T.nilable(Dodopayments::Models::SubscriptionStatus::OrSymbol),
32
48
  tax_id: T.nilable(String),
@@ -34,13 +50,22 @@ module Dodopayments
34
50
  )
35
51
  .returns(T.attached_class)
36
52
  end
37
- def self.new(billing: nil, metadata: nil, status: nil, tax_id: nil, request_options: {}); end
53
+ def self.new(
54
+ billing: nil,
55
+ disable_on_demand: nil,
56
+ metadata: nil,
57
+ status: nil,
58
+ tax_id: nil,
59
+ request_options: {}
60
+ )
61
+ end
38
62
 
39
63
  sig do
40
64
  override
41
65
  .returns(
42
66
  {
43
67
  billing: T.nilable(Dodopayments::Models::BillingAddress),
68
+ disable_on_demand: T.nilable(Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand),
44
69
  metadata: T.nilable(T::Hash[Symbol, String]),
45
70
  status: T.nilable(Dodopayments::Models::SubscriptionStatus::OrSymbol),
46
71
  tax_id: T.nilable(String),
@@ -49,6 +74,17 @@ module Dodopayments
49
74
  )
50
75
  end
51
76
  def to_hash; end
77
+
78
+ class DisableOnDemand < Dodopayments::Internal::Type::BaseModel
79
+ sig { returns(Time) }
80
+ attr_accessor :next_billing_date
81
+
82
+ sig { params(next_billing_date: Time).returns(T.attached_class) }
83
+ def self.new(next_billing_date:); end
84
+
85
+ sig { override.returns({next_billing_date: Time}) }
86
+ def to_hash; end
87
+ end
52
88
  end
53
89
  end
54
90
  end
@@ -0,0 +1,22 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # Represents the different categories of taxation applicable to various products
6
+ # and services.
7
+ module TaxCategory
8
+ extend Dodopayments::Internal::Type::Enum
9
+
10
+ TaggedSymbol = T.type_alias { T.all(Symbol, Dodopayments::Models::TaxCategory) }
11
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
12
+
13
+ DIGITAL_PRODUCTS = T.let(:digital_products, Dodopayments::Models::TaxCategory::TaggedSymbol)
14
+ SAAS = T.let(:saas, Dodopayments::Models::TaxCategory::TaggedSymbol)
15
+ E_BOOK = T.let(:e_book, Dodopayments::Models::TaxCategory::TaggedSymbol)
16
+ EDTECH = T.let(:edtech, Dodopayments::Models::TaxCategory::TaggedSymbol)
17
+
18
+ sig { override.returns(T::Array[Dodopayments::Models::TaxCategory::TaggedSymbol]) }
19
+ def self.values; end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,167 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ AddonCartResponseItem = Dodopayments::Models::AddonCartResponseItem
5
+
6
+ AddonCreateParams = Dodopayments::Models::AddonCreateParams
7
+
8
+ AddonListParams = Dodopayments::Models::AddonListParams
9
+
10
+ AddonResponse = Dodopayments::Models::AddonResponse
11
+
12
+ AddonRetrieveParams = Dodopayments::Models::AddonRetrieveParams
13
+
14
+ AddonUpdateImagesParams = Dodopayments::Models::AddonUpdateImagesParams
15
+
16
+ AddonUpdateParams = Dodopayments::Models::AddonUpdateParams
17
+
18
+ AttachExistingCustomer = Dodopayments::Models::AttachExistingCustomer
19
+
20
+ BillingAddress = Dodopayments::Models::BillingAddress
21
+
22
+ CountryCode = Dodopayments::Models::CountryCode
23
+
24
+ CreateNewCustomer = Dodopayments::Models::CreateNewCustomer
25
+
26
+ Currency = Dodopayments::Models::Currency
27
+
28
+ Customer = Dodopayments::Models::Customer
29
+
30
+ CustomerCreateParams = Dodopayments::Models::CustomerCreateParams
31
+
32
+ CustomerLimitedDetails = Dodopayments::Models::CustomerLimitedDetails
33
+
34
+ CustomerListParams = Dodopayments::Models::CustomerListParams
35
+
36
+ CustomerPortalSession = Dodopayments::Models::CustomerPortalSession
37
+
38
+ CustomerRequest = Dodopayments::Models::CustomerRequest
39
+
40
+ CustomerRetrieveParams = Dodopayments::Models::CustomerRetrieveParams
41
+
42
+ Customers = Dodopayments::Models::Customers
43
+
44
+ CustomerUpdateParams = Dodopayments::Models::CustomerUpdateParams
45
+
46
+ Discount = Dodopayments::Models::Discount
47
+
48
+ DiscountCreateParams = Dodopayments::Models::DiscountCreateParams
49
+
50
+ DiscountDeleteParams = Dodopayments::Models::DiscountDeleteParams
51
+
52
+ DiscountListParams = Dodopayments::Models::DiscountListParams
53
+
54
+ DiscountRetrieveParams = Dodopayments::Models::DiscountRetrieveParams
55
+
56
+ DiscountType = Dodopayments::Models::DiscountType
57
+
58
+ DiscountUpdateParams = Dodopayments::Models::DiscountUpdateParams
59
+
60
+ Dispute = Dodopayments::Models::Dispute
61
+
62
+ DisputeListParams = Dodopayments::Models::DisputeListParams
63
+
64
+ DisputeRetrieveParams = Dodopayments::Models::DisputeRetrieveParams
65
+
66
+ DisputeStage = Dodopayments::Models::DisputeStage
67
+
68
+ DisputeStatus = Dodopayments::Models::DisputeStatus
69
+
70
+ IntentStatus = Dodopayments::Models::IntentStatus
71
+
72
+ Invoices = Dodopayments::Models::Invoices
73
+
74
+ LicenseActivateParams = Dodopayments::Models::LicenseActivateParams
75
+
76
+ LicenseDeactivateParams = Dodopayments::Models::LicenseDeactivateParams
77
+
78
+ LicenseKey = Dodopayments::Models::LicenseKey
79
+
80
+ LicenseKeyDuration = Dodopayments::Models::LicenseKeyDuration
81
+
82
+ LicenseKeyInstance = Dodopayments::Models::LicenseKeyInstance
83
+
84
+ LicenseKeyInstanceListParams = Dodopayments::Models::LicenseKeyInstanceListParams
85
+
86
+ LicenseKeyInstanceRetrieveParams = Dodopayments::Models::LicenseKeyInstanceRetrieveParams
87
+
88
+ LicenseKeyInstanceUpdateParams = Dodopayments::Models::LicenseKeyInstanceUpdateParams
89
+
90
+ LicenseKeyListParams = Dodopayments::Models::LicenseKeyListParams
91
+
92
+ LicenseKeyRetrieveParams = Dodopayments::Models::LicenseKeyRetrieveParams
93
+
94
+ LicenseKeyStatus = Dodopayments::Models::LicenseKeyStatus
95
+
96
+ LicenseKeyUpdateParams = Dodopayments::Models::LicenseKeyUpdateParams
97
+
98
+ LicenseValidateParams = Dodopayments::Models::LicenseValidateParams
99
+
100
+ MiscListSupportedCountriesParams = Dodopayments::Models::MiscListSupportedCountriesParams
101
+
102
+ OneTimeProductCartItem = Dodopayments::Models::OneTimeProductCartItem
103
+
104
+ Payment = Dodopayments::Models::Payment
105
+
106
+ PaymentCreateParams = Dodopayments::Models::PaymentCreateParams
107
+
108
+ PaymentListParams = Dodopayments::Models::PaymentListParams
109
+
110
+ PaymentRetrieveParams = Dodopayments::Models::PaymentRetrieveParams
111
+
112
+ PayoutListParams = Dodopayments::Models::PayoutListParams
113
+
114
+ Price = Dodopayments::Models::Price
115
+
116
+ Product = Dodopayments::Models::Product
117
+
118
+ ProductCreateParams = Dodopayments::Models::ProductCreateParams
119
+
120
+ ProductDeleteParams = Dodopayments::Models::ProductDeleteParams
121
+
122
+ ProductListParams = Dodopayments::Models::ProductListParams
123
+
124
+ ProductRetrieveParams = Dodopayments::Models::ProductRetrieveParams
125
+
126
+ Products = Dodopayments::Models::Products
127
+
128
+ ProductUnarchiveParams = Dodopayments::Models::ProductUnarchiveParams
129
+
130
+ ProductUpdateParams = Dodopayments::Models::ProductUpdateParams
131
+
132
+ Refund = Dodopayments::Models::Refund
133
+
134
+ RefundCreateParams = Dodopayments::Models::RefundCreateParams
135
+
136
+ RefundListParams = Dodopayments::Models::RefundListParams
137
+
138
+ RefundRetrieveParams = Dodopayments::Models::RefundRetrieveParams
139
+
140
+ RefundStatus = Dodopayments::Models::RefundStatus
141
+
142
+ Subscription = Dodopayments::Models::Subscription
143
+
144
+ SubscriptionChangePlanParams = Dodopayments::Models::SubscriptionChangePlanParams
145
+
146
+ SubscriptionChargeParams = Dodopayments::Models::SubscriptionChargeParams
147
+
148
+ SubscriptionCreateParams = Dodopayments::Models::SubscriptionCreateParams
149
+
150
+ SubscriptionListParams = Dodopayments::Models::SubscriptionListParams
151
+
152
+ SubscriptionRetrieveParams = Dodopayments::Models::SubscriptionRetrieveParams
153
+
154
+ SubscriptionStatus = Dodopayments::Models::SubscriptionStatus
155
+
156
+ SubscriptionUpdateParams = Dodopayments::Models::SubscriptionUpdateParams
157
+
158
+ TaxCategory = Dodopayments::Models::TaxCategory
159
+
160
+ TimeInterval = Dodopayments::Models::TimeInterval
161
+
162
+ WebhookEvent = Dodopayments::Models::WebhookEvent
163
+
164
+ WebhookEventListParams = Dodopayments::Models::WebhookEventListParams
165
+
166
+ WebhookEventRetrieveParams = Dodopayments::Models::WebhookEventRetrieveParams
167
+ end
@@ -0,0 +1,97 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class Addons
6
+ sig do
7
+ params(
8
+ currency: Dodopayments::Models::Currency::OrSymbol,
9
+ name: String,
10
+ price: Integer,
11
+ tax_category: Dodopayments::Models::TaxCategory::OrSymbol,
12
+ description: T.nilable(String),
13
+ request_options: Dodopayments::RequestOpts
14
+ )
15
+ .returns(Dodopayments::Models::AddonResponse)
16
+ end
17
+ def create(
18
+ currency:,
19
+ # Name of the Addon
20
+ name:,
21
+ # Amount of the addon
22
+ price:,
23
+ # Represents the different categories of taxation applicable to various products
24
+ # and services.
25
+ tax_category:,
26
+ # Optional description of the Addon
27
+ description: nil,
28
+ request_options: {}
29
+ ); end
30
+ sig do
31
+ params(id: String, request_options: Dodopayments::RequestOpts).returns(Dodopayments::Models::AddonResponse)
32
+ end
33
+ def retrieve(
34
+ # Addon Id
35
+ id,
36
+ request_options: {}
37
+ ); end
38
+ sig do
39
+ params(
40
+ id: String,
41
+ currency: T.nilable(Dodopayments::Models::Currency::OrSymbol),
42
+ description: T.nilable(String),
43
+ image_id: T.nilable(String),
44
+ name: T.nilable(String),
45
+ price: T.nilable(Integer),
46
+ tax_category: T.nilable(Dodopayments::Models::TaxCategory::OrSymbol),
47
+ request_options: Dodopayments::RequestOpts
48
+ )
49
+ .returns(Dodopayments::Models::AddonResponse)
50
+ end
51
+ def update(
52
+ # Addon Id
53
+ id,
54
+ currency: nil,
55
+ # Description of the Addon, optional and must be at most 1000 characters.
56
+ description: nil,
57
+ # Addon image id after its uploaded to S3
58
+ image_id: nil,
59
+ # Name of the Addon, optional and must be at most 100 characters.
60
+ name: nil,
61
+ # Amount of the addon
62
+ price: nil,
63
+ # Represents the different categories of taxation applicable to various products
64
+ # and services.
65
+ tax_category: nil,
66
+ request_options: {}
67
+ ); end
68
+ sig do
69
+ params(
70
+ page_number: T.nilable(Integer),
71
+ page_size: T.nilable(Integer),
72
+ request_options: Dodopayments::RequestOpts
73
+ )
74
+ .returns(Dodopayments::Internal::DefaultPageNumberPagination[Dodopayments::Models::AddonResponse])
75
+ end
76
+ def list(
77
+ # Page number default is 0
78
+ page_number: nil,
79
+ # Page size default is 10 max is 100
80
+ page_size: nil,
81
+ request_options: {}
82
+ ); end
83
+ sig do
84
+ params(id: String, request_options: Dodopayments::RequestOpts)
85
+ .returns(Dodopayments::Models::AddonUpdateImagesResponse)
86
+ end
87
+ def update_images(
88
+ # Addon Id
89
+ id,
90
+ request_options: {}
91
+ ); end
92
+ # @api private
93
+ sig { params(client: Dodopayments::Client).returns(T.attached_class) }
94
+ def self.new(client:); end
95
+ end
96
+ end
97
+ end
@@ -5,7 +5,7 @@ module Dodopayments
5
5
  class Disputes
6
6
  sig do
7
7
  params(dispute_id: String, request_options: Dodopayments::RequestOpts)
8
- .returns(Dodopayments::Models::Dispute)
8
+ .returns(Dodopayments::Models::DisputeRetrieveResponse)
9
9
  end
10
10
  def retrieve(
11
11
  # Dispute Id
@@ -23,7 +23,7 @@ module Dodopayments
23
23
  page_size: T.nilable(Integer),
24
24
  request_options: Dodopayments::RequestOpts
25
25
  )
26
- .returns(Dodopayments::Internal::DefaultPageNumberPagination[Dodopayments::Models::Dispute])
26
+ .returns(Dodopayments::Internal::DefaultPageNumberPagination[Dodopayments::Models::DisputeListResponse])
27
27
  end
28
28
  def list(
29
29
  # Get events after this created time
@@ -4,7 +4,7 @@ module Dodopayments
4
4
  module Resources
5
5
  class Invoices
6
6
  class Payments
7
- sig { params(payment_id: String, request_options: Dodopayments::RequestOpts).void }
7
+ sig { params(payment_id: String, request_options: Dodopayments::RequestOpts).returns(StringIO) }
8
8
  def retrieve(payment_id, request_options: {}); end
9
9
 
10
10
  # @api private
@@ -13,7 +13,7 @@ module Dodopayments
13
13
  ),
14
14
  product_cart: T::Array[T.any(Dodopayments::Models::OneTimeProductCartItem, Dodopayments::Internal::AnyHash)],
15
15
  allowed_payment_method_types: T.nilable(T::Array[Dodopayments::Models::PaymentCreateParams::AllowedPaymentMethodType::OrSymbol]),
16
- billing_currency: T.nilable(Dodopayments::Models::PaymentCreateParams::BillingCurrency::OrSymbol),
16
+ billing_currency: T.nilable(Dodopayments::Models::Currency::OrSymbol),
17
17
  discount_code: T.nilable(String),
18
18
  metadata: T::Hash[Symbol, String],
19
19
  payment_link: T.nilable(T::Boolean),
@@ -13,7 +13,7 @@ module Dodopayments
13
13
  Dodopayments::Internal::AnyHash,
14
14
  Dodopayments::Models::Price::RecurringPrice
15
15
  ),
16
- tax_category: Dodopayments::Models::ProductCreateParams::TaxCategory::OrSymbol,
16
+ tax_category: Dodopayments::Models::TaxCategory::OrSymbol,
17
17
  addons: T.nilable(T::Array[String]),
18
18
  description: T.nilable(String),
19
19
  license_key_activation_message: T.nilable(String),
@@ -69,7 +69,7 @@ module Dodopayments
69
69
  Dodopayments::Models::Price::RecurringPrice
70
70
  )
71
71
  ),
72
- tax_category: T.nilable(Dodopayments::Models::ProductUpdateParams::TaxCategory::OrSymbol),
72
+ tax_category: T.nilable(Dodopayments::Models::TaxCategory::OrSymbol),
73
73
  request_options: Dodopayments::RequestOpts
74
74
  )
75
75
  .void
@@ -13,8 +13,11 @@ module Dodopayments
13
13
  ),
14
14
  product_id: String,
15
15
  quantity: Integer,
16
+ addons: T.nilable(
17
+ T::Array[T.any(Dodopayments::Models::SubscriptionCreateParams::Addon, Dodopayments::Internal::AnyHash)]
18
+ ),
16
19
  allowed_payment_method_types: T.nilable(T::Array[Dodopayments::Models::SubscriptionCreateParams::AllowedPaymentMethodType::OrSymbol]),
17
- billing_currency: T.nilable(Dodopayments::Models::SubscriptionCreateParams::BillingCurrency::OrSymbol),
20
+ billing_currency: T.nilable(Dodopayments::Models::Currency::OrSymbol),
18
21
  discount_code: T.nilable(String),
19
22
  metadata: T::Hash[Symbol, String],
20
23
  on_demand: T.nilable(
@@ -36,6 +39,8 @@ module Dodopayments
36
39
  product_id:,
37
40
  # Number of units to subscribe for. Must be at least 1.
38
41
  quantity:,
42
+ # Attach addons to this subscription
43
+ addons: nil,
39
44
  # List of payment methods allowed during checkout.
40
45
  #
41
46
  # Customers will **never** see payment methods that are **not** in this list.
@@ -75,6 +80,9 @@ module Dodopayments
75
80
  params(
76
81
  subscription_id: String,
77
82
  billing: T.nilable(T.any(Dodopayments::Models::BillingAddress, Dodopayments::Internal::AnyHash)),
83
+ disable_on_demand: T.nilable(
84
+ T.any(Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand, Dodopayments::Internal::AnyHash)
85
+ ),
78
86
  metadata: T.nilable(T::Hash[Symbol, String]),
79
87
  status: T.nilable(Dodopayments::Models::SubscriptionStatus::OrSymbol),
80
88
  tax_id: T.nilable(String),
@@ -86,6 +94,7 @@ module Dodopayments
86
94
  # Subscription Id
87
95
  subscription_id,
88
96
  billing: nil,
97
+ disable_on_demand: nil,
89
98
  metadata: nil,
90
99
  status: nil,
91
100
  tax_id: nil,
@@ -101,7 +110,9 @@ module Dodopayments
101
110
  status: T.nilable(Dodopayments::Models::SubscriptionStatus::OrSymbol),
102
111
  request_options: Dodopayments::RequestOpts
103
112
  )
104
- .returns(Dodopayments::Internal::DefaultPageNumberPagination[Dodopayments::Models::Subscription])
113
+ .returns(
114
+ Dodopayments::Internal::DefaultPageNumberPagination[Dodopayments::Models::SubscriptionListResponse]
115
+ )
105
116
  end
106
117
  def list(
107
118
  # Get events after this created time
@@ -124,6 +135,9 @@ module Dodopayments
124
135
  product_id: String,
125
136
  proration_billing_mode: Dodopayments::Models::SubscriptionChangePlanParams::ProrationBillingMode::OrSymbol,
126
137
  quantity: Integer,
138
+ addons: T.nilable(
139
+ T::Array[T.any(Dodopayments::Models::SubscriptionChangePlanParams::Addon, Dodopayments::Internal::AnyHash)]
140
+ ),
127
141
  request_options: Dodopayments::RequestOpts
128
142
  )
129
143
  .void
@@ -136,6 +150,9 @@ module Dodopayments
136
150
  proration_billing_mode:,
137
151
  # Number of units to subscribe for. Must be at least 1.
138
152
  quantity:,
153
+ # Addons for the new plan. Note : Leaving this empty would remove any existing
154
+ # addons
155
+ addons: nil,
139
156
  request_options: {}
140
157
  ); end
141
158
  sig do
@@ -43,6 +43,8 @@ module Dodopayments
43
43
 
44
44
  attr_reader discounts: Dodopayments::Resources::Discounts
45
45
 
46
+ attr_reader addons: Dodopayments::Resources::Addons
47
+
46
48
  private def auth_headers: -> ::Hash[String, String]
47
49
 
48
50
  def initialize: (
@@ -19,6 +19,8 @@ module Dodopayments
19
19
 
20
20
  def self?.coerce_hash: (top input) -> (::Hash[top, top] | top)
21
21
 
22
+ def self?.coerce_hash!: (top input) -> ::Hash[top, top]?
23
+
22
24
  def self?.deep_merge_lr: (top lhs, top rhs, ?concat: bool) -> top
23
25
 
24
26
  def self?.deep_merge: (