ouisys-engine 4.1.47-alpha.0 → 4.3.0-alpha.0
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/dist/@types/window.d.js +1 -1
- package/dist/api/index.js +728 -1
- package/dist/app/store.js +20 -0
- package/dist/common-types/AppThunk.js +1 -1
- package/dist/common-types/Either.js +1 -1
- package/dist/common-types/IError.js +1 -1
- package/dist/common-types/ITracker.js +3 -1
- package/dist/common-types/IVisitor.js +1 -1
- package/dist/common-types/RemoteDataState.js +135 -1
- package/dist/features/strategies/categories/askMobileNumber.js +388 -0
- package/dist/features/strategies/categories/askOperator.js +313 -0
- package/dist/features/strategies/categories/detectOperatorByIp.js +599 -0
- package/dist/features/strategies/categories/headerEnrichment.js +665 -0
- package/dist/features/strategies/categories/singleFlows/pin.js +1 -0
- package/dist/features/strategies/identifySlice.js +355 -0
- package/dist/features/strategies/pinFlowSlice.js +338 -0
- package/dist/flows/click2smsFlow.js +19 -1
- package/dist/flows/moFlow.js +19 -1
- package/dist/flows/moRedirFlow.js +19 -1
- package/dist/flows/oneClickFlow.js +23 -1
- package/dist/flows/pinFlow.js +23 -1
- package/dist/flows/strategy.js +53 -1
- package/dist/flows/tpayHeFlow.js +23 -0
- package/dist/flows/ussdFlow.js +19 -1
- package/dist/index.js +2 -0
- package/dist/ips/tryGetIPRangeName.js +74 -1
- package/dist/mockServer/browser.js +48 -0
- package/dist/mockServer/handlers.js +22 -0
- package/dist/mockServer/server.js +48 -0
- package/dist/pacman/index.js +108 -1
- package/dist/pacman/queryString.js +45 -1
- package/dist/reducers/click2smsFlow/Click2smsTypes.js +1 -1
- package/dist/reducers/click2smsFlow/IClick2smsConstants.js +1 -1
- package/dist/reducers/click2smsFlow/index.js +183 -1
- package/dist/reducers/click2smsFlow/utils.js +357 -1
- package/dist/reducers/moFlow/IMoConstants.js +1 -1
- package/dist/reducers/moFlow/MoTypes.js +1 -1
- package/dist/reducers/moFlow/index.js +251 -1
- package/dist/reducers/moFlow/utils.js +284 -1
- package/dist/reducers/moRedirFlow/IMoRedirConstants.js +1 -1
- package/dist/reducers/moRedirFlow/MoRedirTypes.js +1 -1
- package/dist/reducers/moRedirFlow/index.js +226 -1
- package/dist/reducers/moRedirFlow/utils.js +186 -1
- package/dist/reducers/oneClickFlow/IOneClickConstants.js +1 -1
- package/dist/reducers/oneClickFlow/OneClickTypes.js +1 -1
- package/dist/reducers/oneClickFlow/index.js +409 -1
- package/dist/reducers/oneClickFlow/utils.js +366 -1
- package/dist/reducers/pinFlow/IPinConstants.js +1 -1
- package/dist/reducers/pinFlow/PinTypes.js +1 -1
- package/dist/reducers/pinFlow/index.js +514 -1
- package/dist/reducers/pinFlow/utils.js +494 -1
- package/dist/reducers/strategy/IStategyActionContants.js +1 -1
- package/dist/reducers/strategy/StrategyTypes.js +1 -1
- package/dist/reducers/strategy/index.js +389 -1
- package/dist/reducers/strategy/strategies/ask_mobile_number.js +403 -1
- package/dist/reducers/strategy/strategies/ask_operator.js +305 -1
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.js +459 -1
- package/dist/reducers/strategy/strategies/header_enrichment.js +783 -1
- package/dist/reducers/strategy/utils.js +702 -1
- package/dist/reducers/tpayHeFlow/ITpayHeConstants.js +1 -0
- package/dist/reducers/tpayHeFlow/TpayHeTypes.js +1 -0
- package/dist/reducers/tpayHeFlow/index.js +331 -0
- package/dist/reducers/tpayHeFlow/utils.js +510 -0
- package/dist/reducers/ussdFlow/IUssdConstants.js +1 -1
- package/dist/reducers/ussdFlow/UssdTypes.js +1 -1
- package/dist/reducers/ussdFlow/index.js +251 -1
- package/dist/reducers/ussdFlow/utils.js +225 -1
- package/dist/store/index.js +177 -1
- package/dist/store/reducers.js +41 -1
- package/dist/test/setup.js +24 -0
- package/dist/test/test-utils.js +51 -0
- package/dist/utilities/handleSubmitNumber.js +59 -1
- package/package.json +2 -2
- package/dist/api/index.d.ts +0 -43
- package/dist/common-types/AppThunk.d.ts +0 -13
- package/dist/common-types/Either.d.ts +0 -8
- package/dist/common-types/IError.d.ts +0 -3
- package/dist/common-types/IOptInFlowName.d.ts +0 -1
- package/dist/common-types/ITracker.d.ts +0 -9
- package/dist/common-types/IVisitor.d.ts +0 -14
- package/dist/common-types/RemoteDataState.d.ts +0 -38
- package/dist/custom-hooks/useOneClickRedirectUrl.d.ts +0 -3
- package/dist/custom-hooks/useOneClickRedirectUrl.js +0 -1
- package/dist/custom-hooks/usePinEntryState.d.ts +0 -8
- package/dist/custom-hooks/usePinEntryState.js +0 -1
- package/dist/custom-hooks/useStrategyConfig.d.ts +0 -4
- package/dist/custom-hooks/useStrategyConfig.js +0 -1
- package/dist/flows/click2smsFlow.d.ts +0 -6
- package/dist/flows/creditCardFlow.d.ts +0 -6
- package/dist/flows/creditCardFlow.js +0 -1
- package/dist/flows/moFlow.d.ts +0 -6
- package/dist/flows/moRedirFlow.d.ts +0 -6
- package/dist/flows/oneClickFlow.d.ts +0 -7
- package/dist/flows/pinFlow.d.ts +0 -7
- package/dist/flows/strategy.d.ts +0 -14
- package/dist/flows/ussdFlow.d.ts +0 -6
- package/dist/index.d.ts +0 -0
- package/dist/ips/tryGetIPRangeName.d.ts +0 -2
- package/dist/jest.config.js +0 -194
- package/dist/pacman/index.d.ts +0 -6
- package/dist/pacman/queryString.d.ts +0 -3
- package/dist/reducers/click2smsFlow/Click2smsTypes.d.ts +0 -76
- package/dist/reducers/click2smsFlow/IClick2smsConstants.d.ts +0 -2
- package/dist/reducers/click2smsFlow/index.d.ts +0 -5
- package/dist/reducers/click2smsFlow/utils.d.ts +0 -4
- package/dist/reducers/creditCardFlow/CreditCardTypes.d.ts +0 -79
- package/dist/reducers/creditCardFlow/CreditCardTypes.js +0 -1
- package/dist/reducers/creditCardFlow/ICreditCardConstants.d.ts +0 -2
- package/dist/reducers/creditCardFlow/ICreditCardConstants.js +0 -1
- package/dist/reducers/creditCardFlow/index.d.ts +0 -5
- package/dist/reducers/creditCardFlow/index.js +0 -1
- package/dist/reducers/creditCardFlow/utils.d.ts +0 -8
- package/dist/reducers/creditCardFlow/utils.js +0 -1
- package/dist/reducers/moFlow/IMoConstants.d.ts +0 -2
- package/dist/reducers/moFlow/MoTypes.d.ts +0 -88
- package/dist/reducers/moFlow/index.d.ts +0 -16
- package/dist/reducers/moFlow/utils.d.ts +0 -12
- package/dist/reducers/moRedirFlow/IMoRedirConstants.d.ts +0 -2
- package/dist/reducers/moRedirFlow/MoRedirTypes.d.ts +0 -64
- package/dist/reducers/moRedirFlow/index.d.ts +0 -14
- package/dist/reducers/moRedirFlow/utils.d.ts +0 -10
- package/dist/reducers/oneClickFlow/IOneClickConstants.d.ts +0 -2
- package/dist/reducers/oneClickFlow/OneClickTypes.d.ts +0 -85
- package/dist/reducers/oneClickFlow/index.d.ts +0 -13
- package/dist/reducers/oneClickFlow/utils.d.ts +0 -16
- package/dist/reducers/pinFlow/IPinConstants.d.ts +0 -2
- package/dist/reducers/pinFlow/PinTypes.d.ts +0 -156
- package/dist/reducers/pinFlow/index.d.ts +0 -19
- package/dist/reducers/pinFlow/utils.d.ts +0 -11
- package/dist/reducers/strategy/IStategyActionContants.d.ts +0 -2
- package/dist/reducers/strategy/StrategyTypes.d.ts +0 -248
- package/dist/reducers/strategy/index.d.ts +0 -13
- package/dist/reducers/strategy/strategies/ask_mobile_number.d.ts +0 -15
- package/dist/reducers/strategy/strategies/ask_operator.d.ts +0 -5
- package/dist/reducers/strategy/strategies/detect_operator_by_ip.d.ts +0 -10
- package/dist/reducers/strategy/strategies/header_enrichment.d.ts +0 -7
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.d.ts +0 -7
- package/dist/reducers/strategy/strategies/injectHeaderEnrichmentScript.js +0 -1
- package/dist/reducers/strategy/utils.d.ts +0 -30
- package/dist/reducers/ussdFlow/IUssdConstants.d.ts +0 -2
- package/dist/reducers/ussdFlow/UssdTypes.d.ts +0 -77
- package/dist/reducers/ussdFlow/index.d.ts +0 -14
- package/dist/reducers/ussdFlow/utils.d.ts +0 -11
- package/dist/store/index.d.ts +0 -14
- package/dist/store/reducers.d.ts +0 -20
- package/dist/utilities/addEmpelloToken.d.ts +0 -4
- package/dist/utilities/addEmpelloToken.js +0 -1
- package/dist/utilities/handleSubmitNumber.d.ts +0 -21
- package/dist/utilities/index.d.ts +0 -14
- package/dist/utilities/index.js +0 -1
- package/dist/utilities/loadScriptInnerHtml.d.ts +0 -2
- package/dist/utilities/loadScriptInnerHtml.js +0 -1
- package/dist/utilities/loadScriptSrc.d.ts +0 -8
- package/dist/utilities/loadScriptSrc.js +0 -1
- package/dist/utilities/replaceUrlParam.d.ts +0 -1
- package/dist/utilities/replaceUrlParam.js +0 -1
- package/dist/utilities/storeMsisdn.d.ts +0 -3
- package/dist/utilities/storeMsisdn.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.symbol");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.symbol.description");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.symbol.iterator");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/es.array.iterator");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.get-own-property-descriptor");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.object.to-string");
|
|
16
|
+
|
|
17
|
+
require("core-js/modules/es.promise");
|
|
18
|
+
|
|
19
|
+
require("core-js/modules/es.string.iterator");
|
|
20
|
+
|
|
21
|
+
require("core-js/modules/es.weak-map");
|
|
22
|
+
|
|
23
|
+
require("core-js/modules/web.dom-collections.iterator");
|
|
24
|
+
|
|
25
|
+
Object.defineProperty(exports, "__esModule", {
|
|
26
|
+
value: true
|
|
27
|
+
});
|
|
28
|
+
exports.loadTpayAction = loadTpayAction;
|
|
29
|
+
exports.confirmTpayAction = confirmTpayAction;
|
|
30
|
+
exports.mockTpayFlow = mockTpayFlow;
|
|
31
|
+
exports.default = TpayHeFlowReducer;
|
|
32
|
+
exports.TpayHeFlowFlowActionMaps = void 0;
|
|
33
|
+
|
|
34
|
+
require("regenerator-runtime/runtime");
|
|
35
|
+
|
|
36
|
+
var RDS = _interopRequireWildcard(require("../../common-types/RemoteDataState"));
|
|
37
|
+
|
|
38
|
+
var _utils = require("./utils");
|
|
39
|
+
|
|
40
|
+
var _strategy = require("../strategy");
|
|
41
|
+
|
|
42
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
43
|
+
|
|
44
|
+
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; }
|
|
45
|
+
|
|
46
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
47
|
+
|
|
48
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
49
|
+
|
|
50
|
+
//ACTION CREATORS
|
|
51
|
+
function loadTpayAction(theme, locale) {
|
|
52
|
+
return /*#__PURE__*/function () {
|
|
53
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(dispatch, store) {
|
|
54
|
+
var currentState, config, product_url, result, errorType;
|
|
55
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
56
|
+
while (1) {
|
|
57
|
+
switch (_context.prev = _context.next) {
|
|
58
|
+
case 0:
|
|
59
|
+
currentState = store().strategy.currentState;
|
|
60
|
+
|
|
61
|
+
if (!(currentState.type === "TPAY_HE")) {
|
|
62
|
+
_context.next = 28;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
config = currentState.result.config;
|
|
67
|
+
_context.prev = 3;
|
|
68
|
+
_context.next = 6;
|
|
69
|
+
return (0, _utils.confirmTPayCheck)();
|
|
70
|
+
|
|
71
|
+
case 6:
|
|
72
|
+
product_url = _context.sent;
|
|
73
|
+
|
|
74
|
+
if (!(product_url !== null)) {
|
|
75
|
+
_context.next = 11;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
window.location.href = product_url;
|
|
80
|
+
_context.next = 17;
|
|
81
|
+
break;
|
|
82
|
+
|
|
83
|
+
case 11:
|
|
84
|
+
dispatch({
|
|
85
|
+
type: "LOAD_TPAY_HE",
|
|
86
|
+
payload: {
|
|
87
|
+
type: "LOAD_TPAY_HE",
|
|
88
|
+
result: RDS.Loading()
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
_context.next = 14;
|
|
92
|
+
return (0, _utils.getTpayConfig)(window, config);
|
|
93
|
+
|
|
94
|
+
case 14:
|
|
95
|
+
result = _context.sent;
|
|
96
|
+
|
|
97
|
+
// await addLookUpTpay(result, theme, locale);
|
|
98
|
+
_strategy.tracker.advancedInFlow('tallyman.v1-tpay-he', 'load-tpay-success');
|
|
99
|
+
|
|
100
|
+
dispatch({
|
|
101
|
+
type: "LOAD_TPAY_HE_SUCCESS",
|
|
102
|
+
payload: {
|
|
103
|
+
type: "LOAD_TPAY_HE",
|
|
104
|
+
result: RDS.Success(result)
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
case 17:
|
|
109
|
+
_context.next = 26;
|
|
110
|
+
break;
|
|
111
|
+
|
|
112
|
+
case 19:
|
|
113
|
+
_context.prev = 19;
|
|
114
|
+
_context.t0 = _context["catch"](3);
|
|
115
|
+
console.warn(_context.t0); //@ts-ignore
|
|
116
|
+
|
|
117
|
+
errorType = "AlreadySubscribed" === _context.t0.type ? "AlreadySubscribed" : "NotSupported" === _context.t0.type ? "NotSupported" : "SubscriptionFailed" === _context.t0.type ? "SubscriptionFailed" : "UnknownError";
|
|
118
|
+
|
|
119
|
+
_strategy.tracker.recedeInFlow('tallyman.v1-tpay-he', 'tpay-config-failure', {
|
|
120
|
+
errorType: errorType || 'UnknownError'
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
dispatch({
|
|
124
|
+
type: "LOAD_TPAY_HE",
|
|
125
|
+
payload: {
|
|
126
|
+
type: "LOAD_TPAY_HE",
|
|
127
|
+
result: RDS.Failure({
|
|
128
|
+
errorType: errorType,
|
|
129
|
+
error: _context.t0
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
dispatch({
|
|
134
|
+
type: "IDENTIFY_STRATEGY",
|
|
135
|
+
payload: {
|
|
136
|
+
type: "PIN",
|
|
137
|
+
result: {
|
|
138
|
+
nextAction: "submitMSISDNAction",
|
|
139
|
+
config: config
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
case 26:
|
|
145
|
+
_context.next = 31;
|
|
146
|
+
break;
|
|
147
|
+
|
|
148
|
+
case 28:
|
|
149
|
+
_strategy.tracker.recedeInFlow('tallyman.v1-tpay-he', 'tpay-config-failure', {
|
|
150
|
+
errorType: 'UnknownError'
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
dispatch({
|
|
154
|
+
type: "LOAD_TPAY_HE",
|
|
155
|
+
payload: {
|
|
156
|
+
type: "LOAD_TPAY_HE",
|
|
157
|
+
result: RDS.Failure({
|
|
158
|
+
errorType: "UnexpectedState"
|
|
159
|
+
})
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
throw "Unexpected state";
|
|
163
|
+
|
|
164
|
+
case 31:
|
|
165
|
+
case "end":
|
|
166
|
+
return _context.stop();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}, _callee, null, [[3, 19]]);
|
|
170
|
+
}));
|
|
171
|
+
|
|
172
|
+
return function (_x, _x2) {
|
|
173
|
+
return _ref.apply(this, arguments);
|
|
174
|
+
};
|
|
175
|
+
}();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function confirmTpayAction(locale, redirectUrl) {
|
|
179
|
+
return /*#__PURE__*/function () {
|
|
180
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(dispatch, store) {
|
|
181
|
+
var currentState, tpayConfig, result, errorType;
|
|
182
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
183
|
+
while (1) {
|
|
184
|
+
switch (_context2.prev = _context2.next) {
|
|
185
|
+
case 0:
|
|
186
|
+
_context2.prev = 0;
|
|
187
|
+
dispatch({
|
|
188
|
+
type: "CONFIRM_TPAY_CLICK",
|
|
189
|
+
payload: {
|
|
190
|
+
type: "CONFIRM_TPAY",
|
|
191
|
+
result: RDS.Loading()
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
_strategy.tracker.advancedInFlow('tallyman.v1-tpay-he', 'confirm-tpay-clicked', {});
|
|
196
|
+
|
|
197
|
+
currentState = store().strategy.currentState;
|
|
198
|
+
|
|
199
|
+
if (!(currentState.type === "TPAY_HE")) {
|
|
200
|
+
_context2.next = 13;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
tpayConfig = store().tpayHeFlow.tpayConfig; //@ts-ignore
|
|
205
|
+
|
|
206
|
+
_context2.next = 8;
|
|
207
|
+
return (0, _utils.confirmTPay)(window, tpayConfig, locale, redirectUrl);
|
|
208
|
+
|
|
209
|
+
case 8:
|
|
210
|
+
result = _context2.sent;
|
|
211
|
+
|
|
212
|
+
_strategy.tracker.advancedInFlow('tallyman.v1-tpay-he', 'confirm-tpay-success', {
|
|
213
|
+
finalUrl: result
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
dispatch({
|
|
217
|
+
type: "CONFIRM_TPAY_CLICK",
|
|
218
|
+
payload: {
|
|
219
|
+
type: "CONFIRM_TPAY",
|
|
220
|
+
result: RDS.Success({
|
|
221
|
+
finalUrl: ""
|
|
222
|
+
})
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
_context2.next = 16;
|
|
226
|
+
break;
|
|
227
|
+
|
|
228
|
+
case 13:
|
|
229
|
+
_strategy.tracker.recedeInFlow('tallyman.v1-tpay-he', 'confirm-tpay-failure', {});
|
|
230
|
+
|
|
231
|
+
dispatch({
|
|
232
|
+
type: "CONFIRM_TPAY_CLICK",
|
|
233
|
+
payload: {
|
|
234
|
+
type: "CONFIRM_TPAY",
|
|
235
|
+
result: RDS.Failure({
|
|
236
|
+
errorType: "UnexpectedState"
|
|
237
|
+
})
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
throw "Unexpected state";
|
|
241
|
+
|
|
242
|
+
case 16:
|
|
243
|
+
_context2.next = 24;
|
|
244
|
+
break;
|
|
245
|
+
|
|
246
|
+
case 18:
|
|
247
|
+
_context2.prev = 18;
|
|
248
|
+
_context2.t0 = _context2["catch"](0);
|
|
249
|
+
console.error(_context2.t0);
|
|
250
|
+
errorType = "AlreadySubscribed" === _context2.t0.type ? "AlreadySubscribed" : "ConfirmError" === _context2.t0.type ? "ConfirmError" : "UnknownError";
|
|
251
|
+
|
|
252
|
+
_strategy.tracker.recedeInFlow('tallyman.v1-tpay-he', 'confirm-tpay', {
|
|
253
|
+
errorType: errorType || 'UnknownError'
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
dispatch({
|
|
257
|
+
type: "CONFIRM_TPAY_CLICK",
|
|
258
|
+
payload: {
|
|
259
|
+
type: "CONFIRM_TPAY",
|
|
260
|
+
result: RDS.Failure({
|
|
261
|
+
errorType: errorType || 'UnknownError'
|
|
262
|
+
})
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
case 24:
|
|
267
|
+
case "end":
|
|
268
|
+
return _context2.stop();
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}, _callee2, null, [[0, 18]]);
|
|
272
|
+
}));
|
|
273
|
+
|
|
274
|
+
return function (_x3, _x4) {
|
|
275
|
+
return _ref2.apply(this, arguments);
|
|
276
|
+
};
|
|
277
|
+
}();
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function mockTpayFlow(mockState) {
|
|
281
|
+
return function (dispatch) {
|
|
282
|
+
if (mockState !== undefined) {
|
|
283
|
+
switch (mockState) {
|
|
284
|
+
case "confirm-state":
|
|
285
|
+
return dispatch({
|
|
286
|
+
type: "MOCK_TPAY_FLOW_STATE",
|
|
287
|
+
payload: _utils.mockedConfirmState.currentState
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
default:
|
|
291
|
+
throw "Mock Flow not supported";
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
var initialState = {
|
|
298
|
+
currentState: {
|
|
299
|
+
type: "LOAD_TPAY_HE",
|
|
300
|
+
result: RDS.NothingYet()
|
|
301
|
+
},
|
|
302
|
+
tpayConfig: null
|
|
303
|
+
};
|
|
304
|
+
var TpayHeFlowFlowActionMaps = {
|
|
305
|
+
loadTpayAction: loadTpayAction
|
|
306
|
+
};
|
|
307
|
+
exports.TpayHeFlowFlowActionMaps = TpayHeFlowFlowActionMaps;
|
|
308
|
+
|
|
309
|
+
function TpayHeFlowReducer() {
|
|
310
|
+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
311
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
312
|
+
|
|
313
|
+
switch (action.type) {
|
|
314
|
+
case "LOAD_TPAY_HE":
|
|
315
|
+
return (0, _strategy.genericHandler)(state, action.payload);
|
|
316
|
+
|
|
317
|
+
case "CONFIRM_TPAY_CLICK":
|
|
318
|
+
//@ts-ignore
|
|
319
|
+
return (0, _strategy.genericHandler)(state, action.payload);
|
|
320
|
+
|
|
321
|
+
case "LOAD_TPAY_HE_SUCCESS":
|
|
322
|
+
return (0, _strategy.genericHandler)(state, action.payload);
|
|
323
|
+
|
|
324
|
+
case "MOCK_TPAY_FLOW_STATE":
|
|
325
|
+
//@ts-ignore
|
|
326
|
+
return handleMockFlow(state, action.payload);
|
|
327
|
+
|
|
328
|
+
default:
|
|
329
|
+
return state;
|
|
330
|
+
}
|
|
331
|
+
}
|