strapi-plugin-payone-provider 5.7.26 → 5.8.26

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 (83) hide show
  1. package/README.md +1191 -1191
  2. package/admin/src/components/Initializer/index.jsx +16 -16
  3. package/admin/src/components/PluginIcon/index.jsx +17 -17
  4. package/admin/src/index.js +57 -57
  5. package/admin/src/pages/App/components/AppHeader.jsx +45 -45
  6. package/admin/src/pages/App/components/AppTabs.jsx +105 -105
  7. package/admin/src/pages/App/components/ApplePayBtn.jsx +355 -355
  8. package/admin/src/pages/App/components/ApplePayConfig.jsx +357 -357
  9. package/admin/src/pages/App/components/DocsPanel.jsx +53 -53
  10. package/admin/src/pages/App/components/RenderInput.jsx +78 -78
  11. package/admin/src/pages/App/components/StatusBadge.jsx +87 -87
  12. package/admin/src/pages/App/components/icons/BankIcon.jsx +10 -10
  13. package/admin/src/pages/App/components/icons/ChevronDownIcon.jsx +9 -9
  14. package/admin/src/pages/App/components/icons/ChevronUpIcon.jsx +9 -9
  15. package/admin/src/pages/App/components/icons/CreditCardIcon.jsx +9 -9
  16. package/admin/src/pages/App/components/icons/ErrorIcon.jsx +10 -10
  17. package/admin/src/pages/App/components/icons/InfoIcon.jsx +9 -9
  18. package/admin/src/pages/App/components/icons/MarkCircle.jsx +19 -19
  19. package/admin/src/pages/App/components/icons/PaymentIcon.jsx +10 -10
  20. package/admin/src/pages/App/components/icons/PendingIcon.jsx +9 -9
  21. package/admin/src/pages/App/components/icons/PersonIcon.jsx +9 -9
  22. package/admin/src/pages/App/components/icons/SuccessIcon.jsx +9 -9
  23. package/admin/src/pages/App/components/icons/WalletIcon.jsx +9 -9
  24. package/admin/src/pages/App/components/icons/index.jsx +12 -12
  25. package/admin/src/pages/App/components/payment-actions/AuthorizationForm.jsx +334 -334
  26. package/admin/src/pages/App/components/payment-actions/CaptureForm.jsx +120 -120
  27. package/admin/src/pages/App/components/payment-actions/PaymentActionsPanel.jsx +183 -183
  28. package/admin/src/pages/App/components/payment-actions/PaymentMethodSelector.jsx +315 -315
  29. package/admin/src/pages/App/components/payment-actions/PaymentResult.jsx +129 -129
  30. package/admin/src/pages/App/components/payment-actions/PreauthorizationForm.jsx +273 -273
  31. package/admin/src/pages/App/components/payment-actions/RefundForm.jsx +114 -114
  32. package/admin/src/pages/App/components/transaction-history/ImportExportBar.jsx +153 -153
  33. package/admin/src/pages/App/components/transaction-history/details/TransactionHistoryItem.jsx +526 -526
  34. package/admin/src/pages/App/index.jsx +96 -96
  35. package/admin/src/pages/App/styles.css +176 -176
  36. package/admin/src/pages/constants/paymentConstants.js +71 -71
  37. package/admin/src/pages/hooks/use-system-theme.js +27 -27
  38. package/admin/src/pages/hooks/usePaymentActions.js +498 -498
  39. package/admin/src/pages/hooks/usePluginTranslations.js +12 -12
  40. package/admin/src/pages/hooks/useSettings.js +183 -183
  41. package/admin/src/pages/hooks/useTransactionHistory.js +148 -148
  42. package/admin/src/pages/utils/api.js +97 -97
  43. package/admin/src/pages/utils/applePayConstants.js +196 -196
  44. package/admin/src/pages/utils/formatTransactionData.js +15 -15
  45. package/admin/src/pages/utils/getInputComponent.jsx +200 -200
  46. package/admin/src/pages/utils/paymentUtils.js +661 -661
  47. package/admin/src/pages/utils/tooltipHelpers.js +18 -18
  48. package/admin/src/pages/utils/transactionTableUtils.js +71 -71
  49. package/admin/src/pluginId.js +9 -9
  50. package/admin/src/translations/de.json +235 -235
  51. package/admin/src/translations/en.json +235 -235
  52. package/admin/src/translations/fr.json +235 -235
  53. package/admin/src/translations/ru.json +235 -235
  54. package/admin/src/utils/prefixPluginTranslations.js +13 -13
  55. package/package.json +45 -45
  56. package/server/bootstrap.js +107 -107
  57. package/server/config/index.js +83 -83
  58. package/server/content-types/index.js +4 -4
  59. package/server/content-types/transactions/index.js +4 -4
  60. package/server/content-types/transactions/schema.json +86 -86
  61. package/server/controllers/index.js +7 -7
  62. package/server/controllers/payone.js +503 -506
  63. package/server/destroy.js +5 -5
  64. package/server/index.js +23 -23
  65. package/server/policies/index.js +7 -7
  66. package/server/policies/is-auth.js +29 -29
  67. package/server/policies/isSuperAdmin.js +20 -20
  68. package/server/register.js +5 -5
  69. package/server/routes/index.js +218 -218
  70. package/server/services/applePayService.js +295 -295
  71. package/server/services/index.js +9 -9
  72. package/server/services/paymentService.js +264 -223
  73. package/server/services/payone.js +78 -78
  74. package/server/services/settingsService.js +59 -59
  75. package/server/services/testConnectionService.js +115 -115
  76. package/server/services/transactionService.js +262 -262
  77. package/server/utils/csvTransactions.js +82 -82
  78. package/server/utils/normalize.js +39 -39
  79. package/server/utils/paymentMethodParams.js +288 -288
  80. package/server/utils/requestBuilder.js +115 -100
  81. package/server/utils/responseParser.js +141 -141
  82. package/strapi-admin.js +4 -4
  83. package/strapi-server.js +3 -3
@@ -1,315 +1,315 @@
1
- import * as React from "react";
2
- import { Box, Flex, Typography, Link, Alert } from "@strapi/design-system";
3
- import pluginId from "../../../../pluginId";
4
- import {
5
- getPaymentMethodOptions,
6
- getPaymentMethodDisplayName,
7
- supportsCaptureMode,
8
- getCaptureModeOptions,
9
- } from "../../../utils/paymentUtils";
10
- import RenderInput from "../RenderInput";
11
- import { usePluginTranslations } from "../../../hooks/usePluginTranslations";
12
-
13
- const PaymentMethodSelector = ({
14
- paymentActions,
15
- onNavigateToConfig,
16
- isLiveMode,
17
- }) => {
18
- const { t } = usePluginTranslations();
19
- return (
20
- <Box>
21
- <Flex direction="column" alignItems="stretch" gap={4}>
22
- <RenderInput
23
- name="paymentMethod"
24
- label={t("paymentMethodSelector.label", "Select Payment Method")}
25
- value={paymentActions.paymentState.paymentMethod || ""}
26
- onChange={(e) => {
27
- const value = e.target?.value || e;
28
- paymentActions.handleFieldChange("paymentMethod", value);
29
- }}
30
- inputType="select"
31
- options={getPaymentMethodOptions(isLiveMode).map((option) => ({
32
- value: option.value,
33
- label: option.label,
34
- }))}
35
- placeholder={t("paymentMethodSelector.placeholder", "Select payment method")}
36
- hint={`${t("paymentMethodSelector.hintCurrent", "Current")}: ${getPaymentMethodDisplayName(paymentActions.paymentState.paymentMethod)}`}
37
- tooltipContent={t("paymentMethodSelector.tooltip", "Select the payment method you want to use for this transaction")}
38
- />
39
- {paymentActions.paymentState.paymentMethod === "apl" &&
40
- onNavigateToConfig && (
41
- <>
42
- <Box
43
- style={{
44
- display: "flex",
45
- flexDirection: "column",
46
- gap: "16px",
47
- }}
48
- >
49
- <Box
50
- style={{
51
- background: "transparent",
52
- padding: "16px",
53
- borderRadius: "4px",
54
- border: "1px solid #eaeaea",
55
- }}
56
- >
57
- <Typography variant="pi" style={{ lineHeight: "1.6" }}>
58
- <strong>Apple Pay requires middleware configuration</strong>{" "}
59
- to work properly. You must configure Content Security Policy
60
- (CSP) in{" "}
61
- <code
62
- style={{
63
- padding: "2px 6px",
64
- borderRadius: "3px",
65
- fontSize: "13px",
66
- }}
67
- >
68
- config/middlewares.js
69
- </code>{" "}
70
- to allow Apple Pay scripts.
71
- </Typography>
72
-
73
- <Box style={{ marginTop: "16px" }}>
74
- <Typography
75
- variant="pi"
76
- style={{
77
- fontWeight: "600",
78
- marginBottom: "8px",
79
- display: "block",
80
- }}
81
- >
82
- Required CSP directives:
83
- </Typography>
84
-
85
- <Box>
86
- <Typography
87
- variant="pi"
88
- style={{
89
- fontFamily: "monospace",
90
- fontSize: "12px",
91
- lineHeight: "1.8",
92
- }}
93
- >
94
- <div>
95
- 'script-src': ['https://applepay.cdn-apple.com',
96
- 'https://www.apple.com']
97
- </div>
98
- <div>
99
- 'connect-src': ['https://applepay.cdn-apple.com',
100
- 'https://www.apple.com']
101
- </div>
102
- <div>
103
- 'frame-src': ['https://applepay.cdn-apple.com']
104
- </div>
105
- </Typography>
106
- </Box>
107
- </Box>
108
-
109
- <Box
110
- padding={2}
111
- background="warning100"
112
- style={{
113
- marginTop: "16px",
114
- borderRadius: "4px",
115
- borderLeft: "3px solid #f29d41",
116
- }}
117
- >
118
- <Typography variant="pi" style={{ fontWeight: "600" }}>
119
- ⚠️ Without this configuration, Apple Pay will NOT work!
120
- </Typography>
121
- </Box>
122
- </Box>
123
-
124
- <Box
125
- style={{
126
- background: "transparent",
127
- padding: "16px",
128
- borderRadius: "4px",
129
- border: "1px solid #eaeaea",
130
- }}
131
- >
132
- <Typography variant="pi" style={{ lineHeight: "1.6" }}>
133
- <strong>Download the domain verification file</strong> from
134
- your Payone merchant portal and place it in the following
135
- locations:
136
- </Typography>
137
-
138
- <Box>
139
- <Typography
140
- variant="pi"
141
- style={{
142
- fontFamily: "monospace",
143
- fontSize: "12px",
144
- lineHeight: "1.8",
145
- }}
146
- >
147
- <div style={{ marginBottom: "8px" }}>
148
- <strong>Strapi:</strong>{" "}
149
- <code>
150
- public/.well-known/apple-developer-merchantid-domain-association
151
- </code>
152
- </div>
153
- <div>
154
- <strong>Frontend:</strong>{" "}
155
- <code>
156
- public/.well-known/apple-developer-merchantid-domain-association
157
- </code>
158
- </div>
159
- </Typography>
160
- </Box>
161
-
162
- <Box style={{ marginTop: "16px" }}>
163
- <Typography variant="pi" style={{ lineHeight: "1.6" }}>
164
- <strong>Download URL:</strong> Get the domain verification
165
- file from Payone documentation:
166
- </Typography>
167
- <Box
168
- padding={2}
169
- background="primary100"
170
- style={{ marginTop: "8px", borderRadius: "4px" }}
171
- >
172
- <Link
173
- href="https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev"
174
- target="_blank"
175
- rel="noopener noreferrer"
176
- style={{
177
- color: "#4945ff",
178
- textDecoration: "none",
179
- fontWeight: "500",
180
- fontSize: "14px",
181
- }}
182
- >
183
-
184
- https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev
185
- </Link>
186
- </Box>
187
- </Box>
188
-
189
- <Box
190
- padding={2}
191
- background="danger100"
192
- style={{
193
- marginTop: "16px",
194
- borderRadius: "4px",
195
- borderLeft: "3px solid #d02b20",
196
- }}
197
- >
198
- <Typography
199
- variant="pi"
200
- textColor="danger600"
201
- style={{ fontWeight: "600" }}
202
- >
203
- ⚠️ Without this file, Apple Pay will NOT work on your
204
- domain!
205
- </Typography>
206
- </Box>
207
- </Box>
208
- </Box>
209
-
210
- <Box padding={3} borderRadius="4px">
211
- <Typography variant="pi" textColor="neutral600">
212
- Configure Apple Pay settings:{" "}
213
- <Link
214
- href={`/plugins/${pluginId}/apple-pay-config`}
215
- onClick={(e) => {
216
- e.preventDefault();
217
- onNavigateToConfig("apple-pay");
218
- }}
219
- style={{
220
- cursor: "pointer",
221
- textDecoration: "underline",
222
- color: "#0066ff",
223
- }}
224
- >
225
- /plugins/{pluginId}/apple-pay-config
226
- </Link>
227
- </Typography>
228
- </Box>
229
- </>
230
- )}
231
- {paymentActions.paymentState.paymentMethod === "gpp" &&
232
- onNavigateToConfig && (
233
- <>
234
- <Alert
235
- closeLabel="Close"
236
- title="⚠️ Important: Middleware Configuration Required"
237
- variant="warning"
238
- >
239
- <Typography variant="pi" marginTop={2}>
240
- <strong>Google Pay requires middleware configuration</strong>{" "}
241
- to work properly. You must configure Content Security Policy
242
- (CSP) in <code>config/middlewares.js</code> to allow Google
243
- Pay scripts, otherwise Google Pay will NOT work.
244
- </Typography>
245
- <Typography variant="pi" marginTop={2}>
246
- Required CSP directives for Google Pay:
247
- </Typography>
248
- <Box
249
- marginTop={2}
250
- padding={2}
251
- background="neutral100"
252
- borderRadius="4px"
253
- >
254
- <Typography
255
- variant="pi"
256
- style={{ fontFamily: "monospace", fontSize: "12px" }}
257
- >
258
- 'script-src': ['https://pay.google.com']
259
- <br />
260
- 'connect-src': ['https://pay.google.com']
261
- <br />
262
- 'frame-src': ['https://pay.google.com']
263
- </Typography>
264
- </Box>
265
- <Typography variant="pi" marginTop={2} fontWeight="bold">
266
- ⚠️ Without this configuration, Google Pay will NOT work!
267
- </Typography>
268
- </Alert>
269
- <Box padding={3} background="neutral100" borderRadius="4px">
270
- <Typography variant="pi" textColor="neutral600">
271
- Configure Google Pay settings:{" "}
272
- <Link
273
- href={`/plugins/${pluginId}/google-pay-config`}
274
- onClick={(e) => {
275
- e.preventDefault();
276
- onNavigateToConfig("google-pay");
277
- }}
278
- style={{
279
- cursor: "pointer",
280
- textDecoration: "underline",
281
- color: "#0066ff",
282
- }}
283
- >
284
- /plugins/{pluginId}/google-pay-config
285
- </Link>
286
- </Typography>
287
- </Box>
288
- </>
289
- )}
290
- {paymentActions.paymentState.paymentMethod !== "apl" &&
291
- supportsCaptureMode(paymentActions.paymentState.paymentMethod) && (
292
- <RenderInput
293
- name="captureMode"
294
- label="Capture Mode"
295
- value={paymentActions.paymentState.captureMode || ""}
296
- onChange={(e) => {
297
- const value = e.target?.value || e;
298
- paymentActions.handleFieldChange("captureMode", value);
299
- }}
300
- inputType="select"
301
- options={getCaptureModeOptions().map((option) => ({
302
- value: option.value,
303
- label: option.label,
304
- }))}
305
- placeholder="Select capture mode"
306
- hint="Select capture mode for wallet payments"
307
- tooltipContent="Choose how the payment should be captured for wallet payments"
308
- />
309
- )}
310
- </Flex>
311
- </Box>
312
- );
313
- };
314
-
315
- export default PaymentMethodSelector;
1
+ import * as React from "react";
2
+ import { Box, Flex, Typography, Link, Alert } from "@strapi/design-system";
3
+ import pluginId from "../../../../pluginId";
4
+ import {
5
+ getPaymentMethodOptions,
6
+ getPaymentMethodDisplayName,
7
+ supportsCaptureMode,
8
+ getCaptureModeOptions,
9
+ } from "../../../utils/paymentUtils";
10
+ import RenderInput from "../RenderInput";
11
+ import { usePluginTranslations } from "../../../hooks/usePluginTranslations";
12
+
13
+ const PaymentMethodSelector = ({
14
+ paymentActions,
15
+ onNavigateToConfig,
16
+ isLiveMode,
17
+ }) => {
18
+ const { t } = usePluginTranslations();
19
+ return (
20
+ <Box>
21
+ <Flex direction="column" alignItems="stretch" gap={4}>
22
+ <RenderInput
23
+ name="paymentMethod"
24
+ label={t("paymentMethodSelector.label", "Select Payment Method")}
25
+ value={paymentActions.paymentState.paymentMethod || ""}
26
+ onChange={(e) => {
27
+ const value = e.target?.value || e;
28
+ paymentActions.handleFieldChange("paymentMethod", value);
29
+ }}
30
+ inputType="select"
31
+ options={getPaymentMethodOptions(isLiveMode).map((option) => ({
32
+ value: option.value,
33
+ label: option.label,
34
+ }))}
35
+ placeholder={t("paymentMethodSelector.placeholder", "Select payment method")}
36
+ hint={`${t("paymentMethodSelector.hintCurrent", "Current")}: ${getPaymentMethodDisplayName(paymentActions.paymentState.paymentMethod)}`}
37
+ tooltipContent={t("paymentMethodSelector.tooltip", "Select the payment method you want to use for this transaction")}
38
+ />
39
+ {paymentActions.paymentState.paymentMethod === "apl" &&
40
+ onNavigateToConfig && (
41
+ <>
42
+ <Box
43
+ style={{
44
+ display: "flex",
45
+ flexDirection: "column",
46
+ gap: "16px",
47
+ }}
48
+ >
49
+ <Box
50
+ style={{
51
+ background: "transparent",
52
+ padding: "16px",
53
+ borderRadius: "4px",
54
+ border: "1px solid #eaeaea",
55
+ }}
56
+ >
57
+ <Typography variant="pi" style={{ lineHeight: "1.6" }}>
58
+ <strong>Apple Pay requires middleware configuration</strong>{" "}
59
+ to work properly. You must configure Content Security Policy
60
+ (CSP) in{" "}
61
+ <code
62
+ style={{
63
+ padding: "2px 6px",
64
+ borderRadius: "3px",
65
+ fontSize: "13px",
66
+ }}
67
+ >
68
+ config/middlewares.js
69
+ </code>{" "}
70
+ to allow Apple Pay scripts.
71
+ </Typography>
72
+
73
+ <Box style={{ marginTop: "16px" }}>
74
+ <Typography
75
+ variant="pi"
76
+ style={{
77
+ fontWeight: "600",
78
+ marginBottom: "8px",
79
+ display: "block",
80
+ }}
81
+ >
82
+ Required CSP directives:
83
+ </Typography>
84
+
85
+ <Box>
86
+ <Typography
87
+ variant="pi"
88
+ style={{
89
+ fontFamily: "monospace",
90
+ fontSize: "12px",
91
+ lineHeight: "1.8",
92
+ }}
93
+ >
94
+ <div>
95
+ 'script-src': ['https://applepay.cdn-apple.com',
96
+ 'https://www.apple.com']
97
+ </div>
98
+ <div>
99
+ 'connect-src': ['https://applepay.cdn-apple.com',
100
+ 'https://www.apple.com']
101
+ </div>
102
+ <div>
103
+ 'frame-src': ['https://applepay.cdn-apple.com']
104
+ </div>
105
+ </Typography>
106
+ </Box>
107
+ </Box>
108
+
109
+ <Box
110
+ padding={2}
111
+ background="warning100"
112
+ style={{
113
+ marginTop: "16px",
114
+ borderRadius: "4px",
115
+ borderLeft: "3px solid #f29d41",
116
+ }}
117
+ >
118
+ <Typography variant="pi" style={{ fontWeight: "600" }}>
119
+ ⚠️ Without this configuration, Apple Pay will NOT work!
120
+ </Typography>
121
+ </Box>
122
+ </Box>
123
+
124
+ <Box
125
+ style={{
126
+ background: "transparent",
127
+ padding: "16px",
128
+ borderRadius: "4px",
129
+ border: "1px solid #eaeaea",
130
+ }}
131
+ >
132
+ <Typography variant="pi" style={{ lineHeight: "1.6" }}>
133
+ <strong>Download the domain verification file</strong> from
134
+ your Payone merchant portal and place it in the following
135
+ locations:
136
+ </Typography>
137
+
138
+ <Box>
139
+ <Typography
140
+ variant="pi"
141
+ style={{
142
+ fontFamily: "monospace",
143
+ fontSize: "12px",
144
+ lineHeight: "1.8",
145
+ }}
146
+ >
147
+ <div style={{ marginBottom: "8px" }}>
148
+ <strong>Strapi:</strong>{" "}
149
+ <code>
150
+ public/.well-known/apple-developer-merchantid-domain-association
151
+ </code>
152
+ </div>
153
+ <div>
154
+ <strong>Frontend:</strong>{" "}
155
+ <code>
156
+ public/.well-known/apple-developer-merchantid-domain-association
157
+ </code>
158
+ </div>
159
+ </Typography>
160
+ </Box>
161
+
162
+ <Box style={{ marginTop: "16px" }}>
163
+ <Typography variant="pi" style={{ lineHeight: "1.6" }}>
164
+ <strong>Download URL:</strong> Get the domain verification
165
+ file from Payone documentation:
166
+ </Typography>
167
+ <Box
168
+ padding={2}
169
+ background="primary100"
170
+ style={{ marginTop: "8px", borderRadius: "4px" }}
171
+ >
172
+ <Link
173
+ href="https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev"
174
+ target="_blank"
175
+ rel="noopener noreferrer"
176
+ style={{
177
+ color: "#4945ff",
178
+ textDecoration: "none",
179
+ fontWeight: "500",
180
+ fontSize: "14px",
181
+ }}
182
+ >
183
+
184
+ https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev
185
+ </Link>
186
+ </Box>
187
+ </Box>
188
+
189
+ <Box
190
+ padding={2}
191
+ background="danger100"
192
+ style={{
193
+ marginTop: "16px",
194
+ borderRadius: "4px",
195
+ borderLeft: "3px solid #d02b20",
196
+ }}
197
+ >
198
+ <Typography
199
+ variant="pi"
200
+ textColor="danger600"
201
+ style={{ fontWeight: "600" }}
202
+ >
203
+ ⚠️ Without this file, Apple Pay will NOT work on your
204
+ domain!
205
+ </Typography>
206
+ </Box>
207
+ </Box>
208
+ </Box>
209
+
210
+ <Box padding={3} borderRadius="4px">
211
+ <Typography variant="pi" textColor="neutral600">
212
+ Configure Apple Pay settings:{" "}
213
+ <Link
214
+ href={`/plugins/${pluginId}/apple-pay-config`}
215
+ onClick={(e) => {
216
+ e.preventDefault();
217
+ onNavigateToConfig("apple-pay");
218
+ }}
219
+ style={{
220
+ cursor: "pointer",
221
+ textDecoration: "underline",
222
+ color: "#0066ff",
223
+ }}
224
+ >
225
+ /plugins/{pluginId}/apple-pay-config
226
+ </Link>
227
+ </Typography>
228
+ </Box>
229
+ </>
230
+ )}
231
+ {paymentActions.paymentState.paymentMethod === "gpp" &&
232
+ onNavigateToConfig && (
233
+ <>
234
+ <Alert
235
+ closeLabel="Close"
236
+ title="⚠️ Important: Middleware Configuration Required"
237
+ variant="warning"
238
+ >
239
+ <Typography variant="pi" marginTop={2}>
240
+ <strong>Google Pay requires middleware configuration</strong>{" "}
241
+ to work properly. You must configure Content Security Policy
242
+ (CSP) in <code>config/middlewares.js</code> to allow Google
243
+ Pay scripts, otherwise Google Pay will NOT work.
244
+ </Typography>
245
+ <Typography variant="pi" marginTop={2}>
246
+ Required CSP directives for Google Pay:
247
+ </Typography>
248
+ <Box
249
+ marginTop={2}
250
+ padding={2}
251
+ background="neutral100"
252
+ borderRadius="4px"
253
+ >
254
+ <Typography
255
+ variant="pi"
256
+ style={{ fontFamily: "monospace", fontSize: "12px" }}
257
+ >
258
+ 'script-src': ['https://pay.google.com']
259
+ <br />
260
+ 'connect-src': ['https://pay.google.com']
261
+ <br />
262
+ 'frame-src': ['https://pay.google.com']
263
+ </Typography>
264
+ </Box>
265
+ <Typography variant="pi" marginTop={2} fontWeight="bold">
266
+ ⚠️ Without this configuration, Google Pay will NOT work!
267
+ </Typography>
268
+ </Alert>
269
+ <Box padding={3} background="neutral100" borderRadius="4px">
270
+ <Typography variant="pi" textColor="neutral600">
271
+ Configure Google Pay settings:{" "}
272
+ <Link
273
+ href={`/plugins/${pluginId}/google-pay-config`}
274
+ onClick={(e) => {
275
+ e.preventDefault();
276
+ onNavigateToConfig("google-pay");
277
+ }}
278
+ style={{
279
+ cursor: "pointer",
280
+ textDecoration: "underline",
281
+ color: "#0066ff",
282
+ }}
283
+ >
284
+ /plugins/{pluginId}/google-pay-config
285
+ </Link>
286
+ </Typography>
287
+ </Box>
288
+ </>
289
+ )}
290
+ {paymentActions.paymentState.paymentMethod !== "apl" &&
291
+ supportsCaptureMode(paymentActions.paymentState.paymentMethod) && (
292
+ <RenderInput
293
+ name="captureMode"
294
+ label="Capture Mode"
295
+ value={paymentActions.paymentState.captureMode || ""}
296
+ onChange={(e) => {
297
+ const value = e.target?.value || e;
298
+ paymentActions.handleFieldChange("captureMode", value);
299
+ }}
300
+ inputType="select"
301
+ options={getCaptureModeOptions().map((option) => ({
302
+ value: option.value,
303
+ label: option.label,
304
+ }))}
305
+ placeholder="Select capture mode"
306
+ hint="Select capture mode for wallet payments"
307
+ tooltipContent="Choose how the payment should be captured for wallet payments"
308
+ />
309
+ )}
310
+ </Flex>
311
+ </Box>
312
+ );
313
+ };
314
+
315
+ export default PaymentMethodSelector;