ouisys-engine 2.1.32 → 2.1.35

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.
@@ -49,6 +49,8 @@ var _utils = require("./utils");
49
49
 
50
50
  var _strategy = require("../strategy");
51
51
 
52
+ var _timers = require("timers");
53
+
52
54
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
53
55
 
54
56
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -65,6 +67,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
65
67
 
66
68
  //ACTION CREATORS
67
69
  function getRedirectUrlAction(_ref) {
70
+ var _this = this;
71
+
68
72
  var extraParams = _ref.extraParams,
69
73
  _ref$autoRedirect = _ref.autoRedirect,
70
74
  autoRedirect = _ref$autoRedirect === void 0 ? false : _ref$autoRedirect,
@@ -81,7 +85,7 @@ function getRedirectUrlAction(_ref) {
81
85
  currentState = store().strategy.currentState;
82
86
 
83
87
  if (!(currentState.type === "ONE_CLICK")) {
84
- _context.next = 37;
88
+ _context.next = 38;
85
89
  break;
86
90
  }
87
91
 
@@ -96,7 +100,7 @@ function getRedirectUrlAction(_ref) {
96
100
  });
97
101
 
98
102
  if (!(isGetRedirectBupperWay == true)) {
99
- _context.next = 13;
103
+ _context.next = 14;
100
104
  break;
101
105
  }
102
106
 
@@ -112,12 +116,33 @@ function getRedirectUrlAction(_ref) {
112
116
  redirect_url: redirectUrl
113
117
  });
114
118
 
115
- if (autoRedirect == true) {
116
- _strategy.tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {
117
- redirect_url: redirectUrl
118
- });
119
-
120
- window.location.href = redirectUrl;
119
+ window.isAutoFraudScreener = true;
120
+
121
+ if (autoRedirect == true || window.isAutoFraudScreener === true) {
122
+ if (process.env.NODE_ENV === "production") {
123
+ // Wait for Evina to Check Fraud First
124
+ setInterval(function () {
125
+ if (window.isEvinaSessionChecked) {
126
+ (0, _timers.clearInterval)(_this);
127
+
128
+ _strategy.tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {
129
+ redirect_url: redirectUrl
130
+ });
131
+
132
+ (0, _timers.setTimeout)(function () {
133
+ window.location.href = redirectUrl;
134
+ }, 1000);
135
+ }
136
+ }, 2000);
137
+ } else {
138
+ _strategy.tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {
139
+ redirect_url: redirectUrl
140
+ });
141
+
142
+ (0, _timers.setTimeout)(function () {
143
+ window.location.href = redirectUrl;
144
+ }, 3000);
145
+ }
121
146
  } else {
122
147
  dispatch({
123
148
  type: "GET_REDIRECT_URL",
@@ -130,12 +155,12 @@ function getRedirectUrlAction(_ref) {
130
155
  });
131
156
  }
132
157
 
133
- _context.next = 28;
158
+ _context.next = 29;
134
159
  break;
135
160
 
136
- case 13:
161
+ case 14:
137
162
  if (!(subscription_url && subscription_url != null)) {
138
- _context.next = 17;
163
+ _context.next = 18;
139
164
  break;
140
165
  }
141
166
 
@@ -147,9 +172,9 @@ function getRedirectUrlAction(_ref) {
147
172
  }
148
173
  }));
149
174
 
150
- case 17:
175
+ case 18:
151
176
  if (!(redirect_url && redirect_url != null)) {
152
- _context.next = 22;
177
+ _context.next = 23;
153
178
  break;
154
179
  }
155
180
 
@@ -167,13 +192,13 @@ function getRedirectUrlAction(_ref) {
167
192
  }
168
193
  }));
169
194
 
170
- case 22:
171
- _context.next = 24;
195
+ case 23:
196
+ _context.next = 25;
172
197
  return (0, _utils.getRedirectUrl)(window, config, _objectSpread(_objectSpread({}, currentState.result.operator && {
173
198
  operator: currentState.result.operator
174
199
  }), extraParams));
175
200
 
176
- case 24:
201
+ case 25:
177
202
  _yield$getRedirectUrl = _context.sent;
178
203
  _redirect_url = _yield$getRedirectUrl.redirect_url;
179
204
 
@@ -181,7 +206,7 @@ function getRedirectUrlAction(_ref) {
181
206
  redirect_url: _redirect_url
182
207
  });
183
208
 
184
- if (autoRedirect == true) {
209
+ if (autoRedirect == true || window.isAutoFraudScreener === true) {
185
210
  _strategy.tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {
186
211
  redirect_url: _redirect_url
187
212
  });
@@ -199,12 +224,12 @@ function getRedirectUrlAction(_ref) {
199
224
  });
200
225
  }
201
226
 
202
- case 28:
203
- _context.next = 35;
227
+ case 29:
228
+ _context.next = 36;
204
229
  break;
205
230
 
206
- case 30:
207
- _context.prev = 30;
231
+ case 31:
232
+ _context.prev = 31;
208
233
  _context.t0 = _context["catch"](3);
209
234
  console.warn(_context.t0);
210
235
  console.log("Falling back to bupper");
@@ -221,11 +246,11 @@ function getRedirectUrlAction(_ref) {
221
246
  });
222
247
  }
223
248
 
224
- case 35:
225
- _context.next = 39;
249
+ case 36:
250
+ _context.next = 40;
226
251
  break;
227
252
 
228
- case 37:
253
+ case 38:
229
254
  dispatch({
230
255
  type: "GET_REDIRECT_URL",
231
256
  payload: {
@@ -237,12 +262,12 @@ function getRedirectUrlAction(_ref) {
237
262
  });
238
263
  throw "Unexpected state";
239
264
 
240
- case 39:
265
+ case 40:
241
266
  case "end":
242
267
  return _context.stop();
243
268
  }
244
269
  }
245
- }, _callee, null, [[3, 30]]);
270
+ }, _callee, null, [[3, 31]]);
246
271
  }));
247
272
 
248
273
  return function (_x, _x2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "2.1.32",
3
+ "version": "2.1.35",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",
@@ -57,6 +57,8 @@ export type ITpay = {
57
57
  hostCountry?:string;
58
58
  hostSlug?:string;
59
59
  tid:string;
60
+ isAutoFraudScreener: boolean;
61
+ isEvinaSessionChecked: boolean;
60
62
  }
61
63
 
62
64
  namespace NodeJS {
@@ -6,6 +6,7 @@ import { AppThunk } from "../../common-types/AppThunk";
6
6
  import { getRedirectUrl, getRedirectUrlBupperWay, mockedRedirectUrlSuccessState, mockedSubscribeAjaxState, subscribe } from "./utils";
7
7
  import { genericHandler, tracker } from "../strategy";
8
8
  import { IHash } from "../strategy/StrategyTypes";
9
+ import { clearInterval, setTimeout } from "timers";
9
10
 
10
11
 
11
12
 
@@ -36,11 +37,29 @@ export function getRedirectUrlAction({extraParams, autoRedirect = false, isGetRe
36
37
 
37
38
 
38
39
  tracker.customEvent('Flow', 'advance-auto', 'redirect-success', {redirect_url:redirectUrl})
40
+ window.isAutoFraudScreener = true
41
+ if(autoRedirect == true || window.isAutoFraudScreener === true){
42
+
43
+ if(process.env.NODE_ENV === "production"){
44
+ // Wait for Evina to Check Fraud First
45
+ setInterval(() => {
46
+ if(window.isEvinaSessionChecked){
47
+ clearInterval(this);
48
+ tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {redirect_url:redirectUrl});
49
+ setTimeout(() => {
50
+ window.location.href = redirectUrl;
51
+ }, 1000);
52
+ }
53
+ }, 2000);
54
+ }else{
55
+ tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {redirect_url:redirectUrl});
56
+ setTimeout(() => {
57
+ window.location.href = redirectUrl;
58
+ }, 3000);
59
+ }
60
+
39
61
 
40
- if(autoRedirect == true){
41
- tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {redirect_url:redirectUrl});
42
62
 
43
- window.location.href = redirectUrl;
44
63
  }else{
45
64
  dispatch({
46
65
  type: "GET_REDIRECT_URL",
@@ -83,7 +102,7 @@ export function getRedirectUrlAction({extraParams, autoRedirect = false, isGetRe
83
102
 
84
103
  tracker.customEvent('Flow', 'advance-auto', 'redirect-success', {redirect_url})
85
104
 
86
- if(autoRedirect == true){
105
+ if(autoRedirect == true || window.isAutoFraudScreener === true){
87
106
  tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {redirect_url});
88
107
 
89
108
  window.location.href = redirect_url;
@@ -212,4 +212,5 @@ export const mockedSubscribeAjaxState : IOneClickFlowReducerState = {
212
212
  //@ts-ignore
213
213
  result: RDS.NothingYet()
214
214
  }
215
- }
215
+ }
216
+