@everymatrix/cashier-page 1.37.12 → 1.39.0

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/index.html CHANGED
@@ -31,24 +31,7 @@
31
31
  </header>
32
32
 
33
33
  <div class="webcomponent">
34
- <cashier-page
35
- lang="en"
36
- local="en-US"
37
- channel="Desktop"
38
- type="Deposit"
39
- session="935b0211-7b3d-4454-8b0a-f8e66099c18f"
40
- translationurl="https://static.everymatrix.com/mmstage/translations/1995/mm-localization-en.json"
41
- assetsurl="https://static.everymatrix.com/mmstage/cashier/operator-assets/1995"
42
- endpoint="https://odeonbet-api.stage.norway.mazeday.com"
43
- merchantid="1995"
44
- successurl="https://odeonbet-stage.mazeday.com/tr/receipt"
45
- failurl="https://odeonbet-stage.mazeday.com/tr/receipt"
46
- cancelurl="https://odeonbet-stage.mazeday.com/tr/receipt"
47
- customerid="6246443"
48
- currency="TRY"
49
- numberofmethodsshown="1"
50
- >
51
- </cashier-page>
34
+ <cashier-page type="Deposit" channel="Desktop" translationurl="https://static.everymatrix.com/mmstage/translations/6/mm-localization-en-8.json" endpoint="https://zirvebet-api.stage.norway.everymatrix.com" session="afdf7cf2-75ef-4375-8b0b-562e19ed75ed" lang="tr" customerid="6446553" currency="TRY" amount="0" dateformat="YYYY/MM/DD" timeformat="HH:mm:ss" dateandtimeformat="D.MM.YYYY, h:mm:ss a" clientstylingurl="https://zirvebet-stage.everymatrix.com/static/css/widgets/cashier-page/style-1.0.227.css" failurl="https://zirvebet-stage.everymatrix.com/tr/receipt" successurl="https://zirvebet-stage.everymatrix.com/tr/receipt" cancelurl="https://zirvebet-stage.everymatrix.com/tr/receipt"></cashier-page>
52
35
  </div>
53
36
 
54
37
  </body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/cashier-page",
3
- "version": "1.37.12",
3
+ "version": "1.39.0",
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": "284346262a669a2f5a5891d7ba9327b0c94aa44c"
38
+ "gitHead": "d3dbfca9fcdc2d9df9a01f60f283ed699ec828fb"
39
39
  }
@@ -8,12 +8,14 @@
8
8
  import {TxnChannel, TxnType, ResponseCode} from "./CashierPage.types";
9
9
 
10
10
  import '@everymatrix/cashier-header';
11
+ import '@everymatrix/cashier-verifications';
11
12
  import '@everymatrix/cashier-methods-list';
12
13
  import '@everymatrix/cashier-method-details';
13
14
  import '@everymatrix/cashier-error';
14
15
  import '@everymatrix/cashier-modal';
15
16
  import '@everymatrix/cashier-confirm-modal';
16
17
  import '@everymatrix/cashier-iframe-redirect';
18
+ import '@everymatrix/cashier-session-expiration-modal';
17
19
 
18
20
  enum RedirectionModeStringEnum {
19
21
  Default = 'Default',
@@ -46,8 +48,10 @@
46
48
  export let channel: string = TxnChannel.Desktop;
47
49
  export let showheader: string = 'true';
48
50
  export let numberofmethodsshown: string;
49
- export let clientstyling:string = '';
50
- export let clientstylingurl:string = ''
51
+ export let clientstyling: string = '';
52
+ export let clientstylingurl: string = '';
53
+ export let showsessionexpirationmodal: string = 'true';
54
+ export let showverifications: string = 'true';
51
55
 
52
56
  let xPlayerSessionId: string;
53
57
  let xPaymentSessionToken: string;
@@ -60,7 +64,7 @@
60
64
  let isMethodOpen:boolean = false;
61
65
  let displayNone:boolean = false;
62
66
  let customStylingContainer:HTMLElement;
63
- let widgetWidth: number
67
+ let widgetWidth: number;
64
68
  let mobileView: string;
65
69
  let prepareRequest;
66
70
  let showConfirmModal:boolean = false;
@@ -126,7 +130,7 @@
126
130
  .then(res => res.json())
127
131
  .then(data => {
128
132
  if (data.error) {
129
- errorMessage = data.error
133
+ errorMessage = data.error;
130
134
  }
131
135
  if (data.ResponseCode === ResponseCode.PlayerSessionIsNotValid) {
132
136
  errorResponseCode = data.ResponseCode;
@@ -144,6 +148,7 @@
144
148
  }
145
149
  xPaymentSessionToken = data.XPaymentSessionToken;
146
150
  isLoading = false;
151
+ window.postMessage({ type: 'StartSessionCountdown', xPaymentSessionToken }, window.location.href);
147
152
  })
148
153
  .catch(error => console.log(error))
149
154
  }
@@ -220,9 +225,16 @@
220
225
  }
221
226
 
222
227
  const hideModal = () => {
223
- window.postMessage({ type: 'HideCashierModal' }, window.location.href)
228
+ window.postMessage({ type: 'HideCashierModal' }, window.location.href);
224
229
  }
225
230
 
231
+ const renewSession = () => {
232
+ errorResponseCode = null;
233
+ setErrorResponseCode();
234
+ getPlayerSession();
235
+ }
236
+
237
+
226
238
  const closeModal = () => {
227
239
  showConfirmModal = false;
228
240
  }
@@ -251,6 +263,10 @@
251
263
  if (e.data.type === 'ShowCashierModal') {
252
264
  modalErrorMessage = e.data.modalErrorMessage;
253
265
  }
266
+ if (e.data.type === 'SessionExpired') {
267
+ errorResponseCode = ResponseCode.JwtTokenError;
268
+ setErrorResponseCode();
269
+ }
254
270
  }
255
271
 
256
272
  $: endpoint && session && customerid && lang && channel && type && successurl && failurl && cancelurl && getPlayerSession();
@@ -303,7 +319,22 @@
303
319
  >
304
320
  <div slot="button" class="ModalButton" on:click={hideModal}>{$_('closeModal')}</div>
305
321
  </cashier-error>
306
- </cashier-modal>
322
+ </cashier-modal>
323
+ {#if showsessionexpirationmodal === 'true'}
324
+ <cashier-session-expiration-modal
325
+ {assetsurl}
326
+ {translationurl}
327
+ {clientstylingurl}
328
+ {clientstyling}
329
+ {lang}
330
+ {local}
331
+ {endpoint}
332
+ {currency}
333
+ {customerid}
334
+ selectedpaymentmethodname="{selectedPaymentMethod.Name}"
335
+ >
336
+ </cashier-session-expiration-modal>
337
+ {/if}
307
338
  {#if showConfirmModal}
308
339
  <cashier-confirm-modal
309
340
  {clientstylingurl}
@@ -318,6 +349,17 @@
318
349
  {#if !errorMessage && !errorResponseCode}
319
350
  <div class="CashierPage">
320
351
  <div class="CashierMethodListWrapper">
352
+ {#if !!showverifications && showverifications !== 'false'}
353
+ <cashier-verifications
354
+ {lang}
355
+ {translationurl}
356
+ {endpoint}
357
+ {clientstylingurl}
358
+ {clientstyling}
359
+ {customerid}
360
+ session="{xPaymentSessionToken}"
361
+ ></cashier-verifications>
362
+ {/if}
321
363
  <cashier-methods-list
322
364
  {lang}
323
365
  {local}
@@ -360,12 +402,18 @@
360
402
  {translationurl}
361
403
  {clientstylingurl}
362
404
  {clientstyling}
363
- hidebuttons="true"
405
+ imgurl = {errorResponseCode === ResponseCode.JwtTokenError ? 'session-expired-icon.png' : ''}
406
+ hidebuttons= {errorResponseCode !== ResponseCode.JwtTokenError}
364
407
  errorcode={errorResponseCode}
365
408
  >
366
409
  {#if !errorResponseCode}
367
410
  <span slot="text">{errorMessage}</span>
368
411
  {/if}
412
+ {#if errorResponseCode === ResponseCode.JwtTokenError}
413
+ <span slot="title">{$_('sessionExpiredTitle')}</span>
414
+ <span slot="text">{$_('sessionExpiredText')}</span>
415
+ <div slot="button" class="CashierErrorButton" on:click={renewSession}>{$_('continueSession')}</div>
416
+ {/if}
369
417
  </cashier-error>
370
418
  {/if}
371
419
  </div>
@@ -410,6 +458,9 @@
410
458
  border-radius: 6px;
411
459
  border: 1px solid var(--mmw--color-grey-105, #E8E9EB);
412
460
  box-sizing: border-box;
461
+ .IframeRedirect {
462
+ border-radius: 6px;
463
+ }
413
464
  .Content, .CashierPage, .DisablePage {
414
465
  height: calc(100% - var(--mmw--header-height, 32px));
415
466
  }
@@ -2,6 +2,9 @@ export const TRANSLATIONS = {
2
2
  "en": {
3
3
  "loading": "Loading...",
4
4
  "closeModal": "CLOSE",
5
+ "continueSession": "CONTINUE",
6
+ "sessionExpiredTitle": "Session Expired!",
7
+ "sessionExpiredText": "Your session has ended. We apologize for any inconvenience. Please click the button to continue.",
5
8
  "deposit": {
6
9
  "makeTxnButton": "DEPOSIT",
7
10
  "confirmText": "You're going to deposit to your account",
@@ -17,14 +20,33 @@ export const TRANSLATIONS = {
17
20
  },
18
21
  "hr": {
19
22
  "loading": "Učitavanje",
23
+ "closeModal": "CLOSE",
24
+ "continueSession": "CONTINUE",
25
+ "sessionExpiredTitle": "Session Expired!",
26
+ "sessionExpiredText": "Your session has ended. We apologize for any inconvenience. Please click the button to continue.",
20
27
  "header": {
21
28
  "deposit": "Uplata",
22
29
  "withdraw": "Povlačenje"
30
+ },
31
+ "deposit": {
32
+ "makeTxnButton": "DEPOSIT",
33
+ "confirmText": "You're going to deposit to your account",
34
+ "confirmTextWithAmount": "You're going to deposit {amount} {currency} to your account",
35
+ "confirmButton": "Ok"
36
+ },
37
+ "withdraw": {
38
+ "makeTxnButton": "WITHDRAW",
39
+ "confirmText": "You're going to withdraw from your account",
40
+ "confirmTextWithAmount": "You're going to withdraw {amount} {currency} from your account",
41
+ "confirmButton": "Ok"
23
42
  }
24
43
  },
25
44
  "tr": {
26
45
  "loading": "Yükleniyor...",
27
46
  "closeModal": "KAPAT",
47
+ "continueSession": "Devam et",
48
+ "sessionExpiredTitle": "Session Expired!",
49
+ "sessionExpiredText": "Your session has ended. We apologize for any inconvenience. Please click the button to continue.",
28
50
  "header": {
29
51
  "deposit": "Yatır",
30
52
  "withdraw": "Çek"