@everymatrix/cashier-method-details 1.27.0 → 1.27.3

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/cashier-method-details",
3
- "version": "1.27.0",
3
+ "version": "1.27.3",
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": "f6ec9c7a552b5acad22390148d440b8050572424"
38
+ "gitHead": "bb3f018dda0d4518201642689dcd1745b1d9153e"
39
39
  }
@@ -7,10 +7,12 @@
7
7
  import { TRANSLATIONS } from './translations';
8
8
 
9
9
  import '@everymatrix/cashier-iframe-redirect';
10
+ import '@everymatrix/cashier-receipt-page';
10
11
  import '@everymatrix/cashier-confirm-modal'
11
12
  import '@everymatrix/cashier-notifications'
12
13
 
13
14
  import type {PaymentMethod} from "./CashierMethodDetails.types";
15
+ import {number} from "svelte-i18n";
14
16
  export class PaymentMethodDetails {
15
17
  name: string;
16
18
  label: string;
@@ -111,10 +113,17 @@
111
113
  export let customerid: string;
112
114
  export let currency: string;
113
115
  export let amount: number;
116
+ export let assetsurl: string;
117
+ export let type: string = TxnType.Deposit;
114
118
  export let selectedpaymentmethodname: string;
115
119
  export let clientstyling:string = '';
116
120
  export let clientstylingurl:string = ''
117
121
 
122
+ export enum TxnType {
123
+ Deposit='Deposit',
124
+ Withdraw='Withdraw'
125
+ }
126
+
118
127
  const VISIBLE_FIELD_TYPES: string[] =
119
128
  'Text,Number,Money,Boolean,Lookup,Date,Time,DateTime,Password,Label,Link,QRCode'.split(',');
120
129
  export enum RedirectionModeStringEnum {
@@ -132,6 +141,7 @@
132
141
  let customStylingContainer:HTMLElement;
133
142
  let prepareRequest;
134
143
  let showConfirmModal:boolean = false;
144
+ let showReceiptPage:boolean = false;
135
145
  let redirectUrl: string;
136
146
  let windowRedirect: Window;
137
147
  let showRedirectNotification: boolean;
@@ -153,6 +163,8 @@
153
163
  let amountError = '';
154
164
  let showError = {};
155
165
  let fieldValidation = {};
166
+ let openLookupTop = false;
167
+ let maxLookupHeight: number;
156
168
 
157
169
  $: endpoint && session && selectedpaymentmethodname && currency && getPaymentDetails();
158
170
  $: clientstyling && customStylingContainer && setClientStyling();
@@ -257,6 +269,7 @@
257
269
  window.addEventListener('confirmModal', confirmTxn, false);
258
270
  window.addEventListener('closeIframe', closeIframe, false);
259
271
  window.addEventListener('notificationButtonClick', retryRedirect, false);
272
+ window.addEventListener('closeCashierReceiptPage', closeReceiptPage, false);
260
273
  document.addEventListener('click',closeAllLookups)
261
274
 
262
275
  return () => {
@@ -264,6 +277,7 @@
264
277
  window.removeEventListener('confirmModal', confirmTxn);
265
278
  window.removeEventListener('closeIframe', closeIframe);
266
279
  window.removeEventListener('notificationButtonClick', retryRedirect);
280
+ window.removeEventListener('closeCashierReceiptPage', closeReceiptPage);
267
281
  }
268
282
  });
269
283
 
@@ -279,10 +293,18 @@
279
293
 
280
294
  const showLookup = (event, name) => {
281
295
  if (name === openedLookup) {
296
+ showError[openedLookup] = true;
297
+ validateField(fields.find(field => field.name === openedLookup));
282
298
  openedLookup = null
283
299
  return;
284
300
  }
301
+ event.stopPropagation();
285
302
  clickedElem = event.composedPath()[0]
303
+ const clickY = clickedElem.getBoundingClientRect().y;
304
+ const minLookupHeight = 200;
305
+ const lookupMargin = 55;
306
+ openLookupTop = (window.innerHeight - clickY) < minLookupHeight;
307
+ maxLookupHeight = openLookupTop ? clickY - minLookupHeight : window.innerHeight - clickY - lookupMargin;
286
308
  openedLookup = name
287
309
  }
288
310
 
@@ -342,6 +364,7 @@
342
364
  }
343
365
  const closeIframe = () => {
344
366
  redirectUrl = null;
367
+ showReceiptPage = true;
345
368
  }
346
369
  const closeModal = () => {
347
370
  showConfirmModal = false;
@@ -365,6 +388,9 @@
365
388
  redirectUrl = data.RedirectUrl;
366
389
  redirectMode = data.RedirectionMode;
367
390
  isProcessingTxn = false;
391
+ if (!redirectUrl) {
392
+ showReceiptPage = true;
393
+ }
368
394
  if (data.RedirectionMode === RedirectionModeStringEnum.RedirectWithRetry) {
369
395
  windowRedirect = window.open(data.RedirectUrl, '_blank');
370
396
  showRedirectNotification = !!windowRedirect;
@@ -380,6 +406,9 @@
380
406
  showRetryNotification = false;
381
407
  }
382
408
 
409
+ const closeReceiptPage = () => {
410
+ showReceiptPage = false
411
+ }
383
412
  const openUrlInNewTab = (url) => {
384
413
  if (!url) {
385
414
  return
@@ -435,7 +464,7 @@
435
464
  }
436
465
 
437
466
  const amountMultiplierError = () => {
438
- if (selectedPaymentMethod.AmountMultiplier && (selectedPaymentMethod.AmountMultiplier % amount !== 0)) {
467
+ if (selectedPaymentMethod.AmountMultiplier && (amount % selectedPaymentMethod.AmountMultiplier !== 0)) {
439
468
  return $_('amountMultiplierError', {
440
469
  values: {
441
470
  multiplier: selectedPaymentMethod.AmountMultiplier
@@ -496,143 +525,149 @@
496
525
  <div class="CashierMethodDetails" bind:this={customStylingContainer}>
497
526
  {#if selectedPaymentMethod?.Name}
498
527
  <div class="MethodsDetails">
499
- <form on:submit|preventDefault={prepareTxn}>
500
- <div class="FieldWrapper">
501
- <div class="FormLogo">
502
- <div class="SelectedLogoWrapper">
503
- <img src={selectedPaymentMethod.Logos[0].LogoUrl} alt={selectedPaymentMethod.Label} />
504
- </div>
505
- <div class="SelectedLogoDescription">
506
- {selectedPaymentMethod.Label}
528
+ {#if !showReceiptPage}
529
+ <form on:submit|preventDefault={prepareTxn}>
530
+ <div class="FieldWrapper">
531
+ <div class="FormLogo">
532
+ <div class="SelectedLogoWrapper">
533
+ <img src={selectedPaymentMethod.Logos[0].LogoUrl} alt={selectedPaymentMethod.Label} />
534
+ </div>
535
+ <div class="SelectedLogoDescription">
536
+ {selectedPaymentMethod.Label}
537
+ </div>
538
+ {#if mobileView}
539
+ <div on:click={() => backToMethodList()} class="ChangePaymeth">{$_('change')}</div>
540
+ {/if}
507
541
  </div>
508
- {#if mobileView}
509
- <div on:click={() => backToMethodList()} class="ChangePaymeth">{$_('change')}</div>
542
+ {#if selectedPaymentMethod.Description}
543
+ <div class="SelectedMethodDescription">
544
+ {selectedPaymentMethod.Description}
545
+ </div>
510
546
  {/if}
511
- </div>
512
- {#if selectedPaymentMethod.Description}
513
- <div class="SelectedMethodDescription">
514
- {selectedPaymentMethod.Description}
515
- </div>
516
- {/if}
517
- {#if !selectedPaymentMethod.HideAmountField}
518
- <div class="Amount" class:Invalid={amountError && showError['amount']}>
519
- <label>
520
- <span class="Required">
521
- {$_('amountLabel')}
522
- </span>
523
- {#if selectedPaymentMethod.IsAmountConfigurable}
524
- <input type="number"
525
- bind:value={amount}
526
- on:input={() => validateAmount()}
527
- on:blur={() => {showError['amount'] = true; validateAmount()}}
528
- placeholder="{$_('amountPlaceholder')}"
529
- >
530
- <span class="Alert">{amountError}</span>
531
- {#if selectedPaymentMethod.DisplayCurrency}
532
- <span class="AmountLimits">
533
- {selectedPaymentMethod.DisplayCurrency.MinAmountLimit ? `${$_('generalMin')} ${formatter.format(selectedPaymentMethod.DisplayCurrency.MinAmountLimit)} ${currency}` : ''}
534
- {selectedPaymentMethod.DisplayCurrency.MaxAmountLimit ? `/ ${$_('generalMax')} ${formatter.format(selectedPaymentMethod.DisplayCurrency.MaxAmountLimit)} ${currency}` : ''}
547
+ {#if !selectedPaymentMethod.HideAmountField}
548
+ <div class="Amount" class:Invalid={amountError && showError['amount']}>
549
+ <label>
550
+ <span class="Required">
551
+ {$_('amountLabel')}
552
+ </span>
553
+ {#if selectedPaymentMethod.IsAmountConfigurable}
554
+ <input type="number"
555
+ bind:value={amount}
556
+ on:input={() => validateAmount()}
557
+ on:blur={() => {showError['amount'] = true; validateAmount()}}
558
+ placeholder="{$_('amountPlaceholder')}"
559
+ >
560
+ <span class="Alert">{amountError}</span>
561
+ {#if selectedPaymentMethod.DisplayCurrency}
562
+ <span class="AmountLimits">
563
+ {selectedPaymentMethod.DisplayCurrency.MinAmountLimit ? `${$_('generalMin')} ${formatter.format(selectedPaymentMethod.DisplayCurrency.MinAmountLimit)} ${currency}` : ''}
564
+ {selectedPaymentMethod.DisplayCurrency.MaxAmountLimit ? `/ ${$_('generalMax')} ${formatter.format(selectedPaymentMethod.DisplayCurrency.MaxAmountLimit)} ${currency}` : ''}
565
+ </span>
566
+ {/if}
567
+ {:else}
568
+ <span class="NonConfigurableAmount">
569
+ {formatter.format(amount)} {currency}
535
570
  </span>
536
571
  {/if}
537
- {:else}
538
- <span class="NonConfigurableAmount">
539
- {formatter.format(amount)} {currency}
540
- </span>
541
- {/if}
542
- </label>
572
+ </label>
573
+ </div>
574
+ {/if}
543
575
  </div>
544
- {/if}
545
- </div>
546
- {#each fields as field, index}
547
- {#if showField(field)}
548
- <div class="FieldWrapper"
549
- class:Hidden={field.type === FieldTypes.Hidden}
550
- class:Invalid={showError[field.name] && fieldValidation[field.name]}>
551
- <label>
552
- {#if field.label && field.type !== FieldTypes.Link && field.type !== FieldTypes.Boolean}
553
- <span class:Required={field.isRequired}>{field.label}</span>
554
- {/if}
555
- {#if field.description && field.description !== field.label && field.type !== FieldTypes.QRCode && field.type !== FieldTypes.Boolean && field.type !== FieldTypes.Link}
556
- <span class="Description">{field.description}</span>
557
- {/if}
558
- {#if field.type === FieldTypes.Text}
559
- <input type="text" bind:value={prepareFields[field.name]}
560
- placeholder="{field.placeholder}"
561
- on:input="{() => { validateField(field) }}"
562
- on:blur="{() => { showError[field.name] = true; validateField(field) }}">
563
-
564
- {:else if field.type === FieldTypes.Number || field.type === FieldTypes.Money}
565
- <input type="number" placeholder="{field.placeholder}" bind:value={prepareFields[field.name]}
566
- on:input="{() => { validateField(field) }}"
567
- on:blur="{() => { showError[field.name] = true; validateField(field) }}"
568
- >
569
- {:else if field.type === FieldTypes.Password}
570
- <input type="password" bind:value={prepareFields[field.name]} placeholder="{field.placeholder}"
571
- on:input="{() => { validateField(field) }}"
572
- on:blur="{() => { showError[field.name] = true; validateField(field) }}"
573
- >
574
- {:else if field.type === FieldTypes.Hidden}
575
- <input type="hidden" bind:value={prepareFields[field.name]} placeholder="{field.placeholder}">
576
-
577
- {:else if field.type === FieldTypes.Lookup}
578
- <div class="CustomSelect">
579
- <div class="Selected" id="{index}" on:click="{(e) => showLookup(e, field.name)}">{prepareFields[field.name] || ''}</div>
580
- <div class="OptionList" class:Opened={openedLookup === field.name}>
581
- {#each field.values as value}
582
- <div on:click="{() => {prepareFields[field.name] = value.Name; fields = fields}}">
583
- <span>{value.Value}</span>
584
- </div>
585
- {/each}
586
- </div>
587
- </div>
588
- {:else if field.type === FieldTypes.Boolean}
589
- <div class="Checkbox">
590
- <input type="checkbox" bind:checked={prepareFields[field.name]} placeholder="{field.placeholder}"
591
- on:change="{() => { showError[field.name] = true; validateField(field) }}"
576
+ {#each fields as field, index}
577
+ {#if showField(field)}
578
+ <div class="FieldWrapper"
579
+ class:Hidden={field.type === FieldTypes.Hidden}
580
+ class:Invalid={showError[field.name] && fieldValidation[field.name]}>
581
+ <label>
582
+ {#if field.label && field.type !== FieldTypes.Link && field.type !== FieldTypes.Boolean}
583
+ <span class:Required={field.isRequired}>{field.label}</span>
584
+ {/if}
585
+ {#if field.description && field.description !== field.label && field.type !== FieldTypes.QRCode && field.type !== FieldTypes.Boolean && field.type !== FieldTypes.Link}
586
+ <span class="Description">{field.description}</span>
587
+ {/if}
588
+ {#if field.type === FieldTypes.Text}
589
+ <input type="text" bind:value={prepareFields[field.name]}
590
+ placeholder="{field.placeholder}"
591
+ on:input="{() => { validateField(field) }}"
592
+ on:blur="{() => { showError[field.name] = true; validateField(field) }}">
593
+
594
+ {:else if field.type === FieldTypes.Number || field.type === FieldTypes.Money}
595
+ <input type="number" placeholder="{field.placeholder}" bind:value={prepareFields[field.name]}
596
+ on:input="{() => { validateField(field) }}"
597
+ on:blur="{() => { showError[field.name] = true; validateField(field) }}"
592
598
  >
593
- <span class="Checkmark"></span>
594
- <span class="Description">{@html field.descriptionWithLink}</span>
595
- </div>
596
- {:else if field.type === FieldTypes.QRCode}
597
- <div class="QRCode" on:click={() => {openUrlInNewTab(field.description)}}>
598
- <div bind:this={qrCodeContainer[qrCodeContainer.length]}>{field.defaultValue}</div>
599
- </div>
600
- {:else if field.type === FieldTypes.Link}
601
- <span>{@html field.descriptionWithLink}</span>
602
- {:else if field.type === FieldTypes.Label}
603
- <span class="Label"></span>
604
- {:else}
605
- <input type="text" bind:value={prepareFields[field.name]} placeholder="{field.placeholder}">
606
- {/if}
607
- </label>
608
- <span class="Alert">{ fieldValidation[field.name] || '' }</span>
609
- </div>
610
- {/if}
611
- {/each}
612
- {#if !isProcessingTxn}
613
- <button class="PrimaryButton" type="submit" disabled="{isSubmitDisabled(amountError, fieldValidation)}">
614
- <svg class="ButtonLock" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
615
- <path fill-rule="evenodd" clip-rule="evenodd" d="M7.51564 0.574496C6.49714 0.733152 5.5928 1.46162 5.21164 2.43037C5.01714 2.92471 4.98674 3.24368 4.98671 4.78987L4.98668 5.99306L4.55336 6.00671C4.20693 6.01762 4.08258 6.03221 3.93336 6.07946C3.43136 6.23846 3.00318 6.58293 2.73943 7.04C2.70133 7.106 2.63639 7.256 2.59508 7.37334L2.52002 7.58665V13.9067L2.59268 14.12C2.6993 14.4331 2.83849 14.6518 3.09336 14.9067C3.34821 15.1615 3.56693 15.3007 3.88002 15.4073L4.09336 15.48H11.9067L12.12 15.4073C12.4331 15.3007 12.6518 15.1615 12.9067 14.9067C13.1616 14.6518 13.3007 14.4331 13.4074 14.12L13.48 13.9067V7.58665L13.405 7.37334C13.1846 6.74712 12.6999 6.27875 12.0667 6.08C11.9191 6.03371 11.7891 6.0184 11.4467 6.00696L11.0134 5.99253L11.0133 4.78959C11.0133 4.128 11.0008 3.45465 10.9855 3.29334C10.9257 2.66268 10.7188 2.13556 10.3497 1.67368C9.66549 0.817589 8.6023 0.405214 7.51564 0.574496ZM8.46436 1.58665C9.01596 1.7035 9.52999 2.11659 9.79758 2.65809C9.98521 3.03771 9.98202 3.00646 9.99305 4.58L10.003 6H5.99702L6.00699 4.58C6.01802 3.00646 6.01483 3.03771 6.20246 2.65809C6.31793 2.42446 6.43799 2.26065 6.61818 2.09103C6.89043 1.83468 7.21371 1.65496 7.52352 1.58775C7.74977 1.53865 8.23518 1.53809 8.46436 1.58665ZM11.9201 7.0955C12.0975 7.17871 12.2992 7.37412 12.3874 7.54806C12.4231 7.61846 12.465 7.75796 12.4805 7.85803C12.4993 7.97978 12.5061 8.97962 12.501 10.88L12.4934 13.72L12.4082 13.8997C12.26 14.2127 12.0016 14.419 11.6821 14.4796C11.4864 14.5167 4.51364 14.5167 4.31793 14.4796C3.99843 14.419 3.74008 14.2127 3.59183 13.8997L3.50668 13.72L3.49905 10.88C3.49393 8.97728 3.50074 7.97987 3.51964 7.85778C3.57627 7.49218 3.79218 7.21543 4.12918 7.0765L4.28002 7.01431L8.02668 7.0205L11.7734 7.02665L11.9201 7.0955Z" fill="white"/>
616
- </svg>
617
- {$_('makeDepositButton')}
618
- <span class="ButtonAmount">{formatter.format(amount)} {currency}</span>
619
- </button>
620
- {:else}
621
- <button class="PrimaryButton">
622
- <svg class="ButtonSpinner" xmlns="http://www.w3.org/2000/svg" width="15" height="14" viewBox="0 0 15 14" fill="none">
623
- <path d="M14.0282 6.58425C13.9037 4.05374 12.3688 1.68916 10.0872 0.61058C7.59818 -0.509483 4.56986 -0.0531603 2.49567 1.68916C0.504443 3.34851 -0.408201 6.04496 0.172573 8.57547C0.711862 11.0645 2.6616 13.0972 5.10915 13.7609C8.0545 14.5906 10.7509 13.1802 12.4103 10.7741C10.9169 12.7653 8.63527 14.0928 6.10476 13.6365C3.57424 13.1802 1.50005 11.2719 0.919281 8.78289C0.297024 6.12793 1.54154 3.34851 3.90612 1.97955C6.35366 0.569097 9.79682 1.10839 11.4147 3.51445C11.8295 4.09522 12.1199 4.80045 12.2444 5.50567C12.3688 6.08644 12.3273 6.7087 12.4103 7.28947C12.4933 7.82876 12.9496 8.53399 13.5718 8.16063C14.1111 7.82876 14.0696 7.12354 14.0282 6.58425C14.0696 6.87464 14.0282 6.41831 14.0282 6.58425Z" fill="white"/>
624
- </svg>
625
- {$_('processingButton')}
626
- </button>
627
- {/if}
628
- {#if showRetryNotification}
629
- <cashier-notifications
630
- text="{$_('retryText')}"
631
- button="{$_('retryButton')}"
632
- >
633
- </cashier-notifications>
634
- {/if}
635
- </form>
599
+ {:else if field.type === FieldTypes.Password}
600
+ <input type="password" bind:value={prepareFields[field.name]} placeholder="{field.placeholder}"
601
+ on:input="{() => { validateField(field) }}"
602
+ on:blur="{() => { showError[field.name] = true; validateField(field) }}"
603
+ >
604
+ {:else if field.type === FieldTypes.Hidden}
605
+ <input type="hidden" bind:value={prepareFields[field.name]} placeholder="{field.placeholder}">
606
+
607
+ {:else if field.type === FieldTypes.Lookup}
608
+ <div class="CustomSelect">
609
+ <div class="Selected" id="{index}" on:click="{(e) => showLookup(e, field.name)}">{prepareFields[field.name] || ''}</div>
610
+ <div class="OptionList"
611
+ class:Opened={openedLookup === field.name}
612
+ class:Top={openLookupTop}
613
+ style="max-height: {`${maxLookupHeight}px`};"
614
+ >
615
+ {#each field.values as value}
616
+ <div on:click="{() => {prepareFields[field.name] = value.Name; fields = fields}}">
617
+ <span>{value.Value}</span>
618
+ </div>
619
+ {/each}
620
+ </div>
621
+ </div>
622
+ {:else if field.type === FieldTypes.Boolean}
623
+ <div class="Checkbox">
624
+ <input type="checkbox" bind:checked={prepareFields[field.name]} placeholder="{field.placeholder}"
625
+ on:change="{() => { showError[field.name] = true; validateField(field) }}"
626
+ >
627
+ <span class="Checkmark"></span>
628
+ <span class="Description">{@html field.descriptionWithLink}</span>
629
+ </div>
630
+ {:else if field.type === FieldTypes.QRCode}
631
+ <div class="QRCode" on:click={() => {openUrlInNewTab(field.description)}}>
632
+ <div bind:this={qrCodeContainer[qrCodeContainer.length]}>{field.defaultValue}</div>
633
+ </div>
634
+ {:else if field.type === FieldTypes.Link}
635
+ <span>{@html field.descriptionWithLink}</span>
636
+ {:else if field.type === FieldTypes.Label}
637
+ <span class="Label"></span>
638
+ {:else}
639
+ <input type="text" bind:value={prepareFields[field.name]} placeholder="{field.placeholder}">
640
+ {/if}
641
+ </label>
642
+ <span class="Alert">{ fieldValidation[field.name] || '' }</span>
643
+ </div>
644
+ {/if}
645
+ {/each}
646
+ {#if !isProcessingTxn}
647
+ <button class="PrimaryButton" type="submit" disabled="{isSubmitDisabled(amountError, fieldValidation)}">
648
+ <svg class="ButtonLock" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
649
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.51564 0.574496C6.49714 0.733152 5.5928 1.46162 5.21164 2.43037C5.01714 2.92471 4.98674 3.24368 4.98671 4.78987L4.98668 5.99306L4.55336 6.00671C4.20693 6.01762 4.08258 6.03221 3.93336 6.07946C3.43136 6.23846 3.00318 6.58293 2.73943 7.04C2.70133 7.106 2.63639 7.256 2.59508 7.37334L2.52002 7.58665V13.9067L2.59268 14.12C2.6993 14.4331 2.83849 14.6518 3.09336 14.9067C3.34821 15.1615 3.56693 15.3007 3.88002 15.4073L4.09336 15.48H11.9067L12.12 15.4073C12.4331 15.3007 12.6518 15.1615 12.9067 14.9067C13.1616 14.6518 13.3007 14.4331 13.4074 14.12L13.48 13.9067V7.58665L13.405 7.37334C13.1846 6.74712 12.6999 6.27875 12.0667 6.08C11.9191 6.03371 11.7891 6.0184 11.4467 6.00696L11.0134 5.99253L11.0133 4.78959C11.0133 4.128 11.0008 3.45465 10.9855 3.29334C10.9257 2.66268 10.7188 2.13556 10.3497 1.67368C9.66549 0.817589 8.6023 0.405214 7.51564 0.574496ZM8.46436 1.58665C9.01596 1.7035 9.52999 2.11659 9.79758 2.65809C9.98521 3.03771 9.98202 3.00646 9.99305 4.58L10.003 6H5.99702L6.00699 4.58C6.01802 3.00646 6.01483 3.03771 6.20246 2.65809C6.31793 2.42446 6.43799 2.26065 6.61818 2.09103C6.89043 1.83468 7.21371 1.65496 7.52352 1.58775C7.74977 1.53865 8.23518 1.53809 8.46436 1.58665ZM11.9201 7.0955C12.0975 7.17871 12.2992 7.37412 12.3874 7.54806C12.4231 7.61846 12.465 7.75796 12.4805 7.85803C12.4993 7.97978 12.5061 8.97962 12.501 10.88L12.4934 13.72L12.4082 13.8997C12.26 14.2127 12.0016 14.419 11.6821 14.4796C11.4864 14.5167 4.51364 14.5167 4.31793 14.4796C3.99843 14.419 3.74008 14.2127 3.59183 13.8997L3.50668 13.72L3.49905 10.88C3.49393 8.97728 3.50074 7.97987 3.51964 7.85778C3.57627 7.49218 3.79218 7.21543 4.12918 7.0765L4.28002 7.01431L8.02668 7.0205L11.7734 7.02665L11.9201 7.0955Z" fill="white"/>
650
+ </svg>
651
+ {$_(`${type.toLowerCase()}.makeTxnButton`)}
652
+ <span class="ButtonAmount">{formatter.format(amount)} {currency}</span>
653
+ </button>
654
+ {:else}
655
+ <button class="PrimaryButton">
656
+ <svg class="ButtonSpinner" xmlns="http://www.w3.org/2000/svg" width="15" height="14" viewBox="0 0 15 14" fill="none">
657
+ <path d="M14.0282 6.58425C13.9037 4.05374 12.3688 1.68916 10.0872 0.61058C7.59818 -0.509483 4.56986 -0.0531603 2.49567 1.68916C0.504443 3.34851 -0.408201 6.04496 0.172573 8.57547C0.711862 11.0645 2.6616 13.0972 5.10915 13.7609C8.0545 14.5906 10.7509 13.1802 12.4103 10.7741C10.9169 12.7653 8.63527 14.0928 6.10476 13.6365C3.57424 13.1802 1.50005 11.2719 0.919281 8.78289C0.297024 6.12793 1.54154 3.34851 3.90612 1.97955C6.35366 0.569097 9.79682 1.10839 11.4147 3.51445C11.8295 4.09522 12.1199 4.80045 12.2444 5.50567C12.3688 6.08644 12.3273 6.7087 12.4103 7.28947C12.4933 7.82876 12.9496 8.53399 13.5718 8.16063C14.1111 7.82876 14.0696 7.12354 14.0282 6.58425C14.0696 6.87464 14.0282 6.41831 14.0282 6.58425Z" fill="white"/>
658
+ </svg>
659
+ {$_('processingButton')}
660
+ </button>
661
+ {/if}
662
+ {#if showRetryNotification}
663
+ <cashier-notifications
664
+ text="{$_('retryText')}"
665
+ button="{$_('retryButton')}"
666
+ >
667
+ </cashier-notifications>
668
+ {/if}
669
+ </form>
670
+ {/if}
636
671
  {#if showRedirectNotification}
637
672
  <div class="RedirectionNotification">
638
673
  <img src="//static.everymatrix.com/mmstage/cashier/assets/redirect.png" alt="">
@@ -641,6 +676,20 @@
641
676
  <div class="RedirectionClose" on:click={() => {showRedirectNotification = false}}>{$_('backToPayment')}</div>
642
677
  </div>
643
678
  {/if}
679
+ {#if showReceiptPage}
680
+ <div class="ReceiptPage">
681
+ <cashier-receipt-page
682
+ {lang}
683
+ {translationurl}
684
+ {local}
685
+ {endpoint}
686
+ {customerid}
687
+ {assetsurl}
688
+ session="{xPaymentSessionToken}"
689
+ >
690
+ </cashier-receipt-page>
691
+ </div>
692
+ {/if}
644
693
  </div>
645
694
  {/if}
646
695
  {#if redirectUrl && redirectMode === RedirectionModeStringEnum.Default}
@@ -654,14 +703,17 @@
654
703
  {/if}
655
704
  {#if showConfirmModal}
656
705
  <cashier-confirm-modal>
657
- <span slot="text">{$_('confirmDepositText')} {formatter.format(amount)} {currency} ?</span>
658
- <div slot="confirm">{$_('confirmDepositButton')}</div>
706
+ <span slot="text">{$_(`${type.toLowerCase()}.confirmText`)} {formatter.format(amount)} {currency} ?</span>
707
+ <div slot="confirm">{$_(`${type.toLowerCase()}.confirmButton`)}</div>
659
708
  </cashier-confirm-modal>
660
709
  {/if}
661
710
  </div>
662
711
 
663
712
 
664
713
  <style lang="scss">
714
+
715
+ $input-height: 40px;
716
+
665
717
  @keyframes loading-spinner {
666
718
  from {
667
719
  transform: rotate(0deg)
@@ -670,6 +722,29 @@
670
722
  transform: rotate(360deg)
671
723
  }
672
724
  }
725
+ ::-webkit-scrollbar {
726
+ width: 4px;
727
+ }
728
+ ::-webkit-scrollbar-track {
729
+ background: transparent;
730
+ }
731
+ ::-webkit-scrollbar-thumb {
732
+ background: var(--emw--color-gray-100, #E8E9EB);
733
+ }
734
+ ::-webkit-scrollbar-thumb:hover {
735
+ background: var(--emw--color-gray-300, #666);
736
+ }
737
+
738
+ input::-webkit-outer-spin-button,
739
+ input::-webkit-inner-spin-button {
740
+ -webkit-appearance: none;
741
+ margin: 0;
742
+ }
743
+
744
+ input[type=number] {
745
+ -moz-appearance: textfield;
746
+ }
747
+
673
748
  .MethodsDetails {
674
749
  position: relative;
675
750
  display: flex;
@@ -721,7 +796,7 @@
721
796
  }
722
797
  .RedirectionNotification {
723
798
  height: 100%;
724
- width: inherit;
799
+ width: 100%;
725
800
  position: absolute;
726
801
  display: flex;
727
802
  flex-direction: column;
@@ -826,7 +901,7 @@
826
901
  input, .Selected {
827
902
  border: 1px solid var(--emw--color-gray-100, #E8E9EB);
828
903
  border-radius: var(--emw--border-radius-medium, 4px);
829
- height: 40px;
904
+ height: $input-height;
830
905
  line-height: var(--emw--size-small, 14px);
831
906
  color: var(--emw--color-black, #111);
832
907
  padding: 0 15px;
@@ -972,7 +1047,6 @@
972
1047
  .OptionList {
973
1048
  display: none;
974
1049
  position: absolute;
975
- top: 100%;
976
1050
  left: 0;
977
1051
  right: 0;
978
1052
  z-index: 99;
@@ -980,10 +1054,17 @@
980
1054
  border: 1px solid var(--emw--color-gray-100, #E8E9EB);
981
1055
  border-radius: var(--emw--border-radius-medium, 4px);
982
1056
  margin-top: 5px;
1057
+ overflow: auto;
1058
+ box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.1);
1059
+ &.Top {
1060
+ transform: translate(0, calc(-1 * (100% + $input-height + 10px)));
1061
+ }
983
1062
  div {
984
1063
  padding: 8px 16px;
985
1064
  cursor: pointer;
986
1065
  user-select: none;
1066
+ line-height: calc(var(--emw--size-small, 14px) + 3px);
1067
+ font-size: var(--emw--size-small, 14px);
987
1068
  &:hover {
988
1069
  background-color: var(--emw--color-background-secondary, #F9F9F9)
989
1070
  }
@@ -2,9 +2,6 @@ export const TRANSLATIONS = {
2
2
  "en": {
3
3
  "loading": "Loading...",
4
4
  "amountLabel": "Amount",
5
- "makeDepositButton": "DEPOSIT",
6
- "confirmDepositText": "Are you sure you want to deposit",
7
- "confirmDepositButton": "Ok",
8
5
  "redirectTitle": "You are redirected to the payment\'s provider page",
9
6
  "redirectMessage": "Please complete your transaction on the payment\'s provider page.",
10
7
  "backToPayment": "Close",
@@ -21,6 +18,16 @@ export const TRANSLATIONS = {
21
18
  "amountMultiplierError": "Amount should be multiple of {multiplier}",
22
19
  "amountIntError": "Amount should be integer value",
23
20
  "amountDecimalError": "Amount should have 2 or less digits after decimal point",
24
- "invalidFieldError": "{field} is invalid"
21
+ "invalidFieldError": "{field} is invalid",
22
+ "deposit": {
23
+ "makeTxnButton": "DEPOSIT",
24
+ "confirmText": "Are you sure you want to deposit?",
25
+ "confirmButton": "Ok",
26
+ },
27
+ "withdraw": {
28
+ "makeTxnButton": "WITHDRAW",
29
+ "confirmText": "Are you sure you want to withdraw?",
30
+ "confirmButton": "Ok",
31
+ }
25
32
  }
26
33
  };