strapi-plugin-payone-provider 5.7.26 → 5.8.26

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 (83) hide show
  1. package/README.md +1191 -1191
  2. package/admin/src/components/Initializer/index.jsx +16 -16
  3. package/admin/src/components/PluginIcon/index.jsx +17 -17
  4. package/admin/src/index.js +57 -57
  5. package/admin/src/pages/App/components/AppHeader.jsx +45 -45
  6. package/admin/src/pages/App/components/AppTabs.jsx +105 -105
  7. package/admin/src/pages/App/components/ApplePayBtn.jsx +355 -355
  8. package/admin/src/pages/App/components/ApplePayConfig.jsx +357 -357
  9. package/admin/src/pages/App/components/DocsPanel.jsx +53 -53
  10. package/admin/src/pages/App/components/RenderInput.jsx +78 -78
  11. package/admin/src/pages/App/components/StatusBadge.jsx +87 -87
  12. package/admin/src/pages/App/components/icons/BankIcon.jsx +10 -10
  13. package/admin/src/pages/App/components/icons/ChevronDownIcon.jsx +9 -9
  14. package/admin/src/pages/App/components/icons/ChevronUpIcon.jsx +9 -9
  15. package/admin/src/pages/App/components/icons/CreditCardIcon.jsx +9 -9
  16. package/admin/src/pages/App/components/icons/ErrorIcon.jsx +10 -10
  17. package/admin/src/pages/App/components/icons/InfoIcon.jsx +9 -9
  18. package/admin/src/pages/App/components/icons/MarkCircle.jsx +19 -19
  19. package/admin/src/pages/App/components/icons/PaymentIcon.jsx +10 -10
  20. package/admin/src/pages/App/components/icons/PendingIcon.jsx +9 -9
  21. package/admin/src/pages/App/components/icons/PersonIcon.jsx +9 -9
  22. package/admin/src/pages/App/components/icons/SuccessIcon.jsx +9 -9
  23. package/admin/src/pages/App/components/icons/WalletIcon.jsx +9 -9
  24. package/admin/src/pages/App/components/icons/index.jsx +12 -12
  25. package/admin/src/pages/App/components/payment-actions/AuthorizationForm.jsx +334 -334
  26. package/admin/src/pages/App/components/payment-actions/CaptureForm.jsx +120 -120
  27. package/admin/src/pages/App/components/payment-actions/PaymentActionsPanel.jsx +183 -183
  28. package/admin/src/pages/App/components/payment-actions/PaymentMethodSelector.jsx +315 -315
  29. package/admin/src/pages/App/components/payment-actions/PaymentResult.jsx +129 -129
  30. package/admin/src/pages/App/components/payment-actions/PreauthorizationForm.jsx +273 -273
  31. package/admin/src/pages/App/components/payment-actions/RefundForm.jsx +114 -114
  32. package/admin/src/pages/App/components/transaction-history/ImportExportBar.jsx +153 -153
  33. package/admin/src/pages/App/components/transaction-history/details/TransactionHistoryItem.jsx +526 -526
  34. package/admin/src/pages/App/index.jsx +96 -96
  35. package/admin/src/pages/App/styles.css +176 -176
  36. package/admin/src/pages/constants/paymentConstants.js +71 -71
  37. package/admin/src/pages/hooks/use-system-theme.js +27 -27
  38. package/admin/src/pages/hooks/usePaymentActions.js +498 -498
  39. package/admin/src/pages/hooks/usePluginTranslations.js +12 -12
  40. package/admin/src/pages/hooks/useSettings.js +183 -183
  41. package/admin/src/pages/hooks/useTransactionHistory.js +148 -148
  42. package/admin/src/pages/utils/api.js +97 -97
  43. package/admin/src/pages/utils/applePayConstants.js +196 -196
  44. package/admin/src/pages/utils/formatTransactionData.js +15 -15
  45. package/admin/src/pages/utils/getInputComponent.jsx +200 -200
  46. package/admin/src/pages/utils/paymentUtils.js +661 -661
  47. package/admin/src/pages/utils/tooltipHelpers.js +18 -18
  48. package/admin/src/pages/utils/transactionTableUtils.js +71 -71
  49. package/admin/src/pluginId.js +9 -9
  50. package/admin/src/translations/de.json +235 -235
  51. package/admin/src/translations/en.json +235 -235
  52. package/admin/src/translations/fr.json +235 -235
  53. package/admin/src/translations/ru.json +235 -235
  54. package/admin/src/utils/prefixPluginTranslations.js +13 -13
  55. package/package.json +45 -45
  56. package/server/bootstrap.js +107 -107
  57. package/server/config/index.js +83 -83
  58. package/server/content-types/index.js +4 -4
  59. package/server/content-types/transactions/index.js +4 -4
  60. package/server/content-types/transactions/schema.json +86 -86
  61. package/server/controllers/index.js +7 -7
  62. package/server/controllers/payone.js +503 -506
  63. package/server/destroy.js +5 -5
  64. package/server/index.js +23 -23
  65. package/server/policies/index.js +7 -7
  66. package/server/policies/is-auth.js +29 -29
  67. package/server/policies/isSuperAdmin.js +20 -20
  68. package/server/register.js +5 -5
  69. package/server/routes/index.js +218 -218
  70. package/server/services/applePayService.js +295 -295
  71. package/server/services/index.js +9 -9
  72. package/server/services/paymentService.js +264 -223
  73. package/server/services/payone.js +78 -78
  74. package/server/services/settingsService.js +59 -59
  75. package/server/services/testConnectionService.js +115 -115
  76. package/server/services/transactionService.js +262 -262
  77. package/server/utils/csvTransactions.js +82 -82
  78. package/server/utils/normalize.js +39 -39
  79. package/server/utils/paymentMethodParams.js +288 -288
  80. package/server/utils/requestBuilder.js +115 -100
  81. package/server/utils/responseParser.js +141 -141
  82. package/strapi-admin.js +4 -4
  83. package/strapi-server.js +3 -3
@@ -1,223 +1,264 @@
1
- "use strict";
2
-
3
- const axios = require("axios");
4
- const { buildClientRequestParams, toFormData } = require("../utils/requestBuilder");
5
- const { addPaymentMethodParams } = require("../utils/paymentMethodParams");
6
- const { parseResponse, extractTxId, requires3DSRedirect, get3DSRedirectUrl } = require("../utils/responseParser");
7
- const { getSettings, validateSettings } = require("./settingsService");
8
- const { logTransaction } = require("./transactionService");
9
-
10
- const POST_GATEWAY_URL = "https://api.pay1.de/post-gateway/";
11
-
12
- const getInvoiceIdObject = (invoiceid) => {
13
- if (!invoiceid || typeof invoiceid !== 'string') {
14
- return null;
15
- }
16
-
17
- const invoiceIdVariants = [
18
- 'invoiceid',
19
- 'invoiceId',
20
- 'invoice_id',
21
- 'invoiceID',
22
- 'InvoiceId',
23
- 'InvoiceID',
24
- 'Invoice_Id',
25
- 'INVOICEID',
26
- 'INVOICE_ID'
27
- ];
28
-
29
- let invoiceIdObject = {}
30
- for (const variant of invoiceIdVariants) {
31
- invoiceIdObject[variant] = invoiceid;
32
- }
33
-
34
- return invoiceIdObject;
35
- };
36
-
37
- const sendRequest = async (strapi, params) => {
38
- try {
39
- const settings = await getSettings(strapi);
40
-
41
- if (!validateSettings(settings)) {
42
- throw new Error("Payone settings not configured");
43
- }
44
-
45
- const requestParams = buildClientRequestParams(settings, params, strapi.log);
46
- const formData = toFormData(requestParams);
47
-
48
- const response = await axios.post(POST_GATEWAY_URL, formData, {
49
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
50
- timeout: 30000
51
- });
52
-
53
- const responseData = parseResponse(response.data, strapi.log);
54
- const errorCode = responseData?.Error?.ErrorCode;
55
- const requires3DSErrorCodes = ["4219", 4219];
56
- const is3DSRequiredError = requires3DSErrorCodes.includes(errorCode);
57
-
58
- if (requires3DSRedirect(responseData) || is3DSRequiredError) {
59
- const redirectUrl = get3DSRedirectUrl(responseData);
60
- responseData.requires3DSRedirect = true;
61
- responseData.redirectUrl = redirectUrl;
62
- responseData.is3DSRequired = is3DSRequiredError;
63
-
64
- }
65
-
66
- const errorMessage = responseData?.Error?.ErrorMessage || null;
67
-
68
- const customerMessage = responseData?.Error?.CustomerMessage || null;
69
-
70
- const status = (responseData?.status || responseData?.Status || "unknown").toUpperCase() || null;
71
-
72
- await logTransaction(strapi, {
73
- txid: extractTxId(responseData) || params.txid || null,
74
- reference: params.reference || null,
75
- status: status,
76
- request_type: params.request,
77
- amount: params.amount || null,
78
- currency: params.currency || "EUR",
79
- raw_request: requestParams,
80
- raw_response: responseData,
81
- error_code: errorCode,
82
- error_message: errorMessage,
83
- customer_message: customerMessage
84
- });
85
-
86
- responseData.errorCode = errorCode;
87
- responseData.errorMessage = errorMessage;
88
- responseData.customerMessage = customerMessage;
89
- responseData.status = status;
90
-
91
- return responseData;
92
- } catch (error) {
93
- strapi.log.error("Payone sendRequest error:", error);
94
- throw error;
95
- }
96
- };
97
-
98
- const preauthorization = async (strapi, params) => {
99
-
100
- const requiredParams = {
101
- request: "preauthorization",
102
- clearingtype: params.clearingtype,
103
- amount: params.amount,
104
- currency: params.currency,
105
- reference: params.reference,
106
- firstname: params.firstname,
107
- lastname: params.lastname,
108
- street: params.street,
109
- zip: params.zip,
110
- city: params.city,
111
- country: params.country,
112
- email: params.email,
113
- narrative_text: params.narrative_text,
114
- ...getInvoiceIdObject(params.invoiceid),
115
- ...params
116
- };
117
-
118
-
119
- const updatedParams = addPaymentMethodParams(requiredParams, strapi.log);
120
- return await sendRequest(strapi, updatedParams);
121
- };
122
-
123
- const authorization = async (strapi, params) => {
124
-
125
- const requiredParams = {
126
- request: "authorization",
127
- clearingtype: params.clearingtype,
128
- reference: params.reference,
129
- firstname: params.firstname,
130
- lastname: params.lastname,
131
- street: params.street,
132
- zip: params.zip,
133
- city: params.city,
134
- country: params.country,
135
- email: params.email,
136
- narrative_text: params.narrative_text,
137
- ...getInvoiceIdObject(params.invoiceid),
138
- ...params
139
- };
140
-
141
- const updatedParams = addPaymentMethodParams(requiredParams, strapi.log);
142
- return await sendRequest(strapi, updatedParams);
143
- };
144
-
145
- const capture = async (strapi, params) => {
146
- if (!params.txid) {
147
- throw new Error("Transaction ID (txid) is required for capture");
148
- }
149
-
150
-
151
- const requiredParams = {
152
- request: "capture",
153
- txid: params.txid,
154
- amount: params.amount || 1000,
155
- currency: params.currency || "EUR",
156
- ...getInvoiceIdObject(params.invoiceid),
157
- ...params
158
- };
159
-
160
- return await sendRequest(strapi, requiredParams);
161
- };
162
-
163
- const refund = async (strapi, params) => {
164
- if (!params.txid) {
165
- throw new Error("Transaction ID (txid) is required for refund");
166
- }
167
-
168
-
169
- const requiredParams = {
170
- request: "refund",
171
- txid: params.txid,
172
- amount: params.amount || 1000,
173
- currency: params.currency || "EUR",
174
- reference: params.reference || `REFUND-${Date.now()}`,
175
- ...getInvoiceIdObject(params.invoiceid),
176
- ...params
177
- };
178
-
179
- return await sendRequest(strapi, requiredParams);
180
- };
181
-
182
- const handle3DSCallback = async (strapi, callbackData, resultType = 'callback') => {
183
- try {
184
- const parsedData = callbackData && Object.keys(callbackData).length > 0
185
- ? parseResponse(callbackData, strapi.log)
186
- : {};
187
-
188
- const txid = extractTxId(parsedData);
189
- const reference = parsedData.reference || parsedData.Reference || null;
190
-
191
- let status;
192
- if (resultType === 'success') {
193
- status = 'APPROVED';
194
- } else if (resultType === 'error') {
195
- status = 'ERROR';
196
- } else if (resultType === 'cancelled') {
197
- status = 'CANCELLED';
198
- } else {
199
- status = parsedData.status || parsedData.Status || 'PENDING';
200
- }
201
-
202
- return {
203
- success: resultType === 'success',
204
- status: status,
205
- txid: txid,
206
- reference: reference,
207
- data: parsedData
208
- };
209
- } catch (error) {
210
- strapi.log.error("3DS callback processing error:", error);
211
- throw error;
212
- }
213
- };
214
-
215
- module.exports = {
216
- sendRequest,
217
- preauthorization,
218
- authorization,
219
- capture,
220
- refund,
221
- handle3DSCallback
222
- };
223
-
1
+ "use strict";
2
+
3
+ const axios = require("axios");
4
+ const { buildClientRequestParams, toFormData, is3dsViable } = require("../utils/requestBuilder");
5
+ const { addPaymentMethodParams } = require("../utils/paymentMethodParams");
6
+ const { parseResponse, extractTxId, requires3DSRedirect, get3DSRedirectUrl } = require("../utils/responseParser");
7
+ const { getSettings, validateSettings } = require("./settingsService");
8
+ const { logTransaction } = require("./transactionService");
9
+
10
+ const POST_GATEWAY_URL = "https://api.pay1.de/post-gateway/";
11
+
12
+ const getInvoiceIdObject = (invoiceid) => {
13
+ if (!invoiceid || typeof invoiceid !== 'string') {
14
+ return null;
15
+ }
16
+
17
+ const invoiceIdVariants = [
18
+ 'invoiceid',
19
+ 'invoiceId',
20
+ 'invoice_id',
21
+ 'invoiceID',
22
+ 'InvoiceId',
23
+ 'InvoiceID',
24
+ 'Invoice_Id',
25
+ 'INVOICEID',
26
+ 'INVOICE_ID'
27
+ ];
28
+
29
+ let invoiceIdObject = {}
30
+ for (const variant of invoiceIdVariants) {
31
+ invoiceIdObject[variant] = invoiceid;
32
+ }
33
+
34
+ return invoiceIdObject;
35
+ };
36
+
37
+ const sendRequest = async (strapi, params) => {
38
+ try {
39
+ const settings = await getSettings(strapi);
40
+ if (!validateSettings(settings)) throw new Error("Payone settings not configured");
41
+
42
+ const requestParams = buildClientRequestParams(settings, params, strapi.log);
43
+
44
+ const formData = toFormData(requestParams);
45
+ const response = await axios.post(POST_GATEWAY_URL, formData, {
46
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
47
+ timeout: 30000
48
+ });
49
+
50
+ const responseData = parseResponse(response.data, strapi.log);
51
+ const errorCode = responseData?.Error?.ErrorCode;
52
+ const requires3DSErrorCodes = ["4219", 4219];
53
+ const is3DSRequiredError = requires3DSErrorCodes.includes(errorCode);
54
+
55
+ if (requires3DSRedirect(responseData) || is3DSRequiredError) {
56
+ const redirectUrl = get3DSRedirectUrl(responseData);
57
+ responseData.requires3DSRedirect = true;
58
+ responseData.redirectUrl = redirectUrl;
59
+ responseData.is3DSRequired = is3DSRequiredError;
60
+ }
61
+
62
+ const errorMessage = responseData?.Error?.ErrorMessage || null;
63
+
64
+ const customerMessage = responseData?.Error?.CustomerMessage || null;
65
+
66
+ const status = (responseData?.status || responseData?.Status || "unknown").toUpperCase() || null;
67
+
68
+ await logTransaction(strapi, {
69
+ txid: extractTxId(responseData) || params.txid || null,
70
+ reference: params.reference || null,
71
+ status: status,
72
+ request_type: params.request,
73
+ amount: params.amount || null,
74
+ currency: params.currency || "EUR",
75
+ raw_request: requestParams,
76
+ raw_response: responseData,
77
+ error_code: errorCode,
78
+ error_message: errorMessage,
79
+ customer_message: customerMessage
80
+ });
81
+
82
+ responseData.errorCode = errorCode;
83
+ responseData.errorMessage = errorMessage;
84
+ responseData.customerMessage = customerMessage;
85
+ responseData.status = status;
86
+
87
+ return responseData;
88
+ } catch (error) {
89
+ strapi.log.error("Payone sendRequest error:", error);
90
+ throw error;
91
+ }
92
+ };
93
+
94
+ const preauthorization = async (strapi, params) => {
95
+ const requestParams = {
96
+ request: "preauthorization",
97
+ clearingtype: params.clearingtype,
98
+ amount: params.amount,
99
+ currency: params.currency,
100
+ reference: params.reference,
101
+ firstname: params.firstname,
102
+ lastname: params.lastname,
103
+ street: params.street,
104
+ zip: params.zip,
105
+ city: params.city,
106
+ country: params.country,
107
+ email: params.email,
108
+ narrative_text: params.narrative_text,
109
+ ...getInvoiceIdObject(params.invoiceid),
110
+ ...params
111
+ };
112
+
113
+ const settings = await getSettings(strapi);
114
+
115
+ // Happnes only when CC-payment and 3DS is enabled and is Pre/Authorization request
116
+ if (is3dsViable(params, settings)) {
117
+ requestParams = await perform3DSCheck(strapi, requestParams);
118
+ if (!requestParams) throw new Error('3DS check failed');
119
+ }
120
+
121
+ requestParams = addPaymentMethodParams(requestParams, strapi.log);
122
+ return await sendRequest(strapi, requestParams);
123
+ };
124
+
125
+ const authorization = async (strapi, params) => {
126
+ let requestParams = {
127
+ request: "authorization",
128
+ clearingtype: params.clearingtype,
129
+ reference: params.reference,
130
+ firstname: params.firstname,
131
+ lastname: params.lastname,
132
+ street: params.street,
133
+ zip: params.zip,
134
+ city: params.city,
135
+ country: params.country,
136
+ email: params.email,
137
+ narrative_text: params.narrative_text,
138
+ ...getInvoiceIdObject(params.invoiceid),
139
+ ...params
140
+ };
141
+
142
+ const settings = await getSettings(strapi);
143
+
144
+ // Happnes only when CC-payment and 3DS is enabled and is Pre/Authorization request
145
+ if (is3dsViable(params, settings)) {
146
+ requestParams = await perform3DSCheck(strapi, requestParams);
147
+ if (!requestParams) throw new Error('3DS check failed');
148
+ }
149
+
150
+ requestParams = addPaymentMethodParams(requestParams, strapi.log);
151
+ return await sendRequest(strapi, requestParams);
152
+ };
153
+
154
+ const capture = async (strapi, params) => {
155
+ if (!params.txid) {
156
+ throw new Error("Transaction ID (txid) is required for capture");
157
+ }
158
+
159
+ const requiredParams = {
160
+ request: "capture",
161
+ txid: params.txid,
162
+ amount: params.amount || 1000,
163
+ currency: params.currency || "EUR",
164
+ ...getInvoiceIdObject(params.invoiceid),
165
+ ...params
166
+ };
167
+
168
+ return await sendRequest(strapi, requiredParams);
169
+ };
170
+
171
+ const refund = async (strapi, params) => {
172
+ if (!params.txid) {
173
+ throw new Error("Transaction ID (txid) is required for refund");
174
+ }
175
+
176
+ const requiredParams = {
177
+ request: "refund",
178
+ txid: params.txid,
179
+ amount: params.amount || 1000,
180
+ currency: params.currency || "EUR",
181
+ reference: params.reference || `REFUND-${Date.now()}`,
182
+ ...getInvoiceIdObject(params.invoiceid),
183
+ ...params
184
+ };
185
+
186
+ return await sendRequest(strapi, requiredParams);
187
+ };
188
+
189
+ /**
190
+ * Performs a 3DS check and returns the modified params
191
+ * The modified params include the pseudocardpan if the 3DS check is valid
192
+ *
193
+ * @param strapi - Strapi instance
194
+ * @param params - Request params
195
+ * @returns The modified params
196
+ */
197
+ const perform3DSCheck = async (strapi, params) => {
198
+ try {
199
+ const result = await sendRequest(strapi, {
200
+ ...params,
201
+ request: "3dscheck",
202
+ exiturl: params.successurl ?? '',
203
+ });
204
+
205
+ if (result?.errorCode || result?.errorMessage || result?.Status === 'Failed' || result?.Status === 'Invalid')
206
+ throw new Error('3DS check failed');
207
+
208
+ const modifiedParams = {
209
+ ...params,
210
+ pseudocardpan: result?.CreditCard?.PseudoCardPan,
211
+ };
212
+
213
+ if (result?.Status === 'Valid') modifiedParams.xid = result?.CreditCard?.ThreeDS?.Xid;
214
+
215
+ return modifiedParams;
216
+ } catch (error) {
217
+ strapi.log.error("3DS check error:", error);
218
+ return null;
219
+ }
220
+ };
221
+
222
+ const handle3DSCallback = async (strapi, callbackData, resultType = 'callback') => {
223
+ try {
224
+ const parsedData = callbackData && Object.keys(callbackData).length > 0
225
+ ? parseResponse(callbackData, strapi.log)
226
+ : {};
227
+
228
+ const txid = extractTxId(parsedData);
229
+ const reference = parsedData.reference || parsedData.Reference || null;
230
+
231
+ let status;
232
+ if (resultType === 'success') {
233
+ status = 'APPROVED';
234
+ } else if (resultType === 'error') {
235
+ status = 'ERROR';
236
+ } else if (resultType === 'cancelled') {
237
+ status = 'CANCELLED';
238
+ } else {
239
+ status = parsedData.status || parsedData.Status || 'PENDING';
240
+ }
241
+
242
+ return {
243
+ success: resultType === 'success',
244
+ status: status,
245
+ txid: txid,
246
+ reference: reference,
247
+ data: parsedData
248
+ };
249
+ } catch (error) {
250
+ strapi.log.error("3DS callback processing error:", error);
251
+ throw error;
252
+ }
253
+ };
254
+
255
+ module.exports = {
256
+ sendRequest,
257
+ preauthorization,
258
+ authorization,
259
+ capture,
260
+ refund,
261
+ handle3DSCallback,
262
+ perform3DSCheck
263
+ };
264
+
@@ -1,78 +1,78 @@
1
- "use strict";
2
-
3
- const settingsService = require("./settingsService");
4
- const transactionService = require("./transactionService");
5
- const paymentService = require("./paymentService");
6
- const testConnectionService = require("./testConnectionService");
7
- const applePayService = require("./applePayService");
8
- const transactionStatusService = require("./transactionStatusService");
9
-
10
- module.exports = ({ strapi }) => ({
11
- // Settings
12
- async getSettings() {
13
- return await settingsService.getSettings(strapi);
14
- },
15
-
16
- async updateSettings(settings) {
17
- return await settingsService.updateSettings(strapi, settings);
18
- },
19
-
20
- async preauthorization(params) {
21
- return await paymentService.preauthorization(strapi, params);
22
- },
23
-
24
- async authorization(params) {
25
- return await paymentService.authorization(strapi, params);
26
- },
27
-
28
- async capture(params) {
29
- return await paymentService.capture(strapi, params);
30
- },
31
-
32
- async refund(params) {
33
- return await paymentService.refund(strapi, params);
34
- },
35
-
36
- // Transaction history
37
- async logTransaction(transactionData) {
38
- return await transactionService.logTransaction(strapi, transactionData);
39
- },
40
-
41
-
42
- async getTransactionHistory({ filters = {}, pagination = {} }) {
43
- return await transactionService.getTransactionHistory(strapi, { filters, pagination });
44
- },
45
-
46
- async getTransactionsForExport({ filters = {}, sort_by, sort_order } = {}) {
47
- return await transactionService.getTransactionsForExport(strapi, { filters, sort_by, sort_order });
48
- },
49
-
50
- async importTransactions(rows) {
51
- return await transactionService.importTransactions(strapi, rows);
52
- },
53
-
54
- // Test connection
55
- async testConnection() {
56
- return await testConnectionService.testConnection(strapi);
57
- },
58
-
59
- // 3D Secure callback handler
60
- async handle3DSCallback(callbackData, resultType) {
61
- return await paymentService.handle3DSCallback(strapi, callbackData, resultType);
62
- },
63
-
64
- // Apple Pay
65
- async validateApplePayMerchant(params) {
66
- return await applePayService.validateApplePayMerchant(strapi, params);
67
- },
68
-
69
- async initializeApplePaySession(params) {
70
- return await applePayService.initializeApplePaySession(strapi, params);
71
- },
72
-
73
- // TransactionStatus Notification
74
- async processTransactionStatus(notificationData) {
75
- return await transactionStatusService.processTransactionStatus(strapi, notificationData);
76
- },
77
-
78
- });
1
+ "use strict";
2
+
3
+ const settingsService = require("./settingsService");
4
+ const transactionService = require("./transactionService");
5
+ const paymentService = require("./paymentService");
6
+ const testConnectionService = require("./testConnectionService");
7
+ const applePayService = require("./applePayService");
8
+ const transactionStatusService = require("./transactionStatusService");
9
+
10
+ module.exports = ({ strapi }) => ({
11
+ // Settings
12
+ async getSettings() {
13
+ return await settingsService.getSettings(strapi);
14
+ },
15
+
16
+ async updateSettings(settings) {
17
+ return await settingsService.updateSettings(strapi, settings);
18
+ },
19
+
20
+ async preauthorization(params) {
21
+ return await paymentService.preauthorization(strapi, params);
22
+ },
23
+
24
+ async authorization(params) {
25
+ return await paymentService.authorization(strapi, params);
26
+ },
27
+
28
+ async capture(params) {
29
+ return await paymentService.capture(strapi, params);
30
+ },
31
+
32
+ async refund(params) {
33
+ return await paymentService.refund(strapi, params);
34
+ },
35
+
36
+ // Transaction history
37
+ async logTransaction(transactionData) {
38
+ return await transactionService.logTransaction(strapi, transactionData);
39
+ },
40
+
41
+
42
+ async getTransactionHistory({ filters = {}, pagination = {} }) {
43
+ return await transactionService.getTransactionHistory(strapi, { filters, pagination });
44
+ },
45
+
46
+ async getTransactionsForExport({ filters = {}, sort_by, sort_order } = {}) {
47
+ return await transactionService.getTransactionsForExport(strapi, { filters, sort_by, sort_order });
48
+ },
49
+
50
+ async importTransactions(rows) {
51
+ return await transactionService.importTransactions(strapi, rows);
52
+ },
53
+
54
+ // Test connection
55
+ async testConnection() {
56
+ return await testConnectionService.testConnection(strapi);
57
+ },
58
+
59
+ // 3D Secure callback handler
60
+ async handle3DSCallback(callbackData, resultType) {
61
+ return await paymentService.handle3DSCallback(strapi, callbackData, resultType);
62
+ },
63
+
64
+ // Apple Pay
65
+ async validateApplePayMerchant(params) {
66
+ return await applePayService.validateApplePayMerchant(strapi, params);
67
+ },
68
+
69
+ async initializeApplePaySession(params) {
70
+ return await applePayService.initializeApplePaySession(strapi, params);
71
+ },
72
+
73
+ // TransactionStatus Notification
74
+ async processTransactionStatus(notificationData) {
75
+ return await transactionStatusService.processTransactionStatus(strapi, notificationData);
76
+ },
77
+
78
+ });