@jetthai/cuora 1.1.64 → 1.1.65-doubleWallet-1
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 +6 -0
- package/dist/bundle.mjs +704 -534
- package/package.json +1 -1
- package/src/api/payment.js +2 -0
- package/src/machine/activity/activity.js +1 -1
- package/src/machine/deposit/crypto.js +36 -19
- package/src/machine/deposit/crypto_button.js +103 -126
- package/src/machine/deposit/direct.js +69 -7
- package/src/machine/deposit/float.js +94 -27
- package/src/machine/deposit/loadcard_vn.js +114 -144
- package/src/machine/deposit/manual_vn.js +39 -7
- package/src/machine/deposit/qrcode_v2.js +155 -171
- package/src/machine/deposit/vpay.js +89 -26
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import payment from '../../api/payment.js'
|
|
3
|
+
import common from '../../api/common.js'
|
|
3
4
|
|
|
4
5
|
export default function (request) {
|
|
6
|
+
const { appSecret } = request.config
|
|
5
7
|
return createMachine(
|
|
6
8
|
{
|
|
7
9
|
id: 'float',
|
|
@@ -9,6 +11,7 @@ export default function (request) {
|
|
|
9
11
|
context: {
|
|
10
12
|
method: 'amb_float',
|
|
11
13
|
userAccount: {},
|
|
14
|
+
siteConfig: null,
|
|
12
15
|
amount: 0,
|
|
13
16
|
|
|
14
17
|
bankList: [],
|
|
@@ -25,6 +28,9 @@ export default function (request) {
|
|
|
25
28
|
|
|
26
29
|
grandTotalEnable: 1,
|
|
27
30
|
ttl: 120,
|
|
31
|
+
|
|
32
|
+
promotion: null,
|
|
33
|
+
bonusPreviewData: [],
|
|
28
34
|
},
|
|
29
35
|
states: {
|
|
30
36
|
loading: {
|
|
@@ -49,7 +55,10 @@ export default function (request) {
|
|
|
49
55
|
initializing: {
|
|
50
56
|
invoke: {
|
|
51
57
|
src: 'initialize',
|
|
52
|
-
onDone: {
|
|
58
|
+
onDone: {
|
|
59
|
+
target: '#float.loaded',
|
|
60
|
+
actions: 'setInitialization',
|
|
61
|
+
},
|
|
53
62
|
onError: {
|
|
54
63
|
target: '#float.unavailable',
|
|
55
64
|
},
|
|
@@ -57,14 +66,38 @@ export default function (request) {
|
|
|
57
66
|
},
|
|
58
67
|
},
|
|
59
68
|
},
|
|
69
|
+
checking: {
|
|
70
|
+
always: [
|
|
71
|
+
{
|
|
72
|
+
target: 'fetching',
|
|
73
|
+
cond: (context, event) => {
|
|
74
|
+
const { siteConfig = {}, promotion = {} } = context
|
|
75
|
+
const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
|
|
76
|
+
return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{ target: 'loaded' },
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
fetching: {
|
|
83
|
+
invoke: {
|
|
84
|
+
src: 'fetchBonusPreview',
|
|
85
|
+
onDone: {
|
|
86
|
+
target: 'loaded',
|
|
87
|
+
actions: 'setBonusPreview',
|
|
88
|
+
},
|
|
89
|
+
onError: {
|
|
90
|
+
target: 'loaded',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
60
94
|
loaded: {
|
|
61
|
-
entry: 'reset',
|
|
62
95
|
on: {
|
|
63
96
|
SELECT_AMOUNT: [
|
|
64
97
|
{
|
|
65
98
|
target: 'debouncing',
|
|
66
99
|
actions: 'addAmount',
|
|
67
|
-
cond:
|
|
100
|
+
cond: 'isGrandTotalEnable',
|
|
68
101
|
},
|
|
69
102
|
{
|
|
70
103
|
target: 'debouncing',
|
|
@@ -75,6 +108,10 @@ export default function (request) {
|
|
|
75
108
|
target: 'calculating',
|
|
76
109
|
actions: 'setAmount',
|
|
77
110
|
},
|
|
111
|
+
CLEAR_CALCULATION: {
|
|
112
|
+
target: 'debouncing',
|
|
113
|
+
actions: 'clearCalculation',
|
|
114
|
+
},
|
|
78
115
|
},
|
|
79
116
|
},
|
|
80
117
|
debouncing: {
|
|
@@ -83,7 +120,7 @@ export default function (request) {
|
|
|
83
120
|
{
|
|
84
121
|
target: 'debouncing',
|
|
85
122
|
actions: 'addAmount',
|
|
86
|
-
cond:
|
|
123
|
+
cond: 'isGrandTotalEnable',
|
|
87
124
|
},
|
|
88
125
|
{
|
|
89
126
|
target: 'debouncing',
|
|
@@ -94,9 +131,6 @@ export default function (request) {
|
|
|
94
131
|
target: 'debouncing',
|
|
95
132
|
actions: 'setAmount',
|
|
96
133
|
},
|
|
97
|
-
BACK: {
|
|
98
|
-
target: 'loaded',
|
|
99
|
-
},
|
|
100
134
|
},
|
|
101
135
|
after: {
|
|
102
136
|
1000: {
|
|
@@ -111,7 +145,7 @@ export default function (request) {
|
|
|
111
145
|
{
|
|
112
146
|
target: 'debouncing',
|
|
113
147
|
actions: 'addAmount',
|
|
114
|
-
cond:
|
|
148
|
+
cond: 'isGrandTotalEnable',
|
|
115
149
|
},
|
|
116
150
|
{
|
|
117
151
|
target: 'debouncing',
|
|
@@ -122,11 +156,12 @@ export default function (request) {
|
|
|
122
156
|
target: 'debouncing',
|
|
123
157
|
actions: 'setAmount',
|
|
124
158
|
},
|
|
125
|
-
|
|
159
|
+
CLEAR_CALCULATION: {
|
|
126
160
|
target: 'debouncing',
|
|
161
|
+
actions: 'clearCalculation',
|
|
127
162
|
},
|
|
128
|
-
|
|
129
|
-
|
|
163
|
+
CLEAR: {
|
|
164
|
+
actions: 'setAmount',
|
|
130
165
|
},
|
|
131
166
|
},
|
|
132
167
|
},
|
|
@@ -148,7 +183,7 @@ export default function (request) {
|
|
|
148
183
|
{
|
|
149
184
|
target: 'debouncing',
|
|
150
185
|
actions: 'addAmount',
|
|
151
|
-
cond:
|
|
186
|
+
cond: 'isGrandTotalEnable',
|
|
152
187
|
},
|
|
153
188
|
{
|
|
154
189
|
target: 'debouncing',
|
|
@@ -162,8 +197,8 @@ export default function (request) {
|
|
|
162
197
|
CONFIRM: {
|
|
163
198
|
target: 'submitting',
|
|
164
199
|
},
|
|
165
|
-
|
|
166
|
-
|
|
200
|
+
CLEAR: {
|
|
201
|
+
actions: 'setAmount',
|
|
167
202
|
},
|
|
168
203
|
CLEAR_CALCULATION: {
|
|
169
204
|
target: 'debouncing',
|
|
@@ -174,7 +209,10 @@ export default function (request) {
|
|
|
174
209
|
submitting: {
|
|
175
210
|
invoke: {
|
|
176
211
|
src: 'submitDeposit',
|
|
177
|
-
onDone: {
|
|
212
|
+
onDone: {
|
|
213
|
+
target: 'countdown',
|
|
214
|
+
actions: 'setHouseBank',
|
|
215
|
+
},
|
|
178
216
|
onError: {
|
|
179
217
|
target: 'calculated',
|
|
180
218
|
},
|
|
@@ -197,6 +235,11 @@ export default function (request) {
|
|
|
197
235
|
accountUnbound: {},
|
|
198
236
|
unavailable: {},
|
|
199
237
|
},
|
|
238
|
+
on: {
|
|
239
|
+
SET_PROMOTION: {
|
|
240
|
+
actions: 'setPromotion',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
200
243
|
},
|
|
201
244
|
{
|
|
202
245
|
actions: {
|
|
@@ -205,6 +248,17 @@ export default function (request) {
|
|
|
205
248
|
userAccount: event.data.bankInfo?.[0],
|
|
206
249
|
}
|
|
207
250
|
}),
|
|
251
|
+
setPromotion: assign((context, event) => {
|
|
252
|
+
const promotion = event.data
|
|
253
|
+
return {
|
|
254
|
+
promotion,
|
|
255
|
+
}
|
|
256
|
+
}),
|
|
257
|
+
setBonusPreview: assign((context, event) => {
|
|
258
|
+
return {
|
|
259
|
+
bonusPreviewData: event.data.bonus,
|
|
260
|
+
}
|
|
261
|
+
}),
|
|
208
262
|
setHouseBank: assign((context, event) => {
|
|
209
263
|
const { accountName, accountNumber, bankName, amount } = event.data
|
|
210
264
|
return {
|
|
@@ -215,9 +269,10 @@ export default function (request) {
|
|
|
215
269
|
}
|
|
216
270
|
}),
|
|
217
271
|
setInitialization: assign((context, event) => {
|
|
218
|
-
const { housePayment, bankList } = event.data
|
|
272
|
+
const { siteConfig, housePayment, bankList } = event.data
|
|
219
273
|
const { optional, minimum, maximum, grandTotalEnable } = housePayment
|
|
220
274
|
return {
|
|
275
|
+
siteConfig,
|
|
221
276
|
options: optional,
|
|
222
277
|
minimum,
|
|
223
278
|
maximum,
|
|
@@ -232,11 +287,8 @@ export default function (request) {
|
|
|
232
287
|
}
|
|
233
288
|
}),
|
|
234
289
|
setAmount: assign((context, event) => {
|
|
235
|
-
return { amount: event.data }
|
|
236
|
-
}),
|
|
237
|
-
clear: assign((context, event) => {
|
|
238
290
|
return {
|
|
239
|
-
amount:
|
|
291
|
+
amount: event.data,
|
|
240
292
|
}
|
|
241
293
|
}),
|
|
242
294
|
setCalculation: assign((context, event) => {
|
|
@@ -260,32 +312,47 @@ export default function (request) {
|
|
|
260
312
|
hasUserAccount: (context, event) => {
|
|
261
313
|
return event.data.bankInfo?.[0]
|
|
262
314
|
},
|
|
315
|
+
isGrandTotalEnable: (context, event) => {
|
|
316
|
+
return context.grandTotalEnable === 1
|
|
317
|
+
},
|
|
263
318
|
},
|
|
264
319
|
services: {
|
|
265
320
|
fetchPaymentInfo: async (context, event) => {
|
|
266
321
|
return await request.send(payment.getPaymentInfo())
|
|
267
322
|
},
|
|
268
323
|
initialize: async (context, event) => {
|
|
269
|
-
const [payments, bankList] = await Promise.all([
|
|
324
|
+
const [{ config }, payments, bankList] = await Promise.all([
|
|
325
|
+
request.send(common.getConfig({ appSecret })),
|
|
270
326
|
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
271
327
|
request.send(payment.getBankList('amb')),
|
|
272
328
|
])
|
|
273
|
-
|
|
329
|
+
const siteConfig = JSON.parse(window.atob(config))
|
|
330
|
+
return { siteConfig, housePayment: payments.find((payment) => payment.method === context.method), bankList }
|
|
331
|
+
},
|
|
332
|
+
fetchBonusPreview: async (context, event) => {
|
|
333
|
+
const { method, promotion } = context
|
|
334
|
+
return await request.send({
|
|
335
|
+
paymentMethod: method,
|
|
336
|
+
promotionsNo: promotion?.activityNo,
|
|
337
|
+
})
|
|
274
338
|
},
|
|
275
339
|
submitDeposit: async (context, event) => {
|
|
340
|
+
const { method, amount, promotion } = context
|
|
276
341
|
return await request.send(
|
|
277
342
|
payment.submitDepositTransaction({
|
|
278
|
-
method
|
|
279
|
-
amount
|
|
343
|
+
method,
|
|
344
|
+
amount,
|
|
345
|
+
promotionsNo: promotion?.activityNo,
|
|
280
346
|
})
|
|
281
347
|
)
|
|
282
348
|
},
|
|
283
349
|
fetchCalculation: async (context, event) => {
|
|
284
|
-
const {
|
|
350
|
+
const { method, amount, promotion } = context
|
|
285
351
|
return await request.send(
|
|
286
352
|
payment.getDepositExpectedResult({
|
|
287
|
-
method
|
|
288
|
-
amount
|
|
353
|
+
method,
|
|
354
|
+
amount,
|
|
355
|
+
promotionsNo: promotion?.activityNo,
|
|
289
356
|
})
|
|
290
357
|
)
|
|
291
358
|
},
|
|
@@ -25,6 +25,10 @@ export default function (request) {
|
|
|
25
25
|
currentMethod: null,
|
|
26
26
|
currentPayment: null,
|
|
27
27
|
result: null,
|
|
28
|
+
|
|
29
|
+
// use for wallet mode 4
|
|
30
|
+
promotion: null,
|
|
31
|
+
bonusPreviewData: [],
|
|
28
32
|
},
|
|
29
33
|
states: {
|
|
30
34
|
loading: {
|
|
@@ -32,7 +36,7 @@ export default function (request) {
|
|
|
32
36
|
src: 'fetchInitData',
|
|
33
37
|
onDone: {
|
|
34
38
|
target: 'checking',
|
|
35
|
-
actions:
|
|
39
|
+
actions: 'setInitData',
|
|
36
40
|
},
|
|
37
41
|
onError: {
|
|
38
42
|
target: 'fail',
|
|
@@ -40,133 +44,72 @@ export default function (request) {
|
|
|
40
44
|
},
|
|
41
45
|
},
|
|
42
46
|
checking: {
|
|
43
|
-
always: [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
on: {
|
|
51
|
-
SELECT_CARD: {
|
|
52
|
-
actions: 'setCard',
|
|
53
|
-
},
|
|
54
|
-
SELECT_AMOUNT: {
|
|
55
|
-
target: 'pending',
|
|
56
|
-
actions: 'setAmount',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
pending: {
|
|
61
|
-
on: {
|
|
62
|
-
SELECT_AMOUNT: {
|
|
63
|
-
actions: 'setAmount',
|
|
64
|
-
},
|
|
65
|
-
CONFIRM: {
|
|
66
|
-
target: 'debouncing',
|
|
67
|
-
},
|
|
68
|
-
BACK: {
|
|
69
|
-
target: 'loaded',
|
|
70
|
-
},
|
|
47
|
+
always: [
|
|
48
|
+
{
|
|
49
|
+
target: 'fetching',
|
|
50
|
+
cond: (context, event) => {
|
|
51
|
+
const { siteConfig = {}, promotion = {} } = context
|
|
52
|
+
const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
|
|
53
|
+
return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
|
|
71
54
|
},
|
|
72
55
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
after: {
|
|
84
|
-
1000: {
|
|
85
|
-
target: 'calculating',
|
|
86
|
-
},
|
|
87
|
-
},
|
|
56
|
+
{ target: 'loaded' },
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
fetching: {
|
|
60
|
+
invoke: {
|
|
61
|
+
src: 'fetchBonusPreview',
|
|
62
|
+
onDone: {
|
|
63
|
+
target: 'loaded',
|
|
64
|
+
actions: 'setBonusPreview',
|
|
88
65
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
on: {
|
|
92
|
-
SELECT_AMOUNT: {
|
|
93
|
-
target: 'debouncing',
|
|
94
|
-
actions: 'setAmount',
|
|
95
|
-
},
|
|
96
|
-
CALCULATE: {
|
|
97
|
-
target: 'debouncing',
|
|
98
|
-
},
|
|
99
|
-
BACK: {
|
|
100
|
-
target: 'loaded',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
66
|
+
onError: {
|
|
67
|
+
target: 'loaded',
|
|
103
68
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
fail: {},
|
|
72
|
+
loaded: {
|
|
73
|
+
entry: 'reset',
|
|
74
|
+
on: {
|
|
75
|
+
SELECT_CARD: [
|
|
76
|
+
{
|
|
77
|
+
target: 'fetching',
|
|
78
|
+
actions: 'setCard',
|
|
79
|
+
cond: (context, event) => {
|
|
80
|
+
const { siteConfig = {}, promotion = {} } = context
|
|
81
|
+
const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
|
|
82
|
+
return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
|
|
113
83
|
},
|
|
114
84
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
on: {
|
|
118
|
-
INPUT_CARD_NUMBER: {
|
|
119
|
-
actions: 'setCardNumber',
|
|
120
|
-
},
|
|
121
|
-
INPUT_SERIAL_NUMBER: {
|
|
122
|
-
actions: 'setSerialNumber',
|
|
123
|
-
},
|
|
124
|
-
SUBMIT: {
|
|
125
|
-
target: 'submitting',
|
|
126
|
-
cond: 'isSubmittable',
|
|
127
|
-
},
|
|
128
|
-
SELECT_CARD: {
|
|
129
|
-
target: 'loaded',
|
|
130
|
-
actions: 'setCard',
|
|
131
|
-
},
|
|
85
|
+
{
|
|
86
|
+
actions: 'setCard',
|
|
132
87
|
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
target: 'submitting',
|
|
140
|
-
cond: 'jumpLinkEnable',
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
target: 'cardInfo',
|
|
144
|
-
},
|
|
145
|
-
],
|
|
146
|
-
onError: {
|
|
147
|
-
target: 'loaded',
|
|
148
|
-
},
|
|
88
|
+
],
|
|
89
|
+
SELECT_AMOUNT: [
|
|
90
|
+
{
|
|
91
|
+
target: 'pending',
|
|
92
|
+
actions: 'setAmount',
|
|
93
|
+
cond: 'isFreeWalletMode',
|
|
149
94
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
BACK: {
|
|
154
|
-
target: 'loaded',
|
|
155
|
-
},
|
|
95
|
+
{
|
|
96
|
+
target: 'debouncing',
|
|
97
|
+
actions: 'setAmount',
|
|
156
98
|
},
|
|
157
|
-
|
|
99
|
+
],
|
|
158
100
|
},
|
|
159
101
|
},
|
|
160
|
-
|
|
161
|
-
entry: 'reset',
|
|
102
|
+
pending: {
|
|
162
103
|
on: {
|
|
163
|
-
SELECT_CARD: {
|
|
164
|
-
actions: 'setCard',
|
|
165
|
-
},
|
|
166
104
|
SELECT_AMOUNT: {
|
|
167
|
-
target: 'debouncing',
|
|
168
105
|
actions: 'setAmount',
|
|
169
106
|
},
|
|
107
|
+
CONFIRM: {
|
|
108
|
+
target: 'calculating',
|
|
109
|
+
},
|
|
110
|
+
BACK: {
|
|
111
|
+
target: 'loaded',
|
|
112
|
+
},
|
|
170
113
|
},
|
|
171
114
|
},
|
|
172
115
|
debouncing: {
|
|
@@ -176,7 +119,7 @@ export default function (request) {
|
|
|
176
119
|
actions: 'setAmount',
|
|
177
120
|
},
|
|
178
121
|
BACK: {
|
|
179
|
-
target: '
|
|
122
|
+
target: 'loaded',
|
|
180
123
|
},
|
|
181
124
|
},
|
|
182
125
|
after: {
|
|
@@ -185,22 +128,6 @@ export default function (request) {
|
|
|
185
128
|
},
|
|
186
129
|
},
|
|
187
130
|
},
|
|
188
|
-
fail: {},
|
|
189
|
-
calculable: {
|
|
190
|
-
entry: 'clearCalculation',
|
|
191
|
-
on: {
|
|
192
|
-
SELECT_AMOUNT: {
|
|
193
|
-
target: 'debouncing',
|
|
194
|
-
actions: 'setAmount',
|
|
195
|
-
},
|
|
196
|
-
CALCULATE: {
|
|
197
|
-
target: 'debouncing',
|
|
198
|
-
},
|
|
199
|
-
BACK: {
|
|
200
|
-
target: 'defaultMode',
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
131
|
calculating: {
|
|
205
132
|
invoke: {
|
|
206
133
|
src: 'fetchCalculation',
|
|
@@ -213,6 +140,18 @@ export default function (request) {
|
|
|
213
140
|
},
|
|
214
141
|
},
|
|
215
142
|
},
|
|
143
|
+
calculable: {
|
|
144
|
+
entry: 'clearCalculation',
|
|
145
|
+
on: {
|
|
146
|
+
SELECT_AMOUNT: {
|
|
147
|
+
target: 'debouncing',
|
|
148
|
+
actions: 'setAmount',
|
|
149
|
+
},
|
|
150
|
+
BACK: {
|
|
151
|
+
target: 'loaded',
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
},
|
|
216
155
|
calculated: {
|
|
217
156
|
on: {
|
|
218
157
|
SELECT_AMOUNT: {
|
|
@@ -229,7 +168,7 @@ export default function (request) {
|
|
|
229
168
|
},
|
|
230
169
|
],
|
|
231
170
|
BACK: {
|
|
232
|
-
target: '
|
|
171
|
+
target: 'loaded',
|
|
233
172
|
},
|
|
234
173
|
CLEAR_CALCULATION: {
|
|
235
174
|
target: 'debouncing',
|
|
@@ -249,10 +188,21 @@ export default function (request) {
|
|
|
249
188
|
target: 'submitting',
|
|
250
189
|
cond: 'isSubmittable',
|
|
251
190
|
},
|
|
252
|
-
SELECT_CARD:
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
191
|
+
SELECT_CARD: [
|
|
192
|
+
{
|
|
193
|
+
target: 'fetching',
|
|
194
|
+
actions: 'setCard',
|
|
195
|
+
cond: (context, event) => {
|
|
196
|
+
const { siteConfig = {}, promotion = {} } = context
|
|
197
|
+
const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
|
|
198
|
+
return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
target: 'loaded',
|
|
203
|
+
actions: 'setCard',
|
|
204
|
+
},
|
|
205
|
+
],
|
|
256
206
|
},
|
|
257
207
|
},
|
|
258
208
|
submitting: {
|
|
@@ -263,18 +213,23 @@ export default function (request) {
|
|
|
263
213
|
actions: 'setResult',
|
|
264
214
|
},
|
|
265
215
|
onError: {
|
|
266
|
-
target: '
|
|
216
|
+
target: 'loaded',
|
|
267
217
|
},
|
|
268
218
|
},
|
|
269
219
|
},
|
|
270
220
|
submitted: {
|
|
271
221
|
on: {
|
|
272
222
|
BACK: {
|
|
273
|
-
target: '
|
|
223
|
+
target: 'loaded',
|
|
274
224
|
},
|
|
275
225
|
},
|
|
276
226
|
},
|
|
277
227
|
},
|
|
228
|
+
on: {
|
|
229
|
+
SET_PROMOTION: {
|
|
230
|
+
actions: 'setPromotion',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
278
233
|
},
|
|
279
234
|
{
|
|
280
235
|
actions: {
|
|
@@ -287,9 +242,10 @@ export default function (request) {
|
|
|
287
242
|
}
|
|
288
243
|
}),
|
|
289
244
|
setInitData: assign((context, event) => {
|
|
290
|
-
const { paymentDetail } = event.data
|
|
245
|
+
const { siteConfig, paymentDetail } = event.data
|
|
291
246
|
const cards = paymentDetail.filter((element) => element.category === context.currentCategory)
|
|
292
247
|
return {
|
|
248
|
+
siteConfig,
|
|
293
249
|
paymentDetail,
|
|
294
250
|
cards,
|
|
295
251
|
selectedCard: cards[0],
|
|
@@ -297,10 +253,9 @@ export default function (request) {
|
|
|
297
253
|
options: cards[0].optional,
|
|
298
254
|
}
|
|
299
255
|
}),
|
|
300
|
-
|
|
301
|
-
const { siteConfig } = event.data
|
|
256
|
+
setBonusPreview: assign((context, event) => {
|
|
302
257
|
return {
|
|
303
|
-
|
|
258
|
+
bonusPreviewData: event.data.bonus,
|
|
304
259
|
}
|
|
305
260
|
}),
|
|
306
261
|
setCard: assign((context, event) => {
|
|
@@ -338,9 +293,15 @@ export default function (request) {
|
|
|
338
293
|
result: event.data,
|
|
339
294
|
}
|
|
340
295
|
}),
|
|
296
|
+
setPromotion: assign((context, event) => {
|
|
297
|
+
const promotion = event.data
|
|
298
|
+
return {
|
|
299
|
+
promotion,
|
|
300
|
+
}
|
|
301
|
+
}),
|
|
341
302
|
},
|
|
342
303
|
guards: {
|
|
343
|
-
|
|
304
|
+
isFreeWalletMode: (context, event) => {
|
|
344
305
|
return context.siteConfig?.walletMode === '2'
|
|
345
306
|
},
|
|
346
307
|
isSubmittable: (context, event) => {
|
|
@@ -361,17 +322,25 @@ export default function (request) {
|
|
|
361
322
|
const siteConfig = JSON.parse(window.atob(config))
|
|
362
323
|
return { siteConfig, paymentDetail }
|
|
363
324
|
},
|
|
325
|
+
fetchBonusPreview: async (context, event) => {
|
|
326
|
+
const { currentMethod, promotion } = context
|
|
327
|
+
return await request.send({
|
|
328
|
+
paymentMethod: currentMethod,
|
|
329
|
+
promotionsNo: promotion?.activityNo,
|
|
330
|
+
})
|
|
331
|
+
},
|
|
364
332
|
fetchCalculation: async (context, event) => {
|
|
365
|
-
const { currentMethod, selectedAmount } = context
|
|
333
|
+
const { currentMethod, selectedAmount, promotion } = context
|
|
366
334
|
return await request.send(
|
|
367
335
|
payment.getDepositExpectedResult({
|
|
368
336
|
method: currentMethod,
|
|
369
337
|
amount: selectedAmount,
|
|
338
|
+
promotionsNo: promotion?.activityNo,
|
|
370
339
|
})
|
|
371
340
|
)
|
|
372
341
|
},
|
|
373
342
|
submitDeposit: async (context, event) => {
|
|
374
|
-
const { currentMethod, selectedCard, selectedAmount, cardNumber, serialNumber } = context
|
|
343
|
+
const { currentMethod, selectedCard, selectedAmount, cardNumber, serialNumber, promotion } = context
|
|
375
344
|
return await request.send(
|
|
376
345
|
payment.submitDepositTransactionLoadcard({
|
|
377
346
|
method: currentMethod,
|
|
@@ -379,6 +348,7 @@ export default function (request) {
|
|
|
379
348
|
card_type: selectedCard.channel_id,
|
|
380
349
|
card_code: cardNumber,
|
|
381
350
|
card_seri: serialNumber,
|
|
351
|
+
promotionsNo: promotion?.activityNo,
|
|
382
352
|
})
|
|
383
353
|
)
|
|
384
354
|
},
|