dodopayments 2.34.0 → 2.35.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 (250) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/models/addon_delete_params.rb +20 -0
  5. data/lib/dodopayments/models/addon_list_params.rb +25 -1
  6. data/lib/dodopayments/models/addon_retrieve_params.rb +18 -1
  7. data/lib/dodopayments/models/addon_unarchive_params.rb +20 -0
  8. data/lib/dodopayments/models/addons/translation_delete_params.rb +36 -0
  9. data/lib/dodopayments/models/addons/translation_list_params.rb +35 -0
  10. data/lib/dodopayments/models/addons/translation_update_params.rb +52 -0
  11. data/lib/dodopayments/models/balance_ledger_entry.rb +1 -0
  12. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +1 -0
  13. data/lib/dodopayments/models/checkout_session_preview_params.rb +17 -1
  14. data/lib/dodopayments/models/create_new_customer.rb +12 -1
  15. data/lib/dodopayments/models/credit_entitlement_list_params.rb +17 -1
  16. data/lib/dodopayments/models/credit_entitlement_retrieve_params.rb +18 -1
  17. data/lib/dodopayments/models/credit_entitlements/credit_entitlement_translation.rb +47 -0
  18. data/lib/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rb +23 -0
  19. data/lib/dodopayments/models/credit_entitlements/translation_delete_params.rb +37 -0
  20. data/lib/dodopayments/models/credit_entitlements/translation_list_params.rb +36 -0
  21. data/lib/dodopayments/models/credit_entitlements/translation_update_params.rb +53 -0
  22. data/lib/dodopayments/models/customer.rb +9 -1
  23. data/lib/dodopayments/models/customer_create_params.rb +14 -1
  24. data/lib/dodopayments/models/customer_update_params.rb +14 -1
  25. data/lib/dodopayments/models/entitlement_list_params.rb +17 -1
  26. data/lib/dodopayments/models/entitlement_retrieve_params.rb +18 -1
  27. data/lib/dodopayments/models/entitlements/entitlement_translation.rb +67 -0
  28. data/lib/dodopayments/models/entitlements/entitlement_translations_list_response.rb +23 -0
  29. data/lib/dodopayments/models/entitlements/translation_delete_params.rb +36 -0
  30. data/lib/dodopayments/models/entitlements/translation_list_params.rb +35 -0
  31. data/lib/dodopayments/models/entitlements/translation_update_params.rb +69 -0
  32. data/lib/dodopayments/models/locale.rb +38 -0
  33. data/lib/dodopayments/models/locale_info.rb +34 -0
  34. data/lib/dodopayments/models/meter_list_params.rb +17 -1
  35. data/lib/dodopayments/models/meter_retrieve_params.rb +18 -1
  36. data/lib/dodopayments/models/meter_update_params.rb +49 -0
  37. data/lib/dodopayments/models/meters/translation_delete_params.rb +36 -0
  38. data/lib/dodopayments/models/meters/translation_list_params.rb +35 -0
  39. data/lib/dodopayments/models/meters/translation_update_params.rb +52 -0
  40. data/lib/dodopayments/models/misc_list_locales_params.rb +14 -0
  41. data/lib/dodopayments/models/misc_list_locales_response.rb +8 -0
  42. data/lib/dodopayments/models/payment.rb +29 -1
  43. data/lib/dodopayments/models/payment_list_response.rb +29 -1
  44. data/lib/dodopayments/models/payment_retrieve_line_items_params.rb +14 -1
  45. data/lib/dodopayments/models/payment_retrieve_line_items_response.rb +10 -1
  46. data/lib/dodopayments/models/payouts/breakup/detail_list_response.rb +3 -1
  47. data/lib/dodopayments/models/payouts/breakup_retrieve_response.rb +2 -1
  48. data/lib/dodopayments/models/product_collection_list_params.rb +17 -1
  49. data/lib/dodopayments/models/product_collection_retrieve_params.rb +18 -1
  50. data/lib/dodopayments/models/product_collections/translation_delete_params.rb +37 -0
  51. data/lib/dodopayments/models/product_collections/translation_list_params.rb +36 -0
  52. data/lib/dodopayments/models/product_collections/translation_update_params.rb +53 -0
  53. data/lib/dodopayments/models/product_list_params.rb +14 -1
  54. data/lib/dodopayments/models/product_retrieve_params.rb +18 -1
  55. data/lib/dodopayments/models/products/translation.rb +50 -0
  56. data/lib/dodopayments/models/products/translation_delete_params.rb +36 -0
  57. data/lib/dodopayments/models/products/translation_list_params.rb +35 -0
  58. data/lib/dodopayments/models/products/translation_update_params.rb +52 -0
  59. data/lib/dodopayments/models/products/translations_list_response.rb +20 -0
  60. data/lib/dodopayments/models/refund_create_params.rb +13 -1
  61. data/lib/dodopayments/models/subscription_list_params.rb +14 -1
  62. data/lib/dodopayments/models/subscription_retrieve_params.rb +18 -1
  63. data/lib/dodopayments/models/three_ds_flow.rb +16 -0
  64. data/lib/dodopayments/models/three_ds_status.rb +21 -0
  65. data/lib/dodopayments/models/update_subscription_plan_req.rb +10 -0
  66. data/lib/dodopayments/models.rb +20 -0
  67. data/lib/dodopayments/resources/addons/translations.rb +110 -0
  68. data/lib/dodopayments/resources/addons.rb +58 -3
  69. data/lib/dodopayments/resources/checkout_sessions.rb +31 -26
  70. data/lib/dodopayments/resources/credit_entitlements/translations.rb +113 -0
  71. data/lib/dodopayments/resources/credit_entitlements.rb +20 -3
  72. data/lib/dodopayments/resources/customers.rb +12 -2
  73. data/lib/dodopayments/resources/entitlements/translations.rb +114 -0
  74. data/lib/dodopayments/resources/entitlements.rb +20 -3
  75. data/lib/dodopayments/resources/meters/translations.rb +110 -0
  76. data/lib/dodopayments/resources/meters.rb +49 -3
  77. data/lib/dodopayments/resources/misc.rb +18 -0
  78. data/lib/dodopayments/resources/payments.rb +10 -2
  79. data/lib/dodopayments/resources/payouts/breakup/details.rb +5 -2
  80. data/lib/dodopayments/resources/payouts/breakup.rb +4 -1
  81. data/lib/dodopayments/resources/product_collections/translations.rb +113 -0
  82. data/lib/dodopayments/resources/product_collections.rb +20 -3
  83. data/lib/dodopayments/resources/products/translations.rb +110 -0
  84. data/lib/dodopayments/resources/products.rb +17 -3
  85. data/lib/dodopayments/resources/refunds.rb +6 -1
  86. data/lib/dodopayments/resources/subscriptions.rb +13 -3
  87. data/lib/dodopayments/version.rb +1 -1
  88. data/lib/dodopayments.rb +39 -0
  89. data/rbi/dodopayments/models/addon_delete_params.rbi +38 -0
  90. data/rbi/dodopayments/models/addon_list_params.rbi +32 -0
  91. data/rbi/dodopayments/models/addon_retrieve_params.rbi +29 -2
  92. data/rbi/dodopayments/models/addon_unarchive_params.rbi +38 -0
  93. data/rbi/dodopayments/models/addons/translation_delete_params.rbi +58 -0
  94. data/rbi/dodopayments/models/addons/translation_list_params.rbi +59 -0
  95. data/rbi/dodopayments/models/addons/translation_update_params.rbi +74 -0
  96. data/rbi/dodopayments/models/balance_ledger_entry.rbi +5 -0
  97. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +5 -0
  98. data/rbi/dodopayments/models/checkout_session_preview_params.rbi +29 -5
  99. data/rbi/dodopayments/models/create_new_customer.rbi +17 -3
  100. data/rbi/dodopayments/models/credit_entitlement_list_params.rbi +21 -0
  101. data/rbi/dodopayments/models/credit_entitlement_retrieve_params.rbi +29 -2
  102. data/rbi/dodopayments/models/credit_entitlements/credit_entitlement_translation.rbi +70 -0
  103. data/rbi/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rbi +54 -0
  104. data/rbi/dodopayments/models/credit_entitlements/translation_delete_params.rbi +58 -0
  105. data/rbi/dodopayments/models/credit_entitlements/translation_list_params.rbi +59 -0
  106. data/rbi/dodopayments/models/credit_entitlements/translation_update_params.rbi +74 -0
  107. data/rbi/dodopayments/models/customer.rbi +11 -3
  108. data/rbi/dodopayments/models/customer_create_params.rbi +12 -0
  109. data/rbi/dodopayments/models/customer_update_params.rbi +12 -0
  110. data/rbi/dodopayments/models/entitlement_list_params.rbi +21 -0
  111. data/rbi/dodopayments/models/entitlement_retrieve_params.rbi +29 -2
  112. data/rbi/dodopayments/models/entitlements/entitlement_translation.rbi +87 -0
  113. data/rbi/dodopayments/models/entitlements/entitlement_translations_list_response.rbi +48 -0
  114. data/rbi/dodopayments/models/entitlements/translation_delete_params.rbi +58 -0
  115. data/rbi/dodopayments/models/entitlements/translation_list_params.rbi +59 -0
  116. data/rbi/dodopayments/models/entitlements/translation_update_params.rbi +92 -0
  117. data/rbi/dodopayments/models/locale.rbi +42 -0
  118. data/rbi/dodopayments/models/locale_info.rbi +54 -0
  119. data/rbi/dodopayments/models/meter_list_params.rbi +21 -0
  120. data/rbi/dodopayments/models/meter_retrieve_params.rbi +29 -2
  121. data/rbi/dodopayments/models/meter_update_params.rbi +70 -0
  122. data/rbi/dodopayments/models/meters/translation_delete_params.rbi +58 -0
  123. data/rbi/dodopayments/models/meters/translation_list_params.rbi +59 -0
  124. data/rbi/dodopayments/models/meters/translation_update_params.rbi +74 -0
  125. data/rbi/dodopayments/models/misc_list_locales_params.rbi +32 -0
  126. data/rbi/dodopayments/models/misc_list_locales_response.rbi +11 -0
  127. data/rbi/dodopayments/models/payment.rbi +33 -0
  128. data/rbi/dodopayments/models/payment_list_response.rbi +36 -3
  129. data/rbi/dodopayments/models/payment_retrieve_line_items_params.rbi +21 -2
  130. data/rbi/dodopayments/models/payment_retrieve_line_items_response.rbi +14 -3
  131. data/rbi/dodopayments/models/payouts/breakup/detail_list_response.rbi +6 -2
  132. data/rbi/dodopayments/models/payouts/breakup_retrieve_response.rbi +4 -2
  133. data/rbi/dodopayments/models/product_collection_list_params.rbi +21 -0
  134. data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +29 -2
  135. data/rbi/dodopayments/models/product_collections/translation_delete_params.rbi +58 -0
  136. data/rbi/dodopayments/models/product_collections/translation_list_params.rbi +59 -0
  137. data/rbi/dodopayments/models/product_collections/translation_update_params.rbi +74 -0
  138. data/rbi/dodopayments/models/product_list_params.rbi +21 -0
  139. data/rbi/dodopayments/models/product_retrieve_params.rbi +29 -2
  140. data/rbi/dodopayments/models/products/translation.rbi +70 -0
  141. data/rbi/dodopayments/models/products/translation_delete_params.rbi +58 -0
  142. data/rbi/dodopayments/models/products/translation_list_params.rbi +59 -0
  143. data/rbi/dodopayments/models/products/translation_update_params.rbi +74 -0
  144. data/rbi/dodopayments/models/products/translations_list_response.rbi +37 -0
  145. data/rbi/dodopayments/models/refund_create_params.rbi +10 -0
  146. data/rbi/dodopayments/models/subscription_list_params.rbi +21 -0
  147. data/rbi/dodopayments/models/subscription_retrieve_params.rbi +25 -1
  148. data/rbi/dodopayments/models/three_ds_flow.rbi +23 -0
  149. data/rbi/dodopayments/models/three_ds_status.rbi +31 -0
  150. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +15 -0
  151. data/rbi/dodopayments/models.rbi +20 -0
  152. data/rbi/dodopayments/resources/addons/translations.rbi +77 -0
  153. data/rbi/dodopayments/resources/addons.rbi +48 -0
  154. data/rbi/dodopayments/resources/checkout_sessions.rbi +55 -39
  155. data/rbi/dodopayments/resources/credit_entitlements/translations.rbi +81 -0
  156. data/rbi/dodopayments/resources/credit_entitlements.rbi +19 -0
  157. data/rbi/dodopayments/resources/customers.rbi +10 -0
  158. data/rbi/dodopayments/resources/entitlements/translations.rbi +87 -0
  159. data/rbi/dodopayments/resources/entitlements.rbi +19 -0
  160. data/rbi/dodopayments/resources/meters/translations.rbi +77 -0
  161. data/rbi/dodopayments/resources/meters.rbi +42 -0
  162. data/rbi/dodopayments/resources/misc.rbi +9 -0
  163. data/rbi/dodopayments/resources/payments.rbi +4 -0
  164. data/rbi/dodopayments/resources/payouts/breakup/details.rbi +5 -2
  165. data/rbi/dodopayments/resources/payouts/breakup.rbi +4 -1
  166. data/rbi/dodopayments/resources/product_collections/translations.rbi +77 -0
  167. data/rbi/dodopayments/resources/product_collections.rbi +19 -0
  168. data/rbi/dodopayments/resources/products/translations.rbi +77 -0
  169. data/rbi/dodopayments/resources/products.rbi +19 -0
  170. data/rbi/dodopayments/resources/refunds.rbi +4 -0
  171. data/rbi/dodopayments/resources/subscriptions.rbi +26 -0
  172. data/sig/dodopayments/models/addon_delete_params.rbs +23 -0
  173. data/sig/dodopayments/models/addon_list_params.rbs +18 -1
  174. data/sig/dodopayments/models/addon_retrieve_params.rbs +8 -1
  175. data/sig/dodopayments/models/addon_unarchive_params.rbs +23 -0
  176. data/sig/dodopayments/models/addons/translation_delete_params.rbs +30 -0
  177. data/sig/dodopayments/models/addons/translation_list_params.rbs +32 -0
  178. data/sig/dodopayments/models/addons/translation_update_params.rbs +43 -0
  179. data/sig/dodopayments/models/balance_ledger_entry.rbs +2 -0
  180. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +2 -0
  181. data/sig/dodopayments/models/checkout_session_preview_params.rbs +13 -3
  182. data/sig/dodopayments/models/create_new_customer.rbs +8 -3
  183. data/sig/dodopayments/models/credit_entitlement_list_params.rbs +12 -1
  184. data/sig/dodopayments/models/credit_entitlement_retrieve_params.rbs +8 -1
  185. data/sig/dodopayments/models/credit_entitlements/credit_entitlement_translation.rbs +39 -0
  186. data/sig/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rbs +24 -0
  187. data/sig/dodopayments/models/credit_entitlements/translation_delete_params.rbs +30 -0
  188. data/sig/dodopayments/models/credit_entitlements/translation_list_params.rbs +32 -0
  189. data/sig/dodopayments/models/credit_entitlements/translation_update_params.rbs +43 -0
  190. data/sig/dodopayments/models/customer.rbs +8 -3
  191. data/sig/dodopayments/models/customer_create_params.rbs +6 -1
  192. data/sig/dodopayments/models/customer_update_params.rbs +6 -1
  193. data/sig/dodopayments/models/entitlement_list_params.rbs +7 -0
  194. data/sig/dodopayments/models/entitlement_retrieve_params.rbs +8 -1
  195. data/sig/dodopayments/models/entitlements/entitlement_translation.rbs +49 -0
  196. data/sig/dodopayments/models/entitlements/entitlement_translations_list_response.rbs +22 -0
  197. data/sig/dodopayments/models/entitlements/translation_delete_params.rbs +30 -0
  198. data/sig/dodopayments/models/entitlements/translation_list_params.rbs +32 -0
  199. data/sig/dodopayments/models/entitlements/translation_update_params.rbs +53 -0
  200. data/sig/dodopayments/models/locale.rbs +56 -0
  201. data/sig/dodopayments/models/locale_info.rbs +26 -0
  202. data/sig/dodopayments/models/meter_list_params.rbs +12 -1
  203. data/sig/dodopayments/models/meter_retrieve_params.rbs +8 -1
  204. data/sig/dodopayments/models/meter_update_params.rbs +41 -0
  205. data/sig/dodopayments/models/meters/translation_delete_params.rbs +30 -0
  206. data/sig/dodopayments/models/meters/translation_list_params.rbs +32 -0
  207. data/sig/dodopayments/models/meters/translation_update_params.rbs +43 -0
  208. data/sig/dodopayments/models/misc_list_locales_params.rbs +15 -0
  209. data/sig/dodopayments/models/misc_list_locales_response.rbs +7 -0
  210. data/sig/dodopayments/models/payment.rbs +15 -0
  211. data/sig/dodopayments/models/payment_list_response.rbs +18 -3
  212. data/sig/dodopayments/models/payment_retrieve_line_items_params.rbs +10 -1
  213. data/sig/dodopayments/models/payment_retrieve_line_items_response.rbs +8 -3
  214. data/sig/dodopayments/models/product_collection_list_params.rbs +7 -0
  215. data/sig/dodopayments/models/product_collection_retrieve_params.rbs +8 -1
  216. data/sig/dodopayments/models/product_collections/translation_delete_params.rbs +30 -0
  217. data/sig/dodopayments/models/product_collections/translation_list_params.rbs +32 -0
  218. data/sig/dodopayments/models/product_collections/translation_update_params.rbs +43 -0
  219. data/sig/dodopayments/models/product_list_params.rbs +7 -0
  220. data/sig/dodopayments/models/product_retrieve_params.rbs +8 -1
  221. data/sig/dodopayments/models/products/translation.rbs +37 -0
  222. data/sig/dodopayments/models/products/translation_delete_params.rbs +30 -0
  223. data/sig/dodopayments/models/products/translation_list_params.rbs +32 -0
  224. data/sig/dodopayments/models/products/translation_update_params.rbs +43 -0
  225. data/sig/dodopayments/models/products/translations_list_response.rbs +18 -0
  226. data/sig/dodopayments/models/refund_create_params.rbs +5 -0
  227. data/sig/dodopayments/models/subscription_list_params.rbs +7 -0
  228. data/sig/dodopayments/models/subscription_retrieve_params.rbs +7 -1
  229. data/sig/dodopayments/models/three_ds_flow.rbs +14 -0
  230. data/sig/dodopayments/models/three_ds_status.rbs +24 -0
  231. data/sig/dodopayments/models.rbs +20 -0
  232. data/sig/dodopayments/resources/addons/translations.rbs +29 -0
  233. data/sig/dodopayments/resources/addons.rbs +15 -0
  234. data/sig/dodopayments/resources/checkout_sessions.rbs +1 -0
  235. data/sig/dodopayments/resources/credit_entitlements/translations.rbs +29 -0
  236. data/sig/dodopayments/resources/credit_entitlements.rbs +4 -0
  237. data/sig/dodopayments/resources/customers.rbs +2 -0
  238. data/sig/dodopayments/resources/entitlements/translations.rbs +31 -0
  239. data/sig/dodopayments/resources/entitlements.rbs +4 -0
  240. data/sig/dodopayments/resources/meters/translations.rbs +29 -0
  241. data/sig/dodopayments/resources/meters.rbs +12 -0
  242. data/sig/dodopayments/resources/misc.rbs +4 -0
  243. data/sig/dodopayments/resources/payments.rbs +1 -0
  244. data/sig/dodopayments/resources/product_collections/translations.rbs +29 -0
  245. data/sig/dodopayments/resources/product_collections.rbs +4 -0
  246. data/sig/dodopayments/resources/products/translations.rbs +29 -0
  247. data/sig/dodopayments/resources/products.rbs +4 -0
  248. data/sig/dodopayments/resources/refunds.rbs +1 -0
  249. data/sig/dodopayments/resources/subscriptions.rbs +2 -0
  250. metadata +119 -2
@@ -0,0 +1,77 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class ProductCollections
6
+ class Translations
7
+ # Creates or replaces the translation of one locale. The response is 201 for a new
8
+ # locale and 200 for a replaced locale.
9
+ sig do
10
+ params(
11
+ locale: Dodopayments::Locale::OrSymbol,
12
+ id: String,
13
+ description: T.nilable(String),
14
+ name: T.nilable(String),
15
+ request_options: Dodopayments::RequestOptions::OrHash
16
+ ).returns(Dodopayments::Products::Translation)
17
+ end
18
+ def update(
19
+ # Path param: A locale that the checkout and the customer portal can show.
20
+ #
21
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
22
+ locale,
23
+ # Path param: Product Collection Id
24
+ id:,
25
+ # Body param: The translated description.
26
+ description: nil,
27
+ # Body param: The translated name.
28
+ name: nil,
29
+ request_options: {}
30
+ )
31
+ end
32
+
33
+ # Lists the translations, for all the locales or for the locales of the filter.
34
+ sig do
35
+ params(
36
+ id: String,
37
+ locale: T::Array[String],
38
+ request_options: Dodopayments::RequestOptions::OrHash
39
+ ).returns(Dodopayments::Products::TranslationsListResponse)
40
+ end
41
+ def list(
42
+ # Product Collection Id
43
+ id,
44
+ # Returns only these locales, for example `?locale=fr&locale=de`. With no value,
45
+ # the response has all the locales.
46
+ locale: nil,
47
+ request_options: {}
48
+ )
49
+ end
50
+
51
+ # Deletes the translation of one locale.
52
+ sig do
53
+ params(
54
+ locale: Dodopayments::Locale::OrSymbol,
55
+ id: String,
56
+ request_options: Dodopayments::RequestOptions::OrHash
57
+ ).void
58
+ end
59
+ def delete(
60
+ # A locale that the checkout and the customer portal can show.
61
+ #
62
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
63
+ locale,
64
+ # Product Collection Id
65
+ id:,
66
+ request_options: {}
67
+ )
68
+ end
69
+
70
+ # @api private
71
+ sig { params(client: Dodopayments::Client).returns(T.attached_class) }
72
+ def self.new(client:)
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -3,6 +3,9 @@
3
3
  module Dodopayments
4
4
  module Resources
5
5
  class ProductCollections
6
+ sig { returns(Dodopayments::Resources::ProductCollections::Translations) }
7
+ attr_reader :translations
8
+
6
9
  sig { returns(Dodopayments::Resources::ProductCollections::Groups) }
7
10
  attr_reader :groups
8
11
 
@@ -69,12 +72,20 @@ module Dodopayments
69
72
  sig do
70
73
  params(
71
74
  id: String,
75
+ locale: String,
72
76
  request_options: Dodopayments::RequestOptions::OrHash
73
77
  ).returns(Dodopayments::ProductCollection)
74
78
  end
75
79
  def retrieve(
76
80
  # Product Collection Id
77
81
  id,
82
+ # Shows the translated name, description and unit of the catalog entities in this
83
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
84
+ # with no translation, an unknown code, or no code shows the base text.
85
+ #
86
+ # Do not send a text from a localized response back in a create or update request.
87
+ # The base text then changes to the translated text.
88
+ locale: nil,
78
89
  request_options: {}
79
90
  )
80
91
  end
@@ -146,6 +157,7 @@ module Dodopayments
146
157
  params(
147
158
  archived: T::Boolean,
148
159
  brand_id: String,
160
+ locale: String,
149
161
  page_number: Integer,
150
162
  page_size: Integer,
151
163
  request_options: Dodopayments::RequestOptions::OrHash
@@ -160,6 +172,13 @@ module Dodopayments
160
172
  archived: nil,
161
173
  # Filter by Brand id
162
174
  brand_id: nil,
175
+ # Shows the translated name, description and unit of the catalog entities in this
176
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
177
+ # with no translation, an unknown code, or no code shows the base text.
178
+ #
179
+ # Do not send a text from a localized response back in a create or update request.
180
+ # The base text then changes to the translated text.
181
+ locale: nil,
163
182
  # Page number default is 0
164
183
  page_number: nil,
165
184
  # Page size default is 10 max is 100
@@ -0,0 +1,77 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Resources
5
+ class Products
6
+ class Translations
7
+ # Creates or replaces the translation of one locale. The response is 201 for a new
8
+ # locale and 200 for a replaced locale.
9
+ sig do
10
+ params(
11
+ locale: Dodopayments::Locale::OrSymbol,
12
+ id: String,
13
+ description: T.nilable(String),
14
+ name: T.nilable(String),
15
+ request_options: Dodopayments::RequestOptions::OrHash
16
+ ).returns(Dodopayments::Products::Translation)
17
+ end
18
+ def update(
19
+ # Path param: A locale that the checkout and the customer portal can show.
20
+ #
21
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
22
+ locale,
23
+ # Path param: Product Id
24
+ id:,
25
+ # Body param: The translated description.
26
+ description: nil,
27
+ # Body param: The translated name.
28
+ name: nil,
29
+ request_options: {}
30
+ )
31
+ end
32
+
33
+ # Lists the translations, for all the locales or for the locales of the filter.
34
+ sig do
35
+ params(
36
+ id: String,
37
+ locale: T::Array[String],
38
+ request_options: Dodopayments::RequestOptions::OrHash
39
+ ).returns(Dodopayments::Products::TranslationsListResponse)
40
+ end
41
+ def list(
42
+ # Product Id
43
+ id,
44
+ # Returns only these locales, for example `?locale=fr&locale=de`. With no value,
45
+ # the response has all the locales.
46
+ locale: nil,
47
+ request_options: {}
48
+ )
49
+ end
50
+
51
+ # Deletes the translation of one locale.
52
+ sig do
53
+ params(
54
+ locale: Dodopayments::Locale::OrSymbol,
55
+ id: String,
56
+ request_options: Dodopayments::RequestOptions::OrHash
57
+ ).void
58
+ end
59
+ def delete(
60
+ # A locale that the checkout and the customer portal can show.
61
+ #
62
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
63
+ locale,
64
+ # Product Id
65
+ id:,
66
+ request_options: {}
67
+ )
68
+ end
69
+
70
+ # @api private
71
+ sig { params(client: Dodopayments::Client).returns(T.attached_class) }
72
+ def self.new(client:)
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
@@ -3,6 +3,9 @@
3
3
  module Dodopayments
4
4
  module Resources
5
5
  class Products
6
+ sig { returns(Dodopayments::Resources::Products::Translations) }
7
+ attr_reader :translations
8
+
6
9
  sig { returns(Dodopayments::Resources::Products::Images) }
7
10
  attr_reader :images
8
11
 
@@ -101,12 +104,20 @@ module Dodopayments
101
104
  sig do
102
105
  params(
103
106
  id: String,
107
+ locale: String,
104
108
  request_options: Dodopayments::RequestOptions::OrHash
105
109
  ).returns(Dodopayments::Product)
106
110
  end
107
111
  def retrieve(
108
112
  # Product Id
109
113
  id,
114
+ # Shows the translated name, description and unit of the catalog entities in this
115
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
116
+ # with no translation, an unknown code, or no code shows the base text.
117
+ #
118
+ # Do not send a text from a localized response back in a create or update request.
119
+ # The base text then changes to the translated text.
120
+ locale: nil,
110
121
  request_options: {}
111
122
  )
112
123
  end
@@ -216,6 +227,7 @@ module Dodopayments
216
227
  params(
217
228
  archived: T::Boolean,
218
229
  brand_id: String,
230
+ locale: String,
219
231
  page_number: Integer,
220
232
  page_size: Integer,
221
233
  recurring: T::Boolean,
@@ -231,6 +243,13 @@ module Dodopayments
231
243
  archived: nil,
232
244
  # filter by Brand id
233
245
  brand_id: nil,
246
+ # Shows the translated name, description and unit of the catalog entities in this
247
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
248
+ # with no translation, an unknown code, or no code shows the base text.
249
+ #
250
+ # Do not send a text from a localized response back in a create or update request.
251
+ # The base text then changes to the translated text.
252
+ locale: nil,
234
253
  # Page number default is 0
235
254
  page_number: nil,
236
255
  # Page size default is 10 max is 100
@@ -6,6 +6,7 @@ module Dodopayments
6
6
  sig do
7
7
  params(
8
8
  payment_id: String,
9
+ currency: T.nilable(Dodopayments::Currency::OrSymbol),
9
10
  items:
10
11
  T.nilable(T::Array[Dodopayments::RefundCreateParams::Item::OrHash]),
11
12
  metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
@@ -16,6 +17,9 @@ module Dodopayments
16
17
  def create(
17
18
  # The unique identifier of the payment to be refunded.
18
19
  payment_id:,
20
+ # The currency of every `items[].amount`. It must be the currency the customer
21
+ # paid in. Without it, the amounts are in the settlement currency.
22
+ currency: nil,
19
23
  # Partially Refund an Individual Item
20
24
  items: nil,
21
25
  # Additional metadata associated with the refund.
@@ -116,12 +116,20 @@ module Dodopayments
116
116
  sig do
117
117
  params(
118
118
  subscription_id: String,
119
+ locale: String,
119
120
  request_options: Dodopayments::RequestOptions::OrHash
120
121
  ).returns(Dodopayments::Subscription)
121
122
  end
122
123
  def retrieve(
123
124
  # Subscription Id
124
125
  subscription_id,
126
+ # Shows the translated name, description and unit of the catalog entities in this
127
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
128
+ # with no translation, an unknown code, or no code shows the base text.
129
+ #
130
+ # Do not send a text from a localized response back in a create or update request.
131
+ # The base text then changes to the translated text.
132
+ locale: nil,
125
133
  request_options: {}
126
134
  )
127
135
  end
@@ -224,6 +232,7 @@ module Dodopayments
224
232
  created_at_gte: Time,
225
233
  created_at_lte: Time,
226
234
  customer_id: String,
235
+ locale: String,
227
236
  page_number: Integer,
228
237
  page_size: Integer,
229
238
  product_id: String,
@@ -246,6 +255,13 @@ module Dodopayments
246
255
  created_at_lte: nil,
247
256
  # Filter by customer id
248
257
  customer_id: nil,
258
+ # Shows the translated name, description and unit of the catalog entities in this
259
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
260
+ # with no translation, an unknown code, or no code shows the base text.
261
+ #
262
+ # Do not send a text from a localized response back in a create or update request.
263
+ # The base text then changes to the translated text.
264
+ locale: nil,
249
265
  # Page number default is 0
250
266
  page_number: nil,
251
267
  # Page size default is 10 max is 100
@@ -369,6 +385,11 @@ module Dodopayments
369
385
  # - `apply_change` (default): Apply plan change immediately regardless of payment
370
386
  # outcome
371
387
  #
388
+ # With `effective_at: next_billing_date`, the plan change payment replaces the
389
+ # renewal payment. If that payment fails with `prevent_change`, the plan change is
390
+ # cancelled. The subscription then renews on the current plan, with the usual
391
+ # payment retries.
392
+ #
372
393
  # If not specified, uses the business-level default setting.
373
394
  on_payment_failure: nil,
374
395
  # The URL that receives the customer after they pay the payment link. Needs
@@ -525,6 +546,11 @@ module Dodopayments
525
546
  # - `apply_change` (default): Apply plan change immediately regardless of payment
526
547
  # outcome
527
548
  #
549
+ # With `effective_at: next_billing_date`, the plan change payment replaces the
550
+ # renewal payment. If that payment fails with `prevent_change`, the plan change is
551
+ # cancelled. The subscription then renews on the current plan, with the usual
552
+ # payment retries.
553
+ #
528
554
  # If not specified, uses the business-level default setting.
529
555
  on_payment_failure: nil,
530
556
  # The URL that receives the customer after they pay the payment link. Needs
@@ -0,0 +1,23 @@
1
+ module Dodopayments
2
+ module Models
3
+ type addon_delete_params =
4
+ { id: String } & Dodopayments::Internal::Type::request_parameters
5
+
6
+ class AddonDeleteParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ attr_accessor id: String
11
+
12
+ def initialize: (
13
+ id: String,
14
+ ?request_options: Dodopayments::request_opts
15
+ ) -> void
16
+
17
+ def to_hash: -> {
18
+ id: String,
19
+ request_options: Dodopayments::RequestOptions
20
+ }
21
+ end
22
+ end
23
+ end
@@ -1,13 +1,26 @@
1
1
  module Dodopayments
2
2
  module Models
3
3
  type addon_list_params =
4
- { page_number: Integer, page_size: Integer }
4
+ {
5
+ archived: bool,
6
+ locale: String,
7
+ page_number: Integer,
8
+ page_size: Integer
9
+ }
5
10
  & Dodopayments::Internal::Type::request_parameters
6
11
 
7
12
  class AddonListParams < Dodopayments::Internal::Type::BaseModel
8
13
  extend Dodopayments::Internal::Type::RequestParameters::Converter
9
14
  include Dodopayments::Internal::Type::RequestParameters
10
15
 
16
+ attr_reader archived: bool?
17
+
18
+ def archived=: (bool) -> bool
19
+
20
+ attr_reader locale: String?
21
+
22
+ def locale=: (String) -> String
23
+
11
24
  attr_reader page_number: Integer?
12
25
 
13
26
  def page_number=: (Integer) -> Integer
@@ -17,12 +30,16 @@ module Dodopayments
17
30
  def page_size=: (Integer) -> Integer
18
31
 
19
32
  def initialize: (
33
+ ?archived: bool,
34
+ ?locale: String,
20
35
  ?page_number: Integer,
21
36
  ?page_size: Integer,
22
37
  ?request_options: Dodopayments::request_opts
23
38
  ) -> void
24
39
 
25
40
  def to_hash: -> {
41
+ archived: bool,
42
+ locale: String,
26
43
  page_number: Integer,
27
44
  page_size: Integer,
28
45
  request_options: Dodopayments::RequestOptions
@@ -1,7 +1,8 @@
1
1
  module Dodopayments
2
2
  module Models
3
3
  type addon_retrieve_params =
4
- { id: String } & Dodopayments::Internal::Type::request_parameters
4
+ { id: String, locale: String }
5
+ & Dodopayments::Internal::Type::request_parameters
5
6
 
6
7
  class AddonRetrieveParams < Dodopayments::Internal::Type::BaseModel
7
8
  extend Dodopayments::Internal::Type::RequestParameters::Converter
@@ -9,13 +10,19 @@ module Dodopayments
9
10
 
10
11
  attr_accessor id: String
11
12
 
13
+ attr_reader locale: String?
14
+
15
+ def locale=: (String) -> String
16
+
12
17
  def initialize: (
13
18
  id: String,
19
+ ?locale: String,
14
20
  ?request_options: Dodopayments::request_opts
15
21
  ) -> void
16
22
 
17
23
  def to_hash: -> {
18
24
  id: String,
25
+ locale: String,
19
26
  request_options: Dodopayments::RequestOptions
20
27
  }
21
28
  end
@@ -0,0 +1,23 @@
1
+ module Dodopayments
2
+ module Models
3
+ type addon_unarchive_params =
4
+ { id: String } & Dodopayments::Internal::Type::request_parameters
5
+
6
+ class AddonUnarchiveParams < Dodopayments::Internal::Type::BaseModel
7
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
8
+ include Dodopayments::Internal::Type::RequestParameters
9
+
10
+ attr_accessor id: String
11
+
12
+ def initialize: (
13
+ id: String,
14
+ ?request_options: Dodopayments::request_opts
15
+ ) -> void
16
+
17
+ def to_hash: -> {
18
+ id: String,
19
+ request_options: Dodopayments::RequestOptions
20
+ }
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,30 @@
1
+ module Dodopayments
2
+ module Models
3
+ module Addons
4
+ type translation_delete_params =
5
+ { id: String, locale: Dodopayments::Models::locale }
6
+ & Dodopayments::Internal::Type::request_parameters
7
+
8
+ class TranslationDeleteParams < Dodopayments::Internal::Type::BaseModel
9
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
10
+ include Dodopayments::Internal::Type::RequestParameters
11
+
12
+ attr_accessor id: String
13
+
14
+ attr_accessor locale: Dodopayments::Models::locale
15
+
16
+ def initialize: (
17
+ id: String,
18
+ locale: Dodopayments::Models::locale,
19
+ ?request_options: Dodopayments::request_opts
20
+ ) -> void
21
+
22
+ def to_hash: -> {
23
+ id: String,
24
+ locale: Dodopayments::Models::locale,
25
+ request_options: Dodopayments::RequestOptions
26
+ }
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,32 @@
1
+ module Dodopayments
2
+ module Models
3
+ module Addons
4
+ type translation_list_params =
5
+ { id: String, locale: ::Array[String] }
6
+ & Dodopayments::Internal::Type::request_parameters
7
+
8
+ class TranslationListParams < Dodopayments::Internal::Type::BaseModel
9
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
10
+ include Dodopayments::Internal::Type::RequestParameters
11
+
12
+ attr_accessor id: String
13
+
14
+ attr_reader locale: ::Array[String]?
15
+
16
+ def locale=: (::Array[String]) -> ::Array[String]
17
+
18
+ def initialize: (
19
+ id: String,
20
+ ?locale: ::Array[String],
21
+ ?request_options: Dodopayments::request_opts
22
+ ) -> void
23
+
24
+ def to_hash: -> {
25
+ id: String,
26
+ locale: ::Array[String],
27
+ request_options: Dodopayments::RequestOptions
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,43 @@
1
+ module Dodopayments
2
+ module Models
3
+ module Addons
4
+ type translation_update_params =
5
+ {
6
+ id: String,
7
+ locale: Dodopayments::Models::locale,
8
+ description: String?,
9
+ name: String?
10
+ }
11
+ & Dodopayments::Internal::Type::request_parameters
12
+
13
+ class TranslationUpdateParams < Dodopayments::Internal::Type::BaseModel
14
+ extend Dodopayments::Internal::Type::RequestParameters::Converter
15
+ include Dodopayments::Internal::Type::RequestParameters
16
+
17
+ attr_accessor id: String
18
+
19
+ attr_accessor locale: Dodopayments::Models::locale
20
+
21
+ attr_accessor description: String?
22
+
23
+ attr_accessor name: String?
24
+
25
+ def initialize: (
26
+ id: String,
27
+ locale: Dodopayments::Models::locale,
28
+ ?description: String?,
29
+ ?name: String?,
30
+ ?request_options: Dodopayments::request_opts
31
+ ) -> void
32
+
33
+ def to_hash: -> {
34
+ id: String,
35
+ locale: Dodopayments::Models::locale,
36
+ description: String?,
37
+ name: String?,
38
+ request_options: Dodopayments::RequestOptions
39
+ }
40
+ end
41
+ end
42
+ end
43
+ end
@@ -111,6 +111,7 @@ module Dodopayments
111
111
  | :dodo_fixed_fee
112
112
  | :interchange_fee
113
113
  | :scheme_fee
114
+ | :opening_balance
114
115
 
115
116
  module EventType
116
117
  extend Dodopayments::Internal::Type::Enum
@@ -149,6 +150,7 @@ module Dodopayments
149
150
  DODO_FIXED_FEE: :dodo_fixed_fee
150
151
  INTERCHANGE_FEE: :interchange_fee
151
152
  SCHEME_FEE: :scheme_fee
153
+ OPENING_BALANCE: :opening_balance
152
154
 
153
155
  def self?.values: -> ::Array[Dodopayments::Models::BalanceLedgerEntry::event_type]
154
156
  end
@@ -411,6 +411,7 @@ module Dodopayments
411
411
  | :dodo_fixed_fee
412
412
  | :interchange_fee
413
413
  | :scheme_fee
414
+ | :opening_balance
414
415
 
415
416
  module EventType
416
417
  extend Dodopayments::Internal::Type::Enum
@@ -449,6 +450,7 @@ module Dodopayments
449
450
  DODO_FIXED_FEE: :dodo_fixed_fee
450
451
  INTERCHANGE_FEE: :interchange_fee
451
452
  SCHEME_FEE: :scheme_fee
453
+ OPENING_BALANCE: :opening_balance
452
454
 
453
455
  def self?.values: -> ::Array[Dodopayments::Models::BalanceRetrieveLedgerParams::event_type]
454
456
  end
@@ -1,15 +1,25 @@
1
1
  module Dodopayments
2
2
  module Models
3
3
  type checkout_session_preview_params =
4
- { } & Dodopayments::Internal::Type::request_parameters
4
+ { locale: String } & Dodopayments::Internal::Type::request_parameters
5
5
 
6
6
  class CheckoutSessionPreviewParams < Dodopayments::Models::CheckoutSessionRequest
7
7
  extend Dodopayments::Internal::Type::RequestParameters::Converter
8
8
  include Dodopayments::Internal::Type::RequestParameters
9
9
 
10
- def initialize: (?request_options: Dodopayments::request_opts) -> void
10
+ def locale: -> String?
11
11
 
12
- def to_hash: -> { request_options: Dodopayments::RequestOptions }
12
+ def locale=: (String _) -> String
13
+
14
+ def initialize: (
15
+ ?locale: String,
16
+ ?request_options: Dodopayments::request_opts
17
+ ) -> void
18
+
19
+ def to_hash: -> {
20
+ locale: String,
21
+ request_options: Dodopayments::RequestOptions
22
+ }
13
23
  end
14
24
  end
15
25
  end
@@ -5,7 +5,8 @@ module Dodopayments
5
5
  email: String,
6
6
  name: String,
7
7
  create_new_customer: bool,
8
- phone_number: String?
8
+ phone_number: String?,
9
+ preferred_locale: Dodopayments::Models::locale?
9
10
  }
10
11
 
11
12
  class CreateNewCustomer < Dodopayments::Internal::Type::BaseModel
@@ -19,18 +20,22 @@ module Dodopayments
19
20
 
20
21
  attr_accessor phone_number: String?
21
22
 
23
+ attr_accessor preferred_locale: Dodopayments::Models::locale?
24
+
22
25
  def initialize: (
23
26
  email: String,
24
27
  name: String,
25
28
  ?create_new_customer: bool,
26
- ?phone_number: String?
29
+ ?phone_number: String?,
30
+ ?preferred_locale: Dodopayments::Models::locale?
27
31
  ) -> void
28
32
 
29
33
  def to_hash: -> {
30
34
  email: String,
31
35
  name: String,
32
36
  create_new_customer: bool,
33
- phone_number: String?
37
+ phone_number: String?,
38
+ preferred_locale: Dodopayments::Models::locale?
34
39
  }
35
40
  end
36
41
  end