@everymatrix/cashier-page 1.35.0 → 1.36.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/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.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": "cad27ef6706d0e17f1eda3810fee31f1ec373fa9"
38
+ "gitHead": "5ffc382ef56d1d1736e48fec65bba06fbdadc8cf"
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() && !errorResponseCode) {
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(() => {
@@ -214,13 +229,14 @@
214
229
 
215
230
  const messageHandler = (e:any) => {
216
231
  if (e.data.type === 'ShowSessionError') {
217
- errorMessage = e.data.error
232
+ errorMessage = e.data.error;
218
233
  }
219
234
  if (e.data.type === 'ToggleDisableActionOnPage') {
220
- isProcessingTxn = e.data.disable
235
+ isProcessingTxn = e.data.disable;
221
236
  }
222
237
  if (e.data.type === 'ErrorResponseCode') {
223
238
  errorResponseCode = e.data.errorResponseCode;
239
+ setTitle();
224
240
  }
225
241
  if (e.data.type === 'ShowConfirmModal') {
226
242
  showConfirmModal = e.data.showConfirmModal;
@@ -229,13 +245,21 @@
229
245
  }
230
246
  if (e.data.type === 'RedirectInfo') {
231
247
  redirectUrl = e.data.redirectUrl;
232
- redirectMode = e.data.redirectMode;
248
+ redirectMode = e.data.redirectMode;
249
+ setTitle();
233
250
  }
234
251
  if (e.data.type === 'ShowCashierModal') {
235
252
  modalErrorMessage = e.data.modalErrorMessage;
236
253
  }
237
254
  }
238
255
 
256
+ $: endpoint && session && customerid && lang && channel && type && successurl && failurl && cancelurl && getPlayerSession();
257
+ $: clientstyling && customStylingContainer && setClientStyling();
258
+ $: clientstylingurl && customStylingContainer && setClientStylingURL();
259
+ $: lang && setActiveLanguage();
260
+ $: lang && setTitle();
261
+ $: translationurl && setTranslationUrl();
262
+ $: widgetWidth && setDevice();
239
263
  </script>
240
264
  <div class={showMethodDetailsPage ? "CashierPageWidget BothSections" : "CashierPageWidget"}
241
265
  bind:this={customStylingContainer}
@@ -245,12 +269,26 @@
245
269
  <div class="DisablePage"></div>
246
270
  {/if}
247
271
  {#if lang}
248
- <div class="Header">{ $_(`header.${type.toLowerCase()}`)}</div>
272
+ {#if !!showheader && showheader !== 'false'}
273
+ <cashier-header class="Header"
274
+ {lang}
275
+ {translationurl}
276
+ {title}
277
+ {clientstylingurl}
278
+ {clientstyling}
279
+ showbackbutton="{showHeaderBack}"
280
+ >
281
+ </cashier-header>
282
+ {/if}
249
283
  {#if redirectUrl && redirectMode === RedirectionModeStringEnum.Default}
250
284
  <div class="IframeRedirect">
251
285
  <cashier-iframe-redirect
252
- lang="{lang}"
253
- translationurl="{translationurl}"
286
+ {lang}
287
+ {translationurl}
288
+ {title}
289
+ {clientstylingurl}
290
+ {clientstyling}
291
+ showbackbutton="{showheader}"
254
292
  iframeurl="{redirectUrl}"
255
293
  ></cashier-iframe-redirect>
256
294
  </div>
@@ -265,9 +303,12 @@
265
303
  >
266
304
  <div slot="button" class="ModalButton" on:click={hideModal}>{$_('closeModal')}</div>
267
305
  </cashier-error>
268
- </cashier-modal>
306
+ </cashier-modal>
269
307
  {#if showConfirmModal}
270
- <cashier-confirm-modal>
308
+ <cashier-confirm-modal
309
+ {clientstylingurl}
310
+ {clientstyling}
311
+ >
271
312
  <span slot="text">{ confirmAmount && !hideAmountField ? $_(`${type.toLowerCase()}.confirmTextWithAmount`,
272
313
  { values:{ amount: formatter.format(confirmAmount), currency }}): $_(`${type.toLowerCase()}.confirmText`)}</span>
273
314
  <div slot="confirm">{$_(`${type.toLowerCase()}.confirmButton`)}</div>
@@ -289,6 +330,7 @@
289
330
  {clientstyling}
290
331
  {assetsurl}
291
332
  session="{xPaymentSessionToken}"
333
+ ismobileview="{mobileView}"
292
334
  ></cashier-methods-list>
293
335
  </div>
294
336
  <div class="CashierMethodDetailsWrapper">
@@ -312,7 +354,7 @@
312
354
  </div>
313
355
  </div>
314
356
  {:else}
315
- <cashier-error
357
+ <cashier-error class="Error"
316
358
  {lang}
317
359
  {assetsurl}
318
360
  {translationurl}
@@ -339,10 +381,10 @@
339
381
  }
340
382
  }
341
383
  @mixin container-height {
342
- height: calc(100% - 66px);
384
+ height: 100%;
343
385
  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
386
  box-sizing: border-box;
387
+ scrollbar-gutter: stable both-edges;
346
388
  }
347
389
  .DisablePage {
348
390
  container-type: inline-size;
@@ -360,15 +402,35 @@
360
402
  container-name: deposit-page;
361
403
  height: inherit;
362
404
  position: relative;
405
+ box-sizing: border-box;
363
406
  .CashierMethodDetailsWrapper {
364
407
  display: none;
365
408
  }
409
+ &:has(.Header) {
410
+ border-radius: 6px;
411
+ border: 1px solid var(--mmw--color-grey-105, #E8E9EB);
412
+ box-sizing: border-box;
413
+ .Content, .CashierPage, .DisablePage {
414
+ height: calc(100% - var(--mmw--header-height, 32px));
415
+ }
416
+ .DisablePage {
417
+ top: var(--mmw--header-height, 32px);
418
+ }
419
+ }
366
420
  }
367
- .BothSections {
368
- .Header {
369
- transition: all 1s;
370
- width: 100%;
421
+ .Content {
422
+ height: 100%;
423
+ position: relative;
424
+ }
425
+ .CashierMethodListWrapper {
426
+ @include container-height;
427
+ padding: var(--emw--spacing-large, 20px) var(--emw--spacing-x-small, 10px) var(--emw--spacing-small, 12px) var(--emw--spacing-x-small, 10px);
428
+ width: 50%;
429
+ &::-webkit-scrollbar {
430
+ border-right: none;
371
431
  }
432
+ }
433
+ .BothSections {
372
434
  .CashierMethodDetailsWrapper {
373
435
  @include container-height;
374
436
  display: block;
@@ -376,16 +438,11 @@
376
438
  width: 50%;
377
439
  justify-content: center;
378
440
  }
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);
441
+ .CashierMethodListWrapper {
442
+ &::-webkit-scrollbar {
443
+ border-right: 1px solid var(--emw--color-gray-100, #E0E0E0 );
444
+ }
445
+ }
389
446
  }
390
447
  .CashierPage {
391
448
  position: relative;
@@ -394,13 +451,7 @@
394
451
  justify-content: center;
395
452
  height: inherit;
396
453
  }
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
- }
454
+
404
455
  cashier-method-details {
405
456
  width: 0;
406
457
  }
@@ -421,15 +472,13 @@
421
472
  background-color: var(--emw--color-white, #FFF);
422
473
  }
423
474
  @container deposit-page (max-width:750px) {
424
- .Header {
425
- width: 100%;
426
- }
427
475
  .CashierPage, .BothSections .CashierPage {
428
476
  flex-direction: column;
429
477
  justify-content: flex-start;
430
478
  gap: 0;
431
479
  cashier-methods-list, cashier-method-details, .CashierMethodDetailsWrapper {
432
480
  width: 100%;
481
+ height: 100%;
433
482
  }
434
483
  }
435
484
  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
+ };