@everymatrix/cashier-page 1.37.11 → 1.38.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
@@ -36,17 +36,18 @@
36
36
  local="en-US"
37
37
  channel="Desktop"
38
38
  type="Deposit"
39
- session="935b0211-7b3d-4454-8b0a-f8e66099c18f"
39
+ session="a4db5664-cefc-4a37-b2b1-e05e5ec31a73"
40
40
  translationurl="https://static.everymatrix.com/mmstage/translations/1995/mm-localization-en.json"
41
41
  assetsurl="https://static.everymatrix.com/mmstage/cashier/operator-assets/1995"
42
- endpoint="https://odeonbet-api.stage.norway.mazeday.com"
43
- merchantid="1995"
42
+ endpoint="https://zirvebet-api.stage.norway.everymatrix.com"
43
+ merchantid="2719"
44
44
  successurl="https://odeonbet-stage.mazeday.com/tr/receipt"
45
45
  failurl="https://odeonbet-stage.mazeday.com/tr/receipt"
46
46
  cancelurl="https://odeonbet-stage.mazeday.com/tr/receipt"
47
- customerid="6246443"
47
+ customerid="6440095"
48
48
  currency="TRY"
49
49
  numberofmethodsshown="1"
50
+ amount="10"
50
51
  >
51
52
  </cashier-page>
52
53
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/cashier-page",
3
- "version": "1.37.11",
3
+ "version": "1.38.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": "bf020b7053c86226ac419f42cea1dabb823cee47"
38
+ "gitHead": "7070080d10ab3c85ed4a5d2eeb2442cc9ff8fb2d"
39
39
  }
@@ -14,6 +14,7 @@
14
14
  import '@everymatrix/cashier-modal';
15
15
  import '@everymatrix/cashier-confirm-modal';
16
16
  import '@everymatrix/cashier-iframe-redirect';
17
+ import '@everymatrix/cashier-session-expiration-modal';
17
18
 
18
19
  enum RedirectionModeStringEnum {
19
20
  Default = 'Default',
@@ -46,8 +47,9 @@
46
47
  export let channel: string = TxnChannel.Desktop;
47
48
  export let showheader: string = 'true';
48
49
  export let numberofmethodsshown: string;
49
- export let clientstyling:string = '';
50
- export let clientstylingurl:string = ''
50
+ export let clientstyling: string = '';
51
+ export let clientstylingurl: string = '';
52
+ export let showsessionexpirationmodal: string = 'true';
51
53
 
52
54
  let xPlayerSessionId: string;
53
55
  let xPaymentSessionToken: string;
@@ -60,7 +62,7 @@
60
62
  let isMethodOpen:boolean = false;
61
63
  let displayNone:boolean = false;
62
64
  let customStylingContainer:HTMLElement;
63
- let widgetWidth: number
65
+ let widgetWidth: number;
64
66
  let mobileView: string;
65
67
  let prepareRequest;
66
68
  let showConfirmModal:boolean = false;
@@ -126,7 +128,7 @@
126
128
  .then(res => res.json())
127
129
  .then(data => {
128
130
  if (data.error) {
129
- errorMessage = data.error
131
+ errorMessage = data.error;
130
132
  }
131
133
  if (data.ResponseCode === ResponseCode.PlayerSessionIsNotValid) {
132
134
  errorResponseCode = data.ResponseCode;
@@ -144,6 +146,7 @@
144
146
  }
145
147
  xPaymentSessionToken = data.XPaymentSessionToken;
146
148
  isLoading = false;
149
+ window.postMessage({ type: 'StartSessionCountdown', xPaymentSessionToken }, window.location.href);
147
150
  })
148
151
  .catch(error => console.log(error))
149
152
  }
@@ -220,9 +223,16 @@
220
223
  }
221
224
 
222
225
  const hideModal = () => {
223
- window.postMessage({ type: 'HideCashierModal' }, window.location.href)
226
+ window.postMessage({ type: 'HideCashierModal' }, window.location.href);
224
227
  }
225
228
 
229
+ const renewSession = () => {
230
+ errorResponseCode = null;
231
+ setErrorResponseCode();
232
+ getPlayerSession();
233
+ }
234
+
235
+
226
236
  const closeModal = () => {
227
237
  showConfirmModal = false;
228
238
  }
@@ -251,6 +261,10 @@
251
261
  if (e.data.type === 'ShowCashierModal') {
252
262
  modalErrorMessage = e.data.modalErrorMessage;
253
263
  }
264
+ if (e.data.type === 'SessionExpired') {
265
+ errorResponseCode = ResponseCode.JwtTokenError;
266
+ setErrorResponseCode();
267
+ }
254
268
  }
255
269
 
256
270
  $: endpoint && session && customerid && lang && channel && type && successurl && failurl && cancelurl && getPlayerSession();
@@ -303,7 +317,22 @@
303
317
  >
304
318
  <div slot="button" class="ModalButton" on:click={hideModal}>{$_('closeModal')}</div>
305
319
  </cashier-error>
306
- </cashier-modal>
320
+ </cashier-modal>
321
+ {#if showsessionexpirationmodal === 'true'}
322
+ <cashier-session-expiration-modal
323
+ {assetsurl}
324
+ {translationurl}
325
+ {clientstylingurl}
326
+ {clientstyling}
327
+ {lang}
328
+ {local}
329
+ {endpoint}
330
+ {currency}
331
+ {customerid}
332
+ selectedpaymentmethodname="{selectedPaymentMethod.Name}"
333
+ >
334
+ </cashier-session-expiration-modal>
335
+ {/if}
307
336
  {#if showConfirmModal}
308
337
  <cashier-confirm-modal
309
338
  {clientstylingurl}
@@ -360,12 +389,18 @@
360
389
  {translationurl}
361
390
  {clientstylingurl}
362
391
  {clientstyling}
363
- hidebuttons="true"
392
+ imgurl = {errorResponseCode === ResponseCode.JwtTokenError ? 'session-expired-icon.png' : ''}
393
+ hidebuttons= {errorResponseCode !== ResponseCode.JwtTokenError}
364
394
  errorcode={errorResponseCode}
365
395
  >
366
396
  {#if !errorResponseCode}
367
397
  <span slot="text">{errorMessage}</span>
368
398
  {/if}
399
+ {#if errorResponseCode === ResponseCode.JwtTokenError}
400
+ <span slot="title">{$_('sessionExpiredTitle')}</span>
401
+ <span slot="text">{$_('sessionExpiredText')}</span>
402
+ <div slot="button" class="CashierErrorButton" on:click={renewSession}>{$_('continueSession')}</div>
403
+ {/if}
369
404
  </cashier-error>
370
405
  {/if}
371
406
  </div>
@@ -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"