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,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
-