ouisys-engine 2.1.20 → 2.1.21
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/api/index.d.ts +1 -1
- package/dist/api/index.js +24 -24
- package/dist/reducers/oneClickFlow/utils.js +8 -7
- package/dist/reducers/pinFlow/utils.js +16 -15
- package/package.json +1 -1
- package/src/@types/window.d.ts +1 -0
- package/src/api/index.ts +4 -4
- package/src/reducers/oneClickFlow/utils.ts +3 -2
- package/src/reducers/pinFlow/utils.ts +3 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { ITpayConsentResult } from "../reducers/TpayHeFlow/TpayHeTypes";
|
|
|
7
7
|
export interface ITallyman {
|
|
8
8
|
identify: (host: string, slug: string, country: string, msisdn: string, device: string, offer: number, rockmanId: string) => Promise<IIdentifyResult>;
|
|
9
9
|
triggerPin: (host: string, country: string, slug: string, device: string, offer: number, msisdn: string, rockmanId: string, extraParamsQs: string, search: string, uniqid?: string) => Promise<IMSISDNSubmissionResult>;
|
|
10
|
-
verifyPin: (host: string, country: string, slug: string, device: string, offer: number, rockmanId: string, pin: string, extraParamsQs: string, uniqid: string) => Promise<IPINSubmissionResult>;
|
|
10
|
+
verifyPin: (host: string, country: string, slug: string, device: string, offer: number, rockmanId: string, pin: string, extraParamsQs: string, uniqid: string, evinaTid: string) => Promise<IPINSubmissionResult>;
|
|
11
11
|
checkSubscriptionByRockmanIdOnly: (host: string, rockmanId: string) => Promise<ICheckSubscriptionResult>;
|
|
12
12
|
checkSubscription: (host: string, country: string, slug: string, device: string, offer: number, rockmanId: string, pin: string, extraParamsQs: string) => Promise<ICheckSubscriptionResult>;
|
|
13
13
|
triggerMessage: (host: string, slug: string, country: string, msisdn: string, device: string, offer: number, rockmanId: string, search: string, extraParamsQs: string) => Promise<IMoMSISDNSubmissionResult>;
|
package/dist/api/index.js
CHANGED
|
@@ -61,7 +61,7 @@ var MockTallyman = {
|
|
|
61
61
|
return identify;
|
|
62
62
|
}(),
|
|
63
63
|
triggerPin: function () {
|
|
64
|
-
var _triggerPin = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(host, country, slug, device, offer, msisdn, rockmanId, extraParamsQs, search, uniqid) {
|
|
64
|
+
var _triggerPin = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(host, country, slug, device, offer, msisdn, rockmanId, extraParamsQs, search, uniqid, evinaTid) {
|
|
65
65
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
66
66
|
while (1) {
|
|
67
67
|
switch (_context2.prev = _context2.next) {
|
|
@@ -84,7 +84,7 @@ var MockTallyman = {
|
|
|
84
84
|
}, _callee2);
|
|
85
85
|
}));
|
|
86
86
|
|
|
87
|
-
function triggerPin(_x8, _x9, _x10, _x11, _x12, _x13, _x14, _x15, _x16, _x17) {
|
|
87
|
+
function triggerPin(_x8, _x9, _x10, _x11, _x12, _x13, _x14, _x15, _x16, _x17, _x18) {
|
|
88
88
|
return _triggerPin.apply(this, arguments);
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -113,7 +113,7 @@ var MockTallyman = {
|
|
|
113
113
|
}, _callee3);
|
|
114
114
|
}));
|
|
115
115
|
|
|
116
|
-
function verifyPin(
|
|
116
|
+
function verifyPin(_x19, _x20, _x21, _x22, _x23, _x24, _x25, _x26, _x27) {
|
|
117
117
|
return _verifyPin.apply(this, arguments);
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -142,7 +142,7 @@ var MockTallyman = {
|
|
|
142
142
|
}, _callee4);
|
|
143
143
|
}));
|
|
144
144
|
|
|
145
|
-
function checkSubscription(
|
|
145
|
+
function checkSubscription(_x28, _x29, _x30, _x31, _x32, _x33, _x34, _x35) {
|
|
146
146
|
return _checkSubscription.apply(this, arguments);
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -171,7 +171,7 @@ var MockTallyman = {
|
|
|
171
171
|
}, _callee5);
|
|
172
172
|
}));
|
|
173
173
|
|
|
174
|
-
function checkSubscriptionByRockmanIdOnly(
|
|
174
|
+
function checkSubscriptionByRockmanIdOnly(_x36, _x37) {
|
|
175
175
|
return _checkSubscriptionByRockmanIdOnly.apply(this, arguments);
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -199,7 +199,7 @@ var MockTallyman = {
|
|
|
199
199
|
}, _callee6);
|
|
200
200
|
}));
|
|
201
201
|
|
|
202
|
-
function redirect(
|
|
202
|
+
function redirect(_x38, _x39, _x40, _x41, _x42, _x43, _x44, _x45, _x46, _x47) {
|
|
203
203
|
return _redirect.apply(this, arguments);
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -228,7 +228,7 @@ var MockTallyman = {
|
|
|
228
228
|
}, _callee7);
|
|
229
229
|
}));
|
|
230
230
|
|
|
231
|
-
function triggerMessage(
|
|
231
|
+
function triggerMessage(_x48, _x49, _x50, _x51, _x52, _x53, _x54, _x55, _x56) {
|
|
232
232
|
return _triggerMessage.apply(this, arguments);
|
|
233
233
|
}
|
|
234
234
|
|
|
@@ -257,7 +257,7 @@ var MockTallyman = {
|
|
|
257
257
|
}, _callee8);
|
|
258
258
|
}));
|
|
259
259
|
|
|
260
|
-
function ussd(
|
|
260
|
+
function ussd(_x57, _x58, _x59, _x60, _x61, _x62, _x63, _x64, _x65) {
|
|
261
261
|
return _ussd.apply(this, arguments);
|
|
262
262
|
}
|
|
263
263
|
|
|
@@ -287,7 +287,7 @@ var MockTallyman = {
|
|
|
287
287
|
}, _callee9);
|
|
288
288
|
}));
|
|
289
289
|
|
|
290
|
-
function oc2sms(
|
|
290
|
+
function oc2sms(_x66, _x67, _x68, _x69, _x70, _x71, _x72, _x73) {
|
|
291
291
|
return _oc2sms.apply(this, arguments);
|
|
292
292
|
}
|
|
293
293
|
|
|
@@ -331,7 +331,7 @@ var MockTallyman = {
|
|
|
331
331
|
}, _callee10);
|
|
332
332
|
}));
|
|
333
333
|
|
|
334
|
-
function tpayConsentConfig(
|
|
334
|
+
function tpayConsentConfig(_x74, _x75, _x76, _x77, _x78, _x79, _x80) {
|
|
335
335
|
return _tpayConsentConfig.apply(this, arguments);
|
|
336
336
|
}
|
|
337
337
|
|
|
@@ -360,7 +360,7 @@ var MockTallyman = {
|
|
|
360
360
|
}, _callee11);
|
|
361
361
|
}));
|
|
362
362
|
|
|
363
|
-
function mcpShield(
|
|
363
|
+
function mcpShield(_x81, _x82, _x83, _x84, _x85, _x86, _x87) {
|
|
364
364
|
return _mcpShield.apply(this, arguments);
|
|
365
365
|
}
|
|
366
366
|
|
|
@@ -395,7 +395,7 @@ var RealTallyman = {
|
|
|
395
395
|
}, _callee12);
|
|
396
396
|
}));
|
|
397
397
|
|
|
398
|
-
function identify(
|
|
398
|
+
function identify(_x88, _x89, _x90, _x91, _x92, _x93, _x94) {
|
|
399
399
|
return _identify2.apply(this, arguments);
|
|
400
400
|
}
|
|
401
401
|
|
|
@@ -427,14 +427,14 @@ var RealTallyman = {
|
|
|
427
427
|
}, _callee13);
|
|
428
428
|
}));
|
|
429
429
|
|
|
430
|
-
function triggerPin(
|
|
430
|
+
function triggerPin(_x95, _x96, _x97, _x98, _x99, _x100, _x101, _x102, _x103, _x104) {
|
|
431
431
|
return _triggerPin2.apply(this, arguments);
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
return triggerPin;
|
|
435
435
|
}(),
|
|
436
436
|
verifyPin: function () {
|
|
437
|
-
var _verifyPin2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14(host, country, slug, device, offer, rockmanId, pin, extraParamsQs, uniqid) {
|
|
437
|
+
var _verifyPin2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14(host, country, slug, device, offer, rockmanId, pin, extraParamsQs, uniqid, evinaTid) {
|
|
438
438
|
var isDMB, newHost;
|
|
439
439
|
return regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
440
440
|
while (1) {
|
|
@@ -444,7 +444,7 @@ var RealTallyman = {
|
|
|
444
444
|
isDMB = window.pac_analytics.visitor.xaid != null && (window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb") != -1 || window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")) != -1 ? true : false;
|
|
445
445
|
newHost = isDMB ? "de.tallymans.com" : host;
|
|
446
446
|
_context14.next = 5;
|
|
447
|
-
return fetch("https://".concat(newHost, "/tallyman/v1/?action=verify-pin&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=").concat(device, "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId, "&pin=").concat(pin).concat(uniqid).concat(extraParamsQs)).then(function (x) {
|
|
447
|
+
return fetch("https://".concat(newHost, "/tallyman/v1/?action=verify-pin&country=").concat(bupperizeCountry(country), "&slug=").concat(slug, "&device=").concat(device, "&offerId=").concat(offer, "&rockman_id=").concat(rockmanId, "&pin=").concat(pin).concat(uniqid, "&sam_evina_tid=").concat(evinaTid).concat(extraParamsQs)).then(function (x) {
|
|
448
448
|
return x.json();
|
|
449
449
|
});
|
|
450
450
|
|
|
@@ -459,7 +459,7 @@ var RealTallyman = {
|
|
|
459
459
|
}, _callee14);
|
|
460
460
|
}));
|
|
461
461
|
|
|
462
|
-
function verifyPin(
|
|
462
|
+
function verifyPin(_x105, _x106, _x107, _x108, _x109, _x110, _x111, _x112, _x113, _x114) {
|
|
463
463
|
return _verifyPin2.apply(this, arguments);
|
|
464
464
|
}
|
|
465
465
|
|
|
@@ -491,7 +491,7 @@ var RealTallyman = {
|
|
|
491
491
|
}, _callee15);
|
|
492
492
|
}));
|
|
493
493
|
|
|
494
|
-
function checkSubscription(
|
|
494
|
+
function checkSubscription(_x115, _x116, _x117, _x118, _x119, _x120, _x121, _x122) {
|
|
495
495
|
return _checkSubscription2.apply(this, arguments);
|
|
496
496
|
}
|
|
497
497
|
|
|
@@ -523,7 +523,7 @@ var RealTallyman = {
|
|
|
523
523
|
}, _callee16);
|
|
524
524
|
}));
|
|
525
525
|
|
|
526
|
-
function checkSubscriptionByRockmanIdOnly(
|
|
526
|
+
function checkSubscriptionByRockmanIdOnly(_x123, _x124) {
|
|
527
527
|
return _checkSubscriptionByRockmanIdOnly2.apply(this, arguments);
|
|
528
528
|
}
|
|
529
529
|
|
|
@@ -555,7 +555,7 @@ var RealTallyman = {
|
|
|
555
555
|
}, _callee17);
|
|
556
556
|
}));
|
|
557
557
|
|
|
558
|
-
function redirect(
|
|
558
|
+
function redirect(_x125, _x126, _x127, _x128, _x129, _x130, _x131, _x132, _x133, _x134) {
|
|
559
559
|
return _redirect2.apply(this, arguments);
|
|
560
560
|
}
|
|
561
561
|
|
|
@@ -587,7 +587,7 @@ var RealTallyman = {
|
|
|
587
587
|
}, _callee18);
|
|
588
588
|
}));
|
|
589
589
|
|
|
590
|
-
function triggerMessage(
|
|
590
|
+
function triggerMessage(_x135, _x136, _x137, _x138, _x139, _x140, _x141, _x142, _x143) {
|
|
591
591
|
return _triggerMessage2.apply(this, arguments);
|
|
592
592
|
}
|
|
593
593
|
|
|
@@ -619,7 +619,7 @@ var RealTallyman = {
|
|
|
619
619
|
}, _callee19);
|
|
620
620
|
}));
|
|
621
621
|
|
|
622
|
-
function ussd(
|
|
622
|
+
function ussd(_x144, _x145, _x146, _x147, _x148, _x149, _x150, _x151, _x152) {
|
|
623
623
|
return _ussd2.apply(this, arguments);
|
|
624
624
|
}
|
|
625
625
|
|
|
@@ -651,7 +651,7 @@ var RealTallyman = {
|
|
|
651
651
|
}, _callee20);
|
|
652
652
|
}));
|
|
653
653
|
|
|
654
|
-
function oc2sms(
|
|
654
|
+
function oc2sms(_x153, _x154, _x155, _x156, _x157, _x158, _x159, _x160) {
|
|
655
655
|
return _oc2sms2.apply(this, arguments);
|
|
656
656
|
}
|
|
657
657
|
|
|
@@ -683,7 +683,7 @@ var RealTallyman = {
|
|
|
683
683
|
}, _callee21);
|
|
684
684
|
}));
|
|
685
685
|
|
|
686
|
-
function tpayConsentConfig(
|
|
686
|
+
function tpayConsentConfig(_x161, _x162, _x163, _x164, _x165, _x166, _x167) {
|
|
687
687
|
return _tpayConsentConfig2.apply(this, arguments);
|
|
688
688
|
}
|
|
689
689
|
|
|
@@ -718,7 +718,7 @@ var RealTallyman = {
|
|
|
718
718
|
}, _callee22);
|
|
719
719
|
}));
|
|
720
720
|
|
|
721
|
-
function mcpShield(
|
|
721
|
+
function mcpShield(_x168, _x169, _x170, _x171, _x172, _x173, _x174, _x175) {
|
|
722
722
|
return _mcpShield2.apply(this, arguments);
|
|
723
723
|
}
|
|
724
724
|
|
|
@@ -250,24 +250,25 @@ exports.getRedirectUrl = getRedirectUrl;
|
|
|
250
250
|
|
|
251
251
|
var subscribe = /*#__PURE__*/function () {
|
|
252
252
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(url, extraParams) {
|
|
253
|
-
var extraParamsQs, result, subscribeError;
|
|
253
|
+
var evinaTid, extraParamsQs, result, subscribeError;
|
|
254
254
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
255
255
|
while (1) {
|
|
256
256
|
switch (_context2.prev = _context2.next) {
|
|
257
257
|
case 0:
|
|
258
|
+
evinaTid = typeof window != "undefined" && window.tid ? window.tid : "";
|
|
258
259
|
extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(function (k) {
|
|
259
260
|
return "".concat(k, "=").concat(extraParams[k]);
|
|
260
261
|
}).join('&');
|
|
261
|
-
_context2.next =
|
|
262
|
-
return fetch(url
|
|
262
|
+
_context2.next = 4;
|
|
263
|
+
return fetch("".concat(url, "&sam_evina_tid=").concat(evinaTid).concat(extraParamsQs)).then(function (x) {
|
|
263
264
|
return x.json();
|
|
264
265
|
});
|
|
265
266
|
|
|
266
|
-
case
|
|
267
|
+
case 4:
|
|
267
268
|
result = _context2.sent;
|
|
268
269
|
|
|
269
270
|
if (!(false === result.success)) {
|
|
270
|
-
_context2.next =
|
|
271
|
+
_context2.next = 12;
|
|
271
272
|
break;
|
|
272
273
|
}
|
|
273
274
|
|
|
@@ -276,10 +277,10 @@ var subscribe = /*#__PURE__*/function () {
|
|
|
276
277
|
subscribeError['productUrl'] = result.product_url ? result.product_url : "";
|
|
277
278
|
throw subscribeError;
|
|
278
279
|
|
|
279
|
-
case
|
|
280
|
+
case 12:
|
|
280
281
|
return _context2.abrupt("return", result.product_url || result.redirect_url);
|
|
281
282
|
|
|
282
|
-
case
|
|
283
|
+
case 13:
|
|
283
284
|
case "end":
|
|
284
285
|
return _context2.stop();
|
|
285
286
|
}
|
|
@@ -398,7 +398,7 @@ function submitPIN(_x16, _x17, _x18, _x19) {
|
|
|
398
398
|
|
|
399
399
|
function _submitPIN() {
|
|
400
400
|
_submitPIN = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(window, pin, config, extraParams) {
|
|
401
|
-
var slug, country, device, host, offer, extraParamsQs, rockmanId, emptyPinError, uniqid, pinResult, pinError, check, checkResult, isAlreadySubscribed, _pinError, _isAlreadySubscribed;
|
|
401
|
+
var slug, country, device, host, offer, extraParamsQs, rockmanId, emptyPinError, uniqid, evinaTid, pinResult, pinError, check, checkResult, isAlreadySubscribed, _pinError, _isAlreadySubscribed;
|
|
402
402
|
|
|
403
403
|
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
404
404
|
while (1) {
|
|
@@ -427,14 +427,15 @@ function _submitPIN() {
|
|
|
427
427
|
|
|
428
428
|
case 9:
|
|
429
429
|
uniqid = uniqidResult != "" ? "&mcpUniqid=".concat(uniqidResult) : '';
|
|
430
|
-
|
|
431
|
-
|
|
430
|
+
evinaTid = typeof window != "undefined" && window.tid ? window.tid : "";
|
|
431
|
+
_context6.next = 13;
|
|
432
|
+
return window.tallymanApi.verifyPin(host, country, slug, device, offer, rockmanId, pin, extraParamsQs, uniqid, evinaTid);
|
|
432
433
|
|
|
433
|
-
case
|
|
434
|
+
case 13:
|
|
434
435
|
pinResult = _context6.sent;
|
|
435
436
|
|
|
436
437
|
if (!(false === pinResult.success)) {
|
|
437
|
-
_context6.next =
|
|
438
|
+
_context6.next = 20;
|
|
438
439
|
break;
|
|
439
440
|
}
|
|
440
441
|
|
|
@@ -442,9 +443,9 @@ function _submitPIN() {
|
|
|
442
443
|
pinError['type'] = "InvalidPIN";
|
|
443
444
|
throw pinError;
|
|
444
445
|
|
|
445
|
-
case
|
|
446
|
+
case 20:
|
|
446
447
|
if (!(true === pinResult.async)) {
|
|
447
|
-
_context6.next =
|
|
448
|
+
_context6.next = 35;
|
|
448
449
|
break;
|
|
449
450
|
}
|
|
450
451
|
|
|
@@ -452,16 +453,16 @@ function _submitPIN() {
|
|
|
452
453
|
return window.tallymanApi.checkSubscription(host, country, slug, device, offer, rockmanId, pin, extraParamsQs);
|
|
453
454
|
};
|
|
454
455
|
|
|
455
|
-
_context6.next =
|
|
456
|
+
_context6.next = 24;
|
|
456
457
|
return (0, _utils.loop)(check, 30, function (r) {
|
|
457
458
|
return r.success;
|
|
458
459
|
}, 0);
|
|
459
460
|
|
|
460
|
-
case
|
|
461
|
+
case 24:
|
|
461
462
|
checkResult = _context6.sent;
|
|
462
463
|
|
|
463
464
|
if (!(true === checkResult.success)) {
|
|
464
|
-
_context6.next =
|
|
465
|
+
_context6.next = 30;
|
|
465
466
|
break;
|
|
466
467
|
}
|
|
467
468
|
|
|
@@ -471,23 +472,23 @@ function _submitPIN() {
|
|
|
471
472
|
isAlreadySubscribed: isAlreadySubscribed
|
|
472
473
|
});
|
|
473
474
|
|
|
474
|
-
case
|
|
475
|
+
case 30:
|
|
475
476
|
_pinError = new Error("Error in submitMSISDN() verify-pin action:\n".concat(checkResult.message));
|
|
476
477
|
_pinError['type'] = "InvalidPIN";
|
|
477
478
|
throw _pinError;
|
|
478
479
|
|
|
479
|
-
case
|
|
480
|
-
_context6.next =
|
|
480
|
+
case 33:
|
|
481
|
+
_context6.next = 37;
|
|
481
482
|
break;
|
|
482
483
|
|
|
483
|
-
case
|
|
484
|
+
case 35:
|
|
484
485
|
_isAlreadySubscribed = pinResult.message == "ALREADY SUBSCRIBED" ? true : false;
|
|
485
486
|
return _context6.abrupt("return", {
|
|
486
487
|
productUrl: pinResult.product_url || null,
|
|
487
488
|
isAlreadySubscribed: _isAlreadySubscribed
|
|
488
489
|
});
|
|
489
490
|
|
|
490
|
-
case
|
|
491
|
+
case 37:
|
|
491
492
|
case "end":
|
|
492
493
|
return _context6.stop();
|
|
493
494
|
}
|
package/package.json
CHANGED
package/src/@types/window.d.ts
CHANGED
package/src/api/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ const bupperizeCountry = (c:string) => c == 'gb' ? 'uk' : c;
|
|
|
13
13
|
export interface ITallyman {
|
|
14
14
|
identify:(host: string, slug: string, country: string, msisdn: string, device: string, offer: number, rockmanId: string)=>Promise<IIdentifyResult>
|
|
15
15
|
triggerPin:(host: string, country: string, slug: string, device: string, offer: number, msisdn: string, rockmanId: string, extraParamsQs: string, search: string,uniqid?:string)=>Promise<IMSISDNSubmissionResult>;
|
|
16
|
-
verifyPin:(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string, uniqid:string)=>Promise<IPINSubmissionResult>;
|
|
16
|
+
verifyPin:(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string, uniqid:string, evinaTid:string)=>Promise<IPINSubmissionResult>;
|
|
17
17
|
checkSubscriptionByRockmanIdOnly:(host:string, rockmanId:string)=>Promise<ICheckSubscriptionResult>;
|
|
18
18
|
checkSubscription:(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string)=>Promise<ICheckSubscriptionResult>;
|
|
19
19
|
triggerMessage:(host:string, slug:string, country:string, msisdn:string, device:string, offer:number, rockmanId:string, search:string, extraParamsQs:string)=>Promise<IMoMSISDNSubmissionResult>;
|
|
@@ -44,7 +44,7 @@ export const MockTallyman:ITallyman = {
|
|
|
44
44
|
rockman_id: ""
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
-
triggerPin:async(host: string, country: string, slug: string, device: string, offer: number, msisdn: string, rockmanId: string, extraParamsQs: string, search: string,uniqid?:string): Promise<IMSISDNSubmissionResult> =>{
|
|
47
|
+
triggerPin:async(host: string, country: string, slug: string, device: string, offer: number, msisdn: string, rockmanId: string, extraParamsQs: string, search: string,uniqid?:string, evinaTid?:string): Promise<IMSISDNSubmissionResult> =>{
|
|
48
48
|
console.log("MockTallyman")
|
|
49
49
|
sleep(2000);
|
|
50
50
|
return {
|
|
@@ -176,11 +176,11 @@ export const RealTallyman:ITallyman = {
|
|
|
176
176
|
const newHost = isDMB ? "de.tallymans.com" : host;
|
|
177
177
|
return await fetch(`https://${newHost}/tallyman/v1/?action=trigger-pin&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&msisdn=${msisdn}&rockman_id=${rockmanId}${uniqid}${extraParamsQs}&${search}`).then(x => x.json());
|
|
178
178
|
},
|
|
179
|
-
verifyPin:async(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string, uniqid:string): Promise<IPINSubmissionResult> =>{
|
|
179
|
+
verifyPin:async(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string, uniqid:string, evinaTid:string): Promise<IPINSubmissionResult> =>{
|
|
180
180
|
console.log("RealTallyman")
|
|
181
181
|
const isDMB = (window.pac_analytics.visitor.xaid != null && (window.pac_analytics.visitor.xaid.toLowerCase().indexOf("dmb") != -1 || window.pac_analytics.visitor.xaid.toLowerCase().indexOf("amb")) != -1) ? true : false;
|
|
182
182
|
const newHost = isDMB ? "de.tallymans.com" : host;
|
|
183
|
-
return await fetch(`https://${newHost}/tallyman/v1/?action=verify-pin&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&rockman_id=${rockmanId}&pin=${pin}${uniqid}${extraParamsQs}`).then(x => x.json())
|
|
183
|
+
return await fetch(`https://${newHost}/tallyman/v1/?action=verify-pin&country=${bupperizeCountry(country)}&slug=${slug}&device=${device}&offerId=${offer}&rockman_id=${rockmanId}&pin=${pin}${uniqid}&sam_evina_tid=${evinaTid}${extraParamsQs}`).then(x => x.json())
|
|
184
184
|
},
|
|
185
185
|
checkSubscription:async(host:string, country:string, slug:string, device:string, offer:number, rockmanId:string, pin:string, extraParamsQs:string): Promise<ICheckSubscriptionResult> =>{
|
|
186
186
|
console.log("RealTallyman")
|
|
@@ -95,10 +95,11 @@ export const getRedirectUrl = async(window:Window, maybeConfig: IConfig, extraP
|
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
export const subscribe:(url:string, extraParams?:IHash)=>Promise<string> = async(url:string, extraParams?:IHash)=>{
|
|
98
|
-
|
|
98
|
+
const evinaTid = (typeof window != "undefined" && window.tid) ? window.tid : "";
|
|
99
99
|
const extraParamsQs = !extraParams ? '' : '&' + Object.keys(extraParams).map(k => `${k}=${extraParams[k]}`).join('&')
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
|
|
102
|
+
const result:ISubscribeResult = await fetch(`${url}&sam_evina_tid=${evinaTid}${extraParamsQs}`).then((x)=>x.json())
|
|
102
103
|
|
|
103
104
|
if(false === result.success){
|
|
104
105
|
const subscribeError = new Error(`Error in subscribe() one-click-subscribe action:\n${result.message}`) as {productUrl:string} & IError;
|
|
@@ -171,7 +171,9 @@ export async function submitPIN(window:Window, pin: string, config:IConfig, extr
|
|
|
171
171
|
throw emptyPinError
|
|
172
172
|
}
|
|
173
173
|
const uniqid = uniqidResult != "" ? `&mcpUniqid=${uniqidResult}` : '';
|
|
174
|
-
const
|
|
174
|
+
const evinaTid = (typeof window != "undefined" && window.tid) ? window.tid : "";
|
|
175
|
+
|
|
176
|
+
const pinResult: IPINSubmissionResult = await window.tallymanApi.verifyPin(host, country, slug, device, offer, rockmanId, pin, extraParamsQs, uniqid, evinaTid)
|
|
175
177
|
if (false === pinResult.success) {
|
|
176
178
|
const pinError = new Error(`Error in submitMSISDN() verify-pin action:\n${pinResult.message}`) as IError & {type:string}
|
|
177
179
|
pinError['type'] = "InvalidPIN";
|