@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.
Files changed (84) hide show
  1. package/README.md +378 -119
  2. package/dist/_chunks/Analytics-DSJqY9ng.mjs +355 -0
  3. package/dist/_chunks/Analytics-nBSdLT2v.js +355 -0
  4. package/dist/_chunks/App-B83DZ9NG.js +70 -0
  5. package/dist/_chunks/App-BUSTbkyy.mjs +68 -0
  6. package/dist/_chunks/Customers-BpFzfglV.js +273 -0
  7. package/dist/_chunks/Customers-C6FH7-zG.mjs +273 -0
  8. package/dist/_chunks/Dashboard-CNMTzSyc.js +180 -0
  9. package/dist/_chunks/Dashboard-Dbwl0ZBo.mjs +180 -0
  10. package/dist/_chunks/Orders-CBkT2YfP.mjs +308 -0
  11. package/dist/_chunks/Orders-OG-pwV-B.js +308 -0
  12. package/dist/_chunks/Payments-BLen1P9N.js +489 -0
  13. package/dist/_chunks/Payments-DSDJ-HWm.mjs +489 -0
  14. package/dist/_chunks/Settings-Dq1xy32B.js +357 -0
  15. package/dist/_chunks/Settings-jmGslDsB.mjs +357 -0
  16. package/dist/_chunks/en-BJocyOVu.mjs +240 -0
  17. package/dist/_chunks/en-BkVAf_R4.js +240 -0
  18. package/dist/_chunks/index-BqqrpI6D.js +66 -0
  19. package/dist/_chunks/index-DS_PYNkf.mjs +67 -0
  20. package/dist/admin/index.js +2 -63
  21. package/dist/admin/index.mjs +2 -63
  22. package/dist/admin/src/components/AnalyticsChart.d.ts +19 -0
  23. package/dist/admin/src/components/CustomerList.d.ts +21 -0
  24. package/dist/admin/src/components/OrderList.d.ts +27 -0
  25. package/dist/admin/src/components/PaymentCard.d.ts +39 -0
  26. package/dist/admin/src/components/PaymentList.d.ts +19 -0
  27. package/dist/admin/src/components/RefundModal.d.ts +15 -0
  28. package/dist/admin/src/pages/Analytics.d.ts +2 -0
  29. package/dist/admin/src/pages/Customers.d.ts +2 -0
  30. package/dist/admin/src/pages/Dashboard.d.ts +2 -0
  31. package/dist/admin/src/pages/HomePage.d.ts +1 -1
  32. package/dist/admin/src/pages/Orders.d.ts +2 -0
  33. package/dist/admin/src/pages/Payments.d.ts +2 -0
  34. package/dist/admin/src/pages/Settings.d.ts +2 -0
  35. package/dist/admin/src/pluginId.d.ts +1 -1
  36. package/dist/server/index.js +1770 -992
  37. package/dist/server/index.mjs +1773 -995
  38. package/dist/server/src/bootstrap.d.ts +5 -11
  39. package/dist/server/src/config/index.d.ts +0 -10
  40. package/dist/server/src/content-types/customer/index.d.ts +69 -0
  41. package/dist/server/src/content-types/index.d.ts +123 -39
  42. package/dist/server/src/content-types/{product.d.ts → order/index.d.ts} +26 -19
  43. package/dist/server/src/content-types/{subscription.d.ts → payment/index.d.ts} +30 -21
  44. package/dist/server/src/controllers/controller.d.ts +5 -12
  45. package/dist/server/src/controllers/index.d.ts +29 -34
  46. package/dist/server/src/controllers/stripe.d.ts +104 -0
  47. package/dist/server/src/index.d.ts +179 -139
  48. package/dist/server/src/middlewares/index.d.ts +19 -1
  49. package/dist/server/src/policies/index.d.ts +3 -1
  50. package/dist/server/src/routes/{admin-routes.d.ts → admin/index.d.ts} +4 -4
  51. package/dist/server/src/routes/content-api/index.d.ts +21 -0
  52. package/dist/server/src/routes/index.d.ts +11 -16
  53. package/dist/server/src/services/index.d.ts +2 -38
  54. package/dist/server/src/services/{stripeDriver.d.ts → stripe.d.ts} +52 -59
  55. package/dist/server/src/types/index.d.ts +179 -0
  56. package/package.json +20 -25
  57. package/dist/_chunks/App-DD7GyuRr.mjs +0 -1424
  58. package/dist/_chunks/App-KZVBFRwo.js +0 -1424
  59. package/dist/_chunks/en-B4KWt_jN.js +0 -4
  60. package/dist/_chunks/en-Byx4XI2L.mjs +0 -4
  61. package/dist/admin/src/components/Header.d.ts +0 -2
  62. package/dist/admin/src/components/NavigationMenu.d.ts +0 -2
  63. package/dist/admin/src/components/Sidebar.d.ts +0 -2
  64. package/dist/admin/src/components/TransactionDetailsModal.d.ts +0 -18
  65. package/dist/admin/src/components/TransactionList.d.ts +0 -18
  66. package/dist/admin/src/pages/ConfigurationPage.d.ts +0 -2
  67. package/dist/admin/src/pages/DashboardPage.d.ts +0 -2
  68. package/dist/admin/src/pages/ProductsPage.d.ts +0 -2
  69. package/dist/admin/src/pages/SubscriptionsPage.d.ts +0 -2
  70. package/dist/admin/src/pages/TransactionsPage.d.ts +0 -2
  71. package/dist/server/src/controllers/product.d.ts +0 -18
  72. package/dist/server/src/controllers/subscription.d.ts +0 -16
  73. package/dist/server/src/controllers/webhook.d.ts +0 -10
  74. package/dist/server/src/routes/content-api.d.ts +0 -12
  75. package/dist/server/src/routes/product.d.ts +0 -2
  76. package/dist/server/src/routes/refund-routes.d.ts +0 -13
  77. package/dist/server/src/routes/subscription.d.ts +0 -5
  78. package/dist/server/src/routes/webhook.d.ts +0 -15
  79. package/dist/server/src/services/paypalDriver.d.ts +0 -47
  80. package/dist/server/src/services/product.d.ts +0 -7
  81. package/dist/server/src/services/service.d.ts +0 -26
  82. package/dist/server/src/services/subscription.d.ts +0 -9
  83. package/dist/server/src/services/sync.d.ts +0 -13
  84. package/jest.config.js +0 -13
@@ -0,0 +1,357 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { Box, Flex, Typography, Alert, Button, Grid, Card, TextInput, SingleSelect, SingleSelectOption, Switch } from "@strapi/design-system";
4
+ import { useIntl } from "react-intl";
5
+ import { useFetchClient } from "@strapi/strapi/admin";
6
+ import { P as PLUGIN_ID } from "./index-DS_PYNkf.mjs";
7
+ const Settings = () => {
8
+ const { formatMessage } = useIntl();
9
+ const { get, put } = useFetchClient();
10
+ const [settings, setSettings] = useState(null);
11
+ const [loading, setLoading] = useState(true);
12
+ const [saving, setSaving] = useState(false);
13
+ const [error, setError] = useState(null);
14
+ const [success, setSuccess] = useState(null);
15
+ const [hasChanges, setHasChanges] = useState(false);
16
+ useEffect(() => {
17
+ fetchSettings();
18
+ }, []);
19
+ const fetchSettings = async () => {
20
+ try {
21
+ setLoading(true);
22
+ const { data } = await get(`/${PLUGIN_ID}/admin/config`);
23
+ if (data.success && data.data) {
24
+ const backendConfig = data.data;
25
+ const initialSettings = {
26
+ stripe: {
27
+ publishableKey: backendConfig.stripe?.publishableKey || "",
28
+ secretKey: backendConfig.stripe?.secretKey || "",
29
+ webhookSecret: backendConfig.stripe?.webhookSecret || "",
30
+ apiVersion: backendConfig.stripe?.apiVersion || "2023-10-16",
31
+ enabled: backendConfig.stripe?.enabled ?? true
32
+ },
33
+ payments: {
34
+ defaultCurrency: backendConfig.payment?.defaultCurrency || "usd",
35
+ supportedCurrencies: backendConfig.payment?.supportedCurrencies || ["usd"],
36
+ enableRefunds: backendConfig.payment?.enableRefunds ?? true,
37
+ enablePartialRefunds: backendConfig.payment?.enablePartialRefunds ?? true,
38
+ refundWindow: backendConfig.payment?.refundWindow || 30,
39
+ captureMethod: backendConfig.payment?.captureMethod || "automatic",
40
+ confirmationMethod: backendConfig.payment?.confirmationMethod || "automatic"
41
+ },
42
+ webhooks: {
43
+ enabled: true,
44
+ endpoints: {
45
+ paymentSucceeded: "",
46
+ paymentFailed: "",
47
+ refundCreated: "",
48
+ invoiceCreated: ""
49
+ },
50
+ retries: 3,
51
+ timeout: 30
52
+ },
53
+ ui: {
54
+ showPaymentStatus: true,
55
+ showCustomerInfo: true,
56
+ enableNotifications: true,
57
+ theme: "auto",
58
+ compactView: false
59
+ },
60
+ security: {
61
+ enableIpFiltering: false,
62
+ allowedIps: [],
63
+ requireAuthentication: true,
64
+ enableAuditLog: true,
65
+ sessionTimeout: 60
66
+ }
67
+ };
68
+ setSettings(initialSettings);
69
+ }
70
+ setLoading(false);
71
+ } catch (err) {
72
+ setError("Failed to fetch settings");
73
+ setLoading(false);
74
+ }
75
+ };
76
+ const handleSettingChange = (section, key, value) => {
77
+ if (!settings) return;
78
+ setSettings((prev) => ({
79
+ ...prev,
80
+ [section]: {
81
+ ...prev[section],
82
+ [key]: value
83
+ }
84
+ }));
85
+ setHasChanges(true);
86
+ setSuccess(null);
87
+ };
88
+ const saveSettings = async () => {
89
+ try {
90
+ setSaving(true);
91
+ setError(null);
92
+ if (!settings) return;
93
+ const payload = {
94
+ stripe: settings.stripe,
95
+ payment: settings.payments,
96
+ logging: {
97
+ enableWebhookLogging: true
98
+ }
99
+ };
100
+ await put(`/${PLUGIN_ID}/admin/config`, payload);
101
+ setHasChanges(false);
102
+ setSuccess("Settings saved successfully");
103
+ setTimeout(() => setSuccess(null), 3e3);
104
+ } catch (err) {
105
+ setError("Failed to save settings");
106
+ } finally {
107
+ setSaving(false);
108
+ }
109
+ };
110
+ const resetSettings = () => {
111
+ if (confirm("Are you sure you want to reset all settings to default? This action cannot be undone.")) {
112
+ fetchSettings();
113
+ setHasChanges(false);
114
+ }
115
+ };
116
+ const testConnection = async () => {
117
+ try {
118
+ setSaving(true);
119
+ const { data } = await get(`/${PLUGIN_ID}/admin/config`);
120
+ if (data.success) {
121
+ alert("Connection to backend successful!");
122
+ } else {
123
+ throw new Error("Failed to connect");
124
+ }
125
+ } catch (err) {
126
+ alert("Connection test failed. Please check your API keys and server logs.");
127
+ } finally {
128
+ setSaving(false);
129
+ }
130
+ };
131
+ if (loading) {
132
+ return /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsx(Typography, { variant: "beta", children: formatMessage({ id: "payment-plugin.settings.loading", defaultMessage: "Loading settings..." }) }) }) });
133
+ }
134
+ if (!settings) {
135
+ return /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Alert, { severity: "danger", children: formatMessage({ id: "payment-plugin.settings.error", defaultMessage: "Failed to load settings" }) }) });
136
+ }
137
+ return /* @__PURE__ */ jsxs(Box, { paddingLeft: 10, paddingRight: 10, paddingTop: 4, paddingBottom: 10, children: [
138
+ /* @__PURE__ */ jsx(Box, { marginBottom: 4, children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", children: [
139
+ /* @__PURE__ */ jsxs(Box, { children: [
140
+ /* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: formatMessage({ id: "payment-plugin.settings.title", defaultMessage: "Payment Settings" }) }),
141
+ /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage({
142
+ id: "payment-plugin.settings.subtitle",
143
+ defaultMessage: "Configure your payment plugin settings"
144
+ }) })
145
+ ] }),
146
+ /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
147
+ hasChanges && /* @__PURE__ */ jsx(Alert, { variant: "warning", style: { marginRight: "1rem" }, children: formatMessage({ id: "payment-plugin.settings.unsaved", defaultMessage: "You have unsaved changes" }) }),
148
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: resetSettings, children: formatMessage({ id: "payment-plugin.settings.reset", defaultMessage: "Reset" }) }),
149
+ /* @__PURE__ */ jsx(
150
+ Button,
151
+ {
152
+ variant: "secondary",
153
+ onClick: testConnection,
154
+ disabled: saving,
155
+ children: formatMessage({ id: "payment-plugin.settings.testConnection", defaultMessage: "Test Connection" })
156
+ }
157
+ ),
158
+ /* @__PURE__ */ jsx(
159
+ Button,
160
+ {
161
+ onClick: saveSettings,
162
+ disabled: !hasChanges || saving,
163
+ loading: saving,
164
+ children: formatMessage({ id: "payment-plugin.settings.save", defaultMessage: "Save Settings" })
165
+ }
166
+ )
167
+ ] })
168
+ ] }) }),
169
+ error && /* @__PURE__ */ jsx(Box, { marginBottom: 4, children: /* @__PURE__ */ jsx(Alert, { variant: "danger", onClose: () => setError(null), children: error }) }),
170
+ success && /* @__PURE__ */ jsx(Box, { marginBottom: 4, children: /* @__PURE__ */ jsx(Alert, { variant: "success", onClose: () => setSuccess(null), children: success }) }),
171
+ /* @__PURE__ */ jsxs(Grid.Root, { gap: 6, children: [
172
+ /* @__PURE__ */ jsx(Grid.Item, { col: 12, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Box, { padding: 4, children: [
173
+ /* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h2", marginBottom: 4, children: formatMessage({ id: "payment-plugin.settings.stripe", defaultMessage: "Stripe Configuration" }) }),
174
+ /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, children: [
175
+ /* @__PURE__ */ jsx(Grid.Item, { col: 6, children: /* @__PURE__ */ jsx(
176
+ TextInput,
177
+ {
178
+ label: formatMessage({ id: "payment-plugin.settings.publishableKey", defaultMessage: "Publishable Key" }),
179
+ placeholder: "pk_test_...",
180
+ value: settings.stripe.publishableKey,
181
+ onChange: (e) => handleSettingChange("stripe", "publishableKey", e.target.value)
182
+ }
183
+ ) }),
184
+ /* @__PURE__ */ jsx(Grid.Item, { col: 6, children: /* @__PURE__ */ jsx(
185
+ TextInput,
186
+ {
187
+ label: formatMessage({ id: "payment-plugin.settings.secretKey", defaultMessage: "Secret Key" }),
188
+ placeholder: "sk_test_...",
189
+ value: settings.stripe.secretKey,
190
+ onChange: (e) => handleSettingChange("stripe", "secretKey", e.target.value),
191
+ type: "password"
192
+ }
193
+ ) }),
194
+ /* @__PURE__ */ jsx(Grid.Item, { col: 6, children: /* @__PURE__ */ jsx(
195
+ TextInput,
196
+ {
197
+ label: formatMessage({ id: "payment-plugin.settings.webhookSecret", defaultMessage: "Webhook Secret" }),
198
+ placeholder: "whsec_...",
199
+ value: settings.stripe.webhookSecret,
200
+ onChange: (e) => handleSettingChange("stripe", "webhookSecret", e.target.value),
201
+ type: "password"
202
+ }
203
+ ) }),
204
+ /* @__PURE__ */ jsx(Grid.Item, { col: 6, children: /* @__PURE__ */ jsxs(
205
+ SingleSelect,
206
+ {
207
+ label: formatMessage({ id: "payment-plugin.settings.apiVersion", defaultMessage: "API Version" }),
208
+ value: settings.stripe.apiVersion,
209
+ onChange: (value) => handleSettingChange("stripe", "apiVersion", value),
210
+ children: [
211
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "2024-06-20", children: "2024-06-20 (Latest)" }),
212
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "2023-10-16", children: "2023-10-16" }),
213
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "2023-08-15", children: "2023-08-15" })
214
+ ]
215
+ }
216
+ ) }),
217
+ /* @__PURE__ */ jsx(Grid.Item, { col: 12, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
218
+ /* @__PURE__ */ jsx(
219
+ Switch,
220
+ {
221
+ label: formatMessage({ id: "payment-plugin.settings.enabled", defaultMessage: "Enable Stripe Payments" }),
222
+ selected: settings.stripe.enabled,
223
+ onChange: () => handleSettingChange("stripe", "enabled", !settings.stripe.enabled)
224
+ }
225
+ ),
226
+ /* @__PURE__ */ jsx(Typography, { children: formatMessage({ id: "payment-plugin.settings.enabled", defaultMessage: "Enable Stripe Payments" }) })
227
+ ] }) })
228
+ ] })
229
+ ] }) }) }),
230
+ /* @__PURE__ */ jsx(Grid.Item, { col: 6, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Box, { padding: 4, children: [
231
+ /* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h2", marginBottom: 4, children: formatMessage({ id: "payment-plugin.settings.payments", defaultMessage: "Payment Settings" }) }),
232
+ /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, children: [
233
+ /* @__PURE__ */ jsx(Grid.Item, { col: 12, children: /* @__PURE__ */ jsxs(
234
+ SingleSelect,
235
+ {
236
+ label: formatMessage({ id: "payment-plugin.settings.defaultCurrency", defaultMessage: "Default Currency" }),
237
+ value: settings.payments.defaultCurrency,
238
+ onChange: (value) => handleSettingChange("payments", "defaultCurrency", value),
239
+ children: [
240
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "usd", children: "USD" }),
241
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "eur", children: "EUR" }),
242
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "gbp", children: "GBP" }),
243
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "cad", children: "CAD" }),
244
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "aud", children: "AUD" })
245
+ ]
246
+ }
247
+ ) }),
248
+ /* @__PURE__ */ jsx(Grid.Item, { col: 12, children: /* @__PURE__ */ jsxs(
249
+ SingleSelect,
250
+ {
251
+ label: formatMessage({ id: "payment-plugin.settings.captureMethod", defaultMessage: "Capture Method" }),
252
+ value: settings.payments.captureMethod,
253
+ onChange: (value) => handleSettingChange("payments", "captureMethod", value),
254
+ children: [
255
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "automatic", children: "Automatic" }),
256
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "manual", children: "Manual" })
257
+ ]
258
+ }
259
+ ) }),
260
+ /* @__PURE__ */ jsx(Grid.Item, { col: 12, children: /* @__PURE__ */ jsx(
261
+ TextInput,
262
+ {
263
+ label: formatMessage({ id: "payment-plugin.settings.refundWindow", defaultMessage: "Refund Window (Days)" }),
264
+ type: "number",
265
+ value: settings.payments.refundWindow.toString(),
266
+ onChange: (e) => handleSettingChange("payments", "refundWindow", parseInt(e.target.value) || 0)
267
+ }
268
+ ) })
269
+ ] })
270
+ ] }) }) }),
271
+ /* @__PURE__ */ jsx(Grid.Item, { col: 6, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Box, { padding: 4, children: [
272
+ /* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h2", marginBottom: 4, children: formatMessage({ id: "payment-plugin.settings.security", defaultMessage: "Security Settings" }) }),
273
+ /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, children: [
274
+ /* @__PURE__ */ jsx(Grid.Item, { col: 12, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
275
+ /* @__PURE__ */ jsx(
276
+ Switch,
277
+ {
278
+ label: formatMessage({ id: "payment-plugin.settings.requireAuth", defaultMessage: "Require Authentication" }),
279
+ selected: settings.security.requireAuthentication,
280
+ onChange: () => handleSettingChange("security", "requireAuthentication", !settings.security.requireAuthentication)
281
+ }
282
+ ),
283
+ /* @__PURE__ */ jsx(Typography, { children: formatMessage({ id: "payment-plugin.settings.requireAuth", defaultMessage: "Require Authentication" }) })
284
+ ] }) }),
285
+ /* @__PURE__ */ jsx(Grid.Item, { col: 12, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
286
+ /* @__PURE__ */ jsx(
287
+ Switch,
288
+ {
289
+ label: formatMessage({ id: "payment-plugin.settings.auditLog", defaultMessage: "Enable Audit Log" }),
290
+ selected: settings.security.enableAuditLog,
291
+ onChange: () => handleSettingChange("security", "enableAuditLog", !settings.security.enableAuditLog)
292
+ }
293
+ ),
294
+ /* @__PURE__ */ jsx(Typography, { children: formatMessage({ id: "payment-plugin.settings.auditLog", defaultMessage: "Enable Audit Log" }) })
295
+ ] }) }),
296
+ /* @__PURE__ */ jsx(Grid.Item, { col: 12, children: /* @__PURE__ */ jsx(
297
+ TextInput,
298
+ {
299
+ label: formatMessage({ id: "payment-plugin.settings.sessionTimeout", defaultMessage: "Session Timeout (Minutes)" }),
300
+ type: "number",
301
+ value: settings.security.sessionTimeout.toString(),
302
+ onChange: (e) => handleSettingChange("security", "sessionTimeout", parseInt(e.target.value) || 60)
303
+ }
304
+ ) })
305
+ ] })
306
+ ] }) }) }),
307
+ /* @__PURE__ */ jsx(Grid.Item, { col: 12, children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(Box, { padding: 4, children: [
308
+ /* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h2", marginBottom: 4, children: formatMessage({ id: "payment-plugin.settings.ui", defaultMessage: "User Interface Settings" }) }),
309
+ /* @__PURE__ */ jsxs(Grid.Root, { gap: 4, children: [
310
+ /* @__PURE__ */ jsx(Grid.Item, { col: 3, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
311
+ /* @__PURE__ */ jsx(
312
+ Switch,
313
+ {
314
+ checked: settings.ui.showPaymentStatus,
315
+ onChange: (checked) => handleSettingChange("ui", "showPaymentStatus", checked)
316
+ }
317
+ ),
318
+ /* @__PURE__ */ jsx(Typography, { children: formatMessage({ id: "payment-plugin.settings.showStatus", defaultMessage: "Show Payment Status" }) })
319
+ ] }) }),
320
+ /* @__PURE__ */ jsx(Grid.Item, { col: 3, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
321
+ /* @__PURE__ */ jsx(
322
+ Switch,
323
+ {
324
+ checked: settings.ui.showCustomerInfo,
325
+ onChange: (checked) => handleSettingChange("ui", "showCustomerInfo", checked)
326
+ }
327
+ ),
328
+ /* @__PURE__ */ jsx(Typography, { children: formatMessage({ id: "payment-plugin.settings.showCustomerInfo", defaultMessage: "Show Customer Info" }) })
329
+ ] }) }),
330
+ /* @__PURE__ */ jsx(Grid.Item, { col: 3, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
331
+ /* @__PURE__ */ jsx(
332
+ Switch,
333
+ {
334
+ checked: settings.ui.enableNotifications,
335
+ onChange: (checked) => handleSettingChange("ui", "enableNotifications", checked)
336
+ }
337
+ ),
338
+ /* @__PURE__ */ jsx(Typography, { children: formatMessage({ id: "payment-plugin.settings.notifications", defaultMessage: "Enable Notifications" }) })
339
+ ] }) }),
340
+ /* @__PURE__ */ jsx(Grid.Item, { col: 3, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, children: [
341
+ /* @__PURE__ */ jsx(
342
+ Switch,
343
+ {
344
+ checked: settings.ui.compactView,
345
+ onChange: (checked) => handleSettingChange("ui", "compactView", checked)
346
+ }
347
+ ),
348
+ /* @__PURE__ */ jsx(Typography, { children: formatMessage({ id: "payment-plugin.settings.compactView", defaultMessage: "Compact View" }) })
349
+ ] }) })
350
+ ] })
351
+ ] }) }) })
352
+ ] })
353
+ ] });
354
+ };
355
+ export {
356
+ Settings
357
+ };
@@ -0,0 +1,240 @@
1
+ const en = {
2
+ "payment-plugin": {
3
+ plugin: {
4
+ name: "Payment Management"
5
+ },
6
+ dashboard: {
7
+ title: "Payment Dashboard",
8
+ subtitle: "Overview of your payment operations",
9
+ totalRevenue: "Total Revenue",
10
+ totalPayments: "Total Payments",
11
+ successRate: "Success Rate",
12
+ averageOrderValue: "Average Order Value",
13
+ recentPayments: "Recent Payments",
14
+ viewAll: "View All",
15
+ customer: "Customer",
16
+ amount: "Amount",
17
+ status: "Status",
18
+ paymentMethod: "Payment Method",
19
+ date: "Date",
20
+ retry: "Retry"
21
+ },
22
+ payments: {
23
+ title: "Payments",
24
+ subtitle: "Manage and monitor all payment transactions",
25
+ retry: "Retry",
26
+ "export": "Export",
27
+ refresh: "Refresh",
28
+ search: {
29
+ placeholder: "Search payments..."
30
+ },
31
+ status: {
32
+ placeholder: "All Statuses"
33
+ },
34
+ method: {
35
+ placeholder: "All Methods"
36
+ },
37
+ currency: {
38
+ placeholder: "All Currencies"
39
+ },
40
+ all: "All",
41
+ succeeded: "Succeeded",
42
+ pending: "Pending",
43
+ failed: "Failed",
44
+ refunded: "Refunded",
45
+ card: "Card",
46
+ bank_transfer: "Bank Transfer",
47
+ wallet: "Wallet",
48
+ clearFilters: "Clear",
49
+ results: "Showing {start}-{end} of {total} payments",
50
+ view: "View details",
51
+ refund: "Refund",
52
+ paymentList: {
53
+ empty: "No payments found",
54
+ customer: "Customer",
55
+ amount: "Amount",
56
+ status: "Status",
57
+ method: "Method",
58
+ date: "Date"
59
+ }
60
+ },
61
+ orders: {
62
+ title: "Orders",
63
+ subtitle: "Manage and track all customer orders",
64
+ retry: "Retry",
65
+ "export": "Export",
66
+ refresh: "Refresh",
67
+ search: {
68
+ placeholder: "Search orders..."
69
+ },
70
+ status: {
71
+ placeholder: "All Statuses"
72
+ },
73
+ paymentStatus: "Payment Status",
74
+ currency: {
75
+ placeholder: "All Currencies"
76
+ },
77
+ all: "All",
78
+ pending: "Pending",
79
+ processing: "Processing",
80
+ shipped: "Shipped",
81
+ delivered: "Delivered",
82
+ cancelled: "Cancelled",
83
+ unpaid: "Unpaid",
84
+ paid: "Paid",
85
+ partially_paid: "Partially Paid",
86
+ refunded: "Refunded",
87
+ clearFilters: "Clear",
88
+ results: "Showing {start}-{end} of {total} orders",
89
+ orderNumber: "Order #",
90
+ customer: "Customer",
91
+ items: "Items",
92
+ total: "Total",
93
+ orderStatus: "Order Status",
94
+ date: "Date",
95
+ orderList: {
96
+ empty: "No orders found",
97
+ orderNumber: "Order #",
98
+ customer: "Customer",
99
+ items: "Items",
100
+ total: "Total",
101
+ status: "Status",
102
+ paymentStatus: "Payment"
103
+ }
104
+ },
105
+ customers: {
106
+ title: "Customers",
107
+ subtitle: "Manage and view customer information",
108
+ retry: "Retry",
109
+ "export": "Export",
110
+ refresh: "Refresh",
111
+ search: {
112
+ placeholder: "Search customers..."
113
+ },
114
+ status: "Status",
115
+ country: {
116
+ placeholder: "All Countries"
117
+ },
118
+ all: "All",
119
+ active: "Active",
120
+ inactive: "Inactive",
121
+ clearFilters: "Clear",
122
+ results: "Showing {start}-{end} of {total} customers",
123
+ customer: "Customer",
124
+ contact: "Contact",
125
+ totalSpent: "Total Spent",
126
+ payments: "Payments",
127
+ lastPayment: "Last Payment",
128
+ registration: "Registered",
129
+ customerList: {
130
+ empty: "No customers found",
131
+ customer: "Customer",
132
+ totalSpent: "Total Spent",
133
+ payments: "Payments",
134
+ lastPayment: "Last Payment",
135
+ status: "Status"
136
+ }
137
+ },
138
+ analytics: {
139
+ title: "Analytics",
140
+ subtitle: "Payment insights and performance metrics",
141
+ retry: "Retry",
142
+ "export": "Export Report",
143
+ refresh: "Refresh",
144
+ totalRevenue: "Total Revenue",
145
+ successRate: "Success Rate",
146
+ averageAmount: "Average Amount",
147
+ trends: "Revenue Trends",
148
+ paymentMethods: "Payment Methods",
149
+ topProducts: "Top Products",
150
+ product: "Product",
151
+ revenue: "Revenue",
152
+ quantity: "Quantity",
153
+ geographic: "Geographic Distribution",
154
+ country: "Country",
155
+ transactions: "Transactions",
156
+ outOfPayments: "{total} payments"
157
+ },
158
+ settings: {
159
+ title: "Payment Settings",
160
+ subtitle: "Configure your payment plugin settings",
161
+ loading: "Loading settings...",
162
+ error: "Failed to load settings",
163
+ unsaved: "You have unsaved changes",
164
+ reset: "Reset",
165
+ testConnection: "Test Connection",
166
+ save: "Save Settings",
167
+ stripe: "Stripe Configuration",
168
+ publishableKey: "Publishable Key",
169
+ secretKey: "Secret Key",
170
+ webhookSecret: "Webhook Secret",
171
+ apiVersion: "API Version",
172
+ enabled: "Enable Stripe Payments",
173
+ payments: "Payment Settings",
174
+ defaultCurrency: "Default Currency",
175
+ captureMethod: "Capture Method",
176
+ refundWindow: "Refund Window (Days)",
177
+ security: "Security Settings",
178
+ requireAuth: "Require Authentication",
179
+ auditLog: "Enable Audit Log",
180
+ sessionTimeout: "Session Timeout (Minutes)",
181
+ ui: "User Interface Settings",
182
+ showStatus: "Show Payment Status",
183
+ showCustomerInfo: "Show Customer Info",
184
+ notifications: "Enable Notifications",
185
+ compactView: "Compact View"
186
+ },
187
+ refund: {
188
+ title: "Process Refund",
189
+ header: "Process Refund",
190
+ paymentInfo: "Payment Information",
191
+ customer: "Customer",
192
+ originalAmount: "Original Amount",
193
+ description: "Description",
194
+ quickOptions: "Quick Options",
195
+ full: "Full Refund",
196
+ half: "50% Refund",
197
+ quarter: "25% Refund",
198
+ amount: "Refund Amount",
199
+ maxAmount: "Maximum: {amount}",
200
+ reason: "Reason (Optional)",
201
+ reasonPlaceholder: "Reason for refund...",
202
+ inCents: "Amount in cents",
203
+ error: "Error",
204
+ warning: "Warning",
205
+ warningMessage: "This action cannot be undone. The refund will be processed immediately.",
206
+ cancel: "Cancel",
207
+ submit: "Process Refund"
208
+ },
209
+ paymentDetails: {
210
+ title: "Payment Details",
211
+ header: "Payment Details",
212
+ copyId: "Copy ID",
213
+ close: "Close",
214
+ basicInfo: "Basic Information",
215
+ customer: "Customer",
216
+ amount: "Amount",
217
+ status: "Status",
218
+ paymentMethod: "Payment Method",
219
+ transaction: "Transaction Details",
220
+ field: "Field",
221
+ value: "Value",
222
+ stripeId: "Stripe Payment ID",
223
+ createdAt: "Created At",
224
+ updatedAt: "Updated At",
225
+ orderId: "Order ID",
226
+ failureReason: "Failure Reason",
227
+ refundAmount: "Refunded Amount",
228
+ metadata: "Metadata",
229
+ key: "Key",
230
+ billingAddress: "Billing Address",
231
+ shippingAddress: "Shipping Address",
232
+ card: "Card",
233
+ bank_transfer: "Bank Transfer",
234
+ wallet: "Wallet"
235
+ }
236
+ }
237
+ };
238
+ export {
239
+ en as default
240
+ };