@everymatrix/player-deposit 0.0.236 → 0.0.240

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-deposit",
3
- "version": "0.0.236",
3
+ "version": "0.0.240",
4
4
  "main": "dist/player-deposit",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "43b4bf97936766e6e83c4522d412c4ff3049d9e2"
39
+ "gitHead": "6b0a5bd921101009e1bbfaa3fe63215a87fffc40"
40
40
  }
@@ -11,7 +11,7 @@
11
11
  export let lang:string = 'en';
12
12
 
13
13
  let userAgent:string = window.navigator.userAgent;
14
- let isMobile = (getDevice(userAgent) === 'PC') ? false : true;
14
+ let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
15
15
  let isLoading:boolean = true;
16
16
 
17
17
  let currency:string = '';
@@ -23,20 +23,16 @@
23
23
  });
24
24
 
25
25
 
26
- const toggleScreen = () => {
26
+ const toggleScreen = ():void => {
27
27
  window.postMessage({ type: 'ReturnToMenu' }, window.location.href);
28
28
  }
29
29
 
30
- const messageHandler = (e:any) => {
30
+ const messageHandler = (e:any):void => {
31
31
  if (e.data) {
32
32
  switch(e.data.type) {
33
33
  case 'ProfileDetailsData':
34
34
  currency = e.data.profileDetails.currency;
35
35
  break;
36
-
37
- default:
38
- // do nothing
39
- break;
40
36
  }
41
37
 
42
38
  switch(e.data.redirect) {
@@ -59,31 +55,26 @@
59
55
  case 'mm-wm-hc-init-deposit':
60
56
  window.postMessage({ type: 'GoToDeposit' }, window.location.href);
61
57
  break;
62
-
63
- default:
64
- // do nothing
65
- break;
66
58
  }
67
59
  }
68
60
  }
69
61
 
70
- const getDepositIframe = () => {
71
- let url = new URL(`${endpoint}/player/${playerid}/hostedcashier/initializedeposit`);
62
+ const getDepositIframe = ():void => {
63
+ let url:URL = new URL(`${endpoint}/player/${playerid}/hostedcashier/initializedeposit`);
72
64
 
73
- let options = {
65
+ let options:any = {
74
66
  method: "POST",
75
67
  headers: {
76
- 'playerId': playerid,
77
68
  'X-SessionId': session,
78
- 'currency': currency,
79
- 'amount': amount,
80
- 'cashierMode': 'Default',
81
- 'IsShortCashier': false,
82
- 'accept': 'application/json'
69
+ currency: currency || 'EUR',
70
+ amount,
71
+ cashierMode: 'Default',
72
+ IsShortCashier: false,
73
+ accept: 'application/json',
83
74
  },
84
75
  };
85
76
 
86
- fetch(url, options)
77
+ fetch(url.href, options)
87
78
  .then((res:any) => res.json())
88
79
  .then((data:any) => {
89
80
 
@@ -96,7 +87,7 @@
96
87
  });
97
88
  }
98
89
 
99
- const initialLoad = () => {
90
+ const setActiveLanguage = ():void => {
100
91
  setLocale(lang);
101
92
  }
102
93
 
@@ -108,7 +99,7 @@
108
99
  }
109
100
  });
110
101
 
111
- $: lang && initialLoad();
102
+ $: lang && setActiveLanguage();
112
103
  $: session && playerid && endpoint && getDepositIframe();
113
104
  </script>
114
105