@everymatrix/cashier-method-details 1.43.1 → 1.43.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1 -0
- package/dist/cashier-method-details.js +201 -194
- package/dist/cashier-method-details.js.map +1 -1
- package/package.json +2 -2
- package/src/CashierMethodDetails.svelte +61 -50
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@everymatrix/cashier-method-details",
|
3
|
-
"version": "1.43.
|
3
|
+
"version": "1.43.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": "
|
38
|
+
"gitHead": "4723f5370b2d6fc913a8cf6770f9f492038e54e8"
|
39
39
|
}
|
@@ -120,7 +120,8 @@
|
|
120
120
|
enum ResponseCode {
|
121
121
|
PlayerSessionIsNotValid = 'PlayerSessionIsNotValid',
|
122
122
|
Success = 'Success',
|
123
|
-
JwtTokenError = 'JwtTokenError'
|
123
|
+
JwtTokenError = 'JwtTokenError',
|
124
|
+
Maintenance = 'Maintenance'
|
124
125
|
}
|
125
126
|
|
126
127
|
const VISIBLE_FIELD_TYPES: string[] = 'Text,Number,Money,Boolean,Lookup,Date,Time,DateTime,Password,Label,Link,QRCode'.split(',');
|
@@ -218,13 +219,11 @@
|
|
218
219
|
let selectedPaymentMethod: PaymentMethod = {} as PaymentMethod;
|
219
220
|
let fields: PaymentMethodDetails[] = [];
|
220
221
|
let prepareFields = {};
|
221
|
-
let
|
222
|
-
let
|
223
|
-
let displayNone:boolean = false;
|
224
|
-
let customStylingContainer:HTMLElement;
|
222
|
+
let displayNone: boolean = false;
|
223
|
+
let customStylingContainer: HTMLElement;
|
225
224
|
let prepareRequest;
|
226
|
-
let showConfirmModal:boolean = false;
|
227
|
-
let showReceiptPage:boolean = false;
|
225
|
+
let showConfirmModal: boolean = false;
|
226
|
+
let showReceiptPage: boolean = false;
|
228
227
|
let redirectUrl: string;
|
229
228
|
let windowRedirect: Window;
|
230
229
|
let showRedirectNotification: boolean;
|
@@ -239,9 +238,7 @@
|
|
239
238
|
let qrCodeScriptSrc: string = 'https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js';
|
240
239
|
let blankPageTarget: string = '_blank';
|
241
240
|
let externalLink: string = '';
|
242
|
-
let mobileView:boolean = false;
|
243
|
-
let userAgent:string = window.navigator.userAgent;
|
244
|
-
let mediaQuery = window.matchMedia('(max-width: 750px)');
|
241
|
+
let mobileView: boolean = false;
|
245
242
|
let innerWidth: number;
|
246
243
|
let formatter = new Intl.NumberFormat(local, {minimumFractionDigits: 2 });
|
247
244
|
let amountError = '';
|
@@ -254,7 +251,8 @@
|
|
254
251
|
let isDisabled: boolean;
|
255
252
|
let showErrorModal = false;
|
256
253
|
let transactionId = '';
|
257
|
-
let showSpinner: boolean =
|
254
|
+
let showSpinner: boolean = false;
|
255
|
+
|
258
256
|
$: endpoint && session && selectedpaymentmethodname && currency && reinitMethod();
|
259
257
|
$: clientstyling && customStylingContainer && setClientStyling();
|
260
258
|
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
@@ -264,7 +262,6 @@
|
|
264
262
|
$: fields.length && qrCodeContainer.length && generateQr();
|
265
263
|
$: fields.length && flatpickrEl.length && createDatePicker();
|
266
264
|
|
267
|
-
|
268
265
|
const reinitMethod = () => {
|
269
266
|
if (flatpickrEl.length) {
|
270
267
|
flatpickrEl.forEach(el => {
|
@@ -347,9 +344,11 @@
|
|
347
344
|
})
|
348
345
|
});
|
349
346
|
}
|
347
|
+
|
350
348
|
const setActiveLanguage = ():void => {
|
351
349
|
setLocale(lang);
|
352
350
|
}
|
351
|
+
|
353
352
|
const setTranslationUrl = () => {
|
354
353
|
let url:string = translationurl;
|
355
354
|
if (url) {
|
@@ -370,6 +369,7 @@
|
|
370
369
|
});
|
371
370
|
|
372
371
|
const getPaymentDetails = () => {
|
372
|
+
showSpinner = true;
|
373
373
|
const url:URL = new URL(`${endpoint}/v1/player/${customerid}/payment/GetPaymentMethod`);
|
374
374
|
const headers = new Headers();
|
375
375
|
headers.append("accept", "application/json");
|
@@ -390,18 +390,13 @@
|
|
390
390
|
window.postMessage({type: 'ShowSessionError', error: data.error}, window.location.href)
|
391
391
|
return;
|
392
392
|
}
|
393
|
-
if (data.ResponseCode === ResponseCode.PlayerSessionIsNotValid
|
394
|
-
|
395
|
-
|
396
|
-
return;
|
397
|
-
}
|
398
|
-
|
399
|
-
if (data.ResponseCode === ResponseCode.JwtTokenError) {
|
393
|
+
if (data.ResponseCode === ResponseCode.PlayerSessionIsNotValid
|
394
|
+
|| data.ResponseCode === ResponseCode.Maintenance
|
395
|
+
|| data.ResponseCode === ResponseCode.JwtTokenError) {
|
400
396
|
errorResponseCode = data.ResponseCode;
|
401
397
|
setErrorResponseCode();
|
402
398
|
return;
|
403
399
|
}
|
404
|
-
|
405
400
|
if (data.ResponseCode !== ResponseCode.Success) {
|
406
401
|
errorResponseCode = data.ResponseCode;
|
407
402
|
return;
|
@@ -546,23 +541,17 @@
|
|
546
541
|
postMessage({type: 'ShowSessionError', error: data.error}, window.location.href)
|
547
542
|
return;
|
548
543
|
}
|
549
|
-
if (data.ResponseCode === ResponseCode.PlayerSessionIsNotValid) {
|
550
|
-
errorResponseCode = data.ResponseCode
|
551
|
-
setErrorResponseCode();
|
552
|
-
return;
|
553
|
-
}
|
554
|
-
|
555
|
-
if (data.ResponseCode === ResponseCode.JwtTokenError) {
|
556
|
-
errorResponseCode = data.ResponseCode
|
557
|
-
setErrorResponseCode();
|
558
|
-
return;
|
559
|
-
}
|
560
|
-
|
561
544
|
if (data.ResponseCode !== ResponseCode.Success) {
|
562
545
|
errorResponseCode = data.ResponseCode
|
563
546
|
isProcessingTxn = false;
|
564
547
|
toggleDisableActionOnPage();
|
565
|
-
|
548
|
+
if (data.ResponseCode === ResponseCode.PlayerSessionIsNotValid
|
549
|
+
|| data.ResponseCode === ResponseCode.Maintenance
|
550
|
+
|| data.ResponseCode === ResponseCode.JwtTokenError) {
|
551
|
+
setErrorResponseCode();
|
552
|
+
} else {
|
553
|
+
showModal()
|
554
|
+
}
|
566
555
|
return;
|
567
556
|
}
|
568
557
|
xPaymentSessionToken = data.XPaymentSessionToken;
|
@@ -577,16 +566,20 @@
|
|
577
566
|
const setErrorResponseCode = () => {
|
578
567
|
window.postMessage({type: 'ErrorResponseCode', errorResponseCode}, window.location.href);
|
579
568
|
}
|
569
|
+
|
580
570
|
const setConfirmModalInfo = () => {
|
581
571
|
window.postMessage({type:'ShowConfirmModal', showConfirmModal, editedAmount, hideAmountField: selectedPaymentMethod.HideAmountField}, window.location.href);
|
582
572
|
}
|
573
|
+
|
583
574
|
const setRedirectInfo = () => {
|
584
575
|
window.postMessage({type: 'RedirectInfo', redirectMode, redirectUrl}, window.location.href);
|
585
576
|
}
|
577
|
+
|
586
578
|
const showModal = () => {
|
587
579
|
showErrorModal = true;
|
588
580
|
window.postMessage({ type: 'ShowCashierModal', modalErrorMessage: errorResponseCode}, window.location.href)
|
589
581
|
}
|
582
|
+
|
590
583
|
const backToMethodList = () => {
|
591
584
|
dispatchEvent(new CustomEvent('backToMethodList', {
|
592
585
|
bubbles: true,
|
@@ -617,14 +610,17 @@
|
|
617
610
|
composed: true
|
618
611
|
}));
|
619
612
|
}
|
613
|
+
|
620
614
|
const closeIframe = () => {
|
621
615
|
redirectUrl = null;
|
622
616
|
showReceiptPage = true;
|
623
617
|
setRedirectInfo();
|
624
618
|
}
|
619
|
+
|
625
620
|
const closeModal = () => {
|
626
621
|
showConfirmModal = false;
|
627
622
|
}
|
623
|
+
|
628
624
|
const confirmTxn = () => {
|
629
625
|
isProcessingTxn = true;
|
630
626
|
const url:URL = new URL(`${endpoint}/v1/player/${customerid}/payment/GetPaymentConfirm`);
|
@@ -642,23 +638,17 @@
|
|
642
638
|
})
|
643
639
|
}
|
644
640
|
fetch(url, requestParams).then((res) => res.json()).then(data => {
|
645
|
-
if(data.ResponseCode === ResponseCode.PlayerSessionIsNotValid) {
|
646
|
-
errorResponseCode = data.ResponseCode
|
647
|
-
setErrorResponseCode();
|
648
|
-
return;
|
649
|
-
}
|
650
|
-
|
651
|
-
if(data.ResponseCode === ResponseCode.JwtTokenError) {
|
652
|
-
errorResponseCode = data.ResponseCode
|
653
|
-
setErrorResponseCode();
|
654
|
-
return;
|
655
|
-
}
|
656
|
-
|
657
641
|
if (data.ResponseCode !== ResponseCode.Success) {
|
658
|
-
errorResponseCode = data.ResponseCode
|
642
|
+
errorResponseCode = data.ResponseCode
|
659
643
|
isProcessingTxn = false;
|
660
644
|
toggleDisableActionOnPage();
|
661
|
-
|
645
|
+
if (data.ResponseCode === ResponseCode.PlayerSessionIsNotValid
|
646
|
+
|| data.ResponseCode === ResponseCode.Maintenance
|
647
|
+
|| data.ResponseCode === ResponseCode.JwtTokenError) {
|
648
|
+
setErrorResponseCode();
|
649
|
+
} else {
|
650
|
+
showModal()
|
651
|
+
}
|
662
652
|
return;
|
663
653
|
}
|
664
654
|
xPaymentSessionToken = data.XPaymentSessionToken;
|
@@ -1048,7 +1038,7 @@
|
|
1048
1038
|
hidebuttons="{`${!mobileView}`}"
|
1049
1039
|
errorcode={errorResponseCode}
|
1050
1040
|
>
|
1051
|
-
<
|
1041
|
+
<button slot="button" class="CashierErrorButton" on:click={backToMethodList}>{$_('backToMethodList')}</button>
|
1052
1042
|
</cashier-error>
|
1053
1043
|
{/if}
|
1054
1044
|
</div>
|
@@ -1333,6 +1323,27 @@
|
|
1333
1323
|
background: var(--mmw--color-main-button-hover, #71B11B);
|
1334
1324
|
}
|
1335
1325
|
}
|
1326
|
+
.CashierErrorButton {
|
1327
|
+
width: 100%;
|
1328
|
+
height: 36px;
|
1329
|
+
color: var(--emw--color-white, #FFF);
|
1330
|
+
text-align: center;
|
1331
|
+
cursor: pointer;
|
1332
|
+
font-size: var(--emw--font-size-x-small, 12px);
|
1333
|
+
font-style: normal;
|
1334
|
+
font-weight: var(--emw--font-weight-semibold, 500);
|
1335
|
+
font-family: inherit;
|
1336
|
+
line-height: 36px;
|
1337
|
+
border: none;
|
1338
|
+
border-radius: var(--emw--border-radius-medium, 4px);
|
1339
|
+
background: var(--emw--color-primary, #7EC51E);
|
1340
|
+
&:hover {
|
1341
|
+
background: var(--mmw--color-main-button-hover, #71B11B);
|
1342
|
+
}
|
1343
|
+
&:active {
|
1344
|
+
background: var(--mmw--color-main-button-active, #5C950F);
|
1345
|
+
}
|
1346
|
+
}
|
1336
1347
|
.QRCode {
|
1337
1348
|
width: 250px;
|
1338
1349
|
margin: auto;
|
@@ -1393,7 +1404,7 @@
|
|
1393
1404
|
display: block;
|
1394
1405
|
}
|
1395
1406
|
}
|
1396
|
-
}
|
1407
|
+
}
|
1397
1408
|
.DateInput {
|
1398
1409
|
position: relative;
|
1399
1410
|
.MobileDateInput {
|
@@ -1449,7 +1460,7 @@
|
|
1449
1460
|
position: absolute;
|
1450
1461
|
left: 0;
|
1451
1462
|
right: 0;
|
1452
|
-
z-index:
|
1463
|
+
z-index: 3;
|
1453
1464
|
background-color: var(--emw--color-white, #fff);
|
1454
1465
|
border: 1px solid var(--mmw--color-grey-105, #E8E9EB);
|
1455
1466
|
border-radius: var(--emw--border-radius-medium, 4px);
|