@antelopejs/payment-subscriptions 0.0.3 → 0.0.5
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/README.md +98 -79
- package/dist/implementation.js +2 -2
- package/dist/implementation.js.map +1 -1
- package/dist/schedule.js +5 -8
- package/dist/schedule.js.map +1 -1
- package/docs/1.introduction.md +50 -37
- package/docs/2.renewal-clock.md +89 -73
- package/docs/3.failed-renewals.md +123 -93
- package/docs/4.provider-schedule.md +29 -20
- package/package.json +14 -9
package/README.md
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@antelopejs/payment-subscriptions`
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
|
-
<a href="https://www.npmjs.com/package/@antelopejs/payment-subscriptions"><img alt="npm" src="https://img.shields.io/npm/v/@antelopejs/payment-subscriptions?style=for-the-badge&labelColor=000000&color=000000"></a>
|
|
5
|
-
<a href="./LICENSE"><img alt="License" src="https://img.shields.io/npm/l/@antelopejs/payment-subscriptions?style=for-the-badge&labelColor=000000&color=000000"></a>
|
|
6
|
-
<a href="https://discord.gg/
|
|
7
|
-
<a href="./docs/1.introduction.md"><img alt="Docs" src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000"></a>
|
|
4
|
+
<a href="https://www.npmjs.com/package/@antelopejs/payment-subscriptions"><img data-illustration alt="npm" src="https://img.shields.io/npm/v/@antelopejs/payment-subscriptions?style=for-the-badge&labelColor=000000&color=000000"></a>
|
|
5
|
+
<a href="./LICENSE"><img data-illustration alt="License" src="https://img.shields.io/npm/l/@antelopejs/payment-subscriptions?style=for-the-badge&labelColor=000000&color=000000"></a>
|
|
6
|
+
<a href="https://discord.gg/g4pFt6eXqu"><img data-illustration alt="Discord" src="https://img.shields.io/badge/Discord-18181B?logo=discord&style=for-the-badge&color=000000"></a>
|
|
7
|
+
<a href="./docs/1.introduction.md"><img data-illustration alt="Docs" src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000"></a>
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
|
-
Subscriptions for any AntelopeJS payment provider.
|
|
11
|
-
`@antelopejs/interface-subscriptions` on top of `@antelopejs/interface-payment
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Checkout.com, Mangopay
|
|
10
|
+
Subscriptions for any AntelopeJS payment provider. This module implements
|
|
11
|
+
`@antelopejs/interface-subscriptions` on top of `@antelopejs/interface-payment`.
|
|
12
|
+
It charges saved payment methods off-session and runs the renewal clock itself.
|
|
13
|
+
It is the implementation for providers that leave each renewal to the merchant,
|
|
14
|
+
such as Adyen, Checkout.com, and Mangopay, and it works with any payment
|
|
15
|
+
provider.
|
|
16
|
+
|
|
17
|
+
Part of [AntelopeJS](https://github.com/AntelopeJS/antelopejs), the TypeScript framework where modules depend on contracts and the application chooses the provider. Built by the team behind [AntelopeJS DMS](https://github.com/AntelopeJS/dms).
|
|
15
18
|
|
|
16
19
|
## Installation
|
|
17
20
|
|
|
@@ -20,15 +23,19 @@ ajs project modules add @antelopejs/payment-subscriptions
|
|
|
20
23
|
ajs project modules install
|
|
21
24
|
```
|
|
22
25
|
|
|
23
|
-
Wire it
|
|
26
|
+
Wire it with these modules:
|
|
24
27
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
- A module that implements `@antelopejs/interface-payment`. That module makes
|
|
29
|
+
the charges.
|
|
30
|
+
- A module that implements `@antelopejs/interface-database`, such as
|
|
31
|
+
`@antelopejs/mongodb`. Every subscription lives there.
|
|
32
|
+
- Optionally, `@antelopejs/redis`, which implements both
|
|
33
|
+
`@antelopejs/interface-redis` and `@antelopejs/interface-redis-scheduler`.
|
|
34
|
+
With it, a renewal is charged when it is due instead of at the next poll.
|
|
30
35
|
|
|
31
|
-
The example below
|
|
36
|
+
The example below selects this module's renewal clock on purpose, with Stripe
|
|
37
|
+
payments and MongoDB storage. For Stripe's own billing, wire Stripe alone
|
|
38
|
+
instead. Set the three environment variables before startup.
|
|
32
39
|
|
|
33
40
|
```typescript [antelope.config.ts] docs-check
|
|
34
41
|
import { defineConfig } from "@antelopejs/interface-core/config";
|
|
@@ -40,7 +47,7 @@ export default defineConfig({
|
|
|
40
47
|
source: {
|
|
41
48
|
type: "package",
|
|
42
49
|
package: "@antelopejs/payment-subscriptions",
|
|
43
|
-
version: "^0.0.
|
|
50
|
+
version: "^0.0.3",
|
|
44
51
|
},
|
|
45
52
|
},
|
|
46
53
|
stripe: {
|
|
@@ -72,91 +79,103 @@ export default defineConfig({
|
|
|
72
79
|
### With a payment module that has subscriptions of its own
|
|
73
80
|
|
|
74
81
|
`@antelopejs/stripe` implements `@antelopejs/interface-subscriptions` natively.
|
|
75
|
-
Wire it alone for Stripe's own subscriptions.
|
|
76
|
-
two
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
Wire it alone for Stripe's own subscriptions. If you wire this module beside it,
|
|
83
|
+
two modules implement the interface, and the core picks one by module ID. It
|
|
84
|
+
does not guess which one you meant. To use this module's clock with Stripe
|
|
85
|
+
charges, make the choice explicit. Add
|
|
86
|
+
`disabledExports: ["@antelopejs/interface-subscriptions"]` to the entry of the
|
|
87
|
+
Stripe module, or add an `importOverrides` entry on each consumer.
|
|
80
88
|
|
|
81
89
|
## How it works
|
|
82
90
|
|
|
83
|
-
- **The database is the only source of truth.** Each subscription is one record
|
|
84
|
-
|
|
85
|
-
has
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
- **The database is the only source of truth.** Each subscription is one record.
|
|
92
|
+
The record holds its period, its status, when it next needs attention, and
|
|
93
|
+
the events it has not delivered yet. The database alone is enough to recover
|
|
94
|
+
a renewal.
|
|
95
|
+
- **The clock only triggers work.** With a Redis scheduler wired, each
|
|
96
|
+
subscription is one Redis task that fires when it is due, and a slow database
|
|
97
|
+
sweep catches any task that Redis loses. Without one, the module polls the
|
|
98
|
+
database. Redis is optional, and nothing waits on it. A module with no Redis
|
|
99
|
+
wired starts and renews. The suite checks the Redis scheduler through normal
|
|
100
|
+
interface routing, with the `@antelopejs/core` version that `devDependencies`
|
|
101
|
+
pins.
|
|
102
|
+
- **Charge recovery has a limit.** An instance claims a due renewal with a
|
|
103
|
+
conditional write before it charges it. Of several instances that race, one
|
|
93
104
|
charges and the rest stand down. The charge also carries an idempotency key
|
|
94
|
-
|
|
95
|
-
takes over an abandoned claim can replay only within the configured
|
|
96
|
-
guarantee
|
|
105
|
+
built from the subscription, the period, and the attempt. An instance that
|
|
106
|
+
takes over an abandoned claim can replay that key only within the configured
|
|
107
|
+
provider guarantee, `guaranteedReplayMs`. Without that protection, an unknown
|
|
108
|
+
result halts the subscription for reconciliation.
|
|
97
109
|
|
|
98
110
|
## Configuration
|
|
99
111
|
|
|
100
112
|
Every field is optional.
|
|
101
113
|
|
|
102
|
-
| Field | Default
|
|
103
|
-
| -------------------- |
|
|
104
|
-
| `pollIntervalMs` | 60 000
|
|
105
|
-
| `sweepIntervalMs` | 900 000
|
|
106
|
-
| `leaseMs` | 300 000
|
|
107
|
-
| `retryDelaysMs` | one, three and seven days | The failed-renewal policy
|
|
108
|
-
| `settlementPollMs` | 3 600 000
|
|
109
|
-
| `errorBackoffMs` | 300 000
|
|
110
|
-
| `batchSize` | 100
|
|
111
|
-
| `providerSchedule` | `payment-interface`
|
|
112
|
-
| `guaranteedReplayMs` | `0`
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
| Field | Default | Meaning |
|
|
115
|
+
| -------------------- | -------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
116
|
+
| `pollIntervalMs` | 60 000 | How often the module polls the database when no Redis scheduler is wired |
|
|
117
|
+
| `sweepIntervalMs` | 900 000 | How often the module sweeps the database when a Redis scheduler is wired |
|
|
118
|
+
| `leaseMs` | 300 000 | How long a claim on a renewal lasts before another instance can take it over |
|
|
119
|
+
| `retryDelaysMs` | one, three, and seven days | The failed-renewal policy. One retry per entry, then the subscription ends |
|
|
120
|
+
| `settlementPollMs` | 3 600 000 | How often the module reads a charge that is still settling again |
|
|
121
|
+
| `errorBackoffMs` | 300 000 | How long to wait when the payment provider cannot be reached at all |
|
|
122
|
+
| `batchSize` | 100 | How many due subscriptions one sweep processes |
|
|
123
|
+
| `providerSchedule` | `payment-interface` | How the module mirrors the schedule with the provider. See the provider schedule page |
|
|
124
|
+
| `guaranteedReplayMs` | `0` | The idempotency retention that the provider guarantees, minus a safety margin. Zero disables replay |
|
|
125
|
+
|
|
126
|
+
Durations are in milliseconds. A `guaranteedReplayMs` that is negative or not
|
|
127
|
+
finite makes the module throw
|
|
128
|
+
`guaranteedReplayMs must be a finite non-negative duration` at construction.
|
|
129
|
+
An unknown `providerSchedule` name also throws at construction.
|
|
130
|
+
|
|
131
|
+
For Stripe, use Stripe's native subscriptions by default. This module is a
|
|
132
|
+
fallback that you choose explicitly. Before you allow retries of uncertain
|
|
133
|
+
requests, check the retention guarantee of the provider for every wired account.
|
|
134
|
+
No portable API reports that capability, and the module does not assume a
|
|
135
|
+
Stripe-style 24-hour window. See
|
|
136
|
+
[reconciliation and operational recovery](./docs/3.failed-renewals.md#reconciliation-and-operational-recovery).
|
|
119
137
|
|
|
120
138
|
## Documentation
|
|
121
139
|
|
|
122
|
-
| Document | Contents
|
|
123
|
-
| ------------------------------------------------------ |
|
|
124
|
-
| [Introduction](./docs/1.introduction.md) | What it implements, what it needs, what it records
|
|
125
|
-
| [The renewal clock](./docs/2.renewal-clock.md) | Polling and Redis, claims, idempotency, several instances
|
|
126
|
-
| [Failed renewals](./docs/3.failed-renewals.md) | The retry policy, settling charges, an unreachable provider
|
|
127
|
-
| [The provider schedule](./docs/4.provider-schedule.md) | The
|
|
140
|
+
| Document | Contents |
|
|
141
|
+
| ------------------------------------------------------ | ------------------------------------------------------------------------- |
|
|
142
|
+
| [Introduction](./docs/1.introduction.md) | What it implements, what it needs, what it records |
|
|
143
|
+
| [The renewal clock](./docs/2.renewal-clock.md) | Polling and Redis, claims, idempotency, several instances |
|
|
144
|
+
| [Failed renewals](./docs/3.failed-renewals.md) | The retry policy, settling charges, an unreachable provider |
|
|
145
|
+
| [The provider schedule](./docs/4.provider-schedule.md) | The extension point for providers that store a schedule, such as Mangopay |
|
|
128
146
|
|
|
129
147
|
## Compatibility
|
|
130
148
|
|
|
131
|
-
<!-- docs-compat:
|
|
132
|
-
|
|
133
|
-
| Package | Range |
|
|
134
|
-
| ------------------------------------- | ---------------- |
|
|
135
|
-
| `@antelopejs/interface-core` | `>=0.0.5 <1.0.0` |
|
|
136
|
-
| `@antelopejs/interface-database` | `>=0.2.0 <1.0.0` |
|
|
137
|
-
| `@antelopejs/interface-payment` | `>=0.0.2 <1.0.0` |
|
|
138
|
-
| `@antelopejs/interface-subscriptions` | `>=0.1.0 <0.2.0` |
|
|
149
|
+
<!-- antelopejs-docs-compat:start -->
|
|
139
150
|
|
|
140
|
-
|
|
151
|
+
| Package | Supported | Tested with |
|
|
152
|
+
| --------------------------------------- | ---------------- | ----------- |
|
|
153
|
+
| `@antelopejs/interface-core` | `>=0.2.4 <1.0.0` | `0.4.0` |
|
|
154
|
+
| `@antelopejs/interface-database` | `>=0.2.0 <1.0.0` | `0.2.0` |
|
|
155
|
+
| `@antelopejs/interface-payment` | `>=0.0.2 <1.0.0` | `0.0.2` |
|
|
156
|
+
| `@antelopejs/interface-redis` | `>=0.0.9 <1.0.0` | `0.0.9` |
|
|
157
|
+
| `@antelopejs/interface-redis-scheduler` | `>=0.0.9 <1.0.0` | `0.0.9` |
|
|
158
|
+
| `@antelopejs/interface-subscriptions` | `>=0.1.0 <0.2.0` | `0.1.0` |
|
|
141
159
|
|
|
142
|
-
|
|
143
|
-
| --------------------------------------- | ---------------- |
|
|
144
|
-
| `@antelopejs/interface-redis` | `>=0.0.6 <1.0.0` |
|
|
145
|
-
| `@antelopejs/interface-redis-scheduler` | `>=0.0.9 <1.0.0` |
|
|
160
|
+
<!-- antelopejs-docs-compat:end -->
|
|
146
161
|
|
|
147
|
-
|
|
162
|
+
The table lists the interface requirements in `package.json`. Provider modules
|
|
163
|
+
can add requirements of their own. Check the compatibility table of each
|
|
164
|
+
provider module that you wire.
|
|
148
165
|
|
|
149
166
|
## Testing
|
|
150
167
|
|
|
151
|
-
`pnpm test` runs the suite twice, once per clock
|
|
152
|
-
|
|
153
|
-
conformance suite runs in both. A test-only payment provider in
|
|
154
|
-
`test/payment-provider` stands in for the payment module
|
|
155
|
-
The scripts
|
|
168
|
+
`pnpm test` runs the suite twice, once per clock. Both runs use a real MongoDB,
|
|
169
|
+
and the second run also uses a real Redis. The suite starts both. The
|
|
170
|
+
conformance suite of the interface runs in both. A test-only payment provider in
|
|
171
|
+
`test/payment-provider` stands in for the payment module, and it is never
|
|
172
|
+
published. The scripts run `ajs module test .` from the `@antelopejs/core`
|
|
173
|
+
version that `devDependencies` pins.
|
|
156
174
|
|
|
157
175
|
## Contributing
|
|
158
176
|
|
|
159
|
-
Read [CONTRIBUTING.md](./CONTRIBUTING.md). Use Node.js
|
|
177
|
+
Read [CONTRIBUTING.md](./CONTRIBUTING.md). Use the Node.js version in `.nvmrc`
|
|
178
|
+
and the pnpm version in the `packageManager` field of `package.json`:
|
|
160
179
|
|
|
161
180
|
```bash
|
|
162
181
|
pnpm install --frozen-lockfile
|
package/dist/implementation.js
CHANGED
|
@@ -199,9 +199,9 @@ const CANCELLATIONS = {
|
|
|
199
199
|
period_end: () => ({ patch: { cancelAtPeriodEnd: true }, events: [] }),
|
|
200
200
|
};
|
|
201
201
|
async function CancelSubscription(id, idempotencyKey, timing, provider) {
|
|
202
|
-
|
|
203
|
-
if (!cancel)
|
|
202
|
+
if (!Object.prototype.hasOwnProperty.call(CANCELLATIONS, timing))
|
|
204
203
|
throw new interface_subscriptions_1.InvalidSubscriptionRequestError(`Unknown cancellation timing: ${timing}`);
|
|
204
|
+
const cancel = CANCELLATIONS[timing];
|
|
205
205
|
const canceled = await changeLive(id, idempotencyKey, provider, (record, now) => {
|
|
206
206
|
assertNotEnded(record);
|
|
207
207
|
return cancel(record, now);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../src/implementation.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AACzC,mDAA2D;AAC3D,qEAIuC;AACvC,iFAU6C;AAE7C,mCAA8B;AAC9B,qCAAoC;AACpC,uCAAoC;AACpC,iCAAwC;AACxC,uCAA0C;AAC1C,+CAAwD;AACxD,qCAA0E;AAC1E,uCAKmB;AAEnB,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAChC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,SAAS,WAAW,CAAC,QAA4B;IAC/C,OAAO,QAAQ,IAAI,EAAE,CAAC;AACxB,CAAC;AAED,SAAS,cAAc,CACrB,cAAsB,EACtB,QAA4B;IAE5B,MAAM,MAAM,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC;SAChC,MAAM,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,KAAK,cAAc,EAAE,CAAC;SACrD,MAAM,CAAC,KAAK,CAAC,CAAC;IACjB,OAAO,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACtC,CAAC;AAED,KAAK,UAAU,QAAQ,CACrB,EAAU,EACV,QAA4B;IAE5B,MAAM,MAAM,GAAG,MAAM,IAAA,oBAAU,EAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC3D,IACE,CAAC,MAAM;QACP,MAAM,CAAC,KAAK,KAAK,MAAM;QACvB,MAAM,CAAC,QAAQ,KAAK,WAAW,CAAC,QAAQ,CAAC,EAC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CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC;AAEY,QAAA,cAAc,GAAG;IAC5B,kBAAkB;IAClB,eAAe;IACf,iBAAiB;IACjB,kBAAkB;IAClB,+BAA+B;IAC/B,kBAAkB,EAAE;QAClB,QAAQ,EAAE,wBAAe;QACzB,UAAU,EAAE,0BAAiB;KAC9B;CACF,CAAC"}
|
package/dist/schedule.js
CHANGED
|
@@ -22,16 +22,13 @@ const PAYMENT_INTERFACE_SCHEDULE = Object.freeze({
|
|
|
22
22
|
charge: chargeOffSession,
|
|
23
23
|
release: () => Promise.resolve(),
|
|
24
24
|
});
|
|
25
|
-
const SCHEDULES =
|
|
26
|
-
"payment-interface"
|
|
27
|
-
|
|
28
|
-
function lookup(table, key) {
|
|
29
|
-
return table[key];
|
|
30
|
-
}
|
|
25
|
+
const SCHEDULES = new Map([
|
|
26
|
+
["payment-interface", PAYMENT_INTERFACE_SCHEDULE],
|
|
27
|
+
]);
|
|
31
28
|
function ResolveSchedule(name) {
|
|
32
|
-
const schedule =
|
|
29
|
+
const schedule = SCHEDULES.get(name);
|
|
33
30
|
if (!schedule) {
|
|
34
|
-
throw new Error(`Unknown providerSchedule "${name}"; known: ${
|
|
31
|
+
throw new Error(`Unknown providerSchedule "${name}"; known: ${[...SCHEDULES.keys()].join(", ")}`);
|
|
35
32
|
}
|
|
36
33
|
return schedule;
|
|
37
34
|
}
|
package/dist/schedule.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../src/schedule.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../src/schedule.ts"],"names":[],"mappings":";;AAsDA,0CAQC;AA9DD,qEAA4E;AAC5E,iFAAgF;AAwBhF,SAAS,gBAAgB,CAAC,MAAuB;IAC/C,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;IAChC,OAAO,IAAA,iCAAa,EAClB;QACE,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,QAAQ,EAAE,YAAY,CAAC,QAAQ;QAC/B,aAAa,EAAE,YAAY,CAAC,aAAa;QACzC,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE;YACR,GAAG,YAAY,CAAC,QAAQ;YACxB,CAAC,mDAAyB,CAAC,EAAE,YAAY,CAAC,EAAE;SAC7C;KACF,EACD,MAAM,CAAC,cAAc,EACrB,MAAM,CAAC,QAAQ,CAChB,CAAC;AACJ,CAAC;AAED,MAAM,0BAA0B,GAAqB,MAAM,CAAC,MAAM,CAAC;IACjE,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1C,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;CACjC,CAAC,CAAC;AAEH,MAAM,SAAS,GAA0C,IAAI,GAAG,CAAC;IAC/D,CAAC,mBAAmB,EAAE,0BAA0B,CAAC;CAClD,CAAC,CAAC;AAEH,SAAgB,eAAe,CAAC,IAAY;IAC1C,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,6BAA6B,IAAI,aAAa,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACjF,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/docs/1.introduction.md
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
title: Introduction
|
|
3
|
+
description: What the generic subscriptions module implements, which interfaces it needs, how it charges, and what it stores.
|
|
4
|
+
mode: reference
|
|
5
|
+
---
|
|
2
6
|
|
|
3
7
|
`@antelopejs/payment-subscriptions` implements
|
|
4
8
|
`@antelopejs/interface-subscriptions` for any provider wired behind
|
|
5
9
|
`@antelopejs/interface-payment`. It is the implementation for providers that
|
|
6
|
-
leave each renewal charge to the merchant
|
|
7
|
-
|
|
8
|
-
implementation by default
|
|
10
|
+
leave each renewal charge to the merchant, such as Adyen, Checkout.com, and
|
|
11
|
+
Mangopay. It is a fallback that you choose explicitly. Stripe users should use
|
|
12
|
+
the native subscription implementation of Stripe by default, so that two
|
|
13
|
+
renewal engines never compete.
|
|
9
14
|
|
|
10
15
|
## What it needs
|
|
11
16
|
|
|
@@ -13,49 +18,57 @@ implementation by default rather than run two competing renewal engines.
|
|
|
13
18
|
| --------------------------------------- | ------------------------------------------------------------- | -------- |
|
|
14
19
|
| `@antelopejs/interface-payment` | Every charge is an off-session payment against a saved method | Yes |
|
|
15
20
|
| `@antelopejs/interface-database` | Every subscription is a record there, and nowhere else | Yes |
|
|
16
|
-
| `@antelopejs/interface-redis-scheduler` | Fires each renewal
|
|
21
|
+
| `@antelopejs/interface-redis-scheduler` | Fires each renewal when it is due instead of at the next poll | No |
|
|
22
|
+
| `@antelopejs/interface-redis` | The module uses the scheduler only when Redis is also wired | No |
|
|
17
23
|
|
|
18
|
-
The database adapter must implement `atomicMutation`, the
|
|
19
|
-
|
|
20
|
-
runs against it.
|
|
24
|
+
The database adapter must implement `atomicMutation`, the conditional
|
|
25
|
+
single-record write of `@antelopejs/interface-database`. `@antelopejs/mongodb`
|
|
26
|
+
implements it, and the suite runs against it.
|
|
21
27
|
|
|
22
28
|
## What it charges
|
|
23
29
|
|
|
24
|
-
Each period is one `CreatePayment` with `offSession: true` against the
|
|
25
|
-
|
|
26
|
-
subscription
|
|
27
|
-
idempotency key is
|
|
28
|
-
`payment-subscriptions:<subscription>:<period>:<attempt
|
|
29
|
-
anything that might repeat a charge, and
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
Each period is one `CreatePayment` call with `offSession: true` against the
|
|
31
|
+
saved method of the subscription. The call carries the `reference` of the
|
|
32
|
+
subscription and its metadata, plus `antelopeSubscription` set to the
|
|
33
|
+
subscription ID. The idempotency key is
|
|
34
|
+
`payment-subscriptions:<subscription>:<period>:<attempt>`. The key stays the
|
|
35
|
+
same for anything that might repeat a charge, and changes for each deliberate
|
|
36
|
+
retry.
|
|
37
|
+
|
|
38
|
+
The optional `provider` that you pass when you create a subscription selects
|
|
39
|
+
the payment account, as on the payment interface. The module stores it with
|
|
40
|
+
the subscription, and every later charge goes to the same account, because the
|
|
41
|
+
customer and the method exist only there. To read the subscription back, pass
|
|
35
42
|
the same `provider`.
|
|
36
43
|
|
|
37
44
|
## What it records
|
|
38
45
|
|
|
39
|
-
|
|
40
|
-
`subscriptions`, default instance
|
|
46
|
+
The module keeps one record per subscription, in the schema
|
|
47
|
+
`payment-subscriptions`, table `subscriptions`, on the default instance. The
|
|
48
|
+
record holds:
|
|
41
49
|
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
50
|
+
- The request: customer, method, amount, interval, reference, description, and
|
|
51
|
+
metadata.
|
|
52
|
+
- The billing state: anchor, current period, status, attempt, the latest
|
|
53
|
+
charge, and any charge still settling.
|
|
54
|
+
- `nextActionAt`, when the subscription next needs attention, and `dueAt`, the
|
|
55
|
+
field that the sweep queries. `dueAt` equals `nextActionAt`, or now while
|
|
56
|
+
events wait for delivery.
|
|
57
|
+
- The claim: which instance holds it, and until when.
|
|
58
|
+
- The persisted start and replay deadline of the current attempt, and any
|
|
59
|
+
reconciliation hold.
|
|
60
|
+
- The outbox, which holds the events raised but not delivered yet.
|
|
61
|
+
- The idempotency keys of the last 50 cancellations and payment method changes.
|
|
51
62
|
|
|
52
|
-
|
|
53
|
-
the `provider
|
|
54
|
-
|
|
63
|
+
The subscription ID is `sub_` followed by a hash of the idempotency key of the
|
|
64
|
+
creation and the `provider`. Two creations that race with one key therefore
|
|
65
|
+
find the same record.
|
|
55
66
|
|
|
56
67
|
## Events
|
|
57
68
|
|
|
58
|
-
Each change records its events in the same write as the change itself
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
event
|
|
69
|
+
Each change records its events in the same write as the change itself. The
|
|
70
|
+
module delivers them from there to the handlers registered on
|
|
71
|
+
`SubscriptionEvents`, in order. If a handler rejects an event, delivery stops
|
|
72
|
+
at that event and the module tries again after `errorBackoffMs`, until every
|
|
73
|
+
handler accepts. Delivery is at least once, and an event survives a crash
|
|
74
|
+
between the change and its delivery.
|
package/docs/2.renewal-clock.md
CHANGED
|
@@ -1,95 +1,111 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
title: The renewal clock
|
|
3
|
+
description: How the module decides when to charge, picks polling or Redis, claims a renewal, and stays safe when several instances run or one dies mid-charge.
|
|
4
|
+
mode: explanation
|
|
5
|
+
---
|
|
2
6
|
|
|
3
|
-
The module decides on its own when a subscription needs
|
|
4
|
-
|
|
5
|
-
run at once and
|
|
7
|
+
The module decides on its own when a subscription needs a charge. That is the
|
|
8
|
+
reason it exists. It is also the part that has to be right when several
|
|
9
|
+
instances run at once and any of them can die in the middle of a charge.
|
|
6
10
|
|
|
7
|
-
## The database decides
|
|
11
|
+
## The database decides and the clock only triggers
|
|
8
12
|
|
|
9
|
-
Every subscription record carries `dueAt
|
|
10
|
-
trigger
|
|
11
|
-
passed.
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
Every subscription record carries `dueAt`, the time when it next needs
|
|
14
|
+
attention. A trigger has one job: make an instance look at the records whose
|
|
15
|
+
`dueAt` has passed. The instance reads what to do from the record, never from
|
|
16
|
+
the trigger. It charges the next period, retries a failed one, reads a
|
|
17
|
+
settling charge again, or ends the subscription at period end.
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
Whichever trigger runs, the database holds the same information. If Redis
|
|
20
|
+
never fires a renewal, the next sweep still makes it.
|
|
17
21
|
|
|
18
22
|
## Choosing the trigger
|
|
19
23
|
|
|
20
|
-
At start, before
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
the
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
At start, before the module touches Redis at all, it picks one of two
|
|
25
|
+
triggers:
|
|
26
|
+
|
|
27
|
+
1. If `@antelopejs/interface-redis` or `@antelopejs/interface-redis-scheduler`
|
|
28
|
+
has no implementation wired, the module **polls**. It sweeps the database
|
|
29
|
+
every `pollIntervalMs`, so a renewal is charged at most one interval late.
|
|
30
|
+
2. Otherwise the module **uses the Redis scheduler**. Each subscription is one
|
|
31
|
+
task, named after the subscription and fired at its `dueAt`. When `dueAt`
|
|
32
|
+
changes, the module schedules the task again, and when `dueAt` is cleared, it
|
|
33
|
+
removes the task. A sweep still runs every `sweepIntervalMs`, because the
|
|
34
|
+
scheduler drops a task whose handler dies mid-run, and the database alone
|
|
35
|
+
must be enough.
|
|
36
|
+
|
|
37
|
+
The Redis interfaces are optional dependencies, and the module imports them
|
|
38
|
+
lazily after the wiring check. Nothing on a request path or in `start()` waits
|
|
39
|
+
for a Redis connection. A Redis that is wired but unreachable delays renewals
|
|
40
|
+
until the next database sweep, and it blocks nothing.
|
|
41
|
+
|
|
42
|
+
The suite checks the Redis scheduler through normal interface routing, without
|
|
43
|
+
a test-only bypass for handler registration. If the scheduler refuses to
|
|
44
|
+
register the handler, the module logs a warning and falls back to polling. At
|
|
45
|
+
start, the module logs which clock it chose, and `ActiveClock()` returns
|
|
46
|
+
`"polling"` or `"redis"`.
|
|
39
47
|
|
|
40
48
|
## Claiming a renewal
|
|
41
49
|
|
|
42
|
-
Several instances
|
|
43
|
-
a conditional write against its current revision (`atomicMutation`),
|
|
44
|
-
|
|
50
|
+
Several instances can find the same renewal due. The module changes each record
|
|
51
|
+
only with a conditional write against its current revision (`atomicMutation`),
|
|
52
|
+
and a charge starts with one:
|
|
45
53
|
|
|
46
|
-
1. Read the record. If it is not due, or another instance
|
|
47
|
-
expired, leave it.
|
|
48
|
-
2. Write a claim
|
|
49
|
-
|
|
50
|
-
succeeds. The
|
|
54
|
+
1. Read the record. If it is not due, or the claim of another instance on it
|
|
55
|
+
has not expired, leave it.
|
|
56
|
+
2. Write a claim against the revision just read. The claim names this instance
|
|
57
|
+
and lasts until now plus `leaseMs`. Of several instances that read the same
|
|
58
|
+
revision, exactly one write succeeds. The others stand down without a call
|
|
59
|
+
to the provider.
|
|
51
60
|
3. Charge.
|
|
52
|
-
4.
|
|
53
|
-
release the claim.
|
|
61
|
+
4. Read the record again and write the outcome against its current revision.
|
|
62
|
+
Then deliver the events and release the claim.
|
|
54
63
|
|
|
55
|
-
If a cancellation lands between 2 and 4,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
If a cancellation lands between step 2 and step 4, step 4 applies the outcome
|
|
65
|
+
to the record as it is now. A charge that went through on a subscription that
|
|
66
|
+
was just cancelled is recorded and reported, and the subscription stays
|
|
67
|
+
cancelled.
|
|
59
68
|
|
|
60
69
|
## When an instance dies mid-charge
|
|
61
70
|
|
|
62
|
-
|
|
63
|
-
Before the first provider call, the module persists the payment
|
|
64
|
-
`attemptStartedAt
|
|
65
|
-
strictly before that deadline. The deadline
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
margin for clock skew, request
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
The claim of that instance expires after `leaseMs`, and another instance claims
|
|
72
|
+
the renewal. Before the first provider call, the module persists the payment
|
|
73
|
+
method, `attemptStartedAt`, and `attemptReplayUntil`. A takeover sends the same
|
|
74
|
+
idempotency key only strictly before that deadline. The deadline comes from
|
|
75
|
+
`guaranteedReplayMs`, which defaults to zero, and a later configuration change
|
|
76
|
+
never extends it. A lease is not an idempotency guarantee. Configure a
|
|
77
|
+
conservative retention duration, with enough margin for clock skew, request
|
|
78
|
+
latency, and process stalls across all instances.
|
|
79
|
+
|
|
80
|
+
If the result is still unknown after the protection expires, processing halts.
|
|
81
|
+
The subscription reports `vendorData.reconciliationRequired: true`, and the
|
|
82
|
+
module logs an error that contains the subscription ID. A record whose attempt
|
|
83
|
+
has already started but carries no attempt timing does not get a new replay
|
|
84
|
+
window. It halts for reconciliation too. The module reads a known pending
|
|
85
|
+
payment by its ID, even after the deadline, and that read never submits a
|
|
86
|
+
charge. For the operational recovery procedure, see
|
|
87
|
+
[failed renewals](./3.failed-renewals.md#reconciliation-and-operational-recovery).
|
|
88
|
+
|
|
89
|
+
The deadline is the second guard. The first guard, the claim, means that the
|
|
90
|
+
provider normally never sees a second request at all.
|
|
79
91
|
|
|
80
92
|
## Several instances
|
|
81
93
|
|
|
82
|
-
|
|
83
|
-
claim identity, sweeps on its own, and delivers the
|
|
84
|
-
processed to the handlers registered in it. Any
|
|
85
|
-
database.
|
|
94
|
+
No instance keeps anything in memory that another instance needs. Each
|
|
95
|
+
instance has its own claim identity, sweeps on its own, and delivers the
|
|
96
|
+
events of the records it processed to the handlers registered in it. Any
|
|
97
|
+
number of instances can run against one database.
|
|
86
98
|
|
|
87
99
|
## Testing the clock
|
|
88
100
|
|
|
89
|
-
The clock the module reads is replaceable (`UseClock`),
|
|
90
|
-
manual
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
101
|
+
The clock that the module reads is replaceable (`UseClock` in `src/clock.ts`),
|
|
102
|
+
and the suite drives a manual clock through trials, renewals, failures,
|
|
103
|
+
retries, and period ends. Separate tests check the real triggers in real time:
|
|
104
|
+
|
|
105
|
+
- A renewal made by polling, with nobody calling.
|
|
106
|
+
- With Redis, a task scheduled for the end of a trial and fired by Redis while
|
|
107
|
+
the sweep is an hour away.
|
|
108
|
+
- With Redis, a task deleted from Redis whose renewal the sweep still makes.
|
|
109
|
+
|
|
110
|
+
A boot test launches a project the way production does, without the test
|
|
111
|
+
harness, and checks that it starts and renews.
|
|
@@ -1,126 +1,156 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
title: Failed renewals
|
|
3
|
+
description: The retry policy of this module for declined renewals, settling charges, refusals, an unreachable provider, the first period, and reconciliation.
|
|
4
|
+
mode: reference
|
|
5
|
+
---
|
|
2
6
|
|
|
3
|
-
The interface promises only that a failed renewal is reported as `past_due`.
|
|
4
|
-
happens next is each implementation
|
|
7
|
+
The interface promises only that a failed renewal is reported as `past_due`.
|
|
8
|
+
What happens next is the policy of each implementation. This page describes
|
|
9
|
+
the policy of this module.
|
|
5
10
|
|
|
6
11
|
## The policy
|
|
7
12
|
|
|
8
|
-
When
|
|
13
|
+
When the charge for a period is declined:
|
|
9
14
|
|
|
10
|
-
1. The period advances anyway, the subscription goes `past_due`, and
|
|
11
|
-
`subscription.payment_failed
|
|
12
|
-
2.
|
|
13
|
-
before it. By default
|
|
14
|
-
eleven days.
|
|
15
|
-
3. A retry that succeeds makes
|
|
16
|
-
does not move.
|
|
17
|
-
4. When the last retry fails, the subscription ends
|
|
18
|
-
`endReason: "payment_failed"`, and
|
|
19
|
-
`subscription.
|
|
15
|
+
1. The period advances anyway, the subscription goes `past_due`, and the module
|
|
16
|
+
raises `subscription.payment_failed`. The unpaid period is the current one.
|
|
17
|
+
2. The module retries the charge after each entry of `retryDelaysMs`, measured
|
|
18
|
+
from the failure before it. By default the delays are one day, three days,
|
|
19
|
+
and seven days, which makes four attempts over eleven days.
|
|
20
|
+
3. A retry that succeeds makes the subscription `active` again, in the same
|
|
21
|
+
period. The cycle does not move.
|
|
22
|
+
4. When the last retry fails, the subscription ends. It becomes `canceled`,
|
|
23
|
+
with `endReason: "payment_failed"`, and the module raises both
|
|
24
|
+
`subscription.payment_failed` and `subscription.canceled`.
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
of the
|
|
26
|
+
A payment with the status `failed`, `canceled`, or `requires_action` counts as
|
|
27
|
+
a decline.
|
|
28
|
+
|
|
29
|
+
Each new attempt uses the payment method of the subscription at the time of
|
|
30
|
+
the attempt. A payer recovers by calling `UpdateSubscriptionPaymentMethod`
|
|
31
|
+
during `past_due`. Each attempt has its own idempotency key. A retry is a new
|
|
32
|
+
charge, not a replay of the decline.
|
|
25
33
|
|
|
26
34
|
A subscription set to end at period end keeps being retried until its period
|
|
27
|
-
ends
|
|
35
|
+
ends. Then it ends, and the module retries no further.
|
|
28
36
|
|
|
29
37
|
## A charge that is still settling
|
|
30
38
|
|
|
31
|
-
A bank debit can report `pending` for days. The
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
A bank debit can report `pending` for days. The module treats a payment with
|
|
40
|
+
the status `pending` or `authorized` as settling. The subscription keeps its
|
|
41
|
+
status: `active` after a trial or a paid period, or `past_due` during retries.
|
|
42
|
+
The module reads the charge again every `settlementPollMs` until it settles,
|
|
43
|
+
then treats it as succeeded or declined. Nothing is reported until it settles.
|
|
35
44
|
|
|
36
|
-
If the subscription is cancelled while a charge is settling, the
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
If the subscription is cancelled while a charge is settling, the module still
|
|
46
|
+
follows the charge. A charge that then succeeds is recorded and reported, so
|
|
47
|
+
that the merchant can refund the money.
|
|
39
48
|
|
|
40
49
|
## A provider that refuses the charge
|
|
41
50
|
|
|
42
|
-
`CustomerNotFoundError`, `PaymentNotFoundError`, `InvalidPaymentStateError
|
|
43
|
-
`UnsupportedOperationError` from the payment interface mean the
|
|
44
|
-
not make this charge
|
|
45
|
-
They count as a declined attempt
|
|
46
|
-
|
|
47
|
-
`
|
|
51
|
+
`CustomerNotFoundError`, `PaymentNotFoundError`, `InvalidPaymentStateError`,
|
|
52
|
+
and `UnsupportedOperationError` from the payment interface mean that the
|
|
53
|
+
provider will not make this charge. The most common cause is a saved method
|
|
54
|
+
that has been removed. They count as a declined attempt. The subscription goes
|
|
55
|
+
`past_due`, the module retries it under the policy, and it ends when the
|
|
56
|
+
retries are spent. The `subscription.payment_failed` event has no `payment`,
|
|
57
|
+
because no payment was made.
|
|
48
58
|
|
|
49
|
-
|
|
59
|
+
If one of these errors comes back when the module reads a settling charge, the
|
|
60
|
+
module does not count it as a decline. It holds the subscription for
|
|
61
|
+
reconciliation.
|
|
50
62
|
|
|
51
|
-
|
|
52
|
-
attempt can be made again after `errorBackoffMs` only within its persisted
|
|
53
|
-
provider guarantee, with the same idempotency key **and the same payment method**,
|
|
54
|
-
recorded before the first try — so if the first request did reach the provider,
|
|
55
|
-
the retry finds that charge instead of making another, even if the method was
|
|
56
|
-
changed meanwhile. The new method is used from the next attempt.
|
|
63
|
+
## A provider that cannot be reached
|
|
57
64
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
Any other `PaymentError` is not a decline. The charge is in doubt. The module
|
|
66
|
+
can make the same attempt again after `errorBackoffMs`, but only within the
|
|
67
|
+
persisted provider guarantee. The retry uses the same idempotency key **and
|
|
68
|
+
the same payment method**, both recorded before the first try. If the first
|
|
69
|
+
request did reach the provider, the retry finds that charge instead of making
|
|
70
|
+
another, even if the method was changed in the meantime. The new method is
|
|
71
|
+
used from the next attempt. With the default `guaranteedReplayMs` of zero, the
|
|
72
|
+
guarantee has already expired, so the module holds the subscription for
|
|
73
|
+
reconciliation instead of retrying.
|
|
74
|
+
|
|
75
|
+
If the subscription is cancelled while a charge is in doubt, the module does
|
|
76
|
+
not make the attempt again, and it holds the record for reconciliation. A
|
|
77
|
+
charge that did land then reaches the merchant only as the
|
|
78
|
+
`payment.succeeded` webhook of the payment interface, which carries
|
|
79
|
+
`antelopeSubscription`.
|
|
61
80
|
|
|
62
81
|
## After a stall
|
|
63
82
|
|
|
64
|
-
Periods are
|
|
65
|
-
than a period
|
|
66
|
-
period
|
|
83
|
+
Periods are counted from the anchor. If the module could not process a
|
|
84
|
+
subscription for longer than a period, because the database or every instance
|
|
85
|
+
was down, it charges every missed period on recovery, one after another.
|
|
67
86
|
|
|
68
87
|
## The first period
|
|
69
88
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
subscription
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
A creation
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
When the request has neither `trialEnd` nor `billingAnchor`,
|
|
90
|
+
`CreateSubscription` charges the first period itself, and a decline there
|
|
91
|
+
creates no subscription. A declined payment rejects with
|
|
92
|
+
`SubscriptionPaymentError`. A refusal from the provider, with no payment made,
|
|
93
|
+
rejects with `InvalidSubscriptionRequestError`. A payer with no subscription is
|
|
94
|
+
not `past_due`. With `trialEnd` or `billingAnchor`, the module creates the
|
|
95
|
+
subscription at once and charges the first period at that time, under the
|
|
96
|
+
policy above.
|
|
97
|
+
|
|
98
|
+
A creation that ends without an answer must be replayed with the same
|
|
99
|
+
idempotency key. That happens when the provider could not be reached, or when
|
|
100
|
+
the instance died during the call. The replay resumes the creation only within
|
|
101
|
+
its persisted replay window. After the window expires, the replay rejects with
|
|
102
|
+
the error `Subscription <id> requires reconciliation; charge replay protection unavailable or expired`
|
|
103
|
+
and does not charge again. A refused creation stays refused on replay. The
|
|
104
|
+
module never completes a creation that nobody replays, and a charge that such
|
|
105
|
+
a creation made belongs to no subscription. That charge still reaches the
|
|
106
|
+
merchant as a webhook of the payment interface that carries
|
|
107
|
+
`antelopeSubscription`.
|
|
82
108
|
|
|
83
109
|
## Reconciliation and operational recovery
|
|
84
110
|
|
|
85
|
-
`guaranteedReplayMs` defaults to zero
|
|
86
|
-
|
|
87
|
-
provider guarantee that covers every account
|
|
88
|
-
margin.
|
|
89
|
-
|
|
111
|
+
`guaranteedReplayMs` defaults to zero. The module makes the first call, but it
|
|
112
|
+
does not replay an uncertain result blindly. Set a positive value only from a
|
|
113
|
+
documented provider guarantee that covers every account that uses this module,
|
|
114
|
+
with a safety margin. The module retries transient errors only strictly before
|
|
115
|
+
the saved deadline. Declines follow the separate, finite `retryDelaysMs` policy
|
|
116
|
+
with new attempt keys.
|
|
90
117
|
|
|
91
118
|
Live subscriptions expose `reconciliationRequired`, `attemptStartedAt`,
|
|
92
|
-
`attemptReplayUntil
|
|
93
|
-
charge scheduled. Cancellation and payment
|
|
94
|
-
hold.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
1. Stop all module instances
|
|
100
|
-
record and
|
|
101
|
-
payment method. Never delete the record or reset timing to
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
119
|
+
`attemptReplayUntil`, and `phase` in `vendorData`. A halted record has no next
|
|
120
|
+
charge scheduled. Cancellation and payment method changes do not clear the
|
|
121
|
+
hold. An initial creation is not a public live subscription yet, so it exposes
|
|
122
|
+
the hold through the replay error and the persisted record.
|
|
123
|
+
|
|
124
|
+
To recover a halted subscription:
|
|
125
|
+
|
|
126
|
+
1. Stop all module instances and triggers, and drain the requests in flight.
|
|
127
|
+
Back up the record, and keep its revision, provider account, attempt key,
|
|
128
|
+
timing, and payment method. Never delete the record or reset its timing to
|
|
129
|
+
force a replay.
|
|
130
|
+
2. Search the authoritative ledger of the provider, including webhooks and the
|
|
131
|
+
metadata key `antelopeSubscription`, with the original account and attempt
|
|
132
|
+
key. If the result is still unknown, leave the hold in place and escalate to
|
|
133
|
+
the provider.
|
|
134
|
+
3. If you find a payment, verify its customer, method, amount, currency,
|
|
135
|
+
subscription metadata, and original attempt key. Recover the target period
|
|
107
136
|
index from that key (`payment-subscriptions:<id>:<period>:<attempt>`), not
|
|
108
|
-
from the
|
|
137
|
+
from the last paid period of the record. If you cannot establish the target,
|
|
109
138
|
leave the hold in place.
|
|
110
|
-
An operator-reviewed
|
|
111
|
-
as `pendingPayment`, clear `reconciliationRequired`, and set
|
|
112
|
-
and `dueAt` to now with the lease cleared. Set `periodIndex`
|
|
113
|
-
target for every record,
|
|
114
|
-
For a `creating` record, replay the original creation
|
|
115
|
-
payment instead of charging. For a live
|
|
116
|
-
record, restart processing
|
|
117
|
-
original attempt identity and timing intact.
|
|
118
|
-
4. If the provider
|
|
119
|
-
|
|
120
|
-
merchant decision. Do not
|
|
139
|
+
An operator-reviewed database repair, conditional on the revision, can
|
|
140
|
+
attach that ID as `pendingPayment`, clear `reconciliationRequired`, and set
|
|
141
|
+
`nextActionAt` and `dueAt` to now with the lease cleared. Set `periodIndex`
|
|
142
|
+
to the recovered target for every record, renewals included. The initial
|
|
143
|
+
charge targets `0`. For a `creating` record, replay the original creation
|
|
144
|
+
key, and the module reads that payment instead of charging. For a live
|
|
145
|
+
record, restart processing so that the module reads and applies the actual
|
|
146
|
+
status of the payment. Keep the original attempt identity and timing intact.
|
|
147
|
+
4. If the provider proves that no charge exists, prefer to retire the held
|
|
148
|
+
subscription and create a replacement with a new key, under an audited
|
|
149
|
+
merchant decision. Do not retry the uncertain attempt silently. Resolve any
|
|
121
150
|
provider schedule registration as well. Refunds and entitlement corrections
|
|
122
|
-
|
|
151
|
+
stay merchant operations.
|
|
123
152
|
|
|
124
|
-
|
|
125
|
-
repair
|
|
126
|
-
a method update or a longer configuration value is not
|
|
153
|
+
The module has no portable force-retry or reconciliation API, on purpose. A
|
|
154
|
+
database repair needs evidence from the provider and an audit trail. An
|
|
155
|
+
elapsed lease, a method update, or a longer configuration value is not
|
|
156
|
+
evidence of non-payment.
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
title: The provider schedule
|
|
3
|
+
description: Why the module can mirror part of a subscription with a provider such as Mangopay, and how the providerSchedule extension point works.
|
|
4
|
+
mode: explanation
|
|
5
|
+
---
|
|
2
6
|
|
|
3
|
-
This module always owns the clock. Some providers
|
|
4
|
-
|
|
5
|
-
chain between charges
|
|
6
|
-
frequency, dates and amounts
|
|
7
|
-
the
|
|
7
|
+
This module always owns the clock. Some providers leave the merchant to fire
|
|
8
|
+
each charge, but still store the schedule if asked, and handle the
|
|
9
|
+
authentication chain between charges. The Recurring PayIn Registration of
|
|
10
|
+
Mangopay stores the frequency, the dates, and the amounts. It chains the first
|
|
11
|
+
payment, which the customer starts, to the later payments, which the merchant
|
|
12
|
+
starts. Mangopay still does not fire those payments.
|
|
8
13
|
|
|
9
|
-
For those, part of a subscription
|
|
10
|
-
in this module
|
|
14
|
+
For those providers, part of the state of a subscription can live with the
|
|
15
|
+
provider as well as in the database of this module. The extension point for it
|
|
16
|
+
is the `ProviderSchedule` interface in `src/schedule.ts`:
|
|
11
17
|
|
|
12
18
|
| Call | When | The default |
|
|
13
19
|
| ---------- | ---------------------------------------------- | ------------------------------ |
|
|
@@ -15,17 +21,20 @@ in this module's database. The seam for it is `ProviderSchedule`:
|
|
|
15
21
|
| `charge` | Each time a period is charged | An off-session `CreatePayment` |
|
|
16
22
|
| `release` | Once, when a subscription ends, for any reason | Does nothing |
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
`charge` and `release
|
|
20
|
-
throws for a decline
|
|
21
|
-
`CreatePayment` does.
|
|
24
|
+
The module stores what `register` returns with the subscription, and hands it
|
|
25
|
+
to every `charge` and `release` call. A schedule never decides when to charge.
|
|
26
|
+
It never throws for a decline either. A declined charge resolves with a
|
|
27
|
+
`failed` payment, as `CreatePayment` does.
|
|
22
28
|
|
|
23
|
-
`register` runs before the
|
|
24
|
-
key
|
|
25
|
-
registers anything real must tolerate that, or derive its
|
|
26
|
-
subscription
|
|
29
|
+
`register` runs before the module stores the subscription, and it receives no
|
|
30
|
+
idempotency key. Two creations that race on one key can therefore both call
|
|
31
|
+
it. A schedule that registers anything real must tolerate that, or derive its
|
|
32
|
+
own key from the subscription ID that it receives.
|
|
27
33
|
|
|
28
|
-
The
|
|
29
|
-
`payment-interface`, exists.
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
The `providerSchedule` setting chooses the schedule. Only the default,
|
|
35
|
+
`payment-interface`, exists. Any other name makes the module throw at
|
|
36
|
+
construction, with an error that lists the known names. A Mangopay schedule
|
|
37
|
+
would charge against the registration through an interface of the Mangopay
|
|
38
|
+
module itself. Everywhere else in AntelopeJS, provider-specific behaviour also
|
|
39
|
+
goes through the interface of the provider module, not through the portable
|
|
40
|
+
interfaces.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/payment-subscriptions",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Generic AntelopeJS subscriptions on top of any payment interface provider: saved methods charged off-session, on a renewal clock the module owns",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "rimraf dist && tsc",
|
|
35
35
|
"format": "oxfmt .",
|
|
36
|
-
"lint": "oxlint",
|
|
36
|
+
"lint": "oxlint && antelopejs-check-interface-ranges",
|
|
37
37
|
"lint:fix": "oxlint --fix",
|
|
38
38
|
"prepack": "pnpm run build",
|
|
39
|
-
"release": "pnpm run lint && pnpm run test && pnpm run prepack && release-it",
|
|
39
|
+
"release": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run prepack && release-it",
|
|
40
40
|
"test": "pnpm run build && pnpm run test:polling && pnpm run test:redis",
|
|
41
41
|
"test:polling": "ajs module test .",
|
|
42
42
|
"test:redis": "ANTELOPE_SUBSCRIPTIONS_TEST_CLOCK=redis ajs module test .",
|
|
43
43
|
"typecheck": "tsc --noEmit",
|
|
44
44
|
"format:check": "oxfmt --check .",
|
|
45
45
|
"knip": "knip",
|
|
46
|
-
"prepare": "if
|
|
46
|
+
"prepare": "if [ -e .git ] && command -v git >/dev/null 2>&1 && command -v lefthook >/dev/null 2>&1 && GIT_DIR=.git GIT_WORK_TREE=. git rev-parse --git-dir >/dev/null 2>&1; then GIT_DIR=.git GIT_WORK_TREE=. lefthook install; fi",
|
|
47
47
|
"checks": "antelopejs-checks",
|
|
48
48
|
"size": "antelopejs-check-size",
|
|
49
49
|
"sync": "antelopejs-sync",
|
|
@@ -52,18 +52,20 @@
|
|
|
52
52
|
"suppressions:update": "antelopejs-suppressions --update"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@antelopejs/interface-core": ">=0.
|
|
55
|
+
"@antelopejs/interface-core": ">=0.2.4 <1.0.0",
|
|
56
56
|
"@antelopejs/interface-database": ">=0.2.0 <1.0.0",
|
|
57
57
|
"@antelopejs/interface-payment": ">=0.0.2 <1.0.0",
|
|
58
58
|
"@antelopejs/interface-subscriptions": ">=0.1.0 <0.2.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@antelopejs/core": "1.
|
|
61
|
+
"@antelopejs/core": "1.21.0",
|
|
62
62
|
"@antelopejs/mongodb": "^1.6.0",
|
|
63
63
|
"@antelopejs/redis": "^1.0.3",
|
|
64
|
-
"@antelopejs/tooling-configs": "^0.
|
|
64
|
+
"@antelopejs/tooling-configs": "^0.5.1",
|
|
65
65
|
"@types/mocha": "^10.0.10",
|
|
66
66
|
"@types/node": "^22.19.15",
|
|
67
|
+
"@types/semver": "^7.8.0",
|
|
68
|
+
"@types/tmp": "^0.2.6",
|
|
67
69
|
"eslint-plugin-perfectionist": "^5.11.0",
|
|
68
70
|
"knip": "^6.34.0",
|
|
69
71
|
"lefthook": "^2.2.2",
|
|
@@ -78,7 +80,7 @@
|
|
|
78
80
|
"typescript": "^5.9.3"
|
|
79
81
|
},
|
|
80
82
|
"optionalDependencies": {
|
|
81
|
-
"@antelopejs/interface-redis": ">=0.0.
|
|
83
|
+
"@antelopejs/interface-redis": ">=0.0.9 <1.0.0",
|
|
82
84
|
"@antelopejs/interface-redis-scheduler": ">=0.0.9 <1.0.0"
|
|
83
85
|
},
|
|
84
86
|
"packageManager": "pnpm@10.6.5",
|
|
@@ -90,6 +92,9 @@
|
|
|
90
92
|
"test": "src/test/antelope.test.ts",
|
|
91
93
|
"skills": [
|
|
92
94
|
"./skills"
|
|
93
|
-
]
|
|
95
|
+
],
|
|
96
|
+
"docs": {
|
|
97
|
+
"standard": true
|
|
98
|
+
}
|
|
94
99
|
}
|
|
95
100
|
}
|