strapi-plugin-payone-provider 4.6.9 → 5.6.9

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