@adonis-agora/payments 0.22.0 → 0.23.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 (52) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/assets/spa/assets/index-DtMpe2lE.js +10 -0
  3. package/dist/assets/spa/assets/index-DtMpe2lE.js.map +1 -0
  4. package/dist/assets/spa/index.html +1 -1
  5. package/dist/commands/payments_renew.d.ts +2 -1
  6. package/dist/commands/payments_renew.d.ts.map +1 -1
  7. package/dist/commands/payments_renew.js +2 -1
  8. package/dist/commands/payments_renew.js.map +1 -1
  9. package/dist/src/billing/billing_store.d.ts +3 -0
  10. package/dist/src/billing/billing_store.d.ts.map +1 -1
  11. package/dist/src/billing/billing_store.js.map +1 -1
  12. package/dist/src/billing/lucid_billing_store.d.ts.map +1 -1
  13. package/dist/src/billing/lucid_billing_store.js +15 -0
  14. package/dist/src/billing/lucid_billing_store.js.map +1 -1
  15. package/dist/src/billing/managed_subscriptions.d.ts +22 -1
  16. package/dist/src/billing/managed_subscriptions.d.ts.map +1 -1
  17. package/dist/src/billing/managed_subscriptions.js +56 -4
  18. package/dist/src/billing/managed_subscriptions.js.map +1 -1
  19. package/dist/src/billing/mixins/with_subscription.d.ts +5 -0
  20. package/dist/src/billing/mixins/with_subscription.d.ts.map +1 -1
  21. package/dist/src/billing/mixins/with_subscription.js +3 -0
  22. package/dist/src/billing/mixins/with_subscription.js.map +1 -1
  23. package/dist/src/billing/schema.d.ts.map +1 -1
  24. package/dist/src/billing/schema.js +8 -0
  25. package/dist/src/billing/schema.js.map +1 -1
  26. package/dist/src/dashboard/handlers.d.ts.map +1 -1
  27. package/dist/src/dashboard/handlers.js +40 -31
  28. package/dist/src/dashboard/handlers.js.map +1 -1
  29. package/dist/src/drivers/asaas.d.ts.map +1 -1
  30. package/dist/src/drivers/asaas.js +5 -2
  31. package/dist/src/drivers/asaas.js.map +1 -1
  32. package/dist/src/drivers/paypal.d.ts.map +1 -1
  33. package/dist/src/drivers/paypal.js +14 -0
  34. package/dist/src/drivers/paypal.js.map +1 -1
  35. package/dist/src/drivers/shared.d.ts +13 -0
  36. package/dist/src/drivers/shared.d.ts.map +1 -1
  37. package/dist/src/drivers/shared.js +21 -0
  38. package/dist/src/drivers/shared.js.map +1 -1
  39. package/dist/src/drivers/woovi.d.ts.map +1 -1
  40. package/dist/src/drivers/woovi.js +12 -4
  41. package/dist/src/drivers/woovi.js.map +1 -1
  42. package/dist/src/subscriptions_api.d.ts +13 -0
  43. package/dist/src/subscriptions_api.d.ts.map +1 -1
  44. package/dist/src/subscriptions_api.js +18 -1
  45. package/dist/src/subscriptions_api.js.map +1 -1
  46. package/dist/src/testing/in_memory_billing_store.d.ts +1 -0
  47. package/dist/src/testing/in_memory_billing_store.d.ts.map +1 -1
  48. package/dist/src/testing/in_memory_billing_store.js +3 -0
  49. package/dist/src/testing/in_memory_billing_store.js.map +1 -1
  50. package/package.json +2 -2
  51. package/dist/assets/spa/assets/index-DsNg6yNC.js +0 -10
  52. package/dist/assets/spa/assets/index-DsNg6yNC.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @adonis-agora/payments
2
2
 
3
+ ## 0.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#184](https://github.com/DavideCarvalho/adonis-agora-payments/pull/184) [`df9ba7b`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/df9ba7bcaff525480e09bbd3fda56f2bc1e893de) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Managed subscriptions now renew by card, and renew at all on Asaas and Woovi.
8
+
9
+ - **The card token is kept.** `createManagedSubscription` stores `card.token` in the new `billing_subscriptions.payment_method_id` column (never serialized) and every renewal charges it as `paymentMethodId`. Before, a renewal went out with no token. Run the billing schema migration again to add the column.
10
+ - **Fix: a renewal returned the first cycle's charge on Asaas.** The driver looked for duplicates by `externalReference`, which every cycle shares, so nothing new was charged. Woovi's `correlationID` had the same collision. When a charge has both `externalReference` and `idempotencyKey`, the gateway field now carries `<reference>|k:<hash>`; webhooks hand back the plain reference, so routing does not change. Code reading the raw field at the gateway sees the suffix.
11
+ - **Fix: the Lucid store dropped `lastRenewalError`, `lastRenewalAttemptAt` and `renewalFailureCount`** on update.
12
+ - **Failed renewals back off.** They wait 1h, 6h, 24h, then 72h instead of retrying every tick; override with `renewDue({ retryDelaysHours })`. A charge the gateway answers as `failed` now counts as a failure instead of advancing the period. `failed` outcomes carry `failureCount` and `externalReference`.
13
+ - **New `subscriptions().updatePaymentMethod(id, token)`** replaces the saved card. A subscription in a failure streak becomes due at once; a healthy one keeps its date.
14
+
15
+ ## 0.22.1
16
+
17
+ ### Patch Changes
18
+
19
+ - [#179](https://github.com/DavideCarvalho/adonis-agora-payments/pull/179) [`6968caf`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/6968cafa9897c05669886d0472f35ca82111c228) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - perf: dedupe concurrent PayPal OAuth token mints (a burst of calls on a cold or just-expired cache now shares one `/v1/oauth2/token` request, like the Efí driver already did); the console's disputes "due within" and subscriptions endpoints run their independent page/count reads in parallel instead of sequentially; `createBillingTables` adds `billing_subscriptions_external_reference_idx` so `listSubscriptions({ externalReference })` is an indexed lookup instead of a full table scan.
20
+
3
21
  ## 0.22.0
4
22
 
5
23
  ### Minor Changes