dodopayments 1.19.0 → 1.20.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/README.md +5 -5
- data/lib/dodopayments/client.rb +12 -9
- data/lib/dodopayments/internal/transport/base_client.rb +1 -1
- data/lib/dodopayments/internal/util.rb +3 -3
- data/lib/dodopayments/models/addon_cart_response_item.rb +23 -0
- data/lib/dodopayments/models/addon_create_params.rb +58 -0
- data/lib/dodopayments/models/addon_list_params.rb +30 -0
- data/lib/dodopayments/models/addon_response.rb +93 -0
- data/lib/dodopayments/models/addon_retrieve_params.rb +14 -0
- data/lib/dodopayments/models/addon_update_images_params.rb +14 -0
- data/lib/dodopayments/models/addon_update_images_response.rb +22 -0
- data/lib/dodopayments/models/addon_update_params.rb +66 -0
- data/lib/dodopayments/models/currency.rb +158 -0
- data/lib/dodopayments/models/payment.rb +14 -315
- data/lib/dodopayments/models/payment_create_params.rb +3 -158
- data/lib/dodopayments/models/payment_list_response.rb +3 -157
- data/lib/dodopayments/models/payout_list_response.rb +3 -157
- data/lib/dodopayments/models/price.rb +6 -314
- data/lib/dodopayments/models/product.rb +3 -19
- data/lib/dodopayments/models/product_create_params.rb +3 -17
- data/lib/dodopayments/models/product_list_response.rb +6 -176
- data/lib/dodopayments/models/product_update_params.rb +3 -17
- data/lib/dodopayments/models/refund.rb +3 -157
- data/lib/dodopayments/models/subscription.rb +21 -158
- data/lib/dodopayments/models/subscription_create_params.rb +30 -159
- data/lib/dodopayments/models/subscription_create_response.rb +10 -1
- data/lib/dodopayments/models/subscription_list_response.rb +179 -0
- data/lib/dodopayments/models/subscription_update_params.rb +19 -1
- data/lib/dodopayments/models/tax_category.rb +19 -0
- data/lib/dodopayments/resources/addons.rb +141 -0
- data/lib/dodopayments/resources/payments.rb +1 -1
- data/lib/dodopayments/resources/products.rb +2 -2
- data/lib/dodopayments/resources/subscriptions.rb +9 -5
- data/lib/dodopayments/version.rb +1 -1
- data/lib/dodopayments.rb +12 -0
- data/rbi/dodopayments/client.rbi +7 -5
- data/rbi/dodopayments/errors.rbi +1 -1
- data/rbi/dodopayments/models/addon_cart_response_item.rbi +20 -0
- data/rbi/dodopayments/models/addon_create_params.rbi +69 -0
- data/rbi/dodopayments/models/addon_list_params.rbi +45 -0
- data/rbi/dodopayments/models/addon_response.rbi +103 -0
- data/rbi/dodopayments/models/addon_retrieve_params.rbi +19 -0
- data/rbi/dodopayments/models/addon_update_images_params.rbi +19 -0
- data/rbi/dodopayments/models/addon_update_images_response.rbi +19 -0
- data/rbi/dodopayments/models/addon_update_params.rbi +77 -0
- data/rbi/dodopayments/models/currency.rbi +161 -0
- data/rbi/dodopayments/models/payment.rbi +15 -318
- data/rbi/dodopayments/models/payment_create_params.rbi +3 -159
- data/rbi/dodopayments/models/payment_list_response.rbi +3 -159
- data/rbi/dodopayments/models/payout_list_response.rbi +3 -159
- data/rbi/dodopayments/models/price.rbi +6 -318
- data/rbi/dodopayments/models/product.rbi +3 -20
- data/rbi/dodopayments/models/product_create_params.rbi +3 -21
- data/rbi/dodopayments/models/product_list_response.rbi +6 -180
- data/rbi/dodopayments/models/product_update_params.rbi +3 -21
- data/rbi/dodopayments/models/refund.rbi +3 -159
- data/rbi/dodopayments/models/subscription.rbi +19 -159
- data/rbi/dodopayments/models/subscription_create_params.rbi +27 -160
- data/rbi/dodopayments/models/subscription_create_response.rbi +8 -0
- data/rbi/dodopayments/models/subscription_list_response.rbi +190 -0
- data/rbi/dodopayments/models/subscription_update_params.rbi +37 -1
- data/rbi/dodopayments/models/tax_category.rbi +22 -0
- data/rbi/dodopayments/resources/addons.rbi +97 -0
- data/rbi/dodopayments/resources/payments.rbi +1 -1
- data/rbi/dodopayments/resources/products.rbi +2 -2
- data/rbi/dodopayments/resources/subscriptions.rbi +13 -2
- data/sig/dodopayments/client.rbs +4 -2
- data/sig/dodopayments/models/addon_cart_response_item.rbs +15 -0
- data/sig/dodopayments/models/addon_create_params.rbs +39 -0
- data/sig/dodopayments/models/addon_list_params.rbs +24 -0
- data/sig/dodopayments/models/addon_response.rbs +54 -0
- data/sig/dodopayments/models/addon_retrieve_params.rbs +15 -0
- data/sig/dodopayments/models/addon_update_images_params.rbs +15 -0
- data/sig/dodopayments/models/addon_update_images_response.rbs +15 -0
- data/sig/dodopayments/models/addon_update_params.rbs +43 -0
- data/sig/dodopayments/models/currency.rbs +302 -0
- data/sig/dodopayments/models/payment.rbs +10 -604
- data/sig/dodopayments/models/payment_create_params.rbs +3 -302
- data/sig/dodopayments/models/payment_list_response.rbs +3 -302
- data/sig/dodopayments/models/payout_list_response.rbs +3 -302
- data/sig/dodopayments/models/price.rbs +6 -604
- data/sig/dodopayments/models/product.rbs +3 -16
- data/sig/dodopayments/models/product_create_params.rbs +3 -16
- data/sig/dodopayments/models/product_list_response.rbs +6 -318
- data/sig/dodopayments/models/product_update_params.rbs +3 -16
- data/sig/dodopayments/models/refund.rbs +3 -302
- data/sig/dodopayments/models/subscription.rbs +11 -302
- data/sig/dodopayments/models/subscription_create_params.rbs +19 -302
- data/sig/dodopayments/models/subscription_create_response.rbs +4 -0
- data/sig/dodopayments/models/subscription_list_response.rbs +98 -0
- data/sig/dodopayments/models/subscription_update_params.rbs +14 -0
- data/sig/dodopayments/models/tax_category.rbs +16 -0
- data/sig/dodopayments/resources/addons.rbs +43 -0
- data/sig/dodopayments/resources/payments.rbs +1 -1
- data/sig/dodopayments/resources/products.rbs +2 -2
- data/sig/dodopayments/resources/subscriptions.rbs +4 -2
- metadata +40 -4
@@ -4,6 +4,13 @@ module Dodopayments
|
|
4
4
|
module Models
|
5
5
|
# @see Dodopayments::Resources::Subscriptions#retrieve
|
6
6
|
class Subscription < Dodopayments::Internal::Type::BaseModel
|
7
|
+
# @!attribute addons
|
8
|
+
# Addons associated with this subscription
|
9
|
+
#
|
10
|
+
# @return [Array<Dodopayments::Models::AddonCartResponseItem>]
|
11
|
+
required :addons,
|
12
|
+
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::AddonCartResponseItem] }
|
13
|
+
|
7
14
|
# @!attribute billing
|
8
15
|
#
|
9
16
|
# @return [Dodopayments::Models::BillingAddress]
|
@@ -17,8 +24,8 @@ module Dodopayments
|
|
17
24
|
|
18
25
|
# @!attribute currency
|
19
26
|
#
|
20
|
-
# @return [Symbol, Dodopayments::Models::
|
21
|
-
required :currency, enum: -> { Dodopayments::Models::
|
27
|
+
# @return [Symbol, Dodopayments::Models::Currency]
|
28
|
+
required :currency, enum: -> { Dodopayments::Models::Currency }
|
22
29
|
|
23
30
|
# @!attribute customer
|
24
31
|
#
|
@@ -37,6 +44,12 @@ module Dodopayments
|
|
37
44
|
# @return [Time]
|
38
45
|
required :next_billing_date, Time
|
39
46
|
|
47
|
+
# @!attribute on_demand
|
48
|
+
# Wether the subscription is on-demand or not
|
49
|
+
#
|
50
|
+
# @return [Boolean]
|
51
|
+
required :on_demand, Dodopayments::Internal::Type::Boolean
|
52
|
+
|
40
53
|
# @!attribute payment_frequency_count
|
41
54
|
# Number of payment frequency intervals
|
42
55
|
#
|
@@ -119,17 +132,19 @@ module Dodopayments
|
|
119
132
|
# @return [String, nil]
|
120
133
|
optional :discount_id, String, nil?: true
|
121
134
|
|
122
|
-
# @!method initialize(billing:, created_at:, currency:, customer:, metadata:, next_billing_date:, 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)
|
135
|
+
# @!method initialize(addons:, 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)
|
123
136
|
# Some parameter documentations has been truncated, see
|
124
137
|
# {Dodopayments::Models::Subscription} for more details.
|
125
138
|
#
|
126
139
|
# Response struct representing subscription details
|
127
140
|
#
|
141
|
+
# @param addons [Array<Dodopayments::Models::AddonCartResponseItem>] Addons associated with this subscription
|
142
|
+
#
|
128
143
|
# @param billing [Dodopayments::Models::BillingAddress]
|
129
144
|
#
|
130
145
|
# @param created_at [Time] Timestamp when the subscription was created
|
131
146
|
#
|
132
|
-
# @param currency [Symbol, Dodopayments::Models::
|
147
|
+
# @param currency [Symbol, Dodopayments::Models::Currency]
|
133
148
|
#
|
134
149
|
# @param customer [Dodopayments::Models::CustomerLimitedDetails]
|
135
150
|
#
|
@@ -138,6 +153,8 @@ module Dodopayments
|
|
138
153
|
# @param next_billing_date [Time] Timestamp of the next scheduled billing. Indicates the end of current billing pe
|
139
154
|
# ...
|
140
155
|
#
|
156
|
+
# @param on_demand [Boolean] Wether the subscription is on-demand or not
|
157
|
+
#
|
141
158
|
# @param payment_frequency_count [Integer] Number of payment frequency intervals
|
142
159
|
#
|
143
160
|
# @param payment_frequency_interval [Symbol, Dodopayments::Models::TimeInterval]
|
@@ -166,160 +183,6 @@ module Dodopayments
|
|
166
183
|
# @param cancelled_at [Time, nil] Cancelled timestamp if the subscription is cancelled
|
167
184
|
#
|
168
185
|
# @param discount_id [String, nil] The discount id if discount is applied
|
169
|
-
|
170
|
-
# @see Dodopayments::Models::Subscription#currency
|
171
|
-
module Currency
|
172
|
-
extend Dodopayments::Internal::Type::Enum
|
173
|
-
|
174
|
-
AED = :AED
|
175
|
-
ALL = :ALL
|
176
|
-
AMD = :AMD
|
177
|
-
ANG = :ANG
|
178
|
-
AOA = :AOA
|
179
|
-
ARS = :ARS
|
180
|
-
AUD = :AUD
|
181
|
-
AWG = :AWG
|
182
|
-
AZN = :AZN
|
183
|
-
BAM = :BAM
|
184
|
-
BBD = :BBD
|
185
|
-
BDT = :BDT
|
186
|
-
BGN = :BGN
|
187
|
-
BHD = :BHD
|
188
|
-
BIF = :BIF
|
189
|
-
BMD = :BMD
|
190
|
-
BND = :BND
|
191
|
-
BOB = :BOB
|
192
|
-
BRL = :BRL
|
193
|
-
BSD = :BSD
|
194
|
-
BWP = :BWP
|
195
|
-
BYN = :BYN
|
196
|
-
BZD = :BZD
|
197
|
-
CAD = :CAD
|
198
|
-
CHF = :CHF
|
199
|
-
CLP = :CLP
|
200
|
-
CNY = :CNY
|
201
|
-
COP = :COP
|
202
|
-
CRC = :CRC
|
203
|
-
CUP = :CUP
|
204
|
-
CVE = :CVE
|
205
|
-
CZK = :CZK
|
206
|
-
DJF = :DJF
|
207
|
-
DKK = :DKK
|
208
|
-
DOP = :DOP
|
209
|
-
DZD = :DZD
|
210
|
-
EGP = :EGP
|
211
|
-
ETB = :ETB
|
212
|
-
EUR = :EUR
|
213
|
-
FJD = :FJD
|
214
|
-
FKP = :FKP
|
215
|
-
GBP = :GBP
|
216
|
-
GEL = :GEL
|
217
|
-
GHS = :GHS
|
218
|
-
GIP = :GIP
|
219
|
-
GMD = :GMD
|
220
|
-
GNF = :GNF
|
221
|
-
GTQ = :GTQ
|
222
|
-
GYD = :GYD
|
223
|
-
HKD = :HKD
|
224
|
-
HNL = :HNL
|
225
|
-
HRK = :HRK
|
226
|
-
HTG = :HTG
|
227
|
-
HUF = :HUF
|
228
|
-
IDR = :IDR
|
229
|
-
ILS = :ILS
|
230
|
-
INR = :INR
|
231
|
-
IQD = :IQD
|
232
|
-
JMD = :JMD
|
233
|
-
JOD = :JOD
|
234
|
-
JPY = :JPY
|
235
|
-
KES = :KES
|
236
|
-
KGS = :KGS
|
237
|
-
KHR = :KHR
|
238
|
-
KMF = :KMF
|
239
|
-
KRW = :KRW
|
240
|
-
KWD = :KWD
|
241
|
-
KYD = :KYD
|
242
|
-
KZT = :KZT
|
243
|
-
LAK = :LAK
|
244
|
-
LBP = :LBP
|
245
|
-
LKR = :LKR
|
246
|
-
LRD = :LRD
|
247
|
-
LSL = :LSL
|
248
|
-
LYD = :LYD
|
249
|
-
MAD = :MAD
|
250
|
-
MDL = :MDL
|
251
|
-
MGA = :MGA
|
252
|
-
MKD = :MKD
|
253
|
-
MMK = :MMK
|
254
|
-
MNT = :MNT
|
255
|
-
MOP = :MOP
|
256
|
-
MRU = :MRU
|
257
|
-
MUR = :MUR
|
258
|
-
MVR = :MVR
|
259
|
-
MWK = :MWK
|
260
|
-
MXN = :MXN
|
261
|
-
MYR = :MYR
|
262
|
-
MZN = :MZN
|
263
|
-
NAD = :NAD
|
264
|
-
NGN = :NGN
|
265
|
-
NIO = :NIO
|
266
|
-
NOK = :NOK
|
267
|
-
NPR = :NPR
|
268
|
-
NZD = :NZD
|
269
|
-
OMR = :OMR
|
270
|
-
PAB = :PAB
|
271
|
-
PEN = :PEN
|
272
|
-
PGK = :PGK
|
273
|
-
PHP = :PHP
|
274
|
-
PKR = :PKR
|
275
|
-
PLN = :PLN
|
276
|
-
PYG = :PYG
|
277
|
-
QAR = :QAR
|
278
|
-
RON = :RON
|
279
|
-
RSD = :RSD
|
280
|
-
RUB = :RUB
|
281
|
-
RWF = :RWF
|
282
|
-
SAR = :SAR
|
283
|
-
SBD = :SBD
|
284
|
-
SCR = :SCR
|
285
|
-
SEK = :SEK
|
286
|
-
SGD = :SGD
|
287
|
-
SHP = :SHP
|
288
|
-
SLE = :SLE
|
289
|
-
SLL = :SLL
|
290
|
-
SOS = :SOS
|
291
|
-
SRD = :SRD
|
292
|
-
SSP = :SSP
|
293
|
-
STN = :STN
|
294
|
-
SVC = :SVC
|
295
|
-
SZL = :SZL
|
296
|
-
THB = :THB
|
297
|
-
TND = :TND
|
298
|
-
TOP = :TOP
|
299
|
-
TRY = :TRY
|
300
|
-
TTD = :TTD
|
301
|
-
TWD = :TWD
|
302
|
-
TZS = :TZS
|
303
|
-
UAH = :UAH
|
304
|
-
UGX = :UGX
|
305
|
-
USD = :USD
|
306
|
-
UYU = :UYU
|
307
|
-
UZS = :UZS
|
308
|
-
VES = :VES
|
309
|
-
VND = :VND
|
310
|
-
VUV = :VUV
|
311
|
-
WST = :WST
|
312
|
-
XAF = :XAF
|
313
|
-
XCD = :XCD
|
314
|
-
XOF = :XOF
|
315
|
-
XPF = :XPF
|
316
|
-
YER = :YER
|
317
|
-
ZAR = :ZAR
|
318
|
-
ZMW = :ZMW
|
319
|
-
|
320
|
-
# @!method self.values
|
321
|
-
# @return [Array<Symbol>]
|
322
|
-
end
|
323
186
|
end
|
324
187
|
end
|
325
188
|
end
|
@@ -29,6 +29,14 @@ module Dodopayments
|
|
29
29
|
# @return [Integer]
|
30
30
|
required :quantity, Integer
|
31
31
|
|
32
|
+
# @!attribute addons
|
33
|
+
# Attach addons to this subscription
|
34
|
+
#
|
35
|
+
# @return [Array<Dodopayments::Models::SubscriptionCreateParams::Addon>, nil]
|
36
|
+
optional :addons,
|
37
|
+
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::SubscriptionCreateParams::Addon] },
|
38
|
+
nil?: true
|
39
|
+
|
32
40
|
# @!attribute allowed_payment_method_types
|
33
41
|
# List of payment methods allowed during checkout.
|
34
42
|
#
|
@@ -44,10 +52,8 @@ module Dodopayments
|
|
44
52
|
|
45
53
|
# @!attribute billing_currency
|
46
54
|
#
|
47
|
-
# @return [Symbol, Dodopayments::Models::
|
48
|
-
optional :billing_currency,
|
49
|
-
enum: -> { Dodopayments::Models::SubscriptionCreateParams::BillingCurrency },
|
50
|
-
nil?: true
|
55
|
+
# @return [Symbol, Dodopayments::Models::Currency, nil]
|
56
|
+
optional :billing_currency, enum: -> { Dodopayments::Models::Currency }, nil?: true
|
51
57
|
|
52
58
|
# @!attribute discount_code
|
53
59
|
# Discount Code to apply to the subscription
|
@@ -97,7 +103,7 @@ module Dodopayments
|
|
97
103
|
# @return [Integer, nil]
|
98
104
|
optional :trial_period_days, Integer, nil?: true
|
99
105
|
|
100
|
-
# @!method initialize(billing:, customer:, product_id:, quantity:, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, metadata: nil, on_demand: nil, payment_link: nil, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
|
106
|
+
# @!method initialize(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, metadata: nil, on_demand: nil, payment_link: nil, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
|
101
107
|
# Some parameter documentations has been truncated, see
|
102
108
|
# {Dodopayments::Models::SubscriptionCreateParams} for more details.
|
103
109
|
#
|
@@ -109,9 +115,11 @@ module Dodopayments
|
|
109
115
|
#
|
110
116
|
# @param quantity [Integer] Number of units to subscribe for. Must be at least 1.
|
111
117
|
#
|
118
|
+
# @param addons [Array<Dodopayments::Models::SubscriptionCreateParams::Addon>, nil] Attach addons to this subscription
|
119
|
+
#
|
112
120
|
# @param allowed_payment_method_types [Array<Symbol, Dodopayments::Models::SubscriptionCreateParams::AllowedPaymentMethodType>, nil] List of payment methods allowed during checkout. ...
|
113
121
|
#
|
114
|
-
# @param billing_currency [Symbol, Dodopayments::Models::
|
122
|
+
# @param billing_currency [Symbol, Dodopayments::Models::Currency, nil]
|
115
123
|
#
|
116
124
|
# @param discount_code [String, nil] Discount Code to apply to the subscription
|
117
125
|
#
|
@@ -132,6 +140,22 @@ module Dodopayments
|
|
132
140
|
#
|
133
141
|
# @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
|
134
142
|
|
143
|
+
class Addon < Dodopayments::Internal::Type::BaseModel
|
144
|
+
# @!attribute addon_id
|
145
|
+
#
|
146
|
+
# @return [String]
|
147
|
+
required :addon_id, String
|
148
|
+
|
149
|
+
# @!attribute quantity
|
150
|
+
#
|
151
|
+
# @return [Integer]
|
152
|
+
required :quantity, Integer
|
153
|
+
|
154
|
+
# @!method initialize(addon_id:, quantity:)
|
155
|
+
# @param addon_id [String]
|
156
|
+
# @param quantity [Integer]
|
157
|
+
end
|
158
|
+
|
135
159
|
module AllowedPaymentMethodType
|
136
160
|
extend Dodopayments::Internal::Type::Enum
|
137
161
|
|
@@ -158,159 +182,6 @@ module Dodopayments
|
|
158
182
|
# @return [Array<Symbol>]
|
159
183
|
end
|
160
184
|
|
161
|
-
module BillingCurrency
|
162
|
-
extend Dodopayments::Internal::Type::Enum
|
163
|
-
|
164
|
-
AED = :AED
|
165
|
-
ALL = :ALL
|
166
|
-
AMD = :AMD
|
167
|
-
ANG = :ANG
|
168
|
-
AOA = :AOA
|
169
|
-
ARS = :ARS
|
170
|
-
AUD = :AUD
|
171
|
-
AWG = :AWG
|
172
|
-
AZN = :AZN
|
173
|
-
BAM = :BAM
|
174
|
-
BBD = :BBD
|
175
|
-
BDT = :BDT
|
176
|
-
BGN = :BGN
|
177
|
-
BHD = :BHD
|
178
|
-
BIF = :BIF
|
179
|
-
BMD = :BMD
|
180
|
-
BND = :BND
|
181
|
-
BOB = :BOB
|
182
|
-
BRL = :BRL
|
183
|
-
BSD = :BSD
|
184
|
-
BWP = :BWP
|
185
|
-
BYN = :BYN
|
186
|
-
BZD = :BZD
|
187
|
-
CAD = :CAD
|
188
|
-
CHF = :CHF
|
189
|
-
CLP = :CLP
|
190
|
-
CNY = :CNY
|
191
|
-
COP = :COP
|
192
|
-
CRC = :CRC
|
193
|
-
CUP = :CUP
|
194
|
-
CVE = :CVE
|
195
|
-
CZK = :CZK
|
196
|
-
DJF = :DJF
|
197
|
-
DKK = :DKK
|
198
|
-
DOP = :DOP
|
199
|
-
DZD = :DZD
|
200
|
-
EGP = :EGP
|
201
|
-
ETB = :ETB
|
202
|
-
EUR = :EUR
|
203
|
-
FJD = :FJD
|
204
|
-
FKP = :FKP
|
205
|
-
GBP = :GBP
|
206
|
-
GEL = :GEL
|
207
|
-
GHS = :GHS
|
208
|
-
GIP = :GIP
|
209
|
-
GMD = :GMD
|
210
|
-
GNF = :GNF
|
211
|
-
GTQ = :GTQ
|
212
|
-
GYD = :GYD
|
213
|
-
HKD = :HKD
|
214
|
-
HNL = :HNL
|
215
|
-
HRK = :HRK
|
216
|
-
HTG = :HTG
|
217
|
-
HUF = :HUF
|
218
|
-
IDR = :IDR
|
219
|
-
ILS = :ILS
|
220
|
-
INR = :INR
|
221
|
-
IQD = :IQD
|
222
|
-
JMD = :JMD
|
223
|
-
JOD = :JOD
|
224
|
-
JPY = :JPY
|
225
|
-
KES = :KES
|
226
|
-
KGS = :KGS
|
227
|
-
KHR = :KHR
|
228
|
-
KMF = :KMF
|
229
|
-
KRW = :KRW
|
230
|
-
KWD = :KWD
|
231
|
-
KYD = :KYD
|
232
|
-
KZT = :KZT
|
233
|
-
LAK = :LAK
|
234
|
-
LBP = :LBP
|
235
|
-
LKR = :LKR
|
236
|
-
LRD = :LRD
|
237
|
-
LSL = :LSL
|
238
|
-
LYD = :LYD
|
239
|
-
MAD = :MAD
|
240
|
-
MDL = :MDL
|
241
|
-
MGA = :MGA
|
242
|
-
MKD = :MKD
|
243
|
-
MMK = :MMK
|
244
|
-
MNT = :MNT
|
245
|
-
MOP = :MOP
|
246
|
-
MRU = :MRU
|
247
|
-
MUR = :MUR
|
248
|
-
MVR = :MVR
|
249
|
-
MWK = :MWK
|
250
|
-
MXN = :MXN
|
251
|
-
MYR = :MYR
|
252
|
-
MZN = :MZN
|
253
|
-
NAD = :NAD
|
254
|
-
NGN = :NGN
|
255
|
-
NIO = :NIO
|
256
|
-
NOK = :NOK
|
257
|
-
NPR = :NPR
|
258
|
-
NZD = :NZD
|
259
|
-
OMR = :OMR
|
260
|
-
PAB = :PAB
|
261
|
-
PEN = :PEN
|
262
|
-
PGK = :PGK
|
263
|
-
PHP = :PHP
|
264
|
-
PKR = :PKR
|
265
|
-
PLN = :PLN
|
266
|
-
PYG = :PYG
|
267
|
-
QAR = :QAR
|
268
|
-
RON = :RON
|
269
|
-
RSD = :RSD
|
270
|
-
RUB = :RUB
|
271
|
-
RWF = :RWF
|
272
|
-
SAR = :SAR
|
273
|
-
SBD = :SBD
|
274
|
-
SCR = :SCR
|
275
|
-
SEK = :SEK
|
276
|
-
SGD = :SGD
|
277
|
-
SHP = :SHP
|
278
|
-
SLE = :SLE
|
279
|
-
SLL = :SLL
|
280
|
-
SOS = :SOS
|
281
|
-
SRD = :SRD
|
282
|
-
SSP = :SSP
|
283
|
-
STN = :STN
|
284
|
-
SVC = :SVC
|
285
|
-
SZL = :SZL
|
286
|
-
THB = :THB
|
287
|
-
TND = :TND
|
288
|
-
TOP = :TOP
|
289
|
-
TRY = :TRY
|
290
|
-
TTD = :TTD
|
291
|
-
TWD = :TWD
|
292
|
-
TZS = :TZS
|
293
|
-
UAH = :UAH
|
294
|
-
UGX = :UGX
|
295
|
-
USD = :USD
|
296
|
-
UYU = :UYU
|
297
|
-
UZS = :UZS
|
298
|
-
VES = :VES
|
299
|
-
VND = :VND
|
300
|
-
VUV = :VUV
|
301
|
-
WST = :WST
|
302
|
-
XAF = :XAF
|
303
|
-
XCD = :XCD
|
304
|
-
XOF = :XOF
|
305
|
-
XPF = :XPF
|
306
|
-
YER = :YER
|
307
|
-
ZAR = :ZAR
|
308
|
-
ZMW = :ZMW
|
309
|
-
|
310
|
-
# @!method self.values
|
311
|
-
# @return [Array<Symbol>]
|
312
|
-
end
|
313
|
-
|
314
185
|
class OnDemand < Dodopayments::Internal::Type::BaseModel
|
315
186
|
# @!attribute mandate_only
|
316
187
|
# If set as True, does not perform any charge and only authorizes payment method
|
@@ -4,6 +4,13 @@ module Dodopayments
|
|
4
4
|
module Models
|
5
5
|
# @see Dodopayments::Resources::Subscriptions#create
|
6
6
|
class SubscriptionCreateResponse < Dodopayments::Internal::Type::BaseModel
|
7
|
+
# @!attribute addons
|
8
|
+
# Addons associated with this subscription
|
9
|
+
#
|
10
|
+
# @return [Array<Dodopayments::Models::AddonCartResponseItem>]
|
11
|
+
required :addons,
|
12
|
+
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::AddonCartResponseItem] }
|
13
|
+
|
7
14
|
# @!attribute customer
|
8
15
|
#
|
9
16
|
# @return [Dodopayments::Models::CustomerLimitedDetails]
|
@@ -46,10 +53,12 @@ module Dodopayments
|
|
46
53
|
# @return [String, nil]
|
47
54
|
optional :payment_link, String, nil?: true
|
48
55
|
|
49
|
-
# @!method initialize(customer:, metadata:, recurring_pre_tax_amount:, subscription_id:, client_secret: nil, discount_id: nil, payment_link: nil)
|
56
|
+
# @!method initialize(addons:, customer:, metadata:, recurring_pre_tax_amount:, subscription_id:, client_secret: nil, discount_id: nil, payment_link: nil)
|
50
57
|
# Some parameter documentations has been truncated, see
|
51
58
|
# {Dodopayments::Models::SubscriptionCreateResponse} for more details.
|
52
59
|
#
|
60
|
+
# @param addons [Array<Dodopayments::Models::AddonCartResponseItem>] Addons associated with this subscription
|
61
|
+
#
|
53
62
|
# @param customer [Dodopayments::Models::CustomerLimitedDetails]
|
54
63
|
#
|
55
64
|
# @param metadata [Hash{Symbol=>String}]
|
@@ -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
|