strapi-plugin-payone-provider 1.6.0 → 1.6.1
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/components/Initializer/index.js +16 -0
- package/admin/src/components/PluginIcon/index.js +6 -0
- package/admin/src/pages/App/components/AppHeader.js +55 -0
- package/admin/src/pages/App/components/AppTabs.js +158 -0
- package/admin/src/pages/App/components/ApplePayButton.js +950 -0
- package/admin/src/pages/App/components/ApplePayConfig.js +364 -0
- package/admin/src/pages/App/components/ApplePayConfigPanel.js +81 -0
- package/admin/src/pages/App/components/ConfigurationPanel.js +280 -0
- package/admin/src/pages/App/components/DocsPanel.js +1057 -0
- package/admin/src/pages/App/components/GooglePayConfig.js +217 -0
- package/admin/src/pages/App/components/GooglePayConfigPanel.js +82 -0
- package/admin/src/pages/App/components/GooglePaybutton.js +300 -0
- package/admin/src/pages/App/components/HistoryPanel.js +285 -0
- package/admin/src/pages/App/components/PaymentActionsPanel.js +190 -0
- package/admin/src/pages/App/components/StatusBadge.js +24 -0
- package/admin/src/pages/App/components/TransactionHistoryItem.js +377 -0
- package/admin/src/pages/App/components/icons/BankIcon.js +10 -0
- package/admin/src/pages/App/components/icons/ChevronDownIcon.js +9 -0
- package/admin/src/pages/App/components/icons/ChevronUpIcon.js +9 -0
- package/admin/src/pages/App/components/icons/CreditCardIcon.js +9 -0
- package/admin/src/pages/App/components/icons/ErrorIcon.js +10 -0
- package/admin/src/pages/App/components/icons/InfoIcon.js +9 -0
- package/admin/src/pages/App/components/icons/PaymentIcon.js +10 -0
- package/admin/src/pages/App/components/icons/PendingIcon.js +9 -0
- package/admin/src/pages/App/components/icons/PersonIcon.js +9 -0
- package/admin/src/pages/App/components/icons/SuccessIcon.js +9 -0
- package/admin/src/pages/App/components/icons/WalletIcon.js +9 -0
- package/admin/src/pages/App/components/icons/index.js +11 -0
- package/admin/src/pages/App/components/paymentActions/AuthorizationForm.js +195 -0
- package/admin/src/pages/App/components/paymentActions/CaptureForm.js +65 -0
- package/admin/src/pages/App/components/paymentActions/CardDetailsInput.js +191 -0
- package/admin/src/pages/App/components/paymentActions/PaymentMethodSelector.js +156 -0
- package/admin/src/pages/App/components/paymentActions/PaymentResult.js +148 -0
- package/admin/src/pages/App/components/paymentActions/PreauthorizationForm.js +199 -0
- package/admin/src/pages/App/components/paymentActions/RefundForm.js +90 -0
- package/admin/src/pages/App/index.js +127 -0
- package/admin/src/pages/hooks/usePaymentActions.js +171 -0
- package/package.json +49 -49
- package/server/bootstrap.js +7 -0
- package/server/controllers/payone.js +0 -2
- package/server/services/transactionService.js +28 -0
- package/server/utils/paymentMethodParams.js +1 -7
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import pluginId from "../../pluginId";
|
|
3
|
+
|
|
4
|
+
const Initializer = ({ setPlugin }) => {
|
|
5
|
+
const ref = useRef(setPlugin);
|
|
6
|
+
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (ref.current) {
|
|
9
|
+
ref.current(pluginId);
|
|
10
|
+
}
|
|
11
|
+
}, []);
|
|
12
|
+
|
|
13
|
+
return null;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default Initializer;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HeaderLayout, Box, Typography, Button } from "@strapi/design-system";
|
|
3
|
+
import { Check, ArrowLeft } from "@strapi/icons";
|
|
4
|
+
import { useHistory, useLocation } from "react-router-dom";
|
|
5
|
+
import pluginId from "../../../pluginId";
|
|
6
|
+
|
|
7
|
+
const AppHeader = ({ activeTab, isSaving, onSave }) => {
|
|
8
|
+
const history = useHistory();
|
|
9
|
+
const location = useLocation();
|
|
10
|
+
const isApplePayConfigPage = location.pathname.includes('/apple-pay-config');
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<HeaderLayout
|
|
14
|
+
title={
|
|
15
|
+
<Box>
|
|
16
|
+
<Typography variant="alpha" as="h1" fontWeight="bold" className="payment-title">
|
|
17
|
+
{isApplePayConfigPage ? "Apple Pay Configuration" : "Payone Provider"}
|
|
18
|
+
</Typography>
|
|
19
|
+
<Typography variant="pi" marginTop={2} className="payment-subtitle">
|
|
20
|
+
{isApplePayConfigPage
|
|
21
|
+
? "Configure Apple Pay settings for your payment gateway"
|
|
22
|
+
: "Configure your Payone integration and manage payment transactions"
|
|
23
|
+
}
|
|
24
|
+
</Typography>
|
|
25
|
+
</Box>
|
|
26
|
+
}
|
|
27
|
+
primaryAction={
|
|
28
|
+
isApplePayConfigPage ? (
|
|
29
|
+
<Button
|
|
30
|
+
onClick={() => history.push(`/plugins/${pluginId}`)}
|
|
31
|
+
startIcon={<ArrowLeft />}
|
|
32
|
+
size="L"
|
|
33
|
+
variant="secondary"
|
|
34
|
+
>
|
|
35
|
+
Back to Main
|
|
36
|
+
</Button>
|
|
37
|
+
) : activeTab === 0 ? (
|
|
38
|
+
<Button
|
|
39
|
+
loading={isSaving}
|
|
40
|
+
onClick={onSave}
|
|
41
|
+
startIcon={<Check />}
|
|
42
|
+
size="L"
|
|
43
|
+
variant="default"
|
|
44
|
+
className="payment-button payment-button-success"
|
|
45
|
+
>
|
|
46
|
+
Save Configuration
|
|
47
|
+
</Button>
|
|
48
|
+
) : null
|
|
49
|
+
}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default AppHeader;
|
|
55
|
+
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Tabs, Tab, TabGroup, TabPanels, TabPanel } from "@strapi/design-system";
|
|
3
|
+
import pluginId from "../../../pluginId";
|
|
4
|
+
import ConfigurationPanel from "./ConfigurationPanel";
|
|
5
|
+
import HistoryPanel from "./HistoryPanel";
|
|
6
|
+
import PaymentActionsPanel from "./PaymentActionsPanel";
|
|
7
|
+
import DocsPanel from "./DocsPanel";
|
|
8
|
+
|
|
9
|
+
const AppTabs = ({
|
|
10
|
+
activeTab,
|
|
11
|
+
setActiveTab,
|
|
12
|
+
// Settings props
|
|
13
|
+
settings,
|
|
14
|
+
isSaving,
|
|
15
|
+
isTesting,
|
|
16
|
+
testResult,
|
|
17
|
+
onSave,
|
|
18
|
+
onTestConnection,
|
|
19
|
+
onInputChange,
|
|
20
|
+
// Transaction history props
|
|
21
|
+
filters,
|
|
22
|
+
onFilterChange,
|
|
23
|
+
onFilterApply,
|
|
24
|
+
isLoadingHistory,
|
|
25
|
+
transactionHistory,
|
|
26
|
+
paginatedTransactions,
|
|
27
|
+
currentPage,
|
|
28
|
+
totalPages,
|
|
29
|
+
pageSize,
|
|
30
|
+
onRefresh,
|
|
31
|
+
onPageChange,
|
|
32
|
+
selectedTransaction,
|
|
33
|
+
onTransactionSelect,
|
|
34
|
+
// Payment actions props
|
|
35
|
+
paymentActions,
|
|
36
|
+
history
|
|
37
|
+
}) => {
|
|
38
|
+
const handleNavigateToConfig = (configType = "apple-pay") => {
|
|
39
|
+
if (history) {
|
|
40
|
+
if (configType === "google-pay") {
|
|
41
|
+
history.push(`/plugins/${pluginId}/google-pay-config`);
|
|
42
|
+
} else {
|
|
43
|
+
history.push(`/plugins/${pluginId}/apple-pay-config`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return (
|
|
48
|
+
<TabGroup
|
|
49
|
+
label="Payone Provider Tabs"
|
|
50
|
+
onTabChange={(index) => setActiveTab(index)}
|
|
51
|
+
>
|
|
52
|
+
<Tabs style={{ borderBottom: "2px solid #e8e8ea" }}>
|
|
53
|
+
<Tab
|
|
54
|
+
className={`payment-tab ${activeTab === 0 ? 'payment-tab-active' : ''}`}
|
|
55
|
+
>
|
|
56
|
+
Configuration
|
|
57
|
+
</Tab>
|
|
58
|
+
<Tab
|
|
59
|
+
className={`payment-tab ${activeTab === 1 ? 'payment-tab-active' : ''}`}
|
|
60
|
+
>
|
|
61
|
+
Transaction History
|
|
62
|
+
</Tab>
|
|
63
|
+
<Tab
|
|
64
|
+
className={`payment-tab ${activeTab === 2 ? 'payment-tab-active' : ''}`}
|
|
65
|
+
>
|
|
66
|
+
Payment Actions
|
|
67
|
+
</Tab>
|
|
68
|
+
<Tab
|
|
69
|
+
className={`payment-tab ${activeTab === 3 ? 'payment-tab-active' : ''}`}
|
|
70
|
+
>
|
|
71
|
+
Documentation
|
|
72
|
+
</Tab>
|
|
73
|
+
</Tabs>
|
|
74
|
+
<TabPanels>
|
|
75
|
+
<TabPanel>
|
|
76
|
+
<ConfigurationPanel
|
|
77
|
+
settings={settings}
|
|
78
|
+
isSaving={isSaving}
|
|
79
|
+
isTesting={isTesting}
|
|
80
|
+
testResult={testResult}
|
|
81
|
+
onSave={onSave}
|
|
82
|
+
onTestConnection={onTestConnection}
|
|
83
|
+
onInputChange={onInputChange}
|
|
84
|
+
/>
|
|
85
|
+
</TabPanel>
|
|
86
|
+
|
|
87
|
+
<TabPanel>
|
|
88
|
+
<HistoryPanel
|
|
89
|
+
filters={filters}
|
|
90
|
+
onFilterChange={onFilterChange}
|
|
91
|
+
onFilterApply={onFilterApply}
|
|
92
|
+
isLoadingHistory={isLoadingHistory}
|
|
93
|
+
transactionHistory={transactionHistory}
|
|
94
|
+
paginatedTransactions={paginatedTransactions}
|
|
95
|
+
currentPage={currentPage}
|
|
96
|
+
totalPages={totalPages}
|
|
97
|
+
pageSize={pageSize}
|
|
98
|
+
onRefresh={onRefresh}
|
|
99
|
+
onPageChange={onPageChange}
|
|
100
|
+
selectedTransaction={selectedTransaction}
|
|
101
|
+
onTransactionSelect={onTransactionSelect}
|
|
102
|
+
/>
|
|
103
|
+
</TabPanel>
|
|
104
|
+
|
|
105
|
+
<TabPanel>
|
|
106
|
+
<PaymentActionsPanel
|
|
107
|
+
paymentAmount={paymentActions.paymentAmount}
|
|
108
|
+
setPaymentAmount={paymentActions.setPaymentAmount}
|
|
109
|
+
preauthReference={paymentActions.preauthReference}
|
|
110
|
+
setPreauthReference={paymentActions.setPreauthReference}
|
|
111
|
+
authReference={paymentActions.authReference}
|
|
112
|
+
setAuthReference={paymentActions.setAuthReference}
|
|
113
|
+
captureTxid={paymentActions.captureTxid}
|
|
114
|
+
setCaptureTxid={paymentActions.setCaptureTxid}
|
|
115
|
+
refundTxid={paymentActions.refundTxid}
|
|
116
|
+
setRefundTxid={paymentActions.setRefundTxid}
|
|
117
|
+
refundSequenceNumber={paymentActions.refundSequenceNumber}
|
|
118
|
+
setRefundSequenceNumber={paymentActions.setRefundSequenceNumber}
|
|
119
|
+
refundReference={paymentActions.refundReference}
|
|
120
|
+
setRefundReference={paymentActions.setRefundReference}
|
|
121
|
+
paymentMethod={paymentActions.paymentMethod}
|
|
122
|
+
setPaymentMethod={paymentActions.setPaymentMethod}
|
|
123
|
+
captureMode={paymentActions.captureMode}
|
|
124
|
+
setCaptureMode={paymentActions.setCaptureMode}
|
|
125
|
+
isProcessingPayment={paymentActions.isProcessingPayment}
|
|
126
|
+
paymentError={paymentActions.paymentError}
|
|
127
|
+
paymentResult={paymentActions.paymentResult}
|
|
128
|
+
onPreauthorization={paymentActions.handlePreauthorization}
|
|
129
|
+
onAuthorization={paymentActions.handleAuthorization}
|
|
130
|
+
onCapture={paymentActions.handleCapture}
|
|
131
|
+
onRefund={paymentActions.handleRefund}
|
|
132
|
+
settings={settings}
|
|
133
|
+
googlePayToken={paymentActions.googlePayToken}
|
|
134
|
+
setGooglePayToken={paymentActions.setGooglePayToken}
|
|
135
|
+
applePayToken={paymentActions.applePayToken}
|
|
136
|
+
setApplePayToken={paymentActions.setApplePayToken}
|
|
137
|
+
cardtype={paymentActions.cardtype}
|
|
138
|
+
setCardtype={paymentActions.setCardtype}
|
|
139
|
+
cardpan={paymentActions.cardpan}
|
|
140
|
+
setCardpan={paymentActions.setCardpan}
|
|
141
|
+
cardexpiredate={paymentActions.cardexpiredate}
|
|
142
|
+
setCardexpiredate={paymentActions.setCardexpiredate}
|
|
143
|
+
cardcvc2={paymentActions.cardcvc2}
|
|
144
|
+
setCardcvc2={paymentActions.setCardcvc2}
|
|
145
|
+
onNavigateToConfig={handleNavigateToConfig}
|
|
146
|
+
/>
|
|
147
|
+
</TabPanel>
|
|
148
|
+
|
|
149
|
+
<TabPanel>
|
|
150
|
+
<DocsPanel />
|
|
151
|
+
</TabPanel>
|
|
152
|
+
</TabPanels>
|
|
153
|
+
</TabGroup>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export default AppTabs;
|
|
158
|
+
|