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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-plugin-payone-provider",
3
- "version": "5.8.27",
3
+ "version": "5.8.28",
4
4
  "description": "Strapi plugin for Payone payment gateway integration",
5
5
  "license": "MIT",
6
6
  "maintainers": [
@@ -92,7 +92,7 @@ const sendRequest = async (strapi, params) => {
92
92
  };
93
93
 
94
94
  const preauthorization = async (strapi, params) => {
95
- const requestParams = {
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
- if (!requestParams.successurl) {
36
- requestParams.successurl = params.successurl || "https://www.example.com/success";
37
- }
38
- if (!requestParams.errorurl) {
39
- requestParams.errorurl = params.errorurl || "https://www.example.com/error";
40
- }
41
- if (!requestParams.backurl) {
42
- requestParams.backurl = params.backurl || "https://www.example.com/back";
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) {