ouisys-engine 2.1.34 → 2.1.37

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.
@@ -67,6 +67,8 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
67
67
 
68
68
  //ACTION CREATORS
69
69
  function getRedirectUrlAction(_ref) {
70
+ var _this = this;
71
+
70
72
  var extraParams = _ref.extraParams,
71
73
  _ref$autoRedirect = _ref.autoRedirect,
72
74
  autoRedirect = _ref$autoRedirect === void 0 ? false : _ref$autoRedirect,
@@ -115,13 +117,32 @@ function getRedirectUrlAction(_ref) {
115
117
  });
116
118
 
117
119
  if (autoRedirect == true || window.isAutoFraudScreener === true) {
118
- _strategy.tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {
119
- redirect_url: redirectUrl
120
- });
121
-
122
- (0, _timers.setTimeout)(function () {
123
- window.location.href = redirectUrl;
124
- }, 3000);
120
+ if (process.env.NODE_ENV === "production") {
121
+ // Wait for Evina to Check Fraud First
122
+ setInterval(function () {
123
+ console.log("here");
124
+
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
+ }
125
146
  } else {
126
147
  dispatch({
127
148
  type: "GET_REDIRECT_URL",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ouisys-engine",
3
- "version": "2.1.34",
3
+ "version": "2.1.37",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "directories": "dist dev-tools",
@@ -58,6 +58,7 @@ export type ITpay = {
58
58
  hostSlug?:string;
59
59
  tid:string;
60
60
  isAutoFraudScreener: boolean;
61
+ isEvinaSessionChecked: boolean;
61
62
  }
62
63
 
63
64
  namespace NodeJS {
@@ -6,7 +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 { setTimeout } from "timers";
9
+ import { clearInterval, setTimeout } from "timers";
10
10
 
11
11
 
12
12
 
@@ -37,13 +37,29 @@ export function getRedirectUrlAction({extraParams, autoRedirect = false, isGetRe
37
37
 
38
38
 
39
39
  tracker.customEvent('Flow', 'advance-auto', 'redirect-success', {redirect_url:redirectUrl})
40
-
41
40
  if(autoRedirect == true || window.isAutoFraudScreener === true){
42
- tracker.advancedInFlow('tallyman.v1-one-click', 'click-redirect-url', {redirect_url:redirectUrl});
43
41
 
44
- setTimeout(()=>{
45
- window.location.href = redirectUrl;
46
- }, 3000)
42
+ if(process.env.NODE_ENV === "production"){
43
+ // Wait for Evina to Check Fraud First
44
+ setInterval(() => {
45
+ console.log("here")
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
+
61
+
62
+
47
63
  }else{
48
64
  dispatch({
49
65
  type: "GET_REDIRECT_URL",
@@ -212,4 +212,5 @@ export const mockedSubscribeAjaxState : IOneClickFlowReducerState = {
212
212
  //@ts-ignore
213
213
  result: RDS.NothingYet()
214
214
  }
215
- }
215
+ }
216
+