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,179 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Subscriptions#list
6
+ class SubscriptionListResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute billing
8
+ #
9
+ # @return [Dodopayments::Models::BillingAddress]
10
+ required :billing, -> { Dodopayments::Models::BillingAddress }
11
+
12
+ # @!attribute created_at
13
+ # Timestamp when the subscription was created
14
+ #
15
+ # @return [Time]
16
+ required :created_at, Time
17
+
18
+ # @!attribute currency
19
+ #
20
+ # @return [Symbol, Dodopayments::Models::Currency]
21
+ required :currency, enum: -> { Dodopayments::Models::Currency }
22
+
23
+ # @!attribute customer
24
+ #
25
+ # @return [Dodopayments::Models::CustomerLimitedDetails]
26
+ required :customer, -> { Dodopayments::Models::CustomerLimitedDetails }
27
+
28
+ # @!attribute metadata
29
+ #
30
+ # @return [Hash{Symbol=>String}]
31
+ required :metadata, Dodopayments::Internal::Type::HashOf[String]
32
+
33
+ # @!attribute next_billing_date
34
+ # Timestamp of the next scheduled billing. Indicates the end of current billing
35
+ # period
36
+ #
37
+ # @return [Time]
38
+ required :next_billing_date, Time
39
+
40
+ # @!attribute on_demand
41
+ # Wether the subscription is on-demand or not
42
+ #
43
+ # @return [Boolean]
44
+ required :on_demand, Dodopayments::Internal::Type::Boolean
45
+
46
+ # @!attribute payment_frequency_count
47
+ # Number of payment frequency intervals
48
+ #
49
+ # @return [Integer]
50
+ required :payment_frequency_count, Integer
51
+
52
+ # @!attribute payment_frequency_interval
53
+ #
54
+ # @return [Symbol, Dodopayments::Models::TimeInterval]
55
+ required :payment_frequency_interval, enum: -> { Dodopayments::Models::TimeInterval }
56
+
57
+ # @!attribute previous_billing_date
58
+ # Timestamp of the last payment. Indicates the start of current billing period
59
+ #
60
+ # @return [Time]
61
+ required :previous_billing_date, Time
62
+
63
+ # @!attribute product_id
64
+ # Identifier of the product associated with this subscription
65
+ #
66
+ # @return [String]
67
+ required :product_id, String
68
+
69
+ # @!attribute quantity
70
+ # Number of units/items included in the subscription
71
+ #
72
+ # @return [Integer]
73
+ required :quantity, Integer
74
+
75
+ # @!attribute recurring_pre_tax_amount
76
+ # Amount charged before tax for each recurring payment in smallest currency unit
77
+ # (e.g. cents)
78
+ #
79
+ # @return [Integer]
80
+ required :recurring_pre_tax_amount, Integer
81
+
82
+ # @!attribute status
83
+ #
84
+ # @return [Symbol, Dodopayments::Models::SubscriptionStatus]
85
+ required :status, enum: -> { Dodopayments::Models::SubscriptionStatus }
86
+
87
+ # @!attribute subscription_id
88
+ # Unique identifier for the subscription
89
+ #
90
+ # @return [String]
91
+ required :subscription_id, String
92
+
93
+ # @!attribute subscription_period_count
94
+ # Number of subscription period intervals
95
+ #
96
+ # @return [Integer]
97
+ required :subscription_period_count, Integer
98
+
99
+ # @!attribute subscription_period_interval
100
+ #
101
+ # @return [Symbol, Dodopayments::Models::TimeInterval]
102
+ required :subscription_period_interval, enum: -> { Dodopayments::Models::TimeInterval }
103
+
104
+ # @!attribute tax_inclusive
105
+ # Indicates if the recurring_pre_tax_amount is tax inclusive
106
+ #
107
+ # @return [Boolean]
108
+ required :tax_inclusive, Dodopayments::Internal::Type::Boolean
109
+
110
+ # @!attribute trial_period_days
111
+ # Number of days in the trial period (0 if no trial)
112
+ #
113
+ # @return [Integer]
114
+ required :trial_period_days, Integer
115
+
116
+ # @!attribute cancelled_at
117
+ # Cancelled timestamp if the subscription is cancelled
118
+ #
119
+ # @return [Time, nil]
120
+ optional :cancelled_at, Time, nil?: true
121
+
122
+ # @!attribute discount_id
123
+ # The discount id if discount is applied
124
+ #
125
+ # @return [String, nil]
126
+ optional :discount_id, String, nil?: true
127
+
128
+ # @!method initialize(billing:, created_at:, currency:, customer:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_id: nil)
129
+ # Some parameter documentations has been truncated, see
130
+ # {Dodopayments::Models::SubscriptionListResponse} for more details.
131
+ #
132
+ # Response struct representing subscription details
133
+ #
134
+ # @param billing [Dodopayments::Models::BillingAddress]
135
+ #
136
+ # @param created_at [Time] Timestamp when the subscription was created
137
+ #
138
+ # @param currency [Symbol, Dodopayments::Models::Currency]
139
+ #
140
+ # @param customer [Dodopayments::Models::CustomerLimitedDetails]
141
+ #
142
+ # @param metadata [Hash{Symbol=>String}]
143
+ #
144
+ # @param next_billing_date [Time] Timestamp of the next scheduled billing. Indicates the end of current billing pe
145
+ # ...
146
+ #
147
+ # @param on_demand [Boolean] Wether the subscription is on-demand or not
148
+ #
149
+ # @param payment_frequency_count [Integer] Number of payment frequency intervals
150
+ #
151
+ # @param payment_frequency_interval [Symbol, Dodopayments::Models::TimeInterval]
152
+ #
153
+ # @param previous_billing_date [Time] Timestamp of the last payment. Indicates the start of current billing period
154
+ #
155
+ # @param product_id [String] Identifier of the product associated with this subscription
156
+ #
157
+ # @param quantity [Integer] Number of units/items included in the subscription
158
+ #
159
+ # @param recurring_pre_tax_amount [Integer] Amount charged before tax for each recurring payment in smallest currency unit (
160
+ # ...
161
+ #
162
+ # @param status [Symbol, Dodopayments::Models::SubscriptionStatus]
163
+ #
164
+ # @param subscription_id [String] Unique identifier for the subscription
165
+ #
166
+ # @param subscription_period_count [Integer] Number of subscription period intervals
167
+ #
168
+ # @param subscription_period_interval [Symbol, Dodopayments::Models::TimeInterval]
169
+ #
170
+ # @param tax_inclusive [Boolean] Indicates if the recurring_pre_tax_amount is tax inclusive
171
+ #
172
+ # @param trial_period_days [Integer] Number of days in the trial period (0 if no trial)
173
+ #
174
+ # @param cancelled_at [Time, nil] Cancelled timestamp if the subscription is cancelled
175
+ #
176
+ # @param discount_id [String, nil] The discount id if discount is applied
177
+ end
178
+ end
179
+ end
@@ -12,6 +12,13 @@ module Dodopayments
12
12
  # @return [Dodopayments::Models::BillingAddress, nil]
13
13
  optional :billing, -> { Dodopayments::Models::BillingAddress }, nil?: true
14
14
 
15
+ # @!attribute disable_on_demand
16
+ #
17
+ # @return [Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand, nil]
18
+ optional :disable_on_demand,
19
+ -> { Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand },
20
+ nil?: true
21
+
15
22
  # @!attribute metadata
16
23
  #
17
24
  # @return [Hash{Symbol=>String}, nil]
@@ -27,12 +34,23 @@ module Dodopayments
27
34
  # @return [String, nil]
28
35
  optional :tax_id, String, nil?: true
29
36
 
30
- # @!method initialize(billing: nil, metadata: nil, status: nil, tax_id: nil, request_options: {})
37
+ # @!method initialize(billing: nil, disable_on_demand: nil, metadata: nil, status: nil, tax_id: nil, request_options: {})
31
38
  # @param billing [Dodopayments::Models::BillingAddress, nil]
39
+ # @param disable_on_demand [Dodopayments::Models::SubscriptionUpdateParams::DisableOnDemand, nil]
32
40
  # @param metadata [Hash{Symbol=>String}, nil]
33
41
  # @param status [Symbol, Dodopayments::Models::SubscriptionStatus, nil]
34
42
  # @param tax_id [String, nil]
35
43
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
44
+
45
+ class DisableOnDemand < Dodopayments::Internal::Type::BaseModel
46
+ # @!attribute next_billing_date
47
+ #
48
+ # @return [Time]
49
+ required :next_billing_date, Time
50
+
51
+ # @!method initialize(next_billing_date:)
52
+ # @param next_billing_date [Time]
53
+ end
36
54
  end
37
55
  end
38
56
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
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
+ DIGITAL_PRODUCTS = :digital_products
11
+ SAAS = :saas
12
+ E_BOOK = :e_book
13
+ EDTECH = :edtech
14
+
15
+ # @!method self.values
16
+ # @return [Array<Symbol>]
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,167 @@
1
+ # frozen_string_literal: true
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,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class Addons
6
+ # Some parameter documentations has been truncated, see
7
+ # {Dodopayments::Models::AddonCreateParams} for more details.
8
+ #
9
+ # @overload create(currency:, name:, price:, tax_category:, description: nil, request_options: {})
10
+ #
11
+ # @param currency [Symbol, Dodopayments::Models::Currency]
12
+ #
13
+ # @param name [String] Name of the Addon
14
+ #
15
+ # @param price [Integer] Amount of the addon
16
+ #
17
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
18
+ # ...
19
+ #
20
+ # @param description [String, nil] Optional description of the Addon
21
+ #
22
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
23
+ #
24
+ # @return [Dodopayments::Models::AddonResponse]
25
+ #
26
+ # @see Dodopayments::Models::AddonCreateParams
27
+ def create(params)
28
+ parsed, options = Dodopayments::Models::AddonCreateParams.dump_request(params)
29
+ @client.request(
30
+ method: :post,
31
+ path: "addons",
32
+ body: parsed,
33
+ model: Dodopayments::Models::AddonResponse,
34
+ options: options
35
+ )
36
+ end
37
+
38
+ # @overload retrieve(id, request_options: {})
39
+ #
40
+ # @param id [String] Addon Id
41
+ #
42
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
43
+ #
44
+ # @return [Dodopayments::Models::AddonResponse]
45
+ #
46
+ # @see Dodopayments::Models::AddonRetrieveParams
47
+ def retrieve(id, params = {})
48
+ @client.request(
49
+ method: :get,
50
+ path: ["addons/%1$s", id],
51
+ model: Dodopayments::Models::AddonResponse,
52
+ options: params[:request_options]
53
+ )
54
+ end
55
+
56
+ # Some parameter documentations has been truncated, see
57
+ # {Dodopayments::Models::AddonUpdateParams} for more details.
58
+ #
59
+ # @overload update(id, currency: nil, description: nil, image_id: nil, name: nil, price: nil, tax_category: nil, request_options: {})
60
+ #
61
+ # @param id [String] Addon Id
62
+ #
63
+ # @param currency [Symbol, Dodopayments::Models::Currency, nil]
64
+ #
65
+ # @param description [String, nil] Description of the Addon, optional and must be at most 1000 characters.
66
+ #
67
+ # @param image_id [String, nil] Addon image id after its uploaded to S3
68
+ #
69
+ # @param name [String, nil] Name of the Addon, optional and must be at most 100 characters.
70
+ #
71
+ # @param price [Integer, nil] Amount of the addon
72
+ #
73
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Represents the different categories of taxation applicable to various products a
74
+ # ...
75
+ #
76
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
77
+ #
78
+ # @return [Dodopayments::Models::AddonResponse]
79
+ #
80
+ # @see Dodopayments::Models::AddonUpdateParams
81
+ def update(id, params = {})
82
+ parsed, options = Dodopayments::Models::AddonUpdateParams.dump_request(params)
83
+ @client.request(
84
+ method: :patch,
85
+ path: ["addons/%1$s", id],
86
+ body: parsed,
87
+ model: Dodopayments::Models::AddonResponse,
88
+ options: options
89
+ )
90
+ end
91
+
92
+ # @overload list(page_number: nil, page_size: nil, request_options: {})
93
+ #
94
+ # @param page_number [Integer, nil] Page number default is 0
95
+ #
96
+ # @param page_size [Integer, nil] Page size default is 10 max is 100
97
+ #
98
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
99
+ #
100
+ # @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::AddonResponse>]
101
+ #
102
+ # @see Dodopayments::Models::AddonListParams
103
+ def list(params = {})
104
+ parsed, options = Dodopayments::Models::AddonListParams.dump_request(params)
105
+ @client.request(
106
+ method: :get,
107
+ path: "addons",
108
+ query: parsed,
109
+ page: Dodopayments::Internal::DefaultPageNumberPagination,
110
+ model: Dodopayments::Models::AddonResponse,
111
+ options: options
112
+ )
113
+ end
114
+
115
+ # @overload update_images(id, request_options: {})
116
+ #
117
+ # @param id [String] Addon Id
118
+ #
119
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
120
+ #
121
+ # @return [Dodopayments::Models::AddonUpdateImagesResponse]
122
+ #
123
+ # @see Dodopayments::Models::AddonUpdateImagesParams
124
+ def update_images(id, params = {})
125
+ @client.request(
126
+ method: :put,
127
+ path: ["addons/%1$s/images", id],
128
+ model: Dodopayments::Models::AddonUpdateImagesResponse,
129
+ options: params[:request_options]
130
+ )
131
+ end
132
+
133
+ # @api private
134
+ #
135
+ # @param client [Dodopayments::Client]
136
+ def initialize(client:)
137
+ @client = client
138
+ end
139
+ end
140
+ end
141
+ end
@@ -9,14 +9,14 @@ module Dodopayments
9
9
  #
10
10
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
11
11
  #
12
- # @return [Dodopayments::Models::Dispute]
12
+ # @return [Dodopayments::Models::DisputeRetrieveResponse]
13
13
  #
14
14
  # @see Dodopayments::Models::DisputeRetrieveParams
15
15
  def retrieve(dispute_id, params = {})
16
16
  @client.request(
17
17
  method: :get,
18
18
  path: ["disputes/%1$s", dispute_id],
19
- model: Dodopayments::Models::Dispute,
19
+ model: Dodopayments::Models::DisputeRetrieveResponse,
20
20
  options: params[:request_options]
21
21
  )
22
22
  end
@@ -39,7 +39,7 @@ module Dodopayments
39
39
  #
40
40
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
41
41
  #
42
- # @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::Dispute>]
42
+ # @return [Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::DisputeListResponse>]
43
43
  #
44
44
  # @see Dodopayments::Models::DisputeListParams
45
45
  def list(params = {})
@@ -49,7 +49,7 @@ module Dodopayments
49
49
  path: "disputes",
50
50
  query: parsed,
51
51
  page: Dodopayments::Internal::DefaultPageNumberPagination,
52
- model: Dodopayments::Models::Dispute,
52
+ model: Dodopayments::Models::DisputeListResponse,
53
53
  options: options
54
54
  )
55
55
  end
@@ -9,14 +9,15 @@ module Dodopayments
9
9
  # @param payment_id [String]
10
10
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
11
11
  #
12
- # @return [nil]
12
+ # @return [StringIO]
13
13
  #
14
14
  # @see Dodopayments::Models::Invoices::PaymentRetrieveParams
15
15
  def retrieve(payment_id, params = {})
16
16
  @client.request(
17
17
  method: :get,
18
18
  path: ["invoices/payments/%1$s", payment_id],
19
- model: NilClass,
19
+ headers: {"accept" => "application/pdf"},
20
+ model: StringIO,
20
21
  options: params[:request_options]
21
22
  )
22
23
  end
@@ -16,7 +16,7 @@ module Dodopayments
16
16
  #
17
17
  # @param allowed_payment_method_types [Array<Symbol, Dodopayments::Models::PaymentCreateParams::AllowedPaymentMethodType>, nil] List of payment methods allowed during checkout. ...
18
18
  #
19
- # @param billing_currency [Symbol, Dodopayments::Models::PaymentCreateParams::BillingCurrency, nil]
19
+ # @param billing_currency [Symbol, Dodopayments::Models::Currency, nil]
20
20
  #
21
21
  # @param discount_code [String, nil] Discount Code to apply to the transaction
22
22
  #
@@ -13,7 +13,7 @@ module Dodopayments
13
13
  #
14
14
  # @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice]
15
15
  #
16
- # @param tax_category [Symbol, Dodopayments::Models::ProductCreateParams::TaxCategory] Represents the different categories of taxation applicable to various products a
16
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
17
17
  # ...
18
18
  #
19
19
  # @param addons [Array<String>, nil] Addons available for subscription product
@@ -89,7 +89,7 @@ module Dodopayments
89
89
  #
90
90
  # @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, nil]
91
91
  #
92
- # @param tax_category [Symbol, Dodopayments::Models::ProductUpdateParams::TaxCategory, nil] Represents the different categories of taxation applicable to various products a
92
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Represents the different categories of taxation applicable to various products a
93
93
  # ...
94
94
  #
95
95
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]