strapi5-plugin-for-stripe 1.0.1 → 1.0.2
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 +5 -5
- package/dist/_chunks/{App-C1WNy-M5.js → App-Cs1bX9aF.js} +8 -8
- package/dist/_chunks/{App-JPkXp0Gh.mjs → App-TlX-jgR6.mjs} +8 -8
- package/dist/_chunks/{SettingsPage-CqdMz8tQ.mjs → SettingsPage-C2RxHIk_.mjs} +2 -2
- package/dist/_chunks/{SettingsPage-YNVaj-LK.js → SettingsPage-CC-uxoJi.js} +2 -2
- package/dist/admin/index.js +2 -2
- package/dist/admin/index.mjs +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img width="200" height="200" alt="logo_strapi5-plugin-stripe-small" src="https://github.com/user-attachments/assets/3e2503d7-235c-4944-b592-bd742d235447" />
|
|
2
|
+
<img width="200" height="200" alt="logo_strapi5-plugin-for-stripe-small" src="https://github.com/user-attachments/assets/3e2503d7-235c-4944-b592-bd742d235447" />
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">💳 Strapi 5 Plugin for Stripe</h1>
|
|
@@ -25,13 +25,13 @@ A Strapi 5 plugin to manage **Stripe products and subscriptions** directly from
|
|
|
25
25
|
1. Copy the plugin into your Strapi project:
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npm i strapi5-plugin-stripe
|
|
28
|
+
npm i strapi5-plugin-for-stripe
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
or
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
yarn add strapi5-plugin-stripe
|
|
34
|
+
yarn add strapi5-plugin-for-stripe
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
2. Restart Strapi:
|
|
@@ -93,7 +93,7 @@ Then restart Strapi.
|
|
|
93
93
|
|
|
94
94
|
When you create the webhook in Stripe, Stripe needs an Endpoint URL (a public URL that Stripe can call).
|
|
95
95
|
|
|
96
|
-
In production, it should be your Strapi webhook route, for example: `https://your-backend.com/api/strapi5-plugin-stripe/webhook`
|
|
96
|
+
In production, it should be your Strapi webhook route, for example: `https://your-backend.com/api/strapi5-plugin-for-stripe/webhook`
|
|
97
97
|
|
|
98
98
|
In local development, Stripe cannot call localhost directly. Use Stripe CLI instead (see below).
|
|
99
99
|
|
|
@@ -124,7 +124,7 @@ Stripe can’t reach localhost from the internet. Use the Stripe CLI to forward
|
|
|
124
124
|
|
|
125
125
|
```bash
|
|
126
126
|
stripe login
|
|
127
|
-
stripe listen --forward-to localhost:1337/api/strapi5-plugin-stripe/webhook
|
|
127
|
+
stripe listen --forward-to localhost:1337/api/strapi5-plugin-for-stripe/webhook
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
The CLI will display a temporary signing secret: `Your webhook signing secret is whsec_...`
|
|
@@ -36,11 +36,11 @@ const HomePage = () => {
|
|
|
36
36
|
setHasChanges(false);
|
|
37
37
|
};
|
|
38
38
|
const loadProducts = async () => {
|
|
39
|
-
const res = await get("/strapi5-plugin-stripe/products");
|
|
39
|
+
const res = await get("/strapi5-plugin-for-stripe/products");
|
|
40
40
|
setProductsAndPrices(res.data);
|
|
41
41
|
};
|
|
42
42
|
const getSettings = async () => {
|
|
43
|
-
const res = await get("/strapi5-plugin-stripe/settings");
|
|
43
|
+
const res = await get("/strapi5-plugin-for-stripe/settings");
|
|
44
44
|
setSettings(res.data || {});
|
|
45
45
|
};
|
|
46
46
|
react.useEffect(() => {
|
|
@@ -75,7 +75,7 @@ const HomePage = () => {
|
|
|
75
75
|
setError("");
|
|
76
76
|
setSuccess("");
|
|
77
77
|
try {
|
|
78
|
-
await post("/strapi5-plugin-stripe/products", {
|
|
78
|
+
await post("/strapi5-plugin-for-stripe/products", {
|
|
79
79
|
currency: settings.currency,
|
|
80
80
|
unit_amount: price * 100,
|
|
81
81
|
product_data: {
|
|
@@ -103,7 +103,7 @@ const HomePage = () => {
|
|
|
103
103
|
setError("");
|
|
104
104
|
setSuccess("");
|
|
105
105
|
try {
|
|
106
|
-
await del(`/strapi5-plugin-stripe/products/${productId}&${priceId}`);
|
|
106
|
+
await del(`/strapi5-plugin-for-stripe/products/${productId}&${priceId}`);
|
|
107
107
|
setSuccess("Product deleted successfully.");
|
|
108
108
|
loadProducts();
|
|
109
109
|
} catch (err) {
|
|
@@ -123,7 +123,7 @@ const HomePage = () => {
|
|
|
123
123
|
}
|
|
124
124
|
if (Object.keys(productUpdate).length > 0) {
|
|
125
125
|
await put(
|
|
126
|
-
`/strapi5-plugin-stripe/products/${productArr.id}`,
|
|
126
|
+
`/strapi5-plugin-for-stripe/products/${productArr.id}`,
|
|
127
127
|
productUpdate
|
|
128
128
|
);
|
|
129
129
|
}
|
|
@@ -140,7 +140,7 @@ const HomePage = () => {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
if (mustCreateNewPrice) {
|
|
143
|
-
const newPrice = await post("/strapi5-plugin-stripe/products", {
|
|
143
|
+
const newPrice = await post("/strapi5-plugin-for-stripe/products", {
|
|
144
144
|
currency: priceArr.currency,
|
|
145
145
|
unit_amount: price * 100,
|
|
146
146
|
product: productArr.id,
|
|
@@ -153,7 +153,7 @@ const HomePage = () => {
|
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
155
|
await del(
|
|
156
|
-
`/strapi5-plugin-stripe/prices/${productArr.id}&${priceArr.id}&${newPrice.data.id}`
|
|
156
|
+
`/strapi5-plugin-for-stripe/prices/${productArr.id}&${priceArr.id}&${newPrice.data.id}`
|
|
157
157
|
);
|
|
158
158
|
}
|
|
159
159
|
setSuccess("Product updated successfully.");
|
|
@@ -496,7 +496,7 @@ const HomePage = () => {
|
|
|
496
496
|
}
|
|
497
497
|
});
|
|
498
498
|
|
|
499
|
-
fetch(apiUrl + "/api/strapi5-plugin-stripe/checkout", {
|
|
499
|
+
fetch(apiUrl + "/api/strapi5-plugin-for-stripe/checkout", {
|
|
500
500
|
method: 'POST',
|
|
501
501
|
headers: { 'Content-Type': 'application/json' },
|
|
502
502
|
body: JSON.stringify({
|
|
@@ -34,11 +34,11 @@ const HomePage = () => {
|
|
|
34
34
|
setHasChanges(false);
|
|
35
35
|
};
|
|
36
36
|
const loadProducts = async () => {
|
|
37
|
-
const res = await get("/strapi5-plugin-stripe/products");
|
|
37
|
+
const res = await get("/strapi5-plugin-for-stripe/products");
|
|
38
38
|
setProductsAndPrices(res.data);
|
|
39
39
|
};
|
|
40
40
|
const getSettings = async () => {
|
|
41
|
-
const res = await get("/strapi5-plugin-stripe/settings");
|
|
41
|
+
const res = await get("/strapi5-plugin-for-stripe/settings");
|
|
42
42
|
setSettings(res.data || {});
|
|
43
43
|
};
|
|
44
44
|
useEffect(() => {
|
|
@@ -73,7 +73,7 @@ const HomePage = () => {
|
|
|
73
73
|
setError("");
|
|
74
74
|
setSuccess("");
|
|
75
75
|
try {
|
|
76
|
-
await post("/strapi5-plugin-stripe/products", {
|
|
76
|
+
await post("/strapi5-plugin-for-stripe/products", {
|
|
77
77
|
currency: settings.currency,
|
|
78
78
|
unit_amount: price * 100,
|
|
79
79
|
product_data: {
|
|
@@ -101,7 +101,7 @@ const HomePage = () => {
|
|
|
101
101
|
setError("");
|
|
102
102
|
setSuccess("");
|
|
103
103
|
try {
|
|
104
|
-
await del(`/strapi5-plugin-stripe/products/${productId}&${priceId}`);
|
|
104
|
+
await del(`/strapi5-plugin-for-stripe/products/${productId}&${priceId}`);
|
|
105
105
|
setSuccess("Product deleted successfully.");
|
|
106
106
|
loadProducts();
|
|
107
107
|
} catch (err) {
|
|
@@ -121,7 +121,7 @@ const HomePage = () => {
|
|
|
121
121
|
}
|
|
122
122
|
if (Object.keys(productUpdate).length > 0) {
|
|
123
123
|
await put(
|
|
124
|
-
`/strapi5-plugin-stripe/products/${productArr.id}`,
|
|
124
|
+
`/strapi5-plugin-for-stripe/products/${productArr.id}`,
|
|
125
125
|
productUpdate
|
|
126
126
|
);
|
|
127
127
|
}
|
|
@@ -138,7 +138,7 @@ const HomePage = () => {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
if (mustCreateNewPrice) {
|
|
141
|
-
const newPrice = await post("/strapi5-plugin-stripe/products", {
|
|
141
|
+
const newPrice = await post("/strapi5-plugin-for-stripe/products", {
|
|
142
142
|
currency: priceArr.currency,
|
|
143
143
|
unit_amount: price * 100,
|
|
144
144
|
product: productArr.id,
|
|
@@ -151,7 +151,7 @@ const HomePage = () => {
|
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
await del(
|
|
154
|
-
`/strapi5-plugin-stripe/prices/${productArr.id}&${priceArr.id}&${newPrice.data.id}`
|
|
154
|
+
`/strapi5-plugin-for-stripe/prices/${productArr.id}&${priceArr.id}&${newPrice.data.id}`
|
|
155
155
|
);
|
|
156
156
|
}
|
|
157
157
|
setSuccess("Product updated successfully.");
|
|
@@ -494,7 +494,7 @@ const HomePage = () => {
|
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
496
|
|
|
497
|
-
fetch(apiUrl + "/api/strapi5-plugin-stripe/checkout", {
|
|
497
|
+
fetch(apiUrl + "/api/strapi5-plugin-for-stripe/checkout", {
|
|
498
498
|
method: 'POST',
|
|
499
499
|
headers: { 'Content-Type': 'application/json' },
|
|
500
500
|
body: JSON.stringify({
|
|
@@ -10,7 +10,7 @@ const SettingsPage = () => {
|
|
|
10
10
|
const { get, put } = useFetchClient();
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
const load = async () => {
|
|
13
|
-
const res = await get("/strapi5-plugin-stripe/settings");
|
|
13
|
+
const res = await get("/strapi5-plugin-for-stripe/settings");
|
|
14
14
|
setData({
|
|
15
15
|
environment: res.data?.environment ?? "test",
|
|
16
16
|
currency: res.data?.currency ?? "eur",
|
|
@@ -29,7 +29,7 @@ const SettingsPage = () => {
|
|
|
29
29
|
}
|
|
30
30
|
setLoading(true);
|
|
31
31
|
try {
|
|
32
|
-
await put("/strapi5-plugin-stripe/settings", data);
|
|
32
|
+
await put("/strapi5-plugin-for-stripe/settings", data);
|
|
33
33
|
setSuccess("Settings saved.");
|
|
34
34
|
} catch (err) {
|
|
35
35
|
setError(
|
|
@@ -12,7 +12,7 @@ const SettingsPage = () => {
|
|
|
12
12
|
const { get, put } = admin.useFetchClient();
|
|
13
13
|
react.useEffect(() => {
|
|
14
14
|
const load = async () => {
|
|
15
|
-
const res = await get("/strapi5-plugin-stripe/settings");
|
|
15
|
+
const res = await get("/strapi5-plugin-for-stripe/settings");
|
|
16
16
|
setData({
|
|
17
17
|
environment: res.data?.environment ?? "test",
|
|
18
18
|
currency: res.data?.currency ?? "eur",
|
|
@@ -31,7 +31,7 @@ const SettingsPage = () => {
|
|
|
31
31
|
}
|
|
32
32
|
setLoading(true);
|
|
33
33
|
try {
|
|
34
|
-
await put("/strapi5-plugin-stripe/settings", data);
|
|
34
|
+
await put("/strapi5-plugin-for-stripe/settings", data);
|
|
35
35
|
setSuccess("Settings saved.");
|
|
36
36
|
} catch (err) {
|
|
37
37
|
setError(
|
package/dist/admin/index.js
CHANGED
|
@@ -36,7 +36,7 @@ const index = {
|
|
|
36
36
|
defaultMessage: "Strapi 5 Plugin for Stripe"
|
|
37
37
|
},
|
|
38
38
|
Component: async () => {
|
|
39
|
-
const { App } = await Promise.resolve().then(() => require("../_chunks/App-
|
|
39
|
+
const { App } = await Promise.resolve().then(() => require("../_chunks/App-Cs1bX9aF.js"));
|
|
40
40
|
return App;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -59,7 +59,7 @@ const index = {
|
|
|
59
59
|
defaultMessage: "Stripe"
|
|
60
60
|
},
|
|
61
61
|
to: `/settings/${PLUGIN_ID}`,
|
|
62
|
-
Component: async () => Promise.resolve().then(() => require("../_chunks/SettingsPage-
|
|
62
|
+
Component: async () => Promise.resolve().then(() => require("../_chunks/SettingsPage-CC-uxoJi.js")),
|
|
63
63
|
permissions: []
|
|
64
64
|
}
|
|
65
65
|
]
|
package/dist/admin/index.mjs
CHANGED
|
@@ -35,7 +35,7 @@ const index = {
|
|
|
35
35
|
defaultMessage: "Strapi 5 Plugin for Stripe"
|
|
36
36
|
},
|
|
37
37
|
Component: async () => {
|
|
38
|
-
const { App } = await import("../_chunks/App-
|
|
38
|
+
const { App } = await import("../_chunks/App-TlX-jgR6.mjs");
|
|
39
39
|
return App;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
@@ -58,7 +58,7 @@ const index = {
|
|
|
58
58
|
defaultMessage: "Stripe"
|
|
59
59
|
},
|
|
60
60
|
to: `/settings/${PLUGIN_ID}`,
|
|
61
|
-
Component: async () => import("../_chunks/SettingsPage-
|
|
61
|
+
Component: async () => import("../_chunks/SettingsPage-C2RxHIk_.mjs"),
|
|
62
62
|
permissions: []
|
|
63
63
|
}
|
|
64
64
|
]
|
package/dist/server/index.js
CHANGED
|
@@ -18,13 +18,13 @@ const config = {
|
|
|
18
18
|
const contentTypes = {};
|
|
19
19
|
const stripeController = ({ strapi }) => ({
|
|
20
20
|
async stripeService() {
|
|
21
|
-
return strapi.plugin("strapi5-plugin-stripe").service("stripeService");
|
|
21
|
+
return strapi.plugin("strapi5-plugin-for-stripe").service("stripeService");
|
|
22
22
|
},
|
|
23
23
|
/* ============================
|
|
24
24
|
* SETTINGS
|
|
25
25
|
* ============================ */
|
|
26
26
|
async getSettingsInternal() {
|
|
27
|
-
return await strapi.store({ type: "plugin", name: "strapi5-plugin-stripe" }).get({ key: "settings" });
|
|
27
|
+
return await strapi.store({ type: "plugin", name: "strapi5-plugin-for-stripe" }).get({ key: "settings" });
|
|
28
28
|
},
|
|
29
29
|
async getSettings(ctx) {
|
|
30
30
|
const settings = await this.getSettingsInternal();
|
|
@@ -44,7 +44,7 @@ const stripeController = ({ strapi }) => ({
|
|
|
44
44
|
throw new Error("cancelUrl must be HTTPS in live mode");
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
await strapi.store({ type: "plugin", name: "strapi5-plugin-stripe" }).set({ key: "settings", value: data });
|
|
47
|
+
await strapi.store({ type: "plugin", name: "strapi5-plugin-for-stripe" }).set({ key: "settings", value: data });
|
|
48
48
|
ctx.body = { ok: true };
|
|
49
49
|
},
|
|
50
50
|
/* ============================
|
package/dist/server/index.mjs
CHANGED
|
@@ -14,13 +14,13 @@ const config = {
|
|
|
14
14
|
const contentTypes = {};
|
|
15
15
|
const stripeController = ({ strapi }) => ({
|
|
16
16
|
async stripeService() {
|
|
17
|
-
return strapi.plugin("strapi5-plugin-stripe").service("stripeService");
|
|
17
|
+
return strapi.plugin("strapi5-plugin-for-stripe").service("stripeService");
|
|
18
18
|
},
|
|
19
19
|
/* ============================
|
|
20
20
|
* SETTINGS
|
|
21
21
|
* ============================ */
|
|
22
22
|
async getSettingsInternal() {
|
|
23
|
-
return await strapi.store({ type: "plugin", name: "strapi5-plugin-stripe" }).get({ key: "settings" });
|
|
23
|
+
return await strapi.store({ type: "plugin", name: "strapi5-plugin-for-stripe" }).get({ key: "settings" });
|
|
24
24
|
},
|
|
25
25
|
async getSettings(ctx) {
|
|
26
26
|
const settings = await this.getSettingsInternal();
|
|
@@ -40,7 +40,7 @@ const stripeController = ({ strapi }) => ({
|
|
|
40
40
|
throw new Error("cancelUrl must be HTTPS in live mode");
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
await strapi.store({ type: "plugin", name: "strapi5-plugin-stripe" }).set({ key: "settings", value: data });
|
|
43
|
+
await strapi.store({ type: "plugin", name: "strapi5-plugin-for-stripe" }).set({ key: "settings", value: data });
|
|
44
44
|
ctx.body = { ok: true };
|
|
45
45
|
},
|
|
46
46
|
/* ============================
|
package/package.json
CHANGED