dodopayments 2.33.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 (277) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/dodopayments/internal/type/enum.rb +11 -11
  5. data/lib/dodopayments/models/addon_delete_params.rb +20 -0
  6. data/lib/dodopayments/models/addon_list_params.rb +25 -1
  7. data/lib/dodopayments/models/addon_retrieve_params.rb +18 -1
  8. data/lib/dodopayments/models/addon_unarchive_params.rb +20 -0
  9. data/lib/dodopayments/models/addons/translation_delete_params.rb +36 -0
  10. data/lib/dodopayments/models/addons/translation_list_params.rb +35 -0
  11. data/lib/dodopayments/models/addons/translation_update_params.rb +52 -0
  12. data/lib/dodopayments/models/balance_ledger_entry.rb +1 -0
  13. data/lib/dodopayments/models/balance_retrieve_ledger_params.rb +1 -0
  14. data/lib/dodopayments/models/charge_type.rb +33 -0
  15. data/lib/dodopayments/models/checkout_session_preview_params.rb +17 -1
  16. data/lib/dodopayments/models/checkout_session_preview_response.rb +12 -1
  17. data/lib/dodopayments/models/create_new_customer.rb +12 -1
  18. data/lib/dodopayments/models/credit_entitlement_list_params.rb +17 -1
  19. data/lib/dodopayments/models/credit_entitlement_retrieve_params.rb +18 -1
  20. data/lib/dodopayments/models/credit_entitlements/credit_entitlement_translation.rb +47 -0
  21. data/lib/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rb +23 -0
  22. data/lib/dodopayments/models/credit_entitlements/translation_delete_params.rb +37 -0
  23. data/lib/dodopayments/models/credit_entitlements/translation_list_params.rb +36 -0
  24. data/lib/dodopayments/models/credit_entitlements/translation_update_params.rb +53 -0
  25. data/lib/dodopayments/models/customer.rb +9 -1
  26. data/lib/dodopayments/models/customer_create_params.rb +14 -1
  27. data/lib/dodopayments/models/customer_update_params.rb +14 -1
  28. data/lib/dodopayments/models/entitlement_list_params.rb +17 -1
  29. data/lib/dodopayments/models/entitlement_retrieve_params.rb +18 -1
  30. data/lib/dodopayments/models/entitlements/entitlement_translation.rb +67 -0
  31. data/lib/dodopayments/models/entitlements/entitlement_translations_list_response.rb +23 -0
  32. data/lib/dodopayments/models/entitlements/translation_delete_params.rb +36 -0
  33. data/lib/dodopayments/models/entitlements/translation_list_params.rb +35 -0
  34. data/lib/dodopayments/models/entitlements/translation_update_params.rb +69 -0
  35. data/lib/dodopayments/models/invoices/payment_retrieve_params.rb +14 -1
  36. data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +14 -1
  37. data/lib/dodopayments/models/invoices/payment_retrieve_refund_params.rb +14 -1
  38. data/lib/dodopayments/models/locale.rb +38 -0
  39. data/lib/dodopayments/models/locale_info.rb +34 -0
  40. data/lib/dodopayments/models/meter_list_params.rb +17 -1
  41. data/lib/dodopayments/models/meter_retrieve_params.rb +18 -1
  42. data/lib/dodopayments/models/meter_update_params.rb +49 -0
  43. data/lib/dodopayments/models/meters/translation_delete_params.rb +36 -0
  44. data/lib/dodopayments/models/meters/translation_list_params.rb +35 -0
  45. data/lib/dodopayments/models/meters/translation_update_params.rb +52 -0
  46. data/lib/dodopayments/models/misc_list_locales_params.rb +14 -0
  47. data/lib/dodopayments/models/misc_list_locales_response.rb +8 -0
  48. data/lib/dodopayments/models/payment.rb +85 -8
  49. data/lib/dodopayments/models/payment_list_response.rb +91 -6
  50. data/lib/dodopayments/models/payment_retrieve_line_items_params.rb +14 -1
  51. data/lib/dodopayments/models/payment_retrieve_line_items_response.rb +10 -1
  52. data/lib/dodopayments/models/payouts/breakup/detail_list_response.rb +3 -1
  53. data/lib/dodopayments/models/payouts/breakup_retrieve_response.rb +2 -1
  54. data/lib/dodopayments/models/price.rb +56 -20
  55. data/lib/dodopayments/models/product_collection_list_params.rb +17 -1
  56. data/lib/dodopayments/models/product_collection_retrieve_params.rb +18 -1
  57. data/lib/dodopayments/models/product_collections/group_update_params.rb +2 -1
  58. data/lib/dodopayments/models/product_collections/translation_delete_params.rb +37 -0
  59. data/lib/dodopayments/models/product_collections/translation_list_params.rb +36 -0
  60. data/lib/dodopayments/models/product_collections/translation_update_params.rb +53 -0
  61. data/lib/dodopayments/models/product_list_params.rb +14 -1
  62. data/lib/dodopayments/models/product_retrieve_params.rb +18 -1
  63. data/lib/dodopayments/models/products/translation.rb +50 -0
  64. data/lib/dodopayments/models/products/translation_delete_params.rb +36 -0
  65. data/lib/dodopayments/models/products/translation_list_params.rb +35 -0
  66. data/lib/dodopayments/models/products/translation_update_params.rb +52 -0
  67. data/lib/dodopayments/models/products/translations_list_response.rb +20 -0
  68. data/lib/dodopayments/models/refund_create_params.rb +13 -1
  69. data/lib/dodopayments/models/subscription_list_params.rb +14 -1
  70. data/lib/dodopayments/models/subscription_retrieve_params.rb +18 -1
  71. data/lib/dodopayments/models/subscription_service_period.rb +12 -1
  72. data/lib/dodopayments/models/three_ds_flow.rb +16 -0
  73. data/lib/dodopayments/models/three_ds_status.rb +21 -0
  74. data/lib/dodopayments/models/update_subscription_plan_req.rb +10 -0
  75. data/lib/dodopayments/models.rb +22 -0
  76. data/lib/dodopayments/resources/addons/translations.rb +110 -0
  77. data/lib/dodopayments/resources/addons.rb +58 -3
  78. data/lib/dodopayments/resources/checkout_sessions.rb +31 -26
  79. data/lib/dodopayments/resources/credit_entitlements/translations.rb +113 -0
  80. data/lib/dodopayments/resources/credit_entitlements.rb +20 -3
  81. data/lib/dodopayments/resources/customers.rb +12 -2
  82. data/lib/dodopayments/resources/entitlements/translations.rb +114 -0
  83. data/lib/dodopayments/resources/entitlements.rb +20 -3
  84. data/lib/dodopayments/resources/invoices/payments.rb +30 -6
  85. data/lib/dodopayments/resources/meters/translations.rb +110 -0
  86. data/lib/dodopayments/resources/meters.rb +49 -3
  87. data/lib/dodopayments/resources/misc.rb +18 -0
  88. data/lib/dodopayments/resources/payments.rb +10 -2
  89. data/lib/dodopayments/resources/payouts/breakup/details.rb +5 -2
  90. data/lib/dodopayments/resources/payouts/breakup.rb +4 -1
  91. data/lib/dodopayments/resources/product_collections/translations.rb +113 -0
  92. data/lib/dodopayments/resources/product_collections.rb +20 -3
  93. data/lib/dodopayments/resources/products/translations.rb +110 -0
  94. data/lib/dodopayments/resources/products.rb +17 -3
  95. data/lib/dodopayments/resources/refunds.rb +6 -1
  96. data/lib/dodopayments/resources/subscriptions.rb +13 -3
  97. data/lib/dodopayments/version.rb +1 -1
  98. data/lib/dodopayments.rb +40 -0
  99. data/rbi/dodopayments/models/addon_delete_params.rbi +38 -0
  100. data/rbi/dodopayments/models/addon_list_params.rbi +32 -0
  101. data/rbi/dodopayments/models/addon_retrieve_params.rbi +29 -2
  102. data/rbi/dodopayments/models/addon_unarchive_params.rbi +38 -0
  103. data/rbi/dodopayments/models/addons/translation_delete_params.rbi +58 -0
  104. data/rbi/dodopayments/models/addons/translation_list_params.rbi +59 -0
  105. data/rbi/dodopayments/models/addons/translation_update_params.rbi +74 -0
  106. data/rbi/dodopayments/models/balance_ledger_entry.rbi +5 -0
  107. data/rbi/dodopayments/models/balance_retrieve_ledger_params.rbi +5 -0
  108. data/rbi/dodopayments/models/charge_type.rbi +37 -0
  109. data/rbi/dodopayments/models/checkout_session_preview_params.rbi +29 -5
  110. data/rbi/dodopayments/models/checkout_session_preview_response.rbi +14 -0
  111. data/rbi/dodopayments/models/create_new_customer.rbi +17 -3
  112. data/rbi/dodopayments/models/credit_entitlement_list_params.rbi +21 -0
  113. data/rbi/dodopayments/models/credit_entitlement_retrieve_params.rbi +29 -2
  114. data/rbi/dodopayments/models/credit_entitlements/credit_entitlement_translation.rbi +70 -0
  115. data/rbi/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rbi +54 -0
  116. data/rbi/dodopayments/models/credit_entitlements/translation_delete_params.rbi +58 -0
  117. data/rbi/dodopayments/models/credit_entitlements/translation_list_params.rbi +59 -0
  118. data/rbi/dodopayments/models/credit_entitlements/translation_update_params.rbi +74 -0
  119. data/rbi/dodopayments/models/customer.rbi +11 -3
  120. data/rbi/dodopayments/models/customer_create_params.rbi +12 -0
  121. data/rbi/dodopayments/models/customer_update_params.rbi +12 -0
  122. data/rbi/dodopayments/models/entitlement_list_params.rbi +21 -0
  123. data/rbi/dodopayments/models/entitlement_retrieve_params.rbi +29 -2
  124. data/rbi/dodopayments/models/entitlements/entitlement_translation.rbi +87 -0
  125. data/rbi/dodopayments/models/entitlements/entitlement_translations_list_response.rbi +48 -0
  126. data/rbi/dodopayments/models/entitlements/translation_delete_params.rbi +58 -0
  127. data/rbi/dodopayments/models/entitlements/translation_list_params.rbi +59 -0
  128. data/rbi/dodopayments/models/entitlements/translation_update_params.rbi +92 -0
  129. data/rbi/dodopayments/models/invoices/payment_retrieve_params.rbi +17 -1
  130. data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +21 -2
  131. data/rbi/dodopayments/models/invoices/payment_retrieve_refund_params.rbi +21 -2
  132. data/rbi/dodopayments/models/locale.rbi +42 -0
  133. data/rbi/dodopayments/models/locale_info.rbi +54 -0
  134. data/rbi/dodopayments/models/meter_list_params.rbi +21 -0
  135. data/rbi/dodopayments/models/meter_retrieve_params.rbi +29 -2
  136. data/rbi/dodopayments/models/meter_update_params.rbi +70 -0
  137. data/rbi/dodopayments/models/meters/translation_delete_params.rbi +58 -0
  138. data/rbi/dodopayments/models/meters/translation_list_params.rbi +59 -0
  139. data/rbi/dodopayments/models/meters/translation_update_params.rbi +74 -0
  140. data/rbi/dodopayments/models/misc_list_locales_params.rbi +32 -0
  141. data/rbi/dodopayments/models/misc_list_locales_response.rbi +11 -0
  142. data/rbi/dodopayments/models/payment.rbi +103 -8
  143. data/rbi/dodopayments/models/payment_list_response.rbi +112 -9
  144. data/rbi/dodopayments/models/payment_retrieve_line_items_params.rbi +21 -2
  145. data/rbi/dodopayments/models/payment_retrieve_line_items_response.rbi +14 -3
  146. data/rbi/dodopayments/models/payouts/breakup/detail_list_response.rbi +6 -2
  147. data/rbi/dodopayments/models/payouts/breakup_retrieve_response.rbi +4 -2
  148. data/rbi/dodopayments/models/price.rbi +96 -24
  149. data/rbi/dodopayments/models/product_collection_list_params.rbi +21 -0
  150. data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +29 -2
  151. data/rbi/dodopayments/models/product_collections/group_update_params.rbi +4 -2
  152. data/rbi/dodopayments/models/product_collections/translation_delete_params.rbi +58 -0
  153. data/rbi/dodopayments/models/product_collections/translation_list_params.rbi +59 -0
  154. data/rbi/dodopayments/models/product_collections/translation_update_params.rbi +74 -0
  155. data/rbi/dodopayments/models/product_list_params.rbi +21 -0
  156. data/rbi/dodopayments/models/product_retrieve_params.rbi +29 -2
  157. data/rbi/dodopayments/models/products/translation.rbi +70 -0
  158. data/rbi/dodopayments/models/products/translation_delete_params.rbi +58 -0
  159. data/rbi/dodopayments/models/products/translation_list_params.rbi +59 -0
  160. data/rbi/dodopayments/models/products/translation_update_params.rbi +74 -0
  161. data/rbi/dodopayments/models/products/translations_list_response.rbi +37 -0
  162. data/rbi/dodopayments/models/refund_create_params.rbi +10 -0
  163. data/rbi/dodopayments/models/subscription_list_params.rbi +21 -0
  164. data/rbi/dodopayments/models/subscription_retrieve_params.rbi +25 -1
  165. data/rbi/dodopayments/models/subscription_service_period.rbi +24 -4
  166. data/rbi/dodopayments/models/three_ds_flow.rbi +23 -0
  167. data/rbi/dodopayments/models/three_ds_status.rbi +31 -0
  168. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +15 -0
  169. data/rbi/dodopayments/models.rbi +22 -0
  170. data/rbi/dodopayments/resources/addons/translations.rbi +77 -0
  171. data/rbi/dodopayments/resources/addons.rbi +48 -0
  172. data/rbi/dodopayments/resources/checkout_sessions.rbi +55 -39
  173. data/rbi/dodopayments/resources/credit_entitlements/translations.rbi +81 -0
  174. data/rbi/dodopayments/resources/credit_entitlements.rbi +19 -0
  175. data/rbi/dodopayments/resources/customers.rbi +10 -0
  176. data/rbi/dodopayments/resources/entitlements/translations.rbi +87 -0
  177. data/rbi/dodopayments/resources/entitlements.rbi +19 -0
  178. data/rbi/dodopayments/resources/invoices/payments.rbi +12 -0
  179. data/rbi/dodopayments/resources/meters/translations.rbi +77 -0
  180. data/rbi/dodopayments/resources/meters.rbi +42 -0
  181. data/rbi/dodopayments/resources/misc.rbi +9 -0
  182. data/rbi/dodopayments/resources/payments.rbi +4 -0
  183. data/rbi/dodopayments/resources/payouts/breakup/details.rbi +5 -2
  184. data/rbi/dodopayments/resources/payouts/breakup.rbi +4 -1
  185. data/rbi/dodopayments/resources/product_collections/groups.rbi +2 -1
  186. data/rbi/dodopayments/resources/product_collections/translations.rbi +77 -0
  187. data/rbi/dodopayments/resources/product_collections.rbi +19 -0
  188. data/rbi/dodopayments/resources/products/translations.rbi +77 -0
  189. data/rbi/dodopayments/resources/products.rbi +19 -0
  190. data/rbi/dodopayments/resources/refunds.rbi +4 -0
  191. data/rbi/dodopayments/resources/subscriptions.rbi +26 -0
  192. data/sig/dodopayments/models/addon_delete_params.rbs +23 -0
  193. data/sig/dodopayments/models/addon_list_params.rbs +18 -1
  194. data/sig/dodopayments/models/addon_retrieve_params.rbs +8 -1
  195. data/sig/dodopayments/models/addon_unarchive_params.rbs +23 -0
  196. data/sig/dodopayments/models/addons/translation_delete_params.rbs +30 -0
  197. data/sig/dodopayments/models/addons/translation_list_params.rbs +32 -0
  198. data/sig/dodopayments/models/addons/translation_update_params.rbs +43 -0
  199. data/sig/dodopayments/models/balance_ledger_entry.rbs +2 -0
  200. data/sig/dodopayments/models/balance_retrieve_ledger_params.rbs +2 -0
  201. data/sig/dodopayments/models/charge_type.rbs +16 -0
  202. data/sig/dodopayments/models/checkout_session_preview_params.rbs +13 -3
  203. data/sig/dodopayments/models/checkout_session_preview_response.rbs +5 -0
  204. data/sig/dodopayments/models/create_new_customer.rbs +8 -3
  205. data/sig/dodopayments/models/credit_entitlement_list_params.rbs +12 -1
  206. data/sig/dodopayments/models/credit_entitlement_retrieve_params.rbs +8 -1
  207. data/sig/dodopayments/models/credit_entitlements/credit_entitlement_translation.rbs +39 -0
  208. data/sig/dodopayments/models/credit_entitlements/credit_entitlement_translations_list_response.rbs +24 -0
  209. data/sig/dodopayments/models/credit_entitlements/translation_delete_params.rbs +30 -0
  210. data/sig/dodopayments/models/credit_entitlements/translation_list_params.rbs +32 -0
  211. data/sig/dodopayments/models/credit_entitlements/translation_update_params.rbs +43 -0
  212. data/sig/dodopayments/models/customer.rbs +8 -3
  213. data/sig/dodopayments/models/customer_create_params.rbs +6 -1
  214. data/sig/dodopayments/models/customer_update_params.rbs +6 -1
  215. data/sig/dodopayments/models/entitlement_list_params.rbs +7 -0
  216. data/sig/dodopayments/models/entitlement_retrieve_params.rbs +8 -1
  217. data/sig/dodopayments/models/entitlements/entitlement_translation.rbs +49 -0
  218. data/sig/dodopayments/models/entitlements/entitlement_translations_list_response.rbs +22 -0
  219. data/sig/dodopayments/models/entitlements/translation_delete_params.rbs +30 -0
  220. data/sig/dodopayments/models/entitlements/translation_list_params.rbs +32 -0
  221. data/sig/dodopayments/models/entitlements/translation_update_params.rbs +53 -0
  222. data/sig/dodopayments/models/invoices/payment_retrieve_params.rbs +7 -1
  223. data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +8 -1
  224. data/sig/dodopayments/models/invoices/payment_retrieve_refund_params.rbs +8 -1
  225. data/sig/dodopayments/models/locale.rbs +56 -0
  226. data/sig/dodopayments/models/locale_info.rbs +26 -0
  227. data/sig/dodopayments/models/meter_list_params.rbs +12 -1
  228. data/sig/dodopayments/models/meter_retrieve_params.rbs +8 -1
  229. data/sig/dodopayments/models/meter_update_params.rbs +41 -0
  230. data/sig/dodopayments/models/meters/translation_delete_params.rbs +30 -0
  231. data/sig/dodopayments/models/meters/translation_list_params.rbs +32 -0
  232. data/sig/dodopayments/models/meters/translation_update_params.rbs +43 -0
  233. data/sig/dodopayments/models/misc_list_locales_params.rbs +15 -0
  234. data/sig/dodopayments/models/misc_list_locales_response.rbs +7 -0
  235. data/sig/dodopayments/models/payment.rbs +35 -0
  236. data/sig/dodopayments/models/payment_list_response.rbs +43 -3
  237. data/sig/dodopayments/models/payment_retrieve_line_items_params.rbs +10 -1
  238. data/sig/dodopayments/models/payment_retrieve_line_items_response.rbs +8 -3
  239. data/sig/dodopayments/models/product_collection_list_params.rbs +7 -0
  240. data/sig/dodopayments/models/product_collection_retrieve_params.rbs +8 -1
  241. data/sig/dodopayments/models/product_collections/translation_delete_params.rbs +30 -0
  242. data/sig/dodopayments/models/product_collections/translation_list_params.rbs +32 -0
  243. data/sig/dodopayments/models/product_collections/translation_update_params.rbs +43 -0
  244. data/sig/dodopayments/models/product_list_params.rbs +7 -0
  245. data/sig/dodopayments/models/product_retrieve_params.rbs +8 -1
  246. data/sig/dodopayments/models/products/translation.rbs +37 -0
  247. data/sig/dodopayments/models/products/translation_delete_params.rbs +30 -0
  248. data/sig/dodopayments/models/products/translation_list_params.rbs +32 -0
  249. data/sig/dodopayments/models/products/translation_update_params.rbs +43 -0
  250. data/sig/dodopayments/models/products/translations_list_response.rbs +18 -0
  251. data/sig/dodopayments/models/refund_create_params.rbs +5 -0
  252. data/sig/dodopayments/models/subscription_list_params.rbs +7 -0
  253. data/sig/dodopayments/models/subscription_retrieve_params.rbs +7 -1
  254. data/sig/dodopayments/models/subscription_service_period.rbs +10 -1
  255. data/sig/dodopayments/models/three_ds_flow.rbs +14 -0
  256. data/sig/dodopayments/models/three_ds_status.rbs +24 -0
  257. data/sig/dodopayments/models.rbs +22 -0
  258. data/sig/dodopayments/resources/addons/translations.rbs +29 -0
  259. data/sig/dodopayments/resources/addons.rbs +15 -0
  260. data/sig/dodopayments/resources/checkout_sessions.rbs +1 -0
  261. data/sig/dodopayments/resources/credit_entitlements/translations.rbs +29 -0
  262. data/sig/dodopayments/resources/credit_entitlements.rbs +4 -0
  263. data/sig/dodopayments/resources/customers.rbs +2 -0
  264. data/sig/dodopayments/resources/entitlements/translations.rbs +31 -0
  265. data/sig/dodopayments/resources/entitlements.rbs +4 -0
  266. data/sig/dodopayments/resources/invoices/payments.rbs +3 -0
  267. data/sig/dodopayments/resources/meters/translations.rbs +29 -0
  268. data/sig/dodopayments/resources/meters.rbs +12 -0
  269. data/sig/dodopayments/resources/misc.rbs +4 -0
  270. data/sig/dodopayments/resources/payments.rbs +1 -0
  271. data/sig/dodopayments/resources/product_collections/translations.rbs +29 -0
  272. data/sig/dodopayments/resources/product_collections.rbs +4 -0
  273. data/sig/dodopayments/resources/products/translations.rbs +29 -0
  274. data/sig/dodopayments/resources/products.rbs +4 -0
  275. data/sig/dodopayments/resources/refunds.rbs +1 -0
  276. data/sig/dodopayments/resources/subscriptions.rbs +2 -0
  277. metadata +122 -2
@@ -17,18 +17,45 @@ module Dodopayments
17
17
  sig { returns(String) }
18
18
  attr_accessor :id
19
19
 
20
+ # Shows the translated name, description and unit of the catalog entities in this
21
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
22
+ # with no translation, an unknown code, or no code shows the base text.
23
+ #
24
+ # Do not send a text from a localized response back in a create or update request.
25
+ # The base text then changes to the translated text.
26
+ sig { returns(T.nilable(String)) }
27
+ attr_reader :locale
28
+
29
+ sig { params(locale: String).void }
30
+ attr_writer :locale
31
+
20
32
  sig do
21
33
  params(
22
34
  id: String,
35
+ locale: String,
23
36
  request_options: Dodopayments::RequestOptions::OrHash
24
37
  ).returns(T.attached_class)
25
38
  end
26
- def self.new(id:, request_options: {})
39
+ def self.new(
40
+ id:,
41
+ # Shows the translated name, description and unit of the catalog entities in this
42
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
43
+ # with no translation, an unknown code, or no code shows the base text.
44
+ #
45
+ # Do not send a text from a localized response back in a create or update request.
46
+ # The base text then changes to the translated text.
47
+ locale: nil,
48
+ request_options: {}
49
+ )
27
50
  end
28
51
 
29
52
  sig do
30
53
  override.returns(
31
- { id: String, request_options: Dodopayments::RequestOptions }
54
+ {
55
+ id: String,
56
+ locale: String,
57
+ request_options: Dodopayments::RequestOptions
58
+ }
32
59
  )
33
60
  end
34
61
  def to_hash
@@ -0,0 +1,70 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class Translation < Dodopayments::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Dodopayments::Products::Translation,
11
+ Dodopayments::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The locale of the translation.
16
+ sig { returns(Dodopayments::Locale::TaggedSymbol) }
17
+ attr_accessor :locale
18
+
19
+ # The time of the last change.
20
+ sig { returns(Time) }
21
+ attr_accessor :updated_at
22
+
23
+ # The translated description. `null` shows that the description has no
24
+ # translation.
25
+ sig { returns(T.nilable(String)) }
26
+ attr_accessor :description
27
+
28
+ # The translated name. `null` shows that the name has no translation.
29
+ sig { returns(T.nilable(String)) }
30
+ attr_accessor :name
31
+
32
+ # The translation of a product, an add-on, a product collection or a meter in one
33
+ # locale.
34
+ sig do
35
+ params(
36
+ locale: Dodopayments::Locale::OrSymbol,
37
+ updated_at: Time,
38
+ description: T.nilable(String),
39
+ name: T.nilable(String)
40
+ ).returns(T.attached_class)
41
+ end
42
+ def self.new(
43
+ # The locale of the translation.
44
+ locale:,
45
+ # The time of the last change.
46
+ updated_at:,
47
+ # The translated description. `null` shows that the description has no
48
+ # translation.
49
+ description: nil,
50
+ # The translated name. `null` shows that the name has no translation.
51
+ name: nil
52
+ )
53
+ end
54
+
55
+ sig do
56
+ override.returns(
57
+ {
58
+ locale: Dodopayments::Locale::TaggedSymbol,
59
+ updated_at: Time,
60
+ description: T.nilable(String),
61
+ name: T.nilable(String)
62
+ }
63
+ )
64
+ end
65
+ def to_hash
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,58 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class TranslationDeleteParams < 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::Products::TranslationDeleteParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :id
20
+
21
+ # A locale that the checkout and the customer portal can show.
22
+ #
23
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
24
+ sig { returns(Dodopayments::Locale::OrSymbol) }
25
+ attr_accessor :locale
26
+
27
+ sig do
28
+ params(
29
+ id: String,
30
+ locale: Dodopayments::Locale::OrSymbol,
31
+ request_options: Dodopayments::RequestOptions::OrHash
32
+ ).returns(T.attached_class)
33
+ end
34
+ def self.new(
35
+ id:,
36
+ # A locale that the checkout and the customer portal can show.
37
+ #
38
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
39
+ locale:,
40
+ request_options: {}
41
+ )
42
+ end
43
+
44
+ sig do
45
+ override.returns(
46
+ {
47
+ id: String,
48
+ locale: Dodopayments::Locale::OrSymbol,
49
+ request_options: Dodopayments::RequestOptions
50
+ }
51
+ )
52
+ end
53
+ def to_hash
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,59 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class TranslationListParams < 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::Products::TranslationListParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :id
20
+
21
+ # Returns only these locales, for example `?locale=fr&locale=de`. With no value,
22
+ # the response has all the locales.
23
+ sig { returns(T.nilable(T::Array[String])) }
24
+ attr_reader :locale
25
+
26
+ sig { params(locale: T::Array[String]).void }
27
+ attr_writer :locale
28
+
29
+ sig do
30
+ params(
31
+ id: String,
32
+ locale: T::Array[String],
33
+ request_options: Dodopayments::RequestOptions::OrHash
34
+ ).returns(T.attached_class)
35
+ end
36
+ def self.new(
37
+ id:,
38
+ # Returns only these locales, for example `?locale=fr&locale=de`. With no value,
39
+ # the response has all the locales.
40
+ locale: nil,
41
+ request_options: {}
42
+ )
43
+ end
44
+
45
+ sig do
46
+ override.returns(
47
+ {
48
+ id: String,
49
+ locale: T::Array[String],
50
+ request_options: Dodopayments::RequestOptions
51
+ }
52
+ )
53
+ end
54
+ def to_hash
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class TranslationUpdateParams < 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::Products::TranslationUpdateParams,
14
+ Dodopayments::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :id
20
+
21
+ # A locale that the checkout and the customer portal can show.
22
+ #
23
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
24
+ sig { returns(Dodopayments::Locale::OrSymbol) }
25
+ attr_accessor :locale
26
+
27
+ # The translated description.
28
+ sig { returns(T.nilable(String)) }
29
+ attr_accessor :description
30
+
31
+ # The translated name.
32
+ sig { returns(T.nilable(String)) }
33
+ attr_accessor :name
34
+
35
+ sig do
36
+ params(
37
+ id: String,
38
+ locale: Dodopayments::Locale::OrSymbol,
39
+ description: T.nilable(String),
40
+ name: T.nilable(String),
41
+ request_options: Dodopayments::RequestOptions::OrHash
42
+ ).returns(T.attached_class)
43
+ end
44
+ def self.new(
45
+ id:,
46
+ # A locale that the checkout and the customer portal can show.
47
+ #
48
+ # The codes are a copy of the checkout locales. `GET /locales` lists them.
49
+ locale:,
50
+ # The translated description.
51
+ description: nil,
52
+ # The translated name.
53
+ name: nil,
54
+ request_options: {}
55
+ )
56
+ end
57
+
58
+ sig do
59
+ override.returns(
60
+ {
61
+ id: String,
62
+ locale: Dodopayments::Locale::OrSymbol,
63
+ description: T.nilable(String),
64
+ name: T.nilable(String),
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,37 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module Products
6
+ class TranslationsListResponse < Dodopayments::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Dodopayments::Products::TranslationsListResponse,
11
+ Dodopayments::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(T::Array[Dodopayments::Products::Translation]) }
16
+ attr_accessor :items
17
+
18
+ # The translations of a product, an add-on, a product collection or a meter.
19
+ sig do
20
+ params(
21
+ items: T::Array[Dodopayments::Products::Translation::OrHash]
22
+ ).returns(T.attached_class)
23
+ end
24
+ def self.new(items:)
25
+ end
26
+
27
+ sig do
28
+ override.returns(
29
+ { items: T::Array[Dodopayments::Products::Translation] }
30
+ )
31
+ end
32
+ def to_hash
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -18,6 +18,11 @@ module Dodopayments
18
18
  sig { returns(String) }
19
19
  attr_accessor :payment_id
20
20
 
21
+ # The currency of every `items[].amount`. It must be the currency the customer
22
+ # paid in. Without it, the amounts are in the settlement currency.
23
+ sig { returns(T.nilable(Dodopayments::Currency::OrSymbol)) }
24
+ attr_accessor :currency
25
+
21
26
  # Partially Refund an Individual Item
22
27
  sig do
23
28
  returns(T.nilable(T::Array[Dodopayments::RefundCreateParams::Item]))
@@ -46,6 +51,7 @@ module Dodopayments
46
51
  sig do
47
52
  params(
48
53
  payment_id: String,
54
+ currency: T.nilable(Dodopayments::Currency::OrSymbol),
49
55
  items:
50
56
  T.nilable(T::Array[Dodopayments::RefundCreateParams::Item::OrHash]),
51
57
  metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
@@ -56,6 +62,9 @@ module Dodopayments
56
62
  def self.new(
57
63
  # The unique identifier of the payment to be refunded.
58
64
  payment_id:,
65
+ # The currency of every `items[].amount`. It must be the currency the customer
66
+ # paid in. Without it, the amounts are in the settlement currency.
67
+ currency: nil,
59
68
  # Partially Refund an Individual Item
60
69
  items: nil,
61
70
  # Additional metadata associated with the refund.
@@ -70,6 +79,7 @@ module Dodopayments
70
79
  override.returns(
71
80
  {
72
81
  payment_id: String,
82
+ currency: T.nilable(Dodopayments::Currency::OrSymbol),
73
83
  items: T.nilable(T::Array[Dodopayments::RefundCreateParams::Item]),
74
84
  metadata: T::Hash[Symbol, Dodopayments::MetadataItem::Variants],
75
85
  reason: T.nilable(String),
@@ -49,6 +49,18 @@ module Dodopayments
49
49
  sig { params(customer_id: String).void }
50
50
  attr_writer :customer_id
51
51
 
52
+ # Shows the translated name, description and unit of the catalog entities in this
53
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
54
+ # with no translation, an unknown code, or no code shows the base text.
55
+ #
56
+ # Do not send a text from a localized response back in a create or update request.
57
+ # The base text then changes to the translated text.
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :locale
60
+
61
+ sig { params(locale: String).void }
62
+ attr_writer :locale
63
+
52
64
  # Page number default is 0
53
65
  sig { returns(T.nilable(Integer)) }
54
66
  attr_reader :page_number
@@ -92,6 +104,7 @@ module Dodopayments
92
104
  created_at_gte: Time,
93
105
  created_at_lte: Time,
94
106
  customer_id: String,
107
+ locale: String,
95
108
  page_number: Integer,
96
109
  page_size: Integer,
97
110
  product_id: String,
@@ -110,6 +123,13 @@ module Dodopayments
110
123
  created_at_lte: nil,
111
124
  # Filter by customer id
112
125
  customer_id: nil,
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,
113
133
  # Page number default is 0
114
134
  page_number: nil,
115
135
  # Page size default is 10 max is 100
@@ -130,6 +150,7 @@ module Dodopayments
130
150
  created_at_gte: Time,
131
151
  created_at_lte: Time,
132
152
  customer_id: String,
153
+ locale: String,
133
154
  page_number: Integer,
134
155
  page_size: Integer,
135
156
  product_id: String,
@@ -17,19 +17,43 @@ module Dodopayments
17
17
  sig { returns(String) }
18
18
  attr_accessor :subscription_id
19
19
 
20
+ # Shows the translated name, description and unit of the catalog entities in this
21
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
22
+ # with no translation, an unknown code, or no code shows the base text.
23
+ #
24
+ # Do not send a text from a localized response back in a create or update request.
25
+ # The base text then changes to the translated text.
26
+ sig { returns(T.nilable(String)) }
27
+ attr_reader :locale
28
+
29
+ sig { params(locale: String).void }
30
+ attr_writer :locale
31
+
20
32
  sig do
21
33
  params(
22
34
  subscription_id: String,
35
+ locale: String,
23
36
  request_options: Dodopayments::RequestOptions::OrHash
24
37
  ).returns(T.attached_class)
25
38
  end
26
- def self.new(subscription_id:, request_options: {})
39
+ def self.new(
40
+ subscription_id:,
41
+ # Shows the translated name, description and unit of the catalog entities in this
42
+ # locale. The value must be a code from `GET /locales`, for example `fr`. A field
43
+ # with no translation, an unknown code, or no code shows the base text.
44
+ #
45
+ # Do not send a text from a localized response back in a create or update request.
46
+ # The base text then changes to the translated text.
47
+ locale: nil,
48
+ request_options: {}
49
+ )
27
50
  end
28
51
 
29
52
  sig do
30
53
  override.returns(
31
54
  {
32
55
  subscription_id: String,
56
+ locale: String,
33
57
  request_options: Dodopayments::RequestOptions
34
58
  }
35
59
  )
@@ -15,6 +15,13 @@ module Dodopayments
15
15
  sig { returns(Time) }
16
16
  attr_accessor :ends_at
17
17
 
18
+ # The part of one full billing period that the plan charge pays for. The value
19
+ # `"1"` is a full period. A value less than 1 is a partial period, for example
20
+ # after a plan change that keeps the billing cycle. For a plan change, this is the
21
+ # value of the new plan. The credit for the old plan is not in this value.
22
+ sig { returns(String) }
23
+ attr_accessor :proration_factor
24
+
18
25
  # Start of the service period. For a renewal, this is the billing date. For a plan
19
26
  # change that applies at the next billing date, this is the time when the change
20
27
  # applied. This time can be some minutes after the billing date.
@@ -27,13 +34,21 @@ module Dodopayments
27
34
 
28
35
  # The service period that a payment pays for, for one subscription.
29
36
  sig do
30
- params(ends_at: Time, starts_at: Time, subscription_id: String).returns(
31
- T.attached_class
32
- )
37
+ params(
38
+ ends_at: Time,
39
+ proration_factor: String,
40
+ starts_at: Time,
41
+ subscription_id: String
42
+ ).returns(T.attached_class)
33
43
  end
34
44
  def self.new(
35
45
  # End of the service period.
36
46
  ends_at:,
47
+ # The part of one full billing period that the plan charge pays for. The value
48
+ # `"1"` is a full period. A value less than 1 is a partial period, for example
49
+ # after a plan change that keeps the billing cycle. For a plan change, this is the
50
+ # value of the new plan. The credit for the old plan is not in this value.
51
+ proration_factor:,
37
52
  # Start of the service period. For a renewal, this is the billing date. For a plan
38
53
  # change that applies at the next billing date, this is the time when the change
39
54
  # applied. This time can be some minutes after the billing date.
@@ -45,7 +60,12 @@ module Dodopayments
45
60
 
46
61
  sig do
47
62
  override.returns(
48
- { ends_at: Time, starts_at: Time, subscription_id: String }
63
+ {
64
+ ends_at: Time,
65
+ proration_factor: String,
66
+ starts_at: Time,
67
+ subscription_id: String
68
+ }
49
69
  )
50
70
  end
51
71
  def to_hash
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # How the cardholder completed the 3DS authentication.
6
+ module ThreeDSFlow
7
+ extend Dodopayments::Internal::Type::Enum
8
+
9
+ TaggedSymbol = T.type_alias { T.all(Symbol, Dodopayments::ThreeDSFlow) }
10
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11
+
12
+ CHALLENGE = T.let(:challenge, Dodopayments::ThreeDSFlow::TaggedSymbol)
13
+ FRICTIONLESS =
14
+ T.let(:frictionless, Dodopayments::ThreeDSFlow::TaggedSymbol)
15
+
16
+ sig do
17
+ override.returns(T::Array[Dodopayments::ThreeDSFlow::TaggedSymbol])
18
+ end
19
+ def self.values
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,31 @@
1
+ # typed: strong
2
+
3
+ module Dodopayments
4
+ module Models
5
+ # The result of the 3DS authentication of a card payment, as the processor reports
6
+ # it.
7
+ module ThreeDSStatus
8
+ extend Dodopayments::Internal::Type::Enum
9
+
10
+ TaggedSymbol = T.type_alias { T.all(Symbol, Dodopayments::ThreeDSStatus) }
11
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
12
+
13
+ AUTHENTICATED =
14
+ T.let(:authenticated, Dodopayments::ThreeDSStatus::TaggedSymbol)
15
+ ATTEMPT_ACKNOWLEDGED =
16
+ T.let(:attempt_acknowledged, Dodopayments::ThreeDSStatus::TaggedSymbol)
17
+ EXEMPTED = T.let(:exempted, Dodopayments::ThreeDSStatus::TaggedSymbol)
18
+ FAILED = T.let(:failed, Dodopayments::ThreeDSStatus::TaggedSymbol)
19
+ NOT_SUPPORTED =
20
+ T.let(:not_supported, Dodopayments::ThreeDSStatus::TaggedSymbol)
21
+ PROCESSING_ERROR =
22
+ T.let(:processing_error, Dodopayments::ThreeDSStatus::TaggedSymbol)
23
+
24
+ sig do
25
+ override.returns(T::Array[Dodopayments::ThreeDSStatus::TaggedSymbol])
26
+ end
27
+ def self.values
28
+ end
29
+ end
30
+ end
31
+ end
@@ -135,6 +135,11 @@ module Dodopayments
135
135
  # - `apply_change` (default): Apply plan change immediately regardless of payment
136
136
  # outcome
137
137
  #
138
+ # With `effective_at: next_billing_date`, the plan change payment replaces the
139
+ # renewal payment. If that payment fails with `prevent_change`, the plan change is
140
+ # cancelled. The subscription then renews on the current plan, with the usual
141
+ # payment retries.
142
+ #
138
143
  # If not specified, uses the business-level default setting.
139
144
  sig do
140
145
  returns(
@@ -252,6 +257,11 @@ module Dodopayments
252
257
  # - `apply_change` (default): Apply plan change immediately regardless of payment
253
258
  # outcome
254
259
  #
260
+ # With `effective_at: next_billing_date`, the plan change payment replaces the
261
+ # renewal payment. If that payment fails with `prevent_change`, the plan change is
262
+ # cancelled. The subscription then renews on the current plan, with the usual
263
+ # payment retries.
264
+ #
255
265
  # If not specified, uses the business-level default setting.
256
266
  on_payment_failure: nil,
257
267
  # The URL that receives the customer after they pay the payment link. Needs
@@ -388,6 +398,11 @@ module Dodopayments
388
398
  # - `apply_change` (default): Apply plan change immediately regardless of payment
389
399
  # outcome
390
400
  #
401
+ # With `effective_at: next_billing_date`, the plan change payment replaces the
402
+ # renewal payment. If that payment fails with `prevent_change`, the plan change is
403
+ # cancelled. The subscription then renews on the current plan, with the usual
404
+ # payment retries.
405
+ #
391
406
  # If not specified, uses the business-level default setting.
392
407
  module OnPaymentFailure
393
408
  extend Dodopayments::Internal::Type::Enum
@@ -13,12 +13,18 @@ module Dodopayments
13
13
 
14
14
  AddonCreateParams = Dodopayments::Models::AddonCreateParams
15
15
 
16
+ AddonDeleteParams = Dodopayments::Models::AddonDeleteParams
17
+
16
18
  AddonListParams = Dodopayments::Models::AddonListParams
17
19
 
18
20
  AddonResponse = Dodopayments::Models::AddonResponse
19
21
 
20
22
  AddonRetrieveParams = Dodopayments::Models::AddonRetrieveParams
21
23
 
24
+ Addons = Dodopayments::Models::Addons
25
+
26
+ AddonUnarchiveParams = Dodopayments::Models::AddonUnarchiveParams
27
+
22
28
  AddonUpdateImagesParams = Dodopayments::Models::AddonUpdateImagesParams
23
29
 
24
30
  AddonUpdateParams = Dodopayments::Models::AddonUpdateParams
@@ -60,6 +66,8 @@ module Dodopayments
60
66
 
61
67
  CbbProrationBehavior = Dodopayments::Models::CbbProrationBehavior
62
68
 
69
+ ChargeType = Dodopayments::Models::ChargeType
70
+
63
71
  CheckoutSessionBillingAddress =
64
72
  Dodopayments::Models::CheckoutSessionBillingAddress
65
73
 
@@ -321,6 +329,10 @@ module Dodopayments
321
329
 
322
330
  LicenseValidateParams = Dodopayments::Models::LicenseValidateParams
323
331
 
332
+ Locale = Dodopayments::Models::Locale
333
+
334
+ LocaleInfo = Dodopayments::Models::LocaleInfo
335
+
324
336
  ManualRetry = Dodopayments::Models::ManualRetry
325
337
 
326
338
  ManualRetryState = Dodopayments::Models::ManualRetryState
@@ -352,8 +364,14 @@ module Dodopayments
352
364
 
353
365
  MeterRetrieveParams = Dodopayments::Models::MeterRetrieveParams
354
366
 
367
+ Meters = Dodopayments::Models::Meters
368
+
355
369
  MeterUnarchiveParams = Dodopayments::Models::MeterUnarchiveParams
356
370
 
371
+ MeterUpdateParams = Dodopayments::Models::MeterUpdateParams
372
+
373
+ MiscListLocalesParams = Dodopayments::Models::MiscListLocalesParams
374
+
357
375
  MiscListSupportedCountriesParams =
358
376
  Dodopayments::Models::MiscListSupportedCountriesParams
359
377
 
@@ -575,6 +593,10 @@ module Dodopayments
575
593
 
576
594
  ThemeModeConfig = Dodopayments::Models::ThemeModeConfig
577
595
 
596
+ ThreeDSFlow = Dodopayments::Models::ThreeDSFlow
597
+
598
+ ThreeDSStatus = Dodopayments::Models::ThreeDSStatus
599
+
578
600
  TimeInterval = Dodopayments::Models::TimeInterval
579
601
 
580
602
  UnsafeUnwrapWebhookEvent = Dodopayments::Models::UnsafeUnwrapWebhookEvent