@everymatrix/cashier-page 1.42.0 → 1.43.1

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.42.0",
3
+ "version": "1.43.1",
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": "59f256966699eecf6d6eced70feb8c6829808414"
38
+ "gitHead": "e0be02e594f762ecb10851537d8690d5e66f4e5d"
39
39
  }
@@ -17,12 +17,15 @@
17
17
  import '@everymatrix/cashier-confirm-modal';
18
18
  import '@everymatrix/cashier-iframe-redirect';
19
19
  import '@everymatrix/cashier-session-expiration-modal';
20
+ import dayjs from 'dayjs';
21
+ import utc from 'dayjs/plugin/utc';
22
+ dayjs.extend(utc);
20
23
 
21
24
  enum RedirectionModeStringEnum {
22
25
  Default = 'Default',
23
26
  RedirectWithRetry = 'Redirect'
24
27
  }
25
-
28
+
26
29
  const mapReducer = (arr, [keys, val]) => [
27
30
  ...arr,
28
31
  ...(Array.isArray(keys) ? [...keys.map(key => [key, val])] : [[keys, val]]
@@ -57,17 +60,12 @@
57
60
  let xPlayerSessionId: string;
58
61
  let xPaymentSessionToken: string;
59
62
  let xConfirmSessionToken: string;
60
- let paymentMethods: PaymentMethod[] = [];
61
63
  let selectedPaymentMethod: PaymentMethod = {} as PaymentMethod;
62
64
  let formatter = new Intl.NumberFormat(local, {minimumFractionDigits: 2 });
63
- let fields = {};
64
- let isLoading:boolean = false;
65
- let isMethodOpen:boolean = false;
66
65
  let displayNone:boolean = false;
67
66
  let customStylingContainer:HTMLElement;
68
67
  let widgetWidth: number;
69
68
  let mobileView: string;
70
- let prepareRequest;
71
69
  let showConfirmModal:boolean = false;
72
70
  let redirectUrl: string;
73
71
  let windowRedirect: Window;
@@ -111,12 +109,20 @@
111
109
  });
112
110
  }
113
111
  }
112
+
113
+ const reinitMethod = () => {
114
+ showMethodDetailsPage = false;
115
+ selectedPaymentMethod = {} as PaymentMethod;
116
+ }
117
+
114
118
  const getPlayerSession = () => {
119
+ xPaymentSessionToken = '';
115
120
  const url:URL = new URL(`${endpoint}/v2/player/${customerid}/payment/GetPaymentSession`);
116
121
  const headers = new Headers();
117
122
  headers.append("accept", "application/json");
118
123
  headers.append("Content-Type", "application/json");
119
124
  headers.append("X-SessionId", `${session}`);
125
+ headers.append("X-Client-Request-Timestamp", dayjs.utc().format("YYYY-MM-DD HH:mm:ss.SSS"));
120
126
  const requestParams:RequestInit = {
121
127
  method: "POST",
122
128
  mode: "cors",
@@ -151,7 +157,6 @@
151
157
  return;
152
158
  }
153
159
  xPaymentSessionToken = data.XPaymentSessionToken;
154
- isLoading = false;
155
160
  window.postMessage({ type: 'StartSessionCountdown', xPaymentSessionToken }, window.location.href);
156
161
  })
157
162
  .catch(error => console.log(error))
@@ -280,6 +285,7 @@
280
285
  $: lang && setTitle();
281
286
  $: translationurl && setTranslationUrl();
282
287
  $: widgetWidth && setDevice();
288
+ $: xPaymentSessionToken && reinitMethod();
283
289
  </script>
284
290
  <div class={showMethodDetailsPage ? "CashierPageWidget BothSections" : "CashierPageWidget"}
285
291
  bind:this={customStylingContainer}
@@ -313,7 +319,10 @@
313
319
  ></cashier-iframe-redirect>
314
320
  </div>
315
321
  {/if}
316
- <cashier-modal>
322
+ <cashier-modal
323
+ {clientstylingurl}
324
+ {clientstyling}
325
+ >
317
326
  <cashier-error
318
327
  {assetsurl}
319
328
  {translationurl}
@@ -345,7 +354,7 @@
345
354
  {clientstylingurl}
346
355
  {clientstyling}
347
356
  >
348
- <span slot="text">{ confirmAmount && !hideAmountField ? $_(`${type.toLowerCase()}.confirmTextWithAmount`,
357
+ <span class="CashierConfirmModalText" slot="text">{ confirmAmount && !hideAmountField ? $_(`${type.toLowerCase()}.confirmTextWithAmount`,
349
358
  { values:{ amount: formatter.format(confirmAmount), currency }}): $_(`${type.toLowerCase()}.confirmText`)}</span>
350
359
  <div slot="confirm">{$_(`${type.toLowerCase()}.confirmButton`)}</div>
351
360
  </cashier-confirm-modal>
@@ -353,16 +362,29 @@
353
362
  {/if}
354
363
  {#if !errorMessage && !errorResponseCode}
355
364
  <div class="CashierPage">
365
+ {#if !!showverifications && showverifications !== 'false'}
366
+ <cashier-verifications class="CashierVerificationsMobile"
367
+ {lang}
368
+ {translationurl}
369
+ {endpoint}
370
+ {clientstylingurl}
371
+ {clientstyling}
372
+ {customerid}
373
+ ismobileview="{mobileView}"
374
+ session="{xPaymentSessionToken}"
375
+ ></cashier-verifications>
376
+ {/if}
356
377
  <div class="CashierMethodListWrapper">
357
378
  {#if !!showverifications && showverifications !== 'false'}
358
- <cashier-verifications
359
- {lang}
360
- {translationurl}
361
- {endpoint}
362
- {clientstylingurl}
363
- {clientstyling}
364
- {customerid}
365
- session="{xPaymentSessionToken}"
379
+ <cashier-verifications class="CashierVerificationsMethodList"
380
+ {lang}
381
+ {translationurl}
382
+ {endpoint}
383
+ {clientstylingurl}
384
+ {clientstyling}
385
+ {customerid}
386
+ ismobileview="{mobileView}"
387
+ session="{xPaymentSessionToken}"
366
388
  ></cashier-verifications>
367
389
  {/if}
368
390
  <cashier-methods-list
@@ -480,6 +502,13 @@
480
502
  }
481
503
  }
482
504
  }
505
+ .CashierVerificationsMobile {
506
+ display: none;
507
+ }
508
+ .CashierVerificationsMethodList {
509
+ display: block;
510
+ border-radius: var(--mmw--border-radius-medium-plus, 6px);
511
+ }
483
512
  .Content {
484
513
  height: 100%;
485
514
  position: relative;
@@ -488,6 +517,8 @@
488
517
  @include container-height;
489
518
  padding: var(--emw--spacing-large, 20px) var(--emw--spacing-x-small, 10px) var(--emw--spacing-small, 12px) var(--emw--spacing-x-small, 10px);
490
519
  width: 50%;
520
+ display: flex;
521
+ flex-direction: column;
491
522
  &::-webkit-scrollbar {
492
523
  border-right: none;
493
524
  }
@@ -495,10 +526,12 @@
495
526
  .BothSections {
496
527
  .CashierMethodDetailsWrapper {
497
528
  @include container-height;
529
+ padding: var(--emw--spacing-large, 20px) var(--emw--spacing-x-small, 10px) var(--emw--spacing-small, 12px) var(--emw--spacing-x-small, 10px);
498
530
  display: block;
499
531
  transition: all 1s;
500
532
  width: 50%;
501
533
  justify-content: center;
534
+ position: relative;
502
535
  }
503
536
  .CashierMethodListWrapper {
504
537
  &::-webkit-scrollbar {
@@ -533,7 +566,19 @@
533
566
  left: 0;
534
567
  background-color: var(--emw--color-white, #FFF);
535
568
  }
569
+
570
+ .CashierConfirmModalText {
571
+ color: var(--mmw--color-grey-10, #111);
572
+ font-size: var(--emw--font-size-small, 14px);
573
+ }
574
+
536
575
  @container deposit-page (max-width:750px) {
576
+ .CashierVerificationsMobile {
577
+ display: block;
578
+ }
579
+ .CashierVerificationsMethodList {
580
+ display: none;
581
+ }
537
582
  .CashierPage, .BothSections .CashierPage {
538
583
  flex-direction: column;
539
584
  justify-content: flex-start;