@reeboot/strapi-payment-plugin 0.0.1 → 0.0.3
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 +378 -119
- package/dist/_chunks/Analytics-DSJqY9ng.mjs +355 -0
- package/dist/_chunks/Analytics-nBSdLT2v.js +355 -0
- package/dist/_chunks/App-B83DZ9NG.js +70 -0
- package/dist/_chunks/App-BUSTbkyy.mjs +68 -0
- package/dist/_chunks/Customers-BpFzfglV.js +273 -0
- package/dist/_chunks/Customers-C6FH7-zG.mjs +273 -0
- package/dist/_chunks/Dashboard-CNMTzSyc.js +180 -0
- package/dist/_chunks/Dashboard-Dbwl0ZBo.mjs +180 -0
- package/dist/_chunks/Orders-CBkT2YfP.mjs +308 -0
- package/dist/_chunks/Orders-OG-pwV-B.js +308 -0
- package/dist/_chunks/Payments-BLen1P9N.js +489 -0
- package/dist/_chunks/Payments-DSDJ-HWm.mjs +489 -0
- package/dist/_chunks/Settings-Dq1xy32B.js +357 -0
- package/dist/_chunks/Settings-jmGslDsB.mjs +357 -0
- package/dist/_chunks/en-BJocyOVu.mjs +240 -0
- package/dist/_chunks/en-BkVAf_R4.js +240 -0
- package/dist/_chunks/index-BqqrpI6D.js +66 -0
- package/dist/_chunks/index-DS_PYNkf.mjs +67 -0
- package/dist/admin/index.js +2 -63
- package/dist/admin/index.mjs +2 -63
- package/dist/admin/src/components/AnalyticsChart.d.ts +19 -0
- package/dist/admin/src/components/CustomerList.d.ts +21 -0
- package/dist/admin/src/components/OrderList.d.ts +27 -0
- package/dist/admin/src/components/PaymentCard.d.ts +39 -0
- package/dist/admin/src/components/PaymentList.d.ts +19 -0
- package/dist/admin/src/components/RefundModal.d.ts +15 -0
- package/dist/admin/src/pages/Analytics.d.ts +2 -0
- package/dist/admin/src/pages/Customers.d.ts +2 -0
- package/dist/admin/src/pages/Dashboard.d.ts +2 -0
- package/dist/admin/src/pages/HomePage.d.ts +1 -1
- package/dist/admin/src/pages/Orders.d.ts +2 -0
- package/dist/admin/src/pages/Payments.d.ts +2 -0
- package/dist/admin/src/pages/Settings.d.ts +2 -0
- package/dist/admin/src/pluginId.d.ts +1 -1
- package/dist/server/index.js +1770 -992
- package/dist/server/index.mjs +1773 -995
- package/dist/server/src/bootstrap.d.ts +5 -11
- package/dist/server/src/config/index.d.ts +0 -10
- package/dist/server/src/content-types/customer/index.d.ts +69 -0
- package/dist/server/src/content-types/index.d.ts +123 -39
- package/dist/server/src/content-types/{product.d.ts → order/index.d.ts} +26 -19
- package/dist/server/src/content-types/{subscription.d.ts → payment/index.d.ts} +30 -21
- package/dist/server/src/controllers/controller.d.ts +5 -12
- package/dist/server/src/controllers/index.d.ts +29 -34
- package/dist/server/src/controllers/stripe.d.ts +104 -0
- package/dist/server/src/index.d.ts +179 -139
- package/dist/server/src/middlewares/index.d.ts +19 -1
- package/dist/server/src/policies/index.d.ts +3 -1
- package/dist/server/src/routes/{admin-routes.d.ts → admin/index.d.ts} +4 -4
- package/dist/server/src/routes/content-api/index.d.ts +21 -0
- package/dist/server/src/routes/index.d.ts +11 -16
- package/dist/server/src/services/index.d.ts +2 -38
- package/dist/server/src/services/{stripeDriver.d.ts → stripe.d.ts} +52 -59
- package/dist/server/src/types/index.d.ts +179 -0
- package/package.json +20 -25
- package/dist/_chunks/App-DD7GyuRr.mjs +0 -1424
- package/dist/_chunks/App-KZVBFRwo.js +0 -1424
- package/dist/_chunks/en-B4KWt_jN.js +0 -4
- package/dist/_chunks/en-Byx4XI2L.mjs +0 -4
- package/dist/admin/src/components/Header.d.ts +0 -2
- package/dist/admin/src/components/NavigationMenu.d.ts +0 -2
- package/dist/admin/src/components/Sidebar.d.ts +0 -2
- package/dist/admin/src/components/TransactionDetailsModal.d.ts +0 -18
- package/dist/admin/src/components/TransactionList.d.ts +0 -18
- package/dist/admin/src/pages/ConfigurationPage.d.ts +0 -2
- package/dist/admin/src/pages/DashboardPage.d.ts +0 -2
- package/dist/admin/src/pages/ProductsPage.d.ts +0 -2
- package/dist/admin/src/pages/SubscriptionsPage.d.ts +0 -2
- package/dist/admin/src/pages/TransactionsPage.d.ts +0 -2
- package/dist/server/src/controllers/product.d.ts +0 -18
- package/dist/server/src/controllers/subscription.d.ts +0 -16
- package/dist/server/src/controllers/webhook.d.ts +0 -10
- package/dist/server/src/routes/content-api.d.ts +0 -12
- package/dist/server/src/routes/product.d.ts +0 -2
- package/dist/server/src/routes/refund-routes.d.ts +0 -13
- package/dist/server/src/routes/subscription.d.ts +0 -5
- package/dist/server/src/routes/webhook.d.ts +0 -15
- package/dist/server/src/services/paypalDriver.d.ts +0 -47
- package/dist/server/src/services/product.d.ts +0 -7
- package/dist/server/src/services/service.d.ts +0 -26
- package/dist/server/src/services/subscription.d.ts +0 -9
- package/dist/server/src/services/sync.d.ts +0 -13
- package/jest.config.js +0 -13
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const en = {
|
|
4
|
+
"payment-plugin": {
|
|
5
|
+
plugin: {
|
|
6
|
+
name: "Payment Management"
|
|
7
|
+
},
|
|
8
|
+
dashboard: {
|
|
9
|
+
title: "Payment Dashboard",
|
|
10
|
+
subtitle: "Overview of your payment operations",
|
|
11
|
+
totalRevenue: "Total Revenue",
|
|
12
|
+
totalPayments: "Total Payments",
|
|
13
|
+
successRate: "Success Rate",
|
|
14
|
+
averageOrderValue: "Average Order Value",
|
|
15
|
+
recentPayments: "Recent Payments",
|
|
16
|
+
viewAll: "View All",
|
|
17
|
+
customer: "Customer",
|
|
18
|
+
amount: "Amount",
|
|
19
|
+
status: "Status",
|
|
20
|
+
paymentMethod: "Payment Method",
|
|
21
|
+
date: "Date",
|
|
22
|
+
retry: "Retry"
|
|
23
|
+
},
|
|
24
|
+
payments: {
|
|
25
|
+
title: "Payments",
|
|
26
|
+
subtitle: "Manage and monitor all payment transactions",
|
|
27
|
+
retry: "Retry",
|
|
28
|
+
"export": "Export",
|
|
29
|
+
refresh: "Refresh",
|
|
30
|
+
search: {
|
|
31
|
+
placeholder: "Search payments..."
|
|
32
|
+
},
|
|
33
|
+
status: {
|
|
34
|
+
placeholder: "All Statuses"
|
|
35
|
+
},
|
|
36
|
+
method: {
|
|
37
|
+
placeholder: "All Methods"
|
|
38
|
+
},
|
|
39
|
+
currency: {
|
|
40
|
+
placeholder: "All Currencies"
|
|
41
|
+
},
|
|
42
|
+
all: "All",
|
|
43
|
+
succeeded: "Succeeded",
|
|
44
|
+
pending: "Pending",
|
|
45
|
+
failed: "Failed",
|
|
46
|
+
refunded: "Refunded",
|
|
47
|
+
card: "Card",
|
|
48
|
+
bank_transfer: "Bank Transfer",
|
|
49
|
+
wallet: "Wallet",
|
|
50
|
+
clearFilters: "Clear",
|
|
51
|
+
results: "Showing {start}-{end} of {total} payments",
|
|
52
|
+
view: "View details",
|
|
53
|
+
refund: "Refund",
|
|
54
|
+
paymentList: {
|
|
55
|
+
empty: "No payments found",
|
|
56
|
+
customer: "Customer",
|
|
57
|
+
amount: "Amount",
|
|
58
|
+
status: "Status",
|
|
59
|
+
method: "Method",
|
|
60
|
+
date: "Date"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
orders: {
|
|
64
|
+
title: "Orders",
|
|
65
|
+
subtitle: "Manage and track all customer orders",
|
|
66
|
+
retry: "Retry",
|
|
67
|
+
"export": "Export",
|
|
68
|
+
refresh: "Refresh",
|
|
69
|
+
search: {
|
|
70
|
+
placeholder: "Search orders..."
|
|
71
|
+
},
|
|
72
|
+
status: {
|
|
73
|
+
placeholder: "All Statuses"
|
|
74
|
+
},
|
|
75
|
+
paymentStatus: "Payment Status",
|
|
76
|
+
currency: {
|
|
77
|
+
placeholder: "All Currencies"
|
|
78
|
+
},
|
|
79
|
+
all: "All",
|
|
80
|
+
pending: "Pending",
|
|
81
|
+
processing: "Processing",
|
|
82
|
+
shipped: "Shipped",
|
|
83
|
+
delivered: "Delivered",
|
|
84
|
+
cancelled: "Cancelled",
|
|
85
|
+
unpaid: "Unpaid",
|
|
86
|
+
paid: "Paid",
|
|
87
|
+
partially_paid: "Partially Paid",
|
|
88
|
+
refunded: "Refunded",
|
|
89
|
+
clearFilters: "Clear",
|
|
90
|
+
results: "Showing {start}-{end} of {total} orders",
|
|
91
|
+
orderNumber: "Order #",
|
|
92
|
+
customer: "Customer",
|
|
93
|
+
items: "Items",
|
|
94
|
+
total: "Total",
|
|
95
|
+
orderStatus: "Order Status",
|
|
96
|
+
date: "Date",
|
|
97
|
+
orderList: {
|
|
98
|
+
empty: "No orders found",
|
|
99
|
+
orderNumber: "Order #",
|
|
100
|
+
customer: "Customer",
|
|
101
|
+
items: "Items",
|
|
102
|
+
total: "Total",
|
|
103
|
+
status: "Status",
|
|
104
|
+
paymentStatus: "Payment"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
customers: {
|
|
108
|
+
title: "Customers",
|
|
109
|
+
subtitle: "Manage and view customer information",
|
|
110
|
+
retry: "Retry",
|
|
111
|
+
"export": "Export",
|
|
112
|
+
refresh: "Refresh",
|
|
113
|
+
search: {
|
|
114
|
+
placeholder: "Search customers..."
|
|
115
|
+
},
|
|
116
|
+
status: "Status",
|
|
117
|
+
country: {
|
|
118
|
+
placeholder: "All Countries"
|
|
119
|
+
},
|
|
120
|
+
all: "All",
|
|
121
|
+
active: "Active",
|
|
122
|
+
inactive: "Inactive",
|
|
123
|
+
clearFilters: "Clear",
|
|
124
|
+
results: "Showing {start}-{end} of {total} customers",
|
|
125
|
+
customer: "Customer",
|
|
126
|
+
contact: "Contact",
|
|
127
|
+
totalSpent: "Total Spent",
|
|
128
|
+
payments: "Payments",
|
|
129
|
+
lastPayment: "Last Payment",
|
|
130
|
+
registration: "Registered",
|
|
131
|
+
customerList: {
|
|
132
|
+
empty: "No customers found",
|
|
133
|
+
customer: "Customer",
|
|
134
|
+
totalSpent: "Total Spent",
|
|
135
|
+
payments: "Payments",
|
|
136
|
+
lastPayment: "Last Payment",
|
|
137
|
+
status: "Status"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
analytics: {
|
|
141
|
+
title: "Analytics",
|
|
142
|
+
subtitle: "Payment insights and performance metrics",
|
|
143
|
+
retry: "Retry",
|
|
144
|
+
"export": "Export Report",
|
|
145
|
+
refresh: "Refresh",
|
|
146
|
+
totalRevenue: "Total Revenue",
|
|
147
|
+
successRate: "Success Rate",
|
|
148
|
+
averageAmount: "Average Amount",
|
|
149
|
+
trends: "Revenue Trends",
|
|
150
|
+
paymentMethods: "Payment Methods",
|
|
151
|
+
topProducts: "Top Products",
|
|
152
|
+
product: "Product",
|
|
153
|
+
revenue: "Revenue",
|
|
154
|
+
quantity: "Quantity",
|
|
155
|
+
geographic: "Geographic Distribution",
|
|
156
|
+
country: "Country",
|
|
157
|
+
transactions: "Transactions",
|
|
158
|
+
outOfPayments: "{total} payments"
|
|
159
|
+
},
|
|
160
|
+
settings: {
|
|
161
|
+
title: "Payment Settings",
|
|
162
|
+
subtitle: "Configure your payment plugin settings",
|
|
163
|
+
loading: "Loading settings...",
|
|
164
|
+
error: "Failed to load settings",
|
|
165
|
+
unsaved: "You have unsaved changes",
|
|
166
|
+
reset: "Reset",
|
|
167
|
+
testConnection: "Test Connection",
|
|
168
|
+
save: "Save Settings",
|
|
169
|
+
stripe: "Stripe Configuration",
|
|
170
|
+
publishableKey: "Publishable Key",
|
|
171
|
+
secretKey: "Secret Key",
|
|
172
|
+
webhookSecret: "Webhook Secret",
|
|
173
|
+
apiVersion: "API Version",
|
|
174
|
+
enabled: "Enable Stripe Payments",
|
|
175
|
+
payments: "Payment Settings",
|
|
176
|
+
defaultCurrency: "Default Currency",
|
|
177
|
+
captureMethod: "Capture Method",
|
|
178
|
+
refundWindow: "Refund Window (Days)",
|
|
179
|
+
security: "Security Settings",
|
|
180
|
+
requireAuth: "Require Authentication",
|
|
181
|
+
auditLog: "Enable Audit Log",
|
|
182
|
+
sessionTimeout: "Session Timeout (Minutes)",
|
|
183
|
+
ui: "User Interface Settings",
|
|
184
|
+
showStatus: "Show Payment Status",
|
|
185
|
+
showCustomerInfo: "Show Customer Info",
|
|
186
|
+
notifications: "Enable Notifications",
|
|
187
|
+
compactView: "Compact View"
|
|
188
|
+
},
|
|
189
|
+
refund: {
|
|
190
|
+
title: "Process Refund",
|
|
191
|
+
header: "Process Refund",
|
|
192
|
+
paymentInfo: "Payment Information",
|
|
193
|
+
customer: "Customer",
|
|
194
|
+
originalAmount: "Original Amount",
|
|
195
|
+
description: "Description",
|
|
196
|
+
quickOptions: "Quick Options",
|
|
197
|
+
full: "Full Refund",
|
|
198
|
+
half: "50% Refund",
|
|
199
|
+
quarter: "25% Refund",
|
|
200
|
+
amount: "Refund Amount",
|
|
201
|
+
maxAmount: "Maximum: {amount}",
|
|
202
|
+
reason: "Reason (Optional)",
|
|
203
|
+
reasonPlaceholder: "Reason for refund...",
|
|
204
|
+
inCents: "Amount in cents",
|
|
205
|
+
error: "Error",
|
|
206
|
+
warning: "Warning",
|
|
207
|
+
warningMessage: "This action cannot be undone. The refund will be processed immediately.",
|
|
208
|
+
cancel: "Cancel",
|
|
209
|
+
submit: "Process Refund"
|
|
210
|
+
},
|
|
211
|
+
paymentDetails: {
|
|
212
|
+
title: "Payment Details",
|
|
213
|
+
header: "Payment Details",
|
|
214
|
+
copyId: "Copy ID",
|
|
215
|
+
close: "Close",
|
|
216
|
+
basicInfo: "Basic Information",
|
|
217
|
+
customer: "Customer",
|
|
218
|
+
amount: "Amount",
|
|
219
|
+
status: "Status",
|
|
220
|
+
paymentMethod: "Payment Method",
|
|
221
|
+
transaction: "Transaction Details",
|
|
222
|
+
field: "Field",
|
|
223
|
+
value: "Value",
|
|
224
|
+
stripeId: "Stripe Payment ID",
|
|
225
|
+
createdAt: "Created At",
|
|
226
|
+
updatedAt: "Updated At",
|
|
227
|
+
orderId: "Order ID",
|
|
228
|
+
failureReason: "Failure Reason",
|
|
229
|
+
refundAmount: "Refunded Amount",
|
|
230
|
+
metadata: "Metadata",
|
|
231
|
+
key: "Key",
|
|
232
|
+
billingAddress: "Billing Address",
|
|
233
|
+
shippingAddress: "Shipping Address",
|
|
234
|
+
card: "Card",
|
|
235
|
+
bank_transfer: "Bank Transfer",
|
|
236
|
+
wallet: "Wallet"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
exports.default = en;
|
|
@@ -0,0 +1,66 @@
|
|
|
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: "Payment Management"
|
|
38
|
+
},
|
|
39
|
+
Component: async () => {
|
|
40
|
+
const { App } = await Promise.resolve().then(() => require("./App-B83DZ9NG.js"));
|
|
41
|
+
return App;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
app.registerPlugin({
|
|
45
|
+
id: PLUGIN_ID,
|
|
46
|
+
initializer: Initializer,
|
|
47
|
+
isReady: false,
|
|
48
|
+
name: PLUGIN_ID,
|
|
49
|
+
dependencies: ["admin", "content-manager", "content-type-builder"]
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
async registerTrads({ locales }) {
|
|
53
|
+
return Promise.all(
|
|
54
|
+
locales.map(async (locale) => {
|
|
55
|
+
try {
|
|
56
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-BkVAf_R4.js")) }), `./translations/${locale}.json`, 3);
|
|
57
|
+
return { data, locale };
|
|
58
|
+
} catch {
|
|
59
|
+
return { data: {}, locale };
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
exports.PLUGIN_ID = PLUGIN_ID;
|
|
66
|
+
exports.index = index;
|
|
@@ -0,0 +1,67 @@
|
|
|
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: "Payment Management"
|
|
37
|
+
},
|
|
38
|
+
Component: async () => {
|
|
39
|
+
const { App } = await import("./App-BUSTbkyy.mjs");
|
|
40
|
+
return App;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
app.registerPlugin({
|
|
44
|
+
id: PLUGIN_ID,
|
|
45
|
+
initializer: Initializer,
|
|
46
|
+
isReady: false,
|
|
47
|
+
name: PLUGIN_ID,
|
|
48
|
+
dependencies: ["admin", "content-manager", "content-type-builder"]
|
|
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": () => import("./en-BJocyOVu.mjs") }), `./translations/${locale}.json`, 3);
|
|
56
|
+
return { data, locale };
|
|
57
|
+
} catch {
|
|
58
|
+
return { data: {}, locale };
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
PLUGIN_ID as P,
|
|
66
|
+
index as i
|
|
67
|
+
};
|
package/dist/admin/index.js
CHANGED
|
@@ -1,64 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
|
|
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 = "strapi-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-KZVBFRwo.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;
|
|
2
|
+
const index = require("../_chunks/index-BqqrpI6D.js");
|
|
3
|
+
module.exports = index.index;
|
package/dist/admin/index.mjs
CHANGED
|
@@ -1,65 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 = "strapi-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-DD7GyuRr.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
|
-
};
|
|
1
|
+
import { i } from "../_chunks/index-DS_PYNkf.mjs";
|
|
63
2
|
export {
|
|
64
|
-
|
|
3
|
+
i as default
|
|
65
4
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TrendData {
|
|
3
|
+
labels: string[];
|
|
4
|
+
revenue: number[];
|
|
5
|
+
payments: number[];
|
|
6
|
+
customers: number[];
|
|
7
|
+
}
|
|
8
|
+
interface PaymentMethodData {
|
|
9
|
+
method: string;
|
|
10
|
+
count: number;
|
|
11
|
+
percentage: number;
|
|
12
|
+
}
|
|
13
|
+
interface AnalyticsChartProps {
|
|
14
|
+
data: TrendData | PaymentMethodData[];
|
|
15
|
+
currency?: string;
|
|
16
|
+
type: 'line' | 'pie' | 'bar';
|
|
17
|
+
}
|
|
18
|
+
declare const AnalyticsChart: React.FC<AnalyticsChartProps>;
|
|
19
|
+
export { AnalyticsChart };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Customer {
|
|
3
|
+
id: string;
|
|
4
|
+
stripeCustomerId: string;
|
|
5
|
+
email: string;
|
|
6
|
+
firstName?: string;
|
|
7
|
+
lastName?: string;
|
|
8
|
+
totalSpent: number;
|
|
9
|
+
currency: string;
|
|
10
|
+
paymentCount: number;
|
|
11
|
+
lastPaymentDate?: string;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
registrationDate: string;
|
|
14
|
+
}
|
|
15
|
+
interface CustomerListProps {
|
|
16
|
+
customers: Customer[];
|
|
17
|
+
onCustomerClick?: (customer: Customer) => void;
|
|
18
|
+
compact?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const CustomerList: React.FC<CustomerListProps>;
|
|
21
|
+
export { CustomerList };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Order {
|
|
3
|
+
id: string;
|
|
4
|
+
orderNumber: string;
|
|
5
|
+
customerEmail: string;
|
|
6
|
+
customerName?: string;
|
|
7
|
+
status: 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled' | 'refunded';
|
|
8
|
+
totalAmount: number;
|
|
9
|
+
currency: string;
|
|
10
|
+
paymentStatus: 'unpaid' | 'paid' | 'partially_paid' | 'refunded';
|
|
11
|
+
items: OrderItem[];
|
|
12
|
+
createdAt: string;
|
|
13
|
+
}
|
|
14
|
+
interface OrderItem {
|
|
15
|
+
id: string;
|
|
16
|
+
productName: string;
|
|
17
|
+
quantity: number;
|
|
18
|
+
unitPrice: number;
|
|
19
|
+
totalPrice: number;
|
|
20
|
+
}
|
|
21
|
+
interface OrderListProps {
|
|
22
|
+
orders: Order[];
|
|
23
|
+
onOrderClick?: (order: Order) => void;
|
|
24
|
+
compact?: boolean;
|
|
25
|
+
}
|
|
26
|
+
declare const OrderList: React.FC<OrderListProps>;
|
|
27
|
+
export { OrderList };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PaymentCardProps {
|
|
3
|
+
payment: {
|
|
4
|
+
id: string;
|
|
5
|
+
stripePaymentId: string;
|
|
6
|
+
amount: number;
|
|
7
|
+
currency: string;
|
|
8
|
+
status: string;
|
|
9
|
+
customerEmail: string;
|
|
10
|
+
customerName?: string;
|
|
11
|
+
paymentMethod: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
metadata?: Record<string, any>;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
orderId?: string;
|
|
17
|
+
refundAmount?: number;
|
|
18
|
+
failureReason?: string;
|
|
19
|
+
billingAddress?: {
|
|
20
|
+
line1?: string;
|
|
21
|
+
line2?: string;
|
|
22
|
+
city?: string;
|
|
23
|
+
state?: string;
|
|
24
|
+
postal_code?: string;
|
|
25
|
+
country?: string;
|
|
26
|
+
};
|
|
27
|
+
shippingAddress?: {
|
|
28
|
+
line1?: string;
|
|
29
|
+
line2?: string;
|
|
30
|
+
city?: string;
|
|
31
|
+
state?: string;
|
|
32
|
+
postal_code?: string;
|
|
33
|
+
country?: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
onClose: () => void;
|
|
37
|
+
}
|
|
38
|
+
declare const PaymentCard: React.FC<PaymentCardProps>;
|
|
39
|
+
export { PaymentCard };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Payment {
|
|
3
|
+
id: string;
|
|
4
|
+
stripePaymentId: string;
|
|
5
|
+
amount: number;
|
|
6
|
+
currency: string;
|
|
7
|
+
status: string;
|
|
8
|
+
customerEmail: string;
|
|
9
|
+
customerName?: string;
|
|
10
|
+
paymentMethod: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
}
|
|
13
|
+
interface PaymentListProps {
|
|
14
|
+
payments: Payment[];
|
|
15
|
+
onPaymentClick?: (payment: Payment) => void;
|
|
16
|
+
compact?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const PaymentList: React.FC<PaymentListProps>;
|
|
19
|
+
export { PaymentList };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RefundModalProps {
|
|
3
|
+
payment: {
|
|
4
|
+
id: string;
|
|
5
|
+
stripePaymentId: string;
|
|
6
|
+
amount: number;
|
|
7
|
+
currency: string;
|
|
8
|
+
customerEmail: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
};
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
onSuccess: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const RefundModal: React.FC<RefundModalProps>;
|
|
15
|
+
export { RefundModal };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
declare const HomePage: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
-
export
|
|
2
|
+
export { HomePage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PLUGIN_ID = "
|
|
1
|
+
export declare const PLUGIN_ID = "payment-plugin";
|