dodopayments 1.61.7 → 1.66.1

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/billing_address.rb +18 -18
  5. data/lib/dodopayments/models/checkout_session_request.rb +10 -1
  6. data/lib/dodopayments/models/subscription_create_params.rb +12 -1
  7. data/lib/dodopayments/models/subscription_create_response.rb +27 -1
  8. data/lib/dodopayments/models/subscription_preview_change_plan_params.rb +63 -0
  9. data/lib/dodopayments/models/subscription_preview_change_plan_response.rb +388 -0
  10. data/lib/dodopayments/models/subscription_updated_webhook_event.rb +76 -0
  11. data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +3 -1
  12. data/lib/dodopayments/models/unwrap_webhook_event.rb +3 -1
  13. data/lib/dodopayments/models/webhook_event_type.rb +1 -0
  14. data/lib/dodopayments/models.rb +4 -0
  15. data/lib/dodopayments/resources/checkout_sessions.rb +3 -1
  16. data/lib/dodopayments/resources/payments.rb +2 -0
  17. data/lib/dodopayments/resources/subscriptions.rb +36 -1
  18. data/lib/dodopayments/resources/webhooks.rb +2 -2
  19. data/lib/dodopayments/version.rb +1 -1
  20. data/lib/dodopayments.rb +4 -0
  21. data/rbi/dodopayments/models/billing_address.rbi +20 -20
  22. data/rbi/dodopayments/models/checkout_session_request.rbi +13 -0
  23. data/rbi/dodopayments/models/subscription_create_params.rbi +12 -0
  24. data/rbi/dodopayments/models/subscription_create_response.rbi +54 -0
  25. data/rbi/dodopayments/models/subscription_preview_change_plan_params.rbi +118 -0
  26. data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +633 -0
  27. data/rbi/dodopayments/models/subscription_updated_webhook_event.rbi +185 -0
  28. data/rbi/dodopayments/models/unsafe_unwrap_webhook_event.rbi +2 -1
  29. data/rbi/dodopayments/models/unwrap_webhook_event.rbi +2 -1
  30. data/rbi/dodopayments/models/webhook_event_type.rbi +5 -0
  31. data/rbi/dodopayments/models.rbi +6 -0
  32. data/rbi/dodopayments/resources/checkout_sessions.rbi +4 -0
  33. data/rbi/dodopayments/resources/subscriptions.rbi +32 -0
  34. data/rbi/dodopayments/resources/webhooks.rbi +4 -2
  35. data/sig/dodopayments/models/billing_address.rbs +17 -17
  36. data/sig/dodopayments/models/checkout_session_request.rbs +7 -0
  37. data/sig/dodopayments/models/subscription_create_params.rbs +5 -0
  38. data/sig/dodopayments/models/subscription_create_response.rbs +17 -0
  39. data/sig/dodopayments/models/subscription_preview_change_plan_params.rbs +54 -0
  40. data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +356 -0
  41. data/sig/dodopayments/models/subscription_updated_webhook_event.rbs +76 -0
  42. data/sig/dodopayments/models/unsafe_unwrap_webhook_event.rbs +1 -0
  43. data/sig/dodopayments/models/unwrap_webhook_event.rbs +1 -0
  44. data/sig/dodopayments/models/webhook_event_type.rbs +2 -0
  45. data/sig/dodopayments/models.rbs +4 -0
  46. data/sig/dodopayments/resources/checkout_sessions.rbs +1 -0
  47. data/sig/dodopayments/resources/subscriptions.rbs +10 -0
  48. data/sig/dodopayments/resources/webhooks.rbs +4 -2
  49. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20bb4eda914389828ce33b46200e9c99d50d8bf7675cd0ba37995898d2b1cfc2
4
- data.tar.gz: 929fb6da8de4a0859a5c15dbecca678eaee157b954b00bf21adcc4f9ac5890c1
3
+ metadata.gz: 972a3614fedb42869f13add8d65c94c5d9ab86ddf846ab3a731b3e0aba2fb8ee
4
+ data.tar.gz: db9d83611c7efd7d69ac9b65b2b835163c04254a40c79410aab014a9d5077e86
5
5
  SHA512:
6
- metadata.gz: 9e2c93a8f3b0ae8736032cf3bed24d056867e0df216478c27b295e99de457457c549dd38ac8735b7fb0bdda74669b4ecfec15557c86aa7d38e499e8a7c50d24d
7
- data.tar.gz: 95d2bfa6debe19dcd2bb46e14812220543f834a06b6d98ef76d49cd2be6733c5c2651592aa6e634ef1007309bb90b5570b9c271b9ddf7889c03cdca4b4f27796
6
+ metadata.gz: a549157df59ceab775aeb937d7f2255d82236032ab5def65f3f6ac8c869326d2e95cbaff72d8a4b2e0e03d60a575b3607be83b17d3c1b43d1131ec8093bcb8d6
7
+ data.tar.gz: 816652a5e782d96450eb2bef110f9ae61f4b3883e6e7090cb7fc8a899efd93f648b59c80f03e883fb284984024145920ab5b3c74824b798a1e3698dbcf60d62e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.66.1 (2025-12-12)
4
+
5
+ Full Changelog: [v1.66.0...v1.66.1](https://github.com/dodopayments/dodopayments-ruby/compare/v1.66.0...v1.66.1)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([33e1723](https://github.com/dodopayments/dodopayments-ruby/commit/33e1723674596d62368d8aafbfcdcf4fb994de56))
10
+
11
+ ## 1.66.0 (2025-12-08)
12
+
13
+ Full Changelog: [v1.61.7...v1.66.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.61.7...v1.66.0)
14
+
15
+ ### Features
16
+
17
+ * **api:** updated openapi spec to v1.66.1 ([b7f15c5](https://github.com/dodopayments/dodopayments-ruby/commit/b7f15c5801d7d6e2523a11e5ca2d0c807c202e89))
18
+
3
19
  ## 1.61.7 (2025-12-03)
4
20
 
5
21
  Full Changelog: [v1.61.6...v1.61.7](https://github.com/dodopayments/dodopayments-ruby/compare/v1.61.6...v1.61.7)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "dodopayments", "~> 1.61.7"
20
+ gem "dodopayments", "~> 1.66.1"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -3,46 +3,46 @@
3
3
  module Dodopayments
4
4
  module Models
5
5
  class BillingAddress < Dodopayments::Internal::Type::BaseModel
6
- # @!attribute city
7
- # City name
8
- #
9
- # @return [String]
10
- required :city, String
11
-
12
6
  # @!attribute country
13
7
  # Two-letter ISO country code (ISO 3166-1 alpha-2)
14
8
  #
15
9
  # @return [Symbol, Dodopayments::Models::CountryCode]
16
10
  required :country, enum: -> { Dodopayments::CountryCode }
17
11
 
12
+ # @!attribute city
13
+ # City name
14
+ #
15
+ # @return [String, nil]
16
+ optional :city, String, nil?: true
17
+
18
18
  # @!attribute state
19
19
  # State or province name
20
20
  #
21
- # @return [String]
22
- required :state, String
21
+ # @return [String, nil]
22
+ optional :state, String, nil?: true
23
23
 
24
24
  # @!attribute street
25
25
  # Street address including house number and unit/apartment if applicable
26
26
  #
27
- # @return [String]
28
- required :street, String
27
+ # @return [String, nil]
28
+ optional :street, String, nil?: true
29
29
 
30
30
  # @!attribute zipcode
31
31
  # Postal code or ZIP code
32
32
  #
33
- # @return [String]
34
- required :zipcode, String
33
+ # @return [String, nil]
34
+ optional :zipcode, String, nil?: true
35
35
 
36
- # @!method initialize(city:, country:, state:, street:, zipcode:)
37
- # @param city [String] City name
38
- #
36
+ # @!method initialize(country:, city: nil, state: nil, street: nil, zipcode: nil)
39
37
  # @param country [Symbol, Dodopayments::Models::CountryCode] Two-letter ISO country code (ISO 3166-1 alpha-2)
40
38
  #
41
- # @param state [String] State or province name
39
+ # @param city [String, nil] City name
40
+ #
41
+ # @param state [String, nil] State or province name
42
42
  #
43
- # @param street [String] Street address including house number and unit/apartment if applicable
43
+ # @param street [String, nil] Street address including house number and unit/apartment if applicable
44
44
  #
45
- # @param zipcode [String] Postal code or ZIP code
45
+ # @param zipcode [String, nil] Postal code or ZIP code
46
46
  end
47
47
  end
48
48
  end
@@ -76,6 +76,13 @@ module Dodopayments
76
76
  # @return [Hash{Symbol=>String}, nil]
77
77
  optional :metadata, Dodopayments::Internal::Type::HashOf[String], nil?: true
78
78
 
79
+ # @!attribute minimal_address
80
+ # If true, only zipcode is required when confirm is true; other address fields
81
+ # remain optional
82
+ #
83
+ # @return [Boolean, nil]
84
+ optional :minimal_address, Dodopayments::Internal::Type::Boolean
85
+
79
86
  # @!attribute return_url
80
87
  # The url to redirect after payment failure or success.
81
88
  #
@@ -93,7 +100,7 @@ module Dodopayments
93
100
  # @return [Dodopayments::Models::CheckoutSessionRequest::SubscriptionData, nil]
94
101
  optional :subscription_data, -> { Dodopayments::CheckoutSessionRequest::SubscriptionData }, nil?: true
95
102
 
96
- # @!method initialize(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, confirm: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, force_3ds: nil, metadata: nil, return_url: nil, show_saved_payment_methods: nil, subscription_data: nil)
103
+ # @!method initialize(product_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, confirm: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, force_3ds: nil, metadata: nil, minimal_address: nil, return_url: nil, show_saved_payment_methods: nil, subscription_data: nil)
97
104
  # Some parameter documentations has been truncated, see
98
105
  # {Dodopayments::Models::CheckoutSessionRequest} for more details.
99
106
  #
@@ -119,6 +126,8 @@ module Dodopayments
119
126
  #
120
127
  # @param metadata [Hash{Symbol=>String}, nil] Additional metadata associated with the payment. Defaults to empty if not provid
121
128
  #
129
+ # @param minimal_address [Boolean] If true, only zipcode is required when confirm is true; other address fields rem
130
+ #
122
131
  # @param return_url [String, nil] The url to redirect after payment failure or success.
123
132
  #
124
133
  # @param show_saved_payment_methods [Boolean] Display saved payment methods of a returning customer False by default
@@ -80,6 +80,15 @@ module Dodopayments
80
80
  # @return [Dodopayments::Models::OnDemandSubscription, nil]
81
81
  optional :on_demand, -> { Dodopayments::OnDemandSubscription }, nil?: true
82
82
 
83
+ # @!attribute one_time_product_cart
84
+ # List of one time products that will be bundled with the first payment for this
85
+ # subscription
86
+ #
87
+ # @return [Array<Dodopayments::Models::OneTimeProductCartItem>, nil]
88
+ optional :one_time_product_cart,
89
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::OneTimeProductCartItem] },
90
+ nil?: true
91
+
83
92
  # @!attribute payment_link
84
93
  # If true, generates a payment link. Defaults to false if not specified.
85
94
  #
@@ -112,7 +121,7 @@ module Dodopayments
112
121
  # @return [Integer, nil]
113
122
  optional :trial_period_days, Integer, nil?: true
114
123
 
115
- # @!method initialize(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: 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: {})
124
+ # @!method initialize(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, on_demand: nil, one_time_product_cart: nil, payment_link: nil, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
116
125
  # Some parameter documentations has been truncated, see
117
126
  # {Dodopayments::Models::SubscriptionCreateParams} for more details.
118
127
  #
@@ -138,6 +147,8 @@ module Dodopayments
138
147
  #
139
148
  # @param on_demand [Dodopayments::Models::OnDemandSubscription, nil]
140
149
  #
150
+ # @param one_time_product_cart [Array<Dodopayments::Models::OneTimeProductCartItem>, nil] List of one time products that will be bundled with the first payment for this s
151
+ #
141
152
  # @param payment_link [Boolean, nil] If true, generates a payment link.
142
153
  #
143
154
  # @param return_url [String, nil] Optional URL to redirect after successful subscription creation
@@ -60,13 +60,21 @@ module Dodopayments
60
60
  # @return [Time, nil]
61
61
  optional :expires_on, Time, nil?: true
62
62
 
63
+ # @!attribute one_time_product_cart
64
+ # One time products associated with the purchase of subscription
65
+ #
66
+ # @return [Array<Dodopayments::Models::SubscriptionCreateResponse::OneTimeProductCart>, nil]
67
+ optional :one_time_product_cart,
68
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::SubscriptionCreateResponse::OneTimeProductCart] },
69
+ nil?: true
70
+
63
71
  # @!attribute payment_link
64
72
  # URL to checkout page
65
73
  #
66
74
  # @return [String, nil]
67
75
  optional :payment_link, String, nil?: true
68
76
 
69
- # @!method initialize(addons:, customer:, metadata:, payment_id:, recurring_pre_tax_amount:, subscription_id:, client_secret: nil, discount_id: nil, expires_on: nil, payment_link: nil)
77
+ # @!method initialize(addons:, customer:, metadata:, payment_id:, recurring_pre_tax_amount:, subscription_id:, client_secret: nil, discount_id: nil, expires_on: nil, one_time_product_cart: nil, payment_link: nil)
70
78
  # Some parameter documentations has been truncated, see
71
79
  # {Dodopayments::Models::SubscriptionCreateResponse} for more details.
72
80
  #
@@ -88,7 +96,25 @@ module Dodopayments
88
96
  #
89
97
  # @param expires_on [Time, nil] Expiry timestamp of the payment link
90
98
  #
99
+ # @param one_time_product_cart [Array<Dodopayments::Models::SubscriptionCreateResponse::OneTimeProductCart>, nil] One time products associated with the purchase of subscription
100
+ #
91
101
  # @param payment_link [String, nil] URL to checkout page
102
+
103
+ class OneTimeProductCart < Dodopayments::Internal::Type::BaseModel
104
+ # @!attribute product_id
105
+ #
106
+ # @return [String]
107
+ required :product_id, String
108
+
109
+ # @!attribute quantity
110
+ #
111
+ # @return [Integer]
112
+ required :quantity, Integer
113
+
114
+ # @!method initialize(product_id:, quantity:)
115
+ # @param product_id [String]
116
+ # @param quantity [Integer]
117
+ end
92
118
  end
93
119
  end
94
120
  end
@@ -0,0 +1,63 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Subscriptions#preview_change_plan
6
+ class SubscriptionPreviewChangePlanParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ # @!attribute product_id
11
+ # Unique identifier of the product to subscribe to
12
+ #
13
+ # @return [String]
14
+ required :product_id, String
15
+
16
+ # @!attribute proration_billing_mode
17
+ # Proration Billing Mode
18
+ #
19
+ # @return [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanParams::ProrationBillingMode]
20
+ required :proration_billing_mode,
21
+ enum: -> { Dodopayments::SubscriptionPreviewChangePlanParams::ProrationBillingMode }
22
+
23
+ # @!attribute quantity
24
+ # Number of units to subscribe for. Must be at least 1.
25
+ #
26
+ # @return [Integer]
27
+ required :quantity, Integer
28
+
29
+ # @!attribute addons
30
+ # Addons for the new plan. Note : Leaving this empty would remove any existing
31
+ # addons
32
+ #
33
+ # @return [Array<Dodopayments::Models::AttachAddon>, nil]
34
+ optional :addons, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::AttachAddon] }, nil?: true
35
+
36
+ # @!method initialize(product_id:, proration_billing_mode:, quantity:, addons: nil, request_options: {})
37
+ # Some parameter documentations has been truncated, see
38
+ # {Dodopayments::Models::SubscriptionPreviewChangePlanParams} for more details.
39
+ #
40
+ # @param product_id [String] Unique identifier of the product to subscribe to
41
+ #
42
+ # @param proration_billing_mode [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanParams::ProrationBillingMode] Proration Billing Mode
43
+ #
44
+ # @param quantity [Integer] Number of units to subscribe for. Must be at least 1.
45
+ #
46
+ # @param addons [Array<Dodopayments::Models::AttachAddon>, nil] Addons for the new plan.
47
+ #
48
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}]
49
+
50
+ # Proration Billing Mode
51
+ module ProrationBillingMode
52
+ extend Dodopayments::Internal::Type::Enum
53
+
54
+ PRORATED_IMMEDIATELY = :prorated_immediately
55
+ FULL_IMMEDIATELY = :full_immediately
56
+ DIFFERENCE_IMMEDIATELY = :difference_immediately
57
+
58
+ # @!method self.values
59
+ # @return [Array<Symbol>]
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,388 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # @see Dodopayments::Resources::Subscriptions#preview_change_plan
6
+ class SubscriptionPreviewChangePlanResponse < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute immediate_charge
8
+ #
9
+ # @return [Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge]
10
+ required :immediate_charge,
11
+ -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge }
12
+
13
+ # @!attribute new_plan
14
+ # Response struct representing subscription details
15
+ #
16
+ # @return [Dodopayments::Models::Subscription]
17
+ required :new_plan, -> { Dodopayments::Subscription }
18
+
19
+ # @!method initialize(immediate_charge:, new_plan:)
20
+ # @param immediate_charge [Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge]
21
+ #
22
+ # @param new_plan [Dodopayments::Models::Subscription] Response struct representing subscription details
23
+
24
+ # @see Dodopayments::Models::SubscriptionPreviewChangePlanResponse#immediate_charge
25
+ class ImmediateCharge < Dodopayments::Internal::Type::BaseModel
26
+ # @!attribute line_items
27
+ #
28
+ # @return [Array<Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter>]
29
+ required :line_items,
30
+ -> { Dodopayments::Internal::Type::ArrayOf[union: Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem] }
31
+
32
+ # @!attribute summary
33
+ #
34
+ # @return [Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::Summary]
35
+ required :summary,
36
+ -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::Summary }
37
+
38
+ # @!method initialize(line_items:, summary:)
39
+ # @param line_items [Array<Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter>]
40
+ # @param summary [Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::Summary]
41
+
42
+ module LineItem
43
+ extend Dodopayments::Internal::Type::Union
44
+
45
+ variant -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription }
46
+
47
+ variant -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon }
48
+
49
+ variant -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter }
50
+
51
+ class Subscription < Dodopayments::Internal::Type::BaseModel
52
+ # @!attribute id
53
+ #
54
+ # @return [String]
55
+ required :id, String
56
+
57
+ # @!attribute currency
58
+ #
59
+ # @return [Symbol, Dodopayments::Models::Currency]
60
+ required :currency, enum: -> { Dodopayments::Currency }
61
+
62
+ # @!attribute product_id
63
+ #
64
+ # @return [String]
65
+ required :product_id, String
66
+
67
+ # @!attribute proration_factor
68
+ #
69
+ # @return [Float]
70
+ required :proration_factor, Float
71
+
72
+ # @!attribute quantity
73
+ #
74
+ # @return [Integer]
75
+ required :quantity, Integer
76
+
77
+ # @!attribute tax_inclusive
78
+ #
79
+ # @return [Boolean]
80
+ required :tax_inclusive, Dodopayments::Internal::Type::Boolean
81
+
82
+ # @!attribute type
83
+ #
84
+ # @return [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription::Type]
85
+ required :type,
86
+ enum: -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription::Type }
87
+
88
+ # @!attribute unit_price
89
+ #
90
+ # @return [Integer]
91
+ required :unit_price, Integer
92
+
93
+ # @!attribute description
94
+ #
95
+ # @return [String, nil]
96
+ optional :description, String, nil?: true
97
+
98
+ # @!attribute name
99
+ #
100
+ # @return [String, nil]
101
+ optional :name, String, nil?: true
102
+
103
+ # @!attribute tax
104
+ #
105
+ # @return [Integer, nil]
106
+ optional :tax, Integer, nil?: true
107
+
108
+ # @!attribute tax_rate
109
+ #
110
+ # @return [Float, nil]
111
+ optional :tax_rate, Float, nil?: true
112
+
113
+ # @!method initialize(id:, currency:, product_id:, proration_factor:, quantity:, tax_inclusive:, type:, unit_price:, description: nil, name: nil, tax: nil, tax_rate: nil)
114
+ # @param id [String]
115
+ # @param currency [Symbol, Dodopayments::Models::Currency]
116
+ # @param product_id [String]
117
+ # @param proration_factor [Float]
118
+ # @param quantity [Integer]
119
+ # @param tax_inclusive [Boolean]
120
+ # @param type [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription::Type]
121
+ # @param unit_price [Integer]
122
+ # @param description [String, nil]
123
+ # @param name [String, nil]
124
+ # @param tax [Integer, nil]
125
+ # @param tax_rate [Float, nil]
126
+
127
+ # @see Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription#type
128
+ module Type
129
+ extend Dodopayments::Internal::Type::Enum
130
+
131
+ SUBSCRIPTION = :subscription
132
+
133
+ # @!method self.values
134
+ # @return [Array<Symbol>]
135
+ end
136
+ end
137
+
138
+ class Addon < Dodopayments::Internal::Type::BaseModel
139
+ # @!attribute id
140
+ #
141
+ # @return [String]
142
+ required :id, String
143
+
144
+ # @!attribute currency
145
+ #
146
+ # @return [Symbol, Dodopayments::Models::Currency]
147
+ required :currency, enum: -> { Dodopayments::Currency }
148
+
149
+ # @!attribute name
150
+ #
151
+ # @return [String]
152
+ required :name, String
153
+
154
+ # @!attribute proration_factor
155
+ #
156
+ # @return [Float]
157
+ required :proration_factor, Float
158
+
159
+ # @!attribute quantity
160
+ #
161
+ # @return [Integer]
162
+ required :quantity, Integer
163
+
164
+ # @!attribute tax_category
165
+ # Represents the different categories of taxation applicable to various products
166
+ # and services.
167
+ #
168
+ # @return [Symbol, Dodopayments::Models::TaxCategory]
169
+ required :tax_category, enum: -> { Dodopayments::TaxCategory }
170
+
171
+ # @!attribute tax_inclusive
172
+ #
173
+ # @return [Boolean]
174
+ required :tax_inclusive, Dodopayments::Internal::Type::Boolean
175
+
176
+ # @!attribute tax_rate
177
+ #
178
+ # @return [Float]
179
+ required :tax_rate, Float
180
+
181
+ # @!attribute type
182
+ #
183
+ # @return [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon::Type]
184
+ required :type,
185
+ enum: -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon::Type }
186
+
187
+ # @!attribute unit_price
188
+ #
189
+ # @return [Integer]
190
+ required :unit_price, Integer
191
+
192
+ # @!attribute description
193
+ #
194
+ # @return [String, nil]
195
+ optional :description, String, nil?: true
196
+
197
+ # @!attribute tax
198
+ #
199
+ # @return [Integer, nil]
200
+ optional :tax, Integer, nil?: true
201
+
202
+ # @!method initialize(id:, currency:, name:, proration_factor:, quantity:, tax_category:, tax_inclusive:, tax_rate:, type:, unit_price:, description: nil, tax: nil)
203
+ # Some parameter documentations has been truncated, see
204
+ # {Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon}
205
+ # for more details.
206
+ #
207
+ # @param id [String]
208
+ #
209
+ # @param currency [Symbol, Dodopayments::Models::Currency]
210
+ #
211
+ # @param name [String]
212
+ #
213
+ # @param proration_factor [Float]
214
+ #
215
+ # @param quantity [Integer]
216
+ #
217
+ # @param tax_category [Symbol, Dodopayments::Models::TaxCategory] Represents the different categories of taxation applicable to various products a
218
+ #
219
+ # @param tax_inclusive [Boolean]
220
+ #
221
+ # @param tax_rate [Float]
222
+ #
223
+ # @param type [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon::Type]
224
+ #
225
+ # @param unit_price [Integer]
226
+ #
227
+ # @param description [String, nil]
228
+ #
229
+ # @param tax [Integer, nil]
230
+
231
+ # @see Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon#type
232
+ module Type
233
+ extend Dodopayments::Internal::Type::Enum
234
+
235
+ ADDON = :addon
236
+
237
+ # @!method self.values
238
+ # @return [Array<Symbol>]
239
+ end
240
+ end
241
+
242
+ class Meter < Dodopayments::Internal::Type::BaseModel
243
+ # @!attribute id
244
+ #
245
+ # @return [String]
246
+ required :id, String
247
+
248
+ # @!attribute chargeable_units
249
+ #
250
+ # @return [String]
251
+ required :chargeable_units, String
252
+
253
+ # @!attribute currency
254
+ #
255
+ # @return [Symbol, Dodopayments::Models::Currency]
256
+ required :currency, enum: -> { Dodopayments::Currency }
257
+
258
+ # @!attribute free_threshold
259
+ #
260
+ # @return [Integer]
261
+ required :free_threshold, Integer
262
+
263
+ # @!attribute name
264
+ #
265
+ # @return [String]
266
+ required :name, String
267
+
268
+ # @!attribute price_per_unit
269
+ #
270
+ # @return [String]
271
+ required :price_per_unit, String
272
+
273
+ # @!attribute subtotal
274
+ #
275
+ # @return [Integer]
276
+ required :subtotal, Integer
277
+
278
+ # @!attribute tax_inclusive
279
+ #
280
+ # @return [Boolean]
281
+ required :tax_inclusive, Dodopayments::Internal::Type::Boolean
282
+
283
+ # @!attribute tax_rate
284
+ #
285
+ # @return [Float]
286
+ required :tax_rate, Float
287
+
288
+ # @!attribute type
289
+ #
290
+ # @return [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter::Type]
291
+ required :type,
292
+ enum: -> { Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter::Type }
293
+
294
+ # @!attribute units_consumed
295
+ #
296
+ # @return [String]
297
+ required :units_consumed, String
298
+
299
+ # @!attribute description
300
+ #
301
+ # @return [String, nil]
302
+ optional :description, String, nil?: true
303
+
304
+ # @!attribute tax
305
+ #
306
+ # @return [Integer, nil]
307
+ optional :tax, Integer, nil?: true
308
+
309
+ # @!method initialize(id:, chargeable_units:, currency:, free_threshold:, name:, price_per_unit:, subtotal:, tax_inclusive:, tax_rate:, type:, units_consumed:, description: nil, tax: nil)
310
+ # @param id [String]
311
+ # @param chargeable_units [String]
312
+ # @param currency [Symbol, Dodopayments::Models::Currency]
313
+ # @param free_threshold [Integer]
314
+ # @param name [String]
315
+ # @param price_per_unit [String]
316
+ # @param subtotal [Integer]
317
+ # @param tax_inclusive [Boolean]
318
+ # @param tax_rate [Float]
319
+ # @param type [Symbol, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter::Type]
320
+ # @param units_consumed [String]
321
+ # @param description [String, nil]
322
+ # @param tax [Integer, nil]
323
+
324
+ # @see Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter#type
325
+ module Type
326
+ extend Dodopayments::Internal::Type::Enum
327
+
328
+ METER = :meter
329
+
330
+ # @!method self.values
331
+ # @return [Array<Symbol>]
332
+ end
333
+ end
334
+
335
+ # @!method self.variants
336
+ # @return [Array(Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Subscription, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Addon, Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge::LineItem::Meter)]
337
+ end
338
+
339
+ # @see Dodopayments::Models::SubscriptionPreviewChangePlanResponse::ImmediateCharge#summary
340
+ class Summary < Dodopayments::Internal::Type::BaseModel
341
+ # @!attribute currency
342
+ #
343
+ # @return [Symbol, Dodopayments::Models::Currency]
344
+ required :currency, enum: -> { Dodopayments::Currency }
345
+
346
+ # @!attribute customer_credits
347
+ #
348
+ # @return [Integer]
349
+ required :customer_credits, Integer
350
+
351
+ # @!attribute settlement_amount
352
+ #
353
+ # @return [Integer]
354
+ required :settlement_amount, Integer
355
+
356
+ # @!attribute settlement_currency
357
+ #
358
+ # @return [Symbol, Dodopayments::Models::Currency]
359
+ required :settlement_currency, enum: -> { Dodopayments::Currency }
360
+
361
+ # @!attribute total_amount
362
+ #
363
+ # @return [Integer]
364
+ required :total_amount, Integer
365
+
366
+ # @!attribute settlement_tax
367
+ #
368
+ # @return [Integer, nil]
369
+ optional :settlement_tax, Integer, nil?: true
370
+
371
+ # @!attribute tax
372
+ #
373
+ # @return [Integer, nil]
374
+ optional :tax, Integer, nil?: true
375
+
376
+ # @!method initialize(currency:, customer_credits:, settlement_amount:, settlement_currency:, total_amount:, settlement_tax: nil, tax: nil)
377
+ # @param currency [Symbol, Dodopayments::Models::Currency]
378
+ # @param customer_credits [Integer]
379
+ # @param settlement_amount [Integer]
380
+ # @param settlement_currency [Symbol, Dodopayments::Models::Currency]
381
+ # @param total_amount [Integer]
382
+ # @param settlement_tax [Integer, nil]
383
+ # @param tax [Integer, nil]
384
+ end
385
+ end
386
+ end
387
+ end
388
+ end