@jetthai/cuora 1.1.190-krw-1 → 1.1.191
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 +11 -15
- package/package.json +1 -1
- package/src/api/auth.js +0 -1
- package/src/api/mailbox.js +5 -9
- package/src/api/payment.js +1 -1
- package/src/machine/auth.js +4 -28
- package/src/machine/bank_binding.js +1 -6
- package/src/machine/bank_binding_amb.js +1 -6
- package/src/machine/deposit/index.js +0 -2
- package/src/machine/deposit/manual_cash.js +6 -49
- package/src/machine/deposit/manual_vn.js +4 -46
- package/src/machine/game_v2_1.js +2 -2
- package/src/machine/inbox.js +33 -222
- package/src/machine/user_sign_up.js +7 -55
- package/src/machine/withdraw/index.js +0 -2
- package/src/machine/deposit/krway.js +0 -151
- package/src/machine/withdraw/withdraw_krway.js +0 -177
package/CHANGELOG.md
CHANGED
|
@@ -2,31 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [1.1.
|
|
5
|
+
### [1.1.191](https://github.com/jetthai/cuora-module/compare/v1.1.190-bigwin...v1.1.191) (2023-10-18)
|
|
6
6
|
|
|
7
|
-
### [1.1.190
|
|
7
|
+
### [1.1.190](https://github.com/jetthai/cuora-module/compare/v1.1.190-bigwin...v1.1.190) (2023-10-18)
|
|
8
8
|
|
|
9
|
-
### [1.1.
|
|
9
|
+
### [1.1.190-bigwin](https://github.com/jetthai/cuora-module/compare/v1.1.190...v1.1.190-bigwin) (2023-10-17)
|
|
10
10
|
|
|
11
|
-
### [1.1.
|
|
11
|
+
### [1.1.190](https://github.com/jetthai/cuora-module/compare/v1.1.189...v1.1.190) (2023-10-17)
|
|
12
12
|
|
|
13
|
-
### [1.1.
|
|
13
|
+
### [1.1.189](https://github.com/jetthai/cuora-module/compare/v1.1.188...v1.1.189) (2023-10-17)
|
|
14
14
|
|
|
15
|
-
### [1.1.
|
|
15
|
+
### [1.1.188](https://github.com/jetthai/cuora-module/compare/v1.1.187...v1.1.188) (2023-10-06)
|
|
16
16
|
|
|
17
|
-
### [1.1.
|
|
17
|
+
### [1.1.187](https://github.com/jetthai/cuora-module/compare/v1.1.186...v1.1.187) (2023-10-03)
|
|
18
18
|
|
|
19
|
-
### [1.1.
|
|
19
|
+
### [1.1.186](https://github.com/jetthai/cuora-module/compare/v1.1.185...v1.1.186) (2023-09-23)
|
|
20
20
|
|
|
21
|
-
### [1.1.
|
|
21
|
+
### [1.1.185](https://github.com/jetthai/cuora-module/compare/v1.1.184...v1.1.185) (2023-09-22)
|
|
22
22
|
|
|
23
|
-
### [1.1.
|
|
23
|
+
### [1.1.184](https://github.com/jetthai/cuora-module/compare/v1.1.183...v1.1.184) (2023-09-21)
|
|
24
24
|
|
|
25
|
-
### [1.1.
|
|
26
|
-
|
|
27
|
-
### [1.1.182-krw-1](https://github.com/jetthai/cuora-module/compare/v1.1.182-krw...v1.1.182-krw-1) (2023-09-27)
|
|
28
|
-
|
|
29
|
-
### [1.1.182-krw](https://github.com/jetthai/cuora-module/compare/v1.1.182...v1.1.182-krw) (2023-09-26)
|
|
25
|
+
### [1.1.183](https://github.com/jetthai/cuora-module/compare/v1.1.182...v1.1.183) (2023-09-21)
|
|
30
26
|
|
|
31
27
|
### [1.1.182](https://github.com/jetthai/cuora-module/compare/v1.1.181...v1.1.182) (2023-09-21)
|
|
32
28
|
|
package/package.json
CHANGED
package/src/api/auth.js
CHANGED
package/src/api/mailbox.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
getMessageTypes: () => ({ url: 'mailbox/getMessageTypes', method: 'get' }),
|
|
3
|
-
getMessageList: ({ type, limit = 10, page
|
|
3
|
+
getMessageList: ({ type, limit = 10, page }) => ({
|
|
4
4
|
url: 'mailbox/getMessageList?include=cl',
|
|
5
5
|
method: 'post',
|
|
6
|
-
params: { type, limit, page
|
|
6
|
+
params: { type, limit, page },
|
|
7
7
|
}),
|
|
8
|
-
updateMessage: ({ groupId, isRead
|
|
8
|
+
updateMessage: ({ groupId, isRead }) => ({
|
|
9
9
|
url: 'mailbox/updateMessage',
|
|
10
10
|
method: 'post',
|
|
11
|
-
params: { groupId, isRead
|
|
12
|
-
}),
|
|
13
|
-
sendMessage: ({ type, category, from, to, title, content }) => ({
|
|
14
|
-
url: 'mailbox/sendMessage',
|
|
15
|
-
method: 'post',
|
|
16
|
-
params: { type, category, from, to, title, content },
|
|
11
|
+
params: { groupId, isRead },
|
|
17
12
|
}),
|
|
13
|
+
sendMessage: () => ({ url: 'mailbox/sendMessage', method: 'post' }),
|
|
18
14
|
getMessage: ({ groupId, limit = 10, pageIdx }) => ({
|
|
19
15
|
url: 'mailbox/getMessage',
|
|
20
16
|
method: 'post',
|
package/src/api/payment.js
CHANGED
|
@@ -40,7 +40,7 @@ export default {
|
|
|
40
40
|
},
|
|
41
41
|
}),
|
|
42
42
|
getBankList: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/getBankList`, method: 'get' }),
|
|
43
|
-
getBindingBankList: (
|
|
43
|
+
getBindingBankList: () => ({ url: 'payment/v2/getBindingBankList', method: 'get' }),
|
|
44
44
|
getWithdrawBankList: () => ({ url: 'payment/v2/getWithdrawBankList', method: 'get' }),
|
|
45
45
|
makeTransaction: ({ type, payload, paymentMethod }) => ({
|
|
46
46
|
url: `payment/v2/${paymentMethod}/transaction`,
|
package/src/machine/auth.js
CHANGED
|
@@ -14,7 +14,6 @@ export default function (request) {
|
|
|
14
14
|
const phoneCountryCode = 'phone_countrycode'
|
|
15
15
|
const accountPhoneKey = 'account_phone'
|
|
16
16
|
const accountEmailKey = 'account_email'
|
|
17
|
-
const accountUsernameKey = 'account_username'
|
|
18
17
|
|
|
19
18
|
return createMachine(
|
|
20
19
|
{
|
|
@@ -211,10 +210,6 @@ export default function (request) {
|
|
|
211
210
|
LOGIN_GUEST: {
|
|
212
211
|
target: '.authenticationGuest',
|
|
213
212
|
},
|
|
214
|
-
LOGIN_ID: {
|
|
215
|
-
target: '.authentication',
|
|
216
|
-
actions: ['setReCaptchaToken', 'setLoginId'],
|
|
217
|
-
},
|
|
218
213
|
LOGIN_PHONE: {
|
|
219
214
|
target: '.authentication',
|
|
220
215
|
actions: ['setReCaptchaToken', 'setLoginPhone'],
|
|
@@ -269,16 +264,6 @@ export default function (request) {
|
|
|
269
264
|
reCaptchaToken,
|
|
270
265
|
}
|
|
271
266
|
}),
|
|
272
|
-
setLoginId: assign((context, event) => {
|
|
273
|
-
const { username, password } = event.data
|
|
274
|
-
return {
|
|
275
|
-
loginData: {
|
|
276
|
-
provider: 'local',
|
|
277
|
-
username,
|
|
278
|
-
password,
|
|
279
|
-
},
|
|
280
|
-
}
|
|
281
|
-
}),
|
|
282
267
|
setLoginPhone: assign((context, event) => {
|
|
283
268
|
const { countryCode, countryAbbr, phone, password } = event.data
|
|
284
269
|
return {
|
|
@@ -331,31 +316,22 @@ export default function (request) {
|
|
|
331
316
|
}
|
|
332
317
|
}),
|
|
333
318
|
setAccount: assign((context, event) => {
|
|
334
|
-
if (context.loginData.
|
|
335
|
-
storage.remove(accountEmailKey)
|
|
336
|
-
storage.remove(accountPhoneKey)
|
|
337
|
-
storage.set(accountUsernameKey, `${context.loginData.username}`, {
|
|
338
|
-
path: '/',
|
|
339
|
-
maxAge: 60 * 60 * 24 * 31,
|
|
340
|
-
})
|
|
341
|
-
} else if (context.loginData.phone) {
|
|
319
|
+
if (context.loginData.phone) {
|
|
342
320
|
storage.remove(accountEmailKey)
|
|
343
|
-
storage.remove(accountUsernameKey)
|
|
344
321
|
storage.set(accountPhoneKey, `${context.loginData.phone}`, {
|
|
345
322
|
path: '/',
|
|
346
|
-
maxAge: 60 * 60 * 24 *
|
|
323
|
+
maxAge: 60 * 60 * 24 * 7,
|
|
347
324
|
})
|
|
348
325
|
storage.set(phoneCountryCode, `${context.countryAbbr}_${context.loginData.countryCode}`, {
|
|
349
326
|
path: '/',
|
|
350
|
-
maxAge: 60 * 60 * 24 *
|
|
327
|
+
maxAge: 60 * 60 * 24 * 7,
|
|
351
328
|
})
|
|
352
329
|
} else if (context.loginData.email) {
|
|
353
330
|
storage.remove(accountPhoneKey)
|
|
354
331
|
storage.remove(phoneCountryCode)
|
|
355
|
-
storage.remove(accountUsernameKey)
|
|
356
332
|
storage.set(accountEmailKey, context.loginData.email, {
|
|
357
333
|
path: '/',
|
|
358
|
-
maxAge: 60 * 60 * 24 *
|
|
334
|
+
maxAge: 60 * 60 * 24 * 7,
|
|
359
335
|
})
|
|
360
336
|
}
|
|
361
337
|
}),
|
|
@@ -2,8 +2,6 @@ import { assign, createMachine } from 'xstate'
|
|
|
2
2
|
import payment from '../api/payment.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
|
-
const { appSecret } = request.config
|
|
6
|
-
|
|
7
5
|
return createMachine(
|
|
8
6
|
{
|
|
9
7
|
id: 'bank_binding',
|
|
@@ -108,10 +106,7 @@ export default function (request) {
|
|
|
108
106
|
},
|
|
109
107
|
services: {
|
|
110
108
|
fetchInitData: async (context, event) => {
|
|
111
|
-
const [bankList, paymentInfo] = await Promise.all([
|
|
112
|
-
request.send(payment.getBindingBankList({ appSecret })),
|
|
113
|
-
request.send(payment.getPaymentInfo()),
|
|
114
|
-
])
|
|
109
|
+
const [bankList, paymentInfo] = await Promise.all([request.send(payment.getBindingBankList()), request.send(payment.getPaymentInfo())])
|
|
115
110
|
return { bankList, paymentInfo }
|
|
116
111
|
},
|
|
117
112
|
updatePaymentInfo: async (context, event) => {
|
|
@@ -2,8 +2,6 @@ import { assign, createMachine } from 'xstate'
|
|
|
2
2
|
import payment from '../api/payment.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
|
-
const { appSecret } = request.config
|
|
6
|
-
|
|
7
5
|
return createMachine(
|
|
8
6
|
{
|
|
9
7
|
id: 'bank_binding_amb',
|
|
@@ -118,10 +116,7 @@ export default function (request) {
|
|
|
118
116
|
},
|
|
119
117
|
services: {
|
|
120
118
|
fetchInitData: async (context, event) => {
|
|
121
|
-
const [bankList, paymentInfo] = await Promise.all([
|
|
122
|
-
request.send(payment.getBindingBankList({ appSecret })),
|
|
123
|
-
request.send(payment.getPaymentInfo()),
|
|
124
|
-
])
|
|
119
|
+
const [bankList, paymentInfo] = await Promise.all([request.send(payment.getBindingBankList()), request.send(payment.getPaymentInfo())])
|
|
125
120
|
return { bankList, paymentInfo }
|
|
126
121
|
},
|
|
127
122
|
updatePaymentInfo: async (context, event) => {
|
|
@@ -8,7 +8,6 @@ import direct from './direct.js'
|
|
|
8
8
|
import amb from './amb.js'
|
|
9
9
|
import float from './float.js'
|
|
10
10
|
import vpay from './vpay.js'
|
|
11
|
-
import krway from './krway.js'
|
|
12
11
|
import usdt from './usdt.js'
|
|
13
12
|
import manual_cash from './manual_cash.js'
|
|
14
13
|
import qrcode_cash from './qrcode_cash.js'
|
|
@@ -35,7 +34,6 @@ export default {
|
|
|
35
34
|
float,
|
|
36
35
|
vpay,
|
|
37
36
|
usdt,
|
|
38
|
-
krway,
|
|
39
37
|
manual_cash,
|
|
40
38
|
qrcode_cash,
|
|
41
39
|
usdt_cash,
|
|
@@ -4,14 +4,13 @@ import common from '../../api/common.js'
|
|
|
4
4
|
import { max } from '../../util/index.js'
|
|
5
5
|
|
|
6
6
|
export default function (request, context) {
|
|
7
|
-
const { paymentDetail = [], promotion, selectedAmount
|
|
7
|
+
const { paymentDetail = [], promotion, selectedAmount } = context || {}
|
|
8
8
|
|
|
9
9
|
return createMachine(
|
|
10
10
|
{
|
|
11
11
|
id: 'manual_cash',
|
|
12
12
|
initial: 'loading',
|
|
13
13
|
context: {
|
|
14
|
-
siteConfig,
|
|
15
14
|
paymentDetail,
|
|
16
15
|
promotion,
|
|
17
16
|
selectedAmount,
|
|
@@ -24,8 +23,6 @@ export default function (request, context) {
|
|
|
24
23
|
selectedUserBank: null,
|
|
25
24
|
userAccountNumber: null,
|
|
26
25
|
userAccountName: null,
|
|
27
|
-
userAccountBranchName: null,
|
|
28
|
-
userAccountBranchCode: null,
|
|
29
26
|
depositTime: null,
|
|
30
27
|
receipt: null,
|
|
31
28
|
|
|
@@ -82,12 +79,6 @@ export default function (request, context) {
|
|
|
82
79
|
SELECT_USER_BANK: {
|
|
83
80
|
actions: 'setUserBank',
|
|
84
81
|
},
|
|
85
|
-
INPUT_USER_ACCOUNT_BRANCH_NAME: {
|
|
86
|
-
actions: 'setUserAccountBranchName',
|
|
87
|
-
},
|
|
88
|
-
INPUT_USER_ACCOUNT_BRANCH_CODE: {
|
|
89
|
-
actions: 'setUserAccountBranchCode',
|
|
90
|
-
},
|
|
91
82
|
INPUT_USER_ACCOUNT_NUMBER: {
|
|
92
83
|
actions: 'setUserAccountNumber',
|
|
93
84
|
},
|
|
@@ -177,8 +168,6 @@ export default function (request, context) {
|
|
|
177
168
|
selectedUserBank: userBanks[0],
|
|
178
169
|
userAccountNumber: userBanks[0].accountNumber,
|
|
179
170
|
userAccountName: userBanks[0].holderName,
|
|
180
|
-
userAccountBranchName: userBanks[0].branch,
|
|
181
|
-
userAccountBranchCode: userBanks[0].branchCode,
|
|
182
171
|
}
|
|
183
172
|
}),
|
|
184
173
|
setHouseBank: assign((context, event) => {
|
|
@@ -205,23 +194,11 @@ export default function (request, context) {
|
|
|
205
194
|
}
|
|
206
195
|
}),
|
|
207
196
|
setUserBank: assign((context, event) => {
|
|
208
|
-
const { accountNumber, holderName
|
|
197
|
+
const { accountNumber, holderName } = event.data
|
|
209
198
|
return {
|
|
210
199
|
selectedUserBank: event.data,
|
|
211
200
|
userAccountNumber: accountNumber,
|
|
212
201
|
userAccountName: holderName,
|
|
213
|
-
userAccountBranchName: branch,
|
|
214
|
-
userAccountBranchCode: branchCode,
|
|
215
|
-
}
|
|
216
|
-
}),
|
|
217
|
-
setUserAccountBranchName: assign((context, event) => {
|
|
218
|
-
return {
|
|
219
|
-
userAccountBranchName: event.data,
|
|
220
|
-
}
|
|
221
|
-
}),
|
|
222
|
-
setUserAccountBranchCode: assign((context, event) => {
|
|
223
|
-
return {
|
|
224
|
-
userAccountBranchCode: event.data,
|
|
225
202
|
}
|
|
226
203
|
}),
|
|
227
204
|
setUserAccountNumber: assign((context, event) => {
|
|
@@ -267,15 +244,8 @@ export default function (request, context) {
|
|
|
267
244
|
return context.calculation
|
|
268
245
|
},
|
|
269
246
|
isSubmittable: (context, event) => {
|
|
270
|
-
const { selectedAmount, userAccountNumber, userAccountName,
|
|
271
|
-
|
|
272
|
-
const defaultCheck = selectedAmount && userAccountNumber && userAccountName && depositTime && receipt
|
|
273
|
-
|
|
274
|
-
if (branchCodeEnable === '1') {
|
|
275
|
-
return defaultCheck && userAccountBranchCode
|
|
276
|
-
} else {
|
|
277
|
-
return defaultCheck
|
|
278
|
-
}
|
|
247
|
+
const { selectedAmount, userAccountNumber, userAccountName, depositTime, receipt } = context
|
|
248
|
+
return selectedAmount && userAccountNumber && userAccountName && depositTime && receipt
|
|
279
249
|
},
|
|
280
250
|
isProcessing: (context, event) => {
|
|
281
251
|
return context.processing
|
|
@@ -314,19 +284,8 @@ export default function (request, context) {
|
|
|
314
284
|
)
|
|
315
285
|
},
|
|
316
286
|
submitDeposit: async (context, event) => {
|
|
317
|
-
const {
|
|
318
|
-
|
|
319
|
-
selectedAmount,
|
|
320
|
-
selectedHouseBank,
|
|
321
|
-
selectedUserBank,
|
|
322
|
-
userAccountNumber,
|
|
323
|
-
userAccountName,
|
|
324
|
-
userAccountBranchName,
|
|
325
|
-
userAccountBranchCode,
|
|
326
|
-
depositTime,
|
|
327
|
-
receipt,
|
|
328
|
-
promotion,
|
|
329
|
-
} = context
|
|
287
|
+
const { method, selectedAmount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt, promotion } =
|
|
288
|
+
context
|
|
330
289
|
return await request.send(
|
|
331
290
|
payment.submitDepositTransactionBank({
|
|
332
291
|
method,
|
|
@@ -336,8 +295,6 @@ export default function (request, context) {
|
|
|
336
295
|
applyerBankCode: selectedUserBank.bankCode,
|
|
337
296
|
applyerAccountNumber: userAccountNumber,
|
|
338
297
|
applyerHolderName: userAccountName,
|
|
339
|
-
applyerBranchName: userAccountBranchName,
|
|
340
|
-
applyerBranchCode: userAccountBranchCode,
|
|
341
298
|
depositTime,
|
|
342
299
|
receipt,
|
|
343
300
|
promotionsNo: promotion?.promotionsNo,
|
|
@@ -21,8 +21,6 @@ export default function (request) {
|
|
|
21
21
|
selectedUserBank: null,
|
|
22
22
|
userAccountNumber: null,
|
|
23
23
|
userAccountName: null,
|
|
24
|
-
userAccountBranchName: null,
|
|
25
|
-
userAccountBranchCode: null,
|
|
26
24
|
depositTime: null,
|
|
27
25
|
receipt: null,
|
|
28
26
|
|
|
@@ -202,12 +200,6 @@ export default function (request) {
|
|
|
202
200
|
SELECT_USER_BANK: {
|
|
203
201
|
actions: 'setUserBank',
|
|
204
202
|
},
|
|
205
|
-
INPUT_USER_ACCOUNT_BRANCH_NAME: {
|
|
206
|
-
actions: 'setUserAccountBranchName',
|
|
207
|
-
},
|
|
208
|
-
INPUT_USER_ACCOUNT_BRANCH_CODE: {
|
|
209
|
-
actions: 'setUserAccountBranchCode',
|
|
210
|
-
},
|
|
211
203
|
INPUT_USER_ACCOUNT_NUMBER: {
|
|
212
204
|
actions: 'setUserAccountNumber',
|
|
213
205
|
},
|
|
@@ -286,8 +278,6 @@ export default function (request) {
|
|
|
286
278
|
selectedUserBank: userBanks[0],
|
|
287
279
|
userAccountNumber: userBanks[0].accountNumber,
|
|
288
280
|
userAccountName: userBanks[0].holderName,
|
|
289
|
-
userAccountBranchName: userBanks[0].branch,
|
|
290
|
-
userAccountBranchCode: userBanks[0].branchCode,
|
|
291
281
|
}
|
|
292
282
|
}),
|
|
293
283
|
setHouseBank: assign((context, event) => {
|
|
@@ -316,23 +306,11 @@ export default function (request) {
|
|
|
316
306
|
}
|
|
317
307
|
}),
|
|
318
308
|
setUserBank: assign((context, event) => {
|
|
319
|
-
const { accountNumber, holderName
|
|
309
|
+
const { accountNumber, holderName } = event.data
|
|
320
310
|
return {
|
|
321
311
|
selectedUserBank: event.data,
|
|
322
312
|
userAccountNumber: accountNumber,
|
|
323
313
|
userAccountName: holderName,
|
|
324
|
-
userAccountBranchName: branch,
|
|
325
|
-
userAccountBranchCode: branchCode,
|
|
326
|
-
}
|
|
327
|
-
}),
|
|
328
|
-
setUserAccountBranchName: assign((context, event) => {
|
|
329
|
-
return {
|
|
330
|
-
userAccountBranchName: event.data,
|
|
331
|
-
}
|
|
332
|
-
}),
|
|
333
|
-
setUserAccountBranchCode: assign((context, event) => {
|
|
334
|
-
return {
|
|
335
|
-
userAccountBranchCode: event.data,
|
|
336
314
|
}
|
|
337
315
|
}),
|
|
338
316
|
setUserAccountNumber: assign((context, event) => {
|
|
@@ -381,14 +359,8 @@ export default function (request) {
|
|
|
381
359
|
return context.calculation
|
|
382
360
|
},
|
|
383
361
|
isSubmittable: (context, event) => {
|
|
384
|
-
const { amount, userAccountNumber, userAccountName,
|
|
385
|
-
|
|
386
|
-
const defaultCheck = amount && userAccountNumber && userAccountName && depositTime && receipt
|
|
387
|
-
if (branchCodeEnable === '1') {
|
|
388
|
-
return defaultCheck && userAccountBranchCode
|
|
389
|
-
} else {
|
|
390
|
-
return defaultCheck
|
|
391
|
-
}
|
|
362
|
+
const { amount, userAccountNumber, userAccountName, depositTime, receipt } = context
|
|
363
|
+
return amount && userAccountNumber && userAccountName && depositTime && receipt
|
|
392
364
|
},
|
|
393
365
|
isProcessing: (context, event) => {
|
|
394
366
|
return context.processing
|
|
@@ -426,19 +398,7 @@ export default function (request) {
|
|
|
426
398
|
)
|
|
427
399
|
},
|
|
428
400
|
submitDeposit: async (context, event) => {
|
|
429
|
-
const {
|
|
430
|
-
method,
|
|
431
|
-
amount,
|
|
432
|
-
selectedHouseBank,
|
|
433
|
-
selectedUserBank,
|
|
434
|
-
userAccountNumber,
|
|
435
|
-
userAccountName,
|
|
436
|
-
userAccountBranchName,
|
|
437
|
-
userAccountBranchCode,
|
|
438
|
-
depositTime,
|
|
439
|
-
receipt,
|
|
440
|
-
promotion,
|
|
441
|
-
} = context
|
|
401
|
+
const { method, amount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt, promotion } = context
|
|
442
402
|
return await request.send(
|
|
443
403
|
payment.submitDepositTransactionBank({
|
|
444
404
|
method,
|
|
@@ -448,8 +408,6 @@ export default function (request) {
|
|
|
448
408
|
applyerBankCode: selectedUserBank.bankCode,
|
|
449
409
|
applyerAccountNumber: userAccountNumber,
|
|
450
410
|
applyerHolderName: userAccountName,
|
|
451
|
-
applyerBranchName: userAccountBranchName,
|
|
452
|
-
applyerBranchCode: userAccountBranchCode,
|
|
453
411
|
depositTime,
|
|
454
412
|
receipt,
|
|
455
413
|
promotionsNo: promotion?.activityNo,
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -143,11 +143,11 @@ export default function (request) {
|
|
|
143
143
|
src: 'disconnectGame',
|
|
144
144
|
onDone: {
|
|
145
145
|
target: 'idle',
|
|
146
|
-
|
|
146
|
+
actions: 'setGameURL',
|
|
147
147
|
},
|
|
148
148
|
onError: {
|
|
149
149
|
target: 'idle',
|
|
150
|
-
|
|
150
|
+
actions: 'setGameURL',
|
|
151
151
|
},
|
|
152
152
|
},
|
|
153
153
|
},
|
package/src/machine/inbox.js
CHANGED
|
@@ -3,25 +3,13 @@ import mailbox from '../api/mailbox.js'
|
|
|
3
3
|
import activity from '../api/activity.js'
|
|
4
4
|
|
|
5
5
|
const messageState = {
|
|
6
|
+
// always: [{ actions: 'showUnread', cond: 'isShowUnread' }],
|
|
6
7
|
initial: 'idle',
|
|
7
8
|
states: {
|
|
8
9
|
idle: {
|
|
9
10
|
initial: 'hidden',
|
|
10
11
|
states: {
|
|
11
12
|
hidden: {},
|
|
12
|
-
delecting: {
|
|
13
|
-
invoke: {
|
|
14
|
-
src: 'deleteMessages',
|
|
15
|
-
onDone: {
|
|
16
|
-
target: 'delected',
|
|
17
|
-
actions: 'removeMessage',
|
|
18
|
-
},
|
|
19
|
-
onError: {
|
|
20
|
-
target: 'hidden',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
delected: {},
|
|
25
13
|
shown: {
|
|
26
14
|
on: {
|
|
27
15
|
HIDE_MESSAGE: {
|
|
@@ -33,20 +21,6 @@ const messageState = {
|
|
|
33
21
|
},
|
|
34
22
|
on: {
|
|
35
23
|
SHOW_MESSAGE: [
|
|
36
|
-
{
|
|
37
|
-
target: 'fetchingCustomerMessage',
|
|
38
|
-
actions: 'showMessage',
|
|
39
|
-
cond: (context, event) => {
|
|
40
|
-
const { currentTab } = context
|
|
41
|
-
const { category, isRead } = event.data
|
|
42
|
-
return currentTab === 'CUSTOMER' && category === 'DEPOSIT' && isRead
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
target: 'updating',
|
|
47
|
-
actions: ['showMessage', 'setMessageIsRead'],
|
|
48
|
-
cond: 'isAccountInquiry',
|
|
49
|
-
},
|
|
50
24
|
{
|
|
51
25
|
target: '.shown',
|
|
52
26
|
actions: 'showMessage',
|
|
@@ -57,35 +31,19 @@ const messageState = {
|
|
|
57
31
|
actions: ['showMessage', 'setMessageIsRead'],
|
|
58
32
|
},
|
|
59
33
|
],
|
|
60
|
-
SELECT_MESSAGES: {
|
|
61
|
-
actions: ['selectMessages', 'setDelectMessages'],
|
|
62
|
-
},
|
|
63
|
-
DELETE_MESSAGES: {
|
|
64
|
-
target: '.delecting',
|
|
65
|
-
},
|
|
66
34
|
},
|
|
67
35
|
},
|
|
68
|
-
|
|
36
|
+
updating: {
|
|
69
37
|
invoke: {
|
|
70
|
-
src: '
|
|
38
|
+
src: 'updateMessageIsRead',
|
|
71
39
|
onDone: {
|
|
72
40
|
target: 'idle.shown',
|
|
73
|
-
actions: 'setCustomerMessage',
|
|
74
41
|
},
|
|
75
42
|
onError: {
|
|
76
43
|
target: 'idle.shown',
|
|
77
44
|
},
|
|
78
45
|
},
|
|
79
46
|
},
|
|
80
|
-
updating: {
|
|
81
|
-
invoke: {
|
|
82
|
-
src: 'updateMessageIsRead',
|
|
83
|
-
onDone: [{ target: 'fetchingCustomerMessage', cond: 'isAccountInquiry' }, { target: 'idle.shown' }],
|
|
84
|
-
onError: {
|
|
85
|
-
target: 'idle.shown',
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
47
|
},
|
|
90
48
|
}
|
|
91
49
|
|
|
@@ -101,10 +59,7 @@ export default function (request) {
|
|
|
101
59
|
currentTab: null,
|
|
102
60
|
inbox: {},
|
|
103
61
|
messageDetail: null,
|
|
104
|
-
|
|
105
|
-
selectedDeleteMessages: null,
|
|
106
|
-
messageTitle: '',
|
|
107
|
-
messageContent: '',
|
|
62
|
+
// isShowUnread: false,
|
|
108
63
|
},
|
|
109
64
|
states: {
|
|
110
65
|
loading: {
|
|
@@ -150,61 +105,15 @@ export default function (request) {
|
|
|
150
105
|
},
|
|
151
106
|
},
|
|
152
107
|
},
|
|
153
|
-
inquiring: {
|
|
154
|
-
invoke: {
|
|
155
|
-
src: 'accountInquiry',
|
|
156
|
-
onDone: {
|
|
157
|
-
target: 'inquired',
|
|
158
|
-
},
|
|
159
|
-
onError: {
|
|
160
|
-
target: 'failed',
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
inquired: {
|
|
165
|
-
after: {
|
|
166
|
-
0: {
|
|
167
|
-
target: 'reloadMessages',
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
reloadMessages: {
|
|
172
|
-
invoke: {
|
|
173
|
-
src: 'reFetchMessages',
|
|
174
|
-
onDone: {
|
|
175
|
-
target: 'more',
|
|
176
|
-
actions: 'setInbox',
|
|
177
|
-
},
|
|
178
|
-
onError: {
|
|
179
|
-
target: 'end',
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
108
|
end: {
|
|
184
109
|
...messageState,
|
|
185
110
|
},
|
|
186
|
-
sending: {
|
|
187
|
-
invoke: {
|
|
188
|
-
src: 'sendMessage',
|
|
189
|
-
onDone: {
|
|
190
|
-
target: 'sended',
|
|
191
|
-
},
|
|
192
|
-
onError: {
|
|
193
|
-
target: 'end',
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
sended: {
|
|
198
|
-
after: {
|
|
199
|
-
0: {
|
|
200
|
-
target: 'reloadMessages',
|
|
201
|
-
actions: 'hideMessage',
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
111
|
failed: {},
|
|
206
112
|
},
|
|
207
113
|
on: {
|
|
114
|
+
// SHOW_SYSTEM_MESSAGE: {
|
|
115
|
+
// actions: 'showSystemMessage',
|
|
116
|
+
// },
|
|
208
117
|
SET_TAB: {
|
|
209
118
|
target: '.checking',
|
|
210
119
|
actions: ['setCurrentTab', 'hideMessage'],
|
|
@@ -217,20 +126,6 @@ export default function (request) {
|
|
|
217
126
|
target: '.loading',
|
|
218
127
|
actions: 'reset',
|
|
219
128
|
},
|
|
220
|
-
INQUIRY_ACCOUNT: {
|
|
221
|
-
target: '.inquiring',
|
|
222
|
-
actions: 'resetPage',
|
|
223
|
-
},
|
|
224
|
-
SET_TITLE: {
|
|
225
|
-
actions: 'setMessageTitle',
|
|
226
|
-
},
|
|
227
|
-
SET_CONTENT: {
|
|
228
|
-
actions: 'setMessageContent',
|
|
229
|
-
},
|
|
230
|
-
SEND_MESSAGE: {
|
|
231
|
-
target: '.sending',
|
|
232
|
-
cond: 'isSendable',
|
|
233
|
-
},
|
|
234
129
|
},
|
|
235
130
|
},
|
|
236
131
|
{
|
|
@@ -250,31 +145,19 @@ export default function (request) {
|
|
|
250
145
|
isRead: (context, event) => {
|
|
251
146
|
return event.data.isRead
|
|
252
147
|
},
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
},
|
|
257
|
-
isSendable: (context, event) => {
|
|
258
|
-
const { messageTitle, messageContent } = context
|
|
259
|
-
return !!messageTitle && !!messageContent
|
|
260
|
-
},
|
|
148
|
+
// isShowUnread: (context, event) => {
|
|
149
|
+
// return context.isShowUnread
|
|
150
|
+
// },
|
|
261
151
|
},
|
|
262
152
|
actions: {
|
|
263
153
|
reset: assign((context, event) => {
|
|
264
154
|
return {
|
|
155
|
+
tabs: [],
|
|
265
156
|
currentTab: null,
|
|
266
157
|
inbox: {},
|
|
267
158
|
messageDetail: null,
|
|
268
159
|
}
|
|
269
160
|
}),
|
|
270
|
-
resetPage: assign((context, event) => {
|
|
271
|
-
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
272
|
-
inbox[currentTab].page = -1
|
|
273
|
-
return {
|
|
274
|
-
inbox,
|
|
275
|
-
messageDetail: null,
|
|
276
|
-
}
|
|
277
|
-
}),
|
|
278
161
|
setTabs: assign((context, event) => {
|
|
279
162
|
let { currentTab } = context
|
|
280
163
|
if (!currentTab) {
|
|
@@ -290,37 +173,9 @@ export default function (request) {
|
|
|
290
173
|
currentTab: event.data,
|
|
291
174
|
}
|
|
292
175
|
}),
|
|
293
|
-
selectMessages: assign((context, event) => {
|
|
294
|
-
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
295
|
-
const data = inbox[currentTab].data.map((item) => {
|
|
296
|
-
if (item.groupId === event.data.groupId) {
|
|
297
|
-
item.isSelected = !item.isSelected
|
|
298
|
-
}
|
|
299
|
-
return item
|
|
300
|
-
})
|
|
301
|
-
inbox[currentTab].data = data
|
|
302
|
-
return { inbox }
|
|
303
|
-
}),
|
|
304
|
-
setDelectMessages: assign((context, event) => {
|
|
305
|
-
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
306
|
-
const selectedMessages = inbox[currentTab].data?.filter((item) => item.isSelected)
|
|
307
|
-
const groupIdsArray = selectedMessages?.map((item) => item.groupId)
|
|
308
|
-
const groupIds = groupIdsArray?.join(',')
|
|
309
|
-
return {
|
|
310
|
-
selectedDeleteMessages: groupIds,
|
|
311
|
-
}
|
|
312
|
-
}),
|
|
313
|
-
setCustomerMessage: assign((context, event) => {
|
|
314
|
-
return {
|
|
315
|
-
messageDetail: event.data?.data,
|
|
316
|
-
}
|
|
317
|
-
}),
|
|
318
176
|
showMessage: assign((context, event) => {
|
|
319
|
-
const { title, content } = event.data
|
|
320
177
|
return {
|
|
321
178
|
messageDetail: event.data,
|
|
322
|
-
messageTitle: title,
|
|
323
|
-
messageContent: content,
|
|
324
179
|
}
|
|
325
180
|
}),
|
|
326
181
|
hideMessage: assign((context, event) => {
|
|
@@ -328,18 +183,19 @@ export default function (request) {
|
|
|
328
183
|
messageDetail: null,
|
|
329
184
|
}
|
|
330
185
|
}),
|
|
331
|
-
removeMessage: assign((context, event) => {
|
|
332
|
-
const groupIds = event.data
|
|
333
|
-
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
334
|
-
const data = inbox[currentTab].data.filter((item) => !groupIds.find((groupId) => groupId === item.groupId))
|
|
335
|
-
inbox[currentTab].data = data
|
|
336
|
-
return { inbox }
|
|
337
|
-
}),
|
|
338
186
|
setInbox: assign((context, event) => {
|
|
339
187
|
return {
|
|
340
188
|
inbox: event.data,
|
|
341
189
|
}
|
|
342
190
|
}),
|
|
191
|
+
// showUnread: assign((context, event) => {
|
|
192
|
+
// const { currentTab, inbox } = context
|
|
193
|
+
// const messageDetail = inbox[currentTab]?.data.find((item) => !item.isRead)
|
|
194
|
+
// return {
|
|
195
|
+
// messageDetail,
|
|
196
|
+
// isShowUnread: false,
|
|
197
|
+
// }
|
|
198
|
+
// }),
|
|
343
199
|
setMessageIsRead: assign((context, event) => {
|
|
344
200
|
const { inbox, currentTab } = JSON.parse(JSON.stringify(context))
|
|
345
201
|
const data = inbox[currentTab].data.map((item) => {
|
|
@@ -351,16 +207,12 @@ export default function (request) {
|
|
|
351
207
|
inbox[currentTab].data = data
|
|
352
208
|
return { inbox }
|
|
353
209
|
}),
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
return {
|
|
361
|
-
messageContent: event.data,
|
|
362
|
-
}
|
|
363
|
-
}),
|
|
210
|
+
// showSystemMessage: assign((context, event) => {
|
|
211
|
+
// return {
|
|
212
|
+
// currentTab: 'SYSTEM',
|
|
213
|
+
// isShowUnread: true,
|
|
214
|
+
// }
|
|
215
|
+
// }),
|
|
364
216
|
},
|
|
365
217
|
services: {
|
|
366
218
|
fetchTabs: async (context, event) => {
|
|
@@ -369,65 +221,24 @@ export default function (request) {
|
|
|
369
221
|
return tabs
|
|
370
222
|
},
|
|
371
223
|
fetchMessages: async (context, event) => {
|
|
372
|
-
const { isRewardListEnable, currentTab, inbox
|
|
224
|
+
const { isRewardListEnable, currentTab, inbox } = JSON.parse(JSON.stringify(context))
|
|
373
225
|
if (isRewardListEnable && (currentTab === 'REWARD' || currentTab === 'DIAMOND')) {
|
|
374
226
|
const { data } = await request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
375
227
|
inbox[currentTab] = { data, page: 0, totalPage: 1 }
|
|
376
228
|
} else {
|
|
377
229
|
const { page = -1 } = inbox[currentTab] || {}
|
|
378
|
-
const
|
|
379
|
-
const
|
|
230
|
+
const nextPage = page + 1
|
|
231
|
+
const { data, ...rest } = await request.send(mailbox.getMessageList({ type: currentTab, page: nextPage }))
|
|
380
232
|
const currentData = inbox[currentTab]?.data || []
|
|
381
|
-
inbox[currentTab] = { data: currentData.concat(
|
|
233
|
+
inbox[currentTab] = { data: currentData.concat(data), ...rest }
|
|
382
234
|
}
|
|
383
235
|
return inbox
|
|
384
236
|
},
|
|
385
|
-
reFetchMessages: async (context, event) => {
|
|
386
|
-
const { currentTab, inbox } = JSON.parse(JSON.stringify(context))
|
|
387
|
-
const { data, ...rest } = await request.send(mailbox.getMessageList({ type: currentTab, page: 0 }))
|
|
388
|
-
let formattedData = []
|
|
389
|
-
formattedData = data?.map((item) => ({ ...item, isSelected: false }))
|
|
390
|
-
inbox[currentTab] = { data: formattedData, ...rest }
|
|
391
|
-
return inbox
|
|
392
|
-
},
|
|
393
237
|
updateMessageIsRead: async (context, event) => {
|
|
394
|
-
const {
|
|
395
|
-
request.send(mailbox.updateMessage({ groupId:
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
deleteMessages: async (context, event) => {
|
|
399
|
-
const { selectedDeleteMessages } = context
|
|
400
|
-
const { groupId = '' } = await request.send(mailbox.updateMessage({ groupId: selectedDeleteMessages, isDelete: true }))
|
|
401
|
-
return groupId.split(',')
|
|
402
|
-
},
|
|
403
|
-
accountInquiry: async (context, event) => {
|
|
404
|
-
const { from, title, content } = event.data
|
|
405
|
-
return await request.send(mailbox.sendMessage({ type: 'CUSTOMER', category: 'DEPOSIT', from, to: 'SYSTEM', title, content }))
|
|
406
|
-
},
|
|
407
|
-
getMessage: async (context, event) => {
|
|
408
|
-
const { messageDetail } = context
|
|
409
|
-
return await request.send(mailbox.getMessage({ groupId: messageDetail.groupId }))
|
|
410
|
-
},
|
|
411
|
-
sendMessage: async (context, event) => {
|
|
412
|
-
const { messageDetail, messageTitle, messageContent } = context
|
|
413
|
-
const { from, type } = event.data
|
|
414
|
-
if (type === 'REPLY') {
|
|
415
|
-
return await request.send(
|
|
416
|
-
mailbox.sendMessage({
|
|
417
|
-
groupId: messageDetail.groupId,
|
|
418
|
-
type: 'CUSTOMER',
|
|
419
|
-
category: 'MAIL',
|
|
420
|
-
from,
|
|
421
|
-
to: 'SYSTEM',
|
|
422
|
-
title: messageTitle,
|
|
423
|
-
content: messageContent,
|
|
424
|
-
})
|
|
425
|
-
)
|
|
426
|
-
} else {
|
|
427
|
-
return await request.send(
|
|
428
|
-
mailbox.sendMessage({ type: 'CUSTOMER', category: 'MAIL', from, to: 'SYSTEM', title: messageTitle, content: messageContent })
|
|
429
|
-
)
|
|
430
|
-
}
|
|
238
|
+
const { data } = event
|
|
239
|
+
request.send(mailbox.updateMessage({ groupId: data.groupId, isRead: true }))
|
|
240
|
+
data.isRead = true
|
|
241
|
+
return data
|
|
431
242
|
},
|
|
432
243
|
},
|
|
433
244
|
}
|
|
@@ -28,17 +28,13 @@ export default function (request) {
|
|
|
28
28
|
states: {
|
|
29
29
|
idle: {
|
|
30
30
|
on: {
|
|
31
|
-
SIGN_UP_ID: {
|
|
32
|
-
target: 'authentication',
|
|
33
|
-
actions: ['setReCaptchaToken', 'setFriendCode', 'setSignUpId'],
|
|
34
|
-
},
|
|
35
31
|
SIGN_UP_PHONE: {
|
|
36
32
|
target: 'authentication',
|
|
37
|
-
actions: ['setReCaptchaToken', '
|
|
33
|
+
actions: ['setReCaptchaToken', 'setAffiliate', 'setSignUpPhone'],
|
|
38
34
|
},
|
|
39
35
|
SIGN_UP_EMAIL: {
|
|
40
36
|
target: 'authentication',
|
|
41
|
-
actions: ['setReCaptchaToken', '
|
|
37
|
+
actions: ['setReCaptchaToken', 'setAffiliate', 'setSignUpEmail'],
|
|
42
38
|
},
|
|
43
39
|
},
|
|
44
40
|
},
|
|
@@ -70,76 +66,32 @@ export default function (request) {
|
|
|
70
66
|
reCaptchaToken,
|
|
71
67
|
}
|
|
72
68
|
}),
|
|
73
|
-
|
|
69
|
+
setAffiliate: assign((context, event) => {
|
|
74
70
|
const { fc } = event.data
|
|
75
|
-
return { fc }
|
|
76
|
-
}),
|
|
77
|
-
setSignUpId: assign((context, event) => {
|
|
78
|
-
const {
|
|
79
|
-
username,
|
|
80
|
-
password,
|
|
81
|
-
countryCode,
|
|
82
|
-
phone,
|
|
83
|
-
channel,
|
|
84
|
-
subchannel,
|
|
85
|
-
bankCode,
|
|
86
|
-
bankAccount,
|
|
87
|
-
holderName,
|
|
88
|
-
branch,
|
|
89
|
-
branchCode,
|
|
90
|
-
affiliateCode,
|
|
91
|
-
} = event.data
|
|
92
71
|
return {
|
|
93
|
-
|
|
94
|
-
provider: 'local',
|
|
95
|
-
username,
|
|
96
|
-
password,
|
|
97
|
-
countryCode,
|
|
98
|
-
phone,
|
|
99
|
-
bankCode,
|
|
100
|
-
bankAccount,
|
|
101
|
-
holderName,
|
|
102
|
-
branch,
|
|
103
|
-
branchCode,
|
|
104
|
-
affiliateCode,
|
|
105
|
-
},
|
|
106
|
-
channel,
|
|
107
|
-
subchannel,
|
|
72
|
+
fc,
|
|
108
73
|
}
|
|
109
74
|
}),
|
|
110
75
|
setSignUpPhone: assign((context, event) => {
|
|
111
|
-
const { countryCode, phone, password, channel, subchannel
|
|
112
|
-
event.data
|
|
76
|
+
const { countryCode, phone, password, channel, subchannel } = event.data
|
|
113
77
|
return {
|
|
114
78
|
signUpData: {
|
|
115
79
|
provider: 'phone',
|
|
116
80
|
countryCode,
|
|
117
81
|
phone,
|
|
118
82
|
password,
|
|
119
|
-
bankCode,
|
|
120
|
-
bankAccount,
|
|
121
|
-
holderName,
|
|
122
|
-
branch,
|
|
123
|
-
branchCode,
|
|
124
|
-
affiliateCode,
|
|
125
83
|
},
|
|
126
84
|
channel,
|
|
127
85
|
subchannel,
|
|
128
86
|
}
|
|
129
87
|
}),
|
|
130
88
|
setSignUpEmail: assign((context, event) => {
|
|
131
|
-
const { email, password, channel, subchannel
|
|
89
|
+
const { email, password, channel, subchannel } = event.data
|
|
132
90
|
return {
|
|
133
91
|
signUpData: {
|
|
134
92
|
provider: 'email',
|
|
135
93
|
email,
|
|
136
94
|
password,
|
|
137
|
-
bankCode,
|
|
138
|
-
bankAccount,
|
|
139
|
-
holderName,
|
|
140
|
-
branch,
|
|
141
|
-
branchCode,
|
|
142
|
-
affiliateCode,
|
|
143
95
|
},
|
|
144
96
|
channel,
|
|
145
97
|
subchannel,
|
|
@@ -170,7 +122,7 @@ export default function (request) {
|
|
|
170
122
|
const { channel, subchannel, signUpData, deviceTokenEnable } = context
|
|
171
123
|
const dt = await getDeviceToken({ fpToken, sentry, hosts: request.hosts, enable: deviceTokenEnable })
|
|
172
124
|
|
|
173
|
-
const affiliateCode = storage.get('ac')
|
|
125
|
+
const affiliateCode = storage.get('ac')
|
|
174
126
|
const messages = {
|
|
175
127
|
url: window.location.href,
|
|
176
128
|
channelOrders: [
|
|
@@ -4,7 +4,6 @@ import withdraw_vn2 from './withdraw_vn2.js'
|
|
|
4
4
|
import withdraw_crypto from './withdraw_crypto.js'
|
|
5
5
|
import withdraw_crypto2 from './withdraw_crypto2.js'
|
|
6
6
|
import withdraw_amb from './withdraw_amb.js'
|
|
7
|
-
import withdraw_krway from './withdraw_krway.js'
|
|
8
7
|
import withdraw_crypto_cash from './withdraw_crypto_cash.js'
|
|
9
8
|
import withdraw_manual_cash from './withdraw_manual_cash.js'
|
|
10
9
|
|
|
@@ -15,7 +14,6 @@ export default {
|
|
|
15
14
|
withdraw_crypto,
|
|
16
15
|
withdraw_crypto2,
|
|
17
16
|
withdraw_amb,
|
|
18
|
-
withdraw_krway,
|
|
19
17
|
withdraw_crypto_cash,
|
|
20
18
|
withdraw_manual_cash,
|
|
21
19
|
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import payment from '../../api/payment.js'
|
|
3
|
-
import mailbox from '../../api/mailbox.js'
|
|
4
|
-
|
|
5
|
-
export default function (request) {
|
|
6
|
-
return createMachine(
|
|
7
|
-
{
|
|
8
|
-
id: 'krway',
|
|
9
|
-
initial: 'loading',
|
|
10
|
-
context: {
|
|
11
|
-
currentCategory: 'krway',
|
|
12
|
-
paymentDetail: [],
|
|
13
|
-
currentPayment: null,
|
|
14
|
-
options: [],
|
|
15
|
-
amount: null,
|
|
16
|
-
processing: null,
|
|
17
|
-
},
|
|
18
|
-
states: {
|
|
19
|
-
loading: {
|
|
20
|
-
invoke: {
|
|
21
|
-
src: 'fetchPaymentDetail',
|
|
22
|
-
onDone: {
|
|
23
|
-
target: 'checking',
|
|
24
|
-
actions: 'setPaymentDetail',
|
|
25
|
-
},
|
|
26
|
-
onError: {
|
|
27
|
-
target: 'fail',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
checking: {
|
|
32
|
-
always: [
|
|
33
|
-
{
|
|
34
|
-
target: 'processing',
|
|
35
|
-
cond: 'isProcessing',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
target: 'idle',
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
processing: {},
|
|
43
|
-
idle: {},
|
|
44
|
-
inquiring: {
|
|
45
|
-
invoke: {
|
|
46
|
-
src: 'accountInquiry',
|
|
47
|
-
onDone: {
|
|
48
|
-
target: 'inquired',
|
|
49
|
-
},
|
|
50
|
-
onError: {
|
|
51
|
-
target: 'idle',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
inquired: {
|
|
56
|
-
after: {
|
|
57
|
-
0: {
|
|
58
|
-
target: 'idle',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
submitting: {
|
|
63
|
-
invoke: {
|
|
64
|
-
src: 'submitDeposit',
|
|
65
|
-
onDone: {
|
|
66
|
-
target: 'submitted',
|
|
67
|
-
actions: 'setProcessing',
|
|
68
|
-
},
|
|
69
|
-
onError: {
|
|
70
|
-
target: 'fail',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
submitted: {},
|
|
75
|
-
fail: {},
|
|
76
|
-
},
|
|
77
|
-
on: {
|
|
78
|
-
INQUIRY_ACCOUNT: {
|
|
79
|
-
target: 'inquiring',
|
|
80
|
-
},
|
|
81
|
-
ADD_AMOUNT: {
|
|
82
|
-
actions: 'addAmount',
|
|
83
|
-
},
|
|
84
|
-
SET_AMOUNT: {
|
|
85
|
-
actions: 'setAmount',
|
|
86
|
-
},
|
|
87
|
-
CLEAR_AMOUNT: {
|
|
88
|
-
actions: 'clearAmount',
|
|
89
|
-
},
|
|
90
|
-
SUBMIT: {
|
|
91
|
-
target: 'submitting',
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
actions: {
|
|
97
|
-
setPaymentDetail: assign((context, event) => {
|
|
98
|
-
const paymentDetail = event.data
|
|
99
|
-
const payments = paymentDetail.filter((item) => item.category === context.currentCategory)
|
|
100
|
-
const currentPayment = payments[0]
|
|
101
|
-
const options = currentPayment.optional || []
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
currentPayment,
|
|
105
|
-
options,
|
|
106
|
-
processing: currentPayment.processing?.[0],
|
|
107
|
-
}
|
|
108
|
-
}),
|
|
109
|
-
addAmount: assign((context, event) => {
|
|
110
|
-
return {
|
|
111
|
-
amount: parseFloat(`${context.amount || 0}`) + parseFloat(`${event.data}`),
|
|
112
|
-
}
|
|
113
|
-
}),
|
|
114
|
-
setAmount: assign((context, event) => {
|
|
115
|
-
return { amount: parseFloat(`${event.data}`) }
|
|
116
|
-
}),
|
|
117
|
-
clearAmount: assign((context, event) => {
|
|
118
|
-
return { amount: null }
|
|
119
|
-
}),
|
|
120
|
-
setProcessing: assign((context, event) => {
|
|
121
|
-
return {
|
|
122
|
-
processing: event.data,
|
|
123
|
-
}
|
|
124
|
-
}),
|
|
125
|
-
},
|
|
126
|
-
guards: {
|
|
127
|
-
isProcessing: (context, event) => {
|
|
128
|
-
return context.processing
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
services: {
|
|
132
|
-
fetchPaymentDetail: async (context, event) => {
|
|
133
|
-
return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
|
|
134
|
-
},
|
|
135
|
-
accountInquiry: async (context, event) => {
|
|
136
|
-
const { from, title, content } = event.data
|
|
137
|
-
return await request.send(mailbox.sendMessage({ type: 'CUSTOMER', category: 'DEPOSIT', from, to: 'SYSTEM', title, content }))
|
|
138
|
-
},
|
|
139
|
-
submitDeposit: async (context, event) => {
|
|
140
|
-
const { currentPayment, amount } = context
|
|
141
|
-
return await request.send(
|
|
142
|
-
payment.submitDepositTransaction({
|
|
143
|
-
method: currentPayment.method,
|
|
144
|
-
amount,
|
|
145
|
-
})
|
|
146
|
-
)
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
}
|
|
150
|
-
)
|
|
151
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import findLastIndex from 'lodash/findLastIndex.js'
|
|
3
|
-
import payment from '../../api/payment.js'
|
|
4
|
-
import user from '../../api/user.js'
|
|
5
|
-
|
|
6
|
-
export default function (request) {
|
|
7
|
-
const { appSecret } = request.config
|
|
8
|
-
return createMachine(
|
|
9
|
-
{
|
|
10
|
-
id: 'withdraw_krway',
|
|
11
|
-
initial: 'loading',
|
|
12
|
-
context: {
|
|
13
|
-
userInfo: {},
|
|
14
|
-
paymentDetail: {},
|
|
15
|
-
minimum: 0,
|
|
16
|
-
maximum: 0,
|
|
17
|
-
options: [],
|
|
18
|
-
amount: 0,
|
|
19
|
-
bankInfo: [],
|
|
20
|
-
bank: null,
|
|
21
|
-
enableWithdraw: false,
|
|
22
|
-
applyId: '',
|
|
23
|
-
balance: 0,
|
|
24
|
-
realAmount: 0,
|
|
25
|
-
charge: 0,
|
|
26
|
-
},
|
|
27
|
-
states: {
|
|
28
|
-
loading: {
|
|
29
|
-
invoke: {
|
|
30
|
-
src: 'fetchPaymentDetail',
|
|
31
|
-
onDone: {
|
|
32
|
-
target: 'fetching',
|
|
33
|
-
actions: 'setPaymentData',
|
|
34
|
-
},
|
|
35
|
-
onError: {
|
|
36
|
-
target: 'fail',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
fetching: {
|
|
41
|
-
invoke: {
|
|
42
|
-
src: 'fetchWithdrawRules',
|
|
43
|
-
onDone: {
|
|
44
|
-
target: 'checking',
|
|
45
|
-
actions: 'updateWithdrawCondition',
|
|
46
|
-
},
|
|
47
|
-
onError: {
|
|
48
|
-
target: 'fail',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
checking: {
|
|
53
|
-
always: [
|
|
54
|
-
{ target: 'inProcessing', cond: 'haveProcessing' },
|
|
55
|
-
{ target: 'notWithdrawable', cond: 'isNotWithdrawable' },
|
|
56
|
-
{ target: 'withdrawable' },
|
|
57
|
-
],
|
|
58
|
-
},
|
|
59
|
-
inProcessing: {},
|
|
60
|
-
notWithdrawable: {},
|
|
61
|
-
withdrawable: {
|
|
62
|
-
on: {
|
|
63
|
-
ADD_AMOUNT: {
|
|
64
|
-
actions: 'addAmount',
|
|
65
|
-
},
|
|
66
|
-
SET_AMOUNT: {
|
|
67
|
-
actions: 'setAmount',
|
|
68
|
-
},
|
|
69
|
-
CLEAR_AMOUNT: {
|
|
70
|
-
actions: 'clearAmount',
|
|
71
|
-
},
|
|
72
|
-
SUBMIT: {
|
|
73
|
-
target: 'submitting',
|
|
74
|
-
cond: 'isSubmittable',
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
submitting: {
|
|
79
|
-
invoke: {
|
|
80
|
-
src: 'submitWithdraw',
|
|
81
|
-
onDone: {
|
|
82
|
-
target: 'submitted',
|
|
83
|
-
actions: 'setResult',
|
|
84
|
-
},
|
|
85
|
-
onError: {
|
|
86
|
-
target: 'withdrawable',
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
submitted: {
|
|
91
|
-
invoke: {
|
|
92
|
-
src: 'fetchPaymentDetail',
|
|
93
|
-
onDone: {
|
|
94
|
-
target: 'inProcessing',
|
|
95
|
-
actions: 'setPaymentData',
|
|
96
|
-
},
|
|
97
|
-
onError: {
|
|
98
|
-
target: 'fail',
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
fail: {},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
actions: {
|
|
107
|
-
setPaymentData: assign((context, event) => {
|
|
108
|
-
const { paymentDetail, bankInfo } = event.data
|
|
109
|
-
const { minimum, maximum, optional } = paymentDetail?.[0] || {}
|
|
110
|
-
return { paymentDetail, bank: bankInfo[0], minimum, maximum, options: optional }
|
|
111
|
-
}),
|
|
112
|
-
updateWithdrawCondition: assign((context, event) => {
|
|
113
|
-
const { enableWithdraw, balance } = event.data
|
|
114
|
-
return {
|
|
115
|
-
balance,
|
|
116
|
-
enableWithdraw,
|
|
117
|
-
}
|
|
118
|
-
}),
|
|
119
|
-
addAmount: assign((context, event) => {
|
|
120
|
-
return {
|
|
121
|
-
amount: parseFloat(`${context.amount || 0}`) + parseFloat(`${event.data}`),
|
|
122
|
-
}
|
|
123
|
-
}),
|
|
124
|
-
setAmount: assign((context, event) => {
|
|
125
|
-
return { amount: parseFloat(`${event.data}`) }
|
|
126
|
-
}),
|
|
127
|
-
clearAmount: assign((context, event) => {
|
|
128
|
-
return { amount: null }
|
|
129
|
-
}),
|
|
130
|
-
setResult: assign((context, event) => {
|
|
131
|
-
const { applyId, balance, realAmount, charge } = event.data
|
|
132
|
-
return { applyId, balance, realAmount, charge }
|
|
133
|
-
}),
|
|
134
|
-
},
|
|
135
|
-
guards: {
|
|
136
|
-
haveProcessing: (context, event) => {
|
|
137
|
-
return (context.paymentDetail?.[0]?.processing || []).length > 0
|
|
138
|
-
},
|
|
139
|
-
isSubmittable: (context, event) => {
|
|
140
|
-
const { amount } = context
|
|
141
|
-
return parseFloat(`${amount}`) > 0
|
|
142
|
-
},
|
|
143
|
-
isNotWithdrawable: (context, event) => {
|
|
144
|
-
const { balance, enableWithdraw, paymentDetail } = context
|
|
145
|
-
const minWithdrawAmount = paymentDetail[0]?.minimum || 0
|
|
146
|
-
return !enableWithdraw || balance < minWithdrawAmount
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
services: {
|
|
150
|
-
fetchPaymentDetail: async (context, event) => {
|
|
151
|
-
const [paymentDetail = [], { bankInfo }] = await Promise.all([
|
|
152
|
-
request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' })),
|
|
153
|
-
request.send(payment.getPaymentInfo()),
|
|
154
|
-
])
|
|
155
|
-
return { paymentDetail, bankInfo }
|
|
156
|
-
},
|
|
157
|
-
fetchWithdrawRules: async (context, event) => {
|
|
158
|
-
return await request.send(payment.getDoubleWalletWithdrawRule({ walletType: 'CASH' }))
|
|
159
|
-
},
|
|
160
|
-
submitWithdraw: async (context, event) => {
|
|
161
|
-
const { paymentDetail, amount, bank } = context
|
|
162
|
-
const { method } = paymentDetail[0]
|
|
163
|
-
return await request.send(
|
|
164
|
-
payment.submitWithdrawTransactionVN({
|
|
165
|
-
method,
|
|
166
|
-
amount,
|
|
167
|
-
applyerBankCode: bank.bankCode,
|
|
168
|
-
applyerAccountNumber: bank.accountNumber,
|
|
169
|
-
branch: bank.branch,
|
|
170
|
-
holderName: bank.holderName,
|
|
171
|
-
})
|
|
172
|
-
)
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
}
|
|
176
|
-
)
|
|
177
|
-
}
|