@everymatrix/cashier-page 1.34.2 → 1.35.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/dist/cashier-page.js +251 -235
- package/dist/cashier-page.js.map +1 -1
- package/package.json +2 -2
- package/src/CashierPage.svelte +20 -7
- package/src/CashierPage.types.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/cashier-page",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.35.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": "
|
|
38
|
+
"gitHead": "cad27ef6706d0e17f1eda3810fee31f1ec373fa9"
|
|
39
39
|
}
|
package/src/CashierPage.svelte
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {TRANSLATIONS} from './translations';
|
|
6
6
|
|
|
7
7
|
import type {PaymentMethod} from "./CashierPage.types";
|
|
8
|
-
import {TxnChannel, TxnType} from "./CashierPage.types";
|
|
8
|
+
import {TxnChannel, TxnType, ResponseCode} from "./CashierPage.types";
|
|
9
9
|
|
|
10
10
|
import '@everymatrix/cashier-methods-list';
|
|
11
11
|
import '@everymatrix/cashier-method-details';
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
let confirmAmount: number;
|
|
75
75
|
let hideAmountField: boolean;
|
|
76
76
|
let redirectMode: RedirectionModeStringEnum;
|
|
77
|
+
let modalErrorMessage: string;
|
|
77
78
|
|
|
78
79
|
$: endpoint && session && customerid && lang && channel && type && successurl && failurl && cancelurl && getPlayerSession();
|
|
79
80
|
$: clientstyling && customStylingContainer && setClientStyling();
|
|
@@ -129,7 +130,16 @@
|
|
|
129
130
|
if (data.error) {
|
|
130
131
|
errorMessage = data.error
|
|
131
132
|
}
|
|
132
|
-
if (data.ResponseCode
|
|
133
|
+
if (data.ResponseCode === ResponseCode.PlayerSessionIsNotValid) {
|
|
134
|
+
errorResponseCode = data.ResponseCode;
|
|
135
|
+
setErrorResponseCode();
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (data.ResponseCode === ResponseCode.JwtTokenError) {
|
|
139
|
+
errorResponseCode = data.ResponseCode;
|
|
140
|
+
setErrorResponseCode();
|
|
141
|
+
}
|
|
142
|
+
if (data.ResponseCode !== ResponseCode.Success) {
|
|
133
143
|
errorResponseCode = data.ResponseCode;
|
|
134
144
|
setErrorResponseCode();
|
|
135
145
|
return;
|
|
@@ -203,24 +213,27 @@
|
|
|
203
213
|
}
|
|
204
214
|
|
|
205
215
|
const messageHandler = (e:any) => {
|
|
206
|
-
if (e.data.type
|
|
216
|
+
if (e.data.type === 'ShowSessionError') {
|
|
207
217
|
errorMessage = e.data.error
|
|
208
218
|
}
|
|
209
219
|
if (e.data.type === 'ToggleDisableActionOnPage') {
|
|
210
220
|
isProcessingTxn = e.data.disable
|
|
211
221
|
}
|
|
212
|
-
if (e.data.type
|
|
222
|
+
if (e.data.type === 'ErrorResponseCode') {
|
|
213
223
|
errorResponseCode = e.data.errorResponseCode;
|
|
214
224
|
}
|
|
215
|
-
if (e.data.type
|
|
225
|
+
if (e.data.type === 'ShowConfirmModal') {
|
|
216
226
|
showConfirmModal = e.data.showConfirmModal;
|
|
217
227
|
confirmAmount = e.data.editedAmount;
|
|
218
228
|
hideAmountField = e.data.hideAmountField;
|
|
219
229
|
}
|
|
220
|
-
if (e.data.type
|
|
230
|
+
if (e.data.type === 'RedirectInfo') {
|
|
221
231
|
redirectUrl = e.data.redirectUrl;
|
|
222
232
|
redirectMode = e.data.redirectMode;
|
|
223
233
|
}
|
|
234
|
+
if (e.data.type === 'ShowCashierModal') {
|
|
235
|
+
modalErrorMessage = e.data.modalErrorMessage;
|
|
236
|
+
}
|
|
224
237
|
}
|
|
225
238
|
|
|
226
239
|
</script>
|
|
@@ -248,7 +261,7 @@
|
|
|
248
261
|
{translationurl}
|
|
249
262
|
{clientstylingurl}
|
|
250
263
|
{clientstyling}
|
|
251
|
-
errorcode={
|
|
264
|
+
errorcode={modalErrorMessage}
|
|
252
265
|
>
|
|
253
266
|
<div slot="button" class="ModalButton" on:click={hideModal}>{$_('closeModal')}</div>
|
|
254
267
|
</cashier-error>
|
package/src/CashierPage.types.ts
CHANGED