@everymatrix/cashier-page 1.43.1 → 1.43.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/cashier-page",
3
- "version": "1.43.1",
3
+ "version": "1.43.3",
4
4
  "main": "index.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "e0be02e594f762ecb10851537d8690d5e66f4e5d"
38
+ "gitHead": "4723f5370b2d6fc913a8cf6770f9f492038e54e8"
39
39
  }
@@ -7,8 +7,10 @@
7
7
  import type {PaymentMethod} from "./CashierPage.types";
8
8
  import {TxnChannel, TxnType, ResponseCode} from "./CashierPage.types";
9
9
  import errorSessionImage from './assets/session-expired-icon.png';
10
+ import maintenanceImage from './assets/maintenance.png';
10
11
 
11
12
  import '@everymatrix/cashier-header';
13
+ import '@everymatrix/cashier-spinner';
12
14
  import '@everymatrix/cashier-verifications';
13
15
  import '@everymatrix/cashier-methods-list';
14
16
  import '@everymatrix/cashier-method-details';
@@ -82,7 +84,7 @@
82
84
  let modalErrorMessage: string;
83
85
  let title: string;
84
86
  let showHeaderBack: string;
85
-
87
+ let showSpinner = true;
86
88
  const setActiveLanguage = ():void => {
87
89
  setLocale(lang);
88
90
  }
@@ -111,12 +113,14 @@
111
113
  }
112
114
 
113
115
  const reinitMethod = () => {
114
- showMethodDetailsPage = false;
115
- selectedPaymentMethod = {} as PaymentMethod;
116
+ showMethodDetailsPage = false;
117
+ selectedPaymentMethod = {} as PaymentMethod;
118
+ setTitle()
116
119
  }
117
120
 
118
121
  const getPlayerSession = () => {
119
122
  xPaymentSessionToken = '';
123
+ showSpinner = true
120
124
  const url:URL = new URL(`${endpoint}/v2/player/${customerid}/payment/GetPaymentSession`);
121
125
  const headers = new Headers();
122
126
  headers.append("accept", "application/json");
@@ -142,15 +146,6 @@
142
146
  if (data.error) {
143
147
  errorMessage = data.error;
144
148
  }
145
- if (data.ResponseCode === ResponseCode.PlayerSessionIsNotValid) {
146
- errorResponseCode = data.ResponseCode;
147
- setErrorResponseCode();
148
- return;
149
- }
150
- if (data.ResponseCode === ResponseCode.JwtTokenError) {
151
- errorResponseCode = data.ResponseCode;
152
- setErrorResponseCode();
153
- }
154
149
  if (data.ResponseCode !== ResponseCode.Success) {
155
150
  errorResponseCode = data.ResponseCode;
156
151
  setErrorResponseCode();
@@ -160,6 +155,7 @@
160
155
  window.postMessage({ type: 'StartSessionCountdown', xPaymentSessionToken }, window.location.href);
161
156
  })
162
157
  .catch(error => console.log(error))
158
+ .finally(() => showSpinner = false)
163
159
  }
164
160
 
165
161
  const setTitle = () => {
@@ -179,15 +175,18 @@
179
175
  const isMobileWidth = () => {
180
176
  return widgetWidth < 750
181
177
  }
178
+
182
179
  const selectPayMeth = (e) => {
183
180
  selectedPaymentMethod.Name = e.detail.Name;
184
181
  selectedPaymentMethod.Label = e.detail.Label
185
182
  showMethodDetailsPage = true;
186
183
  setTitle()
187
184
  }
185
+
188
186
  const setErrorResponseCode = () => {
189
187
  window.postMessage({type: 'ErrorResponseCode', errorResponseCode}, window.location.href);
190
188
  }
189
+
191
190
  const setClientStyling = ():void => {
192
191
  let sheet = document.createElement('style');
193
192
  sheet.innerHTML = clientstyling;
@@ -243,7 +242,6 @@
243
242
  getPlayerSession();
244
243
  }
245
244
 
246
-
247
245
  const closeModal = () => {
248
246
  showConfirmModal = false;
249
247
  }
@@ -277,17 +275,23 @@
277
275
  setErrorResponseCode();
278
276
  }
279
277
  }
280
-
281
278
  $: endpoint && session && customerid && lang && channel && type && successurl && failurl && cancelurl && getPlayerSession();
282
279
  $: clientstyling && customStylingContainer && setClientStyling();
283
280
  $: clientstylingurl && customStylingContainer && setClientStylingURL();
284
281
  $: lang && setActiveLanguage();
285
282
  $: lang && setTitle();
286
- $: translationurl && setTranslationUrl();
283
+ $: lang && translationurl && setTranslationUrl();
287
284
  $: widgetWidth && setDevice();
288
285
  $: xPaymentSessionToken && reinitMethod();
289
286
  </script>
287
+ {#if showSpinner}
288
+ <cashier-spinner
289
+ {clientstylingurl}
290
+ {clientstyling}
291
+ ></cashier-spinner>
292
+ {/if}
290
293
  <div class={showMethodDetailsPage ? "CashierPageWidget BothSections" : "CashierPageWidget"}
294
+ class:MobileView={mobileView === 'true'}
291
295
  bind:this={customStylingContainer}
292
296
  bind:clientWidth={widgetWidth}
293
297
  >
@@ -299,8 +303,8 @@
299
303
  <cashier-header class="Header"
300
304
  {lang}
301
305
  {translationurl}
302
- {title}
303
306
  {clientstylingurl}
307
+ {title}
304
308
  {clientstyling}
305
309
  showbackbutton="{showHeaderBack}"
306
310
  >
@@ -324,14 +328,16 @@
324
328
  {clientstyling}
325
329
  >
326
330
  <cashier-error
327
- {assetsurl}
328
- {translationurl}
329
- {clientstylingurl}
330
- {clientstyling}
331
- {lang}
332
- errorcode={modalErrorMessage}
331
+ {assetsurl}
332
+ {translationurl}
333
+ {clientstylingurl}
334
+ {clientstyling}
335
+ {lang}
336
+ errorcode={modalErrorMessage}
333
337
  >
334
- <div slot="button" class="ModalButton" on:click={hideModal}>{$_('closeModal')}</div>
338
+ {#if modalErrorMessage}
339
+ <button slot="button" class="CashierErrorButton" on:click={hideModal}>{$_('closeModal')}</button>
340
+ {/if}
335
341
  </cashier-error>
336
342
  </cashier-modal>
337
343
  {#if showsessionexpirationmodal === 'true'}
@@ -362,7 +368,7 @@
362
368
  {/if}
363
369
  {#if !errorMessage && !errorResponseCode}
364
370
  <div class="CashierPage">
365
- {#if !!showverifications && showverifications !== 'false'}
371
+ {#if !!showverifications && showverifications !== 'false' && mobileView === 'true'}
366
372
  <cashier-verifications class="CashierVerificationsMobile"
367
373
  {lang}
368
374
  {translationurl}
@@ -375,7 +381,7 @@
375
381
  ></cashier-verifications>
376
382
  {/if}
377
383
  <div class="CashierMethodListWrapper">
378
- {#if !!showverifications && showverifications !== 'false'}
384
+ {#if !!showverifications && showverifications !== 'false' && mobileView !== 'true'}
379
385
  <cashier-verifications class="CashierVerificationsMethodList"
380
386
  {lang}
381
387
  {translationurl}
@@ -423,7 +429,7 @@
423
429
  </div>
424
430
  </div>
425
431
  {:else}
426
- <cashier-error class="Error"
432
+ <cashier-error
427
433
  {lang}
428
434
  {assetsurl}
429
435
  {translationurl}
@@ -445,7 +451,18 @@
445
451
  </div>
446
452
  <span slot="title">{$_('sessionExpiredTitle')}</span>
447
453
  <span slot="text">{$_('sessionExpiredText')}</span>
448
- <div slot="button" class="CashierErrorButton" on:click={renewSession}>{$_('continueSession')}</div>
454
+ <button slot="button" class="CashierErrorButton" on:click={renewSession}>{$_('continueSession')}</button>
455
+ {/if}
456
+ {#if errorResponseCode === ResponseCode.Maintenance}
457
+ <div slot="icon">
458
+ {#if assetsurl}
459
+ <img src="{`${assetsurl}/maintenance.png`}" width="300px" alt="error">
460
+ {:else}
461
+ <img src={maintenanceImage} width="300px" alt="error">
462
+ {/if}
463
+ </div>
464
+ <span slot="title">{$_('maintenanceTitle')}</span>
465
+ <span slot="text">{$_('maintenanceText')}</span>
449
466
  {/if}
450
467
  </cashier-error>
451
468
  {/if}
@@ -473,7 +490,7 @@
473
490
  position: absolute;
474
491
  width: 100%;
475
492
  height: 100%;
476
- z-index: 100;
493
+ z-index: 4;
477
494
  top: 0;
478
495
  left: 0;
479
496
  background-color: transparent;
@@ -481,7 +498,7 @@
481
498
  .CashierPageWidget {
482
499
  container-type: inline-size;
483
500
  container-name: deposit-page;
484
- height: inherit;
501
+ height: 100%;
485
502
  position: relative;
486
503
  box-sizing: border-box;
487
504
  .CashierMethodDetailsWrapper {
@@ -500,6 +517,9 @@
500
517
  .DisablePage {
501
518
  top: var(--mmw--header-height, 32px);
502
519
  }
520
+ cashier-error {
521
+ height: calc(100% - 32px);
522
+ }
503
523
  }
504
524
  }
505
525
  .CashierVerificationsMobile {
@@ -554,6 +574,10 @@
554
574
  height: inherit;
555
575
  width: inherit;
556
576
  }
577
+ cashier-error {
578
+ height: inherit;
579
+ }
580
+
557
581
  .IframeRedirect {
558
582
  display: flex;
559
583
  position: absolute;
@@ -561,7 +585,7 @@
561
585
  justify-content: center;
562
586
  width: 100%;
563
587
  height: 100%;
564
- z-index: 100;
588
+ z-index: 4;
565
589
  top: 0;
566
590
  left: 0;
567
591
  background-color: var(--emw--color-white, #FFF);
@@ -572,13 +596,41 @@
572
596
  font-size: var(--emw--font-size-small, 14px);
573
597
  }
574
598
 
575
- @container deposit-page (max-width:750px) {
599
+
600
+ .CashierErrorButton {
601
+ width: 100%;
602
+ height: 36px;
603
+ color: var(--emw--color-white, #FFF);
604
+ text-align: center;
605
+ cursor: pointer;
606
+ font-size: var(--emw--font-size-x-small, 12px);
607
+ font-style: normal;
608
+ font-weight: var(--emw--font-weight-semibold, 500);
609
+ font-family: inherit;
610
+ line-height: 36px;
611
+ border: none;
612
+ border-radius: var(--emw--border-radius-medium, 4px);
613
+ background: var(--emw--color-primary, #7EC51E);
614
+ &:hover {
615
+ background: var(--mmw--color-main-button-hover, #71B11B);
616
+ }
617
+ &:active {
618
+ background: var(--mmw--color-main-button-active, #5C950F);
619
+ }
620
+ }
621
+ .MobileView {
576
622
  .CashierVerificationsMobile {
577
623
  display: block;
578
624
  }
579
625
  .CashierVerificationsMethodList {
580
626
  display: none;
581
627
  }
628
+ &.BothSections .CashierMethodListWrapper {
629
+ display: none;
630
+ }
631
+ }
632
+
633
+ @container deposit-page (max-width:750px) {
582
634
  .CashierPage, .BothSections .CashierPage {
583
635
  flex-direction: column;
584
636
  justify-content: flex-start;
@@ -76,5 +76,6 @@ export enum TxnChannel {
76
76
  export enum ResponseCode {
77
77
  PlayerSessionIsNotValid ='PlayerSessionIsNotValid',
78
78
  Success = 'Success',
79
- JwtTokenError = 'JwtTokenError'
79
+ JwtTokenError = 'JwtTokenError',
80
+ Maintenance = 'Maintenance'
80
81
  }
Binary file
@@ -5,6 +5,8 @@ export const TRANSLATIONS = {
5
5
  "continueSession": "CONTINUE",
6
6
  "sessionExpiredTitle": "Session Expired!",
7
7
  "sessionExpiredText": "Your session has ended. We apologize for any inconvenience. Please click the button to continue.",
8
+ "maintenanceText": "Payment Methods are currently closed for scheduled maintenance.",
9
+ "maintenanceTitle": "We’ll Be Back Soon",
8
10
  "deposit": {
9
11
  "makeTxnButton": "DEPOSIT",
10
12
  "confirmText": "You're going to deposit to your account",
@@ -24,6 +26,8 @@ export const TRANSLATIONS = {
24
26
  "continueSession": "CONTINUE",
25
27
  "sessionExpiredTitle": "Session Expired!",
26
28
  "sessionExpiredText": "Your session has ended. We apologize for any inconvenience. Please click the button to continue.",
29
+ "maintenanceText": "We are down for a scheduled maintenance and expect to be back online in a few minutes",
30
+ "maintenanceTitle": "We’ll Be Back Soon",
27
31
  "header": {
28
32
  "deposit": "Uplata",
29
33
  "withdraw": "Povlačenje"
@@ -45,8 +49,10 @@ export const TRANSLATIONS = {
45
49
  "loading": "Yükleniyor...",
46
50
  "closeModal": "KAPAT",
47
51
  "continueSession": "Devam et",
48
- "sessionExpiredTitle": "Session Expired!",
49
- "sessionExpiredText": "Your session has ended. We apologize for any inconvenience. Please click the button to continue.",
52
+ "sessionExpiredTitle": "Oturumun Süresi Doldu!",
53
+ "sessionExpiredText": 'Oturumunuz sona erdi. Herhangi bir rahatsızlıktan dolayı özür dileriz. Devam etmek için lütfen butona tıklayın.',
54
+ "maintenanceText": "Ödeme Yöntemleri planlanmış bakım nedeniyle şu anda kapalı.",
55
+ "maintenanceTitle": "Yakında Geri Döneceğiz",
50
56
  "header": {
51
57
  "deposit": "Yatır",
52
58
  "withdraw": "Çek"