@jetthai/cuora 1.1.127 → 1.1.128-dev-2
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 +426 -0
- package/package.json +1 -1
- package/src/api/activity.js +28 -0
- package/src/api/auth.js +6 -0
- package/src/api/common.js +2 -1
- package/src/api/game.js +5 -4
- package/src/api/mailbox.js +9 -5
- package/src/api/payment.js +103 -8
- package/src/api/user.js +2 -0
- package/src/machine/activity/activity.js +56 -16
- package/src/machine/activity/activity_cash.js +78 -14
- package/src/machine/activity/cash_rain_activity.js +153 -0
- package/src/machine/activity/diamond_shop_activity_cash.js +57 -92
- package/src/machine/activity/diamond_shop_activity_vn.js +54 -89
- package/src/machine/activity/fafafa_activity.js +8 -1
- package/src/machine/activity/friend_invite_friends_activity.js +3 -1
- package/src/machine/activity/index.js +6 -0
- package/src/machine/activity/instant_rebate_activity.js +214 -0
- package/src/machine/activity/roulette_activity_v2.js +11 -2
- package/src/machine/activity/sign_in_activity.js +20 -13
- package/src/machine/activity/vip_card_activity.js +140 -0
- package/src/machine/auth.js +54 -5
- package/src/machine/bank_binding.js +112 -12
- package/src/machine/bank_binding_amb.js +6 -1
- package/src/machine/common.js +92 -24
- package/src/machine/deposit/amb.js +5 -3
- package/src/machine/deposit/crypto.js +14 -10
- package/src/machine/deposit/crypto_bank.js +317 -0
- package/src/machine/deposit/crypto_bank_cash.js +280 -0
- package/src/machine/deposit/crypto_button.js +9 -5
- package/src/machine/deposit/crypto_cash.js +2 -5
- package/src/machine/deposit/crypto_qrcode.js +147 -0
- package/src/machine/deposit/crypto_qrcode_cash.js +131 -0
- package/src/machine/deposit/crypto_way.js +220 -0
- package/src/machine/deposit/crypto_way_cash.js +242 -0
- package/src/machine/deposit/direct.js +2 -11
- package/src/machine/deposit/direct_cash.js +6 -26
- package/src/machine/deposit/float.js +5 -3
- package/src/machine/deposit/index.js +14 -0
- package/src/machine/deposit/krway.js +151 -0
- package/src/machine/deposit/loadcard_cash.js +6 -27
- package/src/machine/deposit/loadcard_vn.js +2 -10
- package/src/machine/deposit/manual_cash.js +89 -38
- package/src/machine/deposit/manual_vn.js +104 -48
- package/src/machine/deposit/qrcode_cash.js +12 -23
- package/src/machine/deposit/qrcode_v2.js +3 -8
- package/src/machine/deposit/usdt_cash.js +0 -2
- package/src/machine/deposit/vpay.js +5 -3
- package/src/machine/game_info.js +57 -0
- package/src/machine/game_search_cash.js +137 -12
- package/src/machine/game_search_v2.js +4 -4
- package/src/machine/game_v2_1.js +131 -7
- package/src/machine/honor_board_cash.js +63 -0
- package/src/machine/inbox.js +259 -34
- package/src/machine/index.js +6 -0
- package/src/machine/leaderboard.js +31 -8
- package/src/machine/reward_cash.js +1 -1
- package/src/machine/side_v2.js +1 -1
- package/src/machine/user_photo.js +65 -0
- package/src/machine/user_sign_up.js +71 -7
- package/src/machine/withdraw/index.js +6 -0
- package/src/machine/withdraw/withdraw_crypto.js +1 -66
- package/src/machine/withdraw/withdraw_crypto2.js +540 -0
- package/src/machine/withdraw/withdraw_krway.js +207 -0
- package/src/machine/withdraw/withdraw_manual.js +595 -0
- package/src/machine/withdraw/withdraw_manual_cash.js +44 -14
- package/src/machine/withdraw/withdraw_vn.js +42 -7
- package/src/machine/withdraw/withdraw_vn2.js +64 -37
- package/src/util/constant.js +18 -0
- package/src/util/deviceToken.js +2 -2
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import payment from '../../api/payment.js'
|
|
3
|
-
import common from '../../api/common.js'
|
|
4
3
|
import { max } from '../../util/index.js'
|
|
5
4
|
|
|
6
5
|
export default function (request, context) {
|
|
7
|
-
const {
|
|
6
|
+
const { appSecret } = request.config
|
|
7
|
+
const { paymentDetail = [], promotion, selectedAmount, siteConfig = {} } = context || {}
|
|
8
8
|
|
|
9
9
|
return createMachine(
|
|
10
10
|
{
|
|
11
11
|
id: 'manual_cash',
|
|
12
12
|
initial: 'loading',
|
|
13
13
|
context: {
|
|
14
|
+
siteConfig,
|
|
14
15
|
paymentDetail,
|
|
15
16
|
promotion,
|
|
16
17
|
selectedAmount,
|
|
17
18
|
|
|
19
|
+
bankList: [],
|
|
20
|
+
bindingPaymentList: {},
|
|
21
|
+
bindingPaymentInfo: {},
|
|
18
22
|
houseBanks: [],
|
|
19
23
|
userBanks: [],
|
|
20
|
-
banks: [],
|
|
21
24
|
|
|
22
25
|
selectedHouseBank: null,
|
|
23
26
|
selectedUserBank: null,
|
|
24
27
|
userAccountNumber: null,
|
|
28
|
+
userIfscCode: null,
|
|
25
29
|
userAccountName: null,
|
|
30
|
+
userAccountBranchName: null,
|
|
31
|
+
userAccountBranchCode: null,
|
|
32
|
+
transactionId: null,
|
|
26
33
|
depositTime: null,
|
|
27
34
|
receipt: null,
|
|
28
35
|
|
|
@@ -79,21 +86,32 @@ export default function (request, context) {
|
|
|
79
86
|
SELECT_USER_BANK: {
|
|
80
87
|
actions: 'setUserBank',
|
|
81
88
|
},
|
|
89
|
+
INPUT_USER_ACCOUNT_BRANCH_NAME: {
|
|
90
|
+
actions: 'setUserAccountBranchName',
|
|
91
|
+
},
|
|
92
|
+
INPUT_USER_ACCOUNT_BRANCH_CODE: {
|
|
93
|
+
actions: 'setUserAccountBranchCode',
|
|
94
|
+
},
|
|
82
95
|
INPUT_USER_ACCOUNT_NUMBER: {
|
|
83
96
|
actions: 'setUserAccountNumber',
|
|
84
97
|
},
|
|
98
|
+
INPUT_USER_IFSC_CODE: {
|
|
99
|
+
actions: 'setUserIfscCode',
|
|
100
|
+
},
|
|
85
101
|
INPUT_USER_ACCOUNT_NAME: {
|
|
86
102
|
actions: 'setUserAccountName',
|
|
87
103
|
},
|
|
88
104
|
SET_RECEIPT: {
|
|
89
105
|
actions: 'setReceipt',
|
|
90
106
|
},
|
|
107
|
+
INPUT_TRANSACTION_ID: {
|
|
108
|
+
actions: 'setTransactionId',
|
|
109
|
+
},
|
|
91
110
|
SET_DEPOSIT_TIME: {
|
|
92
111
|
actions: 'setDepositTime',
|
|
93
112
|
},
|
|
94
113
|
SUBMIT: {
|
|
95
114
|
target: 'submitting',
|
|
96
|
-
cond: 'isSubmittable',
|
|
97
115
|
},
|
|
98
116
|
},
|
|
99
117
|
},
|
|
@@ -130,27 +148,28 @@ export default function (request, context) {
|
|
|
130
148
|
{
|
|
131
149
|
actions: {
|
|
132
150
|
setInitData: assign((context, event) => {
|
|
133
|
-
const { currentPayment,
|
|
134
|
-
const
|
|
151
|
+
const { currentPayment, bankList, bindingPaymentInfo, processing } = event.data
|
|
152
|
+
const userBankLsit = bindingPaymentInfo.bankList || []
|
|
153
|
+
const allBankList = bankList || []
|
|
135
154
|
|
|
136
155
|
const houseBanks = currentPayment.banks.map((bank) => {
|
|
137
|
-
const foundBank =
|
|
156
|
+
const foundBank = allBankList.find((item) => item.bankCode === bank.bankName)
|
|
138
157
|
bank.bankCode = bank.bankName // because api has no bankCode field
|
|
139
158
|
bank.displayText = foundBank?.shortName
|
|
140
159
|
bank.imageUrl = foundBank?.imageUrl
|
|
141
|
-
return bank
|
|
160
|
+
return { ...bank, ...foundBank }
|
|
142
161
|
})
|
|
143
162
|
|
|
144
|
-
const
|
|
145
|
-
const foundBank =
|
|
163
|
+
const formattedUserBanks = userBankLsit.map((bank) => {
|
|
164
|
+
const foundBank = allBankList.find((item) => item.bankCode === bank.bankCode)
|
|
146
165
|
bank.displayText = `${foundBank?.shortName} ${bank.accountNumber.slice(-5)}`
|
|
147
166
|
bank.imageUrl = foundBank?.imageUrl
|
|
148
|
-
return bank
|
|
167
|
+
return { ...bank, ...foundBank }
|
|
149
168
|
})
|
|
150
169
|
|
|
151
170
|
const userBanks = [
|
|
152
|
-
...
|
|
153
|
-
...
|
|
171
|
+
...formattedUserBanks,
|
|
172
|
+
...allBankList.map((bank) => ({
|
|
154
173
|
...bank,
|
|
155
174
|
displayText: bank.shortName,
|
|
156
175
|
})),
|
|
@@ -161,11 +180,15 @@ export default function (request, context) {
|
|
|
161
180
|
method: currentPayment.method,
|
|
162
181
|
processing,
|
|
163
182
|
houseBanks,
|
|
183
|
+
selectedAmount: max(promotion?.minimumAmount, currentPayment?.minimum, selectedAmount, 0),
|
|
164
184
|
selectedHouseBank: houseBanks[0],
|
|
165
185
|
userBanks,
|
|
166
186
|
selectedUserBank: userBanks[0],
|
|
167
187
|
userAccountNumber: userBanks[0].accountNumber,
|
|
188
|
+
userIfscCode: userBanks[0].ifscCode,
|
|
168
189
|
userAccountName: userBanks[0].holderName,
|
|
190
|
+
userAccountBranchName: userBanks[0].branch,
|
|
191
|
+
userAccountBranchCode: userBanks[0].branchCode,
|
|
169
192
|
}
|
|
170
193
|
}),
|
|
171
194
|
setHouseBank: assign((context, event) => {
|
|
@@ -192,11 +215,24 @@ export default function (request, context) {
|
|
|
192
215
|
}
|
|
193
216
|
}),
|
|
194
217
|
setUserBank: assign((context, event) => {
|
|
195
|
-
const { accountNumber, holderName } = event.data
|
|
218
|
+
const { accountNumber, ifscCode, holderName, branch, branchCode } = event.data
|
|
196
219
|
return {
|
|
197
220
|
selectedUserBank: event.data,
|
|
198
221
|
userAccountNumber: accountNumber,
|
|
222
|
+
userIfscCode: ifscCode,
|
|
199
223
|
userAccountName: holderName,
|
|
224
|
+
userAccountBranchName: branch,
|
|
225
|
+
userAccountBranchCode: branchCode,
|
|
226
|
+
}
|
|
227
|
+
}),
|
|
228
|
+
setUserAccountBranchName: assign((context, event) => {
|
|
229
|
+
return {
|
|
230
|
+
userAccountBranchName: event.data,
|
|
231
|
+
}
|
|
232
|
+
}),
|
|
233
|
+
setUserAccountBranchCode: assign((context, event) => {
|
|
234
|
+
return {
|
|
235
|
+
userAccountBranchCode: event.data,
|
|
200
236
|
}
|
|
201
237
|
}),
|
|
202
238
|
setUserAccountNumber: assign((context, event) => {
|
|
@@ -204,11 +240,21 @@ export default function (request, context) {
|
|
|
204
240
|
userAccountNumber: event.data,
|
|
205
241
|
}
|
|
206
242
|
}),
|
|
243
|
+
setUserIfscCode: assign((context, event) => {
|
|
244
|
+
return {
|
|
245
|
+
userIfscCode: event.data,
|
|
246
|
+
}
|
|
247
|
+
}),
|
|
207
248
|
setUserAccountName: assign((context, event) => {
|
|
208
249
|
return {
|
|
209
250
|
userAccountName: event.data,
|
|
210
251
|
}
|
|
211
252
|
}),
|
|
253
|
+
setTransactionId: assign((context, event) => {
|
|
254
|
+
return {
|
|
255
|
+
transactionId: event.data,
|
|
256
|
+
}
|
|
257
|
+
}),
|
|
212
258
|
setDepositTime: assign((context, event) => {
|
|
213
259
|
return {
|
|
214
260
|
depositTime: event.data,
|
|
@@ -224,11 +270,6 @@ export default function (request, context) {
|
|
|
224
270
|
promotion: event.data,
|
|
225
271
|
}
|
|
226
272
|
}),
|
|
227
|
-
setPromotionDefaultAmount: assign((context, event) => {
|
|
228
|
-
return {
|
|
229
|
-
selectedAmount: context.promotion.minimumAmount,
|
|
230
|
-
}
|
|
231
|
-
}),
|
|
232
273
|
},
|
|
233
274
|
guards: {
|
|
234
275
|
isCalculable: (context, event) => {
|
|
@@ -238,36 +279,27 @@ export default function (request, context) {
|
|
|
238
279
|
} = context
|
|
239
280
|
return selectedAmount && minimum <= +selectedAmount && +selectedAmount <= maximum
|
|
240
281
|
},
|
|
241
|
-
isCalculated: (context, event) => {
|
|
242
|
-
return context.calculation
|
|
243
|
-
},
|
|
244
|
-
isSubmittable: (context, event) => {
|
|
245
|
-
const { selectedAmount, userAccountNumber, userAccountName, depositTime, receipt } = context
|
|
246
|
-
return selectedAmount && userAccountNumber && userAccountName && depositTime && receipt
|
|
247
|
-
},
|
|
248
282
|
isProcessing: (context, event) => {
|
|
249
283
|
return context.processing
|
|
250
284
|
},
|
|
251
|
-
hasMinPromotionDeposit: (context, event) => {
|
|
252
|
-
return context.promotion?.minimumAmount
|
|
253
|
-
},
|
|
254
285
|
},
|
|
255
286
|
services: {
|
|
256
287
|
fetchInitData: async (context, event) => {
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
)
|
|
288
|
+
const { paymentDetail = [] } = context
|
|
289
|
+
const currentPayment = paymentDetail.find((element) => element.category === context.currentCategory && element.transferType === 'deposit')
|
|
260
290
|
|
|
261
|
-
const [
|
|
291
|
+
const [bankList, bindingPaymentInfo, orders] = await Promise.all([
|
|
262
292
|
request.send(payment.getBankList(currentPayment.method)),
|
|
263
|
-
request.send(payment.
|
|
293
|
+
// request.send(payment.getBindingPaymentList({ appSecret })),
|
|
294
|
+
request.send(payment.getBindingPaymentInfo({ appSecret })),
|
|
264
295
|
request.send(payment.getPendingOrder({ transferType: 'DEPOSIT' })),
|
|
265
296
|
])
|
|
266
297
|
|
|
267
298
|
return {
|
|
268
299
|
currentPayment,
|
|
269
|
-
|
|
270
|
-
|
|
300
|
+
bankList,
|
|
301
|
+
// bindingPaymentList,
|
|
302
|
+
bindingPaymentInfo,
|
|
271
303
|
processing: orders[0],
|
|
272
304
|
}
|
|
273
305
|
},
|
|
@@ -282,17 +314,36 @@ export default function (request, context) {
|
|
|
282
314
|
)
|
|
283
315
|
},
|
|
284
316
|
submitDeposit: async (context, event) => {
|
|
285
|
-
const {
|
|
286
|
-
|
|
317
|
+
const {
|
|
318
|
+
method,
|
|
319
|
+
selectedAmount,
|
|
320
|
+
selectedHouseBank,
|
|
321
|
+
selectedUserBank,
|
|
322
|
+
userAccountNumber,
|
|
323
|
+
userIfscCode,
|
|
324
|
+
userAccountName,
|
|
325
|
+
userAccountBranchName,
|
|
326
|
+
userAccountBranchCode,
|
|
327
|
+
transactionId,
|
|
328
|
+
depositTime,
|
|
329
|
+
receipt,
|
|
330
|
+
promotion,
|
|
331
|
+
} = context
|
|
287
332
|
return await request.send(
|
|
288
333
|
payment.submitDepositTransactionBank({
|
|
289
334
|
method,
|
|
290
335
|
amount: selectedAmount,
|
|
291
336
|
targetBankCode: selectedHouseBank.bankName,
|
|
292
337
|
targetAccountNumber: selectedHouseBank.accountNumber,
|
|
338
|
+
targetIfscCode: selectedHouseBank.ifscCode,
|
|
339
|
+
targetUpi: selectedHouseBank.upi,
|
|
293
340
|
applyerBankCode: selectedUserBank.bankCode,
|
|
294
341
|
applyerAccountNumber: userAccountNumber,
|
|
342
|
+
applyerIfscCode: userIfscCode,
|
|
295
343
|
applyerHolderName: userAccountName,
|
|
344
|
+
applyerBranch: userAccountBranchName,
|
|
345
|
+
applyerBranchCode: userAccountBranchCode,
|
|
346
|
+
transactionId,
|
|
296
347
|
depositTime,
|
|
297
348
|
receipt,
|
|
298
349
|
promotionsNo: promotion?.promotionsNo,
|
|
@@ -1,9 +1,9 @@
|
|
|
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
5
|
const { appSecret } = request.config
|
|
6
|
+
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
9
9
|
id: 'manual',
|
|
@@ -11,16 +11,19 @@ export default function (request) {
|
|
|
11
11
|
context: {
|
|
12
12
|
siteConfig: null,
|
|
13
13
|
paymentDetail: [],
|
|
14
|
-
|
|
14
|
+
allBankList: [],
|
|
15
15
|
houseBanks: [],
|
|
16
16
|
playerBanks: [],
|
|
17
|
-
banks: [],
|
|
18
17
|
|
|
19
18
|
amount: null,
|
|
20
19
|
selectedHouseBank: null,
|
|
21
20
|
selectedUserBank: null,
|
|
22
21
|
userAccountNumber: null,
|
|
22
|
+
userIfscCode: null,
|
|
23
23
|
userAccountName: null,
|
|
24
|
+
userAccountBranchName: null,
|
|
25
|
+
userAccountBranchCode: null,
|
|
26
|
+
transactionId: null,
|
|
24
27
|
depositTime: null,
|
|
25
28
|
receipt: null,
|
|
26
29
|
|
|
@@ -41,7 +44,7 @@ export default function (request) {
|
|
|
41
44
|
states: {
|
|
42
45
|
init1: {
|
|
43
46
|
invoke: {
|
|
44
|
-
src: '
|
|
47
|
+
src: 'fetchPaymentDetail',
|
|
45
48
|
onDone: {
|
|
46
49
|
target: 'init2',
|
|
47
50
|
actions: 'setInitData',
|
|
@@ -59,7 +62,7 @@ export default function (request) {
|
|
|
59
62
|
},
|
|
60
63
|
],
|
|
61
64
|
invoke: {
|
|
62
|
-
src: '
|
|
65
|
+
src: 'fetchBanks',
|
|
63
66
|
onDone: {
|
|
64
67
|
target: '#manual.step1',
|
|
65
68
|
actions: 'setBanks',
|
|
@@ -133,7 +136,13 @@ export default function (request) {
|
|
|
133
136
|
always: [
|
|
134
137
|
{
|
|
135
138
|
target: 'pending',
|
|
136
|
-
cond: (context, event) =>
|
|
139
|
+
cond: (context, event) => {
|
|
140
|
+
const { siteConfig = {}, calculation, promotion } = context
|
|
141
|
+
const { walletMode } = siteConfig
|
|
142
|
+
const { promotionsNo, activityNo } = promotion
|
|
143
|
+
const isNoBonus = promotionsNo === 'none' || activityNo === 'none'
|
|
144
|
+
return walletMode === '4' && !!calculation && !isNoBonus
|
|
145
|
+
},
|
|
137
146
|
},
|
|
138
147
|
{
|
|
139
148
|
target: '#manual.step2',
|
|
@@ -194,9 +203,21 @@ export default function (request) {
|
|
|
194
203
|
SELECT_USER_BANK: {
|
|
195
204
|
actions: 'setUserBank',
|
|
196
205
|
},
|
|
206
|
+
INPUT_USER_ACCOUNT_BRANCH_NAME: {
|
|
207
|
+
actions: 'setUserAccountBranchName',
|
|
208
|
+
},
|
|
209
|
+
INPUT_USER_ACCOUNT_BRANCH_CODE: {
|
|
210
|
+
actions: 'setUserAccountBranchCode',
|
|
211
|
+
},
|
|
197
212
|
INPUT_USER_ACCOUNT_NUMBER: {
|
|
198
213
|
actions: 'setUserAccountNumber',
|
|
199
214
|
},
|
|
215
|
+
INPUT_USER_IFSC_CODE: {
|
|
216
|
+
actions: 'setUserIfscCode',
|
|
217
|
+
},
|
|
218
|
+
INPUT_TRANSACTION_ID: {
|
|
219
|
+
actions: 'setTransactionId',
|
|
220
|
+
},
|
|
200
221
|
INPUT_USER_ACCOUNT_NAME: {
|
|
201
222
|
actions: 'setUserAccountName',
|
|
202
223
|
},
|
|
@@ -212,7 +233,6 @@ export default function (request) {
|
|
|
212
233
|
},
|
|
213
234
|
SUBMIT: {
|
|
214
235
|
target: '.submitting',
|
|
215
|
-
cond: 'isSubmittable',
|
|
216
236
|
},
|
|
217
237
|
},
|
|
218
238
|
},
|
|
@@ -229,49 +249,52 @@ export default function (request) {
|
|
|
229
249
|
{
|
|
230
250
|
actions: {
|
|
231
251
|
setInitData: assign((context, event) => {
|
|
232
|
-
const
|
|
233
|
-
const bankInfoList = paymentInfo?.bankInfo || []
|
|
252
|
+
const paymentDetail = event.data || []
|
|
234
253
|
const currentPayment = paymentDetail.find((element) => element.category === context.currentCategory)
|
|
235
|
-
const
|
|
254
|
+
const { method, banks = [], processing } = currentPayment || {}
|
|
255
|
+
const houseBanks = banks.map((item) => {
|
|
236
256
|
item.bankCode = item.bankName
|
|
237
257
|
return item
|
|
238
258
|
})
|
|
259
|
+
|
|
239
260
|
return {
|
|
240
|
-
siteConfig,
|
|
241
261
|
paymentDetail,
|
|
242
262
|
currentPayment,
|
|
243
|
-
method
|
|
263
|
+
method,
|
|
244
264
|
houseBanks,
|
|
245
265
|
selectedHouseBank: houseBanks[0],
|
|
246
|
-
|
|
247
|
-
processing: currentPayment.processing?.[0],
|
|
266
|
+
processing: processing?.[0],
|
|
248
267
|
}
|
|
249
268
|
}),
|
|
250
269
|
setBanks: assign((context, event) => {
|
|
251
|
-
const
|
|
252
|
-
const
|
|
270
|
+
const { bindingPaymentInfo = {}, bindingPaymentList = {} } = event.data || {}
|
|
271
|
+
const userBankLsit = bindingPaymentInfo.bankList || []
|
|
272
|
+
const allBankList = bindingPaymentList.bankList || []
|
|
273
|
+
const { currentPayment, houseBanks, selectedHouseBank } = context
|
|
274
|
+
const { banks = [] } = currentPayment
|
|
253
275
|
|
|
254
|
-
const
|
|
276
|
+
const formettedPlayerBanks = userBankLsit.map((bank) => {
|
|
255
277
|
bank.shortName = `${bank.bankCode} ${bank.accountNumber.slice(-5)}`
|
|
256
|
-
bank.imageUrl =
|
|
278
|
+
bank.imageUrl = allBankList.find((item) => item.bankCode === bank.bankCode)?.imageUrl
|
|
257
279
|
return bank
|
|
258
280
|
})
|
|
259
|
-
|
|
260
|
-
const userBanks = [...formattedPlayerBanks, ...banks]
|
|
281
|
+
const playerBanks = [...formettedPlayerBanks, ...allBankList]
|
|
261
282
|
|
|
262
283
|
const newHouseBanks = houseBanks.map((houseBank) => {
|
|
263
|
-
return { ...houseBank, ...
|
|
284
|
+
return { ...houseBank, ...allBankList.find((bank) => houseBank.bankName === bank.bankCode) }
|
|
264
285
|
})
|
|
265
|
-
|
|
266
|
-
const newSelectedHouseBank = { ...selectedHouseBank, ...banks.find((bank) => selectedHouseBank.bankName === bank.bankCode) }
|
|
286
|
+
const newSelectedHouseBank = { ...selectedHouseBank, ...allBankList.find((bank) => selectedHouseBank.bankName === bank.bankCode) }
|
|
267
287
|
|
|
268
288
|
return {
|
|
269
|
-
|
|
289
|
+
playerBanks,
|
|
270
290
|
houseBanks: newHouseBanks,
|
|
271
291
|
selectedHouseBank: newSelectedHouseBank,
|
|
272
|
-
selectedUserBank:
|
|
273
|
-
userAccountNumber:
|
|
274
|
-
|
|
292
|
+
selectedUserBank: playerBanks[0],
|
|
293
|
+
userAccountNumber: playerBanks[0].accountNumber,
|
|
294
|
+
userIfscCode: playerBanks[0].ifscCode,
|
|
295
|
+
userAccountName: playerBanks[0].holderName,
|
|
296
|
+
userAccountBranchName: playerBanks[0].branch,
|
|
297
|
+
userAccountBranchCode: playerBanks[0].branchCode,
|
|
275
298
|
}
|
|
276
299
|
}),
|
|
277
300
|
setHouseBank: assign((context, event) => {
|
|
@@ -300,11 +323,24 @@ export default function (request) {
|
|
|
300
323
|
}
|
|
301
324
|
}),
|
|
302
325
|
setUserBank: assign((context, event) => {
|
|
303
|
-
const { accountNumber, holderName } = event.data
|
|
326
|
+
const { accountNumber, ifscCode, holderName, branch, branchCode } = event.data
|
|
304
327
|
return {
|
|
305
328
|
selectedUserBank: event.data,
|
|
306
329
|
userAccountNumber: accountNumber,
|
|
330
|
+
userIfscCode: ifscCode,
|
|
307
331
|
userAccountName: holderName,
|
|
332
|
+
userAccountBranchName: branch,
|
|
333
|
+
userAccountBranchCode: branchCode,
|
|
334
|
+
}
|
|
335
|
+
}),
|
|
336
|
+
setUserAccountBranchName: assign((context, event) => {
|
|
337
|
+
return {
|
|
338
|
+
userAccountBranchName: event.data,
|
|
339
|
+
}
|
|
340
|
+
}),
|
|
341
|
+
setUserAccountBranchCode: assign((context, event) => {
|
|
342
|
+
return {
|
|
343
|
+
userAccountBranchCode: event.data,
|
|
308
344
|
}
|
|
309
345
|
}),
|
|
310
346
|
setUserAccountNumber: assign((context, event) => {
|
|
@@ -312,6 +348,16 @@ export default function (request) {
|
|
|
312
348
|
userAccountNumber: event.data,
|
|
313
349
|
}
|
|
314
350
|
}),
|
|
351
|
+
setUserIfscCode: assign((context, event) => {
|
|
352
|
+
return {
|
|
353
|
+
userIfscCode: event.data,
|
|
354
|
+
}
|
|
355
|
+
}),
|
|
356
|
+
setTransactionId: assign((context, event) => {
|
|
357
|
+
return {
|
|
358
|
+
transactionId: event.data,
|
|
359
|
+
}
|
|
360
|
+
}),
|
|
315
361
|
setUserAccountName: assign((context, event) => {
|
|
316
362
|
return {
|
|
317
363
|
userAccountName: event.data,
|
|
@@ -352,10 +398,6 @@ export default function (request) {
|
|
|
352
398
|
isCalculated: (context, event) => {
|
|
353
399
|
return context.calculation
|
|
354
400
|
},
|
|
355
|
-
isSubmittable: (context, event) => {
|
|
356
|
-
const { amount, userAccountNumber, userAccountName, depositTime, receipt } = context
|
|
357
|
-
return amount && userAccountNumber && userAccountName && depositTime && receipt
|
|
358
|
-
},
|
|
359
401
|
isProcessing: (context, event) => {
|
|
360
402
|
return context.processing
|
|
361
403
|
},
|
|
@@ -364,22 +406,16 @@ export default function (request) {
|
|
|
364
406
|
},
|
|
365
407
|
},
|
|
366
408
|
services: {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
request.send(common.getConfig({ appSecret })),
|
|
370
|
-
request.send(payment.getPaymentInfo()),
|
|
371
|
-
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
372
|
-
])
|
|
373
|
-
const siteConfig = JSON.parse(window.atob(config))
|
|
374
|
-
return {
|
|
375
|
-
siteConfig,
|
|
376
|
-
paymentInfo,
|
|
377
|
-
paymentDetail,
|
|
378
|
-
}
|
|
409
|
+
fetchPaymentDetail: async (context, event) => {
|
|
410
|
+
return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
|
|
379
411
|
},
|
|
380
|
-
|
|
381
|
-
const
|
|
382
|
-
|
|
412
|
+
fetchBanks: async (context, event) => {
|
|
413
|
+
const [bindingPaymentInfo, bindingPaymentList] = await Promise.all([
|
|
414
|
+
request.send(payment.getBindingPaymentInfo({ appSecret })),
|
|
415
|
+
request.send(payment.getBindingPaymentList({ appSecret })),
|
|
416
|
+
])
|
|
417
|
+
|
|
418
|
+
return { bindingPaymentInfo, bindingPaymentList }
|
|
383
419
|
},
|
|
384
420
|
fetchCalculation: async (context, event) => {
|
|
385
421
|
const { method, amount, promotion } = context
|
|
@@ -392,16 +428,36 @@ export default function (request) {
|
|
|
392
428
|
)
|
|
393
429
|
},
|
|
394
430
|
submitDeposit: async (context, event) => {
|
|
395
|
-
const {
|
|
431
|
+
const {
|
|
432
|
+
method,
|
|
433
|
+
amount,
|
|
434
|
+
selectedHouseBank,
|
|
435
|
+
selectedUserBank,
|
|
436
|
+
userAccountNumber,
|
|
437
|
+
userIfscCode,
|
|
438
|
+
userAccountName,
|
|
439
|
+
userAccountBranchName,
|
|
440
|
+
userAccountBranchCode,
|
|
441
|
+
transactionId,
|
|
442
|
+
depositTime,
|
|
443
|
+
receipt,
|
|
444
|
+
promotion,
|
|
445
|
+
} = context
|
|
396
446
|
return await request.send(
|
|
397
447
|
payment.submitDepositTransactionBank({
|
|
398
448
|
method,
|
|
399
449
|
amount,
|
|
400
450
|
targetBankCode: selectedHouseBank.bankName,
|
|
401
451
|
targetAccountNumber: selectedHouseBank.accountNumber,
|
|
452
|
+
targetIfscCode: selectedHouseBank.ifscCode,
|
|
453
|
+
targetUpi: selectedHouseBank.upi,
|
|
402
454
|
applyerBankCode: selectedUserBank.bankCode,
|
|
403
455
|
applyerAccountNumber: userAccountNumber,
|
|
456
|
+
applyerIfscCode: userIfscCode,
|
|
404
457
|
applyerHolderName: userAccountName,
|
|
458
|
+
applyerBranch: userAccountBranchName,
|
|
459
|
+
applyerBranchCode: userAccountBranchCode,
|
|
460
|
+
transactionId,
|
|
405
461
|
depositTime,
|
|
406
462
|
receipt,
|
|
407
463
|
promotionsNo: promotion?.activityNo,
|
|
@@ -36,7 +36,13 @@ export default function (request, context) {
|
|
|
36
36
|
},
|
|
37
37
|
],
|
|
38
38
|
},
|
|
39
|
-
loaded: {
|
|
39
|
+
loaded: {
|
|
40
|
+
after: {
|
|
41
|
+
0: {
|
|
42
|
+
target: 'calculated',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
40
46
|
debouncing: {
|
|
41
47
|
entry: 'clearCalculation',
|
|
42
48
|
after: {
|
|
@@ -85,7 +91,7 @@ export default function (request, context) {
|
|
|
85
91
|
actions: 'setResult',
|
|
86
92
|
},
|
|
87
93
|
onError: {
|
|
88
|
-
target: '
|
|
94
|
+
target: 'loaded',
|
|
89
95
|
},
|
|
90
96
|
},
|
|
91
97
|
},
|
|
@@ -118,15 +124,8 @@ export default function (request, context) {
|
|
|
118
124
|
actions: {
|
|
119
125
|
setInitData: assign((context, event) => {
|
|
120
126
|
const { paymentDetail, selectedAmount, promotion } = context
|
|
121
|
-
const qrcodes = paymentDetail
|
|
122
|
-
|
|
123
|
-
.map((qrcode) => {
|
|
124
|
-
qrcode.disabled = promotion?.promotionsNo !== 'none' && qrcode.charge > 0
|
|
125
|
-
return qrcode
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
const selectedQrcode = qrcodes.find((qrcode) => !qrcode.disabled)
|
|
129
|
-
|
|
127
|
+
const qrcodes = paymentDetail.filter((element) => element.category === context.currentCategory && element.transferType === 'deposit')
|
|
128
|
+
const selectedQrcode = qrcodes[0]
|
|
130
129
|
return {
|
|
131
130
|
paymentDetail,
|
|
132
131
|
qrcodes,
|
|
@@ -135,21 +134,11 @@ export default function (request, context) {
|
|
|
135
134
|
selectedAmount: max(promotion?.minimumAmount, selectedQrcode?.minimum, selectedAmount, 0),
|
|
136
135
|
}
|
|
137
136
|
}),
|
|
138
|
-
setBonusPreview: assign((context, event) => {
|
|
139
|
-
return {
|
|
140
|
-
bonusPreviewData: event.data.bonus,
|
|
141
|
-
}
|
|
142
|
-
}),
|
|
143
137
|
setPromotion: assign((context, event) => {
|
|
144
138
|
const { selectedAmount } = context
|
|
145
139
|
const promotion = event.data
|
|
146
|
-
const qrcodes = context.qrcodes
|
|
147
|
-
|
|
148
|
-
return qrcode
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
const selectedQrcode = qrcodes.find((qrcode) => !qrcode.disabled)
|
|
152
|
-
|
|
140
|
+
const qrcodes = context.qrcodes
|
|
141
|
+
const selectedQrcode = qrcodes[0]
|
|
153
142
|
return {
|
|
154
143
|
promotion,
|
|
155
144
|
qrcodes,
|
|
@@ -302,7 +302,7 @@ export default function (request) {
|
|
|
302
302
|
actions: 'setResult',
|
|
303
303
|
},
|
|
304
304
|
onError: {
|
|
305
|
-
target: '
|
|
305
|
+
target: 'loaded',
|
|
306
306
|
},
|
|
307
307
|
},
|
|
308
308
|
},
|
|
@@ -338,18 +338,13 @@ export default function (request) {
|
|
|
338
338
|
return {
|
|
339
339
|
selectedAmount: null,
|
|
340
340
|
calculation: null,
|
|
341
|
+
result: null,
|
|
341
342
|
}
|
|
342
343
|
}),
|
|
343
344
|
setInitData: assign((context, event) => {
|
|
344
345
|
const { siteConfig, paymentDetail } = event.data
|
|
345
346
|
const qrcodes = paymentDetail.filter((element) => element.category === context.currentCategory)
|
|
346
|
-
|
|
347
|
-
if (siteConfig.walletMode === '4') {
|
|
348
|
-
selectedQrcode = qrcodes.find((qrcode) => parseFloat(`${qrcode.charge || 0}`) === 0)
|
|
349
|
-
} else {
|
|
350
|
-
selectedQrcode = qrcodes[0]
|
|
351
|
-
}
|
|
352
|
-
|
|
347
|
+
const selectedQrcode = qrcodes[0]
|
|
353
348
|
return {
|
|
354
349
|
siteConfig,
|
|
355
350
|
paymentDetail,
|
|
@@ -81,7 +81,6 @@ export default function (request, context) {
|
|
|
81
81
|
icon: value,
|
|
82
82
|
}
|
|
83
83
|
})
|
|
84
|
-
|
|
85
84
|
return {
|
|
86
85
|
networks: defaultNetworks,
|
|
87
86
|
selectedNetwork: defaultNetworks[0],
|
|
@@ -107,7 +106,6 @@ export default function (request, context) {
|
|
|
107
106
|
name,
|
|
108
107
|
qrcode,
|
|
109
108
|
}
|
|
110
|
-
|
|
111
109
|
return {
|
|
112
110
|
result,
|
|
113
111
|
resultMap: {
|