dodopayments 2.17.0 → 2.18.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 (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/internal/cursor_page_pagination.rb +1 -1
  5. data/lib/dodopayments/models/credit_entitlements/credit_ledger_entry.rb +14 -1
  6. data/lib/dodopayments/models/entitlements/grant_fulfill_license_key_params.rb +53 -0
  7. data/lib/dodopayments/models/metadata.rb +8 -0
  8. data/lib/dodopayments/models/payment_method_types.rb +1 -0
  9. data/lib/dodopayments/models/product.rb +3 -17
  10. data/lib/dodopayments/models/product_create_params.rb +3 -16
  11. data/lib/dodopayments/models/product_list_response.rb +3 -17
  12. data/lib/dodopayments/models/product_update_params.rb +3 -16
  13. data/lib/dodopayments/models/products/list_localized_prices_response.rb +18 -0
  14. data/lib/dodopayments/models/products/localized_price.rb +75 -0
  15. data/lib/dodopayments/models/products/localized_price_archive_params.rb +28 -0
  16. data/lib/dodopayments/models/products/localized_price_create_params.rb +51 -0
  17. data/lib/dodopayments/models/products/localized_price_list_params.rb +22 -0
  18. data/lib/dodopayments/models/products/localized_price_retrieve_params.rb +28 -0
  19. data/lib/dodopayments/models/products/localized_price_update_params.rb +42 -0
  20. data/lib/dodopayments/models/products/pricing_mode.rb +17 -0
  21. data/lib/dodopayments/models.rb +3 -0
  22. data/lib/dodopayments/resources/checkout_sessions.rb +2 -1
  23. data/lib/dodopayments/resources/entitlements/grants.rb +35 -0
  24. data/lib/dodopayments/resources/invoices/payments.rb +6 -3
  25. data/lib/dodopayments/resources/products/localized_prices.rb +144 -0
  26. data/lib/dodopayments/resources/products.rb +11 -5
  27. data/lib/dodopayments/resources/webhooks/headers.rb +3 -2
  28. data/lib/dodopayments/resources/webhooks.rb +7 -4
  29. data/lib/dodopayments/version.rb +1 -1
  30. data/lib/dodopayments.rb +11 -0
  31. data/rbi/dodopayments/models/credit_entitlements/credit_ledger_entry.rbi +12 -0
  32. data/rbi/dodopayments/models/entitlements/grant_fulfill_license_key_params.rbi +74 -0
  33. data/rbi/dodopayments/models/metadata.rbi +11 -0
  34. data/rbi/dodopayments/models/payment_method_types.rbi +2 -0
  35. data/rbi/dodopayments/models/product.rbi +4 -26
  36. data/rbi/dodopayments/models/product_create_params.rbi +3 -43
  37. data/rbi/dodopayments/models/product_list_response.rbi +3 -47
  38. data/rbi/dodopayments/models/product_update_params.rbi +3 -43
  39. data/rbi/dodopayments/models/products/list_localized_prices_response.rbi +36 -0
  40. data/rbi/dodopayments/models/products/localized_price.rbi +98 -0
  41. data/rbi/dodopayments/models/products/localized_price_archive_params.rbi +48 -0
  42. data/rbi/dodopayments/models/products/localized_price_create_params.rbi +72 -0
  43. data/rbi/dodopayments/models/products/localized_price_list_params.rbi +43 -0
  44. data/rbi/dodopayments/models/products/localized_price_retrieve_params.rbi +48 -0
  45. data/rbi/dodopayments/models/products/localized_price_update_params.rbi +62 -0
  46. data/rbi/dodopayments/models/products/pricing_mode.rbi +28 -0
  47. data/rbi/dodopayments/models.rbi +6 -0
  48. data/rbi/dodopayments/resources/checkout_sessions.rbi +5 -1
  49. data/rbi/dodopayments/resources/entitlements/grants.rbi +28 -0
  50. data/rbi/dodopayments/resources/invoices/payments.rbi +15 -3
  51. data/rbi/dodopayments/resources/products/localized_prices.rbi +103 -0
  52. data/rbi/dodopayments/resources/products.rbi +16 -4
  53. data/rbi/dodopayments/resources/webhooks/headers.rbi +6 -1
  54. data/rbi/dodopayments/resources/webhooks.rbi +16 -3
  55. data/sig/dodopayments/models/checkout_session_request.rbs +4 -4
  56. data/sig/dodopayments/models/credit_entitlements/balance_create_ledger_entry_params.rbs +4 -4
  57. data/sig/dodopayments/models/credit_entitlements/balance_list_grants_response.rbs +4 -4
  58. data/sig/dodopayments/models/credit_entitlements/credit_ledger_entry.rbs +5 -0
  59. data/sig/dodopayments/models/customer.rbs +7 -5
  60. data/sig/dodopayments/models/customer_create_params.rbs +7 -5
  61. data/sig/dodopayments/models/customer_limited_details.rbs +7 -5
  62. data/sig/dodopayments/models/customer_update_params.rbs +4 -4
  63. data/sig/dodopayments/models/discount.rbs +4 -4
  64. data/sig/dodopayments/models/discount_create_params.rbs +7 -5
  65. data/sig/dodopayments/models/discount_detail.rbs +4 -4
  66. data/sig/dodopayments/models/discount_update_params.rbs +4 -4
  67. data/sig/dodopayments/models/entitlement.rbs +4 -4
  68. data/sig/dodopayments/models/entitlement_create_params.rbs +7 -5
  69. data/sig/dodopayments/models/entitlement_update_params.rbs +4 -4
  70. data/sig/dodopayments/models/entitlements/entitlement_grant.rbs +4 -4
  71. data/sig/dodopayments/models/entitlements/grant_fulfill_license_key_params.rbs +43 -0
  72. data/sig/dodopayments/models/metadata.rbs +7 -0
  73. data/sig/dodopayments/models/payment.rbs +4 -4
  74. data/sig/dodopayments/models/payment_create_params.rbs +7 -5
  75. data/sig/dodopayments/models/payment_create_response.rbs +4 -4
  76. data/sig/dodopayments/models/payment_list_response.rbs +4 -4
  77. data/sig/dodopayments/models/payment_method_types.rbs +2 -0
  78. data/sig/dodopayments/models/product.rbs +8 -19
  79. data/sig/dodopayments/models/product_create_params.rbs +11 -20
  80. data/sig/dodopayments/models/product_list_response.rbs +8 -19
  81. data/sig/dodopayments/models/product_update_params.rbs +8 -19
  82. data/sig/dodopayments/models/products/list_localized_prices_response.rbs +20 -0
  83. data/sig/dodopayments/models/products/localized_price.rbs +57 -0
  84. data/sig/dodopayments/models/products/localized_price_archive_params.rbs +30 -0
  85. data/sig/dodopayments/models/products/localized_price_create_params.rbs +43 -0
  86. data/sig/dodopayments/models/products/localized_price_list_params.rbs +26 -0
  87. data/sig/dodopayments/models/products/localized_price_retrieve_params.rbs +30 -0
  88. data/sig/dodopayments/models/products/localized_price_update_params.rbs +34 -0
  89. data/sig/dodopayments/models/products/pricing_mode.rbs +16 -0
  90. data/sig/dodopayments/models/refund.rbs +4 -4
  91. data/sig/dodopayments/models/refund_create_params.rbs +7 -5
  92. data/sig/dodopayments/models/subscription.rbs +4 -4
  93. data/sig/dodopayments/models/subscription_charge_params.rbs +4 -4
  94. data/sig/dodopayments/models/subscription_create_params.rbs +7 -5
  95. data/sig/dodopayments/models/subscription_create_response.rbs +4 -4
  96. data/sig/dodopayments/models/subscription_list_response.rbs +4 -4
  97. data/sig/dodopayments/models/subscription_update_params.rbs +4 -4
  98. data/sig/dodopayments/models/update_subscription_plan_req.rbs +4 -4
  99. data/sig/dodopayments/models.rbs +2 -0
  100. data/sig/dodopayments/resources/checkout_sessions.rbs +2 -2
  101. data/sig/dodopayments/resources/credit_entitlements/balances.rbs +1 -1
  102. data/sig/dodopayments/resources/customers.rbs +2 -2
  103. data/sig/dodopayments/resources/discounts.rbs +2 -2
  104. data/sig/dodopayments/resources/entitlements/grants.rbs +8 -0
  105. data/sig/dodopayments/resources/entitlements.rbs +2 -2
  106. data/sig/dodopayments/resources/payments.rbs +1 -1
  107. data/sig/dodopayments/resources/products/localized_prices.rbs +41 -0
  108. data/sig/dodopayments/resources/products.rbs +6 -4
  109. data/sig/dodopayments/resources/refunds.rbs +1 -1
  110. data/sig/dodopayments/resources/subscriptions.rbs +5 -5
  111. metadata +35 -2
@@ -36,6 +36,41 @@ module Dodopayments
36
36
  )
37
37
  end
38
38
 
39
+ # Some parameter documentations has been truncated, see
40
+ # {Dodopayments::Models::Entitlements::GrantFulfillLicenseKeyParams} for more
41
+ # details.
42
+ #
43
+ # For entitlements whose license-key config uses `manual` fulfillment, grants are
44
+ # created in the `pending` state without a key. Call this endpoint to deliver the
45
+ # key: the grant moves to `delivered`, the customer is emailed the key, and the
46
+ # `license_key.created` and `entitlement_grant.delivered` webhook events are sent.
47
+ #
48
+ # @overload fulfill_license_key(grant_id, key:, activations_limit: nil, expires_at: nil, request_options: {})
49
+ #
50
+ # @param grant_id [String] Grant ID
51
+ #
52
+ # @param key [String] The license key value to deliver to the customer.
53
+ #
54
+ # @param activations_limit [Integer, nil] Per-key activation limit. Defaults to the entitlement's license-key configuratio
55
+ #
56
+ # @param expires_at [Time, nil] When the key expires. Defaults to the duration in the entitlement's license-key
57
+ #
58
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
59
+ #
60
+ # @return [Dodopayments::Models::Entitlements::EntitlementGrant]
61
+ #
62
+ # @see Dodopayments::Models::Entitlements::GrantFulfillLicenseKeyParams
63
+ def fulfill_license_key(grant_id, params)
64
+ parsed, options = Dodopayments::Entitlements::GrantFulfillLicenseKeyParams.dump_request(params)
65
+ @client.request(
66
+ method: :post,
67
+ path: ["grants/%1$s/license-key", grant_id],
68
+ body: parsed,
69
+ model: Dodopayments::Entitlements::EntitlementGrant,
70
+ options: options
71
+ )
72
+ end
73
+
39
74
  # Revoke a single grant. Idempotent: re-revoking an already-revoked grant returns
40
75
  # the grant in its current state.
41
76
  #
@@ -6,7 +6,8 @@ module Dodopayments
6
6
  class Payments
7
7
  # @overload retrieve(payment_id, request_options: {})
8
8
  #
9
- # @param payment_id [String]
9
+ # @param payment_id [String] Payment ID
10
+ #
10
11
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
11
12
  #
12
13
  # @return [StringIO]
@@ -24,7 +25,8 @@ module Dodopayments
24
25
 
25
26
  # @overload retrieve_payout(payout_id, request_options: {})
26
27
  #
27
- # @param payout_id [String]
28
+ # @param payout_id [String] Payout ID
29
+ #
28
30
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
29
31
  #
30
32
  # @return [StringIO]
@@ -42,7 +44,8 @@ module Dodopayments
42
44
 
43
45
  # @overload retrieve_refund(refund_id, request_options: {})
44
46
  #
45
- # @param refund_id [String]
47
+ # @param refund_id [String] Refund ID
48
+ #
46
49
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
47
50
  #
48
51
  # @return [StringIO]
@@ -0,0 +1,144 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class Products
6
+ class LocalizedPrices
7
+ # Some parameter documentations has been truncated, see
8
+ # {Dodopayments::Models::Products::LocalizedPriceCreateParams} for more details.
9
+ #
10
+ # @overload create(product_id, amount:, currency:, country_code: nil, request_options: {})
11
+ #
12
+ # @param product_id [String] Product Id
13
+ #
14
+ # @param amount [Integer] Amount in the smallest currency unit (e.g., cents). Must be greater than zero.
15
+ #
16
+ # @param currency [Symbol, Dodopayments::Models::Currency] Currency to charge in. Must be a supported currency.
17
+ #
18
+ # @param country_code [Symbol, Dodopayments::Models::CountryCode, nil] Required when the product's pricing_mode is by_country; forbidden when by_curren
19
+ #
20
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
21
+ #
22
+ # @return [Dodopayments::Models::Products::LocalizedPrice]
23
+ #
24
+ # @see Dodopayments::Models::Products::LocalizedPriceCreateParams
25
+ def create(product_id, params)
26
+ parsed, options = Dodopayments::Products::LocalizedPriceCreateParams.dump_request(params)
27
+ @client.request(
28
+ method: :post,
29
+ path: ["products/%1$s/localized-prices", product_id],
30
+ body: parsed,
31
+ model: Dodopayments::Products::LocalizedPrice,
32
+ options: options
33
+ )
34
+ end
35
+
36
+ # @overload retrieve(id, product_id:, request_options: {})
37
+ #
38
+ # @param id [String] Localized Price Id
39
+ #
40
+ # @param product_id [String] Product Id
41
+ #
42
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
43
+ #
44
+ # @return [Dodopayments::Models::Products::LocalizedPrice]
45
+ #
46
+ # @see Dodopayments::Models::Products::LocalizedPriceRetrieveParams
47
+ def retrieve(id, params)
48
+ parsed, options = Dodopayments::Products::LocalizedPriceRetrieveParams.dump_request(params)
49
+ product_id =
50
+ parsed.delete(:product_id) do
51
+ raise ArgumentError.new("missing required path argument #{_1}")
52
+ end
53
+ @client.request(
54
+ method: :get,
55
+ path: ["products/%1$s/localized-prices/%2$s", product_id, id],
56
+ model: Dodopayments::Products::LocalizedPrice,
57
+ options: options
58
+ )
59
+ end
60
+
61
+ # Some parameter documentations has been truncated, see
62
+ # {Dodopayments::Models::Products::LocalizedPriceUpdateParams} for more details.
63
+ #
64
+ # @overload update(id, product_id:, amount: nil, request_options: {})
65
+ #
66
+ # @param id [String] Path param: Localized Price Id
67
+ #
68
+ # @param product_id [String] Path param: Product Id
69
+ #
70
+ # @param amount [Integer, nil] Body param: New amount in the smallest currency unit (e.g., cents). Must be grea
71
+ #
72
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
73
+ #
74
+ # @return [Dodopayments::Models::Products::LocalizedPrice]
75
+ #
76
+ # @see Dodopayments::Models::Products::LocalizedPriceUpdateParams
77
+ def update(id, params)
78
+ parsed, options = Dodopayments::Products::LocalizedPriceUpdateParams.dump_request(params)
79
+ product_id =
80
+ parsed.delete(:product_id) do
81
+ raise ArgumentError.new("missing required path argument #{_1}")
82
+ end
83
+ @client.request(
84
+ method: :patch,
85
+ path: ["products/%1$s/localized-prices/%2$s", product_id, id],
86
+ body: parsed,
87
+ model: Dodopayments::Products::LocalizedPrice,
88
+ options: options
89
+ )
90
+ end
91
+
92
+ # @overload list(product_id, request_options: {})
93
+ #
94
+ # @param product_id [String] Product Id
95
+ #
96
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
97
+ #
98
+ # @return [Dodopayments::Models::Products::ListLocalizedPricesResponse]
99
+ #
100
+ # @see Dodopayments::Models::Products::LocalizedPriceListParams
101
+ def list(product_id, params = {})
102
+ @client.request(
103
+ method: :get,
104
+ path: ["products/%1$s/localized-prices", product_id],
105
+ model: Dodopayments::Products::ListLocalizedPricesResponse,
106
+ options: params[:request_options]
107
+ )
108
+ end
109
+
110
+ # @overload archive(id, product_id:, request_options: {})
111
+ #
112
+ # @param id [String] Localized Price Id
113
+ #
114
+ # @param product_id [String] Product Id
115
+ #
116
+ # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
117
+ #
118
+ # @return [nil]
119
+ #
120
+ # @see Dodopayments::Models::Products::LocalizedPriceArchiveParams
121
+ def archive(id, params)
122
+ parsed, options = Dodopayments::Products::LocalizedPriceArchiveParams.dump_request(params)
123
+ product_id =
124
+ parsed.delete(:product_id) do
125
+ raise ArgumentError.new("missing required path argument #{_1}")
126
+ end
127
+ @client.request(
128
+ method: :delete,
129
+ path: ["products/%1$s/localized-prices/%2$s", product_id, id],
130
+ model: NilClass,
131
+ options: options
132
+ )
133
+ end
134
+
135
+ # @api private
136
+ #
137
+ # @param client [Dodopayments::Client]
138
+ def initialize(client:)
139
+ @client = client
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end
@@ -9,6 +9,9 @@ module Dodopayments
9
9
  # @return [Dodopayments::Resources::Products::ShortLinks]
10
10
  attr_reader :short_links
11
11
 
12
+ # @return [Dodopayments::Resources::Products::LocalizedPrices]
13
+ attr_reader :localized_prices
14
+
12
15
  # Some parameter documentations has been truncated, see
13
16
  # {Dodopayments::Models::ProductCreateParams} for more details.
14
17
  #
@@ -42,7 +45,7 @@ module Dodopayments
42
45
  #
43
46
  # @param metadata [Hash{Symbol=>String}] Additional metadata for the product
44
47
  #
45
- # @param pricing_mode [Symbol, Dodopayments::Models::ProductCreateParams::PricingMode, nil] Pricing mode for localized pricing. When set, rules from
48
+ # @param pricing_mode [Symbol, Dodopayments::Models::Products::PricingMode, nil] Pricing mode for localized pricing. When set, rules from
46
49
  #
47
50
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
48
51
  #
@@ -83,7 +86,7 @@ module Dodopayments
83
86
  #
84
87
  # @overload update(id, addons: nil, brand_id: nil, credit_entitlements: nil, description: nil, digital_product_delivery: nil, entitlements: nil, image_id: nil, license_key_activation_message: nil, license_key_activations_limit: nil, license_key_duration: nil, license_key_enabled: nil, metadata: nil, name: nil, price: nil, pricing_mode: nil, tax_category: nil, request_options: {})
85
88
  #
86
- # @param id [String]
89
+ # @param id [String] Product Id
87
90
  #
88
91
  # @param addons [Array<String>, nil] Available Addons for subscription products
89
92
  #
@@ -113,7 +116,7 @@ module Dodopayments
113
116
  #
114
117
  # @param price [Dodopayments::Models::Price::OneTimePrice, Dodopayments::Models::Price::RecurringPrice, Dodopayments::Models::Price::UsageBasedPrice, nil] Price details of the product.
115
118
  #
116
- # @param pricing_mode [Symbol, Dodopayments::Models::ProductUpdateParams::PricingMode, nil] Update the pricing mode. Omit to leave unchanged; set to null to clear
119
+ # @param pricing_mode [Symbol, Dodopayments::Models::Products::PricingMode, nil] Update the pricing mode. Omit to leave unchanged; set to null to clear
117
120
  #
118
121
  # @param tax_category [Symbol, Dodopayments::Models::TaxCategory, nil] Tax category of the product.
119
122
  #
@@ -168,7 +171,8 @@ module Dodopayments
168
171
 
169
172
  # @overload archive(id, request_options: {})
170
173
  #
171
- # @param id [String]
174
+ # @param id [String] Product Id
175
+ #
172
176
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
173
177
  #
174
178
  # @return [nil]
@@ -185,7 +189,8 @@ module Dodopayments
185
189
 
186
190
  # @overload unarchive(id, request_options: {})
187
191
  #
188
- # @param id [String]
192
+ # @param id [String] Product Id
193
+ #
189
194
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
190
195
  #
191
196
  # @return [nil]
@@ -229,6 +234,7 @@ module Dodopayments
229
234
  @client = client
230
235
  @images = Dodopayments::Resources::Products::Images.new(client: client)
231
236
  @short_links = Dodopayments::Resources::Products::ShortLinks.new(client: client)
237
+ @localized_prices = Dodopayments::Resources::Products::LocalizedPrices.new(client: client)
232
238
  end
233
239
  end
234
240
  end
@@ -8,7 +8,8 @@ module Dodopayments
8
8
  #
9
9
  # @overload retrieve(webhook_id, request_options: {})
10
10
  #
11
- # @param webhook_id [String]
11
+ # @param webhook_id [String] Webhook ID
12
+ #
12
13
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
13
14
  #
14
15
  # @return [Dodopayments::Models::Webhooks::HeaderRetrieveResponse]
@@ -27,7 +28,7 @@ module Dodopayments
27
28
  #
28
29
  # @overload update(webhook_id, headers:, request_options: {})
29
30
  #
30
- # @param webhook_id [String]
31
+ # @param webhook_id [String] Webhook ID
31
32
  #
32
33
  # @param headers [Hash{Symbol=>String}] Object of header-value pair to update or add
33
34
  #
@@ -49,7 +49,8 @@ module Dodopayments
49
49
  #
50
50
  # @overload retrieve(webhook_id, request_options: {})
51
51
  #
52
- # @param webhook_id [String]
52
+ # @param webhook_id [String] Webhook ID
53
+ #
53
54
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
54
55
  #
55
56
  # @return [Dodopayments::Models::WebhookDetails]
@@ -71,7 +72,7 @@ module Dodopayments
71
72
  #
72
73
  # @overload update(webhook_id, description: nil, disabled: nil, filter_types: nil, metadata: nil, rate_limit: nil, url: nil, request_options: {})
73
74
  #
74
- # @param webhook_id [String]
75
+ # @param webhook_id [String] Webhook ID
75
76
  #
76
77
  # @param description [String, nil] Description of the webhook
77
78
  #
@@ -131,7 +132,8 @@ module Dodopayments
131
132
  #
132
133
  # @overload delete(webhook_id, request_options: {})
133
134
  #
134
- # @param webhook_id [String]
135
+ # @param webhook_id [String] Webhook ID
136
+ #
135
137
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
136
138
  #
137
139
  # @return [nil]
@@ -150,7 +152,8 @@ module Dodopayments
150
152
  #
151
153
  # @overload retrieve_secret(webhook_id, request_options: {})
152
154
  #
153
- # @param webhook_id [String]
155
+ # @param webhook_id [String] Webhook ID
156
+ #
154
157
  # @param request_options [Dodopayments::RequestOptions, Hash{Symbol=>Object}, nil]
155
158
  #
156
159
  # @return [Dodopayments::Models::WebhookRetrieveSecretResponse]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dodopayments
4
- VERSION = "2.17.0"
4
+ VERSION = "2.18.0"
5
5
  end
data/lib/dodopayments.rb CHANGED
@@ -197,6 +197,7 @@ require_relative "dodopayments/models/entitlement_retrieve_params"
197
197
  require_relative "dodopayments/models/entitlements/file_delete_params"
198
198
  require_relative "dodopayments/models/entitlements/file_upload_params"
199
199
  require_relative "dodopayments/models/entitlements/file_upload_response"
200
+ require_relative "dodopayments/models/entitlements/grant_fulfill_license_key_params"
200
201
  require_relative "dodopayments/models/entitlements/grant_list_params"
201
202
  require_relative "dodopayments/models/entitlements/grant_revoke_params"
202
203
  require_relative "dodopayments/models/entitlements/license_key_grant"
@@ -228,6 +229,7 @@ require_relative "dodopayments/models/license_key_status"
228
229
  require_relative "dodopayments/models/license_key_update_params"
229
230
  require_relative "dodopayments/models/license_validate_params"
230
231
  require_relative "dodopayments/models/license_validate_response"
232
+ require_relative "dodopayments/models/metadata"
231
233
  require_relative "dodopayments/models/meter"
232
234
  require_relative "dodopayments/models/meter_aggregation"
233
235
  require_relative "dodopayments/models/meter_archive_params"
@@ -295,6 +297,14 @@ require_relative "dodopayments/models/product_list_response"
295
297
  require_relative "dodopayments/models/product_retrieve_params"
296
298
  require_relative "dodopayments/models/products/image_update_params"
297
299
  require_relative "dodopayments/models/products/image_update_response"
300
+ require_relative "dodopayments/models/products/list_localized_prices_response"
301
+ require_relative "dodopayments/models/products/localized_price"
302
+ require_relative "dodopayments/models/products/localized_price_archive_params"
303
+ require_relative "dodopayments/models/products/localized_price_create_params"
304
+ require_relative "dodopayments/models/products/localized_price_list_params"
305
+ require_relative "dodopayments/models/products/localized_price_retrieve_params"
306
+ require_relative "dodopayments/models/products/localized_price_update_params"
307
+ require_relative "dodopayments/models/products/pricing_mode"
298
308
  require_relative "dodopayments/models/products/short_link_create_params"
299
309
  require_relative "dodopayments/models/products/short_link_create_response"
300
310
  require_relative "dodopayments/models/products/short_link_list_params"
@@ -396,6 +406,7 @@ require_relative "dodopayments/resources/product_collections/groups"
396
406
  require_relative "dodopayments/resources/product_collections/groups/items"
397
407
  require_relative "dodopayments/resources/products"
398
408
  require_relative "dodopayments/resources/products/images"
409
+ require_relative "dodopayments/resources/products/localized_prices"
399
410
  require_relative "dodopayments/resources/products/short_links"
400
411
  require_relative "dodopayments/resources/refunds"
401
412
  require_relative "dodopayments/resources/subscriptions"
@@ -43,6 +43,12 @@ module Dodopayments
43
43
  sig { returns(T::Boolean) }
44
44
  attr_accessor :is_credit
45
45
 
46
+ # Metadata associated with the credit grant's source (the subscription or payment
47
+ # created at checkout). Empty when the grant has no resolvable source (e.g.
48
+ # credits granted directly via the API).
49
+ sig { returns(T::Hash[Symbol, String]) }
50
+ attr_accessor :metadata
51
+
46
52
  sig { returns(String) }
47
53
  attr_accessor :overage_after
48
54
 
@@ -81,6 +87,7 @@ module Dodopayments
81
87
  credit_entitlement_id: String,
82
88
  customer_id: String,
83
89
  is_credit: T::Boolean,
90
+ metadata: T::Hash[Symbol, String],
84
91
  overage_after: String,
85
92
  overage_before: String,
86
93
  transaction_type:
@@ -103,6 +110,10 @@ module Dodopayments
103
110
  credit_entitlement_id:,
104
111
  customer_id:,
105
112
  is_credit:,
113
+ # Metadata associated with the credit grant's source (the subscription or payment
114
+ # created at checkout). Empty when the grant has no resolvable source (e.g.
115
+ # credits granted directly via the API).
116
+ metadata:,
106
117
  overage_after:,
107
118
  overage_before:,
108
119
  transaction_type:,
@@ -126,6 +137,7 @@ module Dodopayments
126
137
  credit_entitlement_id: String,
127
138
  customer_id: String,
128
139
  is_credit: T::Boolean,
140
+ metadata: T::Hash[Symbol, String],
129
141
  overage_after: String,
130
142
  overage_before: String,
131
143
  transaction_type:
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Entitlements
6
+ class GrantFulfillLicenseKeyParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Dodopayments::Entitlements::GrantFulfillLicenseKeyParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :grant_id
20
+
21
+ # The license key value to deliver to the customer.
22
+ sig { returns(String) }
23
+ attr_accessor :key
24
+
25
+ # Per-key activation limit. Defaults to the entitlement's license-key
26
+ # configuration.
27
+ sig { returns(T.nilable(Integer)) }
28
+ attr_accessor :activations_limit
29
+
30
+ # When the key expires. Defaults to the duration in the entitlement's license-key
31
+ # configuration.
32
+ sig { returns(T.nilable(Time)) }
33
+ attr_accessor :expires_at
34
+
35
+ sig do
36
+ params(
37
+ grant_id: String,
38
+ key: String,
39
+ activations_limit: T.nilable(Integer),
40
+ expires_at: T.nilable(Time),
41
+ request_options: Dodopayments::RequestOptions::OrHash
42
+ ).returns(T.attached_class)
43
+ end
44
+ def self.new(
45
+ grant_id:,
46
+ # The license key value to deliver to the customer.
47
+ key:,
48
+ # Per-key activation limit. Defaults to the entitlement's license-key
49
+ # configuration.
50
+ activations_limit: nil,
51
+ # When the key expires. Defaults to the duration in the entitlement's license-key
52
+ # configuration.
53
+ expires_at: nil,
54
+ request_options: {}
55
+ )
56
+ end
57
+
58
+ sig do
59
+ override.returns(
60
+ {
61
+ grant_id: String,
62
+ key: String,
63
+ activations_limit: T.nilable(Integer),
64
+ expires_at: T.nilable(Time),
65
+ request_options: Dodopayments::RequestOptions
66
+ }
67
+ )
68
+ end
69
+ def to_hash
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,11 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ Metadata =
6
+ T.let(
7
+ Dodopayments::Internal::Type::HashOf[String],
8
+ Dodopayments::Internal::Type::Converter
9
+ )
10
+ end
11
+ end
@@ -212,6 +212,8 @@ module Dodopayments
212
212
  NAVER_PAY =
213
213
  T.let(:naver_pay, Dodopayments::PaymentMethodTypes::TaggedSymbol)
214
214
  PAYCO = T.let(:payco, Dodopayments::PaymentMethodTypes::TaggedSymbol)
215
+ SATISPAY =
216
+ T.let(:satispay, Dodopayments::PaymentMethodTypes::TaggedSymbol)
215
217
 
216
218
  sig do
217
219
  override.returns(
@@ -107,7 +107,7 @@ module Dodopayments
107
107
  # Pricing mode for localized pricing. NULL means base-only (no localized rules
108
108
  # apply).
109
109
  sig do
110
- returns(T.nilable(Dodopayments::Product::PricingMode::TaggedSymbol))
110
+ returns(T.nilable(Dodopayments::Products::PricingMode::TaggedSymbol))
111
111
  end
112
112
  attr_accessor :pricing_mode
113
113
 
@@ -146,7 +146,8 @@ module Dodopayments
146
146
  license_key_duration:
147
147
  T.nilable(Dodopayments::LicenseKeyDuration::OrHash),
148
148
  name: T.nilable(String),
149
- pricing_mode: T.nilable(Dodopayments::Product::PricingMode::OrSymbol),
149
+ pricing_mode:
150
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
150
151
  product_collection_id: T.nilable(String)
151
152
  ).returns(T.attached_class)
152
153
  end
@@ -225,36 +226,13 @@ module Dodopayments
225
226
  license_key_duration: T.nilable(Dodopayments::LicenseKeyDuration),
226
227
  name: T.nilable(String),
227
228
  pricing_mode:
228
- T.nilable(Dodopayments::Product::PricingMode::TaggedSymbol),
229
+ T.nilable(Dodopayments::Products::PricingMode::TaggedSymbol),
229
230
  product_collection_id: T.nilable(String)
230
231
  }
231
232
  )
232
233
  end
233
234
  def to_hash
234
235
  end
235
-
236
- # Pricing mode for localized pricing. NULL means base-only (no localized rules
237
- # apply).
238
- module PricingMode
239
- extend Dodopayments::Internal::Type::Enum
240
-
241
- TaggedSymbol =
242
- T.type_alias { T.all(Symbol, Dodopayments::Product::PricingMode) }
243
- OrSymbol = T.type_alias { T.any(Symbol, String) }
244
-
245
- BY_CURRENCY =
246
- T.let(:by_currency, Dodopayments::Product::PricingMode::TaggedSymbol)
247
- BY_COUNTRY =
248
- T.let(:by_country, Dodopayments::Product::PricingMode::TaggedSymbol)
249
-
250
- sig do
251
- override.returns(
252
- T::Array[Dodopayments::Product::PricingMode::TaggedSymbol]
253
- )
254
- end
255
- def self.values
256
- end
257
- end
258
236
  end
259
237
  end
260
238
  end
@@ -127,11 +127,7 @@ module Dodopayments
127
127
  # Pricing mode for localized pricing. When set, rules from
128
128
  # /products/{id}/localized-prices apply at checkout. NULL means base-only
129
129
  # (existing behavior).
130
- sig do
131
- returns(
132
- T.nilable(Dodopayments::ProductCreateParams::PricingMode::OrSymbol)
133
- )
134
- end
130
+ sig { returns(T.nilable(Dodopayments::Products::PricingMode::OrSymbol)) }
135
131
  attr_accessor :pricing_mode
136
132
 
137
133
  sig do
@@ -162,7 +158,7 @@ module Dodopayments
162
158
  license_key_enabled: T.nilable(T::Boolean),
163
159
  metadata: T::Hash[Symbol, String],
164
160
  pricing_mode:
165
- T.nilable(Dodopayments::ProductCreateParams::PricingMode::OrSymbol),
161
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
166
162
  request_options: Dodopayments::RequestOptions::OrHash
167
163
  ).returns(T.attached_class)
168
164
  end
@@ -248,9 +244,7 @@ module Dodopayments
248
244
  license_key_enabled: T.nilable(T::Boolean),
249
245
  metadata: T::Hash[Symbol, String],
250
246
  pricing_mode:
251
- T.nilable(
252
- Dodopayments::ProductCreateParams::PricingMode::OrSymbol
253
- ),
247
+ T.nilable(Dodopayments::Products::PricingMode::OrSymbol),
254
248
  request_options: Dodopayments::RequestOptions
255
249
  }
256
250
  )
@@ -300,40 +294,6 @@ module Dodopayments
300
294
  def to_hash
301
295
  end
302
296
  end
303
-
304
- # Pricing mode for localized pricing. When set, rules from
305
- # /products/{id}/localized-prices apply at checkout. NULL means base-only
306
- # (existing behavior).
307
- module PricingMode
308
- extend Dodopayments::Internal::Type::Enum
309
-
310
- TaggedSymbol =
311
- T.type_alias do
312
- T.all(Symbol, Dodopayments::ProductCreateParams::PricingMode)
313
- end
314
- OrSymbol = T.type_alias { T.any(Symbol, String) }
315
-
316
- BY_CURRENCY =
317
- T.let(
318
- :by_currency,
319
- Dodopayments::ProductCreateParams::PricingMode::TaggedSymbol
320
- )
321
- BY_COUNTRY =
322
- T.let(
323
- :by_country,
324
- Dodopayments::ProductCreateParams::PricingMode::TaggedSymbol
325
- )
326
-
327
- sig do
328
- override.returns(
329
- T::Array[
330
- Dodopayments::ProductCreateParams::PricingMode::TaggedSymbol
331
- ]
332
- )
333
- end
334
- def self.values
335
- end
336
- end
337
297
  end
338
298
  end
339
299
  end