@everymatrix/player-account-controller 0.0.162 → 0.0.166
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/player-account-controller.js +14833 -10931
- package/dist/player-account-controller.js.map +1 -1
- package/documentation.md +8 -0
- package/index.html +1 -1
- package/package.json +4 -4
- package/src/PlayerAccountController.svelte +91 -4
package/documentation.md
CHANGED
|
@@ -27,6 +27,10 @@ For example here is a list of the components used in order to display the Player
|
|
|
27
27
|
- Player Timeout
|
|
28
28
|
- Player Account Closure
|
|
29
29
|
- Player Gaming Limits
|
|
30
|
+
- Deposit
|
|
31
|
+
- Withdrawal
|
|
32
|
+
- Pending Withdrawals
|
|
33
|
+
- Transaction History
|
|
30
34
|
|
|
31
35
|
These components can also be used on their own, and they still can communicate to each other even if they are structurally placed in separate parts of your application (they still need to be on the same page).
|
|
32
36
|
|
|
@@ -131,6 +135,10 @@ The `customnotifications` is a string data that contains the background colors u
|
|
|
131
135
|
|GamingLimitsConfirmChanges|no extra data sent|intermediary step towards updating the data in which the user's acknowledgement to edit the limit values is confirmed|
|
|
132
136
|
|CancelGamingLimitsChanges|no extra data sent|intermediary step towards updating the data in which the user cancels the changes he has made to his gaming limits|
|
|
133
137
|
|PlayerAccountGamingLimitDelete|limit - the limit data to be deleted|intermediary step towards deleting data in which the user's acknowledgement to delete limit values is confirmed|
|
|
138
|
+
|Deposit|currency - send the user currency, amount - send "o" as amount|send POST to get the deposit iframe url
|
|
139
|
+
|Withdrawal|currency - send the user currency, amount - send "o" as amount|send POST to get the withdraw iframe url
|
|
140
|
+
|Pending Withdrawal|no extra data sent|get pending withdrawals iframe url
|
|
141
|
+
|Transaction History|no extra data sent|get transaction history iframe url
|
|
134
142
|
|CancelGamingLimitsRemove|no extra data sent|intermediary step towards deleting limits data in which the user cancels the changes he has made to his gaming limits|
|
|
135
143
|
|ModalClosed|no extra data sent|closes current confirmation modal|
|
|
136
144
|
|EnableScroll|no extra data sent|enables scroll after the used closes the modal|
|
package/index.html
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
endpoint="https://demo-api.stage.norway.everymatrix.com/v1"
|
|
35
35
|
cmsendpoint="https://wp-one-widgets.everymatrix.com/wp-json/wpone-rest/v1"
|
|
36
36
|
playerid="3685503"
|
|
37
|
-
session="
|
|
37
|
+
session="32d59c64-3678-4635-96c1-ce220b8fbf3a"
|
|
38
38
|
accountpath="/menu-locations/profile-menu"
|
|
39
39
|
notificationpath="/support_information"
|
|
40
40
|
customnotifications="#58586B,#2687F6,#D0046C"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/player-account-controller",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.166",
|
|
4
4
|
"main": "dist/player-account-controller.js",
|
|
5
5
|
"svelte": "src/index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"typescript": "^3.9.3"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@everymatrix/player-account-menu": "^0.0.
|
|
33
|
-
"@everymatrix/player-account-notifications": "^0.0.
|
|
32
|
+
"@everymatrix/player-account-menu": "^0.0.166",
|
|
33
|
+
"@everymatrix/player-account-notifications": "^0.0.166",
|
|
34
34
|
"cross-env": "^7.0.3",
|
|
35
35
|
"sirv-cli": "^1.0.0",
|
|
36
36
|
"svelte": "^3.0.0"
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "cc5cea8f5d4ed68bf0b052d98cc82ce69e97fc45"
|
|
42
42
|
}
|
|
@@ -18,6 +18,11 @@
|
|
|
18
18
|
import '@everymatrix/player-account-gaming-limits';
|
|
19
19
|
import '@everymatrix/player-active-bonuses';
|
|
20
20
|
import '@everymatrix/player-bonus-history';
|
|
21
|
+
import '@everymatrix/player-deposit';
|
|
22
|
+
import '@everymatrix/player-withdrawal';
|
|
23
|
+
import '@everymatrix/player-pending-withdrawals';
|
|
24
|
+
import '@everymatrix/player-transaction-history';
|
|
25
|
+
import '@everymatrix/player-gaming-history';
|
|
21
26
|
|
|
22
27
|
export let cmsendpoint:string = '';
|
|
23
28
|
export let accountpath:string = '';
|
|
@@ -47,8 +52,24 @@
|
|
|
47
52
|
let timelimit:any;
|
|
48
53
|
let showsuccessnotification:boolean = false;
|
|
49
54
|
let showdeletenotification:boolean = false;
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
let realityCheckData:any;
|
|
56
|
+
let storedRealityCheck:string = '';
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
const widgetTitle = ['Profile Info',
|
|
60
|
+
'Change password',
|
|
61
|
+
'Reality Check',
|
|
62
|
+
'Timeout',
|
|
63
|
+
'Account Closure',
|
|
64
|
+
'Gaming Limits',
|
|
65
|
+
'Self Exclusion',
|
|
66
|
+
'Active Bonuses',
|
|
67
|
+
'Bonus History',
|
|
68
|
+
'Gaming History',
|
|
69
|
+
'Deposit',
|
|
70
|
+
'Withdrawal',
|
|
71
|
+
'Pending Withdrawals',
|
|
72
|
+
'Transaction History'];
|
|
52
73
|
const accountMenuEndpointURL:string = cmsendpoint + accountpath;
|
|
53
74
|
const notificationsEndpointURL:string = cmsendpoint + notificationpath;
|
|
54
75
|
|
|
@@ -327,6 +348,10 @@
|
|
|
327
348
|
getGamingLimits(`${endpoint}/player/${playerid}/limits`);
|
|
328
349
|
break;
|
|
329
350
|
|
|
351
|
+
case 'SubmittedRealityCheck':
|
|
352
|
+
setRealityCheckValue(e.data.realityCheckUpdatedValue);
|
|
353
|
+
break;
|
|
354
|
+
|
|
330
355
|
default:
|
|
331
356
|
// do nothing
|
|
332
357
|
break;
|
|
@@ -375,6 +400,47 @@
|
|
|
375
400
|
});
|
|
376
401
|
}
|
|
377
402
|
|
|
403
|
+
const getRealityCheckData = (url:string) => {
|
|
404
|
+
let options = {
|
|
405
|
+
method: 'GET',
|
|
406
|
+
headers: {
|
|
407
|
+
'X-SessionID': sessionId,
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
fetch(url, options)
|
|
411
|
+
.then((res:any) => { return res.json(); })
|
|
412
|
+
.then((data:any) => {
|
|
413
|
+
realityCheckData = data.UserRealityCheckValue;
|
|
414
|
+
}, (err:any) => {
|
|
415
|
+
console.error(err);
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
const setRealityCheckValue = (updatedData:string) => {
|
|
420
|
+
if(updatedData) {
|
|
421
|
+
storedRealityCheck = updatedData;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
let optionsRealityCheck = {
|
|
425
|
+
method: "POST",
|
|
426
|
+
headers: {
|
|
427
|
+
'X-SessionID': sessionId,
|
|
428
|
+
'Content-Type': "application/json",
|
|
429
|
+
'Accept': 'application/json',
|
|
430
|
+
'realityCheckValue': parseInt(storedRealityCheck, 10)
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
fetch(`${endpoint}/player/${userId}/realitycheck`, optionsRealityCheck)
|
|
435
|
+
.then((res:any) => {
|
|
436
|
+
if (res.status == 200) {
|
|
437
|
+
getRealityCheckData(`${endpoint}/player/${playerid}/realitycheck`);
|
|
438
|
+
window.postMessage({ type: 'RealityCheckValueUpdated' }, window.location.href);
|
|
439
|
+
}
|
|
440
|
+
}, (err:any) => {
|
|
441
|
+
console.error(err);
|
|
442
|
+
});
|
|
443
|
+
}
|
|
378
444
|
|
|
379
445
|
const getGamingLimits = (url:string) => {
|
|
380
446
|
if (showsuccessnotification === true) {
|
|
@@ -445,6 +511,7 @@
|
|
|
445
511
|
getNotificationsDetails(cmsendpoint + notificationpath);
|
|
446
512
|
getUserProfileInfo();
|
|
447
513
|
getGamingLimits(`${endpoint}/player/${playerid}/limits`);
|
|
514
|
+
getRealityCheckData(`${endpoint}/player/${playerid}/realitycheck`);
|
|
448
515
|
}
|
|
449
516
|
|
|
450
517
|
const initialLoad = () => {
|
|
@@ -487,7 +554,7 @@
|
|
|
487
554
|
{:else if switchContent && pageName === widgetTitle[1]}
|
|
488
555
|
<player-change-password></player-change-password>
|
|
489
556
|
{:else if switchContent && pageName === widgetTitle[2]}
|
|
490
|
-
<player-reality-check></player-reality-check>
|
|
557
|
+
<player-reality-check realitycheck={realityCheckData}></player-reality-check>
|
|
491
558
|
{:else if switchContent && pageName === widgetTitle[3]}
|
|
492
559
|
<player-account-timeout></player-account-timeout>
|
|
493
560
|
{:else if switchContent && pageName === widgetTitle[4]}
|
|
@@ -500,6 +567,16 @@
|
|
|
500
567
|
<player-active-bonuses {endpoint} {session} {playerid}></player-active-bonuses>
|
|
501
568
|
{:else if switchContent && pageName === widgetTitle[8]}
|
|
502
569
|
<player-bonus-history {endpoint} {session} {playerid}></player-bonus-history>
|
|
570
|
+
{:else if switchContent && pageName === widgetTitle[9]}
|
|
571
|
+
<player-gaming-history {endpoint} {session} {playerid}></player-gaming-history>
|
|
572
|
+
{:else if switchContent && pageName === widgetTitle[10]}
|
|
573
|
+
<player-deposit {endpoint} {session} {playerid}></player-deposit>
|
|
574
|
+
{:else if switchContent && pageName === widgetTitle[11]}
|
|
575
|
+
<player-withdrawal {endpoint} {session} {playerid}></player-withdrawal>
|
|
576
|
+
{:else if switchContent && pageName === widgetTitle[12]}
|
|
577
|
+
<player-pending-withdrawals {endpoint} {session} {playerid}></player-pending-withdrawals>
|
|
578
|
+
{:else if switchContent && pageName === widgetTitle[13]}
|
|
579
|
+
<player-transaction-history {endpoint} {session} {playerid}></player-transaction-history>
|
|
503
580
|
{/if}
|
|
504
581
|
{/if}
|
|
505
582
|
{:else}
|
|
@@ -512,7 +589,7 @@
|
|
|
512
589
|
{:else if switchContent && pageName === widgetTitle[1]}
|
|
513
590
|
<player-change-password></player-change-password>
|
|
514
591
|
{:else if switchContent && pageName === widgetTitle[2]}
|
|
515
|
-
<player-reality-check></player-reality-check>
|
|
592
|
+
<player-reality-check realitycheck={realityCheckData}></player-reality-check>
|
|
516
593
|
{:else if switchContent && pageName === widgetTitle[3]}
|
|
517
594
|
<player-account-timeout></player-account-timeout>
|
|
518
595
|
{:else if switchContent && pageName === widgetTitle[4]}
|
|
@@ -525,6 +602,16 @@
|
|
|
525
602
|
<player-active-bonuses {endpoint} {session} {playerid}></player-active-bonuses>
|
|
526
603
|
{:else if switchContent && pageName === widgetTitle[8]}
|
|
527
604
|
<player-bonus-history {endpoint} {session} {playerid}></player-bonus-history>
|
|
605
|
+
{:else if switchContent && pageName === widgetTitle[9]}
|
|
606
|
+
<player-gaming-history {endpoint} {session} {playerid}></player-gaming-history>
|
|
607
|
+
{:else if switchContent && pageName === widgetTitle[10]}
|
|
608
|
+
<player-deposit {endpoint} {session} {playerid}></player-deposit>
|
|
609
|
+
{:else if switchContent && pageName === widgetTitle[11]}
|
|
610
|
+
<player-withdrawal {endpoint} {session} {playerid}></player-withdrawal>
|
|
611
|
+
{:else if switchContent && pageName === widgetTitle[12]}
|
|
612
|
+
<player-pending-withdrawals {endpoint} {session} {playerid}></player-pending-withdrawals>
|
|
613
|
+
{:else if switchContent && pageName === widgetTitle[13]}
|
|
614
|
+
<player-transaction-history {endpoint} {session} {playerid}></player-transaction-history>
|
|
528
615
|
{/if}
|
|
529
616
|
</main>
|
|
530
617
|
<aside>
|