@everymatrix/cashier-page 1.27.3
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/cashier-page.js +786 -0
- package/dist/cashier-page.js.map +1 -0
- package/index.html +53 -0
- package/index.js +1 -0
- package/package.json +39 -0
- package/public/favicon.png +0 -0
- package/public/reset.css +48 -0
- package/rollup.config.js +59 -0
- package/src/CashierPage.svelte +255 -0
- package/src/CashierPage.types.ts +74 -0
- package/src/i18n.js +27 -0
- package/src/index.ts +4 -0
- package/src/translations.js +16 -0
- package/stories/CashierPage.stories.js +13 -0
- package/tsconfig.json +6 -0
package/index.html
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
cashier-page
|
|
9
|
+
</title>
|
|
10
|
+
<link rel="stylesheet" href="public/reset.css">
|
|
11
|
+
<script src='dist/cashier-page.js'></script>
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
<style>
|
|
16
|
+
html,body { margin: 0; padding: 0; height: 100%; font-family: "Helvetica Neue", "Helvetica", sans-serif; }
|
|
17
|
+
.header { display: flex; justify-content: center; align-items: center; padding: 10px 20px; margin-bottom: 20px; background: #42a3e2; box-shadow: 3px 4px 5px 0px rgba(0,0,0, .2); }
|
|
18
|
+
.header__logo svg { height: 50px; width: 50px; margin-right: 5px; }
|
|
19
|
+
.header__name { color: #fff; }
|
|
20
|
+
.header__name span { margin-right: 10px; font-weight: bold; }
|
|
21
|
+
.webcomponent { padding: 10px 20px; }
|
|
22
|
+
</style>
|
|
23
|
+
<header class="header">
|
|
24
|
+
<div class="header__logo">
|
|
25
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="161" height="132" viewBox="0 0 161 132"><defs><linearGradient x1="0%" y1="50%" y2="50%" id="a"><stop stop-color="#2A3B8F" offset="0%"/><stop stop-color="#29ABE2" offset="100%"/></linearGradient><linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="c"><stop stop-color="#B4D44E" offset="0%"/><stop stop-color="#E7F716" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path fill="#166DA5" d="M160.6 65.9l-17.4 29.3-24.4-29.7 24.4-28.9z"/><path fill="#8FDB69" d="M141.3 100.2l-26.5-31.7-15.9 26.6 24.7 36.1z"/><path fill="#166DA5" d="M141 31.4l-26.2 31.8-15.9-26.6L123.6.9z"/><path fill="url(#a)" opacity=".95" d="M61.1 31.4H141L123.4.7H78.7z M114.8 63.3H159l-15.9-26.8H98.8"/><path fill="url(#c)" opacity=".95" d="M141.3 100.3H61l17.6 30.5h45z M114.8 68.4H159l-15.9 26.8H98.8"/><path fill="#010101" d="M78.6 130.8L41 65.8 79.1.8H37.9L.4 65.8l37.5 65z"/></g></svg>
|
|
26
|
+
</div>
|
|
27
|
+
<h1 class="header__name">
|
|
28
|
+
<span>WEBCOMPONENT:</span> cashier-page
|
|
29
|
+
</h1>
|
|
30
|
+
</header>
|
|
31
|
+
|
|
32
|
+
<div class="webcomponent">
|
|
33
|
+
<cashier-page
|
|
34
|
+
lang="en"
|
|
35
|
+
local="en-US"
|
|
36
|
+
channel="Desktop"
|
|
37
|
+
type="Withdraw"
|
|
38
|
+
session="f32ae5ee-9728-4c94-a4ec-14ffc28a1d81"
|
|
39
|
+
translationurl="https://static.everymatrix.com/mmstage/translations/1995/mm-localization-en.json"
|
|
40
|
+
assetsurl="https://static.everymatrix.com/mmstage/cashier/operator-assets/1995"
|
|
41
|
+
endpoint="https://api-stage-odeonbet-norway.apiopp.com/"
|
|
42
|
+
merchantid="1995"
|
|
43
|
+
customerid="6221239"
|
|
44
|
+
currency="TRY"
|
|
45
|
+
channel="Desktop"
|
|
46
|
+
type="Withdraw"
|
|
47
|
+
numberofmethodsshown="1"
|
|
48
|
+
>
|
|
49
|
+
</cashier-page>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
</body>
|
|
53
|
+
</html>
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './dist/cashier-page.js';
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@everymatrix/cashier-page",
|
|
3
|
+
"version": "1.27.3",
|
|
4
|
+
"main": "index.js",
|
|
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
|
+
"rollup": "^2.3.4",
|
|
20
|
+
"rollup-plugin-dev-server": "^0.4.3",
|
|
21
|
+
"rollup-plugin-livereload": "^2.0.0",
|
|
22
|
+
"rollup-plugin-svelte": "^7.0.0",
|
|
23
|
+
"rollup-plugin-terser": "^7.0.0",
|
|
24
|
+
"rollup-plugin-uglify": "^6.0.4",
|
|
25
|
+
"svelte-check": "^1.0.0",
|
|
26
|
+
"svelte-preprocess": "^5.0.0",
|
|
27
|
+
"tslib": "^2.0.0",
|
|
28
|
+
"typescript": "^3.9.3"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"cross-env": "^7.0.3",
|
|
32
|
+
"sirv-cli": "^1.0.0",
|
|
33
|
+
"svelte": "^3.0.0"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"gitHead": "bb3f018dda0d4518201642689dcd1745b1d9153e"
|
|
39
|
+
}
|
|
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/cashier-page.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,255 @@
|
|
|
1
|
+
<svelte:options tag={null} />
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
import {onMount} from "svelte";
|
|
4
|
+
import {_, addNewMessages, setLocale} from './i18n';
|
|
5
|
+
import {TRANSLATIONS} from './translations';
|
|
6
|
+
|
|
7
|
+
import type {PaymentMethod} from "./CashierPage.types";
|
|
8
|
+
import {TxnChannel, TxnType} from "./CashierPage.types";
|
|
9
|
+
|
|
10
|
+
import '@everymatrix/cashier-methods-list';
|
|
11
|
+
import '@everymatrix/cashier-method-details';
|
|
12
|
+
|
|
13
|
+
export let endpoint: string;
|
|
14
|
+
export let session: string;
|
|
15
|
+
export let lang: string = 'en';
|
|
16
|
+
export let local: string = 'en-US';
|
|
17
|
+
export let translationurl: string;
|
|
18
|
+
export let customerid: string;
|
|
19
|
+
export let currency: string;
|
|
20
|
+
export let amount: number;
|
|
21
|
+
export let assetsurl: string;
|
|
22
|
+
export let type: string = TxnType.Deposit;
|
|
23
|
+
export let channel: string = TxnChannel.Desktop;
|
|
24
|
+
export let successUrl: string;
|
|
25
|
+
export let failUrl: string;
|
|
26
|
+
export let cancelUrl: string;
|
|
27
|
+
export let numberofmethodsshown: string;
|
|
28
|
+
export let clientstyling:string = '';
|
|
29
|
+
export let clientstylingurl:string = ''
|
|
30
|
+
|
|
31
|
+
let xPlayerSessionId: string;
|
|
32
|
+
let xPaymentSessionToken: string;
|
|
33
|
+
let xConfirmSessionToken: string;
|
|
34
|
+
let paymentMethods: PaymentMethod[] = [];
|
|
35
|
+
let selectedPaymentMethod: PaymentMethod = {} as PaymentMethod;
|
|
36
|
+
let fields = {};
|
|
37
|
+
let isLoading:boolean = false;
|
|
38
|
+
let isMethodOpen:boolean = false;
|
|
39
|
+
let displayNone:boolean = false;
|
|
40
|
+
let customStylingContainer:HTMLElement;
|
|
41
|
+
let prepareRequest;
|
|
42
|
+
let showConfirmModal:boolean = false;
|
|
43
|
+
let redirectUrl: string;
|
|
44
|
+
let windowRedirect: Window;
|
|
45
|
+
let showRedirectNotification: boolean;
|
|
46
|
+
let showRetryNotification: boolean;
|
|
47
|
+
let isProcessingTxn: boolean;
|
|
48
|
+
let isTranslationLoaded: boolean;
|
|
49
|
+
let showMethodDetailsPage: boolean = false;
|
|
50
|
+
|
|
51
|
+
$: endpoint && session && customerid && lang && channel && type && getPlayerSession();
|
|
52
|
+
$: clientstyling && customStylingContainer && setClientStyling();
|
|
53
|
+
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
|
54
|
+
$: lang && setActiveLanguage();
|
|
55
|
+
$: lang && translationurl && setTranslationUrl();
|
|
56
|
+
|
|
57
|
+
const setActiveLanguage = ():void => {
|
|
58
|
+
setLocale(lang);
|
|
59
|
+
}
|
|
60
|
+
const setTranslationUrl = () => {
|
|
61
|
+
let url:string = translationurl;
|
|
62
|
+
if (url) {
|
|
63
|
+
return fetch(url).then((res:any) => res.json())
|
|
64
|
+
.then((res) => {
|
|
65
|
+
Object.keys(res).forEach((item:any):void => {
|
|
66
|
+
addNewMessages(item, res[item]);
|
|
67
|
+
isTranslationLoaded = true;
|
|
68
|
+
});
|
|
69
|
+
}).catch((err:any) => {
|
|
70
|
+
isTranslationLoaded = true;
|
|
71
|
+
console.log(err);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
Object.keys(TRANSLATIONS).forEach((item:any):void => {
|
|
77
|
+
addNewMessages(item, TRANSLATIONS[item]);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const getPlayerSession = () => {
|
|
81
|
+
const url:URL = new URL(`${endpoint}/v2/player/${customerid}/payment/GetPaymentSession`);
|
|
82
|
+
const headers = new Headers();
|
|
83
|
+
headers.append("accept", "application/json");
|
|
84
|
+
headers.append("Content-Type", "application/json");
|
|
85
|
+
headers.append("X-SessionId", `${session}`);
|
|
86
|
+
const requestParams:RequestInit = {
|
|
87
|
+
method: "POST",
|
|
88
|
+
mode: "cors",
|
|
89
|
+
headers: headers,
|
|
90
|
+
body: JSON.stringify({
|
|
91
|
+
"Channel": channel,
|
|
92
|
+
"Type": type,
|
|
93
|
+
"SuccessUrl": successUrl,
|
|
94
|
+
"CancelUrl": cancelUrl,
|
|
95
|
+
"FailUrl": failUrl,
|
|
96
|
+
"Language": lang,
|
|
97
|
+
"ProductType": "Casino"
|
|
98
|
+
})
|
|
99
|
+
};
|
|
100
|
+
fetch(url, requestParams).then(res => res.json()).then(data => {
|
|
101
|
+
xPaymentSessionToken = data.XPaymentSessionToken;
|
|
102
|
+
isLoading = false;
|
|
103
|
+
})
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const selectPayMeth = (e) => {
|
|
107
|
+
selectedPaymentMethod.Name = e.detail.Name;
|
|
108
|
+
showMethodDetailsPage = true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const setClientStyling = ():void => {
|
|
112
|
+
let sheet = document.createElement('style');
|
|
113
|
+
sheet.innerHTML = clientstyling;
|
|
114
|
+
customStylingContainer.appendChild(sheet);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const setClientStylingURL = ():void => {
|
|
118
|
+
displayNone = true;
|
|
119
|
+
|
|
120
|
+
let url:URL = new URL(clientstylingurl);
|
|
121
|
+
let cssFile:HTMLElement = document.createElement('style');
|
|
122
|
+
|
|
123
|
+
fetch(url.href)
|
|
124
|
+
.then((res:any) => res.text())
|
|
125
|
+
.then((data:any) => {
|
|
126
|
+
cssFile.innerHTML = data
|
|
127
|
+
|
|
128
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
|
|
129
|
+
setTimeout(() => { displayNone = false; }, 500);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const hideMethodDetails = (e) => {
|
|
134
|
+
showMethodDetailsPage = !e.detail.hideMethodDetails
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
onMount(() => {
|
|
138
|
+
window.addEventListener('selectPayMeth', selectPayMeth, false);
|
|
139
|
+
window.addEventListener('hidePaymentDetails', hideMethodDetails, false);
|
|
140
|
+
|
|
141
|
+
return () => {
|
|
142
|
+
window.removeEventListener('hidePaymentDetails', hideMethodDetails);
|
|
143
|
+
window.removeEventListener('selectPayMeth', selectPayMeth);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
</script>
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
<div class={showMethodDetailsPage ? "CashierPageWidget BothSections" : "CashierPageWidget"} bind:this={customStylingContainer}>
|
|
151
|
+
{#if lang}
|
|
152
|
+
<div class="Header">{ $_(`header.${type.toLowerCase()}`)}</div>
|
|
153
|
+
{/if}
|
|
154
|
+
<div class="CashierPage">
|
|
155
|
+
{#if isLoading}
|
|
156
|
+
<p class="Message">{$_('loading')}</p>
|
|
157
|
+
{:else}
|
|
158
|
+
<cashier-methods-list
|
|
159
|
+
{lang}
|
|
160
|
+
{local}
|
|
161
|
+
{translationurl}
|
|
162
|
+
{endpoint}
|
|
163
|
+
{customerid}
|
|
164
|
+
{currency}
|
|
165
|
+
{numberofmethodsshown}
|
|
166
|
+
session="{xPaymentSessionToken}"
|
|
167
|
+
></cashier-methods-list>
|
|
168
|
+
{/if}
|
|
169
|
+
<cashier-method-details
|
|
170
|
+
{lang}
|
|
171
|
+
{local}
|
|
172
|
+
{translationurl}
|
|
173
|
+
{endpoint}
|
|
174
|
+
{customerid}
|
|
175
|
+
{currency}
|
|
176
|
+
{amount}
|
|
177
|
+
{assetsurl}
|
|
178
|
+
{type}
|
|
179
|
+
selectedpaymentmethodname="{selectedPaymentMethod.Name}"
|
|
180
|
+
session="{xPaymentSessionToken}"
|
|
181
|
+
></cashier-method-details>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
<style lang="scss">
|
|
187
|
+
@keyframes loading-spinner {
|
|
188
|
+
from {
|
|
189
|
+
transform: rotate(0deg)
|
|
190
|
+
}
|
|
191
|
+
to {
|
|
192
|
+
transform: rotate(360deg)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
.CashierPageWidget {
|
|
196
|
+
container-type: inline-size;
|
|
197
|
+
container-name: deposit-page;
|
|
198
|
+
}
|
|
199
|
+
.BothSections {
|
|
200
|
+
.Header {
|
|
201
|
+
transition: all 1s;
|
|
202
|
+
width: 100%;
|
|
203
|
+
}
|
|
204
|
+
.CashierPage {
|
|
205
|
+
gap: 23px;
|
|
206
|
+
}
|
|
207
|
+
cashier-method-details {
|
|
208
|
+
transition: all 1s;
|
|
209
|
+
width: 50%;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
.Header {
|
|
213
|
+
width: 50%;
|
|
214
|
+
display: flex;
|
|
215
|
+
margin: auto;
|
|
216
|
+
padding: 15px 0;
|
|
217
|
+
font-size: var(--emw--font-size-small, 14px);
|
|
218
|
+
font-weight: bold;
|
|
219
|
+
color: var(--emw--color-black, #111);
|
|
220
|
+
line-height: var(--emw--font-size-small, 14px);
|
|
221
|
+
}
|
|
222
|
+
.CashierPage {
|
|
223
|
+
position: relative;
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-direction: row;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
}
|
|
228
|
+
cashier-methods-list {
|
|
229
|
+
width: 50%;
|
|
230
|
+
}
|
|
231
|
+
cashier-method-details {
|
|
232
|
+
width: 0;
|
|
233
|
+
}
|
|
234
|
+
@container deposit-page (max-width:750px) {
|
|
235
|
+
.Header {
|
|
236
|
+
width: 100%;
|
|
237
|
+
}
|
|
238
|
+
.CashierPage, .BothSections .CashierPage {
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
gap: 0;
|
|
241
|
+
cashier-methods-list, cashier-method-details {
|
|
242
|
+
width: 100%;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
cashier-method-details {
|
|
246
|
+
display: none;
|
|
247
|
+
}
|
|
248
|
+
.BothSections cashier-method-details {
|
|
249
|
+
display: flex;
|
|
250
|
+
}
|
|
251
|
+
.BothSections cashier-methods-list {
|
|
252
|
+
display: none;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export interface PaymentMethod {
|
|
2
|
+
Name: string;
|
|
3
|
+
PaymentSolutionName: string;
|
|
4
|
+
Label: string;
|
|
5
|
+
Description: string;
|
|
6
|
+
IsAmountConfigurable: boolean;
|
|
7
|
+
HideAmountField: boolean;
|
|
8
|
+
IsIntegerAmount: boolean;
|
|
9
|
+
IsPrefirmSupported: boolean;
|
|
10
|
+
IsFake: boolean;
|
|
11
|
+
RedirectLink: string;
|
|
12
|
+
AmountMultiplier: number;
|
|
13
|
+
RedirectionMode: Number;
|
|
14
|
+
DisplayCurrency: PaymentMethodCurrencyConfig;
|
|
15
|
+
Currencies: Array<PaymentMethodCurrencyConfig>;
|
|
16
|
+
Fields: Array<PaymentMethodDetails>;
|
|
17
|
+
Account: any;
|
|
18
|
+
Logos: any;
|
|
19
|
+
PredefinedAmounts: number[];
|
|
20
|
+
PaymentMethodsAmounts: any;
|
|
21
|
+
InfoLink?: string;
|
|
22
|
+
ShortDescription?: string;
|
|
23
|
+
logoUrls: any;
|
|
24
|
+
DisableContinueButton: boolean;
|
|
25
|
+
Settings: any;
|
|
26
|
+
Tags: string[];
|
|
27
|
+
CardToken: string;
|
|
28
|
+
LoaderDisplayTime: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface PaymentMethodCurrencyConfig {
|
|
32
|
+
Name: string;
|
|
33
|
+
Label: string;
|
|
34
|
+
Description: string;
|
|
35
|
+
Amounts: Array<number>;
|
|
36
|
+
MinAmountLimit: number;
|
|
37
|
+
MaxAmountLimit: number;
|
|
38
|
+
}
|
|
39
|
+
export interface PaymentMethodDetails {
|
|
40
|
+
Name: string;
|
|
41
|
+
Label: string;
|
|
42
|
+
Description: string;
|
|
43
|
+
Type: string;
|
|
44
|
+
DefaultValue: any;
|
|
45
|
+
Format: string;
|
|
46
|
+
Placeholder: string;
|
|
47
|
+
DisplayPlaceholder?: string;
|
|
48
|
+
IsReadonly: boolean;
|
|
49
|
+
IsRequired: boolean;
|
|
50
|
+
IsPrimaryField: boolean;
|
|
51
|
+
DemandUserInput: boolean;
|
|
52
|
+
AutoTrim: boolean;
|
|
53
|
+
MaxValue: string;
|
|
54
|
+
MinValue: string;
|
|
55
|
+
AutoUppercase: boolean;
|
|
56
|
+
CorrelationFieldName: string;
|
|
57
|
+
CorrelationFieldValue: string[];
|
|
58
|
+
NotEqualToFieldName: string;
|
|
59
|
+
Values: any[];
|
|
60
|
+
Selected: Object;
|
|
61
|
+
UseCopyButton: boolean;
|
|
62
|
+
InputMask: string[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export enum TxnType {
|
|
66
|
+
Deposit='Deposit',
|
|
67
|
+
Withdraw='Withdraw'
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export enum TxnChannel {
|
|
71
|
+
Desktop='Desktop',
|
|
72
|
+
Mobile='Mobile',
|
|
73
|
+
NativeApp='NativeApp'
|
|
74
|
+
}
|
package/src/i18n.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dictionary,
|
|
3
|
+
locale,
|
|
4
|
+
addMessages,
|
|
5
|
+
_
|
|
6
|
+
} from 'svelte-i18n';
|
|
7
|
+
|
|
8
|
+
function setupI18n({ withLocale: _locale, translations }) {
|
|
9
|
+
locale.subscribe((data) => {
|
|
10
|
+
if (data == null) {
|
|
11
|
+
dictionary.set(translations);
|
|
12
|
+
locale.set(_locale);
|
|
13
|
+
}
|
|
14
|
+
}); // maybe we will need this to make sure that the i18n is set up only once
|
|
15
|
+
/*dictionary.set(translations);
|
|
16
|
+
locale.set(_locale);*/
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function addNewMessages(lang, dict) {
|
|
20
|
+
addMessages(lang, dict);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function setLocale(_locale) {
|
|
24
|
+
locale.set(_locale);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { _, setupI18n, addNewMessages, setLocale };
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const TRANSLATIONS = {
|
|
2
|
+
"en": {
|
|
3
|
+
"loading": "Loading...",
|
|
4
|
+
"header": {
|
|
5
|
+
"deposit": "Deposit",
|
|
6
|
+
"withdraw": "Withdraw"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"hr": {
|
|
10
|
+
"loading": "Učitavanje",
|
|
11
|
+
"header": {
|
|
12
|
+
"deposit": "Uplata",
|
|
13
|
+
"withdraw": "Visszavonás"
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { html } from 'lit-element';
|
|
2
|
+
|
|
3
|
+
import CashierPage from '../src/CashierPage';
|
|
4
|
+
|
|
5
|
+
// This default export determines where your story goes in the story list
|
|
6
|
+
export default {
|
|
7
|
+
title: 'CashierPage',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// 👇 We create a “template” of how args map to rendering
|
|
11
|
+
const CashierPage = ({ aProperty }) => html`<cashier-page></cashier-page>`;
|
|
12
|
+
|
|
13
|
+
export const FirstStory = CashierPage.bind({});
|