@everymatrix/cashier-methods-list 1.25.0 → 1.27.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/cashier-methods-list",
3
- "version": "1.25.0",
3
+ "version": "1.27.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": "668756b576877a7c33679408591fa2b7f93e0f37"
38
+ "gitHead": "f6ec9c7a552b5acad22390148d440b8050572424"
39
39
  }
@@ -6,6 +6,7 @@
6
6
  import {createEventDispatcher, onMount} from "svelte";
7
7
 
8
8
  export let lang:string = 'en';
9
+ export let local:string = 'en-US';
9
10
  export let endpoint:string;
10
11
  export let session:string;
11
12
  export let customerid: string;
@@ -26,6 +27,7 @@
26
27
  let methodsButtonToggleText: string = '';
27
28
  let paymentMethodsToShow: PaymentMethod[] = [];
28
29
  let showMerchantList: boolean = true;
30
+ let formatter = new Intl.NumberFormat(local, {minimumFractionDigits: 2 });
29
31
 
30
32
  $: endpoint && session && customerid && getMetaData();
31
33
  $: lang && setActiveLanguage();
@@ -73,21 +75,13 @@
73
75
  fetch(url, requestParams).then(res => res.json()).then(data => {
74
76
  paymentMethods = data.PaymentMethods.PaymentMethods.map((payMeth) => ({
75
77
  ...payMeth,
76
- LogoUrl: payMeth.Logos && payMeth.Logos[0].LogoUrl ? `https:${payMeth.Logos[0].LogoUrl}` : '',
78
+ LogoUrl: payMeth.Logos && payMeth.Logos.length && payMeth.Logos[0].LogoUrl ? `https:${payMeth.Logos[0].LogoUrl}` : '',
77
79
  }));
78
80
  methodsButtonToggleText = (numberofmethodsshown && +numberofmethodsshown > 0 && paymentMethods.length > +numberofmethodsshown) ? $_('showAll') : '';
79
81
  paymentMethodsToShow = methodsButtonToggleText ? paymentMethods.slice(0, +numberofmethodsshown) : paymentMethods;
80
82
  })
81
83
  }
82
84
 
83
- const setLimit = (payMeth): string => {
84
- const minLabel = $_('generalMin');
85
- const maxLabel = $_('generalMax');
86
- const min = payMeth.DisplayCurrency.MinAmountLimit ? `${minLabel}: ${payMeth.DisplayCurrency.MinAmountLimit} ${payMeth.DisplayCurrency.Name}` : '';
87
- const max = payMeth.DisplayCurrency.MaxAmountLimit ? `${maxLabel}: ${payMeth.DisplayCurrency.MaxAmountLimit} ${payMeth.DisplayCurrency.Name}` : '';
88
- return `${min} ${payMeth.DisplayCurrency.MinAmountLimit && payMeth.DisplayCurrency.MaxAmountLimit ? '/' : ''} ${max}`;
89
- }
90
-
91
85
  const selectPayMeth = (payMeth: PaymentMethod): void => {
92
86
  selectedPaymentMethod = payMeth.Name;
93
87
  dispatchEvent(new CustomEvent('selectPayMeth', {
@@ -169,8 +163,8 @@
169
163
  <span>{payMeth.Label || payMeth.Name}</span>
170
164
  </div>
171
165
  <div class="MethodLimits">
172
- <span class="Limits">{$_('generalMin')} {payMeth.DisplayCurrency.MinAmountLimit} {payMeth.DisplayCurrency.Name}</span>
173
- <span class="Limits">{$_('generalMax')} {payMeth.DisplayCurrency.MaxAmountLimit} {payMeth.DisplayCurrency.Name}</span>
166
+ <span class="Limits">{$_('generalMin')} {formatter.format(payMeth.DisplayCurrency.MinAmountLimit)} {payMeth.DisplayCurrency.Name}</span>
167
+ <span class="Limits">{$_('generalMax')} {formatter.format(payMeth.DisplayCurrency.MaxAmountLimit)} {payMeth.DisplayCurrency.Name}</span>
174
168
  </div>
175
169
  </div>
176
170
  {/each}
@@ -257,13 +251,13 @@
257
251
  }
258
252
  .ShowAllButton {
259
253
  cursor: pointer;
260
- color: var(--emw--color-primary, #292929);
254
+ color: var(--emw--color-gray-300, #666);
261
255
  text-align: center;
262
256
  font-size: var(--emw--font-size-x-small, 12px);
263
257
  font-style: normal;
264
258
  font-weight: var(--emw--font-weight-semibold, 500);
259
+ background: var(--emw--color-gray-150, #F7F8FA);
265
260
  line-height: normal;
266
- text-transform: uppercase;
267
261
  border: 1px solid var(--emw--color-gray-100, #E8E9EB);
268
262
  border-radius: var(--emw--border-radius-medium, 4px);
269
263
  margin: 12px auto;
@@ -272,6 +266,9 @@
272
266
  align-items: center;
273
267
  justify-content: center;
274
268
  width: 80%;
269
+ &:hover {
270
+ background: var(--emw--color-background, #FFF);
271
+ }
275
272
  }
276
273
 
277
274
  </style>
@@ -2,11 +2,17 @@ export const TRANSLATIONS = {
2
2
  "en": {
3
3
  "generalMin": "Min",
4
4
  "generalMax": "Max",
5
- "showAll": "Show All",
6
- "showLess": "Show Less",
5
+ "showAll": "SHOW ALL",
6
+ "showLess": "SHOW LESS",
7
7
  },
8
8
  "uk": {
9
9
  "generalMin": "Мін",
10
10
  "generalMax": "Макс"
11
+ },
12
+ "hr": {
13
+ "generalMin": "Minimalno",
14
+ "generalMax": "Maksimalno",
15
+ "showAll": "Pokaži sve",
16
+ "showLess": "Prikaži manje"
11
17
  }
12
- };
18
+ }