strapi-plugin-payone-provider 5.8.27 → 5.8.28
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/package.json
CHANGED
|
@@ -92,7 +92,7 @@ const sendRequest = async (strapi, params) => {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
const preauthorization = async (strapi, params) => {
|
|
95
|
-
|
|
95
|
+
let requestParams = {
|
|
96
96
|
request: "preauthorization",
|
|
97
97
|
clearingtype: params.clearingtype,
|
|
98
98
|
amount: params.amount,
|
|
@@ -110,14 +110,6 @@ const preauthorization = async (strapi, params) => {
|
|
|
110
110
|
...params
|
|
111
111
|
};
|
|
112
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(requestParams, settings)) {
|
|
117
|
-
requestParams = await perform3DSCheck(strapi, requestParams);
|
|
118
|
-
if (!requestParams) throw new Error('3DS check failed');
|
|
119
|
-
}
|
|
120
|
-
|
|
121
113
|
requestParams = addPaymentMethodParams(requestParams, strapi.log);
|
|
122
114
|
return await sendRequest(strapi, requestParams);
|
|
123
115
|
};
|
|
@@ -139,14 +131,6 @@ const authorization = async (strapi, params) => {
|
|
|
139
131
|
...params
|
|
140
132
|
};
|
|
141
133
|
|
|
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(requestParams, settings)) {
|
|
146
|
-
requestParams = await perform3DSCheck(strapi, requestParams);
|
|
147
|
-
if (!requestParams) throw new Error('3DS check failed');
|
|
148
|
-
}
|
|
149
|
-
|
|
150
134
|
requestParams = addPaymentMethodParams(requestParams, strapi.log);
|
|
151
135
|
return await sendRequest(strapi, requestParams);
|
|
152
136
|
};
|
|
@@ -32,14 +32,15 @@ const buildClientRequestParams = (settings, params, logger = null) => {
|
|
|
32
32
|
requestParams["3dsecure"] = "yes";
|
|
33
33
|
requestParams.ecommercemode = params.ecommercemode || "internet";
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!requestParams.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
const missingUrls = [];
|
|
36
|
+
if (!requestParams.successurl) missingUrls.push("successurl");
|
|
37
|
+
if (!requestParams.errorurl) missingUrls.push("errorurl");
|
|
38
|
+
if (!requestParams.backurl) missingUrls.push("backurl");
|
|
39
|
+
if (missingUrls.length > 0) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
`3DS-eligible credit card request is missing required redirect URLs: ${missingUrls.join(", ")}. ` +
|
|
42
|
+
`These must be supplied by the caller so Payone can redirect the customer back after the issuer challenge.`
|
|
43
|
+
);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
if (logger) {
|