@adonis-agora/payments 0.22.1 → 0.23.1
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.
- package/CHANGELOG.md +18 -0
- package/dist/assets/spa/assets/index-DtMpe2lE.js.map +1 -1
- package/dist/commands/payments_renew.d.ts +2 -1
- package/dist/commands/payments_renew.d.ts.map +1 -1
- package/dist/commands/payments_renew.js +2 -1
- package/dist/commands/payments_renew.js.map +1 -1
- package/dist/src/billing/billing_store.d.ts +3 -0
- package/dist/src/billing/billing_store.d.ts.map +1 -1
- package/dist/src/billing/billing_store.js.map +1 -1
- package/dist/src/billing/lucid_billing_store.d.ts.map +1 -1
- package/dist/src/billing/lucid_billing_store.js +15 -0
- package/dist/src/billing/lucid_billing_store.js.map +1 -1
- package/dist/src/billing/managed_subscriptions.d.ts +22 -1
- package/dist/src/billing/managed_subscriptions.d.ts.map +1 -1
- package/dist/src/billing/managed_subscriptions.js +83 -14
- package/dist/src/billing/managed_subscriptions.js.map +1 -1
- package/dist/src/billing/mixins/with_subscription.d.ts +5 -0
- package/dist/src/billing/mixins/with_subscription.d.ts.map +1 -1
- package/dist/src/billing/mixins/with_subscription.js +3 -0
- package/dist/src/billing/mixins/with_subscription.js.map +1 -1
- package/dist/src/billing/schema.d.ts.map +1 -1
- package/dist/src/billing/schema.js +3 -0
- package/dist/src/billing/schema.js.map +1 -1
- package/dist/src/drivers/asaas.d.ts.map +1 -1
- package/dist/src/drivers/asaas.js +5 -2
- package/dist/src/drivers/asaas.js.map +1 -1
- package/dist/src/drivers/shared.d.ts +13 -0
- package/dist/src/drivers/shared.d.ts.map +1 -1
- package/dist/src/drivers/shared.js +21 -0
- package/dist/src/drivers/shared.js.map +1 -1
- package/dist/src/drivers/woovi.d.ts.map +1 -1
- package/dist/src/drivers/woovi.js +12 -4
- package/dist/src/drivers/woovi.js.map +1 -1
- package/dist/src/subscriptions_api.d.ts +13 -0
- package/dist/src/subscriptions_api.d.ts.map +1 -1
- package/dist/src/subscriptions_api.js +18 -1
- package/dist/src/subscriptions_api.js.map +1 -1
- package/dist/src/testing/in_memory_billing_store.d.ts +1 -0
- package/dist/src/testing/in_memory_billing_store.d.ts.map +1 -1
- package/dist/src/testing/in_memory_billing_store.js +3 -0
- package/dist/src/testing/in_memory_billing_store.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @adonis-agora/payments
|
|
2
2
|
|
|
3
|
+
## 0.23.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#186](https://github.com/DavideCarvalho/adonis-agora-payments/pull/186) [`039a326`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/039a326e4488b2a668dfff332faee4a091411810) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Fix: when the first charge of a managed subscription failed, its row stayed `active` and was charged again one period later, debiting a customer whose signup had failed. The row is now closed before the error propagates.
|
|
8
|
+
|
|
9
|
+
## 0.23.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#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.
|
|
14
|
+
|
|
15
|
+
- **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.
|
|
16
|
+
- **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.
|
|
17
|
+
- **Fix: the Lucid store dropped `lastRenewalError`, `lastRenewalAttemptAt` and `renewalFailureCount`** on update.
|
|
18
|
+
- **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`.
|
|
19
|
+
- **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.
|
|
20
|
+
|
|
3
21
|
## 0.22.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|