strapi-plugin-payone-provider 4.6.10 → 4.6.11

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 (62) hide show
  1. package/README.md +64 -0
  2. package/admin/src/pages/App/components/AppHeader.jsx +3 -2
  3. package/admin/src/pages/App/components/AppTabs.jsx +34 -88
  4. package/admin/src/pages/App/components/DocsPanel.jsx +1726 -1726
  5. package/admin/src/pages/App/components/GooglePaybutton.jsx +300 -300
  6. package/admin/src/pages/App/components/StatusBadge.jsx +1 -1
  7. package/admin/src/pages/App/components/common/InfoTooltip.jsx +16 -0
  8. package/admin/src/pages/App/components/{ApplePayConfig.jsx → configuration/ApplePayConfig.jsx} +191 -62
  9. package/admin/src/pages/App/components/{ApplePayConfigPanel.jsx → configuration/ApplePayConfigPanel.jsx} +71 -70
  10. package/admin/src/pages/App/components/configuration/ConfigurationFields.jsx +408 -0
  11. package/admin/src/pages/App/components/configuration/ConfigurationPanel.jsx +67 -0
  12. package/admin/src/pages/App/components/{GooglePayConfig.jsx → configuration/GooglePayConfig.jsx} +254 -254
  13. package/admin/src/pages/App/components/{GooglePayConfigPanel.jsx → configuration/GooglePayConfigPanel.jsx} +82 -82
  14. package/admin/src/pages/App/components/configuration/TestConnection.jsx +129 -0
  15. package/admin/src/pages/App/components/paymentActions/ApplePayPanel.jsx +137 -95
  16. package/admin/src/pages/App/components/paymentActions/CaptureForm.jsx +119 -14
  17. package/admin/src/pages/App/components/paymentActions/CardDetailsInput.jsx +85 -24
  18. package/admin/src/pages/App/components/paymentActions/PaymentActionsPanel.jsx +361 -0
  19. package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.jsx +22 -4
  20. package/admin/src/pages/App/components/paymentActions/RefundForm.jsx +91 -20
  21. package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationForm.jsx +157 -0
  22. package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationFormFields.jsx +308 -0
  23. package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationFormHeader.jsx +27 -0
  24. package/admin/src/pages/App/components/paymentActions/authorization/AuthorizationPaymentButtons.jsx +93 -0
  25. package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationForm.jsx +134 -0
  26. package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationFormFields.jsx +295 -0
  27. package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationFormHeader.jsx +27 -0
  28. package/admin/src/pages/App/components/paymentActions/preauthorization/PreauthorizationPaymentButtons.jsx +53 -0
  29. package/admin/src/pages/App/components/transaction-history/FiltersPanel.jsx +182 -0
  30. package/admin/src/pages/App/components/transaction-history/HistoryPanel.jsx +49 -0
  31. package/admin/src/pages/App/components/transaction-history/TransactionTable.jsx +169 -0
  32. package/admin/src/pages/App/components/transaction-history/TransactionTablePagination.jsx +28 -0
  33. package/admin/src/pages/App/components/transaction-history/details/TransactionDetails.jsx +155 -0
  34. package/admin/src/pages/App/index.jsx +5 -29
  35. package/admin/src/pages/hooks/usePaymentActions.js +87 -11
  36. package/admin/src/pages/hooks/useSettings.js +64 -22
  37. package/admin/src/pages/hooks/useTransactionHistory.js +100 -88
  38. package/admin/src/pages/utils/api.js +31 -3
  39. package/admin/src/pages/utils/countryLanguageUtils.js +236 -0
  40. package/admin/src/pages/utils/transactionTableUtils.js +60 -0
  41. package/package.json +1 -1
  42. package/server/bootstrap.js +6 -6
  43. package/server/controllers/payone.js +27 -3
  44. package/server/policies/index.js +2 -1
  45. package/server/policies/is-payone-notification.js +31 -0
  46. package/server/routes/index.js +10 -0
  47. package/server/services/payone.js +11 -4
  48. package/server/services/settingsService.js +8 -2
  49. package/server/services/testConnectionService.js +11 -72
  50. package/server/services/transactionService.js +58 -78
  51. package/server/services/transactionStatusService.js +87 -0
  52. package/admin/src/pages/App/components/ConfigurationPanel.jsx +0 -517
  53. package/admin/src/pages/App/components/CustomerInfoPopover.jsx +0 -147
  54. package/admin/src/pages/App/components/HistoryPanel.jsx +0 -94
  55. package/admin/src/pages/App/components/PaymentActionsPanel.jsx +0 -280
  56. package/admin/src/pages/App/components/RawDataPopover.jsx +0 -113
  57. package/admin/src/pages/App/components/TransactionHistoryItem.jsx +0 -522
  58. package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTableFilters.jsx +0 -113
  59. package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTablePagination.jsx +0 -180
  60. package/admin/src/pages/App/components/TransactionHistoryTable/index.jsx +0 -225
  61. package/admin/src/pages/App/components/paymentActions/AuthorizationForm.jsx +0 -197
  62. package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.jsx +0 -142
@@ -1,5 +1,14 @@
1
1
  import React from "react";
2
- import { Box, Flex, Typography, Select, Option, Checkbox, Stack } from "@strapi/design-system";
2
+ import {
3
+ Box,
4
+ Flex,
5
+ Typography,
6
+ Select,
7
+ Option,
8
+ Checkbox,
9
+ Stack,
10
+ } from "@strapi/design-system";
11
+ import InfoTooltip from "../common/InfoTooltip";
3
12
  import {
4
13
  APPLE_PAY_SUPPORTED_COUNTRIES,
5
14
  APPLE_PAY_SUPPORTED_NETWORKS,
@@ -8,14 +17,10 @@ import {
8
17
  getSupportedNetworksForCountry,
9
18
  APPLE_PAY_BUTTON_STYLES,
10
19
  APPLE_PAY_BUTTON_TYPES,
11
- DEFAULT_APPLE_PAY_CONFIG
12
- } from "../../utils/applePayConstants";
20
+ DEFAULT_APPLE_PAY_CONFIG,
21
+ } from "../../../utils/applePayConstants";
13
22
 
14
- const ApplePayConfig = ({
15
- config,
16
- onConfigChange,
17
- settings
18
- }) => {
23
+ const ApplePayConfig = ({ config, onConfigChange, settings }) => {
19
24
  const {
20
25
  countryCode = DEFAULT_APPLE_PAY_CONFIG.countryCode,
21
26
  currencyCode = DEFAULT_APPLE_PAY_CONFIG.currencyCode,
@@ -26,16 +31,17 @@ const ApplePayConfig = ({
26
31
  } = config || {};
27
32
 
28
33
  const supportedCurrencies = getSupportedCurrenciesForCountry(countryCode);
29
- const supportedNetworksForCountry = getSupportedNetworksForCountry(countryCode);
34
+ const supportedNetworksForCountry =
35
+ getSupportedNetworksForCountry(countryCode);
30
36
 
31
37
  const handleCountryChange = (value) => {
32
38
  const newConfig = {
33
39
  ...config,
34
- countryCode: value
40
+ countryCode: value,
35
41
  };
36
42
 
37
43
  const newSupportedCurrencies = getSupportedCurrenciesForCountry(value);
38
- if (!newSupportedCurrencies.find(c => c.code === currencyCode)) {
44
+ if (!newSupportedCurrencies.find((c) => c.code === currencyCode)) {
39
45
  newConfig.currencyCode = newSupportedCurrencies[0]?.code || "USD";
40
46
  }
41
47
 
@@ -47,31 +53,31 @@ const ApplePayConfig = ({
47
53
  const handleCurrencyChange = (value) => {
48
54
  onConfigChange({
49
55
  ...config,
50
- currencyCode: value
56
+ currencyCode: value,
51
57
  });
52
58
  };
53
59
 
54
60
  const handleNetworkToggle = (networkCode) => {
55
61
  const currentNetworks = supportedNetworks || [];
56
62
  const newNetworks = currentNetworks.includes(networkCode)
57
- ? currentNetworks.filter(n => n !== networkCode)
63
+ ? currentNetworks.filter((n) => n !== networkCode)
58
64
  : [...currentNetworks, networkCode];
59
65
 
60
66
  onConfigChange({
61
67
  ...config,
62
- supportedNetworks: newNetworks
68
+ supportedNetworks: newNetworks,
63
69
  });
64
70
  };
65
71
 
66
72
  const handleCapabilityToggle = (capabilityCode) => {
67
73
  const currentCapabilities = merchantCapabilities || [];
68
74
  const newCapabilities = currentCapabilities.includes(capabilityCode)
69
- ? currentCapabilities.filter(c => c !== capabilityCode)
75
+ ? currentCapabilities.filter((c) => c !== capabilityCode)
70
76
  : [...currentCapabilities, capabilityCode];
71
77
 
72
78
  onConfigChange({
73
79
  ...config,
74
- merchantCapabilities: newCapabilities
80
+ merchantCapabilities: newCapabilities,
75
81
  });
76
82
  };
77
83
 
@@ -79,7 +85,12 @@ const ApplePayConfig = ({
79
85
  <Box>
80
86
  <Stack spacing={6}>
81
87
  <Box>
82
- <Typography variant="delta" as="h3" fontWeight="bold" style={{ marginBottom: "6px" }}>
88
+ <Typography
89
+ variant="delta"
90
+ as="h3"
91
+ fontWeight="bold"
92
+ style={{ marginBottom: "6px" }}
93
+ >
83
94
  Apple Pay Configuration
84
95
  </Typography>
85
96
  <Typography variant="pi" textColor="neutral600">
@@ -95,10 +106,16 @@ const ApplePayConfig = ({
95
106
  name="countryCode"
96
107
  value={countryCode}
97
108
  onChange={handleCountryChange}
98
- hint="Select the country where your business operates"
99
109
  required
110
+ labelAction={
111
+ <InfoTooltip
112
+ label="Country Code"
113
+ description="Select the country where your business operates"
114
+ id="countryCode-tooltip"
115
+ />
116
+ }
100
117
  >
101
- {APPLE_PAY_SUPPORTED_COUNTRIES.map(country => (
118
+ {APPLE_PAY_SUPPORTED_COUNTRIES.map((country) => (
102
119
  <Option key={country.code} value={country.code}>
103
120
  {country.name} ({country.code})
104
121
  </Option>
@@ -112,18 +129,29 @@ const ApplePayConfig = ({
112
129
  name="currencyCode"
113
130
  value={currencyCode}
114
131
  onChange={handleCurrencyChange}
115
- hint={`Supported currencies for ${countryCode}`}
116
132
  required
133
+ labelAction={
134
+ <InfoTooltip
135
+ label="Currency Code"
136
+ description={`Supported currencies for ${countryCode}. Should match the selected country.`}
137
+ id="currencyCode-tooltip"
138
+ />
139
+ }
117
140
  >
118
- {supportedCurrencies.map(currency => (
141
+ {supportedCurrencies.map((currency) => (
119
142
  <Option key={currency.code} value={currency.code}>
120
143
  {currency.name} ({currency.code}) {currency.symbol}
121
144
  </Option>
122
145
  ))}
123
146
  </Select>
124
147
  {supportedCurrencies.length === 0 && (
125
- <Typography variant="pi" textColor="danger600" style={{ marginTop: "4px" }}>
126
- No supported currencies for this country. Please select a different country.
148
+ <Typography
149
+ variant="pi"
150
+ textColor="danger600"
151
+ style={{ marginTop: "4px" }}
152
+ >
153
+ No supported currencies for this country. Please select a
154
+ different country.
127
155
  </Typography>
128
156
  )}
129
157
  </Box>
@@ -136,10 +164,18 @@ const ApplePayConfig = ({
136
164
  label="Button Style"
137
165
  name="buttonStyle"
138
166
  value={buttonStyle}
139
- onChange={(value) => onConfigChange({ ...config, buttonStyle: value })}
140
- hint="Visual style of the Apple Pay button"
167
+ onChange={(value) =>
168
+ onConfigChange({ ...config, buttonStyle: value })
169
+ }
170
+ labelAction={
171
+ <InfoTooltip
172
+ label="Button Style"
173
+ description="Visual style of the Apple Pay button (e.g., black, white, white-outline)"
174
+ id="buttonStyle-tooltip"
175
+ />
176
+ }
141
177
  >
142
- {APPLE_PAY_BUTTON_STYLES.map(style => (
178
+ {APPLE_PAY_BUTTON_STYLES.map((style) => (
143
179
  <Option key={style.code} value={style.code}>
144
180
  {style.name}
145
181
  </Option>
@@ -152,10 +188,18 @@ const ApplePayConfig = ({
152
188
  label="Button Type"
153
189
  name="buttonType"
154
190
  value={buttonType}
155
- onChange={(value) => onConfigChange({ ...config, buttonType: value })}
156
- hint="Type of action the button represents"
191
+ onChange={(value) =>
192
+ onConfigChange({ ...config, buttonType: value })
193
+ }
194
+ labelAction={
195
+ <InfoTooltip
196
+ label="Button Type"
197
+ description="Type of action the button represents (e.g., buy, donate, plain)"
198
+ id="buttonType-tooltip"
199
+ />
200
+ }
157
201
  >
158
- {APPLE_PAY_BUTTON_TYPES.map(type => (
202
+ {APPLE_PAY_BUTTON_TYPES.map((type) => (
159
203
  <Option key={type.code} value={type.code}>
160
204
  {type.name}
161
205
  </Option>
@@ -166,29 +210,45 @@ const ApplePayConfig = ({
166
210
 
167
211
  {/* Supported Networks */}
168
212
  <Box>
169
- <Typography variant="pi" fontWeight="semiBold" style={{ marginLeft: "2px" }}>
213
+ <Typography
214
+ variant="pi"
215
+ fontWeight="semiBold"
216
+ style={{ marginLeft: "2px" }}
217
+ >
170
218
  Supported Networks
171
219
  </Typography>
172
- <Typography variant="pi" textColor="neutral600" style={{ marginLeft: "2px" }}>
220
+ <Typography
221
+ variant="pi"
222
+ textColor="neutral600"
223
+ style={{ marginLeft: "2px" }}
224
+ >
173
225
  Select payment networks supported in {countryCode}
174
226
  </Typography>
175
227
  <Flex wrap="wrap" gap={4} style={{ marginTop: "12px" }}>
176
- {APPLE_PAY_SUPPORTED_NETWORKS.map(network => {
177
- const isSupported = supportedNetworksForCountry.includes(network.code);
228
+ {APPLE_PAY_SUPPORTED_NETWORKS.map((network) => {
229
+ const isSupported = supportedNetworksForCountry.includes(
230
+ network.code
231
+ );
178
232
  const isSelected = supportedNetworks?.includes(network.code);
179
233
 
180
234
  return (
181
- <Box key={network.code} style={{ flex: "0 0 calc(50% - 8px)", minWidth: "250px" }}>
235
+ <Box
236
+ key={network.code}
237
+ style={{ flex: "0 0 calc(50% - 8px)", minWidth: "250px" }}
238
+ >
182
239
  <Checkbox
183
240
  name={`network-${network.code}`}
184
241
  checked={isSelected}
185
242
  onChange={() => handleNetworkToggle(network.code)}
186
243
  disabled={!isSupported}
187
- hint={!isSupported ? `Not supported in ${countryCode}` : undefined}
188
244
  >
189
245
  {network.name} ({network.code})
190
246
  {!isSupported && (
191
- <Typography variant="sigma" textColor="neutral500" style={{ marginLeft: "8px" }}>
247
+ <Typography
248
+ variant="sigma"
249
+ textColor="neutral500"
250
+ style={{ marginLeft: "8px" }}
251
+ >
192
252
  (Not available)
193
253
  </Typography>
194
254
  )}
@@ -198,7 +258,11 @@ const ApplePayConfig = ({
198
258
  })}
199
259
  </Flex>
200
260
  {supportedNetworks?.length === 0 && (
201
- <Typography variant="pi" textColor="danger600" style={{ marginTop: "8px" }}>
261
+ <Typography
262
+ variant="pi"
263
+ textColor="danger600"
264
+ style={{ marginTop: "8px" }}
265
+ >
202
266
  At least one network must be selected
203
267
  </Typography>
204
268
  )}
@@ -206,18 +270,32 @@ const ApplePayConfig = ({
206
270
 
207
271
  {/* Merchant Capabilities */}
208
272
  <Box>
209
- <Typography variant="pi" fontWeight="semiBold" style={{ marginLeft: "2px" }}>
273
+ <Typography
274
+ variant="pi"
275
+ fontWeight="semiBold"
276
+ style={{ marginLeft: "2px" }}
277
+ >
210
278
  Merchant Capabilities
211
279
  </Typography>
212
- <Typography variant="pi" textColor="neutral600" style={{ marginLeft: "2px" }}>
213
- Select payment capabilities. "3D Secure" is required for most payment methods.
280
+ <Typography
281
+ variant="pi"
282
+ textColor="neutral600"
283
+ style={{ marginLeft: "2px" }}
284
+ >
285
+ Select payment capabilities. "3D Secure" is required for most
286
+ payment methods.
214
287
  </Typography>
215
288
  <Flex wrap="wrap" gap={4} style={{ marginTop: "12px" }}>
216
- {APPLE_PAY_MERCHANT_CAPABILITIES.map(capability => {
217
- const isSelected = merchantCapabilities?.includes(capability.code);
289
+ {APPLE_PAY_MERCHANT_CAPABILITIES.map((capability) => {
290
+ const isSelected = merchantCapabilities?.includes(
291
+ capability.code
292
+ );
218
293
 
219
294
  return (
220
- <Box key={capability.code} style={{ flex: "0 0 calc(50% - 8px)", minWidth: "250px" }}>
295
+ <Box
296
+ key={capability.code}
297
+ style={{ flex: "0 0 calc(50% - 8px)", minWidth: "250px" }}
298
+ >
221
299
  <Checkbox
222
300
  name={`capability-${capability.code}`}
223
301
  checked={isSelected}
@@ -230,38 +308,65 @@ const ApplePayConfig = ({
230
308
  })}
231
309
  </Flex>
232
310
  {merchantCapabilities?.length === 0 && (
233
- <Typography variant="pi" textColor="danger600" style={{ marginTop: "8px" }}>
234
- At least one capability must be selected. "supports3DS" is recommended.
311
+ <Typography
312
+ variant="pi"
313
+ textColor="danger600"
314
+ style={{ marginTop: "8px" }}
315
+ >
316
+ At least one capability must be selected. "supports3DS" is
317
+ recommended.
235
318
  </Typography>
236
319
  )}
237
320
  </Box>
238
321
 
239
-
240
322
  {/* Merchant Identifier Info */}
241
323
  <Box>
242
- <Typography variant="pi" fontWeight="semiBold" style={{ marginLeft: "2px" }}>
324
+ <Typography
325
+ variant="pi"
326
+ fontWeight="semiBold"
327
+ style={{ marginLeft: "2px" }}
328
+ >
243
329
  Merchant Identifier
244
330
  </Typography>
245
331
  <Typography variant="pi" textColor="neutral600">
246
332
  {settings?.mid || settings?.portalid
247
333
  ? `Using: ${settings.mid || settings.portalid}`
248
- : "Merchant identifier will be obtained from Payone after domain verification. See documentation for setup instructions."
249
- }
334
+ : "Merchant identifier will be obtained from Payone after domain verification. See documentation for setup instructions."}
250
335
  </Typography>
251
336
  </Box>
252
337
 
253
338
  {/* Domain Verification File Alert */}
254
339
  <Box marginTop={4}>
255
- <Box padding={3} background="warning100" borderRadius="4px" borderColor="warning200" borderWidth="1px" borderStyle="solid">
256
- <Typography variant="pi" fontWeight="bold" textColor="warning700" marginBottom={2}>
257
- ⚠️ Domain Verification File Required {' '}
340
+ <Box
341
+ padding={3}
342
+ background="warning100"
343
+ borderRadius="4px"
344
+ borderColor="warning200"
345
+ borderWidth="1px"
346
+ borderStyle="solid"
347
+ >
348
+ <Typography
349
+ variant="pi"
350
+ fontWeight="bold"
351
+ textColor="warning700"
352
+ marginBottom={2}
353
+ >
354
+ ⚠️ Domain Verification File Required{" "}
258
355
  </Typography>
259
356
  <Typography variant="pi" textColor="neutral700" marginBottom={2}>
260
- <strong>Download the Apple Pay domain verification file</strong> from your Payone merchant portal:
357
+ <strong>Download the Apple Pay domain verification file</strong>{" "}
358
+ from your Payone merchant portal:
261
359
  </Typography>
262
- <Box padding={2} background="neutral0" borderRadius="4px" marginTop={2} marginBottom={2}>
360
+ <Box
361
+ padding={2}
362
+ background="neutral0"
363
+ borderRadius="4px"
364
+ marginTop={2}
365
+ marginBottom={2}
366
+ >
263
367
  <Typography variant="pi" style={{ fontSize: "12px" }}>
264
- <strong>Download URL:</strong> Download the domain verification file from Payone documentation:{" "}
368
+ <strong>Download URL:</strong> Download the domain verification
369
+ file from Payone documentation:{" "}
265
370
  <a
266
371
  href="https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev"
267
372
  target="_blank"
@@ -275,17 +380,41 @@ const ApplePayConfig = ({
275
380
  <Typography variant="pi" textColor="neutral700" marginBottom={2}>
276
381
  <strong>Place the file at:</strong>
277
382
  </Typography>
278
- <Box padding={2} background="neutral0" borderRadius="4px" marginTop={2} marginBottom={2}>
279
- <Typography variant="pi" style={{ fontFamily: "monospace", fontSize: "12px" }}>
280
- <strong>Strapi:</strong> <code>public/.well-known/apple-developer-merchantid-domain-association</code><br />
281
- <strong>Frontend:</strong> <code>public/.well-known/apple-developer-merchantid-domain-association</code>
383
+ <Box
384
+ padding={2}
385
+ background="neutral0"
386
+ borderRadius="4px"
387
+ marginTop={2}
388
+ marginBottom={2}
389
+ >
390
+ <Typography
391
+ variant="pi"
392
+ style={{ fontFamily: "monospace", fontSize: "12px" }}
393
+ >
394
+ <strong>Strapi:</strong>{" "}
395
+ <code>
396
+ public/.well-known/apple-developer-merchantid-domain-association
397
+ </code>
398
+ <br />
399
+ <strong>Frontend:</strong>{" "}
400
+ <code>
401
+ public/.well-known/apple-developer-merchantid-domain-association
402
+ </code>
282
403
  </Typography>
283
404
  </Box>
284
405
  <Typography variant="pi" textColor="neutral700" marginTop={2}>
285
- The file must be accessible at: <code>https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association</code>
406
+ The file must be accessible at:{" "}
407
+ <code>
408
+ https://yourdomain.com/.well-known/apple-developer-merchantid-domain-association
409
+ </code>
286
410
  </Typography>
287
411
  <br />
288
- <Typography variant="pi" fontWeight="bold" textColor="danger600" marginTop={2}>
412
+ <Typography
413
+ variant="pi"
414
+ fontWeight="bold"
415
+ textColor="danger600"
416
+ marginTop={2}
417
+ >
289
418
  Without this file, Apple Pay will NOT work on your domain!
290
419
  </Typography>
291
420
  </Box>
@@ -295,4 +424,4 @@ const ApplePayConfig = ({
295
424
  );
296
425
  };
297
426
 
298
- export default ApplePayConfig;
427
+ export default ApplePayConfig;
@@ -1,70 +1,71 @@
1
- import React, { useState, useEffect } from "react";
2
- import {
3
- Box,
4
- Card,
5
- CardBody,
6
- Flex,
7
- Typography,
8
- Button,
9
- } from "@strapi/design-system";
10
- import { Check } from "@strapi/icons";
11
- import ApplePayConfig from "./ApplePayConfig";
12
-
13
- const ApplePayConfigPanel = ({ settings, onInputChange, isSaving, onSave }) => {
14
- const [applePayConfig, setApplePayConfig] = useState(
15
- settings?.applePayConfig || {}
16
- );
17
-
18
- useEffect(() => {
19
- setApplePayConfig(settings?.applePayConfig || {});
20
- }, [settings?.applePayConfig]);
21
-
22
- return (
23
- <Box
24
- className="payment-container"
25
- paddingTop={8}
26
- paddingBottom={8}
27
- paddingLeft={8}
28
- paddingRight={8}
29
- >
30
- <Flex direction="column" alignItems="stretch" gap={8}>
31
- <Box>
32
- <Card className="payment-card">
33
- <CardBody padding={6}>
34
- <ApplePayConfig
35
- config={applePayConfig}
36
- onConfigChange={(newConfig) => {
37
- setApplePayConfig(newConfig);
38
- onInputChange("applePayConfig", newConfig);
39
- }}
40
- settings={settings}
41
- />
42
- </CardBody>
43
- </Card>
44
- </Box>
45
-
46
- <Box paddingTop={4}>
47
- <Flex direction="row" gap={4} alignItems="center">
48
- <Button
49
- loading={isSaving}
50
- onClick={onSave}
51
- startIcon={<Check />}
52
- size="L"
53
- variant="default"
54
- className="payment-button payment-button-success"
55
- >
56
- Save Apple Pay Configuration
57
- </Button>
58
- <Typography variant="sigma" textColor="neutral600">
59
- Note: Apple Pay configuration is used for Apple Pay payment
60
- requests. Make sure to configure the correct merchant identifier,
61
- supported networks, and capabilities for your region.
62
- </Typography>
63
- </Flex>
64
- </Box>
65
- </Flex>
66
- </Box>
67
- );
68
- };
69
-
70
- export default ApplePayConfigPanel;
1
+ import React, { useState, useEffect } from "react";
2
+ import {
3
+ Box,
4
+ Card,
5
+ CardBody,
6
+ Flex,
7
+ Typography,
8
+ Button,
9
+ } from "@strapi/design-system";
10
+ import { Check } from "@strapi/icons";
11
+ import ApplePayConfig from "./ApplePayConfig";
12
+
13
+ const ApplePayConfigPanel = ({ settings, onInputChange, isSaving, onSave }) => {
14
+ const [applePayConfig, setApplePayConfig] = useState(
15
+ settings?.applePayConfig || {}
16
+ );
17
+
18
+ useEffect(() => {
19
+ setApplePayConfig(settings?.applePayConfig || {});
20
+ }, [settings?.applePayConfig]);
21
+
22
+ return (
23
+ <Box
24
+ className="payment-container"
25
+ paddingTop={8}
26
+ paddingBottom={8}
27
+ paddingLeft={8}
28
+ paddingRight={8}
29
+ >
30
+ <Flex direction="column" alignItems="stretch" gap={8}>
31
+ <Box>
32
+ <Card className="payment-card">
33
+ <CardBody padding={6}>
34
+ <ApplePayConfig
35
+ config={applePayConfig}
36
+ onConfigChange={(newConfig) => {
37
+ setApplePayConfig(newConfig);
38
+ onInputChange("applePayConfig", newConfig);
39
+ }}
40
+ settings={settings}
41
+ />
42
+ </CardBody>
43
+ </Card>
44
+ </Box>
45
+
46
+ <Box paddingTop={4}>
47
+ <Flex direction="row" gap={4} alignItems="center">
48
+ <Button
49
+ loading={isSaving}
50
+ onClick={onSave}
51
+ startIcon={<Check />}
52
+ size="L"
53
+ variant="default"
54
+ className="payment-button payment-button-success"
55
+ >
56
+ Save Apple Pay Configuration
57
+ </Button>
58
+ <Typography variant="sigma" textColor="neutral600">
59
+ Note: Apple Pay configuration is used for Apple Pay payment
60
+ requests. Make sure to configure the correct merchant identifier,
61
+ supported networks, and capabilities for your region.
62
+ </Typography>
63
+ </Flex>
64
+ </Box>
65
+ </Flex>
66
+ </Box>
67
+ );
68
+ };
69
+
70
+ export default ApplePayConfigPanel;
71
+