@easy-cms/plugin-ecommerce 0.67.1 → 0.68.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.
- package/README.md +1 -1
- package/dist/{chunk-AWRN73SK.js → chunk-DTW2GKBP.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/stripe.d.ts +9 -1
- package/dist/stripe.js +13 -4
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ A shop for Easy CMS: products with variants and prices in several currencies, ca
|
|
|
11
11
|
npm install @easy-cms/plugin-ecommerce
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Or `pnpm add`, `yarn add` or `bun add`. For Stripe, also install `stripe
|
|
14
|
+
Or `pnpm add`, `yarn add` or `bun add`. For Stripe, also install `stripe` (17 to 23).
|
|
15
15
|
|
|
16
16
|
## Usage
|
|
17
17
|
|
|
@@ -783,7 +783,7 @@ var INFO = {
|
|
|
783
783
|
name: "@easy-cms/plugin-ecommerce",
|
|
784
784
|
// The plugin API it is written for (`PLUGIN_API_VERSION` of @easy-cms/core).
|
|
785
785
|
apiVersion: 1,
|
|
786
|
-
...true ? { version: "0.
|
|
786
|
+
...true ? { version: "0.68.0" } : {}
|
|
787
787
|
};
|
|
788
788
|
|
|
789
789
|
// src/shop.ts
|
package/dist/index.js
CHANGED
package/dist/stripe.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Label } from '@easy-cms/core';
|
|
2
2
|
import { P as PaymentAdapter } from './payments-DZKeAbza.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* The Stripe API version the adapter asks for and is tested with, whichever `stripe` package
|
|
6
|
+
* (17 to 23) is installed, so a new major of the package doesn't change answers under a shop.
|
|
7
|
+
*/
|
|
8
|
+
declare const STRIPE_API_VERSION = "2026-09-30.endive";
|
|
9
|
+
|
|
4
10
|
/** The parts of the `stripe` package's client the adapter uses. */
|
|
5
11
|
interface StripeClient {
|
|
6
12
|
readonly paymentIntents: {
|
|
@@ -45,6 +51,8 @@ interface StripeAdapterOptions {
|
|
|
45
51
|
readonly label?: Label;
|
|
46
52
|
/** Extra `PaymentIntent` parameters, e.g. `{ payment_method_types: ['card', 'promptpay'] }`. */
|
|
47
53
|
readonly paymentIntent?: Record<string, unknown>;
|
|
54
|
+
/** Default `STRIPE_API_VERSION`. Not used with `client`, which has its own. */
|
|
55
|
+
readonly apiVersion?: string;
|
|
48
56
|
/** A Stripe client of your own (or a stand-in in tests). Default: `new Stripe(secretKey)`. */
|
|
49
57
|
readonly client?: StripeClient;
|
|
50
58
|
}
|
|
@@ -55,4 +63,4 @@ interface StripeAdapterOptions {
|
|
|
55
63
|
*/
|
|
56
64
|
declare function stripeAdapter(options: StripeAdapterOptions): PaymentAdapter;
|
|
57
65
|
|
|
58
|
-
export { type StripeAdapterOptions, type StripeClient, stripeAdapter };
|
|
66
|
+
export { STRIPE_API_VERSION, type StripeAdapterOptions, type StripeClient, stripeAdapter };
|
package/dist/stripe.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
paymentFailed,
|
|
3
3
|
paymentSucceeded
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DTW2GKBP.js";
|
|
5
|
+
|
|
6
|
+
// src/stripe-client.ts
|
|
7
|
+
var STRIPE_API_VERSION = "2026-09-30.endive";
|
|
8
|
+
function createStripeClient(Stripe, options, config = {}) {
|
|
9
|
+
return new Stripe(options.secretKey, {
|
|
10
|
+
apiVersion: options.apiVersion ?? STRIPE_API_VERSION,
|
|
11
|
+
appInfo: { name: "Easy CMS ecommerce", url: "https://github.com/maritonx/easy-cms" },
|
|
12
|
+
...config
|
|
13
|
+
});
|
|
14
|
+
}
|
|
5
15
|
|
|
6
16
|
// src/stripe.ts
|
|
7
17
|
function stripeAdapter(options) {
|
|
@@ -10,9 +20,7 @@ function stripeAdapter(options) {
|
|
|
10
20
|
if (options.client) return Promise.resolve(options.client);
|
|
11
21
|
const name = "stripe";
|
|
12
22
|
client ??= import(name).then(
|
|
13
|
-
(mod) =>
|
|
14
|
-
appInfo: { name: "Easy CMS ecommerce", url: "https://github.com/maritonx/easy-cms" }
|
|
15
|
-
})
|
|
23
|
+
(mod) => createStripeClient(mod.default, options)
|
|
16
24
|
);
|
|
17
25
|
return client;
|
|
18
26
|
};
|
|
@@ -86,5 +94,6 @@ function stripeAdapter(options) {
|
|
|
86
94
|
};
|
|
87
95
|
}
|
|
88
96
|
export {
|
|
97
|
+
STRIPE_API_VERSION,
|
|
89
98
|
stripeAdapter
|
|
90
99
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easy-cms/plugin-ecommerce",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.68.0",
|
|
4
4
|
"description": "A shop for Easy CMS: products and variants, prices in several currencies, carts (guests too), checkout with Stripe or bank transfer, orders, stock, customer accounts, and React and Vue hooks (experimental)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
],
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"react": ">=18.0.0",
|
|
37
|
-
"stripe": ">=17.0.0",
|
|
37
|
+
"stripe": ">=17.0.0 <24.0.0",
|
|
38
38
|
"vue": "^3.4.0",
|
|
39
|
-
"@easy-cms/core": "^0.
|
|
39
|
+
"@easy-cms/core": "^0.68.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependenciesMeta": {
|
|
42
42
|
"react": {
|
|
@@ -53,10 +53,12 @@
|
|
|
53
53
|
"@types/react": "^19.2.0",
|
|
54
54
|
"happy-dom": "^20.14.5",
|
|
55
55
|
"react": "^19.2.0",
|
|
56
|
+
"stripe": "^23.0.0",
|
|
57
|
+
"stripe-17": "npm:stripe@^17.7.0",
|
|
56
58
|
"vue": "^3.5.43",
|
|
57
|
-
"@easy-cms/core": "^0.
|
|
58
|
-
"@easy-cms/db-sqlite": "^0.
|
|
59
|
-
"@easy-cms/plugin-multi-tenant": "^0.
|
|
59
|
+
"@easy-cms/core": "^0.68.0",
|
|
60
|
+
"@easy-cms/db-sqlite": "^0.68.0",
|
|
61
|
+
"@easy-cms/plugin-multi-tenant": "^0.68.0"
|
|
60
62
|
},
|
|
61
63
|
"engines": {
|
|
62
64
|
"node": ">=22.12"
|