strapi-plugin-payone-provider 1.6.1 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/index.js +2 -0
- package/admin/src/pages/App/components/ApplePayBtn.jsx +15 -13
- package/admin/src/pages/App/components/PaymentActionsPanel.jsx +68 -17
- package/admin/src/pages/App/components/paymentActions/AuthorizationForm.jsx +4 -12
- package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.jsx +163 -86
- package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.jsx +21 -11
- package/admin/src/pages/App/index.jsx +15 -7
- package/admin/src/pages/hooks/usePaymentActions.js +0 -172
- package/admin/src/pages/utils/injectApplePayScript.js +34 -0
- package/admin/src/pages/utils/paymentUtils.js +2 -2
- package/package.json +2 -1
- package/server/bootstrap.js +0 -19
- package/server/services/transactionService.js +0 -28
- package/admin/src/components/Initializer/index.js +0 -16
- package/admin/src/components/PluginIcon/index.js +0 -6
- package/admin/src/pages/App/components/AppHeader.js +0 -55
- package/admin/src/pages/App/components/AppTabs.js +0 -158
- package/admin/src/pages/App/components/ApplePayButton.js +0 -950
- package/admin/src/pages/App/components/ApplePayButton.jsx +0 -908
- package/admin/src/pages/App/components/ApplePayConfig.js +0 -364
- package/admin/src/pages/App/components/ApplePayConfigPanel.js +0 -81
- package/admin/src/pages/App/components/ConfigurationPanel.js +0 -280
- package/admin/src/pages/App/components/DocsPanel.js +0 -1057
- package/admin/src/pages/App/components/GooglePayConfig.js +0 -217
- package/admin/src/pages/App/components/GooglePayConfigPanel.js +0 -82
- package/admin/src/pages/App/components/GooglePaybutton.js +0 -300
- package/admin/src/pages/App/components/HistoryPanel.js +0 -285
- package/admin/src/pages/App/components/PaymentActionsPanel.js +0 -190
- package/admin/src/pages/App/components/StatusBadge.js +0 -24
- package/admin/src/pages/App/components/TransactionHistoryItem.js +0 -377
- package/admin/src/pages/App/components/icons/BankIcon.js +0 -10
- package/admin/src/pages/App/components/icons/ChevronDownIcon.js +0 -9
- package/admin/src/pages/App/components/icons/ChevronUpIcon.js +0 -9
- package/admin/src/pages/App/components/icons/CreditCardIcon.js +0 -9
- package/admin/src/pages/App/components/icons/ErrorIcon.js +0 -10
- package/admin/src/pages/App/components/icons/InfoIcon.js +0 -9
- package/admin/src/pages/App/components/icons/PaymentIcon.js +0 -10
- package/admin/src/pages/App/components/icons/PendingIcon.js +0 -9
- package/admin/src/pages/App/components/icons/PersonIcon.js +0 -9
- package/admin/src/pages/App/components/icons/SuccessIcon.js +0 -9
- package/admin/src/pages/App/components/icons/WalletIcon.js +0 -9
- package/admin/src/pages/App/components/icons/index.js +0 -11
- package/admin/src/pages/App/components/paymentActions/AuthorizationForm.js +0 -195
- package/admin/src/pages/App/components/paymentActions/CaptureForm.js +0 -65
- package/admin/src/pages/App/components/paymentActions/CardDetailsInput.js +0 -191
- package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.js +0 -156
- package/admin/src/pages/App/components/paymentActions/PaymentResult.js +0 -148
- package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.js +0 -199
- package/admin/src/pages/App/components/paymentActions/RefundForm.js +0 -90
- package/admin/src/pages/App/index.js +0 -127
package/admin/src/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import pluginId from "./pluginId";
|
|
|
3
3
|
import Initializer from "./components/Initializer/index.jsx";
|
|
4
4
|
import PluginIcon from "./components/PluginIcon/index.jsx";
|
|
5
5
|
import { injectGooglePayScript } from "./pages/utils/injectGooglePayScript";
|
|
6
|
+
import { injectApplePayScript } from "./pages/utils/injectApplePayScript";
|
|
6
7
|
|
|
7
8
|
const name = pluginPkg.strapi.name;
|
|
8
9
|
|
|
@@ -32,6 +33,7 @@ export default {
|
|
|
32
33
|
|
|
33
34
|
bootstrap(app) {
|
|
34
35
|
injectGooglePayScript();
|
|
36
|
+
injectApplePayScript();
|
|
35
37
|
},
|
|
36
38
|
|
|
37
39
|
async registerTrads() {
|
|
@@ -224,8 +224,8 @@ const ApplePayBtn = ({
|
|
|
224
224
|
session.begin();
|
|
225
225
|
};
|
|
226
226
|
|
|
227
|
-
const mode = (settings?.mode ||
|
|
228
|
-
const isLiveMode = mode ===
|
|
227
|
+
const mode = (settings?.mode || "test").toLowerCase();
|
|
228
|
+
const isLiveMode = mode === "live";
|
|
229
229
|
|
|
230
230
|
if (!settings?.mid) {
|
|
231
231
|
return (
|
|
@@ -245,15 +245,19 @@ const ApplePayBtn = ({
|
|
|
245
245
|
if (!isLiveMode) {
|
|
246
246
|
return (
|
|
247
247
|
<Box>
|
|
248
|
-
<Alert
|
|
248
|
+
<Alert
|
|
249
|
+
closeLabel="Close"
|
|
250
|
+
title=" Apple Pay Only Works in Live Mode"
|
|
251
|
+
variant="danger"
|
|
252
|
+
>
|
|
249
253
|
<Typography variant="pi" marginTop={2}>
|
|
250
|
-
<strong>Apple Pay is only supported in live mode.</strong> According
|
|
254
|
+
<strong>Apple Pay is only supported in live mode.</strong> According
|
|
255
|
+
to Payone documentation, test mode support will be available at a
|
|
256
|
+
later time.
|
|
251
257
|
</Typography>
|
|
252
|
-
<Typography variant="pi"
|
|
253
|
-
Please switch to <strong>live mode</strong> in plugin settings to
|
|
254
|
-
|
|
255
|
-
<Typography variant="pi" marginTop={2} fontWeight="bold" textColor="danger600">
|
|
256
|
-
⚠️ Apple Pay will NOT work in test mode!
|
|
258
|
+
<Typography variant="pi" style={{ marginLeft: "8px" }}>
|
|
259
|
+
Please switch to <strong>live mode</strong> in plugin settings to
|
|
260
|
+
use Apple Pay.
|
|
257
261
|
</Typography>
|
|
258
262
|
</Alert>
|
|
259
263
|
</Box>
|
|
@@ -284,11 +288,9 @@ const ApplePayBtn = ({
|
|
|
284
288
|
onClick={handleApplePayClick}
|
|
285
289
|
buttonStyle={nativeButtonStyle}
|
|
286
290
|
type={nativeButtonType}
|
|
287
|
-
style={{
|
|
288
|
-
width: "100%",
|
|
289
|
-
borderRadius: "8px",
|
|
290
|
-
}}
|
|
291
|
+
style={{ width: "220px", height: "40px" }}
|
|
291
292
|
/>
|
|
293
|
+
<br /> <br />
|
|
292
294
|
<Typography
|
|
293
295
|
variant="pi"
|
|
294
296
|
textColor="neutral600"
|
|
@@ -51,6 +51,72 @@ const PaymentActionsPanel = ({
|
|
|
51
51
|
const mode = (settings?.mode || "test").toLowerCase();
|
|
52
52
|
const isLiveMode = mode === "live";
|
|
53
53
|
|
|
54
|
+
if (isLiveMode) {
|
|
55
|
+
return (
|
|
56
|
+
<Box
|
|
57
|
+
style={{
|
|
58
|
+
display: "flex",
|
|
59
|
+
flexDirection: "column",
|
|
60
|
+
alignItems: "flex-start",
|
|
61
|
+
gap: "16px",
|
|
62
|
+
marginTop: "24px",
|
|
63
|
+
width: "100%",
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
<Typography
|
|
67
|
+
variant="pi"
|
|
68
|
+
textColor="danger600"
|
|
69
|
+
style={{
|
|
70
|
+
fontSize: "14px",
|
|
71
|
+
marginTop: "12px",
|
|
72
|
+
marginBottom: "12px",
|
|
73
|
+
fontWeight: "bold",
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
⚠️ Payment Actions are disabled in live mode for security reasons. but
|
|
77
|
+
you can test apple pay in live mode. For testing other payment
|
|
78
|
+
methods, please use test mode.
|
|
79
|
+
</Typography>
|
|
80
|
+
|
|
81
|
+
<PaymentMethodSelector
|
|
82
|
+
paymentMethod={paymentMethod}
|
|
83
|
+
setPaymentMethod={setPaymentMethod}
|
|
84
|
+
captureMode={captureMode}
|
|
85
|
+
setCaptureMode={setCaptureMode}
|
|
86
|
+
onNavigateToConfig={onNavigateToConfig}
|
|
87
|
+
settings={settings}
|
|
88
|
+
isLiveMode={isLiveMode}
|
|
89
|
+
/>
|
|
90
|
+
|
|
91
|
+
<hr className="payment-divider" />
|
|
92
|
+
<Box className="payment-form-section">
|
|
93
|
+
<AuthorizationForm
|
|
94
|
+
paymentAmount={paymentAmount}
|
|
95
|
+
setPaymentAmount={setPaymentAmount}
|
|
96
|
+
authReference={authReference}
|
|
97
|
+
setAuthReference={setAuthReference}
|
|
98
|
+
isProcessingPayment={isProcessingPayment}
|
|
99
|
+
onAuthorization={onAuthorization}
|
|
100
|
+
paymentMethod={paymentMethod}
|
|
101
|
+
settings={settings}
|
|
102
|
+
googlePayToken={googlePayToken}
|
|
103
|
+
setGooglePayToken={setGooglePayToken}
|
|
104
|
+
applePayToken={applePayToken}
|
|
105
|
+
setApplePayToken={setApplePayToken}
|
|
106
|
+
cardtype={cardtype}
|
|
107
|
+
setCardtype={setCardtype}
|
|
108
|
+
cardpan={cardpan}
|
|
109
|
+
setCardpan={setCardpan}
|
|
110
|
+
cardexpiredate={cardexpiredate}
|
|
111
|
+
setCardexpiredate={setCardexpiredate}
|
|
112
|
+
cardcvc2={cardcvc2}
|
|
113
|
+
setCardcvc2={setCardcvc2}
|
|
114
|
+
/>
|
|
115
|
+
</Box>
|
|
116
|
+
</Box>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
54
120
|
return (
|
|
55
121
|
<Box
|
|
56
122
|
className="payment-container"
|
|
@@ -85,16 +151,6 @@ const PaymentActionsPanel = ({
|
|
|
85
151
|
Process payments, captures, and refunds with multiple payment
|
|
86
152
|
methods
|
|
87
153
|
</Typography>
|
|
88
|
-
{isLiveMode && (
|
|
89
|
-
<Typography
|
|
90
|
-
variant="pi"
|
|
91
|
-
textColor="danger600"
|
|
92
|
-
style={{ fontSize: "14px", marginTop: "8px", fontWeight: "bold" }}
|
|
93
|
-
>
|
|
94
|
-
⚠️ Payment Actions are disabled in live mode for security reasons.
|
|
95
|
-
Please use test mode for testing.
|
|
96
|
-
</Typography>
|
|
97
|
-
)}
|
|
98
154
|
</Box>
|
|
99
155
|
|
|
100
156
|
<PaymentMethodSelector
|
|
@@ -104,6 +160,7 @@ const PaymentActionsPanel = ({
|
|
|
104
160
|
setCaptureMode={setCaptureMode}
|
|
105
161
|
onNavigateToConfig={onNavigateToConfig}
|
|
106
162
|
settings={settings}
|
|
163
|
+
isLiveMode={isLiveMode}
|
|
107
164
|
/>
|
|
108
165
|
|
|
109
166
|
<hr className="payment-divider" />
|
|
@@ -142,13 +199,7 @@ const PaymentActionsPanel = ({
|
|
|
142
199
|
|
|
143
200
|
<hr className="payment-divider" />
|
|
144
201
|
|
|
145
|
-
<Box
|
|
146
|
-
className="payment-form-section"
|
|
147
|
-
style={{
|
|
148
|
-
opacity: isLiveMode ? 0.5 : 1,
|
|
149
|
-
pointerEvents: isLiveMode ? "none" : "auto",
|
|
150
|
-
}}
|
|
151
|
-
>
|
|
202
|
+
<Box className="payment-form-section">
|
|
152
203
|
<AuthorizationForm
|
|
153
204
|
paymentAmount={paymentAmount}
|
|
154
205
|
setPaymentAmount={setPaymentAmount}
|
|
@@ -31,7 +31,6 @@ const AuthorizationForm = ({
|
|
|
31
31
|
setCardexpiredate,
|
|
32
32
|
cardcvc2,
|
|
33
33
|
setCardcvc2,
|
|
34
|
-
isLiveMode = false,
|
|
35
34
|
}) => {
|
|
36
35
|
const handleGooglePayToken = (token, paymentData) => {
|
|
37
36
|
if (!token) {
|
|
@@ -42,9 +41,7 @@ const AuthorizationForm = ({
|
|
|
42
41
|
};
|
|
43
42
|
|
|
44
43
|
const handleGooglePayError = (error) => {
|
|
45
|
-
|
|
46
|
-
onError(error);
|
|
47
|
-
}
|
|
44
|
+
console.error("[AuthorizationForm] Google Pay error:", error);
|
|
48
45
|
};
|
|
49
46
|
|
|
50
47
|
const handleApplePayToken = async (token, paymentData) => {
|
|
@@ -62,9 +59,7 @@ const AuthorizationForm = ({
|
|
|
62
59
|
};
|
|
63
60
|
|
|
64
61
|
const handleApplePayError = (error) => {
|
|
65
|
-
|
|
66
|
-
onError(error);
|
|
67
|
-
}
|
|
62
|
+
console.error("[AuthorizationForm] Apple Pay error:", error);
|
|
68
63
|
};
|
|
69
64
|
|
|
70
65
|
return (
|
|
@@ -168,9 +163,7 @@ const AuthorizationForm = ({
|
|
|
168
163
|
loading={isProcessingPayment}
|
|
169
164
|
startIcon={<Play />}
|
|
170
165
|
style={{ maxWidth: "200px" }}
|
|
171
|
-
disabled={
|
|
172
|
-
!paymentAmount.trim() || !authReference.trim() || isLiveMode
|
|
173
|
-
}
|
|
166
|
+
disabled={!paymentAmount.trim() || !authReference.trim()}
|
|
174
167
|
className="payment-button payment-button-primary"
|
|
175
168
|
>
|
|
176
169
|
Process Authorization
|
|
@@ -191,8 +184,7 @@ const AuthorizationForm = ({
|
|
|
191
184
|
(paymentMethod === "cc" &&
|
|
192
185
|
settings?.enable3DSecure !== false &&
|
|
193
186
|
(!cardtype || !cardpan || !cardexpiredate || !cardcvc2)) ||
|
|
194
|
-
(paymentMethod === "apl" && !applePayToken)
|
|
195
|
-
isLiveMode
|
|
187
|
+
(paymentMethod === "apl" && !applePayToken)
|
|
196
188
|
}
|
|
197
189
|
>
|
|
198
190
|
Process Authorization
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
2
|
import {
|
|
3
3
|
Box,
|
|
4
4
|
Flex,
|
|
@@ -22,10 +22,14 @@ const PaymentMethodSelector = ({
|
|
|
22
22
|
captureMode,
|
|
23
23
|
setCaptureMode,
|
|
24
24
|
onNavigateToConfig,
|
|
25
|
-
|
|
25
|
+
isLiveMode,
|
|
26
26
|
}) => {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (isLiveMode && paymentMethod !== "apl") {
|
|
29
|
+
setPaymentMethod("apl");
|
|
30
|
+
}
|
|
31
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
+
}, [isLiveMode]);
|
|
29
33
|
|
|
30
34
|
return (
|
|
31
35
|
<Box>
|
|
@@ -37,7 +41,7 @@ const PaymentMethodSelector = ({
|
|
|
37
41
|
onChange={(value) => setPaymentMethod(value)}
|
|
38
42
|
hint={`Current: ${getPaymentMethodDisplayName(paymentMethod)}`}
|
|
39
43
|
>
|
|
40
|
-
{getPaymentMethodOptions().map((option) => (
|
|
44
|
+
{getPaymentMethodOptions(isLiveMode).map((option) => (
|
|
41
45
|
<Option key={option.value} value={option.value}>
|
|
42
46
|
{option.label}
|
|
43
47
|
</Option>
|
|
@@ -45,96 +49,169 @@ const PaymentMethodSelector = ({
|
|
|
45
49
|
</Select>
|
|
46
50
|
{paymentMethod === "apl" && onNavigateToConfig && (
|
|
47
51
|
<>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
title="⚠️ Important: Middleware Configuration Required"
|
|
51
|
-
variant="warning"
|
|
52
|
+
<Box
|
|
53
|
+
style={{ display: "flex", flexDirection: "column", gap: "16px" }}
|
|
52
54
|
>
|
|
53
|
-
<Typography variant="pi" marginTop={2}>
|
|
54
|
-
<strong>Apple Pay requires middleware configuration</strong> to
|
|
55
|
-
work properly. You must configure Content Security Policy (CSP)
|
|
56
|
-
in <code>config/middlewares.js</code> to allow Apple Pay
|
|
57
|
-
scripts, otherwise Apple Pay will NOT work.
|
|
58
|
-
</Typography>
|
|
59
|
-
<Typography variant="pi" marginTop={2}>
|
|
60
|
-
Required CSP directives for Apple Pay:
|
|
61
|
-
</Typography>
|
|
62
55
|
<Box
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
style={{
|
|
57
|
+
background: "transparent",
|
|
58
|
+
padding: "16px",
|
|
59
|
+
borderRadius: "4px",
|
|
60
|
+
border: "1px solid #eaeaea",
|
|
61
|
+
}}
|
|
67
62
|
>
|
|
68
|
-
<Typography
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
63
|
+
<Typography variant="pi" style={{ lineHeight: "1.6" }}>
|
|
64
|
+
<strong>Apple Pay requires middleware configuration</strong>{" "}
|
|
65
|
+
to work properly. You must configure Content Security Policy
|
|
66
|
+
(CSP) in{" "}
|
|
67
|
+
<code
|
|
68
|
+
style={{
|
|
69
|
+
padding: "2px 6px",
|
|
70
|
+
borderRadius: "3px",
|
|
71
|
+
fontSize: "13px",
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
config/middlewares.js
|
|
75
|
+
</code>{" "}
|
|
76
|
+
to allow Apple Pay scripts.
|
|
79
77
|
</Typography>
|
|
78
|
+
|
|
79
|
+
<Box style={{ marginTop: "16px" }}>
|
|
80
|
+
<Typography
|
|
81
|
+
variant="pi"
|
|
82
|
+
style={{
|
|
83
|
+
fontWeight: "600",
|
|
84
|
+
marginBottom: "8px",
|
|
85
|
+
display: "block",
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
Required CSP directives:
|
|
89
|
+
</Typography>
|
|
90
|
+
|
|
91
|
+
<Box>
|
|
92
|
+
<Typography
|
|
93
|
+
variant="pi"
|
|
94
|
+
style={{
|
|
95
|
+
fontFamily: "monospace",
|
|
96
|
+
fontSize: "12px",
|
|
97
|
+
lineHeight: "1.8",
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
<div>
|
|
101
|
+
'script-src': ['https://applepay.cdn-apple.com',
|
|
102
|
+
'https://www.apple.com']
|
|
103
|
+
</div>
|
|
104
|
+
<div>
|
|
105
|
+
'connect-src': ['https://applepay.cdn-apple.com',
|
|
106
|
+
'https://www.apple.com']
|
|
107
|
+
</div>
|
|
108
|
+
<div>'frame-src': ['https://applepay.cdn-apple.com']</div>
|
|
109
|
+
</Typography>
|
|
110
|
+
</Box>
|
|
111
|
+
</Box>
|
|
112
|
+
|
|
113
|
+
<Box
|
|
114
|
+
padding={2}
|
|
115
|
+
background="warning100"
|
|
116
|
+
style={{
|
|
117
|
+
marginTop: "16px",
|
|
118
|
+
borderRadius: "4px",
|
|
119
|
+
borderLeft: "3px solid #f29d41",
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
<Typography variant="pi" style={{ fontWeight: "600" }}>
|
|
123
|
+
⚠️ Without this configuration, Apple Pay will NOT work!
|
|
124
|
+
</Typography>
|
|
125
|
+
</Box>
|
|
80
126
|
</Box>
|
|
81
|
-
|
|
82
|
-
Without this configuration, Apple Pay will NOT work!
|
|
83
|
-
</Typography>
|
|
84
|
-
</Alert>
|
|
85
|
-
<Alert
|
|
86
|
-
closeLabel="Close"
|
|
87
|
-
title="📥 Apple Pay Domain Verification File Required"
|
|
88
|
-
variant="default"
|
|
89
|
-
>
|
|
90
|
-
<Typography variant="pi" marginTop={2}>
|
|
91
|
-
<strong>Download the Apple Pay domain verification file</strong>{" "}
|
|
92
|
-
from your Payone merchant portal and place it in:
|
|
93
|
-
</Typography>
|
|
127
|
+
|
|
94
128
|
<Box
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
129
|
+
style={{
|
|
130
|
+
background: "transparent",
|
|
131
|
+
padding: "16px",
|
|
132
|
+
borderRadius: "4px",
|
|
133
|
+
border: "1px solid #eaeaea",
|
|
134
|
+
}}
|
|
99
135
|
>
|
|
100
|
-
<Typography
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<strong>Strapi:</strong>{" "}
|
|
105
|
-
<code>
|
|
106
|
-
public/.well-known/apple-developer-merchantid-domain-association
|
|
107
|
-
</code>
|
|
108
|
-
<br />
|
|
109
|
-
<strong>Frontend:</strong>{" "}
|
|
110
|
-
<code>
|
|
111
|
-
public/.well-known/apple-developer-merchantid-domain-association
|
|
112
|
-
</code>
|
|
136
|
+
<Typography variant="pi" style={{ lineHeight: "1.6" }}>
|
|
137
|
+
<strong>Download the domain verification file</strong> from
|
|
138
|
+
your Payone merchant portal and place it in the following
|
|
139
|
+
locations:
|
|
113
140
|
</Typography>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
141
|
+
|
|
142
|
+
<Box>
|
|
143
|
+
<Typography
|
|
144
|
+
variant="pi"
|
|
145
|
+
style={{
|
|
146
|
+
fontFamily: "monospace",
|
|
147
|
+
fontSize: "12px",
|
|
148
|
+
lineHeight: "1.8",
|
|
149
|
+
}}
|
|
150
|
+
>
|
|
151
|
+
<div style={{ marginBottom: "8px" }}>
|
|
152
|
+
<strong>Strapi:</strong>{" "}
|
|
153
|
+
<code>
|
|
154
|
+
public/.well-known/apple-developer-merchantid-domain-association
|
|
155
|
+
</code>
|
|
156
|
+
</div>
|
|
157
|
+
<div>
|
|
158
|
+
<strong>Frontend:</strong>{" "}
|
|
159
|
+
<code>
|
|
160
|
+
public/.well-known/apple-developer-merchantid-domain-association
|
|
161
|
+
</code>
|
|
162
|
+
</div>
|
|
163
|
+
</Typography>
|
|
164
|
+
</Box>
|
|
165
|
+
|
|
166
|
+
<Box style={{ marginTop: "16px" }}>
|
|
167
|
+
<Typography variant="pi" style={{ lineHeight: "1.6" }}>
|
|
168
|
+
<strong>Download URL:</strong> Get the domain verification
|
|
169
|
+
file from Payone documentation:
|
|
170
|
+
</Typography>
|
|
171
|
+
<Box
|
|
172
|
+
padding={2}
|
|
173
|
+
background="primary100"
|
|
174
|
+
style={{ marginTop: "8px", borderRadius: "4px" }}
|
|
175
|
+
>
|
|
176
|
+
<Link
|
|
177
|
+
href="https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev"
|
|
178
|
+
target="_blank"
|
|
179
|
+
rel="noopener noreferrer"
|
|
180
|
+
style={{
|
|
181
|
+
color: "#4945ff",
|
|
182
|
+
textDecoration: "none",
|
|
183
|
+
fontWeight: "500",
|
|
184
|
+
fontSize: "14px",
|
|
185
|
+
}}
|
|
186
|
+
>
|
|
187
|
+
→
|
|
188
|
+
https://docs.payone.com/payment-methods/apple-pay/apple-pay-without-dev
|
|
189
|
+
</Link>
|
|
190
|
+
</Box>
|
|
191
|
+
</Box>
|
|
192
|
+
|
|
193
|
+
<Box
|
|
194
|
+
padding={2}
|
|
195
|
+
background="danger100"
|
|
196
|
+
style={{
|
|
197
|
+
marginTop: "16px",
|
|
198
|
+
borderRadius: "4px",
|
|
199
|
+
borderLeft: "3px solid #d02b20",
|
|
200
|
+
}}
|
|
123
201
|
>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
<Box padding={3} background="neutral100" borderRadius="4px">
|
|
202
|
+
<Typography
|
|
203
|
+
variant="pi"
|
|
204
|
+
textColor="danger600"
|
|
205
|
+
style={{ fontWeight: "600" }}
|
|
206
|
+
>
|
|
207
|
+
⚠️ Without this file, Apple Pay will NOT work on your
|
|
208
|
+
domain!
|
|
209
|
+
</Typography>
|
|
210
|
+
</Box>
|
|
211
|
+
</Box>
|
|
212
|
+
</Box>
|
|
213
|
+
|
|
214
|
+
<Box padding={3} borderRadius="4px">
|
|
138
215
|
<Typography variant="pi" textColor="neutral600">
|
|
139
216
|
Configure Apple Pay settings:{" "}
|
|
140
217
|
<Link
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Flex,
|
|
5
|
+
Typography,
|
|
6
|
+
TextInput,
|
|
7
|
+
Button,
|
|
8
|
+
} from "@strapi/design-system";
|
|
3
9
|
import { Play } from "@strapi/icons";
|
|
4
10
|
import GooglePayButton from "../GooglePaybutton";
|
|
5
11
|
import CardDetailsInput from "./CardDetailsInput";
|
|
@@ -22,7 +28,7 @@ const PreauthorizationForm = ({
|
|
|
22
28
|
setCardexpiredate,
|
|
23
29
|
cardcvc2,
|
|
24
30
|
setCardcvc2,
|
|
25
|
-
isLiveMode = false
|
|
31
|
+
isLiveMode = false,
|
|
26
32
|
}) => {
|
|
27
33
|
const handleGooglePayToken = (token, paymentData) => {
|
|
28
34
|
if (!token) {
|
|
@@ -33,20 +39,25 @@ const PreauthorizationForm = ({
|
|
|
33
39
|
};
|
|
34
40
|
|
|
35
41
|
const handleGooglePayError = (error) => {
|
|
36
|
-
|
|
37
|
-
onError(error);
|
|
38
|
-
}
|
|
42
|
+
console.error("[PreauthorizationForm] Google Pay error:", error);
|
|
39
43
|
};
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
|
|
43
45
|
return (
|
|
44
46
|
<Flex direction="column" alignItems="stretch" gap={4}>
|
|
45
47
|
<Flex direction="row" gap={2}>
|
|
46
|
-
<Typography
|
|
48
|
+
<Typography
|
|
49
|
+
variant="omega"
|
|
50
|
+
fontWeight="semiBold"
|
|
51
|
+
textColor="neutral800"
|
|
52
|
+
className="payment-form-title"
|
|
53
|
+
>
|
|
47
54
|
Preauthorization
|
|
48
55
|
</Typography>
|
|
49
|
-
<Typography
|
|
56
|
+
<Typography
|
|
57
|
+
variant="pi"
|
|
58
|
+
textColor="neutral600"
|
|
59
|
+
className="payment-form-description"
|
|
60
|
+
>
|
|
50
61
|
Reserve an amount on a credit card without capturing it immediately.
|
|
51
62
|
</Typography>
|
|
52
63
|
</Flex>
|
|
@@ -111,7 +122,7 @@ const PreauthorizationForm = ({
|
|
|
111
122
|
onClick={onPreauthorization}
|
|
112
123
|
loading={isProcessingPayment}
|
|
113
124
|
startIcon={<Play />}
|
|
114
|
-
style={{ maxWidth:
|
|
125
|
+
style={{ maxWidth: "200px" }}
|
|
115
126
|
className="payment-button payment-button-primary"
|
|
116
127
|
disabled={
|
|
117
128
|
!paymentAmount.trim() ||
|
|
@@ -129,4 +140,3 @@ const PreauthorizationForm = ({
|
|
|
129
140
|
};
|
|
130
141
|
|
|
131
142
|
export default PreauthorizationForm;
|
|
132
|
-
|
|
@@ -22,17 +22,25 @@ const App = () => {
|
|
|
22
22
|
const paymentActions = usePaymentActions();
|
|
23
23
|
|
|
24
24
|
useEffect(() => {
|
|
25
|
-
if (
|
|
25
|
+
if (
|
|
26
|
+
location.pathname.includes("/apple-pay-config") ||
|
|
27
|
+
location.pathname.includes("/google-pay-config")
|
|
28
|
+
) {
|
|
26
29
|
} else {
|
|
27
|
-
const tabFromPath = location.pathname.includes(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
const tabFromPath = location.pathname.includes("/history")
|
|
31
|
+
? 1
|
|
32
|
+
: location.pathname.includes("/payment-actions")
|
|
33
|
+
? 2
|
|
34
|
+
: location.pathname.includes("/documentation")
|
|
35
|
+
? 3
|
|
36
|
+
: 0;
|
|
30
37
|
setActiveTab(tabFromPath);
|
|
31
38
|
}
|
|
32
39
|
}, [location.pathname]);
|
|
33
40
|
|
|
34
|
-
const isApplePayConfigPage = location.pathname.includes(
|
|
35
|
-
const isGooglePayConfigPage =
|
|
41
|
+
const isApplePayConfigPage = location.pathname.includes("/apple-pay-config");
|
|
42
|
+
const isGooglePayConfigPage =
|
|
43
|
+
location.pathname.includes("/google-pay-config");
|
|
36
44
|
|
|
37
45
|
if (isApplePayConfigPage) {
|
|
38
46
|
return (
|
|
@@ -124,4 +132,4 @@ const App = () => {
|
|
|
124
132
|
);
|
|
125
133
|
};
|
|
126
134
|
|
|
127
|
-
export default App;
|
|
135
|
+
export default App;
|