@adonis-agora/payments 1.0.0-rc.0 → 1.0.0-rc.10

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 (256) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/assets/spa/assets/index-5dx49kj3.js +10 -0
  3. package/dist/assets/spa/assets/index-5dx49kj3.js.map +1 -0
  4. package/dist/assets/spa/assets/index-CzCxJVQH.css +2 -0
  5. package/dist/assets/spa/index.html +2 -2
  6. package/dist/commands/agora_doctor.d.ts +23 -0
  7. package/dist/commands/agora_doctor.d.ts.map +1 -0
  8. package/dist/commands/agora_doctor.js +110 -0
  9. package/dist/commands/agora_doctor.js.map +1 -0
  10. package/dist/commands/main.d.ts +4 -3
  11. package/dist/commands/main.d.ts.map +1 -1
  12. package/dist/commands/main.js +5 -1
  13. package/dist/commands/main.js.map +1 -1
  14. package/dist/commands/payments_doctor.d.ts +8 -0
  15. package/dist/commands/payments_doctor.d.ts.map +1 -0
  16. package/dist/commands/payments_doctor.js +8 -0
  17. package/dist/commands/payments_doctor.js.map +1 -0
  18. package/dist/commands/payments_sync.d.ts +30 -0
  19. package/dist/commands/payments_sync.d.ts.map +1 -1
  20. package/dist/commands/payments_sync.js +125 -2
  21. package/dist/commands/payments_sync.js.map +1 -1
  22. package/dist/configure.d.ts.map +1 -1
  23. package/dist/configure.js +0 -1
  24. package/dist/configure.js.map +1 -1
  25. package/dist/providers/dashboard_provider.d.ts +73 -36
  26. package/dist/providers/dashboard_provider.d.ts.map +1 -1
  27. package/dist/providers/dashboard_provider.js +472 -211
  28. package/dist/providers/dashboard_provider.js.map +1 -1
  29. package/dist/providers/payments_provider.d.ts.map +1 -1
  30. package/dist/providers/payments_provider.js +121 -0
  31. package/dist/providers/payments_provider.js.map +1 -1
  32. package/dist/src/account_console/card_mounters/asaas.d.ts +6 -0
  33. package/dist/src/account_console/card_mounters/asaas.d.ts.map +1 -0
  34. package/dist/src/account_console/card_mounters/asaas.js +45 -0
  35. package/dist/src/account_console/card_mounters/asaas.js.map +1 -0
  36. package/dist/src/account_console/card_mounters/mercadopago.d.ts +6 -0
  37. package/dist/src/account_console/card_mounters/mercadopago.d.ts.map +1 -0
  38. package/dist/src/account_console/card_mounters/mercadopago.js +33 -0
  39. package/dist/src/account_console/card_mounters/mercadopago.js.map +1 -0
  40. package/dist/src/account_console/card_mounters/pagarme.d.ts +7 -0
  41. package/dist/src/account_console/card_mounters/pagarme.d.ts.map +1 -0
  42. package/dist/src/account_console/card_mounters/pagarme.js +40 -0
  43. package/dist/src/account_console/card_mounters/pagarme.js.map +1 -0
  44. package/dist/src/account_console/card_mounters/paypal.d.ts +7 -0
  45. package/dist/src/account_console/card_mounters/paypal.d.ts.map +1 -0
  46. package/dist/src/account_console/card_mounters/paypal.js +16 -0
  47. package/dist/src/account_console/card_mounters/paypal.js.map +1 -0
  48. package/dist/src/account_console/card_mounters/square.d.ts +6 -0
  49. package/dist/src/account_console/card_mounters/square.d.ts.map +1 -0
  50. package/dist/src/account_console/card_mounters/square.js +18 -0
  51. package/dist/src/account_console/card_mounters/square.js.map +1 -0
  52. package/dist/src/account_console/card_mounters/stripe.d.ts +3 -0
  53. package/dist/src/account_console/card_mounters/stripe.d.ts.map +1 -0
  54. package/dist/src/account_console/card_mounters/stripe.js +17 -0
  55. package/dist/src/account_console/card_mounters/stripe.js.map +1 -0
  56. package/dist/src/account_console/card_script.d.ts +9 -0
  57. package/dist/src/account_console/card_script.d.ts.map +1 -0
  58. package/dist/src/account_console/card_script.js +133 -0
  59. package/dist/src/account_console/card_script.js.map +1 -0
  60. package/dist/src/account_console/card_ticket.d.ts +21 -0
  61. package/dist/src/account_console/card_ticket.d.ts.map +1 -0
  62. package/dist/src/account_console/card_ticket.js +67 -0
  63. package/dist/src/account_console/card_ticket.js.map +1 -0
  64. package/dist/src/account_console/contract.d.ts +200 -0
  65. package/dist/src/account_console/contract.d.ts.map +1 -0
  66. package/dist/src/account_console/contract.js +10 -0
  67. package/dist/src/account_console/contract.js.map +1 -0
  68. package/dist/src/account_console/extension.d.ts +117 -0
  69. package/dist/src/account_console/extension.d.ts.map +1 -0
  70. package/dist/src/account_console/extension.js +1031 -0
  71. package/dist/src/account_console/extension.js.map +1 -0
  72. package/dist/src/account_console/messages.d.ts +5 -0
  73. package/dist/src/account_console/messages.d.ts.map +1 -0
  74. package/dist/src/account_console/messages.js +182 -0
  75. package/dist/src/account_console/messages.js.map +1 -0
  76. package/dist/src/account_console/tokenize_endpoint.d.ts +30 -0
  77. package/dist/src/account_console/tokenize_endpoint.d.ts.map +1 -0
  78. package/dist/src/account_console/tokenize_endpoint.js +120 -0
  79. package/dist/src/account_console/tokenize_endpoint.js.map +1 -0
  80. package/dist/src/agora/tenancy.d.ts +132 -0
  81. package/dist/src/agora/tenancy.d.ts.map +1 -0
  82. package/dist/src/agora/tenancy.js +161 -0
  83. package/dist/src/agora/tenancy.js.map +1 -0
  84. package/dist/src/billing/billing_store.d.ts +64 -20
  85. package/dist/src/billing/billing_store.d.ts.map +1 -1
  86. package/dist/src/billing/billing_store.js +6 -0
  87. package/dist/src/billing/billing_store.js.map +1 -1
  88. package/dist/src/billing/index.d.ts +1 -1
  89. package/dist/src/billing/index.d.ts.map +1 -1
  90. package/dist/src/billing/lucid_billing_store.d.ts +42 -13
  91. package/dist/src/billing/lucid_billing_store.d.ts.map +1 -1
  92. package/dist/src/billing/lucid_billing_store.js +325 -100
  93. package/dist/src/billing/lucid_billing_store.js.map +1 -1
  94. package/dist/src/billing/owner_scope.d.ts +30 -0
  95. package/dist/src/billing/owner_scope.d.ts.map +1 -0
  96. package/dist/src/billing/owner_scope.js +35 -0
  97. package/dist/src/billing/owner_scope.js.map +1 -0
  98. package/dist/src/billing/resolve_store.d.ts.map +1 -1
  99. package/dist/src/billing/resolve_store.js +26 -2
  100. package/dist/src/billing/resolve_store.js.map +1 -1
  101. package/dist/src/billing/schema.d.ts +33 -3
  102. package/dist/src/billing/schema.d.ts.map +1 -1
  103. package/dist/src/billing/schema.js +153 -62
  104. package/dist/src/billing/schema.js.map +1 -1
  105. package/dist/src/billing/scoped_store.d.ts +18 -0
  106. package/dist/src/billing/scoped_store.d.ts.map +1 -0
  107. package/dist/src/billing/scoped_store.js +178 -0
  108. package/dist/src/billing/scoped_store.js.map +1 -0
  109. package/dist/src/billing/usage.d.ts +10 -1
  110. package/dist/src/billing/usage.d.ts.map +1 -1
  111. package/dist/src/billing/usage.js +25 -4
  112. package/dist/src/billing/usage.js.map +1 -1
  113. package/dist/src/billing/webhook_processor.d.ts +7 -0
  114. package/dist/src/billing/webhook_processor.d.ts.map +1 -1
  115. package/dist/src/billing/webhook_processor.js +37 -1
  116. package/dist/src/billing/webhook_processor.js.map +1 -1
  117. package/dist/src/client/define_config.d.ts +5 -1
  118. package/dist/src/client/define_config.d.ts.map +1 -1
  119. package/dist/src/client/define_config.js +15 -1
  120. package/dist/src/client/define_config.js.map +1 -1
  121. package/dist/src/current_customer.d.ts +27 -0
  122. package/dist/src/current_customer.d.ts.map +1 -0
  123. package/dist/src/current_customer.js +46 -0
  124. package/dist/src/current_customer.js.map +1 -0
  125. package/dist/src/dashboard/access_denied_page.d.ts +5 -7
  126. package/dist/src/dashboard/access_denied_page.d.ts.map +1 -1
  127. package/dist/src/dashboard/access_denied_page.js +2 -6
  128. package/dist/src/dashboard/access_denied_page.js.map +1 -1
  129. package/dist/src/dashboard/console_authorize.d.ts +101 -0
  130. package/dist/src/dashboard/console_authorize.d.ts.map +1 -0
  131. package/dist/src/dashboard/console_authorize.js +161 -0
  132. package/dist/src/dashboard/console_authorize.js.map +1 -0
  133. package/dist/src/dashboard/console_switcher.d.ts +113 -0
  134. package/dist/src/dashboard/console_switcher.d.ts.map +1 -0
  135. package/dist/src/dashboard/console_switcher.js +234 -0
  136. package/dist/src/dashboard/console_switcher.js.map +1 -0
  137. package/dist/src/dashboard/define_config.d.ts +24 -49
  138. package/dist/src/dashboard/define_config.d.ts.map +1 -1
  139. package/dist/src/dashboard/define_config.js +1 -67
  140. package/dist/src/dashboard/define_config.js.map +1 -1
  141. package/dist/src/dashboard/dev_tools.d.ts +119 -0
  142. package/dist/src/dashboard/dev_tools.d.ts.map +1 -0
  143. package/dist/src/dashboard/dev_tools.js +446 -0
  144. package/dist/src/dashboard/dev_tools.js.map +1 -0
  145. package/dist/src/dashboard/handlers.d.ts +31 -17
  146. package/dist/src/dashboard/handlers.d.ts.map +1 -1
  147. package/dist/src/dashboard/handlers.js +247 -230
  148. package/dist/src/dashboard/handlers.js.map +1 -1
  149. package/dist/src/dashboard/index.d.ts +11 -8
  150. package/dist/src/dashboard/index.d.ts.map +1 -1
  151. package/dist/src/dashboard/index.js +8 -6
  152. package/dist/src/dashboard/index.js.map +1 -1
  153. package/dist/src/dashboard/list_filters.d.ts +83 -0
  154. package/dist/src/dashboard/list_filters.d.ts.map +1 -0
  155. package/dist/src/dashboard/list_filters.js +152 -0
  156. package/dist/src/dashboard/list_filters.js.map +1 -0
  157. package/dist/src/dashboard/spa.d.ts +11 -13
  158. package/dist/src/dashboard/spa.d.ts.map +1 -1
  159. package/dist/src/dashboard/spa.js +4 -4
  160. package/dist/src/dashboard/spa.js.map +1 -1
  161. package/dist/src/dashboard/tenant_scope.d.ts +44 -0
  162. package/dist/src/dashboard/tenant_scope.d.ts.map +1 -0
  163. package/dist/src/dashboard/tenant_scope.js +42 -0
  164. package/dist/src/dashboard/tenant_scope.js.map +1 -0
  165. package/dist/src/define_config.d.ts +54 -0
  166. package/dist/src/define_config.d.ts.map +1 -1
  167. package/dist/src/define_config.js +12 -2
  168. package/dist/src/define_config.js.map +1 -1
  169. package/dist/src/doctor/agora_doctor.d.ts +116 -0
  170. package/dist/src/doctor/agora_doctor.d.ts.map +1 -0
  171. package/dist/src/doctor/agora_doctor.js +685 -0
  172. package/dist/src/doctor/agora_doctor.js.map +1 -0
  173. package/dist/src/doctor/checks.d.ts +53 -0
  174. package/dist/src/doctor/checks.d.ts.map +1 -0
  175. package/dist/src/doctor/checks.js +344 -0
  176. package/dist/src/doctor/checks.js.map +1 -0
  177. package/dist/src/doctor/index.d.ts +9 -0
  178. package/dist/src/doctor/index.d.ts.map +1 -0
  179. package/dist/src/doctor/index.js +8 -0
  180. package/dist/src/doctor/index.js.map +1 -0
  181. package/dist/src/driver.d.ts +85 -0
  182. package/dist/src/driver.d.ts.map +1 -1
  183. package/dist/src/drivers/asaas.d.ts +12 -1
  184. package/dist/src/drivers/asaas.d.ts.map +1 -1
  185. package/dist/src/drivers/asaas.js +29 -0
  186. package/dist/src/drivers/asaas.js.map +1 -1
  187. package/dist/src/drivers/dodo.d.ts +6 -1
  188. package/dist/src/drivers/dodo.d.ts.map +1 -1
  189. package/dist/src/drivers/dodo.js +12 -0
  190. package/dist/src/drivers/dodo.js.map +1 -1
  191. package/dist/src/drivers/lemonsqueezy.d.ts +7 -1
  192. package/dist/src/drivers/lemonsqueezy.d.ts.map +1 -1
  193. package/dist/src/drivers/lemonsqueezy.js +21 -0
  194. package/dist/src/drivers/lemonsqueezy.js.map +1 -1
  195. package/dist/src/drivers/mercadopago.d.ts +25 -1
  196. package/dist/src/drivers/mercadopago.d.ts.map +1 -1
  197. package/dist/src/drivers/mercadopago.js +46 -1
  198. package/dist/src/drivers/mercadopago.js.map +1 -1
  199. package/dist/src/drivers/paddle.d.ts +9 -1
  200. package/dist/src/drivers/paddle.d.ts.map +1 -1
  201. package/dist/src/drivers/paddle.js +24 -0
  202. package/dist/src/drivers/paddle.js.map +1 -1
  203. package/dist/src/drivers/pagarme.d.ts +13 -1
  204. package/dist/src/drivers/pagarme.d.ts.map +1 -1
  205. package/dist/src/drivers/pagarme.js +31 -0
  206. package/dist/src/drivers/pagarme.js.map +1 -1
  207. package/dist/src/drivers/paypal.d.ts +19 -1
  208. package/dist/src/drivers/paypal.d.ts.map +1 -1
  209. package/dist/src/drivers/paypal.js +62 -1
  210. package/dist/src/drivers/paypal.js.map +1 -1
  211. package/dist/src/drivers/polar.d.ts +6 -1
  212. package/dist/src/drivers/polar.d.ts.map +1 -1
  213. package/dist/src/drivers/polar.js +18 -0
  214. package/dist/src/drivers/polar.js.map +1 -1
  215. package/dist/src/drivers/square.d.ts +18 -1
  216. package/dist/src/drivers/square.d.ts.map +1 -1
  217. package/dist/src/drivers/square.js +49 -0
  218. package/dist/src/drivers/square.js.map +1 -1
  219. package/dist/src/drivers/stripe.d.ts +13 -1
  220. package/dist/src/drivers/stripe.d.ts.map +1 -1
  221. package/dist/src/drivers/stripe.js +81 -2
  222. package/dist/src/drivers/stripe.js.map +1 -1
  223. package/dist/src/ensure_customer.d.ts +9 -0
  224. package/dist/src/ensure_customer.d.ts.map +1 -1
  225. package/dist/src/ensure_customer.js +12 -3
  226. package/dist/src/ensure_customer.js.map +1 -1
  227. package/dist/src/index.d.ts +14 -5
  228. package/dist/src/index.d.ts.map +1 -1
  229. package/dist/src/index.js +4 -0
  230. package/dist/src/index.js.map +1 -1
  231. package/dist/src/payments_manager.d.ts +39 -1
  232. package/dist/src/payments_manager.d.ts.map +1 -1
  233. package/dist/src/payments_manager.js +77 -7
  234. package/dist/src/payments_manager.js.map +1 -1
  235. package/dist/src/testing/in_memory_billing_store.d.ts +14 -11
  236. package/dist/src/testing/in_memory_billing_store.d.ts.map +1 -1
  237. package/dist/src/testing/in_memory_billing_store.js +83 -25
  238. package/dist/src/testing/in_memory_billing_store.js.map +1 -1
  239. package/dist/stubs/config/payments_dashboard.stub +12 -23
  240. package/dist/stubs/database/migrations/create_billing_tables.stub +9 -2
  241. package/package.json +14 -3
  242. package/dist/assets/spa/assets/index-CyiEHJ5F.js +0 -10
  243. package/dist/assets/spa/assets/index-CyiEHJ5F.js.map +0 -1
  244. package/dist/assets/spa/assets/index-ZuYF2tz5.css +0 -2
  245. package/dist/src/dashboard/auth.d.ts +0 -136
  246. package/dist/src/dashboard/auth.d.ts.map +0 -1
  247. package/dist/src/dashboard/auth.js +0 -152
  248. package/dist/src/dashboard/auth.js.map +0 -1
  249. package/dist/src/dashboard/login_page.d.ts +0 -36
  250. package/dist/src/dashboard/login_page.d.ts.map +0 -1
  251. package/dist/src/dashboard/login_page.js +0 -158
  252. package/dist/src/dashboard/login_page.js.map +0 -1
  253. package/dist/src/dashboard/session_cookie.d.ts +0 -42
  254. package/dist/src/dashboard/session_cookie.d.ts.map +0 -1
  255. package/dist/src/dashboard/session_cookie.js +0 -97
  256. package/dist/src/dashboard/session_cookie.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,82 @@
1
1
  # @adonis-agora/payments
2
2
 
3
+ ## 1.0.0-rc.10
4
+
5
+ ### Major Changes
6
+
7
+ - [#237](https://github.com/DavideCarvalho/adonis-agora-payments/pull/237) [`66d22c9`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/66d22c97f1c287de431cd0ca01ae9c8904b667f4) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Console list endpoints use the `@adonis-agora/filter` wire format. `GET <path>/api/{payments,subscriptions,disputes,webhook-events,customers,audit}` take `filter[field]=value` (exact, one value), an optional `sort` limited to the list's one order, and `page`/`size`, and answer `{ data, meta: { total, perPage, currentPage, lastPage, firstPage } }` with a real total. Unknown filter fields, unsupported operators and other sorts answer `400`. The payments `reference` lookup is `filter[externalReference]`, the disputes work list is `filter[dueWithin]` with its total in `meta.total`. `BillingStore` count reads take the list filters (`PaymentCountQuery`, `SubscriptionCountQuery`, `DisputeCountQuery`, `WebhookEventCountQuery`) and a new `countCustomers` is required. The bundled console builds its requests with `@adonis-agora/filter-client` and pages with the real total.
8
+
9
+ ## 1.0.0-rc.9
10
+
11
+ ### Patch Changes
12
+
13
+ - [#235](https://github.com/DavideCarvalho/adonis-agora-payments/pull/235) [`13c4b2d`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/13c4b2debac163f0990d9ca005d5720b111cfba1) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - The payments console no longer gets a 404 on load with tenancy off. `GET <path>/api/tenants` is now always mounted and answers `{ mode: 'off' }` when tenancy is off, the same way telescope's console answers. The audited organization switch (`POST <path>/api/tenants/:id/select`) is still mounted only with tenancy on.
14
+
15
+ ## 1.0.0-rc.8
16
+
17
+ ### Minor Changes
18
+
19
+ - [#234](https://github.com/DavideCarvalho/adonis-agora-payments/pull/234) [`09f49a8`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/09f49a8d3bde85c9b38517c5bb08349351561fc7) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - `billing.connection` and `billing.schema` put the billing tables on their own Lucid connection and in their own Postgres schema (MySQL: database), e.g. `"billing"."billing_payments"` while the app stays in `public`. Every statement names the schema: the DDL, the column checks, the store's reads and writes (so the dashboard, account console and dev MCP reads too), the published migration and `agora:doctor`. Nothing relies on `search_path`, so this is safe behind PgBouncer in transaction mode. The schema is created on first use (or by the migration), the name is validated at boot, and SQLite with a `schema` fails the boot. `billingStores.lucid(...)` inherits both options; `createBillingTables`/`dropBillingTables`/`truncateBillingTables` take `{ schema }`. Without either option, behaviour is unchanged.
20
+
21
+ ## 1.0.0-rc.7
22
+
23
+ ### Patch Changes
24
+
25
+ - [#233](https://github.com/DavideCarvalho/adonis-agora-payments/pull/233) [`0e33af4`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/0e33af4ad2631cc3b4fe13bcaf23cfcefb802bbb) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - The billing store's "is this table/column installed?" probes no longer skip dispute, audit and ledger writes silently. They used a catalog lookup that only saw the connection's current schema, so a model with a qualified `static table` (or one living in another schema) read as "not installed" and its rows were never written. The probe now queries through the model itself, resolving the table exactly as the write does. When something really is missing: with `autoCreateSchema` on the write fails with an error naming the table (the model points somewhere the DDL did not create); with it off the write is skipped as before, with a warning logged once per process.
26
+
27
+ ## 1.0.0-rc.6
28
+
29
+ ### Minor Changes
30
+
31
+ - [#228](https://github.com/DavideCarvalho/adonis-agora-payments/pull/228) [`7f8a8a2`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/7f8a8a2d3560d5aca56dfc7fb20e59f7277021c4) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - The payments console joins the Agora console switcher. It registers itself in the app's `'agora.consoles'` registry (created by whichever console boots first), and its heading becomes a menu to the other Agora consoles the viewer may open, each checked with that console's own `authorize` (300 ms each, in parallel; `ctx.agoraProbe` is `true` while they run). Ctrl/Cmd-K searches every console the viewer may open; payments answers payments (gateway id or reference), customers (gateway id or owner id) and subscriptions (gateway id or reference, opening that subscription), only within the organizations the viewer may see. New routes: `GET <path>/api/consoles` and `GET <path>/api/consoles/search?q=`, behind the console's `authorize`. `registerAgoraConsole` is exported from `@adonis-agora/payments/dashboard` for consoles an app mounts itself. Nothing changes for an app with a single console.
32
+
33
+ ## 1.0.0-rc.5
34
+
35
+ ### Minor Changes
36
+
37
+ - [#227](https://github.com/DavideCarvalho/adonis-agora-payments/pull/227) [`78d6fdf`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/78d6fdfbff204063059b3a8157a43db8cb42c973) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - The payments console now serves its data to coding agents on the app's dev MCP endpoint (`/mcp/agora`) when the app registers `@adonis-agora/agent/mcp_provider`. Fourteen `payments_*` tools, gated by the console's own `authorize` and, with organizations on, scoped to the organizations the console shows the caller (`tenant` narrows to one). Reads (`payments_get_overview`, `payments_get_health`, `payments_list_payments`, `payments_get_payment`, `payments_list_subscriptions`, `payments_get_subscription`, `payments_list_disputes`, `payments_list_webhook_events`, `payments_list_customers`, `payments_list_audit`, `payments_list_organizations`) are listed by default and return what the console's JSON API returns. The actions (`payments_refund_payment`, `payments_retry_webhook_event`, `payments_resolve_dispute`) only when the app opts in on the dev endpoint; each is recorded in the activity trail as `mcp:<caller>`. No configuration in this package.
38
+
39
+ New `anyAuthorize(...authorizers)` in `@adonis-agora/payments/dashboard`: allows a request when any of the given `authorize` forms does, e.g. a console token for MCP clients or a signed-in admin.
40
+
41
+ - [#227](https://github.com/DavideCarvalho/adonis-agora-payments/pull/227) [`78d6fdf`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/78d6fdfbff204063059b3a8157a43db8cb42c973) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - New `GET <path>/api/subscriptions/:id` in the payments console API: one subscription, by its id or its gateway id, with its current state, the customer it bills, the payments charged for it, the webhook events naming those payments and its audit rows. Scoped to the viewer's organizations like every other read (another organization's subscription is `404`). `GET <path>/api/subscriptions` also takes `customerId`. The billing store's `listSubscriptions` takes `id` and `listPayments` takes `subscriptionId` (exact matches; a custom store that ignores them still answers correctly in the console), and with organizations on, a subscription's audit rows are visible to a viewer who can see the subscription.
42
+
43
+ - [#227](https://github.com/DavideCarvalho/adonis-agora-payments/pull/227) [`78d6fdf`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/78d6fdfbff204063059b3a8157a43db8cb42c973) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - A webhook retry from the payments console is now recorded in the activity trail as `webhook.retried`, with who ran it (the console viewer, or `mcp:<caller>` from the dev MCP tools: both paths write the same row), the gateway, and the event's type and previous error. The retry response carries the audit row. The Activity screen can filter retries.
44
+
45
+ ## 1.0.0-rc.4
46
+
47
+ ### Minor Changes
48
+
49
+ - [#229](https://github.com/DavideCarvalho/adonis-agora-payments/pull/229) [`771cf19`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/771cf19a7ef13bde72b993b6e82a9014c811335e) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Account console pages. When `@adonis-agora/authkit-server` (or authkit-client) is in the app, payments registers itself into authkit's `authkit.accountExtensions` registry, with no import of authkit. Signed-in users get `/account/billing` (cancel at period end, keep subscription, change plan, update card — each with confirmation and a recent sign-in), `/account/payment-method` (the card updated in place with the gateway's own component: Stripe Payment Element, Mercado Pago Secure Fields, Pagar.me, Square Web Payments, PayPal button, and an Asaas card form tokenized by the app) and `/account/invoices` (payments and gateway invoices, with download). Gateways without a component send the user to their own page (Stripe billing portal, Lemon Squeezy, Paddle, Polar, Dodo). New `accountConsole` option in `config/payments.ts`: `false`, or `{ owner, organizationRoles, pages, actions, plans, changePlan, invoiceUrl, path, publicUrl, returnUrl }`; with organizations on, the pages bill the active organization for its owners and admins. Drivers gain optional `cardSetup`, `saveCard` and `cardUpdateUrl`; `UpdateSubscriptionInput.planId` (Stripe swaps the price); new driver options `publishableKey` (Stripe), `publicKey` (Pagar.me, Mercado Pago), `applicationId` (Square).
50
+
51
+ ## 1.0.0-rc.3
52
+
53
+ ### Minor Changes
54
+
55
+ - [#225](https://github.com/DavideCarvalho/adonis-agora-payments/pull/225) [`da2bcf4`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/da2bcf4419969d8f2b30baddca089db33a18a8aa) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Organizations as tenants. With tenancy on in `@adonis-agora/context` (payments' new `tenancy` option defaults to `'inherit'`; nothing changes while it is off): `ensureCustomer` with a store and no `owner` records the active organization as the owner; `payments.currentOwner()` / `payments.currentCustomer()` answer the active organization's customer, else the signed-in user's (`userOwnerType`, default `'User'`); metered usage with no `customerId` is the current customer's; `payments.scopedStore()` confines reads to the current organization; app webhook handlers run inside the organization that owns the customer. The console's `authorize` may answer `tenants: '*' | string[]`; reads are confined to the viewer's organizations, `?tenant=` picks one (a pick outside the grant reads as empty and is audited), and the SPA gains an Organization picker. Store reads accept `owners` (custom stores opt in with `ownerScoping: true`). `payments:sync` gains `--tenant`, `--backfill-owner`, `--owner-id` and `--owner-key`.
56
+
57
+ ## 1.0.0-rc.2
58
+
59
+ ### Minor Changes
60
+
61
+ - [#224](https://github.com/DavideCarvalho/adonis-agora-payments/pull/224) [`2cc413d`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/2cc413d2889a40e6d6f4f443dad315043247be64) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - `node ace agora:doctor` (and `payments:doctor`). The commands barrel now ships the shared Agora health check, and the payments provider registers its checks into the `'agora.doctor'` registry: `payments.webhook-secret`, `payments.webhook-csrf`, `payments.console-gate`, and with `--deep` `payments.tables` and `payments.health` (the `payments:health` report). The new `@adonis-agora/payments/doctor` entry serves `--no-boot`.
62
+
63
+ ## 1.0.0-rc.1
64
+
65
+ ### Major Changes
66
+
67
+ - [#222](https://github.com/DavideCarvalho/adonis-agora-payments/pull/222) [`b57fa20`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/b57fa209cf7da05b6c26eebb8ced5341d85eaa67) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Dashboard `authorize` adopts the shared Agora console contract, and the console behaves like every other Agora console.
68
+
69
+ - `authorize` takes an inline function, an authorizer class (built through the container, so `@inject()` works), or a lazy import `() => import('#policies/console_access')`. An authorizer may answer `{ redirectTo }`: a `302` for page navigations, `401 { error: 'unauthenticated', redirectTo }` for API calls. A throw is a `403`.
70
+ - With `authorize` omitted the console is open outside production and answers every request with `403` in production, and the app logs one warning at boot: ``[@adonis-agora/payments] console has no `authorize` configured: it is open outside production and denies every request in production. Set `authorize` in config/payments_dashboard.ts.``
71
+ - `PAYMENTS_DASHBOARD_TOKEN` is removed, with the `x-payments-token` header and the `?token=` query param, and `defaultAuthorize` is no longer exported. For token access use the new `authorizeByToken({ token: env.get('CONSOLE_TOKEN') })`, which checks `Authorization: Bearer <token>` in constant time and answers `401` otherwise. An empty token throws when the config loads.
72
+ - API denials from `authorize` answer `{ error: 'forbidden' }` (`403`) or `{ error: 'unauthenticated' }` (`401`, was `'unauthorized'`).
73
+ - `dashboardAuth` is removed, with no alias: the built-in login page, `GET|POST <path>/login`, `POST <path>/session`, `GET <path>/logout`, the signed session cookie and its `login`/`session` hooks, and the exports `resolveDashboardAuth`, `performLogin`, `performSession`, `readSession`, `sanitizeReturnTo`, `SESSION_COOKIE_NAME`, `signSessionCookie`, `verifySessionCookie`, `renderLoginPage` and the types `DashboardAuthOptions`, `ResolvedDashboardAuth`, `AuthMode`, `LoginHook`, `LoginOutcome`, `SessionHook`, `SessionOutcome`, `DashboardSession`, `DashboardSessionUser`, `SignOptions`, `VerifyOptions`, `InjectedAuth`. Sign-in is your app's own: gate the console in `authorize` and return `{ redirectTo: '/login' }` for a signed-out visitor. `ResolvedPaymentsDashboardConfig` has no `dashboardAuth`, and the injected page config no `auth`.
74
+ - The console UI has no Sign out link. On a `401` from its API it follows the body's `redirectTo`, or reloads the console page so the server answers the navigation.
75
+ - Refunds and dispute resolutions are recorded against the app's signed-in user (`ctx.auth.user`'s `email`, `name` or `id`), `bearer` for a token caller, else unattributed.
76
+ - The access-denied page drops the `session-required` reason; `loginHref` is only what you pass in `accessDenied`.
77
+
78
+ Exported from `@adonis-agora/payments/dashboard`: `ConsoleAuthorize`, `ConsoleAuthorizer`, `ConsoleAuthorizerClass`, `ConsoleAuthorizeResult`, `resolveConsoleAuthorize`, `authorizeByToken`. `ResolvedPaymentsDashboardConfig['authorize']` is now `ConsoleAuthorize | null`. The payments client endpoint (`config/payments_client.ts`) and payment-driver tokens are unchanged.
79
+
3
80
  ## 1.0.0-rc.0
4
81
 
5
82
  ### Major Changes