@antelopejs/mollie 0.0.0 → 0.1.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/README.md
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
<a href="https://github.com/AntelopeJS/antelopejs"><img data-illustration src="./.github/readme/strip.svg" width="100%" alt="PROVIDER · MOLLIE: part of AntelopeJS, hexagonal architecture beyond your own code. A glowing button reads Star AntelopeJS."></a>
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
# `@antelopejs/mollie`
|
|
6
|
+
|
|
7
|
+
<a href="https://www.npmjs.com/package/@antelopejs/mollie"><img data-illustration alt="npm" src="https://img.shields.io/npm/v/@antelopejs/mollie?style=for-the-badge&labelColor=000000&color=000000"></a> <a href="./LICENSE"><img data-illustration alt="License" src="https://img.shields.io/npm/l/@antelopejs/mollie?style=for-the-badge&labelColor=000000&color=000000"></a> <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> <a href="https://interfaces.antelopejs.com/docs/payment"><img data-illustration alt="Documentation" src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000"></a> <a href="https://github.com/AntelopeJS/antelopejs"><img data-illustration alt="Star AntelopeJS" src="https://img.shields.io/github/stars/AntelopeJS/antelopejs?label=Star%20AntelopeJS&style=for-the-badge&labelColor=000000&color=000000&logo=github"></a>
|
|
8
|
+
|
|
9
|
+
**The Mollie provider for AntelopeJS. It implements portable payments and subscriptions on the Mollie API.**
|
|
10
|
+
|
|
11
|
+
[Documentation](https://interfaces.antelopejs.com/docs/payment) · [Interfaces](#interfaces) · [All interfaces and providers](https://github.com/AntelopeJS/antelopejs#ecosystem)
|
|
12
|
+
|
|
7
13
|
</div>
|
|
8
14
|
|
|
9
15
|
A Mollie payment module for AntelopeJS. It implements the payment interface, and it implements the subscriptions interface on Mollie's own subscriptions.
|
|
10
16
|
|
|
11
|
-
##
|
|
17
|
+
## Install
|
|
12
18
|
|
|
13
19
|
```bash
|
|
14
20
|
ajs project modules add @antelopejs/mollie
|
|
@@ -107,18 +113,36 @@ Subscriptions are Mollie's own. Mollie holds the schedule and creates every rene
|
|
|
107
113
|
|
|
108
114
|
Wire `@antelopejs/payment-subscriptions`, and add `disabledExports: ["@antelopejs/interface-subscriptions"]` to this module's entry.
|
|
109
115
|
|
|
110
|
-
## License
|
|
111
|
-
|
|
112
|
-
This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.
|
|
113
|
-
|
|
114
116
|
## Compatibility
|
|
115
117
|
|
|
116
118
|
<!-- antelopejs-docs-compat:start -->
|
|
117
119
|
|
|
118
120
|
| Package | Supported | Tested with |
|
|
119
121
|
| ------------------------------------- | ---------------- | ----------- |
|
|
120
|
-
| `@antelopejs/interface-core` | `>=0.
|
|
121
|
-
| `@antelopejs/interface-payment` | `>=0.2.0 <0.3.0` | `0.2.
|
|
122
|
-
| `@antelopejs/interface-subscriptions` | `>=0.1.0 <0.2.0` | `0.1.
|
|
122
|
+
| `@antelopejs/interface-core` | `>=0.5.1 <0.6.0` | `0.5.1` |
|
|
123
|
+
| `@antelopejs/interface-payment` | `>=0.2.0 <0.3.0` | `0.2.1` |
|
|
124
|
+
| `@antelopejs/interface-subscriptions` | `>=0.1.0 <0.2.0` | `0.1.2` |
|
|
123
125
|
|
|
124
126
|
<!-- antelopejs-docs-compat:end -->
|
|
127
|
+
|
|
128
|
+
## Part of AntelopeJS
|
|
129
|
+
|
|
130
|
+
This package belongs to [AntelopeJS](https://github.com/AntelopeJS/antelopejs), the TypeScript framework where modules depend on contracts and the application chooses the provider. The open-source back office [AntelopeJS DMS](https://github.com/AntelopeJS/dms) is built on it.
|
|
131
|
+
|
|
132
|
+
<!-- antelopejs-framework-modules:start -->
|
|
133
|
+
|
|
134
|
+
| Area | Contracts | Providers |
|
|
135
|
+
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
136
|
+
| API | [`interface-api`](https://github.com/AntelopeJS/interface-api) · [`interface-api-util`](https://github.com/AntelopeJS/interface-api-util) · [`interface-data-api`](https://github.com/AntelopeJS/interface-data-api) | [`api`](https://github.com/AntelopeJS/api) |
|
|
137
|
+
| Auth | [`interface-auth`](https://github.com/AntelopeJS/interface-auth) | [`auth-jwt`](https://github.com/AntelopeJS/auth-jwt) |
|
|
138
|
+
| Database | [`interface-database`](https://github.com/AntelopeJS/interface-database) · [`interface-database-decorators`](https://github.com/AntelopeJS/interface-database-decorators) · [`interface-database-catalog`](https://github.com/AntelopeJS/interface-database-catalog) · [`interface-mongodb`](https://github.com/AntelopeJS/interface-mongodb) · [`interface-rethinkdb`](https://github.com/AntelopeJS/interface-rethinkdb) | [`postgres`](https://github.com/AntelopeJS/postgres) · [`mysql`](https://github.com/AntelopeJS/mysql) · [`mongodb`](https://github.com/AntelopeJS/mongodb) · [`rethinkdb`](https://github.com/AntelopeJS/rethinkdb) |
|
|
139
|
+
| Redis | [`interface-redis`](https://github.com/AntelopeJS/interface-redis) · [`interface-redis-scheduler`](https://github.com/AntelopeJS/interface-redis-scheduler) | [`redis`](https://github.com/AntelopeJS/redis) |
|
|
140
|
+
| Email | [`interface-email`](https://github.com/AntelopeJS/interface-email) | [`nodemailer`](https://github.com/AntelopeJS/nodemailer) · [`brevo`](https://github.com/AntelopeJS/brevo) |
|
|
141
|
+
| File storage | [`interface-file-storage`](https://github.com/AntelopeJS/interface-file-storage) | [`file-storage-local`](https://github.com/AntelopeJS/file-storage-local) · [`file-storage-s3`](https://github.com/AntelopeJS/file-storage-s3) |
|
|
142
|
+
| Payments | [`interface-payment`](https://github.com/AntelopeJS/interface-payment) · [`interface-subscriptions`](https://github.com/AntelopeJS/interface-subscriptions) · [`interface-stripe`](https://github.com/AntelopeJS/interface-stripe) | [`stripe`](https://github.com/AntelopeJS/stripe) · **`mollie`** · [`checkout-com`](https://github.com/AntelopeJS/checkout-com) · [`payment-subscriptions`](https://github.com/AntelopeJS/payment-subscriptions) |
|
|
143
|
+
|
|
144
|
+
<!-- antelopejs-framework-modules:end -->
|
|
145
|
+
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.
|
|
@@ -18,30 +18,30 @@ function savedCardOf(payment) {
|
|
|
18
18
|
? { customerId, mandateId }
|
|
19
19
|
: undefined;
|
|
20
20
|
}
|
|
21
|
-
async function
|
|
21
|
+
async function readMandate(account, card, timeoutMs) {
|
|
22
|
+
const deadline = AbortSignal.timeout(Math.max(1, timeoutMs));
|
|
22
23
|
try {
|
|
23
24
|
const mandate = await account.client.request({
|
|
24
25
|
method: "GET",
|
|
25
26
|
path: `/customers/${card.customerId}/mandates/${card.mandateId}`,
|
|
26
|
-
signal:
|
|
27
|
+
signal: deadline,
|
|
27
28
|
}, resources_1.IsMollieMandate);
|
|
28
|
-
return mandate.status === "pending";
|
|
29
|
+
return mandate.status === "pending" ? "pending" : "settled";
|
|
29
30
|
}
|
|
30
31
|
catch {
|
|
31
|
-
return
|
|
32
|
+
return deadline.aborted ? "cut" : "failed";
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
async function pollUntilListable(account, card, deadline) {
|
|
35
|
-
let
|
|
36
|
+
let last = "pending";
|
|
36
37
|
for (let left = deadline - Date.now(); left > 0;) {
|
|
37
|
-
|
|
38
|
-
if (
|
|
38
|
+
last = await readMandate(account, card, left);
|
|
39
|
+
if (last === "settled")
|
|
39
40
|
return true;
|
|
40
|
-
lastReadFailed = pending === undefined;
|
|
41
41
|
await (0, promises_1.setTimeout)(Math.min(exports.MANDATE_POLL_MS, Math.max(0, deadline - Date.now())));
|
|
42
42
|
left = deadline - Date.now();
|
|
43
43
|
}
|
|
44
|
-
return
|
|
44
|
+
return last !== "failed";
|
|
45
45
|
}
|
|
46
46
|
const LEDGERS = new WeakMap();
|
|
47
47
|
function ledgerOf(account) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"saved-method.js","sourceRoot":"","sources":["../../../src/implementations/payment/saved-method.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"saved-method.js","sourceRoot":"","sources":["../../../src/implementations/payment/saved-method.ts"],"names":[],"mappings":";;;AA0HA,4CAkBC;AA5ID,mDAA2D;AAG3D,sDAAyD;AAEzD,uCAA0C;AAO7B,QAAA,eAAe,GAAG,KAAK,CAAC;AACxB,QAAA,eAAe,GAAG,GAAG,CAAC;AACnC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AACnC,MAAM,IAAI,GAAG,YAAY,CAAC;AAO1B,SAAS,WAAW,CAAC,OAAsB;IACzC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAC1C,MAAM,YAAY,GAChB,OAAO,CAAC,MAAM,KAAK,MAAM;QACzB,OAAO,CAAC,YAAY,KAAK,OAAO;QAChC,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC;IAC1B,OAAO,YAAY,IAAI,UAAU,IAAI,SAAS;QAC5C,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE;QAC3B,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAQD,KAAK,UAAU,WAAW,CACxB,OAAgB,EAChB,IAAe,EACf,SAAiB;IAEjB,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IAC7D,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,OAAO,CAC1C;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,cAAc,IAAI,CAAC,UA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CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC3B,IAAI,QAAQ;YAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/mollie",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A Mollie payment module that implements the payment and subscriptions interfaces of antelopejs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"suppressions:update": "antelopejs-suppressions --update"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@antelopejs/interface-core": ">=0.
|
|
49
|
+
"@antelopejs/interface-core": ">=0.5.1 <0.6.0",
|
|
50
50
|
"@antelopejs/interface-payment": ">=0.2.0 <0.3.0",
|
|
51
51
|
"@antelopejs/interface-subscriptions": ">=0.1.0 <0.2.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@antelopejs/core": "
|
|
55
|
-
"@antelopejs/tooling-configs": "
|
|
54
|
+
"@antelopejs/core": "~1.23.0",
|
|
55
|
+
"@antelopejs/tooling-configs": ">=0.6.0 <0.7.0",
|
|
56
56
|
"@types/mocha": "^10.0.10",
|
|
57
57
|
"@types/node": "^22.19.15",
|
|
58
58
|
"eslint-plugin-perfectionist": "^5.11.0",
|