dodopayments 2.9.1 → 2.11.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 (302) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +9 -9
  4. data/lib/dodopayments/client.rb +4 -0
  5. data/lib/dodopayments/internal/transport/base_client.rb +2 -0
  6. data/lib/dodopayments/internal/type/union.rb +21 -7
  7. data/lib/dodopayments/models/abandoned_checkout_detected_webhook_event.rb +4 -16
  8. data/lib/dodopayments/models/abandoned_checkout_recovered_webhook_event.rb +4 -16
  9. data/lib/dodopayments/models/checkout_session_flags.rb +15 -1
  10. data/lib/dodopayments/models/checkout_session_request.rb +25 -2
  11. data/lib/dodopayments/models/checkout_session_response.rb +33 -1
  12. data/lib/dodopayments/models/credit_added_webhook_event.rb +4 -16
  13. data/lib/dodopayments/models/credit_balance_low_webhook_event.rb +4 -16
  14. data/lib/dodopayments/models/credit_deducted_webhook_event.rb +4 -16
  15. data/lib/dodopayments/models/credit_expired_webhook_event.rb +4 -16
  16. data/lib/dodopayments/models/credit_manual_adjustment_webhook_event.rb +4 -16
  17. data/lib/dodopayments/models/credit_overage_charged_webhook_event.rb +4 -16
  18. data/lib/dodopayments/models/credit_overage_reset_webhook_event.rb +4 -16
  19. data/lib/dodopayments/models/credit_rolled_over_webhook_event.rb +4 -16
  20. data/lib/dodopayments/models/credit_rollover_forfeited_webhook_event.rb +4 -16
  21. data/lib/dodopayments/models/discount_detail.rb +143 -0
  22. data/lib/dodopayments/models/dispute_accepted_webhook_event.rb +4 -16
  23. data/lib/dodopayments/models/dispute_cancelled_webhook_event.rb +4 -16
  24. data/lib/dodopayments/models/dispute_challenged_webhook_event.rb +4 -16
  25. data/lib/dodopayments/models/dispute_expired_webhook_event.rb +4 -16
  26. data/lib/dodopayments/models/dispute_lost_webhook_event.rb +4 -16
  27. data/lib/dodopayments/models/dispute_opened_webhook_event.rb +4 -16
  28. data/lib/dodopayments/models/dispute_won_webhook_event.rb +4 -16
  29. data/lib/dodopayments/models/dunning_recovered_webhook_event.rb +4 -16
  30. data/lib/dodopayments/models/dunning_started_webhook_event.rb +4 -16
  31. data/lib/dodopayments/models/entitlement_grant_created_webhook_event.rb +4 -16
  32. data/lib/dodopayments/models/entitlement_grant_delivered_webhook_event.rb +4 -16
  33. data/lib/dodopayments/models/entitlement_grant_failed_webhook_event.rb +4 -16
  34. data/lib/dodopayments/models/entitlement_grant_revoked_webhook_event.rb +4 -16
  35. data/lib/dodopayments/models/filter_type.rb +71 -0
  36. data/lib/dodopayments/models/github_permission.rb +19 -0
  37. data/lib/dodopayments/models/integration_config.rb +3 -19
  38. data/lib/dodopayments/models/integration_config_response.rb +3 -19
  39. data/lib/dodopayments/models/invoices/payment_retrieve_payout_params.rb +22 -0
  40. data/lib/dodopayments/models/license_key_created_webhook_event.rb +4 -16
  41. data/lib/dodopayments/models/meter_filter.rb +3 -331
  42. data/lib/dodopayments/models/payment.rb +15 -3
  43. data/lib/dodopayments/models/payment_cancelled_webhook_event.rb +4 -16
  44. data/lib/dodopayments/models/payment_create_params.rb +25 -3
  45. data/lib/dodopayments/models/payment_create_response.rb +14 -3
  46. data/lib/dodopayments/models/payment_failed_webhook_event.rb +4 -16
  47. data/lib/dodopayments/models/payment_method_types.rb +1 -0
  48. data/lib/dodopayments/models/payment_processing_webhook_event.rb +4 -16
  49. data/lib/dodopayments/models/payment_succeeded_webhook_event.rb +4 -16
  50. data/lib/dodopayments/models/payout_list_response.rb +6 -3
  51. data/lib/dodopayments/models/price.rb +20 -48
  52. data/lib/dodopayments/models/product.rb +3 -3
  53. data/lib/dodopayments/models/product_collection.rb +74 -0
  54. data/lib/dodopayments/models/product_collection_create_params.rb +47 -0
  55. data/lib/dodopayments/models/product_collection_delete_params.rb +20 -0
  56. data/lib/dodopayments/models/product_collection_list_params.rb +46 -0
  57. data/lib/dodopayments/models/product_collection_list_response.rb +65 -0
  58. data/lib/dodopayments/models/product_collection_retrieve_params.rb +20 -0
  59. data/lib/dodopayments/models/product_collection_unarchive_params.rb +20 -0
  60. data/lib/dodopayments/models/product_collection_unarchive_response.rb +33 -0
  61. data/lib/dodopayments/models/product_collection_update_images_params.rb +29 -0
  62. data/lib/dodopayments/models/product_collection_update_images_response.rb +25 -0
  63. data/lib/dodopayments/models/product_collection_update_params.rb +61 -0
  64. data/lib/dodopayments/models/product_collections/group_create_params.rb +22 -0
  65. data/lib/dodopayments/models/product_collections/group_delete_params.rb +28 -0
  66. data/lib/dodopayments/models/product_collections/group_product.rb +26 -0
  67. data/lib/dodopayments/models/product_collections/group_update_params.rb +59 -0
  68. data/lib/dodopayments/models/product_collections/groups/item_create_params.rb +41 -0
  69. data/lib/dodopayments/models/product_collections/groups/item_create_response.rb +15 -0
  70. data/lib/dodopayments/models/product_collections/groups/item_delete_params.rb +36 -0
  71. data/lib/dodopayments/models/product_collections/groups/item_update_params.rb +47 -0
  72. data/lib/dodopayments/models/product_collections/groups/product_collection_product.rb +132 -0
  73. data/lib/dodopayments/models/product_collections/product_collection_group_details.rb +42 -0
  74. data/lib/dodopayments/models/product_collections/product_collection_group_response.rb +39 -0
  75. data/lib/dodopayments/models/product_create_params.rb +3 -3
  76. data/lib/dodopayments/models/product_item_req.rb +42 -1
  77. data/lib/dodopayments/models/product_update_params.rb +3 -3
  78. data/lib/dodopayments/models/refund_failed_webhook_event.rb +4 -16
  79. data/lib/dodopayments/models/refund_succeeded_webhook_event.rb +4 -16
  80. data/lib/dodopayments/models/subscription.rb +24 -5
  81. data/lib/dodopayments/models/subscription_active_webhook_event.rb +4 -16
  82. data/lib/dodopayments/models/subscription_cancelled_webhook_event.rb +4 -16
  83. data/lib/dodopayments/models/subscription_create_params.rb +25 -3
  84. data/lib/dodopayments/models/subscription_create_response.rb +14 -3
  85. data/lib/dodopayments/models/subscription_expired_webhook_event.rb +4 -16
  86. data/lib/dodopayments/models/subscription_failed_webhook_event.rb +4 -16
  87. data/lib/dodopayments/models/subscription_list_response.rb +45 -5
  88. data/lib/dodopayments/models/subscription_on_hold_webhook_event.rb +4 -16
  89. data/lib/dodopayments/models/subscription_plan_changed_webhook_event.rb +4 -16
  90. data/lib/dodopayments/models/subscription_preview_change_plan_response.rb +21 -49
  91. data/lib/dodopayments/models/subscription_renewed_webhook_event.rb +4 -16
  92. data/lib/dodopayments/models/subscription_update_params.rb +12 -1
  93. data/lib/dodopayments/models/subscription_update_payment_method_params.rb +19 -37
  94. data/lib/dodopayments/models/subscription_updated_webhook_event.rb +4 -16
  95. data/lib/dodopayments/models/unsafe_unwrap_webhook_event.rb +41 -39
  96. data/lib/dodopayments/models/unwrap_webhook_event.rb +41 -39
  97. data/lib/dodopayments/models/update_subscription_plan_req.rb +17 -6
  98. data/lib/dodopayments/models/webhook_event_type.rb +1 -2
  99. data/lib/dodopayments/models/webhook_payload.rb +52 -143
  100. data/lib/dodopayments/models.rb +24 -0
  101. data/lib/dodopayments/resources/checkout_sessions.rb +12 -4
  102. data/lib/dodopayments/resources/invoices/payments.rb +18 -0
  103. data/lib/dodopayments/resources/payments.rb +6 -2
  104. data/lib/dodopayments/resources/product_collections/groups/items.rb +111 -0
  105. data/lib/dodopayments/resources/product_collections/groups.rb +109 -0
  106. data/lib/dodopayments/resources/product_collections.rb +179 -0
  107. data/lib/dodopayments/resources/subscriptions.rb +20 -10
  108. data/lib/dodopayments/version.rb +1 -1
  109. data/lib/dodopayments.rb +29 -0
  110. data/rbi/dodopayments/client.rbi +3 -0
  111. data/rbi/dodopayments/models/abandoned_checkout_detected_webhook_event.rbi +4 -40
  112. data/rbi/dodopayments/models/abandoned_checkout_recovered_webhook_event.rbi +4 -40
  113. data/rbi/dodopayments/models/checkout_session_flags.rbi +23 -0
  114. data/rbi/dodopayments/models/checkout_session_request.rbi +26 -0
  115. data/rbi/dodopayments/models/checkout_session_response.rbi +43 -5
  116. data/rbi/dodopayments/models/credit_added_webhook_event.rbi +4 -29
  117. data/rbi/dodopayments/models/credit_balance_low_webhook_event.rbi +4 -33
  118. data/rbi/dodopayments/models/credit_deducted_webhook_event.rbi +4 -33
  119. data/rbi/dodopayments/models/credit_expired_webhook_event.rbi +4 -33
  120. data/rbi/dodopayments/models/credit_manual_adjustment_webhook_event.rbi +4 -39
  121. data/rbi/dodopayments/models/credit_overage_charged_webhook_event.rbi +4 -36
  122. data/rbi/dodopayments/models/credit_overage_reset_webhook_event.rbi +4 -36
  123. data/rbi/dodopayments/models/credit_rolled_over_webhook_event.rbi +4 -33
  124. data/rbi/dodopayments/models/credit_rollover_forfeited_webhook_event.rbi +4 -40
  125. data/rbi/dodopayments/models/discount_detail.rbi +161 -0
  126. data/rbi/dodopayments/models/dispute_accepted_webhook_event.rbi +4 -33
  127. data/rbi/dodopayments/models/dispute_cancelled_webhook_event.rbi +4 -33
  128. data/rbi/dodopayments/models/dispute_challenged_webhook_event.rbi +4 -34
  129. data/rbi/dodopayments/models/dispute_expired_webhook_event.rbi +4 -33
  130. data/rbi/dodopayments/models/dispute_lost_webhook_event.rbi +4 -29
  131. data/rbi/dodopayments/models/dispute_opened_webhook_event.rbi +4 -33
  132. data/rbi/dodopayments/models/dispute_won_webhook_event.rbi +4 -29
  133. data/rbi/dodopayments/models/dunning_recovered_webhook_event.rbi +4 -33
  134. data/rbi/dodopayments/models/dunning_started_webhook_event.rbi +4 -33
  135. data/rbi/dodopayments/models/entitlement_grant_created_webhook_event.rbi +4 -40
  136. data/rbi/dodopayments/models/entitlement_grant_delivered_webhook_event.rbi +4 -40
  137. data/rbi/dodopayments/models/entitlement_grant_failed_webhook_event.rbi +4 -39
  138. data/rbi/dodopayments/models/entitlement_grant_revoked_webhook_event.rbi +4 -40
  139. data/rbi/dodopayments/models/filter_type.rbi +112 -0
  140. data/rbi/dodopayments/models/github_permission.rbi +26 -0
  141. data/rbi/dodopayments/models/integration_config.rbi +3 -59
  142. data/rbi/dodopayments/models/integration_config_response.rbi +3 -59
  143. data/rbi/dodopayments/models/invoices/payment_retrieve_payout_params.rbi +40 -0
  144. data/rbi/dodopayments/models/license_key_created_webhook_event.rbi +4 -34
  145. data/rbi/dodopayments/models/meter_filter.rbi +3 -572
  146. data/rbi/dodopayments/models/payment.rbi +10 -2
  147. data/rbi/dodopayments/models/payment_cancelled_webhook_event.rbi +4 -33
  148. data/rbi/dodopayments/models/payment_create_params.rbi +26 -2
  149. data/rbi/dodopayments/models/payment_create_response.rbi +12 -2
  150. data/rbi/dodopayments/models/payment_failed_webhook_event.rbi +4 -33
  151. data/rbi/dodopayments/models/payment_method_types.rbi +1 -0
  152. data/rbi/dodopayments/models/payment_processing_webhook_event.rbi +4 -34
  153. data/rbi/dodopayments/models/payment_succeeded_webhook_event.rbi +4 -33
  154. data/rbi/dodopayments/models/price.rbi +18 -90
  155. data/rbi/dodopayments/models/product_collection.rbi +108 -0
  156. data/rbi/dodopayments/models/product_collection_create_params.rbi +82 -0
  157. data/rbi/dodopayments/models/product_collection_delete_params.rbi +38 -0
  158. data/rbi/dodopayments/models/product_collection_list_params.rbi +82 -0
  159. data/rbi/dodopayments/models/product_collection_list_response.rbi +88 -0
  160. data/rbi/dodopayments/models/product_collection_retrieve_params.rbi +38 -0
  161. data/rbi/dodopayments/models/product_collection_unarchive_params.rbi +38 -0
  162. data/rbi/dodopayments/models/product_collection_unarchive_response.rbi +56 -0
  163. data/rbi/dodopayments/models/product_collection_update_images_params.rbi +52 -0
  164. data/rbi/dodopayments/models/product_collection_update_images_response.rbi +40 -0
  165. data/rbi/dodopayments/models/product_collection_update_params.rbi +84 -0
  166. data/rbi/dodopayments/models/product_collections/group_create_params.rbi +40 -0
  167. data/rbi/dodopayments/models/product_collections/group_delete_params.rbi +48 -0
  168. data/rbi/dodopayments/models/product_collections/group_product.rbi +46 -0
  169. data/rbi/dodopayments/models/product_collections/group_update_params.rbi +80 -0
  170. data/rbi/dodopayments/models/product_collections/groups/item_create_params.rbi +68 -0
  171. data/rbi/dodopayments/models/product_collections/groups/item_create_response.rbi +17 -0
  172. data/rbi/dodopayments/models/product_collections/groups/item_delete_params.rbi +55 -0
  173. data/rbi/dodopayments/models/product_collections/groups/item_update_params.rbi +68 -0
  174. data/rbi/dodopayments/models/product_collections/groups/product_collection_product.rbi +148 -0
  175. data/rbi/dodopayments/models/product_collections/product_collection_group_details.rbi +67 -0
  176. data/rbi/dodopayments/models/product_collections/product_collection_group_response.rbi +68 -0
  177. data/rbi/dodopayments/models/product_item_req.rbi +74 -3
  178. data/rbi/dodopayments/models/refund_failed_webhook_event.rbi +4 -31
  179. data/rbi/dodopayments/models/refund_succeeded_webhook_event.rbi +4 -33
  180. data/rbi/dodopayments/models/subscription.rbi +22 -4
  181. data/rbi/dodopayments/models/subscription_active_webhook_event.rbi +4 -36
  182. data/rbi/dodopayments/models/subscription_cancelled_webhook_event.rbi +4 -36
  183. data/rbi/dodopayments/models/subscription_create_params.rbi +26 -2
  184. data/rbi/dodopayments/models/subscription_create_response.rbi +12 -2
  185. data/rbi/dodopayments/models/subscription_expired_webhook_event.rbi +4 -36
  186. data/rbi/dodopayments/models/subscription_failed_webhook_event.rbi +4 -36
  187. data/rbi/dodopayments/models/subscription_list_response.rbi +77 -4
  188. data/rbi/dodopayments/models/subscription_on_hold_webhook_event.rbi +4 -36
  189. data/rbi/dodopayments/models/subscription_plan_changed_webhook_event.rbi +4 -40
  190. data/rbi/dodopayments/models/subscription_preview_change_plan_response.rbi +18 -123
  191. data/rbi/dodopayments/models/subscription_renewed_webhook_event.rbi +4 -36
  192. data/rbi/dodopayments/models/subscription_update_params.rbi +14 -0
  193. data/rbi/dodopayments/models/subscription_update_payment_method_params.rbi +28 -112
  194. data/rbi/dodopayments/models/subscription_updated_webhook_event.rbi +4 -36
  195. data/rbi/dodopayments/models/update_subscription_plan_req.rbi +18 -8
  196. data/rbi/dodopayments/models/webhook_event_type.rbi +5 -4
  197. data/rbi/dodopayments/models/webhook_payload.rbi +46 -466
  198. data/rbi/dodopayments/models.rbi +31 -0
  199. data/rbi/dodopayments/resources/checkout_sessions.rbi +22 -0
  200. data/rbi/dodopayments/resources/invoices/payments.rbi +9 -0
  201. data/rbi/dodopayments/resources/payments.rbi +11 -1
  202. data/rbi/dodopayments/resources/product_collections/groups/items.rbi +83 -0
  203. data/rbi/dodopayments/resources/product_collections/groups.rbi +88 -0
  204. data/rbi/dodopayments/resources/product_collections.rbi +149 -0
  205. data/rbi/dodopayments/resources/subscriptions.rbi +37 -13
  206. data/sig/dodopayments/client.rbs +2 -0
  207. data/sig/dodopayments/models/abandoned_checkout_detected_webhook_event.rbs +4 -14
  208. data/sig/dodopayments/models/abandoned_checkout_recovered_webhook_event.rbs +4 -14
  209. data/sig/dodopayments/models/checkout_session_flags.rbs +7 -0
  210. data/sig/dodopayments/models/checkout_session_request.rbs +10 -0
  211. data/sig/dodopayments/models/checkout_session_response.rbs +27 -3
  212. data/sig/dodopayments/models/credit_added_webhook_event.rbs +4 -14
  213. data/sig/dodopayments/models/credit_balance_low_webhook_event.rbs +4 -14
  214. data/sig/dodopayments/models/credit_deducted_webhook_event.rbs +4 -14
  215. data/sig/dodopayments/models/credit_expired_webhook_event.rbs +4 -14
  216. data/sig/dodopayments/models/credit_manual_adjustment_webhook_event.rbs +4 -14
  217. data/sig/dodopayments/models/credit_overage_charged_webhook_event.rbs +4 -14
  218. data/sig/dodopayments/models/credit_overage_reset_webhook_event.rbs +4 -14
  219. data/sig/dodopayments/models/credit_rolled_over_webhook_event.rbs +4 -14
  220. data/sig/dodopayments/models/credit_rollover_forfeited_webhook_event.rbs +4 -14
  221. data/sig/dodopayments/models/discount_detail.rbs +95 -0
  222. data/sig/dodopayments/models/dispute_accepted_webhook_event.rbs +4 -14
  223. data/sig/dodopayments/models/dispute_cancelled_webhook_event.rbs +4 -14
  224. data/sig/dodopayments/models/dispute_challenged_webhook_event.rbs +4 -14
  225. data/sig/dodopayments/models/dispute_expired_webhook_event.rbs +4 -14
  226. data/sig/dodopayments/models/dispute_lost_webhook_event.rbs +4 -14
  227. data/sig/dodopayments/models/dispute_opened_webhook_event.rbs +4 -14
  228. data/sig/dodopayments/models/dispute_won_webhook_event.rbs +4 -14
  229. data/sig/dodopayments/models/dunning_recovered_webhook_event.rbs +4 -14
  230. data/sig/dodopayments/models/dunning_started_webhook_event.rbs +4 -14
  231. data/sig/dodopayments/models/entitlement_grant_created_webhook_event.rbs +4 -14
  232. data/sig/dodopayments/models/entitlement_grant_delivered_webhook_event.rbs +4 -14
  233. data/sig/dodopayments/models/entitlement_grant_failed_webhook_event.rbs +4 -14
  234. data/sig/dodopayments/models/entitlement_grant_revoked_webhook_event.rbs +4 -14
  235. data/sig/dodopayments/models/filter_type.rbs +52 -0
  236. data/sig/dodopayments/models/github_permission.rbs +17 -0
  237. data/sig/dodopayments/models/integration_config.rbs +4 -18
  238. data/sig/dodopayments/models/integration_config_response.rbs +4 -18
  239. data/sig/dodopayments/models/invoices/payment_retrieve_payout_params.rbs +25 -0
  240. data/sig/dodopayments/models/license_key_created_webhook_event.rbs +4 -14
  241. data/sig/dodopayments/models/meter_filter.rbs +4 -252
  242. data/sig/dodopayments/models/payment.rbs +5 -0
  243. data/sig/dodopayments/models/payment_cancelled_webhook_event.rbs +4 -14
  244. data/sig/dodopayments/models/payment_create_params.rbs +10 -0
  245. data/sig/dodopayments/models/payment_create_response.rbs +5 -0
  246. data/sig/dodopayments/models/payment_failed_webhook_event.rbs +4 -14
  247. data/sig/dodopayments/models/payment_method_types.rbs +2 -0
  248. data/sig/dodopayments/models/payment_processing_webhook_event.rbs +4 -14
  249. data/sig/dodopayments/models/payment_succeeded_webhook_event.rbs +4 -14
  250. data/sig/dodopayments/models/price.rbs +15 -45
  251. data/sig/dodopayments/models/product_collection.rbs +55 -0
  252. data/sig/dodopayments/models/product_collection_create_params.rbs +41 -0
  253. data/sig/dodopayments/models/product_collection_delete_params.rbs +23 -0
  254. data/sig/dodopayments/models/product_collection_list_params.rbs +49 -0
  255. data/sig/dodopayments/models/product_collection_list_response.rbs +50 -0
  256. data/sig/dodopayments/models/product_collection_retrieve_params.rbs +23 -0
  257. data/sig/dodopayments/models/product_collection_unarchive_params.rbs +23 -0
  258. data/sig/dodopayments/models/product_collection_unarchive_response.rbs +30 -0
  259. data/sig/dodopayments/models/product_collection_update_images_params.rbs +28 -0
  260. data/sig/dodopayments/models/product_collection_update_images_response.rbs +16 -0
  261. data/sig/dodopayments/models/product_collection_update_params.rbs +51 -0
  262. data/sig/dodopayments/models/product_collections/group_create_params.rbs +27 -0
  263. data/sig/dodopayments/models/product_collections/group_delete_params.rbs +30 -0
  264. data/sig/dodopayments/models/product_collections/group_product.rbs +17 -0
  265. data/sig/dodopayments/models/product_collections/group_update_params.rbs +48 -0
  266. data/sig/dodopayments/models/product_collections/groups/item_create_params.rbs +40 -0
  267. data/sig/dodopayments/models/product_collections/groups/item_create_response.rbs +12 -0
  268. data/sig/dodopayments/models/product_collections/groups/item_delete_params.rbs +36 -0
  269. data/sig/dodopayments/models/product_collections/groups/item_update_params.rbs +40 -0
  270. data/sig/dodopayments/models/product_collections/groups/product_collection_product.rbs +99 -0
  271. data/sig/dodopayments/models/product_collections/product_collection_group_details.rbs +34 -0
  272. data/sig/dodopayments/models/product_collections/product_collection_group_response.rbs +39 -0
  273. data/sig/dodopayments/models/product_item_req.rbs +27 -3
  274. data/sig/dodopayments/models/refund_failed_webhook_event.rbs +4 -14
  275. data/sig/dodopayments/models/refund_succeeded_webhook_event.rbs +4 -14
  276. data/sig/dodopayments/models/subscription.rbs +10 -0
  277. data/sig/dodopayments/models/subscription_active_webhook_event.rbs +4 -14
  278. data/sig/dodopayments/models/subscription_cancelled_webhook_event.rbs +4 -14
  279. data/sig/dodopayments/models/subscription_create_params.rbs +10 -0
  280. data/sig/dodopayments/models/subscription_create_response.rbs +5 -0
  281. data/sig/dodopayments/models/subscription_expired_webhook_event.rbs +4 -14
  282. data/sig/dodopayments/models/subscription_failed_webhook_event.rbs +4 -14
  283. data/sig/dodopayments/models/subscription_list_response.rbs +29 -0
  284. data/sig/dodopayments/models/subscription_on_hold_webhook_event.rbs +4 -14
  285. data/sig/dodopayments/models/subscription_plan_changed_webhook_event.rbs +4 -14
  286. data/sig/dodopayments/models/subscription_preview_change_plan_response.rbs +15 -45
  287. data/sig/dodopayments/models/subscription_renewed_webhook_event.rbs +4 -14
  288. data/sig/dodopayments/models/subscription_update_params.rbs +5 -0
  289. data/sig/dodopayments/models/subscription_update_payment_method_params.rbs +17 -57
  290. data/sig/dodopayments/models/subscription_updated_webhook_event.rbs +4 -14
  291. data/sig/dodopayments/models/update_subscription_plan_req.rbs +5 -0
  292. data/sig/dodopayments/models/webhook_event_type.rbs +2 -4
  293. data/sig/dodopayments/models/webhook_payload.rbs +50 -213
  294. data/sig/dodopayments/models.rbs +24 -0
  295. data/sig/dodopayments/resources/checkout_sessions.rbs +4 -0
  296. data/sig/dodopayments/resources/invoices/payments.rbs +5 -0
  297. data/sig/dodopayments/resources/payments.rbs +2 -0
  298. data/sig/dodopayments/resources/product_collections/groups/items.rbs +33 -0
  299. data/sig/dodopayments/resources/product_collections/groups.rbs +34 -0
  300. data/sig/dodopayments/resources/product_collections.rbs +56 -0
  301. data/sig/dodopayments/resources/subscriptions.rbs +6 -1
  302. metadata +89 -2
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ class ProductCollectionGroupDetails < Dodopayments::Internal::Type::BaseModel
7
+ # @!attribute products
8
+ # Products in this group
9
+ #
10
+ # @return [Array<Dodopayments::Models::ProductCollections::GroupProduct>]
11
+ required :products,
12
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductCollections::GroupProduct] }
13
+
14
+ # @!attribute group_name
15
+ # Optional group name. Multiple groups can have null names, but named groups must
16
+ # be unique per collection
17
+ #
18
+ # @return [String, nil]
19
+ optional :group_name, String, nil?: true
20
+
21
+ # @!attribute status
22
+ # Status of the group (defaults to true if not provided)
23
+ #
24
+ # @return [Boolean, nil]
25
+ optional :status, Dodopayments::Internal::Type::Boolean, nil?: true
26
+
27
+ # @!method initialize(products:, group_name: nil, status: nil)
28
+ # Some parameter documentations has been truncated, see
29
+ # {Dodopayments::Models::ProductCollections::ProductCollectionGroupDetails} for
30
+ # more details.
31
+ #
32
+ # @param products [Array<Dodopayments::Models::ProductCollections::GroupProduct>] Products in this group
33
+ #
34
+ # @param group_name [String, nil] Optional group name. Multiple groups can have null names, but named groups must
35
+ #
36
+ # @param status [Boolean, nil] Status of the group (defaults to true if not provided)
37
+ end
38
+ end
39
+
40
+ ProductCollectionGroupDetails = ProductCollections::ProductCollectionGroupDetails
41
+ end
42
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dodopayments
4
+ module Models
5
+ module ProductCollections
6
+ # @see Dodopayments::Resources::ProductCollections::Groups#create
7
+ class ProductCollectionGroupResponse < Dodopayments::Internal::Type::BaseModel
8
+ # @!attribute group_id
9
+ #
10
+ # @return [String]
11
+ required :group_id, String
12
+
13
+ # @!attribute products
14
+ #
15
+ # @return [Array<Dodopayments::Models::ProductCollections::Groups::ProductCollectionProduct>]
16
+ required :products,
17
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductCollections::Groups::ProductCollectionProduct] }
18
+
19
+ # @!attribute status
20
+ #
21
+ # @return [Boolean]
22
+ required :status, Dodopayments::Internal::Type::Boolean
23
+
24
+ # @!attribute group_name
25
+ #
26
+ # @return [String, nil]
27
+ optional :group_name, String, nil?: true
28
+
29
+ # @!method initialize(group_id:, products:, status:, group_name: nil)
30
+ # @param group_id [String]
31
+ # @param products [Array<Dodopayments::Models::ProductCollections::Groups::ProductCollectionProduct>]
32
+ # @param status [Boolean]
33
+ # @param group_name [String, nil]
34
+ end
35
+ end
36
+
37
+ ProductCollectionGroupResponse = ProductCollections::ProductCollectionGroupResponse
38
+ end
39
+ end
@@ -70,7 +70,7 @@ module Dodopayments
70
70
  nil?: true
71
71
 
72
72
  # @!attribute license_key_activation_message
73
- # @deprecated
73
+ # @deprecated Use the dedicated entitlements API to configure license-key delivery.
74
74
  #
75
75
  # Optional message displayed during license key activation
76
76
  #
@@ -81,7 +81,7 @@ module Dodopayments
81
81
  optional :license_key_activation_message, String, nil?: true
82
82
 
83
83
  # @!attribute license_key_activations_limit
84
- # @deprecated
84
+ # @deprecated Use the dedicated entitlements API to configure license-key delivery.
85
85
  #
86
86
  # The number of times the license key can be activated. Must be 0 or greater
87
87
  #
@@ -103,7 +103,7 @@ module Dodopayments
103
103
  optional :license_key_duration, -> { Dodopayments::LicenseKeyDuration }, nil?: true
104
104
 
105
105
  # @!attribute license_key_enabled
106
- # @deprecated
106
+ # @deprecated Use the dedicated entitlements API to configure license-key delivery.
107
107
  #
108
108
  # When true, generates and sends a license key to your customer. Defaults to false
109
109
  #
@@ -32,7 +32,18 @@ module Dodopayments
32
32
  # @return [Integer, nil]
33
33
  optional :amount, Integer, nil?: true
34
34
 
35
- # @!method initialize(product_id:, quantity:, addons: nil, amount: nil)
35
+ # @!attribute credit_entitlements
36
+ # Per-checkout-session overrides for credit entitlements already attached to this
37
+ # product. Each entry overrides the `credits_amount` granted by the referenced
38
+ # credit entitlement when this checkout session is fulfilled. The
39
+ # credit_entitlement_id must already be attached to the product.
40
+ #
41
+ # @return [Array<Dodopayments::Models::ProductItemReq::CreditEntitlement>, nil]
42
+ optional :credit_entitlements,
43
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductItemReq::CreditEntitlement] },
44
+ nil?: true
45
+
46
+ # @!method initialize(product_id:, quantity:, addons: nil, amount: nil, credit_entitlements: nil)
36
47
  # Some parameter documentations has been truncated, see
37
48
  # {Dodopayments::Models::ProductItemReq} for more details.
38
49
  #
@@ -43,6 +54,36 @@ module Dodopayments
43
54
  # @param addons [Array<Dodopayments::Models::AttachAddon>, nil] only valid if product is a subscription
44
55
  #
45
56
  # @param amount [Integer, nil] Amount the customer pays if pay_what_you_want is enabled. If disabled then amoun
57
+ #
58
+ # @param credit_entitlements [Array<Dodopayments::Models::ProductItemReq::CreditEntitlement>, nil] Per-checkout-session overrides for credit entitlements already attached
59
+
60
+ class CreditEntitlement < Dodopayments::Internal::Type::BaseModel
61
+ # @!attribute credit_entitlement_id
62
+ # ID of the credit entitlement to override. Must already be attached to the
63
+ # product.
64
+ #
65
+ # @return [String]
66
+ required :credit_entitlement_id, String
67
+
68
+ # @!attribute credits_amount
69
+ # Number of credits to grant for this checkout session, overriding the
70
+ # product-level `credits_amount` set on the credit entitlement mapping. Must be
71
+ # greater than zero.
72
+ #
73
+ # @return [String]
74
+ required :credits_amount, String
75
+
76
+ # @!method initialize(credit_entitlement_id:, credits_amount:)
77
+ # Some parameter documentations has been truncated, see
78
+ # {Dodopayments::Models::ProductItemReq::CreditEntitlement} for more details.
79
+ #
80
+ # Per-checkout-session override for a single credit entitlement attached to a
81
+ # product.
82
+ #
83
+ # @param credit_entitlement_id [String] ID of the credit entitlement to override. Must already be attached to the produc
84
+ #
85
+ # @param credits_amount [String] Number of credits to grant for this checkout session, overriding the
86
+ end
46
87
  end
47
88
  end
48
89
  end
@@ -64,7 +64,7 @@ module Dodopayments
64
64
  optional :image_id, String, nil?: true
65
65
 
66
66
  # @!attribute license_key_activation_message
67
- # @deprecated
67
+ # @deprecated Use the dedicated entitlements API to configure license-key delivery.
68
68
  #
69
69
  # Message sent to the customer upon license key activation.
70
70
  #
@@ -77,7 +77,7 @@ module Dodopayments
77
77
  optional :license_key_activation_message, String, nil?: true
78
78
 
79
79
  # @!attribute license_key_activations_limit
80
- # @deprecated
80
+ # @deprecated Use the dedicated entitlements API to configure license-key delivery.
81
81
  #
82
82
  # Limit for the number of activations for the license key.
83
83
  #
@@ -101,7 +101,7 @@ module Dodopayments
101
101
  optional :license_key_duration, -> { Dodopayments::LicenseKeyDuration }, nil?: true
102
102
 
103
103
  # @!attribute license_key_enabled
104
- # @deprecated
104
+ # @deprecated Use the dedicated entitlements API to configure license-key delivery.
105
105
  #
106
106
  # Whether the product requires a license key.
107
107
  #
@@ -23,29 +23,17 @@ module Dodopayments
23
23
  # @!attribute type
24
24
  # The event type
25
25
  #
26
- # @return [Symbol, Dodopayments::Models::RefundFailedWebhookEvent::Type]
27
- required :type, enum: -> { Dodopayments::RefundFailedWebhookEvent::Type }
26
+ # @return [Symbol, :"refund.failed"]
27
+ required :type, const: :"refund.failed"
28
28
 
29
- # @!method initialize(business_id:, data:, timestamp:, type:)
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"refund.failed")
30
30
  # @param business_id [String] The business identifier
31
31
  #
32
32
  # @param data [Dodopayments::Models::Refund]
33
33
  #
34
34
  # @param timestamp [Time] The timestamp of when the event occurred
35
35
  #
36
- # @param type [Symbol, Dodopayments::Models::RefundFailedWebhookEvent::Type] The event type
37
-
38
- # The event type
39
- #
40
- # @see Dodopayments::Models::RefundFailedWebhookEvent#type
41
- module Type
42
- extend Dodopayments::Internal::Type::Enum
43
-
44
- REFUND_FAILED = :"refund.failed"
45
-
46
- # @!method self.values
47
- # @return [Array<Symbol>]
48
- end
36
+ # @param type [Symbol, :"refund.failed"] The event type
49
37
  end
50
38
  end
51
39
  end
@@ -23,29 +23,17 @@ module Dodopayments
23
23
  # @!attribute type
24
24
  # The event type
25
25
  #
26
- # @return [Symbol, Dodopayments::Models::RefundSucceededWebhookEvent::Type]
27
- required :type, enum: -> { Dodopayments::RefundSucceededWebhookEvent::Type }
26
+ # @return [Symbol, :"refund.succeeded"]
27
+ required :type, const: :"refund.succeeded"
28
28
 
29
- # @!method initialize(business_id:, data:, timestamp:, type:)
29
+ # @!method initialize(business_id:, data:, timestamp:, type: :"refund.succeeded")
30
30
  # @param business_id [String] The business identifier
31
31
  #
32
32
  # @param data [Dodopayments::Models::Refund]
33
33
  #
34
34
  # @param timestamp [Time] The timestamp of when the event occurred
35
35
  #
36
- # @param type [Symbol, Dodopayments::Models::RefundSucceededWebhookEvent::Type] The event type
37
-
38
- # The event type
39
- #
40
- # @see Dodopayments::Models::RefundSucceededWebhookEvent#type
41
- module Type
42
- extend Dodopayments::Internal::Type::Enum
43
-
44
- REFUND_SUCCEEDED = :"refund.succeeded"
45
-
46
- # @!method self.values
47
- # @return [Array<Symbol>]
48
- end
36
+ # @param type [Symbol, :"refund.succeeded"] The event type
49
37
  end
50
38
  end
51
39
  end
@@ -178,18 +178,33 @@ module Dodopayments
178
178
  -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::CustomFieldResponse] },
179
179
  nil?: true
180
180
 
181
+ # @!attribute customer_business_name
182
+ # Business / legal name associated with the tax id (B2B). When set this is used on
183
+ # the invoice in place of the customer's personal name.
184
+ #
185
+ # @return [String, nil]
186
+ optional :customer_business_name, String, nil?: true
187
+
181
188
  # @!attribute discount_cycles_remaining
182
- # Number of remaining discount cycles if discount is applied
189
+ # DEPRECATED: Use discounts[].cycles_remaining instead.
183
190
  #
184
191
  # @return [Integer, nil]
185
192
  optional :discount_cycles_remaining, Integer, nil?: true
186
193
 
187
194
  # @!attribute discount_id
188
- # The discount id if discount is applied
195
+ # DEPRECATED: Use discounts instead. Returns the first discount's ID if present.
189
196
  #
190
197
  # @return [String, nil]
191
198
  optional :discount_id, String, nil?: true
192
199
 
200
+ # @!attribute discounts
201
+ # All stacked discounts applied, ordered by position
202
+ #
203
+ # @return [Array<Dodopayments::Models::DiscountDetail>, nil]
204
+ optional :discounts,
205
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::DiscountDetail] },
206
+ nil?: true
207
+
193
208
  # @!attribute expires_at
194
209
  # Timestamp when the subscription will expire
195
210
  #
@@ -214,7 +229,7 @@ module Dodopayments
214
229
  # @return [String, nil]
215
230
  optional :tax_id, String, nil?: true
216
231
 
217
- # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancellation_comment: nil, cancellation_feedback: nil, cancelled_at: nil, custom_field_responses: nil, discount_cycles_remaining: nil, discount_id: nil, expires_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil)
232
+ # @!method initialize(addons:, billing:, cancel_at_next_billing_date:, created_at:, credit_entitlement_cart:, currency:, customer:, metadata:, meter_credit_entitlement_cart:, meters:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancellation_comment: nil, cancellation_feedback: nil, cancelled_at: nil, custom_field_responses: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, discounts: nil, expires_at: nil, payment_method_id: nil, scheduled_change: nil, tax_id: nil)
218
233
  # Some parameter documentations has been truncated, see
219
234
  # {Dodopayments::Models::Subscription} for more details.
220
235
  #
@@ -276,9 +291,13 @@ module Dodopayments
276
291
  #
277
292
  # @param custom_field_responses [Array<Dodopayments::Models::CustomFieldResponse>, nil] Customer's responses to custom fields collected during checkout
278
293
  #
279
- # @param discount_cycles_remaining [Integer, nil] Number of remaining discount cycles if discount is applied
294
+ # @param customer_business_name [String, nil] Business / legal name associated with the tax id (B2B). When set this is
295
+ #
296
+ # @param discount_cycles_remaining [Integer, nil] DEPRECATED: Use discounts[].cycles_remaining instead.
297
+ #
298
+ # @param discount_id [String, nil] DEPRECATED: Use discounts instead. Returns the first discount's ID if present.
280
299
  #
281
- # @param discount_id [String, nil] The discount id if discount is applied
300
+ # @param discounts [Array<Dodopayments::Models::DiscountDetail>, nil] All stacked discounts applied, ordered by position
282
301
  #
283
302
  # @param expires_at [Time, nil] Timestamp when the subscription will expire
284
303
  #
@@ -24,29 +24,17 @@ module Dodopayments
24
24
  # @!attribute type
25
25
  # The event type
26
26
  #
27
- # @return [Symbol, Dodopayments::Models::SubscriptionActiveWebhookEvent::Type]
28
- required :type, enum: -> { Dodopayments::SubscriptionActiveWebhookEvent::Type }
27
+ # @return [Symbol, :"subscription.active"]
28
+ required :type, const: :"subscription.active"
29
29
 
30
- # @!method initialize(business_id:, data:, timestamp:, type:)
30
+ # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.active")
31
31
  # @param business_id [String] The business identifier
32
32
  #
33
33
  # @param data [Dodopayments::Models::Subscription] Response struct representing subscription details
34
34
  #
35
35
  # @param timestamp [Time] The timestamp of when the event occurred
36
36
  #
37
- # @param type [Symbol, Dodopayments::Models::SubscriptionActiveWebhookEvent::Type] The event type
38
-
39
- # The event type
40
- #
41
- # @see Dodopayments::Models::SubscriptionActiveWebhookEvent#type
42
- module Type
43
- extend Dodopayments::Internal::Type::Enum
44
-
45
- SUBSCRIPTION_ACTIVE = :"subscription.active"
46
-
47
- # @!method self.values
48
- # @return [Array<Symbol>]
49
- end
37
+ # @param type [Symbol, :"subscription.active"] The event type
50
38
  end
51
39
  end
52
40
  end
@@ -24,29 +24,17 @@ module Dodopayments
24
24
  # @!attribute type
25
25
  # The event type
26
26
  #
27
- # @return [Symbol, Dodopayments::Models::SubscriptionCancelledWebhookEvent::Type]
28
- required :type, enum: -> { Dodopayments::SubscriptionCancelledWebhookEvent::Type }
27
+ # @return [Symbol, :"subscription.cancelled"]
28
+ required :type, const: :"subscription.cancelled"
29
29
 
30
- # @!method initialize(business_id:, data:, timestamp:, type:)
30
+ # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.cancelled")
31
31
  # @param business_id [String] The business identifier
32
32
  #
33
33
  # @param data [Dodopayments::Models::Subscription] Response struct representing subscription details
34
34
  #
35
35
  # @param timestamp [Time] The timestamp of when the event occurred
36
36
  #
37
- # @param type [Symbol, Dodopayments::Models::SubscriptionCancelledWebhookEvent::Type] The event type
38
-
39
- # The event type
40
- #
41
- # @see Dodopayments::Models::SubscriptionCancelledWebhookEvent#type
42
- module Type
43
- extend Dodopayments::Internal::Type::Enum
44
-
45
- SUBSCRIPTION_CANCELLED = :"subscription.cancelled"
46
-
47
- # @!method self.values
48
- # @return [Array<Symbol>]
49
- end
37
+ # @param type [Symbol, :"subscription.cancelled"] The event type
50
38
  end
51
39
  end
52
40
  end
@@ -57,12 +57,30 @@ module Dodopayments
57
57
  # @return [Symbol, Dodopayments::Models::Currency, nil]
58
58
  optional :billing_currency, enum: -> { Dodopayments::Currency }, nil?: true
59
59
 
60
+ # @!attribute customer_business_name
61
+ # Optional business / legal name associated with the tax id. When provided
62
+ # together with a valid tax id for a B2B purchase, this name is rendered on the
63
+ # invoice instead of the customer's personal name.
64
+ #
65
+ # @return [String, nil]
66
+ optional :customer_business_name, String, nil?: true
67
+
60
68
  # @!attribute discount_code
61
- # Discount Code to apply to the subscription
69
+ # @deprecated Use `discount_id` instead.
70
+ #
71
+ # DEPRECATED: Use discount_codes instead. Cannot be used together with
72
+ # discount_codes.
62
73
  #
63
74
  # @return [String, nil]
64
75
  optional :discount_code, String, nil?: true
65
76
 
77
+ # @!attribute discount_codes
78
+ # Stacked discount codes to apply, in order of application. Max 20. Cannot be used
79
+ # together with discount_code.
80
+ #
81
+ # @return [Array<String>, nil]
82
+ optional :discount_codes, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
83
+
66
84
  # @!attribute force_3ds
67
85
  # Override merchant default 3DS behaviour for this subscription
68
86
  #
@@ -161,7 +179,7 @@ module Dodopayments
161
179
  # @return [Integer, nil]
162
180
  optional :trial_period_days, Integer, nil?: true
163
181
 
164
- # @!method initialize(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, on_demand: nil, one_time_product_cart: nil, payment_link: nil, payment_method_id: nil, redirect_immediately: nil, require_phone_number: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
182
+ # @!method initialize(billing:, customer:, product_id:, quantity:, addons: nil, allowed_payment_method_types: nil, billing_currency: nil, customer_business_name: nil, discount_code: nil, discount_codes: nil, force_3ds: nil, mandate_min_amount_inr_paise: nil, metadata: nil, on_demand: nil, one_time_product_cart: nil, payment_link: nil, payment_method_id: nil, redirect_immediately: nil, require_phone_number: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {})
165
183
  # Some parameter documentations has been truncated, see
166
184
  # {Dodopayments::Models::SubscriptionCreateParams} for more details.
167
185
  #
@@ -179,7 +197,11 @@ module Dodopayments
179
197
  #
180
198
  # @param billing_currency [Symbol, Dodopayments::Models::Currency, nil] Fix the currency in which the end customer is billed.
181
199
  #
182
- # @param discount_code [String, nil] Discount Code to apply to the subscription
200
+ # @param customer_business_name [String, nil] Optional business / legal name associated with the tax id. When provided
201
+ #
202
+ # @param discount_code [String, nil] DEPRECATED: Use discount_codes instead. Cannot be used together with discount_co
203
+ #
204
+ # @param discount_codes [Array<String>, nil] Stacked discount codes to apply, in order of application. Max 20.
183
205
  #
184
206
  # @param force_3ds [Boolean, nil] Override merchant default 3DS behaviour for this subscription
185
207
  #
@@ -49,11 +49,20 @@ module Dodopayments
49
49
  optional :client_secret, String, nil?: true
50
50
 
51
51
  # @!attribute discount_id
52
- # The discount id if discount is applied
52
+ # @deprecated Use `discounts` instead.
53
+ #
54
+ # DEPRECATED: Use discount_ids instead. Returns the first discount's ID if
55
+ # present.
53
56
  #
54
57
  # @return [String, nil]
55
58
  optional :discount_id, String, nil?: true
56
59
 
60
+ # @!attribute discount_ids
61
+ # All stacked discount IDs applied, in order of application
62
+ #
63
+ # @return [Array<String>, nil]
64
+ optional :discount_ids, Dodopayments::Internal::Type::ArrayOf[String], nil?: true
65
+
57
66
  # @!attribute expires_on
58
67
  # Expiry timestamp of the payment link
59
68
  #
@@ -74,7 +83,7 @@ module Dodopayments
74
83
  # @return [String, nil]
75
84
  optional :payment_link, String, nil?: true
76
85
 
77
- # @!method initialize(addons:, customer:, metadata:, payment_id:, recurring_pre_tax_amount:, subscription_id:, client_secret: nil, discount_id: nil, expires_on: nil, one_time_product_cart: nil, payment_link: nil)
86
+ # @!method initialize(addons:, customer:, metadata:, payment_id:, recurring_pre_tax_amount:, subscription_id:, client_secret: nil, discount_id: nil, discount_ids: nil, expires_on: nil, one_time_product_cart: nil, payment_link: nil)
78
87
  # Some parameter documentations has been truncated, see
79
88
  # {Dodopayments::Models::SubscriptionCreateResponse} for more details.
80
89
  #
@@ -92,7 +101,9 @@ module Dodopayments
92
101
  #
93
102
  # @param client_secret [String, nil] Client secret used to load Dodo checkout SDK
94
103
  #
95
- # @param discount_id [String, nil] The discount id if discount is applied
104
+ # @param discount_id [String, nil] DEPRECATED: Use discount_ids instead. Returns the first discount's ID if present
105
+ #
106
+ # @param discount_ids [Array<String>, nil] All stacked discount IDs applied, in order of application
96
107
  #
97
108
  # @param expires_on [Time, nil] Expiry timestamp of the payment link
98
109
  #
@@ -24,29 +24,17 @@ module Dodopayments
24
24
  # @!attribute type
25
25
  # The event type
26
26
  #
27
- # @return [Symbol, Dodopayments::Models::SubscriptionExpiredWebhookEvent::Type]
28
- required :type, enum: -> { Dodopayments::SubscriptionExpiredWebhookEvent::Type }
27
+ # @return [Symbol, :"subscription.expired"]
28
+ required :type, const: :"subscription.expired"
29
29
 
30
- # @!method initialize(business_id:, data:, timestamp:, type:)
30
+ # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.expired")
31
31
  # @param business_id [String] The business identifier
32
32
  #
33
33
  # @param data [Dodopayments::Models::Subscription] Response struct representing subscription details
34
34
  #
35
35
  # @param timestamp [Time] The timestamp of when the event occurred
36
36
  #
37
- # @param type [Symbol, Dodopayments::Models::SubscriptionExpiredWebhookEvent::Type] The event type
38
-
39
- # The event type
40
- #
41
- # @see Dodopayments::Models::SubscriptionExpiredWebhookEvent#type
42
- module Type
43
- extend Dodopayments::Internal::Type::Enum
44
-
45
- SUBSCRIPTION_EXPIRED = :"subscription.expired"
46
-
47
- # @!method self.values
48
- # @return [Array<Symbol>]
49
- end
37
+ # @param type [Symbol, :"subscription.expired"] The event type
50
38
  end
51
39
  end
52
40
  end
@@ -24,29 +24,17 @@ module Dodopayments
24
24
  # @!attribute type
25
25
  # The event type
26
26
  #
27
- # @return [Symbol, Dodopayments::Models::SubscriptionFailedWebhookEvent::Type]
28
- required :type, enum: -> { Dodopayments::SubscriptionFailedWebhookEvent::Type }
27
+ # @return [Symbol, :"subscription.failed"]
28
+ required :type, const: :"subscription.failed"
29
29
 
30
- # @!method initialize(business_id:, data:, timestamp:, type:)
30
+ # @!method initialize(business_id:, data:, timestamp:, type: :"subscription.failed")
31
31
  # @param business_id [String] The business identifier
32
32
  #
33
33
  # @param data [Dodopayments::Models::Subscription] Response struct representing subscription details
34
34
  #
35
35
  # @param timestamp [Time] The timestamp of when the event occurred
36
36
  #
37
- # @param type [Symbol, Dodopayments::Models::SubscriptionFailedWebhookEvent::Type] The event type
38
-
39
- # The event type
40
- #
41
- # @see Dodopayments::Models::SubscriptionFailedWebhookEvent#type
42
- module Type
43
- extend Dodopayments::Internal::Type::Enum
44
-
45
- SUBSCRIPTION_FAILED = :"subscription.failed"
46
-
47
- # @!method self.values
48
- # @return [Array<Symbol>]
49
- end
37
+ # @param type [Symbol, :"subscription.failed"] The event type
50
38
  end
51
39
  end
52
40
  end
@@ -34,6 +34,13 @@ module Dodopayments
34
34
  # @return [Dodopayments::Models::CustomerLimitedDetails]
35
35
  required :customer, -> { Dodopayments::CustomerLimitedDetails }
36
36
 
37
+ # @!attribute discounts
38
+ # All stacked discounts applied, in order of application
39
+ #
40
+ # @return [Array<Dodopayments::Models::SubscriptionListResponse::Discount>]
41
+ required :discounts,
42
+ -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Models::SubscriptionListResponse::Discount] }
43
+
37
44
  # @!attribute metadata
38
45
  # Additional custom data associated with the subscription
39
46
  #
@@ -132,14 +139,21 @@ module Dodopayments
132
139
  # @return [Time, nil]
133
140
  optional :cancelled_at, Time, nil?: true
134
141
 
142
+ # @!attribute customer_business_name
143
+ # Business / legal name associated with the tax id (B2B). When set this is used on
144
+ # the invoice in place of the customer's personal name.
145
+ #
146
+ # @return [String, nil]
147
+ optional :customer_business_name, String, nil?: true
148
+
135
149
  # @!attribute discount_cycles_remaining
136
- # Number of remaining discount cycles if discount is applied
150
+ # DEPRECATED: Use discounts[].cycles_remaining instead.
137
151
  #
138
152
  # @return [Integer, nil]
139
153
  optional :discount_cycles_remaining, Integer, nil?: true
140
154
 
141
155
  # @!attribute discount_id
142
- # The discount id if discount is applied
156
+ # DEPRECATED: Use discounts instead.
143
157
  #
144
158
  # @return [String, nil]
145
159
  optional :discount_id, String, nil?: true
@@ -168,7 +182,7 @@ module Dodopayments
168
182
  # @return [String, nil]
169
183
  optional :tax_id, String, nil?: true
170
184
 
171
- # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, discount_cycles_remaining: nil, discount_id: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil)
185
+ # @!method initialize(billing:, cancel_at_next_billing_date:, created_at:, currency:, customer:, discounts:, metadata:, next_billing_date:, on_demand:, payment_frequency_count:, payment_frequency_interval:, previous_billing_date:, product_id:, quantity:, recurring_pre_tax_amount:, status:, subscription_id:, subscription_period_count:, subscription_period_interval:, tax_inclusive:, trial_period_days:, cancelled_at: nil, customer_business_name: nil, discount_cycles_remaining: nil, discount_id: nil, payment_method_id: nil, product_name: nil, scheduled_change: nil, tax_id: nil)
172
186
  # Some parameter documentations has been truncated, see
173
187
  # {Dodopayments::Models::SubscriptionListResponse} for more details.
174
188
  #
@@ -184,6 +198,8 @@ module Dodopayments
184
198
  #
185
199
  # @param customer [Dodopayments::Models::CustomerLimitedDetails] Customer details associated with the subscription
186
200
  #
201
+ # @param discounts [Array<Dodopayments::Models::SubscriptionListResponse::Discount>] All stacked discounts applied, in order of application
202
+ #
187
203
  # @param metadata [Hash{Symbol=>String}] Additional custom data associated with the subscription
188
204
  #
189
205
  # @param next_billing_date [Time] Timestamp of the next scheduled billing. Indicates the end of current billing pe
@@ -216,9 +232,11 @@ module Dodopayments
216
232
  #
217
233
  # @param cancelled_at [Time, nil] Cancelled timestamp if the subscription is cancelled
218
234
  #
219
- # @param discount_cycles_remaining [Integer, nil] Number of remaining discount cycles if discount is applied
235
+ # @param customer_business_name [String, nil] Business / legal name associated with the tax id (B2B). When set this is
236
+ #
237
+ # @param discount_cycles_remaining [Integer, nil] DEPRECATED: Use discounts[].cycles_remaining instead.
220
238
  #
221
- # @param discount_id [String, nil] The discount id if discount is applied
239
+ # @param discount_id [String, nil] DEPRECATED: Use discounts instead.
222
240
  #
223
241
  # @param payment_method_id [String, nil] Saved payment method id used for recurring charges
224
242
  #
@@ -227,6 +245,28 @@ module Dodopayments
227
245
  # @param scheduled_change [Dodopayments::Models::ScheduledPlanChange, nil] Scheduled plan change details, if any
228
246
  #
229
247
  # @param tax_id [String, nil] Tax identifier provided for this subscription (if applicable)
248
+
249
+ class Discount < Dodopayments::Internal::Type::BaseModel
250
+ # @!attribute discount_id
251
+ # The unique discount ID
252
+ #
253
+ # @return [String]
254
+ required :discount_id, String
255
+
256
+ # @!attribute discount_cycles_remaining
257
+ # Remaining billing cycles for this discount on this subscription
258
+ #
259
+ # @return [Integer, nil]
260
+ optional :discount_cycles_remaining, Integer, nil?: true
261
+
262
+ # @!method initialize(discount_id:, discount_cycles_remaining: nil)
263
+ # Lightweight discount info for list endpoints. Array order represents position
264
+ # (no explicit position field).
265
+ #
266
+ # @param discount_id [String] The unique discount ID
267
+ #
268
+ # @param discount_cycles_remaining [Integer, nil] Remaining billing cycles for this discount on this subscription
269
+ end
230
270
  end
231
271
  end
232
272
  end