@reeboot/strapi-payment-plugin 0.0.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 +112 -0
- package/dist/_chunks/App-BGle38NN.js +1149 -0
- package/dist/_chunks/App-DoUUpjp-.mjs +1149 -0
- package/dist/_chunks/en-B4KWt_jN.js +4 -0
- package/dist/_chunks/en-Byx4XI2L.mjs +4 -0
- package/dist/admin/index.js +64 -0
- package/dist/admin/index.mjs +65 -0
- package/dist/admin/src/components/Header.d.ts +2 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/NavigationMenu.d.ts +2 -0
- package/dist/admin/src/components/PluginIcon.d.ts +2 -0
- package/dist/admin/src/components/Sidebar.d.ts +2 -0
- package/dist/admin/src/components/TransactionDetailsModal.d.ts +18 -0
- package/dist/admin/src/components/TransactionList.d.ts +18 -0
- package/dist/admin/src/index.d.ts +10 -0
- package/dist/admin/src/pages/App.d.ts +2 -0
- package/dist/admin/src/pages/ConfigurationPage.d.ts +2 -0
- package/dist/admin/src/pages/DashboardPage.d.ts +2 -0
- package/dist/admin/src/pages/HomePage.d.ts +2 -0
- package/dist/admin/src/pages/ProductsPage.d.ts +2 -0
- package/dist/admin/src/pages/SubscriptionsPage.d.ts +2 -0
- package/dist/admin/src/pages/TransactionsPage.d.ts +2 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/server/controllers/product.d.ts +12 -0
- package/dist/server/controllers/subscription.d.ts +12 -0
- package/dist/server/index.js +7287 -0
- package/dist/server/index.mjs +7286 -0
- package/dist/server/services/product.d.ts +7 -0
- package/dist/server/services/subscription.d.ts +7 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +13 -0
- package/dist/server/src/content-types/index.d.ts +2 -0
- package/dist/server/src/controllers/controller.d.ts +10 -0
- package/dist/server/src/controllers/index.d.ts +41 -0
- package/dist/server/src/controllers/productController.d.ts +9 -0
- package/dist/server/src/controllers/subscriptionController.d.ts +9 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +159 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin-routes.d.ts +13 -0
- package/dist/server/src/routes/content-api.d.ts +12 -0
- package/dist/server/src/routes/index.d.ts +51 -0
- package/dist/server/src/routes/product-routes.d.ts +13 -0
- package/dist/server/src/routes/refund-routes.d.ts +13 -0
- package/dist/server/src/routes/subscription-routes.d.ts +13 -0
- package/dist/server/src/services/index.d.ts +41 -0
- package/dist/server/src/services/paypalDriver.d.ts +7 -0
- package/dist/server/src/services/service.d.ts +33 -0
- package/dist/server/src/services/stripeDriver.d.ts +290 -0
- package/jest.config.js +13 -0
- package/package.json +75 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const react = require("react");
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const icons = require("@strapi/icons");
|
|
5
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
6
|
+
const v = glob[path];
|
|
7
|
+
if (v) {
|
|
8
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
9
|
+
}
|
|
10
|
+
return new Promise((_, reject) => {
|
|
11
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
12
|
+
reject.bind(
|
|
13
|
+
null,
|
|
14
|
+
new Error(
|
|
15
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
16
|
+
)
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const PLUGIN_ID = "payment-plugin";
|
|
22
|
+
const Initializer = ({ setPlugin }) => {
|
|
23
|
+
const ref = react.useRef(setPlugin);
|
|
24
|
+
react.useEffect(() => {
|
|
25
|
+
ref.current(PLUGIN_ID);
|
|
26
|
+
}, []);
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsx(icons.PuzzlePiece, {});
|
|
30
|
+
const index = {
|
|
31
|
+
register(app) {
|
|
32
|
+
app.addMenuLink({
|
|
33
|
+
to: `plugins/${PLUGIN_ID}`,
|
|
34
|
+
icon: PluginIcon,
|
|
35
|
+
intlLabel: {
|
|
36
|
+
id: `${PLUGIN_ID}.plugin.name`,
|
|
37
|
+
defaultMessage: PLUGIN_ID
|
|
38
|
+
},
|
|
39
|
+
Component: async () => {
|
|
40
|
+
const { App } = await Promise.resolve().then(() => require("../_chunks/App-BGle38NN.js"));
|
|
41
|
+
return App;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
app.registerPlugin({
|
|
45
|
+
id: PLUGIN_ID,
|
|
46
|
+
initializer: Initializer,
|
|
47
|
+
isReady: false,
|
|
48
|
+
name: PLUGIN_ID
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
async registerTrads({ locales }) {
|
|
52
|
+
return Promise.all(
|
|
53
|
+
locales.map(async (locale) => {
|
|
54
|
+
try {
|
|
55
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("../_chunks/en-B4KWt_jN.js")) }), `./translations/${locale}.json`, 3);
|
|
56
|
+
return { data, locale };
|
|
57
|
+
} catch {
|
|
58
|
+
return { data: {}, locale };
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
module.exports = index;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useRef, useEffect } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { PuzzlePiece } from "@strapi/icons";
|
|
4
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
5
|
+
const v = glob[path];
|
|
6
|
+
if (v) {
|
|
7
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
8
|
+
}
|
|
9
|
+
return new Promise((_, reject) => {
|
|
10
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
11
|
+
reject.bind(
|
|
12
|
+
null,
|
|
13
|
+
new Error(
|
|
14
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
15
|
+
)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const PLUGIN_ID = "payment-plugin";
|
|
21
|
+
const Initializer = ({ setPlugin }) => {
|
|
22
|
+
const ref = useRef(setPlugin);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
ref.current(PLUGIN_ID);
|
|
25
|
+
}, []);
|
|
26
|
+
return null;
|
|
27
|
+
};
|
|
28
|
+
const PluginIcon = () => /* @__PURE__ */ jsx(PuzzlePiece, {});
|
|
29
|
+
const index = {
|
|
30
|
+
register(app) {
|
|
31
|
+
app.addMenuLink({
|
|
32
|
+
to: `plugins/${PLUGIN_ID}`,
|
|
33
|
+
icon: PluginIcon,
|
|
34
|
+
intlLabel: {
|
|
35
|
+
id: `${PLUGIN_ID}.plugin.name`,
|
|
36
|
+
defaultMessage: PLUGIN_ID
|
|
37
|
+
},
|
|
38
|
+
Component: async () => {
|
|
39
|
+
const { App } = await import("../_chunks/App-DoUUpjp-.mjs");
|
|
40
|
+
return App;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
app.registerPlugin({
|
|
44
|
+
id: PLUGIN_ID,
|
|
45
|
+
initializer: Initializer,
|
|
46
|
+
isReady: false,
|
|
47
|
+
name: PLUGIN_ID
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
async registerTrads({ locales }) {
|
|
51
|
+
return Promise.all(
|
|
52
|
+
locales.map(async (locale) => {
|
|
53
|
+
try {
|
|
54
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("../_chunks/en-Byx4XI2L.mjs") }), `./translations/${locale}.json`, 3);
|
|
55
|
+
return { data, locale };
|
|
56
|
+
} catch {
|
|
57
|
+
return { data: {}, locale };
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
index as default
|
|
65
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TransactionDetailsModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
transaction: {
|
|
6
|
+
id: string;
|
|
7
|
+
amount: number;
|
|
8
|
+
currency: string;
|
|
9
|
+
status: string;
|
|
10
|
+
date: string;
|
|
11
|
+
customer: string;
|
|
12
|
+
paymentMethod: string;
|
|
13
|
+
gateway: string;
|
|
14
|
+
} | null;
|
|
15
|
+
onRefund: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const TransactionDetailsModal: React.FC<TransactionDetailsModalProps>;
|
|
18
|
+
export default TransactionDetailsModal;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Transaction {
|
|
3
|
+
id: string;
|
|
4
|
+
amount: number;
|
|
5
|
+
currency: string;
|
|
6
|
+
status: string;
|
|
7
|
+
date: string;
|
|
8
|
+
customer: string;
|
|
9
|
+
paymentMethod: string;
|
|
10
|
+
gateway: string;
|
|
11
|
+
}
|
|
12
|
+
interface TransactionListProps {
|
|
13
|
+
transactions: Transaction[];
|
|
14
|
+
onViewDetails: (transaction: Transaction) => void;
|
|
15
|
+
onStatusUpdate?: (transactionId: string, newStatus: string) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const TransactionList: React.FC<TransactionListProps>;
|
|
18
|
+
export default TransactionList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PLUGIN_ID = "payment-plugin";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* controller
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="koa" />
|
|
5
|
+
declare const _default: {
|
|
6
|
+
find(ctx: import("koa").Context): Promise<void>;
|
|
7
|
+
findOne(ctx: import("koa").Context): Promise<import("koa").Context>;
|
|
8
|
+
create(ctx: import("koa").Context): Promise<void>;
|
|
9
|
+
update(ctx: import("koa").Context): Promise<void>;
|
|
10
|
+
delete(ctx: import("koa").Context): Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* controller
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="koa" />
|
|
5
|
+
declare const _default: {
|
|
6
|
+
find(ctx: import("koa").Context): Promise<void>;
|
|
7
|
+
findOne(ctx: import("koa").Context): Promise<import("koa").Context>;
|
|
8
|
+
create(ctx: import("koa").Context): Promise<void>;
|
|
9
|
+
update(ctx: import("koa").Context): Promise<void>;
|
|
10
|
+
delete(ctx: import("koa").Context): Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|