@everymatrix/cashier-page 1.35.0 → 1.36.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,7 +36,7 @@
36
36
  local="en-US"
37
37
  channel="Desktop"
38
38
  type="Deposit"
39
- session="b54930b8-1e79-496b-bb20-ac07d5098e39"
39
+ session="935b0211-7b3d-4454-8b0a-f8e66099c18f"
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
42
  endpoint="https://odeonbet-api.stage.norway.mazeday.com"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/cashier-page",
3
- "version": "1.35.0",
3
+ "version": "1.36.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": "cad27ef6706d0e17f1eda3810fee31f1ec373fa9"
38
+ "gitHead": "09be81de9c66446d0062303022d5f036d874d153"
39
39
  }
@@ -1,12 +1,13 @@
1
1
  <svelte:options tag={null} />
2
2
  <script lang="ts">
3
3
  import {onMount} from "svelte";
4
- import {_, addNewMessages, setLocale} from './i18n';
4
+ import { _, addNewMessages, setLocale, setupI18n } from './i18n';
5
5
  import {TRANSLATIONS} from './translations';
6
6
 
7
7
  import type {PaymentMethod} from "./CashierPage.types";
8
8
  import {TxnChannel, TxnType, ResponseCode} from "./CashierPage.types";
9
9
 
10
+ import '@everymatrix/cashier-header';
10
11
  import '@everymatrix/cashier-methods-list';
11
12
  import '@everymatrix/cashier-method-details';
12
13
  import '@everymatrix/cashier-error';
@@ -43,6 +44,7 @@
43
44
  export let assetsurl: string;
44
45
  export let type: string = TxnType.Deposit;
45
46
  export let channel: string = TxnChannel.Desktop;
47
+ export let showheader: string = 'true';
46
48
  export let numberofmethodsshown: string;
47
49
  export let clientstyling:string = '';
48
50
  export let clientstylingurl:string = ''
@@ -75,13 +77,9 @@
75
77
  let hideAmountField: boolean;
76
78
  let redirectMode: RedirectionModeStringEnum;
77
79
  let modalErrorMessage: string;
80
+ let title: string;
81
+ let showHeaderBack: string;
78
82
 
79
- $: endpoint && session && customerid && lang && channel && type && successurl && failurl && cancelurl && getPlayerSession();
80
- $: clientstyling && customStylingContainer && setClientStyling();
81
- $: clientstylingurl && customStylingContainer && setClientStylingURL();
82
- $: lang && setActiveLanguage();
83
- $: lang && translationurl && setTranslationUrl();
84
- $: widgetWidth && setDevice();
85
83
  const setActiveLanguage = ():void => {
86
84
  setLocale(lang);
87
85
  }
@@ -150,12 +148,28 @@
150
148
  .catch(error => console.log(error))
151
149
  }
152
150
 
151
+ const setTitle = () => {
152
+ if (showMethodDetailsPage && isMobileWidth()) {
153
+ title = selectedPaymentMethod.Label || selectedPaymentMethod.Name;
154
+ showHeaderBack = 'true'
155
+ } else {
156
+ title = `header.${type.toLowerCase()}`
157
+ showHeaderBack = 'false'
158
+ }
159
+ }
153
160
  const setDevice = () => {
154
- mobileView = (widgetWidth < 750).toString();
161
+ mobileView = isMobileWidth().toString();
162
+ setTitle()
163
+ }
164
+
165
+ const isMobileWidth = () => {
166
+ return widgetWidth < 750
155
167
  }
156
168
  const selectPayMeth = (e) => {
157
169
  selectedPaymentMethod.Name = e.detail.Name;
170
+ selectedPaymentMethod.Label = e.detail.Label
158
171
  showMethodDetailsPage = true;
172
+ setTitle()
159
173
  }
160
174
  const setErrorResponseCode = () => {
161
175
  window.postMessage({type: 'ErrorResponseCode', errorResponseCode}, window.location.href);
@@ -184,6 +198,7 @@
184
198
 
185
199
  const hideMethodDetails = (e) => {
186
200
  showMethodDetailsPage = !e.detail.hideMethodDetails
201
+ setTitle()
187
202
  }
188
203
 
189
204
  onMount(() => {
@@ -229,13 +244,21 @@
229
244
  }
230
245
  if (e.data.type === 'RedirectInfo') {
231
246
  redirectUrl = e.data.redirectUrl;
232
- redirectMode = e.data.redirectMode;
247
+ redirectMode = e.data.redirectMode;
248
+ setTitle()
233
249
  }
234
250
  if (e.data.type === 'ShowCashierModal') {
235
251
  modalErrorMessage = e.data.modalErrorMessage;
236
252
  }
237
253
  }
238
254
 
255
+ $: endpoint && session && customerid && lang && channel && type && successurl && failurl && cancelurl && getPlayerSession();
256
+ $: clientstyling && customStylingContainer && setClientStyling();
257
+ $: clientstylingurl && customStylingContainer && setClientStylingURL();
258
+ $: lang && setActiveLanguage();
259
+ $: lang && setTitle();
260
+ $: translationurl && setTranslationUrl();
261
+ $: widgetWidth && setDevice();
239
262
  </script>
240
263
  <div class={showMethodDetailsPage ? "CashierPageWidget BothSections" : "CashierPageWidget"}
241
264
  bind:this={customStylingContainer}
@@ -245,12 +268,26 @@
245
268
  <div class="DisablePage"></div>
246
269
  {/if}
247
270
  {#if lang}
248
- <div class="Header">{ $_(`header.${type.toLowerCase()}`)}</div>
271
+ {#if !!showheader && showheader !== 'false'}
272
+ <cashier-header class="Header"
273
+ {lang}
274
+ {translationurl}
275
+ {title}
276
+ {clientstylingurl}
277
+ {clientstyling}
278
+ showbackbutton="{showHeaderBack}"
279
+ >
280
+ </cashier-header>
281
+ {/if}
249
282
  {#if redirectUrl && redirectMode === RedirectionModeStringEnum.Default}
250
283
  <div class="IframeRedirect">
251
284
  <cashier-iframe-redirect
252
- lang="{lang}"
253
- translationurl="{translationurl}"
285
+ {lang}
286
+ {translationurl}
287
+ {title}
288
+ {clientstylingurl}
289
+ {clientstyling}
290
+ showbackbutton="{showheader}"
254
291
  iframeurl="{redirectUrl}"
255
292
  ></cashier-iframe-redirect>
256
293
  </div>
@@ -265,7 +302,7 @@
265
302
  >
266
303
  <div slot="button" class="ModalButton" on:click={hideModal}>{$_('closeModal')}</div>
267
304
  </cashier-error>
268
- </cashier-modal>
305
+ </cashier-modal>
269
306
  {#if showConfirmModal}
270
307
  <cashier-confirm-modal>
271
308
  <span slot="text">{ confirmAmount && !hideAmountField ? $_(`${type.toLowerCase()}.confirmTextWithAmount`,
@@ -289,6 +326,7 @@
289
326
  {clientstyling}
290
327
  {assetsurl}
291
328
  session="{xPaymentSessionToken}"
329
+ ismobileview="{mobileView}"
292
330
  ></cashier-methods-list>
293
331
  </div>
294
332
  <div class="CashierMethodDetailsWrapper">
@@ -312,7 +350,7 @@
312
350
  </div>
313
351
  </div>
314
352
  {:else}
315
- <cashier-error
353
+ <cashier-error class="Error"
316
354
  {lang}
317
355
  {assetsurl}
318
356
  {translationurl}
@@ -339,10 +377,10 @@
339
377
  }
340
378
  }
341
379
  @mixin container-height {
342
- height: calc(100% - 66px);
380
+ height: 100%;
343
381
  overflow: auto;
344
- padding: var(--emw--spacing-x-small, 7px) var(--emw--spacing-small, 12px) var(--emw--spacing-small, 12px) var(--emw--spacing-small, 12px);
345
382
  box-sizing: border-box;
383
+ scrollbar-gutter: stable both-edges;
346
384
  }
347
385
  .DisablePage {
348
386
  container-type: inline-size;
@@ -360,15 +398,37 @@
360
398
  container-name: deposit-page;
361
399
  height: inherit;
362
400
  position: relative;
401
+ box-sizing: border-box;
363
402
  .CashierMethodDetailsWrapper {
364
403
  display: none;
365
404
  }
405
+ &:has(.Header) {
406
+ .Content, .CashierPage, .Error {
407
+ border-radius: 0 0 6px 6px;
408
+ border: 1px solid var(--mmw--color-grey-105, #E8E9EB);
409
+ box-sizing: border-box;
410
+ }
411
+ .Content, .CashierPage, .DisablePage {
412
+ height: calc(100% - var(--mmw--header-height, 32px));
413
+ }
414
+ .DisablePage {
415
+ top: var(--mmw--header-height, 32px);
416
+ }
417
+ }
366
418
  }
367
- .BothSections {
368
- .Header {
369
- transition: all 1s;
370
- width: 100%;
419
+ .Content {
420
+ height: 100%;
421
+ position: relative;
422
+ }
423
+ .CashierMethodListWrapper {
424
+ @include container-height;
425
+ padding: var(--emw--spacing-large, 20px) var(--emw--spacing-x-small, 10px) var(--emw--spacing-small, 12px) var(--emw--spacing-x-small, 10px);
426
+ width: 50%;
427
+ &::-webkit-scrollbar {
428
+ border-right: none;
371
429
  }
430
+ }
431
+ .BothSections {
372
432
  .CashierMethodDetailsWrapper {
373
433
  @include container-height;
374
434
  display: block;
@@ -376,16 +436,11 @@
376
436
  width: 50%;
377
437
  justify-content: center;
378
438
  }
379
- }
380
- .Header {
381
- width: 50%;
382
- display: flex;
383
- margin: auto;
384
- padding: var(--emw--spacing-medium, 15px) 0;
385
- font-size: var(--emw--font-size-small, 14px);
386
- font-weight: bold;
387
- color: var(--mmw--color-grey-10, #111);
388
- line-height: var(--emw--font-size-small, 14px);
439
+ .CashierMethodListWrapper {
440
+ &::-webkit-scrollbar {
441
+ border-right: 1px solid var(--emw--color-gray-100, #E0E0E0 );
442
+ }
443
+ }
389
444
  }
390
445
  .CashierPage {
391
446
  position: relative;
@@ -394,13 +449,7 @@
394
449
  justify-content: center;
395
450
  height: inherit;
396
451
  }
397
- .CashierMethodListWrapper {
398
- @include container-height;
399
- width: 50%;
400
- &::-webkit-scrollbar {
401
- border-right: 1px solid var(--emw--color-gray-100, #E0E0E0 );
402
- }
403
- }
452
+
404
453
  cashier-method-details {
405
454
  width: 0;
406
455
  }
@@ -421,15 +470,13 @@
421
470
  background-color: var(--emw--color-white, #FFF);
422
471
  }
423
472
  @container deposit-page (max-width:750px) {
424
- .Header {
425
- width: 100%;
426
- }
427
473
  .CashierPage, .BothSections .CashierPage {
428
474
  flex-direction: column;
429
475
  justify-content: flex-start;
430
476
  gap: 0;
431
477
  cashier-methods-list, cashier-method-details, .CashierMethodDetailsWrapper {
432
478
  width: 100%;
479
+ height: 100%;
433
480
  }
434
481
  }
435
482
  cashier-method-details {
@@ -2,10 +2,6 @@ export const TRANSLATIONS = {
2
2
  "en": {
3
3
  "loading": "Loading...",
4
4
  "closeModal": "CLOSE",
5
- "header": {
6
- "deposit": "Deposit",
7
- "withdraw": "Withdraw"
8
- },
9
5
  "deposit": {
10
6
  "makeTxnButton": "DEPOSIT",
11
7
  "confirmText": "You're going to deposit to your account",
@@ -25,5 +21,25 @@ export const TRANSLATIONS = {
25
21
  "deposit": "Uplata",
26
22
  "withdraw": "Povlačenje"
27
23
  }
24
+ },
25
+ "tr": {
26
+ "loading": "Yükleniyor...",
27
+ "closeModal": "KAPAT",
28
+ "header": {
29
+ "deposit": "Yatır",
30
+ "withdraw": "Çek"
31
+ },
32
+ "deposit": {
33
+ "makeTxnButton": "YATIR",
34
+ "confirmText": "Hesabınıza yatırıyorsunuz",
35
+ "confirmTextWithAmount": "Hesabınıza {amount} {currency} yatırıyorsunuz",
36
+ "confirmButton": "Tamam"
37
+ },
38
+ "withdraw": {
39
+ "makeTxnButton": "ÇEK",
40
+ "confirmText": "Hesabınızdan çekiyorsunuz",
41
+ "confirmTextWithAmount": "Hesabınıza {amount} {currency} yatırıyorsunuz",
42
+ "confirmButton": "Tamam"
43
+ }
28
44
  }
29
- }
45
+ };