@jetthai/cuora 1.1.13-3 → 1.1.13
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/CHANGELOG.md +0 -6
- package/dist/bundle.mjs +34 -560
- package/package.json +1 -1
- package/src/api/payment.js +0 -2
- package/src/machine/deposit/crypto_button.js +9 -137
- package/src/machine/deposit/loadcard_vn.js +13 -142
- package/src/machine/deposit/qrcode_v2.js +12 -168
- package/src/machine/index.js +0 -2
- package/src/machine/promotions.js +0 -115
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import payment from '../../api/payment.js'
|
|
3
|
-
import common from '../../api/common.js'
|
|
4
3
|
|
|
5
4
|
export default function (request) {
|
|
6
|
-
const { appSecret } = request.config
|
|
7
5
|
return createMachine(
|
|
8
6
|
{
|
|
9
7
|
id: 'qrcode',
|
|
10
8
|
initial: 'loading',
|
|
11
9
|
context: {
|
|
12
|
-
siteConfig: null,
|
|
13
10
|
qrcodes: null,
|
|
14
11
|
options: null,
|
|
15
12
|
|
|
@@ -18,7 +15,7 @@ export default function (request) {
|
|
|
18
15
|
|
|
19
16
|
calculation: null,
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
paymentDetails: [],
|
|
22
19
|
currentCategory: 'qrcode',
|
|
23
20
|
currentMethod: null,
|
|
24
21
|
|
|
@@ -31,152 +28,15 @@ export default function (request) {
|
|
|
31
28
|
invoke: {
|
|
32
29
|
src: 'fetchInitData',
|
|
33
30
|
onDone: {
|
|
34
|
-
target: '
|
|
35
|
-
actions:
|
|
31
|
+
target: 'loaded',
|
|
32
|
+
actions: 'setInitData',
|
|
36
33
|
},
|
|
37
34
|
onError: {
|
|
38
35
|
target: 'fail',
|
|
39
36
|
},
|
|
40
37
|
},
|
|
41
38
|
},
|
|
42
|
-
|
|
43
|
-
always: [{ target: 'promotionApplyMode', cond: 'isPromotionApplyMode' }, { target: 'defaultMode' }],
|
|
44
|
-
},
|
|
45
|
-
promotionApplyMode: {
|
|
46
|
-
initial: 'loaded',
|
|
47
|
-
states: {
|
|
48
|
-
loaded: {
|
|
49
|
-
entry: 'reset',
|
|
50
|
-
on: {
|
|
51
|
-
SELECT_QRCODE: {
|
|
52
|
-
actions: 'setQrcode',
|
|
53
|
-
},
|
|
54
|
-
SELECT_AMOUNT: [
|
|
55
|
-
{
|
|
56
|
-
target: 'submittable',
|
|
57
|
-
actions: 'addAmount',
|
|
58
|
-
cond: (context, event) => context.grandTotalEnable === 1,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
target: 'submittable',
|
|
62
|
-
actions: 'setAmount',
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
KEY_IN: {
|
|
66
|
-
actions: 'setAmount',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
submittable: {
|
|
71
|
-
on: {
|
|
72
|
-
SELECT_AMOUNT: [
|
|
73
|
-
{
|
|
74
|
-
actions: 'addAmount',
|
|
75
|
-
cond: (context, event) => context.grandTotalEnable === 1,
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
actions: 'setAmount',
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
KEY_IN: {
|
|
82
|
-
actions: 'setAmount',
|
|
83
|
-
},
|
|
84
|
-
CONFIRM: {
|
|
85
|
-
target: 'debouncing',
|
|
86
|
-
},
|
|
87
|
-
BACK: {
|
|
88
|
-
target: 'loaded',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
debouncing: {
|
|
93
|
-
on: {
|
|
94
|
-
SELECT_AMOUNT: [
|
|
95
|
-
{
|
|
96
|
-
target: 'debouncing',
|
|
97
|
-
actions: 'addAmount',
|
|
98
|
-
cond: (context, event) => context.grandTotalEnable === 1,
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
target: 'debouncing',
|
|
102
|
-
actions: 'setAmount',
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
KEY_IN: {
|
|
106
|
-
target: 'debouncing',
|
|
107
|
-
actions: 'setAmount',
|
|
108
|
-
},
|
|
109
|
-
BACK: {
|
|
110
|
-
target: 'loaded',
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
after: {
|
|
114
|
-
1000: {
|
|
115
|
-
target: 'calculating',
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
calculable: {
|
|
120
|
-
entry: 'clearCalculation',
|
|
121
|
-
on: {
|
|
122
|
-
SELECT_AMOUNT: [
|
|
123
|
-
{
|
|
124
|
-
target: 'debouncing',
|
|
125
|
-
actions: 'addAmount',
|
|
126
|
-
cond: (context, event) => context.grandTotalEnable === 1,
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
target: 'debouncing',
|
|
130
|
-
actions: 'setAmount',
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
KEY_IN: {
|
|
134
|
-
target: 'debouncing',
|
|
135
|
-
actions: 'setAmount',
|
|
136
|
-
},
|
|
137
|
-
CALCULATE: {
|
|
138
|
-
target: 'debouncing',
|
|
139
|
-
},
|
|
140
|
-
BACK: {
|
|
141
|
-
target: 'loaded',
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
},
|
|
145
|
-
calculating: {
|
|
146
|
-
invoke: {
|
|
147
|
-
src: 'fetchCalculation',
|
|
148
|
-
onDone: {
|
|
149
|
-
target: 'submitting',
|
|
150
|
-
actions: 'setCalculation',
|
|
151
|
-
},
|
|
152
|
-
onError: {
|
|
153
|
-
target: 'calculable',
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
submitting: {
|
|
158
|
-
invoke: {
|
|
159
|
-
src: 'submitDeposit',
|
|
160
|
-
onDone: {
|
|
161
|
-
target: 'submitted',
|
|
162
|
-
actions: 'setResult',
|
|
163
|
-
},
|
|
164
|
-
onError: {
|
|
165
|
-
target: 'submittable',
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
submitted: {
|
|
170
|
-
on: {
|
|
171
|
-
SELECT_QRCODE: {
|
|
172
|
-
target: 'loaded',
|
|
173
|
-
actions: 'setQrcode',
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
defaultMode: {
|
|
39
|
+
loaded: {
|
|
180
40
|
entry: 'reset',
|
|
181
41
|
on: {
|
|
182
42
|
SELECT_QRCODE: {
|
|
@@ -217,7 +77,7 @@ export default function (request) {
|
|
|
217
77
|
actions: 'setAmount',
|
|
218
78
|
},
|
|
219
79
|
BACK: {
|
|
220
|
-
target: '
|
|
80
|
+
target: 'loaded',
|
|
221
81
|
},
|
|
222
82
|
},
|
|
223
83
|
after: {
|
|
@@ -249,7 +109,7 @@ export default function (request) {
|
|
|
249
109
|
target: 'debouncing',
|
|
250
110
|
},
|
|
251
111
|
BACK: {
|
|
252
|
-
target: '
|
|
112
|
+
target: 'loaded',
|
|
253
113
|
},
|
|
254
114
|
},
|
|
255
115
|
},
|
|
@@ -286,7 +146,7 @@ export default function (request) {
|
|
|
286
146
|
target: 'submitting',
|
|
287
147
|
},
|
|
288
148
|
BACK: {
|
|
289
|
-
target: '
|
|
149
|
+
target: 'loaded',
|
|
290
150
|
},
|
|
291
151
|
CLEAR_CALCULATION: {
|
|
292
152
|
target: 'debouncing',
|
|
@@ -309,7 +169,7 @@ export default function (request) {
|
|
|
309
169
|
submitted: {
|
|
310
170
|
on: {
|
|
311
171
|
SELECT_QRCODE: {
|
|
312
|
-
target: '
|
|
172
|
+
target: 'loaded',
|
|
313
173
|
actions: 'setQrcode',
|
|
314
174
|
},
|
|
315
175
|
},
|
|
@@ -325,11 +185,11 @@ export default function (request) {
|
|
|
325
185
|
}
|
|
326
186
|
}),
|
|
327
187
|
setInitData: assign((context, event) => {
|
|
328
|
-
const
|
|
329
|
-
const qrcodes =
|
|
188
|
+
const paymentDetails = event.data
|
|
189
|
+
const qrcodes = paymentDetails.filter((element) => element.category === context.currentCategory)
|
|
330
190
|
|
|
331
191
|
return {
|
|
332
|
-
|
|
192
|
+
paymentDetails,
|
|
333
193
|
qrcodes,
|
|
334
194
|
selectedQrcode: qrcodes[0],
|
|
335
195
|
currentMethod: qrcodes[0].method,
|
|
@@ -337,12 +197,6 @@ export default function (request) {
|
|
|
337
197
|
grandTotalEnable: qrcodes[0].grandTotalEnable,
|
|
338
198
|
}
|
|
339
199
|
}),
|
|
340
|
-
preset: assign((context, event) => {
|
|
341
|
-
const { siteConfig } = event.data
|
|
342
|
-
return {
|
|
343
|
-
siteConfig,
|
|
344
|
-
}
|
|
345
|
-
}),
|
|
346
200
|
setQrcode: assign((context, event) => {
|
|
347
201
|
return {
|
|
348
202
|
selectedQrcode: event.data,
|
|
@@ -373,19 +227,9 @@ export default function (request) {
|
|
|
373
227
|
}
|
|
374
228
|
}),
|
|
375
229
|
},
|
|
376
|
-
guards: {
|
|
377
|
-
isPromotionApplyMode: (context, event) => {
|
|
378
|
-
return context.siteConfig?.promotionApplyMode === '1'
|
|
379
|
-
},
|
|
380
|
-
},
|
|
381
230
|
services: {
|
|
382
231
|
fetchInitData: async (context, event) => {
|
|
383
|
-
|
|
384
|
-
request.send(common.getConfig({ appSecret })),
|
|
385
|
-
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
386
|
-
])
|
|
387
|
-
const siteConfig = JSON.parse(window.atob(config))
|
|
388
|
-
return { siteConfig, paymentDetail }
|
|
232
|
+
return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
|
|
389
233
|
},
|
|
390
234
|
fetchCalculation: async (context, event) => {
|
|
391
235
|
const { currentMethod, selectedAmount } = context
|
package/src/machine/index.js
CHANGED
|
@@ -33,7 +33,6 @@ import leaderboard from './leaderboard.js'
|
|
|
33
33
|
import auth_otp_v2 from './auth_otp_v2.js'
|
|
34
34
|
import auth_otp_v3 from './auth_otp_v3.js'
|
|
35
35
|
import vip_table from './vip_table.js'
|
|
36
|
-
import promotions from './promotions.js'
|
|
37
36
|
|
|
38
37
|
export default {
|
|
39
38
|
...activity,
|
|
@@ -72,5 +71,4 @@ export default {
|
|
|
72
71
|
auth_otp_v2,
|
|
73
72
|
auth_otp_v3,
|
|
74
73
|
vip_table,
|
|
75
|
-
promotions,
|
|
76
74
|
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import payment from '../api/payment.js'
|
|
3
|
-
|
|
4
|
-
export default function (request) {
|
|
5
|
-
return createMachine(
|
|
6
|
-
{
|
|
7
|
-
id: 'promotions',
|
|
8
|
-
initial: 'loading',
|
|
9
|
-
context: {
|
|
10
|
-
noBonus: {
|
|
11
|
-
promotionsNo: 'No Bonus',
|
|
12
|
-
title: 'No Bonus',
|
|
13
|
-
adSmallUrl: [
|
|
14
|
-
{
|
|
15
|
-
url: '~/assets/images/deposit/deposit_img_nobonus_normal.png',
|
|
16
|
-
name: 'No Bonus',
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
descrip: 'no_bonus',
|
|
20
|
-
minimumAmount: 0,
|
|
21
|
-
turnoverLimitMultiple: 1,
|
|
22
|
-
promotionDetail: [],
|
|
23
|
-
withdrawLimitDetail: [],
|
|
24
|
-
limitGameDetail: [],
|
|
25
|
-
},
|
|
26
|
-
promotionsList: [],
|
|
27
|
-
selectedPromo: {},
|
|
28
|
-
joinedPromotion: null,
|
|
29
|
-
},
|
|
30
|
-
states: {
|
|
31
|
-
loading: {
|
|
32
|
-
invoke: {
|
|
33
|
-
src: 'fetchPromotionsList',
|
|
34
|
-
onDone: {
|
|
35
|
-
target: 'loaded',
|
|
36
|
-
actions: 'setInit',
|
|
37
|
-
},
|
|
38
|
-
onError: {
|
|
39
|
-
target: 'fail',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
fetching: {
|
|
44
|
-
invoke: {
|
|
45
|
-
src: 'fetchJoinedPromotion',
|
|
46
|
-
onDone: {
|
|
47
|
-
target: 'loaded',
|
|
48
|
-
actions: 'setJoinedPromotion',
|
|
49
|
-
},
|
|
50
|
-
onError: {
|
|
51
|
-
target: 'fail',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
loaded: {
|
|
56
|
-
on: {
|
|
57
|
-
SELECT_PROMO: {
|
|
58
|
-
actions: 'setSelectedPromo',
|
|
59
|
-
},
|
|
60
|
-
SET_AMOUNT: {
|
|
61
|
-
actions: 'setAmount',
|
|
62
|
-
},
|
|
63
|
-
CONFIRM: {
|
|
64
|
-
target: 'joinning',
|
|
65
|
-
cond: 'isValidAmount',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
fail: {},
|
|
70
|
-
joinning: {},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
actions: {
|
|
75
|
-
setInit: assign((context, event) => {
|
|
76
|
-
return {
|
|
77
|
-
promotionsList: event.data,
|
|
78
|
-
selectedPromo: context.noBonus,
|
|
79
|
-
}
|
|
80
|
-
}),
|
|
81
|
-
setJoinedPromotion: assign((context, event) => {
|
|
82
|
-
return {
|
|
83
|
-
joinedPromotion: event.data,
|
|
84
|
-
}
|
|
85
|
-
}),
|
|
86
|
-
setSelectedPromo: assign((context, event) => {
|
|
87
|
-
return {
|
|
88
|
-
selectedPromo: event.data,
|
|
89
|
-
}
|
|
90
|
-
}),
|
|
91
|
-
setAmount: assign((context, event) => {
|
|
92
|
-
return {
|
|
93
|
-
amount: event.data,
|
|
94
|
-
}
|
|
95
|
-
}),
|
|
96
|
-
},
|
|
97
|
-
guards: {
|
|
98
|
-
isValidAmount: (context, event) => {
|
|
99
|
-
const { minimumAmount, amount } = context
|
|
100
|
-
return minimumAmount <= amount
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
services: {
|
|
104
|
-
fetchPromotionsList: async (context, event) => {
|
|
105
|
-
const { data } = await request.send(payment.getPromotionsList())
|
|
106
|
-
return data
|
|
107
|
-
},
|
|
108
|
-
fetchJoinedPromotion: async (context, event) => {
|
|
109
|
-
const { data } = await request.send(payment.getJoinedPromotion())
|
|
110
|
-
return data
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
}
|
|
114
|
-
)
|
|
115
|
-
}
|