@everymatrix/player-deposit 0.0.163
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/README.md +30 -0
- package/dist/player-deposit.js +4872 -0
- package/dist/player-deposit.js.map +1 -0
- package/index.html +21 -0
- package/index.js +1 -0
- package/package.json +40 -0
- package/public/favicon.png +0 -0
- package/public/reset.css +48 -0
- package/rollup.config.js +59 -0
- package/src/PlayerDeposit.svelte +177 -0
- package/src/index.ts +4 -0
- package/stories/PlayerDeposit.stories.js +13 -0
- package/tsconfig.json +6 -0
package/index.html
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset='utf-8'>
|
|
5
|
+
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
|
6
|
+
|
|
7
|
+
<title>
|
|
8
|
+
player-deposit
|
|
9
|
+
</title>
|
|
10
|
+
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
+
<script src='dist/player-deposit.js'></script>
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
|
|
16
|
+
<div class="webcomponent">
|
|
17
|
+
<player-deposit></player-deposit>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './dist/player-deposit.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@everymatrix/player-deposit",
|
|
3
|
+
"version": "0.0.163",
|
|
4
|
+
"main": "dist/player-deposit",
|
|
5
|
+
"svelte": "src/index.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "sirv public",
|
|
8
|
+
"build": "cross-env NODE_ENV=\"production\" && rollup -c",
|
|
9
|
+
"dev": "cross-env NODE_ENV=\"development\" rollup -c -w",
|
|
10
|
+
"validate": "svelte-check",
|
|
11
|
+
"test": "echo"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@rollup/plugin-babel": "^5.3.0",
|
|
15
|
+
"@rollup/plugin-commonjs": "^16.0.0",
|
|
16
|
+
"@rollup/plugin-node-resolve": "^10.0.0",
|
|
17
|
+
"@rollup/plugin-typescript": "^6.0.0",
|
|
18
|
+
"@tsconfig/svelte": "^1.0.0",
|
|
19
|
+
"node-sass": "^5.0.0",
|
|
20
|
+
"rollup": "^2.3.4",
|
|
21
|
+
"rollup-plugin-dev-server": "^0.4.3",
|
|
22
|
+
"rollup-plugin-livereload": "^2.0.0",
|
|
23
|
+
"rollup-plugin-svelte": "^7.0.0",
|
|
24
|
+
"rollup-plugin-terser": "^7.0.0",
|
|
25
|
+
"rollup-plugin-uglify": "^6.0.4",
|
|
26
|
+
"svelte-check": "^1.0.0",
|
|
27
|
+
"svelte-preprocess": "^4.0.0",
|
|
28
|
+
"tslib": "^2.0.0",
|
|
29
|
+
"typescript": "^3.9.3"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"cross-env": "^7.0.3",
|
|
33
|
+
"sirv-cli": "^1.0.0",
|
|
34
|
+
"svelte": "^3.0.0"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"gitHead": "0987227fd54b268a6dedfb7687bc94ba10d87ea7"
|
|
40
|
+
}
|
|
Binary file
|
package/public/reset.css
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* http://meyerweb.com/eric/tools/css/reset/
|
|
2
|
+
v2.0 | 20110126
|
|
3
|
+
License: none (public domain)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
html, body, div, span, applet, object, iframe,
|
|
7
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
|
8
|
+
a, abbr, acronym, address, big, cite, code,
|
|
9
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
|
10
|
+
small, strike, strong, sub, sup, tt, var,
|
|
11
|
+
b, u, i, center,
|
|
12
|
+
dl, dt, dd, ol, ul, li,
|
|
13
|
+
fieldset, form, label, legend,
|
|
14
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
|
15
|
+
article, aside, canvas, details, embed,
|
|
16
|
+
figure, figcaption, footer, header, hgroup,
|
|
17
|
+
menu, nav, output, ruby, section, summary,
|
|
18
|
+
time, mark, audio, video {
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
border: 0;
|
|
22
|
+
font-size: 100%;
|
|
23
|
+
font: inherit;
|
|
24
|
+
vertical-align: baseline;
|
|
25
|
+
}
|
|
26
|
+
/* HTML5 display-role reset for older browsers */
|
|
27
|
+
article, aside, details, figcaption, figure,
|
|
28
|
+
footer, header, hgroup, menu, nav, section {
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
body {
|
|
32
|
+
line-height: 1;
|
|
33
|
+
}
|
|
34
|
+
ol, ul {
|
|
35
|
+
list-style: none;
|
|
36
|
+
}
|
|
37
|
+
blockquote, q {
|
|
38
|
+
quotes: none;
|
|
39
|
+
}
|
|
40
|
+
blockquote:before, blockquote:after,
|
|
41
|
+
q:before, q:after {
|
|
42
|
+
content: '';
|
|
43
|
+
content: none;
|
|
44
|
+
}
|
|
45
|
+
table {
|
|
46
|
+
border-collapse: collapse;
|
|
47
|
+
border-spacing: 0;
|
|
48
|
+
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import svelte from 'rollup-plugin-svelte';
|
|
2
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
3
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
4
|
+
import serve from 'rollup-plugin-dev-server';
|
|
5
|
+
import livereload from 'rollup-plugin-livereload';
|
|
6
|
+
import { terser } from 'rollup-plugin-terser';
|
|
7
|
+
import sveltePreprocess from 'svelte-preprocess';
|
|
8
|
+
import typescript from '@rollup/plugin-typescript';
|
|
9
|
+
const production = process.env.NODE_ENV === 'production';
|
|
10
|
+
const dev = process.env.NODE_ENV === 'development';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
input: 'src/index.ts',
|
|
14
|
+
output: {
|
|
15
|
+
sourcemap: true,
|
|
16
|
+
format: 'umd',
|
|
17
|
+
name: 'app',
|
|
18
|
+
file: 'dist/player-deposit.js'
|
|
19
|
+
},
|
|
20
|
+
plugins: [
|
|
21
|
+
svelte({
|
|
22
|
+
preprocess: sveltePreprocess(),
|
|
23
|
+
compilerOptions: {
|
|
24
|
+
// enable run-time checks when not in production
|
|
25
|
+
customElement: true,
|
|
26
|
+
dev: !production
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
29
|
+
commonjs(),
|
|
30
|
+
resolve({
|
|
31
|
+
browser: true,
|
|
32
|
+
dedupe: ['svelte']
|
|
33
|
+
}),
|
|
34
|
+
dev && serve({
|
|
35
|
+
open: true,
|
|
36
|
+
verbose: true,
|
|
37
|
+
allowCrossOrigin: true,
|
|
38
|
+
historyApiFallback: false,
|
|
39
|
+
host: 'localhost',
|
|
40
|
+
port: 5050,
|
|
41
|
+
}),
|
|
42
|
+
dev && livereload({ watch: ['', 'dist'] }),
|
|
43
|
+
typescript({
|
|
44
|
+
sourceMap: !production,
|
|
45
|
+
inlineSources: !production,
|
|
46
|
+
}),
|
|
47
|
+
// If we're building for production (npm run build
|
|
48
|
+
// instead of npm run dev), minify
|
|
49
|
+
production &&
|
|
50
|
+
terser({
|
|
51
|
+
output: {
|
|
52
|
+
comments: "all"
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
],
|
|
56
|
+
watch: {
|
|
57
|
+
clearScreen: false
|
|
58
|
+
}
|
|
59
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
<script lang="typescript">
|
|
3
|
+
import { onMount } from 'svelte';
|
|
4
|
+
import { getDevice } from 'rvhelper';
|
|
5
|
+
|
|
6
|
+
export let endpoint:string = '';
|
|
7
|
+
export let session:string = '';
|
|
8
|
+
export let playerid:string = '';
|
|
9
|
+
|
|
10
|
+
let userAgent:string = window.navigator.userAgent;
|
|
11
|
+
let isMobile = (getDevice(userAgent) === 'PC') ? false : true;
|
|
12
|
+
let isLoading:boolean = true;
|
|
13
|
+
|
|
14
|
+
let currency:string = '';
|
|
15
|
+
let amount:number = 0;
|
|
16
|
+
let iframeUrl:string = '';
|
|
17
|
+
|
|
18
|
+
const toggleScreen = () => {
|
|
19
|
+
window.postMessage({ type: 'ReturnToMenu' }, window.location.href);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const messageHandler = (e:any) => {
|
|
23
|
+
if (e.data) {
|
|
24
|
+
switch(e.data.type) {
|
|
25
|
+
case 'ProfileDetailsData':
|
|
26
|
+
currency = e.data.profileDetails.currency;
|
|
27
|
+
break;
|
|
28
|
+
|
|
29
|
+
default:
|
|
30
|
+
// do nothing
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
switch(e.data.redirect) {
|
|
35
|
+
case 'mm-hc-casino':
|
|
36
|
+
window.postMessage({ type: 'GoToCasino' }, window.location.href);
|
|
37
|
+
break;
|
|
38
|
+
|
|
39
|
+
case 'mm-hc-sports':
|
|
40
|
+
window.postMessage({ type: 'GoToSports' }, window.location.href);
|
|
41
|
+
break;
|
|
42
|
+
|
|
43
|
+
case 'mm-hc-contact':
|
|
44
|
+
window.postMessage({ type: 'GoToCustomerSupport' }, window.location.href);
|
|
45
|
+
break;
|
|
46
|
+
|
|
47
|
+
case 'mm-hc-back-to-merchant':
|
|
48
|
+
window.postMessage({ type: 'GoToHomepage' }, window.location.href);
|
|
49
|
+
break;
|
|
50
|
+
|
|
51
|
+
case 'mm-wm-hc-init-deposit':
|
|
52
|
+
window.postMessage({ type: 'GoToDeposit' }, window.location.href);
|
|
53
|
+
break;
|
|
54
|
+
|
|
55
|
+
default:
|
|
56
|
+
// do nothing
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const getDepositIframe = () => {
|
|
63
|
+
let url = new URL(`${endpoint}/player/${playerid}/hostedcashier/initializedeposit`);
|
|
64
|
+
|
|
65
|
+
let options = {
|
|
66
|
+
method: "POST",
|
|
67
|
+
headers: {
|
|
68
|
+
'playerId': playerid,
|
|
69
|
+
'X-SessionId': session,
|
|
70
|
+
'currency': currency,
|
|
71
|
+
'amount': amount,
|
|
72
|
+
'cashierMode': 'Default',
|
|
73
|
+
'IsShortCashier': false,
|
|
74
|
+
'accept': 'application/json'
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
fetch(url, options)
|
|
79
|
+
.then((res:any) => res.json())
|
|
80
|
+
.then((data:any) => {
|
|
81
|
+
|
|
82
|
+
isLoading = false;
|
|
83
|
+
|
|
84
|
+
iframeUrl = data.CashierUrl;
|
|
85
|
+
|
|
86
|
+
}, (err:any) => {
|
|
87
|
+
console.error(err);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
onMount(() => {
|
|
92
|
+
window.addEventListener('message', messageHandler, false);
|
|
93
|
+
|
|
94
|
+
return () => {
|
|
95
|
+
window.removeEventListener('message', messageHandler);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
$: session && playerid && endpoint && getDepositIframe();
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<div class="DepositWrapper {isMobile ? 'DepositWrapperMobile' : ''}">
|
|
103
|
+
{#if isMobile}
|
|
104
|
+
<div class="MenuReturnButton" on:click={() => toggleScreen()}>
|
|
105
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15"><defs><style>.aaa{fill:#d0046c;}</style></defs><g transform="translate(-20 -158)">
|
|
106
|
+
<g transform="translate(20 158)">
|
|
107
|
+
<path class="aaa" d="M7.5,0,6.136,1.364,11.3,6.526H0V8.474H11.3L6.136,13.636,7.5,15,15,7.5Z" transform="translate(15 15) rotate(180)"/>
|
|
108
|
+
</g></g>
|
|
109
|
+
</svg>
|
|
110
|
+
<h2 class="DepositTitleMobile">Deposit</h2>
|
|
111
|
+
</div>
|
|
112
|
+
{/if}
|
|
113
|
+
<h2 class="DepositTitle {isMobile ? 'DepositTitleNone' : ''}">Deposit</h2>
|
|
114
|
+
{#if isLoading}
|
|
115
|
+
<p>Loading, please wait ...</p>
|
|
116
|
+
{:else}
|
|
117
|
+
<div class="DepositIframeWrapper">
|
|
118
|
+
<iframe src={iframeUrl} title="Deposit Iframe"></iframe>
|
|
119
|
+
</div>
|
|
120
|
+
{/if}
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
<style lang="scss">
|
|
125
|
+
//This function does a multiplication
|
|
126
|
+
// in order to work with px the
|
|
127
|
+
// same way as working with em
|
|
128
|
+
@function ttp($value) {
|
|
129
|
+
$multiplicator: 16px;
|
|
130
|
+
@return $value * $multiplicator;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.DepositWrapper {
|
|
134
|
+
color: #07072A;
|
|
135
|
+
padding: 50px 50px 30px 50px;
|
|
136
|
+
max-width: 100%;
|
|
137
|
+
|
|
138
|
+
&.DepositWrapperMobile {
|
|
139
|
+
padding: 20px 15px;
|
|
140
|
+
max-width: unset;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.MenuReturnButton{
|
|
145
|
+
color: #D0046C;
|
|
146
|
+
display: inline-flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
column-gap: 10px;
|
|
149
|
+
margin-bottom: 30px;
|
|
150
|
+
& svg {
|
|
151
|
+
fill: #D0046C;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.DepositTitle {
|
|
156
|
+
font-size: 26px;
|
|
157
|
+
color: #D0046C;
|
|
158
|
+
font-weight: 400;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.DepositTitleMobile {
|
|
162
|
+
font-size: 16px;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.DepositTitleNone {
|
|
166
|
+
display: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.DepositIframeWrapper {
|
|
170
|
+
iframe {
|
|
171
|
+
border: none;
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 85vh;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
</style>
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { html } from 'lit-element';
|
|
2
|
+
|
|
3
|
+
import PlayerDeposit from '../src/PlayerDeposit';
|
|
4
|
+
|
|
5
|
+
// This default export determines where your story goes in the story list
|
|
6
|
+
export default {
|
|
7
|
+
title: 'PlayerDeposit',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// 👇 We create a “template” of how args map to rendering
|
|
11
|
+
const PlayerDeposit = ({ aProperty }) => html`<player-deposit></player-deposit>`;
|
|
12
|
+
|
|
13
|
+
export const FirstStory = PlayerDeposit.bind({});
|