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.
- package/README.md +24 -11
- package/admin/src/components/Initializer/index.jsx +3 -3
- package/admin/src/components/PluginIcon/index.jsx +3 -3
- package/admin/src/index.js +33 -11
- package/admin/src/pages/App/components/AppHeader.jsx +17 -32
- package/admin/src/pages/App/components/AppTabs.jsx +36 -162
- package/admin/src/pages/App/components/ApplePayBtn.jsx +9 -11
- package/admin/src/pages/App/components/ApplePayConfig.jsx +221 -161
- package/admin/src/pages/App/components/ApplePayConfigPanel.jsx +33 -45
- package/admin/src/pages/App/components/DocsPanel.jsx +66 -1726
- package/admin/src/pages/App/components/GooglePayConfig.jsx +136 -169
- package/admin/src/pages/App/components/GooglePayConfigPanel.jsx +37 -55
- package/admin/src/pages/App/components/GooglePaybutton.jsx +101 -43
- package/admin/src/pages/App/components/RenderInput.jsx +94 -0
- package/admin/src/pages/App/components/StatusBadge.jsx +24 -71
- package/admin/src/pages/App/components/configuration/ConfigurationFields.jsx +255 -0
- package/admin/src/pages/App/components/configuration/ConfigurationPanel.jsx +54 -0
- package/admin/src/pages/App/components/configuration/TestConnection.jsx +130 -0
- package/admin/src/pages/App/components/docs/ApplePaySection.jsx +260 -0
- package/admin/src/pages/App/components/docs/BaseUrlSection.jsx +53 -0
- package/admin/src/pages/App/components/docs/CaptureRefundSection.jsx +113 -0
- package/admin/src/pages/App/components/docs/CodeBlock.jsx +59 -0
- package/admin/src/pages/App/components/docs/CreditCardSection.jsx +93 -0
- package/admin/src/pages/App/components/docs/GooglePaySection.jsx +248 -0
- package/admin/src/pages/App/components/docs/PayPalSection.jsx +116 -0
- package/admin/src/pages/App/components/docs/PaymentMethodsSection.jsx +55 -0
- package/admin/src/pages/App/components/docs/TableOfContents.jsx +47 -0
- package/admin/src/pages/App/components/docs/TestCredentialsSection.jsx +304 -0
- package/admin/src/pages/App/components/docs/ThreeDSecureSection.jsx +188 -0
- package/admin/src/pages/App/components/icons/BankIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/ChevronDownIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/ChevronUpIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/CreditCardIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/ErrorIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/InfoIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/MarkCircle.jsx +19 -0
- package/admin/src/pages/App/components/icons/PaymentIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/PendingIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/PersonIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/SuccessIcon.jsx +1 -1
- package/admin/src/pages/App/components/icons/WalletIcon.jsx +1 -1
- package/admin/src/pages/App/components/payment-actions/ApplePayPanel.jsx +51 -0
- package/admin/src/pages/App/components/payment-actions/AuthorizationForm.jsx +341 -0
- package/admin/src/pages/App/components/payment-actions/CaptureForm.jsx +128 -0
- package/admin/src/pages/App/components/{paymentActions → payment-actions}/CardDetailsInput.jsx +77 -72
- package/admin/src/pages/App/components/payment-actions/PaymentActionsPanel.jsx +194 -0
- package/admin/src/pages/App/components/payment-actions/PaymentMethodSelector.jsx +313 -0
- package/admin/src/pages/App/components/payment-actions/PaymentResult.jsx +133 -0
- package/admin/src/pages/App/components/payment-actions/PreauthorizationForm.jsx +280 -0
- package/admin/src/pages/App/components/payment-actions/RefundForm.jsx +121 -0
- package/admin/src/pages/App/components/transaction-history/FiltersPanel.jsx +145 -0
- package/admin/src/pages/App/components/transaction-history/HistoryPanel.jsx +50 -0
- package/admin/src/pages/App/components/transaction-history/TransactionTable.jsx +163 -0
- package/admin/src/pages/App/components/transaction-history/details/TransactionDetails.jsx +156 -0
- package/admin/src/pages/App/components/{TransactionHistoryItem.jsx → transaction-history/details/TransactionHistoryItem.jsx} +16 -28
- package/admin/src/pages/App/index.jsx +27 -70
- package/admin/src/pages/App/styles.css +46 -169
- package/admin/src/pages/constants/paymentConstants.js +52 -16
- package/admin/src/pages/hooks/use-system-theme.js +27 -0
- package/admin/src/pages/hooks/usePaymentActions.js +273 -210
- package/admin/src/pages/hooks/useSettings.js +87 -48
- package/admin/src/pages/hooks/useTransactionHistory.js +105 -108
- package/admin/src/pages/utils/api.js +57 -72
- package/admin/src/pages/utils/applePayConstants.js +2 -28
- package/admin/src/pages/utils/countryLanguageUtils.js +280 -0
- package/admin/src/pages/utils/getInputComponent.jsx +225 -0
- package/admin/src/pages/utils/googlePayConstants.js +2 -9
- package/admin/src/pages/utils/paymentUtils.js +13 -25
- package/admin/src/pages/utils/tooltipHelpers.js +18 -0
- package/admin/src/pages/utils/transactionTableUtils.js +60 -0
- package/package.json +8 -14
- package/server/config/index.js +18 -2
- package/server/controllers/payone.js +80 -31
- package/server/policies/is-auth.js +9 -3
- package/server/policies/isSuperAdmin.js +7 -5
- package/server/services/paymentService.js +6 -22
- package/server/services/payone.js +3 -3
- package/server/services/settingsService.js +13 -3
- package/server/services/testConnectionService.js +11 -73
- package/server/services/transactionService.js +63 -98
- package/server/utils/normalize.js +0 -12
- package/server/utils/paymentMethodParams.js +0 -1
- package/server/utils/responseParser.js +9 -14
- package/strapi-admin.js +3 -1
- package/admin/src/pages/App/components/ConfigurationPanel.jsx +0 -517
- package/admin/src/pages/App/components/CustomerInfoPopover.jsx +0 -147
- package/admin/src/pages/App/components/HistoryPanel.jsx +0 -94
- package/admin/src/pages/App/components/PaymentActionsPanel.jsx +0 -280
- package/admin/src/pages/App/components/RawDataPopover.jsx +0 -113
- package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTableFilters.jsx +0 -113
- package/admin/src/pages/App/components/TransactionHistoryTable/TransactionHistoryTablePagination.jsx +0 -180
- package/admin/src/pages/App/components/TransactionHistoryTable/index.jsx +0 -225
- package/admin/src/pages/App/components/paymentActions/ApplePayPanel.jsx +0 -95
- package/admin/src/pages/App/components/paymentActions/AuthorizationForm.jsx +0 -197
- package/admin/src/pages/App/components/paymentActions/CaptureForm.jsx +0 -65
- package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.jsx +0 -306
- package/admin/src/pages/App/components/paymentActions/PaymentResult.jsx +0 -192
- package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.jsx +0 -142
- package/admin/src/pages/App/components/paymentActions/RefundForm.jsx +0 -90
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
Box,
|
|
4
|
-
Flex,
|
|
5
|
-
Typography,
|
|
6
|
-
TextInput,
|
|
7
|
-
Button,
|
|
8
|
-
} from "@strapi/design-system";
|
|
9
|
-
import { Play } from "@strapi/icons";
|
|
10
|
-
import GooglePayButton from "../GooglePaybutton";
|
|
11
|
-
import CardDetailsInput from "./CardDetailsInput";
|
|
12
|
-
|
|
13
|
-
const PreauthorizationForm = ({
|
|
14
|
-
paymentAmount,
|
|
15
|
-
setPaymentAmount,
|
|
16
|
-
preauthReference,
|
|
17
|
-
setPreauthReference,
|
|
18
|
-
isProcessingPayment,
|
|
19
|
-
onPreauthorization,
|
|
20
|
-
paymentMethod,
|
|
21
|
-
settings,
|
|
22
|
-
setGooglePayToken,
|
|
23
|
-
cardtype,
|
|
24
|
-
setCardtype,
|
|
25
|
-
cardpan,
|
|
26
|
-
setCardpan,
|
|
27
|
-
cardexpiredate,
|
|
28
|
-
setCardexpiredate,
|
|
29
|
-
cardcvc2,
|
|
30
|
-
setCardcvc2,
|
|
31
|
-
isLiveMode = false,
|
|
32
|
-
}) => {
|
|
33
|
-
const handleGooglePayToken = (token, paymentData) => {
|
|
34
|
-
if (!token) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
setGooglePayToken(token);
|
|
38
|
-
onPreauthorization(token);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const handleGooglePayError = (error) => {
|
|
42
|
-
console.error("Google Pay error:", error);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<Flex direction="column" alignItems="stretch" gap={4}>
|
|
47
|
-
<Flex direction="row" gap={2}>
|
|
48
|
-
<Typography
|
|
49
|
-
variant="omega"
|
|
50
|
-
fontWeight="semiBold"
|
|
51
|
-
textColor="neutral800"
|
|
52
|
-
className="payment-form-title"
|
|
53
|
-
>
|
|
54
|
-
Preauthorization
|
|
55
|
-
</Typography>
|
|
56
|
-
<Typography
|
|
57
|
-
variant="pi"
|
|
58
|
-
textColor="neutral600"
|
|
59
|
-
className="payment-form-description"
|
|
60
|
-
>
|
|
61
|
-
Reserve an amount on a credit card without capturing it immediately.
|
|
62
|
-
</Typography>
|
|
63
|
-
</Flex>
|
|
64
|
-
|
|
65
|
-
<Flex gap={4} wrap="wrap">
|
|
66
|
-
<TextInput
|
|
67
|
-
label="Amount (in cents) *"
|
|
68
|
-
name="paymentAmount"
|
|
69
|
-
value={paymentAmount}
|
|
70
|
-
onChange={(e) => setPaymentAmount(e.target.value)}
|
|
71
|
-
placeholder="Enter amount (e.g., 1000 for €10.00)"
|
|
72
|
-
hint="Amount in cents (e.g., 1000 = €10.00)"
|
|
73
|
-
required
|
|
74
|
-
className="payment-input"
|
|
75
|
-
style={{ flex: 1, minWidth: "250px" }}
|
|
76
|
-
/>
|
|
77
|
-
|
|
78
|
-
<TextInput
|
|
79
|
-
label="Reference *"
|
|
80
|
-
name="preauthReference"
|
|
81
|
-
value={preauthReference}
|
|
82
|
-
onChange={(e) => setPreauthReference(e.target.value)}
|
|
83
|
-
placeholder="Auto-generated if empty"
|
|
84
|
-
hint="Reference will be auto-generated if left empty"
|
|
85
|
-
className="payment-input"
|
|
86
|
-
style={{ flex: 1, minWidth: "250px" }}
|
|
87
|
-
/>
|
|
88
|
-
</Flex>
|
|
89
|
-
|
|
90
|
-
{paymentMethod === "cc" && settings?.enable3DSecure && (
|
|
91
|
-
<Box marginTop={4}>
|
|
92
|
-
<CardDetailsInput
|
|
93
|
-
cardtype={cardtype}
|
|
94
|
-
setCardtype={setCardtype}
|
|
95
|
-
cardpan={cardpan}
|
|
96
|
-
setCardpan={setCardpan}
|
|
97
|
-
cardexpiredate={cardexpiredate}
|
|
98
|
-
setCardexpiredate={setCardexpiredate}
|
|
99
|
-
cardcvc2={cardcvc2}
|
|
100
|
-
setCardcvc2={setCardcvc2}
|
|
101
|
-
/>
|
|
102
|
-
</Box>
|
|
103
|
-
)}
|
|
104
|
-
|
|
105
|
-
{paymentMethod === "gpp" ? (
|
|
106
|
-
<GooglePayButton
|
|
107
|
-
amount={paymentAmount}
|
|
108
|
-
currency="EUR"
|
|
109
|
-
onTokenReceived={handleGooglePayToken}
|
|
110
|
-
onError={handleGooglePayError}
|
|
111
|
-
settings={settings}
|
|
112
|
-
/>
|
|
113
|
-
) : paymentMethod === "apl" ? (
|
|
114
|
-
<Box>
|
|
115
|
-
<Typography variant="pi" textColor="neutral600">
|
|
116
|
-
Apple Pay is only supported for Authorization, not Preauthorization.
|
|
117
|
-
</Typography>
|
|
118
|
-
</Box>
|
|
119
|
-
) : (
|
|
120
|
-
<Button
|
|
121
|
-
variant="default"
|
|
122
|
-
onClick={onPreauthorization}
|
|
123
|
-
loading={isProcessingPayment}
|
|
124
|
-
startIcon={<Play />}
|
|
125
|
-
style={{ maxWidth: "200px" }}
|
|
126
|
-
className="payment-button payment-button-primary"
|
|
127
|
-
disabled={
|
|
128
|
-
!paymentAmount.trim() ||
|
|
129
|
-
(paymentMethod === "cc" &&
|
|
130
|
-
settings?.enable3DSecure !== false &&
|
|
131
|
-
(!cardtype || !cardpan || !cardexpiredate || !cardcvc2)) ||
|
|
132
|
-
isLiveMode
|
|
133
|
-
}
|
|
134
|
-
>
|
|
135
|
-
Process Preauthorization
|
|
136
|
-
</Button>
|
|
137
|
-
)}
|
|
138
|
-
</Flex>
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export default PreauthorizationForm;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box, Flex, Typography, TextInput, Button } from "@strapi/design-system";
|
|
3
|
-
import { Play } from "@strapi/icons";
|
|
4
|
-
|
|
5
|
-
const RefundForm = ({
|
|
6
|
-
paymentAmount,
|
|
7
|
-
setPaymentAmount,
|
|
8
|
-
refundTxid,
|
|
9
|
-
setRefundTxid,
|
|
10
|
-
refundSequenceNumber,
|
|
11
|
-
setRefundSequenceNumber,
|
|
12
|
-
refundReference,
|
|
13
|
-
setRefundReference,
|
|
14
|
-
isProcessingPayment,
|
|
15
|
-
onRefund
|
|
16
|
-
}) => {
|
|
17
|
-
return (
|
|
18
|
-
<Flex direction="column" alignItems="stretch" gap={4}>
|
|
19
|
-
<Flex direction="row" gap={2}>
|
|
20
|
-
<Typography variant="omega" fontWeight="semiBold" textColor="neutral800" className="payment-form-title">
|
|
21
|
-
Refund
|
|
22
|
-
</Typography>
|
|
23
|
-
<Typography variant="pi" textColor="neutral600" className="payment-form-description">
|
|
24
|
-
Refund a previously captured amount.
|
|
25
|
-
</Typography>
|
|
26
|
-
</Flex>
|
|
27
|
-
|
|
28
|
-
<Flex gap={4} wrap="wrap">
|
|
29
|
-
<TextInput
|
|
30
|
-
label="Transaction ID"
|
|
31
|
-
name="refundTxid"
|
|
32
|
-
value={refundTxid}
|
|
33
|
-
onChange={(e) => setRefundTxid(e.target.value)}
|
|
34
|
-
placeholder="Enter TxId from capture"
|
|
35
|
-
hint="Transaction ID from a previous capture"
|
|
36
|
-
className="payment-input"
|
|
37
|
-
style={{ flex: 1, minWidth: "200px" }}
|
|
38
|
-
/>
|
|
39
|
-
|
|
40
|
-
<TextInput
|
|
41
|
-
label="Sequence Number"
|
|
42
|
-
name="refundSequenceNumber"
|
|
43
|
-
value={refundSequenceNumber}
|
|
44
|
-
onChange={(e) => setRefundSequenceNumber(e.target.value)}
|
|
45
|
-
placeholder="2"
|
|
46
|
-
hint="Sequence number for this refund (1-127) and by default for first 2"
|
|
47
|
-
className="payment-input"
|
|
48
|
-
style={{ flex: 1, minWidth: "200px" }}
|
|
49
|
-
/>
|
|
50
|
-
|
|
51
|
-
<TextInput
|
|
52
|
-
label="Amount (in cents)"
|
|
53
|
-
name="refundAmount"
|
|
54
|
-
value={paymentAmount}
|
|
55
|
-
onChange={(e) => setPaymentAmount(e.target.value)}
|
|
56
|
-
placeholder="1000"
|
|
57
|
-
hint="Amount in cents to refund (will be negative)"
|
|
58
|
-
className="payment-input"
|
|
59
|
-
style={{ flex: 1, minWidth: "200px" }}
|
|
60
|
-
/>
|
|
61
|
-
|
|
62
|
-
<TextInput
|
|
63
|
-
label="Reference"
|
|
64
|
-
name="refundReference"
|
|
65
|
-
value={refundReference}
|
|
66
|
-
onChange={(e) => setRefundReference(e.target.value)}
|
|
67
|
-
placeholder="Optional reference"
|
|
68
|
-
hint="Optional reference for this refund"
|
|
69
|
-
className="payment-input"
|
|
70
|
-
style={{ flex: 1, minWidth: "200px" }}
|
|
71
|
-
/>
|
|
72
|
-
</Flex>
|
|
73
|
-
|
|
74
|
-
<Button
|
|
75
|
-
variant="default"
|
|
76
|
-
onClick={onRefund}
|
|
77
|
-
loading={isProcessingPayment}
|
|
78
|
-
startIcon={<Play />}
|
|
79
|
-
style={{ maxWidth: '200px' }}
|
|
80
|
-
className="payment-button payment-button-primary"
|
|
81
|
-
disabled={!refundTxid.trim() || !paymentAmount.trim()}
|
|
82
|
-
>
|
|
83
|
-
Process Refund
|
|
84
|
-
</Button>
|
|
85
|
-
</Flex>
|
|
86
|
-
);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export default RefundForm;
|
|
90
|
-
|