ouisys-engine 2.1.27 → 2.1.31
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/reducers/pinFlow/PinTypes.d.ts +1 -1
- package/dist/reducers/pinFlow/index.js +1 -1
- package/dist/reducers/pinFlow/utils.js +19 -14
- package/package.json +1 -1
- package/src/reducers/pinFlow/PinTypes.ts +1 -1
- package/src/reducers/pinFlow/index.ts +2 -5
- package/src/reducers/pinFlow/utils.ts +7 -2
|
@@ -27,7 +27,7 @@ export declare type PINEntrySuccess = {
|
|
|
27
27
|
msisdn?: string;
|
|
28
28
|
isAlreadySubscribed?: boolean;
|
|
29
29
|
};
|
|
30
|
-
export declare type PINEntryErrorTypes = "UnknownError" | "TooEarly" | "InvalidPIN" | "UnexpectedState";
|
|
30
|
+
export declare type PINEntryErrorTypes = "UnknownError" | "TooEarly" | "InvalidPIN" | "UnexpectedState" | "SessionBlocked";
|
|
31
31
|
export declare type IMsisdnSumbitNextData = {
|
|
32
32
|
actualPIN: string;
|
|
33
33
|
nextAction: "submitPinAction";
|
|
@@ -400,7 +400,7 @@ function submitPinAction(msisdn, pin, extraParams) {
|
|
|
400
400
|
_context3.prev = 19;
|
|
401
401
|
_context3.t0 = _context3["catch"](2);
|
|
402
402
|
console.error(_context3.t0);
|
|
403
|
-
errorType =
|
|
403
|
+
errorType = _context3.t0.type || "UnknownError";
|
|
404
404
|
|
|
405
405
|
_strategy.tracker.recedeInFlow('tallyman.v1-pin', 'pin-submission-failure', {
|
|
406
406
|
msisdn: msisdn,
|
|
@@ -393,7 +393,7 @@ function submitPIN(_x16, _x17, _x18, _x19) {
|
|
|
393
393
|
|
|
394
394
|
function _submitPIN() {
|
|
395
395
|
_submitPIN = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(window, pin, config, extraParams) {
|
|
396
|
-
var slug, country, device, host, offer, extraParamsQs, rockmanId, emptyPinError, uniqid, evinaTid, pinResult, pinError, check, checkResult, isAlreadySubscribed, _pinError, _isAlreadySubscribed;
|
|
396
|
+
var slug, country, device, host, offer, extraParamsQs, rockmanId, emptyPinError, uniqid, evinaTid, pinResult, pinErrorTypeMap, errorMessage, pinError, check, checkResult, isAlreadySubscribed, _pinError, _isAlreadySubscribed;
|
|
397
397
|
|
|
398
398
|
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
399
399
|
while (1) {
|
|
@@ -430,17 +430,22 @@ function _submitPIN() {
|
|
|
430
430
|
pinResult = _context6.sent;
|
|
431
431
|
|
|
432
432
|
if (!(false === pinResult.success)) {
|
|
433
|
-
_context6.next =
|
|
433
|
+
_context6.next = 22;
|
|
434
434
|
break;
|
|
435
435
|
}
|
|
436
436
|
|
|
437
|
-
|
|
438
|
-
|
|
437
|
+
pinErrorTypeMap = {
|
|
438
|
+
"pin does not match": "InvalidPIN",
|
|
439
|
+
"mcp blocked": "SessionBlocked"
|
|
440
|
+
};
|
|
441
|
+
errorMessage = pinErrorTypeMap[pinResult.message];
|
|
442
|
+
pinError = new Error("Error in submitMSISDN() verify-pin action:\n".concat(errorMessage));
|
|
443
|
+
pinError['type'] = errorMessage ? errorMessage : "InvalidPIN";
|
|
439
444
|
throw pinError;
|
|
440
445
|
|
|
441
|
-
case
|
|
446
|
+
case 22:
|
|
442
447
|
if (!(true === pinResult.async)) {
|
|
443
|
-
_context6.next =
|
|
448
|
+
_context6.next = 37;
|
|
444
449
|
break;
|
|
445
450
|
}
|
|
446
451
|
|
|
@@ -448,16 +453,16 @@ function _submitPIN() {
|
|
|
448
453
|
return window.tallymanApi.checkSubscription(host, country, slug, device, offer, rockmanId, pin, extraParamsQs);
|
|
449
454
|
};
|
|
450
455
|
|
|
451
|
-
_context6.next =
|
|
456
|
+
_context6.next = 26;
|
|
452
457
|
return (0, _utils.loop)(check, 30, function (r) {
|
|
453
458
|
return r.success;
|
|
454
459
|
}, 0);
|
|
455
460
|
|
|
456
|
-
case
|
|
461
|
+
case 26:
|
|
457
462
|
checkResult = _context6.sent;
|
|
458
463
|
|
|
459
464
|
if (!(true === checkResult.success)) {
|
|
460
|
-
_context6.next =
|
|
465
|
+
_context6.next = 32;
|
|
461
466
|
break;
|
|
462
467
|
}
|
|
463
468
|
|
|
@@ -467,23 +472,23 @@ function _submitPIN() {
|
|
|
467
472
|
isAlreadySubscribed: isAlreadySubscribed
|
|
468
473
|
});
|
|
469
474
|
|
|
470
|
-
case
|
|
475
|
+
case 32:
|
|
471
476
|
_pinError = new Error("Error in submitMSISDN() verify-pin action:\n".concat(checkResult.message));
|
|
472
477
|
_pinError['type'] = "InvalidPIN";
|
|
473
478
|
throw _pinError;
|
|
474
479
|
|
|
475
|
-
case
|
|
476
|
-
_context6.next =
|
|
480
|
+
case 35:
|
|
481
|
+
_context6.next = 39;
|
|
477
482
|
break;
|
|
478
483
|
|
|
479
|
-
case
|
|
484
|
+
case 37:
|
|
480
485
|
_isAlreadySubscribed = pinResult.message == "ALREADY SUBSCRIBED" ? true : false;
|
|
481
486
|
return _context6.abrupt("return", {
|
|
482
487
|
productUrl: pinResult.product_url || null,
|
|
483
488
|
isAlreadySubscribed: _isAlreadySubscribed
|
|
484
489
|
});
|
|
485
490
|
|
|
486
|
-
case
|
|
491
|
+
case 39:
|
|
487
492
|
case "end":
|
|
488
493
|
return _context6.stop();
|
|
489
494
|
}
|
package/package.json
CHANGED
|
@@ -30,7 +30,7 @@ export type PINEntryFailure = {
|
|
|
30
30
|
error?: Error;
|
|
31
31
|
};
|
|
32
32
|
export type PINEntrySuccess = { finalUrl: string, msisdn?:string, isAlreadySubscribed?:boolean, };
|
|
33
|
-
export type PINEntryErrorTypes = "UnknownError" | "TooEarly" | "InvalidPIN" | "UnexpectedState";
|
|
33
|
+
export type PINEntryErrorTypes = "UnknownError" | "TooEarly" | "InvalidPIN" | "UnexpectedState" | "SessionBlocked";
|
|
34
34
|
|
|
35
35
|
export type IMsisdnSumbitNextData = {
|
|
36
36
|
actualPIN: string;
|
|
@@ -234,11 +234,8 @@ export function submitPinAction(msisdn:string, pin:string, extraParams?:{[key: s
|
|
|
234
234
|
} catch(ex) {
|
|
235
235
|
|
|
236
236
|
console.error(ex)
|
|
237
|
-
const errorType: PINEntryErrorTypes =
|
|
238
|
-
|
|
239
|
-
? "InvalidPIN"
|
|
240
|
-
: "UnknownError";
|
|
241
|
-
tracker.recedeInFlow('tallyman.v1-pin', 'pin-submission-failure',{msisdn, pin})
|
|
237
|
+
const errorType: PINEntryErrorTypes = ex.type || "UnknownError";
|
|
238
|
+
tracker.recedeInFlow('tallyman.v1-pin', 'pin-submission-failure',{msisdn, pin})
|
|
242
239
|
|
|
243
240
|
dispatch({
|
|
244
241
|
type: "PIN_SUBMIT_ERROR",
|
|
@@ -168,8 +168,13 @@ export async function submitPIN(window:Window, pin: string, config:IConfig, extr
|
|
|
168
168
|
|
|
169
169
|
const pinResult: IPINSubmissionResult = await window.tallymanApi.verifyPin(host, country, slug, device, offer, rockmanId, pin, extraParamsQs, uniqid, evinaTid)
|
|
170
170
|
if (false === pinResult.success) {
|
|
171
|
-
const
|
|
172
|
-
|
|
171
|
+
const pinErrorTypeMap:{[key:string]:string} = {
|
|
172
|
+
"pin does not match": "InvalidPIN",
|
|
173
|
+
"mcp blocked": "SessionBlocked"
|
|
174
|
+
}
|
|
175
|
+
const errorMessage = pinErrorTypeMap[pinResult.message as string]
|
|
176
|
+
const pinError = new Error(`Error in submitMSISDN() verify-pin action:\n${errorMessage}`) as IError & {type:string}
|
|
177
|
+
pinError['type'] = errorMessage ? errorMessage : "InvalidPIN";
|
|
173
178
|
throw pinError
|
|
174
179
|
} else {
|
|
175
180
|
if(true === pinResult.async) {
|