@everymatrix/cashier-method-details 1.22.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,592 @@
1
+ <svelte:options tag={null} />
2
+ <script lang="ts">
3
+ import { onMount } from "svelte";
4
+ import { _, addNewMessages, setupI18n, setLocale } from './i18n';
5
+ import { TRANSLATIONS } from './translations';
6
+
7
+ import '@everymatrix/cashier-iframe-redirect';
8
+ import '@everymatrix/cashier-confirm-modal'
9
+ import '@everymatrix/cashier-notifications'
10
+
11
+ import type {PaymentMethod} from "./CashierMethodDetails.types";
12
+
13
+ export enum FieldTypes {
14
+ Unknown ='Unknown',
15
+ Text ='Text',
16
+ Boolean ='Boolean',
17
+ Number ='Number',
18
+ Money ='Money',
19
+ DateTime ='DateTime',
20
+ Lookup ='Lookup',
21
+ IpAddress ='IpAddress',
22
+ Date ='Date',
23
+ Time ='Time',
24
+ LookupCollection = 'LookupCollection',
25
+ Hidden = 'Hidden',
26
+ Label = 'Label',
27
+ Password = 'Password',
28
+ Link = 'Link',
29
+ Image = 'Image',
30
+ Html = 'Html',
31
+ QRCod = 'QRCode'
32
+ }
33
+ export let endpoint: string;
34
+ export let session: string;
35
+ export let lang: string;
36
+ export let translationurl: string;
37
+ export let customerid: string;
38
+ export let currency: string;
39
+ export let amount: number;
40
+ export let selectedpaymentmethodname: string;
41
+ export let clientstyling:string = '';
42
+ export let clientstylingurl:string = ''
43
+
44
+ const VISIBLE_FIELD_TYPES: string[] =
45
+ 'Text,Number,Money,Boolean,Lookup,Date,Time,DateTime,Password,Label,Link,QRCode'.split(',');
46
+ export enum RedirectionModeStringEnum {
47
+ Default = 'Default',
48
+ RedirectWithRetry = 'Redirect'
49
+ }
50
+
51
+ let xPaymentSessionToken: string;
52
+ let selectedPaymentMethod: PaymentMethod = {} as PaymentMethod;
53
+ let fields = [];
54
+ let prepareFields = {};
55
+ let isLoading:boolean = false;
56
+ let isMethodOpen:boolean = false;
57
+ let displayNone:boolean = false;
58
+ let customStylingContainer:HTMLElement;
59
+ let prepareRequest;
60
+ let showConfirmModal:boolean = false;
61
+ let redirectUrl: string;
62
+ let windowRedirect: Window;
63
+ let showRedirectNotification: boolean;
64
+ let redirectMode: RedirectionModeStringEnum;
65
+ let showRetryNotification: boolean;
66
+ let isProcessingTxn: boolean;
67
+ let isTranslationLoaded: boolean;
68
+ let openedLookup: number | null;
69
+ let clickedElem: HTMLElement;
70
+ $: endpoint && session && selectedpaymentmethodname && currency && getPaymentDetails();
71
+ $: clientstyling && customStylingContainer && setClientStyling();
72
+ $: clientstylingurl && customStylingContainer && setClientStylingURL();
73
+ $: lang && setActiveLanguage();
74
+ $: lang && translationurl && setTranslationUrl();
75
+
76
+ const setActiveLanguage = ():void => {
77
+ setLocale(lang);
78
+ }
79
+ const setTranslationUrl = () => {
80
+ let url:string = translationurl;
81
+ if (url) {
82
+ return fetch(url).then((res:any) => res.json())
83
+ .then((res) => {
84
+ Object.keys(res).forEach((item:any):void => {
85
+ addNewMessages(item, res[item]);
86
+ isTranslationLoaded = true;
87
+ });
88
+ }).catch((err:any) => {
89
+ isTranslationLoaded = true;
90
+ });
91
+ }
92
+ }
93
+
94
+ Object.keys(TRANSLATIONS).forEach((item:any):void => {
95
+ addNewMessages(item, TRANSLATIONS[item]);
96
+ });
97
+
98
+ const getPaymentDetails = () => {
99
+ const url:URL = new URL(`${endpoint}/v1/player/${customerid}/payment/GetPaymentMethod`);
100
+ const headers = new Headers();
101
+ headers.append("accept", "application/json");
102
+ headers.append("Content-Type", "application/json");
103
+ const requestParams:RequestInit = {
104
+ method: "POST",
105
+ mode: "cors",
106
+ headers: headers,
107
+ body: JSON.stringify({
108
+ "PaymentMethodName": selectedpaymentmethodname,
109
+ "Currency": currency,
110
+ "XPaymentSessionToken": session
111
+ })
112
+ }
113
+ fetch(url, requestParams).then(res => res.json()).then(data => {
114
+ xPaymentSessionToken = data.XPaymentSessionToken;
115
+ selectedPaymentMethod = data.PaymentMethod;
116
+ fields = selectedPaymentMethod.Fields;
117
+ prepareFields = {};
118
+ })
119
+ }
120
+
121
+ const setClientStyling = ():void => {
122
+ let sheet = document.createElement('style');
123
+ sheet.innerHTML = clientstyling;
124
+ customStylingContainer.appendChild(sheet);
125
+ }
126
+
127
+ const setClientStylingURL = ():void => {
128
+ displayNone = true;
129
+
130
+ let url:URL = new URL(clientstylingurl);
131
+ let cssFile:HTMLElement = document.createElement('style');
132
+
133
+ fetch(url.href)
134
+ .then((res:any) => res.text())
135
+ .then((data:any) => {
136
+ cssFile.innerHTML = data
137
+
138
+ setTimeout(() => { customStylingContainer.appendChild(cssFile) }, 1);
139
+ setTimeout(() => { displayNone = false; }, 500);
140
+ });
141
+ }
142
+
143
+ onMount(() => {
144
+ window.addEventListener('closeModal', closeModal, false);
145
+ window.addEventListener('confirmModal', confirmTxn, false);
146
+ window.addEventListener('closeIframe', closeIframe, false);
147
+ window.addEventListener('notificationButtonClick', retryRedirect, false);
148
+ document.addEventListener('click',closeAllLookups)
149
+
150
+ return () => {
151
+ window.removeEventListener('closeModal', closeModal);
152
+ window.removeEventListener('confirmModal', confirmTxn);
153
+ window.removeEventListener('closeIframe', closeIframe);
154
+ window.removeEventListener('notificationButtonClick', retryRedirect);
155
+ }
156
+
157
+ });
158
+
159
+ const closeAllLookups = (e) => {
160
+ if(!e.composedPath().includes(clickedElem)){
161
+ openedLookup = null;
162
+ }
163
+ }
164
+
165
+ const showLookup = (event, index) => {
166
+ if (index === openedLookup) {
167
+ openedLookup = null
168
+ return;
169
+ }
170
+ clickedElem = event.composedPath()[0]
171
+ openedLookup = index
172
+ }
173
+
174
+ const prepareTxn = () => {
175
+ isProcessingTxn = true;
176
+ const url:URL = new URL(`${endpoint}/v1/player/${customerid}/payment/GetPaymentPrepare`);
177
+ const headers = new Headers();
178
+ headers.append("accept", "application/json");
179
+ headers.append("Content-Type", "application/json");
180
+ const requestParams:RequestInit = {
181
+ method: "POST",
182
+ mode: "cors",
183
+ headers: headers,
184
+ body: JSON.stringify({
185
+ "XPaymentSessionToken": xPaymentSessionToken,
186
+ "Transaction": {
187
+ "PaymentMethod": selectedPaymentMethod.Name,
188
+ "Amount": amount,
189
+ "Currency": currency,
190
+ "CustomFields": prepareFields
191
+ },
192
+ "Account": {}
193
+ })
194
+ }
195
+ fetch(url, requestParams).then((res) => res.json()).then(data => {
196
+ xPaymentSessionToken = data.XPaymentSessionToken;
197
+ isProcessingTxn = false;
198
+ showConfirmModal = true;
199
+ })
200
+ }
201
+ const closeIframe = () => {
202
+ redirectUrl = null;
203
+ }
204
+ const closeModal = () => {
205
+ showConfirmModal = false;
206
+ }
207
+ const confirmTxn = () => {
208
+ isProcessingTxn = true;
209
+ const url:URL = new URL(`${endpoint}/v1/player/${customerid}/payment/GetPaymentConfirm`);
210
+ const headers = new Headers();
211
+ headers.append("accept", "application/json");
212
+ headers.append("Content-Type", "application/json");
213
+ const requestParams:RequestInit = {
214
+ method: "POST",
215
+ mode: "cors",
216
+ headers: headers,
217
+ body: JSON.stringify({
218
+ "XPaymentSessionToken": xPaymentSessionToken,
219
+ })
220
+ }
221
+ fetch(url, requestParams).then((res) => res.json()).then(data => {
222
+ xPaymentSessionToken = data.XPaymentSessionToken;
223
+ redirectUrl = data.RedirectUrl;
224
+ redirectMode = data.RedirectionMode;
225
+ isProcessingTxn = false;
226
+ if (data.RedirectionMode === RedirectionModeStringEnum.RedirectWithRetry) {
227
+ windowRedirect = window.open(data.RedirectUrl, '_blank');
228
+ showRedirectNotification = !!windowRedirect;
229
+ if (!windowRedirect) {
230
+ showRetryNotification = true;
231
+ }
232
+ }
233
+ })
234
+ }
235
+ const retryRedirect = () => {
236
+ windowRedirect = window.open(redirectUrl, '_blank');
237
+ showRedirectNotification = true;
238
+ showRetryNotification = false;
239
+ }
240
+
241
+ const showField = (field) => {
242
+ return !field.CorrelationFieldName || (field.CorrelationFieldName && prepareFields[field.CorrelationFieldName] === field.CorrelationFieldValue)
243
+ }
244
+
245
+
246
+ </script>
247
+
248
+
249
+ <div class="CashierMethodDetails">
250
+ {#if isTranslationLoaded && selectedPaymentMethod.Name}
251
+ <div class="MethodsDetails">
252
+ <form on:submit|preventDefault={prepareTxn}>
253
+ <div class="FieldWrapper">
254
+ <div class="form-logo">
255
+ <div class="SelectedLogoWrapper">
256
+ <img src={selectedPaymentMethod.Logos[0].LogoUrl} alt={selectedPaymentMethod.Label} />
257
+ </div>
258
+ <div class="SelectedLogoDescription">
259
+ {selectedPaymentMethod.Label}
260
+ </div>
261
+ </div>
262
+ {#if !selectedPaymentMethod.HideAmountField}
263
+ <div class="Amount">
264
+ <label>
265
+ <span class="Required">
266
+ {$_('amountLabel')}
267
+ </span>
268
+ {#if selectedPaymentMethod.IsAmountConfigurable}
269
+ <input type="number" bind:value={amount} placeholder="{$_('amountPlaceholder')}">
270
+ {#if selectedPaymentMethod.DisplayCurrency}
271
+ <span class="AmountLimits">
272
+ {selectedPaymentMethod.DisplayCurrency.MinAmountLimit ? `${$_('generalMin')} ${selectedPaymentMethod.DisplayCurrency.MinAmountLimit} ${currency}` : ''}
273
+ {selectedPaymentMethod.DisplayCurrency.MaxAmountLimit ? `/ ${$_('generalMax')} ${selectedPaymentMethod.DisplayCurrency.MaxAmountLimit} ${currency}` : ''}
274
+ </span>
275
+ {/if}
276
+ {:else}
277
+ <span class="NonConfigurableAmount">
278
+ {amount} {currency}
279
+ </span>
280
+ {/if}
281
+ </label>
282
+ </div>
283
+ {/if}
284
+ </div>
285
+ {#each fields as field, index}
286
+ {#if showField(field)}
287
+ <div class="FieldWrapper" class:Hidden={field.Type === FieldTypes.Hidden}>
288
+ <label>
289
+ <span class:Required={field.IsRequired}>{field.Label}</span>
290
+ {#if field.Description && field.Description !== field.Label}
291
+ <span class="Description">{field.Description}</span>
292
+ {/if}
293
+ {#if field.Type === FieldTypes.Text}
294
+ <input type="text" bind:value={prepareFields[field.Name]} placeholder="{field.Placeholder}">
295
+
296
+ {:else if field.Type === FieldTypes.Number || field.Type === FieldTypes.Money}
297
+ <input type="number" placeholder="{field.Placeholder}" bind:value={prepareFields[field.Name]}>
298
+
299
+ {:else if field.Type === FieldTypes.Password}
300
+ <input type="password" bind:value={prepareFields[field.Name]} placeholder="{field.Placeholder}">
301
+
302
+ {:else if field.Type === FieldTypes.Hidden}
303
+ <input type="hidden" bind:value={prepareFields[field.Name]} placeholder="{field.Placeholder}">
304
+
305
+ {:else if field.Type === FieldTypes.Lookup}
306
+ <div class="CustomSelect">
307
+ <div class="Selected" id="{index}" on:click="{(e) => showLookup(e,index)}">{prepareFields[field.Name] || ''}</div>
308
+ <div class="OptionList" class:Opened={openedLookup === index}>
309
+ {#each field.Values as value}
310
+ <div on:click="{() => {prepareFields[field.Name] = value.Name; fields = fields}}">
311
+ <span>{value.Value}</span>
312
+ </div>
313
+ {/each}
314
+ </div>
315
+ </div>
316
+ {:else if field.Type === FieldTypes.Boolean}
317
+ <input type="checkbox" bind:value={prepareFields[field.Name]} placeholder="{field.Placeholder}">
318
+ {:else}
319
+ <input type="text" bind:value={prepareFields[field.Name]} placeholder="{field.Placeholder}">
320
+ {/if}
321
+ </label>
322
+ </div>
323
+ {/if}
324
+ {/each}
325
+ {#if !isProcessingTxn}
326
+ <button class="PrimaryButton" type="submit">
327
+ <svg class="ButtonLock" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
328
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.51564 0.574496C6.49714 0.733152 5.5928 1.46162 5.21164 2.43037C5.01714 2.92471 4.98674 3.24368 4.98671 4.78987L4.98668 5.99306L4.55336 6.00671C4.20693 6.01762 4.08258 6.03221 3.93336 6.07946C3.43136 6.23846 3.00318 6.58293 2.73943 7.04C2.70133 7.106 2.63639 7.256 2.59508 7.37334L2.52002 7.58665V13.9067L2.59268 14.12C2.6993 14.4331 2.83849 14.6518 3.09336 14.9067C3.34821 15.1615 3.56693 15.3007 3.88002 15.4073L4.09336 15.48H11.9067L12.12 15.4073C12.4331 15.3007 12.6518 15.1615 12.9067 14.9067C13.1616 14.6518 13.3007 14.4331 13.4074 14.12L13.48 13.9067V7.58665L13.405 7.37334C13.1846 6.74712 12.6999 6.27875 12.0667 6.08C11.9191 6.03371 11.7891 6.0184 11.4467 6.00696L11.0134 5.99253L11.0133 4.78959C11.0133 4.128 11.0008 3.45465 10.9855 3.29334C10.9257 2.66268 10.7188 2.13556 10.3497 1.67368C9.66549 0.817589 8.6023 0.405214 7.51564 0.574496ZM8.46436 1.58665C9.01596 1.7035 9.52999 2.11659 9.79758 2.65809C9.98521 3.03771 9.98202 3.00646 9.99305 4.58L10.003 6H5.99702L6.00699 4.58C6.01802 3.00646 6.01483 3.03771 6.20246 2.65809C6.31793 2.42446 6.43799 2.26065 6.61818 2.09103C6.89043 1.83468 7.21371 1.65496 7.52352 1.58775C7.74977 1.53865 8.23518 1.53809 8.46436 1.58665ZM11.9201 7.0955C12.0975 7.17871 12.2992 7.37412 12.3874 7.54806C12.4231 7.61846 12.465 7.75796 12.4805 7.85803C12.4993 7.97978 12.5061 8.97962 12.501 10.88L12.4934 13.72L12.4082 13.8997C12.26 14.2127 12.0016 14.419 11.6821 14.4796C11.4864 14.5167 4.51364 14.5167 4.31793 14.4796C3.99843 14.419 3.74008 14.2127 3.59183 13.8997L3.50668 13.72L3.49905 10.88C3.49393 8.97728 3.50074 7.97987 3.51964 7.85778C3.57627 7.49218 3.79218 7.21543 4.12918 7.0765L4.28002 7.01431L8.02668 7.0205L11.7734 7.02665L11.9201 7.0955Z" fill="white"/>
329
+ </svg>
330
+ {$_('makeDepositButton')}
331
+ <span class="ButtonAmount">{amount || $_('amountPlaceholder')} {currency}</span>
332
+ </button>
333
+ {:else}
334
+ <button class="PrimaryButton">
335
+ <svg class="ButtonSpinner" xmlns="http://www.w3.org/2000/svg" width="15" height="14" viewBox="0 0 15 14" fill="none">
336
+ <path d="M14.0282 6.58425C13.9037 4.05374 12.3688 1.68916 10.0872 0.61058C7.59818 -0.509483 4.56986 -0.0531603 2.49567 1.68916C0.504443 3.34851 -0.408201 6.04496 0.172573 8.57547C0.711862 11.0645 2.6616 13.0972 5.10915 13.7609C8.0545 14.5906 10.7509 13.1802 12.4103 10.7741C10.9169 12.7653 8.63527 14.0928 6.10476 13.6365C3.57424 13.1802 1.50005 11.2719 0.919281 8.78289C0.297024 6.12793 1.54154 3.34851 3.90612 1.97955C6.35366 0.569097 9.79682 1.10839 11.4147 3.51445C11.8295 4.09522 12.1199 4.80045 12.2444 5.50567C12.3688 6.08644 12.3273 6.7087 12.4103 7.28947C12.4933 7.82876 12.9496 8.53399 13.5718 8.16063C14.1111 7.82876 14.0696 7.12354 14.0282 6.58425C14.0696 6.87464 14.0282 6.41831 14.0282 6.58425Z" fill="white"/>
337
+ </svg>
338
+ {$_('processingButton')}
339
+ </button>
340
+ {/if}
341
+ {#if showRetryNotification}
342
+ <cashier-notifications
343
+ text="{$_('retryText')}"
344
+ button="{$_('retryButton')}"
345
+ >
346
+ </cashier-notifications>
347
+ {/if}
348
+ </form>
349
+ {#if showRedirectNotification}
350
+ <div class="RedirectionNotification">
351
+ <img src="//static.everymatrix.com/mmstage/cashier/assets/redirect.png" alt="">
352
+ <span class="RedirectionTitle">{$_('redirectTitle')}</span>
353
+ <span class="RedirectionMessage">{$_('redirectMessage')}</span>
354
+ <div class="RedirectionClose" on:click={() => {showRedirectNotification = false}}>{$_('backToPayment')}</div>
355
+ </div>
356
+ {/if}
357
+ </div>
358
+ {/if}
359
+ {#if redirectUrl && redirectMode === RedirectionModeStringEnum.Default}
360
+ <div class="IframeRedirect">
361
+ <cashier-iframe-redirect
362
+ lang="{lang}"
363
+ translationurl="{translationurl}"
364
+ iframeurl="{redirectUrl}"
365
+ ></cashier-iframe-redirect>
366
+ </div>
367
+ {/if}
368
+ {#if showConfirmModal}
369
+ <cashier-confirm-modal>
370
+ <span slot="text">{$_('confirmDepositText')} {amount} {currency} ?</span>
371
+ <div slot="confirm">{$_('confirmDepositButton')}</div>
372
+ </cashier-confirm-modal>
373
+ {/if}
374
+ </div>
375
+
376
+
377
+ <style lang="scss">
378
+ @keyframes loading-spinner {
379
+ from {
380
+ transform: rotate(0deg)
381
+ }
382
+ to {
383
+ transform: rotate(360deg)
384
+ }
385
+ }
386
+ .MethodsDetails {
387
+ position: relative;
388
+ display: flex;
389
+ flex-direction: column;
390
+ gap: 5px;
391
+ &:has(.RedirectionNotification) form {
392
+ visibility: hidden;
393
+ }
394
+ }
395
+ .form-logo {
396
+ align-items: center;
397
+ display: flex;
398
+ height: 50px;
399
+ border-bottom: 1px solid var(--emw--color-gray-100, #E8E9EB);
400
+
401
+ .SelectedLogoDescription {
402
+ color: var(--emw--color-black, #111);
403
+ font-size: var(--emw--font-size-small, 14px);
404
+ margin: 7px 5px 7px 7px;
405
+ word-break: break-word;
406
+ }
407
+
408
+ .SelectedLogoWrapper {
409
+ width: 56px;
410
+ height: 32px;
411
+ flex-shrink: 0;
412
+ background: var(--emw--color-background, #FFF);
413
+ border: 1px solid var(--emw--color-gray-100, #E8E9EB);
414
+ border-radius: var(--emw--border-radius-large, 6px);
415
+
416
+ img {
417
+ max-height: 32px;
418
+ max-width: 56px;
419
+ }
420
+ }
421
+ }
422
+ .RedirectionNotification {
423
+ height: 100%;
424
+ width: inherit;
425
+ position: absolute;
426
+ display: flex;
427
+ flex-direction: column;
428
+ align-items: center;
429
+ justify-content: center;
430
+ gap: 20px;
431
+ .RedirectionClose {
432
+ display: flex;
433
+ width: 234px;
434
+ height: 36px;
435
+ flex-direction: column;
436
+ justify-content: center;
437
+ flex-shrink: 0;
438
+ color: var(--emw--color-white, #FFF);
439
+ cursor: pointer;
440
+ text-align: center;
441
+ font-size: var(--emw--font-size-x-small, 12px);
442
+ font-style: normal;
443
+ font-weight: 500;
444
+ line-height: normal;
445
+ text-transform: uppercase;
446
+ border-radius: 4px;
447
+ background: var(--emw--color-primary, #7EC51E);
448
+ }
449
+ .RedirectionTitle {
450
+ color: var(--emw--color-black, #111);
451
+ font-size: var(--emw--font-size-x-small, 12px);
452
+ font-style: normal;
453
+ text-transform: none;
454
+ font-weight: var(--emw--font-weight-bold, 600);
455
+ }
456
+ .RedirectionMessage {
457
+ color: var(--emw--color-gray-300, #666);
458
+ font-size: var(--emw--font-size-x-small, 12px);
459
+ font-style: normal;
460
+ text-transform: none;
461
+ }
462
+ }
463
+ cashier-iframe-redirect {
464
+ height: inherit;
465
+ width: inherit;
466
+ }
467
+ .IframeRedirect {
468
+ display: flex;
469
+ position: absolute;
470
+ align-items: center;
471
+ justify-content: center;
472
+ width: 100%;
473
+ height: 100%;
474
+ z-index: 100;
475
+ top: 0;
476
+ left: 0;
477
+ background-color: var(--emw--color-gray-transparency-20, rgba(0, 0, 0, .2));
478
+ }
479
+ .FieldWrapper, label{
480
+ display: flex;
481
+ flex-direction: column ;
482
+ }
483
+ .FieldWrapper {
484
+ background-color: var(--emw--color-gray-transparency-100, rgba(255, 255, 255, 1));
485
+ border-radius: 6px;
486
+ box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.1);
487
+ padding: 0 15px 15px;
488
+ margin-bottom: 10px;
489
+ &.Hidden {
490
+ height: 0;
491
+ visibility: hidden;
492
+ margin: 0;
493
+ padding: 0;
494
+ }
495
+ }
496
+ .AmountLimits {
497
+ color: var(--emw--color-gray-300, #666);
498
+ font-size: var(--emw--font-size-x-small, 12px);
499
+ margin: 5px 0 0 2px;
500
+ line-height: var(--emw--font-size-x-small, 12px);
501
+ }
502
+ input, .Selected {
503
+ border: 1px solid var(--emw--color-gray-100, #E8E9EB);
504
+ border-radius: var(--emw--border-radius-medium, 4px);
505
+ height: 40px;
506
+ line-height: var(--emw--size-small, 14px);
507
+ color: var(--emw--color-black, #111);
508
+ padding: 0 15px;
509
+ &:focus {
510
+ outline: none;
511
+ }
512
+ }
513
+
514
+ label {
515
+ color: var(--emw--color-black, #111);
516
+ font-size: var(--emw--size-small, 14px);
517
+ margin-top: 7px;
518
+ line-height: 27px;
519
+ span.Required:before {
520
+ content: '*';
521
+ display: inline-block;
522
+ margin-right: 2px;
523
+ }
524
+ }
525
+ .Description {
526
+ color: var(--emw--color-gray-300, #666);
527
+ font-size: var(--emw--font-size-x-small, 12px);
528
+ margin: 0 0 5px 2px;
529
+ line-height: var(--emw--font-size-x-small, 12px);
530
+ }
531
+ .PrimaryButton {
532
+ color: var(--emw--color-white, #FFF);
533
+ text-align: center;
534
+ font-size: var(--emw--font-size-small, 14px);
535
+ font-style: normal;
536
+ font-weight: 400;
537
+ height: 46px;
538
+ border-radius: 50px;
539
+ line-height: normal;
540
+ border: none;
541
+ background: var(--emw--color-primary, #7EC51E);
542
+ width: 100%;
543
+ margin: 12px 0;
544
+ cursor: pointer;
545
+ text-transform: uppercase;
546
+ .ButtonSpinner {
547
+ animation: loading-spinner 1s linear infinite
548
+ }
549
+ }
550
+ .CustomSelect {
551
+ width: 100%;
552
+ position: relative;
553
+ }
554
+ .Selected {
555
+ display: flex;
556
+ align-items: center;
557
+ cursor: pointer;
558
+ &:after {
559
+ position: absolute;
560
+ content: "";
561
+ top: 19px;
562
+ right: 10px;
563
+ width: 0;
564
+ height: 0;
565
+ border: 6px solid transparent;
566
+ border-color: rgb(168 169 170) transparent transparent transparent;
567
+ }
568
+ }
569
+ .OptionList {
570
+ display: none;
571
+ position: absolute;
572
+ top: 100%;
573
+ left: 0;
574
+ right: 0;
575
+ z-index: 99;
576
+ background-color: white;
577
+ border: 1px solid var(--emw--color-gray-100, #E8E9EB);
578
+ border-radius: var(--emw--border-radius-medium, 4px);
579
+ margin-top: 5px;
580
+ div {
581
+ padding: 8px 16px;
582
+ cursor: pointer;
583
+ user-select: none;
584
+ &:hover {
585
+ background-color: var(--emw--color-background-secondary, #F9F9F9)
586
+ }
587
+ }
588
+ &.Opened {
589
+ display: block;
590
+ }
591
+ }
592
+ </style>
@@ -0,0 +1,91 @@
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 const FIELD_TYPES = {
66
+ 0: 'Unknown',
67
+ 1: 'Text',
68
+ 2: 'Boolean',
69
+ 3: 'Number',
70
+ 4: 'Money',
71
+ 5: 'DateTime',
72
+ 6: 'Lookup',
73
+ 7: 'IpAddress',
74
+ 8: 'Date',
75
+ 9: 'Time',
76
+ 10: 'LookupCollection',
77
+ 11: 'Hidden',
78
+ 12: 'Label',
79
+ 13: 'Password',
80
+ 14: 'Link',
81
+ 15: 'Image',
82
+ 19: 'Html',
83
+ 20: 'QRCode'
84
+ };
85
+ export const VISIBLE_FIELD_TYPES: string[] =
86
+ 'Text,Number,Money,Boolean,Lookup,Date,Time,DateTime,Password,Label,Link,QRCode'.split(',');
87
+
88
+ export enum RedirectionModeStringEnum {
89
+ Default = 'Default',
90
+ RedirectWithRetry = 'Redirect'
91
+ }