@jetthai/cuora 1.1.333-dev-4 → 1.1.333-dev-5
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 +2 -0
- package/package.json +1 -1
- package/src/api/common.js +1 -0
- package/src/machine/deposit/index.js +4 -0
- package/src/machine/deposit/virtual_bank_cash.js +201 -0
- package/src/machine/deposit/virtual_bank_vn.js +289 -0
- package/src/machine/withdraw/withdraw_krway.js +22 -20
- package/src/machine/withdraw/withdraw_manual.js +22 -22
- package/src/machine/withdraw/withdraw_vn.js +22 -20
- package/src/machine/withdraw/withdraw_vn2.js +22 -20
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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.333-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.333-dev-4...v1.1.333-dev-5) (2025-01-10)
|
|
6
|
+
|
|
5
7
|
### [1.1.333-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.333-dev-3...v1.1.333-dev-4) (2025-01-10)
|
|
6
8
|
|
|
7
9
|
### [1.1.333-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.333...v1.1.333-dev-3) (2025-01-10)
|
package/package.json
CHANGED
package/src/api/common.js
CHANGED
|
@@ -6,4 +6,5 @@ export default {
|
|
|
6
6
|
getAnnouncements: ({ appSecret }) => ({ url: 'getAnnouncements', params: { appSecret }, method: 'get', isPublic: true }),
|
|
7
7
|
getNavbar: ({ appSecret } = {}) => ({ url: 'getNavbarSetting', params: { appSecret }, method: 'get', isPublic: true }),
|
|
8
8
|
getDefaultAffiliateCode: ({ appSecret }) => ({ url: 'getAffiliateCode', params: { appSecret }, method: 'get', isPublic: true }),
|
|
9
|
+
getSiteInfoConfig: ({ appSecret, config }) => ({ url: 'get-site-config', method: 'get', params: { appSecret, config }, isPublic: true }),
|
|
9
10
|
}
|
|
@@ -22,6 +22,8 @@ import crypto_way from './crypto_way.js'
|
|
|
22
22
|
import crypto_bank_cash from './crypto_bank_cash.js'
|
|
23
23
|
import crypto_qrcode_cash from './crypto_qrcode_cash.js'
|
|
24
24
|
import crypto_way_cash from './crypto_way_cash.js'
|
|
25
|
+
import virtual_bank_vn from './virtual_bank_vn.js'
|
|
26
|
+
import virtual_bank_cash from './virtual_bank_cash.js'
|
|
25
27
|
|
|
26
28
|
export default {
|
|
27
29
|
manual_vn,
|
|
@@ -48,4 +50,6 @@ export default {
|
|
|
48
50
|
crypto_bank_cash,
|
|
49
51
|
crypto_qrcode_cash,
|
|
50
52
|
crypto_way_cash,
|
|
53
|
+
virtual_bank_vn,
|
|
54
|
+
virtual_bank_cash,
|
|
51
55
|
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { assign, createMachine } from 'xstate'
|
|
2
|
+
import payment from '@jetthai/cuora/src/api/payment.js'
|
|
3
|
+
import { max } from '@jetthai/cuora/src/util/index.js'
|
|
4
|
+
|
|
5
|
+
export default function (request, context) {
|
|
6
|
+
const { appSecret } = request.config
|
|
7
|
+
const { paymentDetail = [], promotion, selectedAmount, siteConfig = {} } = context || {}
|
|
8
|
+
|
|
9
|
+
return createMachine(
|
|
10
|
+
{
|
|
11
|
+
id: 'virtual_bank_cash',
|
|
12
|
+
initial: 'loading',
|
|
13
|
+
context: {
|
|
14
|
+
siteConfig,
|
|
15
|
+
paymentDetail,
|
|
16
|
+
promotion,
|
|
17
|
+
selectedAmount,
|
|
18
|
+
|
|
19
|
+
bindingPaymentList: {},
|
|
20
|
+
bindingPaymentInfo: {},
|
|
21
|
+
virtualBanks: {},
|
|
22
|
+
|
|
23
|
+
depositTime: null,
|
|
24
|
+
|
|
25
|
+
currentCategory: 'virtualBank',
|
|
26
|
+
method: null,
|
|
27
|
+
currentPayment: null,
|
|
28
|
+
currentApplyerBank: null,
|
|
29
|
+
|
|
30
|
+
calculation: null,
|
|
31
|
+
processing: null,
|
|
32
|
+
},
|
|
33
|
+
states: {
|
|
34
|
+
loading: {
|
|
35
|
+
invoke: {
|
|
36
|
+
src: 'fetchInitData',
|
|
37
|
+
onDone: {
|
|
38
|
+
target: 'checking',
|
|
39
|
+
actions: 'setInitData',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
checking: {
|
|
44
|
+
always: [
|
|
45
|
+
{
|
|
46
|
+
target: 'submitted',
|
|
47
|
+
cond: 'isProcessing',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
target: 'debouncing',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
loaded: {},
|
|
55
|
+
debouncing: {
|
|
56
|
+
entry: 'clearCalculation',
|
|
57
|
+
after: {
|
|
58
|
+
1000: [{ target: 'calculating', cond: 'isCalculable' }, { target: 'loaded' }],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
calculating: {
|
|
62
|
+
invoke: {
|
|
63
|
+
src: 'fetchCalculation',
|
|
64
|
+
onDone: {
|
|
65
|
+
target: 'calculated',
|
|
66
|
+
actions: 'setCalculation',
|
|
67
|
+
},
|
|
68
|
+
onError: {
|
|
69
|
+
target: 'loaded',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
calculated: {
|
|
74
|
+
on: {
|
|
75
|
+
SET_DEPOSIT_TIME: {
|
|
76
|
+
actions: 'setDepositTime',
|
|
77
|
+
},
|
|
78
|
+
SUBMIT: {
|
|
79
|
+
target: 'submitting',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
submitting: {
|
|
84
|
+
invoke: {
|
|
85
|
+
src: 'submitDeposit',
|
|
86
|
+
onDone: {
|
|
87
|
+
target: 'submitted',
|
|
88
|
+
actions: 'setProcessing',
|
|
89
|
+
},
|
|
90
|
+
onError: {
|
|
91
|
+
target: 'loaded',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
submitted: {},
|
|
96
|
+
},
|
|
97
|
+
on: {
|
|
98
|
+
SET_PROMOTION: {
|
|
99
|
+
target: 'debouncing',
|
|
100
|
+
actions: 'setPromotion',
|
|
101
|
+
internal: false,
|
|
102
|
+
},
|
|
103
|
+
INPUT_AMOUNT: {
|
|
104
|
+
target: 'debouncing',
|
|
105
|
+
actions: 'inputAmount',
|
|
106
|
+
internal: false,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
actions: {
|
|
112
|
+
setInitData: assign((context, event) => {
|
|
113
|
+
const { currentPayment } = event.data
|
|
114
|
+
|
|
115
|
+
const processing = currentPayment?.processing?.[0]
|
|
116
|
+
|
|
117
|
+
const virtualBanks = currentPayment?.virtualBanks?.[0]
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
currentPayment,
|
|
121
|
+
method: currentPayment.method,
|
|
122
|
+
processing,
|
|
123
|
+
selectedAmount: max(promotion?.minimumAmount, currentPayment?.minimum, selectedAmount, 0),
|
|
124
|
+
virtualBanks,
|
|
125
|
+
}
|
|
126
|
+
}),
|
|
127
|
+
inputAmount: assign((context, event) => {
|
|
128
|
+
return { selectedAmount: event.data }
|
|
129
|
+
}),
|
|
130
|
+
setCalculation: assign((context, event) => {
|
|
131
|
+
return {
|
|
132
|
+
calculation: event.data,
|
|
133
|
+
}
|
|
134
|
+
}),
|
|
135
|
+
setProcessing: assign((context, event) => {
|
|
136
|
+
return {
|
|
137
|
+
processing: event.data,
|
|
138
|
+
}
|
|
139
|
+
}),
|
|
140
|
+
clearCalculation: assign((context, event) => {
|
|
141
|
+
return {
|
|
142
|
+
calculation: null,
|
|
143
|
+
}
|
|
144
|
+
}),
|
|
145
|
+
setDepositTime: assign((context, event) => {
|
|
146
|
+
return {
|
|
147
|
+
depositTime: event.data,
|
|
148
|
+
}
|
|
149
|
+
}),
|
|
150
|
+
setPromotion: assign((context, event) => {
|
|
151
|
+
return {
|
|
152
|
+
promotion: event.data,
|
|
153
|
+
}
|
|
154
|
+
}),
|
|
155
|
+
},
|
|
156
|
+
guards: {
|
|
157
|
+
isCalculable: (context, event) => {
|
|
158
|
+
const {
|
|
159
|
+
selectedAmount,
|
|
160
|
+
currentPayment: { maximum, minimum },
|
|
161
|
+
} = context
|
|
162
|
+
return selectedAmount && minimum <= +selectedAmount && +selectedAmount <= maximum
|
|
163
|
+
},
|
|
164
|
+
isProcessing: (context, event) => {
|
|
165
|
+
return context.processing
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
services: {
|
|
169
|
+
fetchInitData: async (context, event) => {
|
|
170
|
+
const { paymentDetail = [] } = context
|
|
171
|
+
const currentPayment = paymentDetail.find((element) => element.category === context.currentCategory && element.transferType === 'deposit')
|
|
172
|
+
|
|
173
|
+
return {
|
|
174
|
+
currentPayment,
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
fetchCalculation: async (context, event) => {
|
|
178
|
+
const { method, selectedAmount, promotion } = context
|
|
179
|
+
return await request.send(
|
|
180
|
+
payment.getDepositExpectedResult({
|
|
181
|
+
method,
|
|
182
|
+
amount: selectedAmount,
|
|
183
|
+
promotionsNo: promotion?.promotionsNo,
|
|
184
|
+
})
|
|
185
|
+
)
|
|
186
|
+
},
|
|
187
|
+
submitDeposit: async (context, event) => {
|
|
188
|
+
const { method, selectedAmount, depositTime, promotion } = context
|
|
189
|
+
return await request.send(
|
|
190
|
+
payment.submitDepositTransactionBank({
|
|
191
|
+
method,
|
|
192
|
+
amount: selectedAmount,
|
|
193
|
+
depositTime,
|
|
194
|
+
promotionsNo: promotion?.promotionsNo,
|
|
195
|
+
})
|
|
196
|
+
)
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
}
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { assign, createMachine } from 'xstate'
|
|
2
|
+
import payment from '../../api/payment.js'
|
|
3
|
+
|
|
4
|
+
export default function (request) {
|
|
5
|
+
const { appSecret } = request.config
|
|
6
|
+
|
|
7
|
+
return createMachine(
|
|
8
|
+
{
|
|
9
|
+
id: 'virtual_bank',
|
|
10
|
+
initial: 'loading',
|
|
11
|
+
context: {
|
|
12
|
+
siteConfig: null,
|
|
13
|
+
paymentDetail: [],
|
|
14
|
+
virtualBanks: {},
|
|
15
|
+
|
|
16
|
+
amount: null,
|
|
17
|
+
depositTime: null,
|
|
18
|
+
|
|
19
|
+
currentCategory: 'virtualBank',
|
|
20
|
+
method: null,
|
|
21
|
+
currentPayment: null,
|
|
22
|
+
|
|
23
|
+
calculation: null,
|
|
24
|
+
processing: null,
|
|
25
|
+
|
|
26
|
+
// use for wallet mode 3
|
|
27
|
+
promotion: null,
|
|
28
|
+
},
|
|
29
|
+
states: {
|
|
30
|
+
loading: {
|
|
31
|
+
initial: 'init',
|
|
32
|
+
states: {
|
|
33
|
+
init: {
|
|
34
|
+
invoke: {
|
|
35
|
+
src: 'fetchPaymentDetail',
|
|
36
|
+
onDone: {
|
|
37
|
+
target: '#virtual_bank.step1',
|
|
38
|
+
actions: 'setInitData',
|
|
39
|
+
},
|
|
40
|
+
onError: {
|
|
41
|
+
target: '#virtual_bank.fail',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
step1: {
|
|
48
|
+
initial: 'promotion',
|
|
49
|
+
states: {
|
|
50
|
+
promotion: {
|
|
51
|
+
always: [
|
|
52
|
+
{
|
|
53
|
+
target: 'idle',
|
|
54
|
+
cond: 'isDoubleWalletMode',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
target: 'calculating',
|
|
58
|
+
actions: 'setPromotionDefaultAmount',
|
|
59
|
+
cond: 'hasMinPromotionDeposit',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
target: 'idle',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
idle: {},
|
|
67
|
+
calculating: {
|
|
68
|
+
invoke: {
|
|
69
|
+
src: 'fetchCalculation',
|
|
70
|
+
onDone: {
|
|
71
|
+
target: 'idle',
|
|
72
|
+
actions: 'setCalculation',
|
|
73
|
+
},
|
|
74
|
+
onError: {
|
|
75
|
+
target: 'idle',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
debouncing: {
|
|
80
|
+
after: {
|
|
81
|
+
1000: [{ target: 'calculating', cond: 'isCalculable' }, { target: 'idle' }],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
on: {
|
|
86
|
+
SET_AMOUNT: {
|
|
87
|
+
actions: ['setAmount', 'clearCalculation'],
|
|
88
|
+
},
|
|
89
|
+
CALCULATE: {
|
|
90
|
+
target: '.debouncing',
|
|
91
|
+
},
|
|
92
|
+
CLEAR_CALCULATION: {
|
|
93
|
+
target: '.debouncing',
|
|
94
|
+
actions: 'clearCalculation',
|
|
95
|
+
},
|
|
96
|
+
TRANSACT: {
|
|
97
|
+
target: 'checking',
|
|
98
|
+
cond: 'isCalculated',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
checking: {
|
|
103
|
+
always: [
|
|
104
|
+
{
|
|
105
|
+
target: 'pending',
|
|
106
|
+
cond: (context, event) => {
|
|
107
|
+
const { siteConfig = {}, calculation, promotion } = context
|
|
108
|
+
const { walletMode } = siteConfig
|
|
109
|
+
const { promotionsNo, activityNo } = promotion
|
|
110
|
+
const isNoBonus = promotionsNo === 'none' || activityNo === 'none'
|
|
111
|
+
return walletMode === '4' && !!calculation && !isNoBonus
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
target: '#virtual_bank.step2',
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
pending: {
|
|
120
|
+
on: {
|
|
121
|
+
CONFIRM: {
|
|
122
|
+
target: '#virtual_bank.step2',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
step2: {
|
|
127
|
+
initial: 'idle',
|
|
128
|
+
states: {
|
|
129
|
+
idle: {},
|
|
130
|
+
calculating: {
|
|
131
|
+
invoke: {
|
|
132
|
+
src: 'fetchCalculation',
|
|
133
|
+
onDone: {
|
|
134
|
+
target: 'idle',
|
|
135
|
+
actions: 'setCalculation',
|
|
136
|
+
},
|
|
137
|
+
onError: {
|
|
138
|
+
target: 'idle',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
debouncing: {
|
|
143
|
+
after: {
|
|
144
|
+
1000: [{ target: 'calculating', cond: 'isCalculable' }, { target: 'idle' }],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
submitting: {
|
|
148
|
+
invoke: {
|
|
149
|
+
src: 'submitDeposit',
|
|
150
|
+
onDone: {
|
|
151
|
+
target: '#virtual_bank.submitted',
|
|
152
|
+
actions: 'setProcessing',
|
|
153
|
+
},
|
|
154
|
+
onError: {
|
|
155
|
+
target: 'idle',
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
on: {
|
|
161
|
+
SET_AMOUNT: {
|
|
162
|
+
actions: ['setAmount', 'clearCalculation'],
|
|
163
|
+
},
|
|
164
|
+
CALCULATE: {
|
|
165
|
+
target: '.debouncing',
|
|
166
|
+
},
|
|
167
|
+
SET_DEPOSIT_TIME: {
|
|
168
|
+
actions: 'setDepositTime',
|
|
169
|
+
},
|
|
170
|
+
CLEAR_CALCULATION: {
|
|
171
|
+
target: '.debouncing',
|
|
172
|
+
actions: 'clearCalculation',
|
|
173
|
+
},
|
|
174
|
+
SUBMIT: {
|
|
175
|
+
target: '.submitting',
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
processing: {},
|
|
180
|
+
submitted: {},
|
|
181
|
+
fail: {},
|
|
182
|
+
},
|
|
183
|
+
on: {
|
|
184
|
+
SET_PROMOTION: {
|
|
185
|
+
actions: 'setPromotion',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
actions: {
|
|
191
|
+
setInitData: assign((context, event) => {
|
|
192
|
+
const paymentDetail = event.data || []
|
|
193
|
+
const currentPayment = paymentDetail.find((element) => element.category === context.currentCategory)
|
|
194
|
+
const { method, processing, virtualBanks } = currentPayment || {}
|
|
195
|
+
|
|
196
|
+
return {
|
|
197
|
+
paymentDetail,
|
|
198
|
+
currentPayment,
|
|
199
|
+
method,
|
|
200
|
+
processing: processing?.[0],
|
|
201
|
+
virtualBanks: virtualBanks?.[0],
|
|
202
|
+
}
|
|
203
|
+
}),
|
|
204
|
+
setAmount: assign((context, event) => {
|
|
205
|
+
return {
|
|
206
|
+
amount: event.data,
|
|
207
|
+
}
|
|
208
|
+
}),
|
|
209
|
+
setCalculation: assign((context, event) => {
|
|
210
|
+
return {
|
|
211
|
+
calculation: event.data,
|
|
212
|
+
}
|
|
213
|
+
}),
|
|
214
|
+
setProcessing: assign((context, event) => {
|
|
215
|
+
return {
|
|
216
|
+
processing: event.data,
|
|
217
|
+
}
|
|
218
|
+
}),
|
|
219
|
+
clearCalculation: assign((context, event) => {
|
|
220
|
+
return {
|
|
221
|
+
calculation: null,
|
|
222
|
+
}
|
|
223
|
+
}),
|
|
224
|
+
setDepositTime: assign((context, event) => {
|
|
225
|
+
return {
|
|
226
|
+
depositTime: event.data,
|
|
227
|
+
}
|
|
228
|
+
}),
|
|
229
|
+
setPromotion: assign((context, event) => {
|
|
230
|
+
return {
|
|
231
|
+
promotion: event.data,
|
|
232
|
+
}
|
|
233
|
+
}),
|
|
234
|
+
setPromotionDefaultAmount: assign((context, event) => {
|
|
235
|
+
return {
|
|
236
|
+
amount: context.promotion.minimumAmount,
|
|
237
|
+
}
|
|
238
|
+
}),
|
|
239
|
+
},
|
|
240
|
+
guards: {
|
|
241
|
+
isDoubleWalletMode: (context, event) => {
|
|
242
|
+
return context.siteConfig?.walletMode === '4'
|
|
243
|
+
},
|
|
244
|
+
isCalculable: (context, event) => {
|
|
245
|
+
const {
|
|
246
|
+
amount,
|
|
247
|
+
currentPayment: { maximum, minimum },
|
|
248
|
+
} = context
|
|
249
|
+
return amount && minimum <= +amount && +amount <= maximum
|
|
250
|
+
},
|
|
251
|
+
isCalculated: (context, event) => {
|
|
252
|
+
return context.calculation
|
|
253
|
+
},
|
|
254
|
+
isProcessing: (context, event) => {
|
|
255
|
+
return context.processing
|
|
256
|
+
},
|
|
257
|
+
hasMinPromotionDeposit: (context, event) => {
|
|
258
|
+
return context.promotion?.minimumAmount
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
services: {
|
|
262
|
+
fetchPaymentDetail: async (context, event) => {
|
|
263
|
+
return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
|
|
264
|
+
},
|
|
265
|
+
fetchCalculation: async (context, event) => {
|
|
266
|
+
const { method, amount, promotion } = context
|
|
267
|
+
return await request.send(
|
|
268
|
+
payment.getDepositExpectedResult({
|
|
269
|
+
method,
|
|
270
|
+
amount,
|
|
271
|
+
promotionsNo: promotion?.activityNo,
|
|
272
|
+
})
|
|
273
|
+
)
|
|
274
|
+
},
|
|
275
|
+
submitDeposit: async (context, event) => {
|
|
276
|
+
const { method, amount, depositTime, promotion } = context
|
|
277
|
+
return await request.send(
|
|
278
|
+
payment.submitDepositTransactionBank({
|
|
279
|
+
method,
|
|
280
|
+
amount,
|
|
281
|
+
depositTime,
|
|
282
|
+
promotionsNo: promotion?.activityNo,
|
|
283
|
+
})
|
|
284
|
+
)
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
}
|
|
288
|
+
)
|
|
289
|
+
}
|
|
@@ -58,39 +58,35 @@ export default function (request) {
|
|
|
58
58
|
src: 'withdrawCheck',
|
|
59
59
|
onDone: [
|
|
60
60
|
{
|
|
61
|
-
target: '
|
|
62
|
-
cond: 'isNotWithdrawMinDepositAmount',
|
|
61
|
+
target: 'checkingWithdrawStatus',
|
|
63
62
|
actions: assign((context, event) => {
|
|
64
63
|
return {
|
|
65
64
|
withdrawCheck: event.data,
|
|
66
65
|
}
|
|
67
66
|
}),
|
|
68
67
|
},
|
|
69
|
-
{
|
|
70
|
-
target: 'passWithdrawCooldownTime',
|
|
71
|
-
cond: 'isPassWithdrawCooldownTime',
|
|
72
|
-
actions: assign((context, event) => {
|
|
73
|
-
return {
|
|
74
|
-
withdrawCheck: event.data,
|
|
75
|
-
}
|
|
76
|
-
}),
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
target: 'notWithdrawable',
|
|
80
|
-
cond: 'isNotWithdrawable',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
target: 'withdrawable',
|
|
84
|
-
},
|
|
85
68
|
],
|
|
86
69
|
onError: {
|
|
87
70
|
target: '#withdraw_krway.fail',
|
|
88
71
|
},
|
|
89
72
|
},
|
|
90
73
|
},
|
|
74
|
+
checkingWithdrawStatus: {
|
|
75
|
+
always: [
|
|
76
|
+
// 提款最低存款金額
|
|
77
|
+
{ target: 'notWithdrawMinDepositAmount', cond: 'isNotWithdrawMinDepositAmount' },
|
|
78
|
+
// 提款冷卻時間
|
|
79
|
+
{ target: 'passWithdrawCooldownTime', cond: 'isPassWithdrawCooldownTime' },
|
|
80
|
+
// 提款服務時間
|
|
81
|
+
{ target: 'withdrawServiceTime', cond: 'isNotWIthdrawServiceTime' },
|
|
82
|
+
{ target: 'notWithdrawable', cond: 'isNotWithdrawable' },
|
|
83
|
+
{ target: 'withdrawable' },
|
|
84
|
+
],
|
|
85
|
+
},
|
|
91
86
|
notWithdrawMinDepositAmount: {},
|
|
92
87
|
passWithdrawCooldownTime: {},
|
|
93
88
|
inProcessing: {},
|
|
89
|
+
withdrawServiceTime: {},
|
|
94
90
|
notWithdrawable: {},
|
|
95
91
|
withdrawable: {
|
|
96
92
|
on: {
|
|
@@ -180,10 +176,16 @@ export default function (request) {
|
|
|
180
176
|
return !enableWithdraw || balance < minWithdrawAmount
|
|
181
177
|
},
|
|
182
178
|
isNotWithdrawMinDepositAmount: (context, event) => {
|
|
183
|
-
|
|
179
|
+
const { withdrawCheck } = context
|
|
180
|
+
return !withdrawCheck?.passDepositeLimit
|
|
184
181
|
},
|
|
185
182
|
isPassWithdrawCooldownTime: (context, event) => {
|
|
186
|
-
|
|
183
|
+
const { withdrawCheck } = context
|
|
184
|
+
return !withdrawCheck?.passWithdrawCooldownTime
|
|
185
|
+
},
|
|
186
|
+
isNotWIthdrawServiceTime: (context, event) => {
|
|
187
|
+
const { withdrawCheck } = context
|
|
188
|
+
return !withdrawCheck?.withdrawInServiceTime
|
|
187
189
|
},
|
|
188
190
|
},
|
|
189
191
|
services: {
|
|
@@ -168,41 +168,35 @@ export default function (request) {
|
|
|
168
168
|
invoke: {
|
|
169
169
|
src: 'withdrawCheck',
|
|
170
170
|
onDone: [
|
|
171
|
-
// 提款最低存款金額
|
|
172
171
|
{
|
|
173
|
-
target: '
|
|
174
|
-
cond: 'isNotWithdrawMinDepositAmount',
|
|
172
|
+
target: 'checkingWithdrawStatus',
|
|
175
173
|
actions: assign((context, event) => {
|
|
176
174
|
return {
|
|
177
175
|
withdrawCheck: event.data,
|
|
178
176
|
}
|
|
179
177
|
}),
|
|
180
178
|
},
|
|
181
|
-
// 提款冷卻時間
|
|
182
|
-
{
|
|
183
|
-
target: 'passWithdrawCooldownTime',
|
|
184
|
-
cond: 'isPassWithdrawCooldownTime',
|
|
185
|
-
actions: assign((context, event) => {
|
|
186
|
-
return {
|
|
187
|
-
withdrawCheck: event.data,
|
|
188
|
-
}
|
|
189
|
-
}),
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
target: 'notWithdrawable',
|
|
193
|
-
cond: 'isNotWithdrawable',
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
target: 'withdrawable',
|
|
197
|
-
},
|
|
198
179
|
],
|
|
199
180
|
onError: {
|
|
200
181
|
target: '#withdraw_manual.fail',
|
|
201
182
|
},
|
|
202
183
|
},
|
|
203
184
|
},
|
|
185
|
+
checkingWithdrawStatus: {
|
|
186
|
+
always: [
|
|
187
|
+
// 提款最低存款金額
|
|
188
|
+
{ target: 'notWithdrawMinDepositAmount', cond: 'isNotWithdrawMinDepositAmount' },
|
|
189
|
+
// 提款冷卻時間
|
|
190
|
+
{ target: 'passWithdrawCooldownTime', cond: 'isPassWithdrawCooldownTime' },
|
|
191
|
+
// 提款服務時間
|
|
192
|
+
{ target: 'withdrawServiceTime', cond: 'isNotWIthdrawServiceTime' },
|
|
193
|
+
{ target: 'notWithdrawable', cond: 'isNotWithdrawable' },
|
|
194
|
+
{ target: 'withdrawable' },
|
|
195
|
+
],
|
|
196
|
+
},
|
|
204
197
|
notWithdrawMinDepositAmount: {},
|
|
205
198
|
passWithdrawCooldownTime: {},
|
|
199
|
+
withdrawServiceTime: {},
|
|
206
200
|
notWithdrawable: {},
|
|
207
201
|
unbound: {
|
|
208
202
|
// to bank_binding.js
|
|
@@ -525,10 +519,16 @@ export default function (request) {
|
|
|
525
519
|
return event.data?.status === 'otp-verifying'
|
|
526
520
|
},
|
|
527
521
|
isNotWithdrawMinDepositAmount: (context, event) => {
|
|
528
|
-
|
|
522
|
+
const { withdrawCheck } = context
|
|
523
|
+
return !withdrawCheck?.passDepositeLimit
|
|
529
524
|
},
|
|
530
525
|
isPassWithdrawCooldownTime: (context, event) => {
|
|
531
|
-
|
|
526
|
+
const { withdrawCheck } = context
|
|
527
|
+
return !withdrawCheck?.passWithdrawCooldownTime
|
|
528
|
+
},
|
|
529
|
+
isNotWIthdrawServiceTime: (context, event) => {
|
|
530
|
+
const { withdrawCheck } = context
|
|
531
|
+
return !withdrawCheck?.withdrawInServiceTime
|
|
532
532
|
},
|
|
533
533
|
},
|
|
534
534
|
services: {
|
|
@@ -142,38 +142,34 @@ export default function (request) {
|
|
|
142
142
|
src: 'withdrawCheck',
|
|
143
143
|
onDone: [
|
|
144
144
|
{
|
|
145
|
-
target: '
|
|
146
|
-
cond: 'isNotWithdrawMinDepositAmount',
|
|
145
|
+
target: 'checkingWithdrawStatus',
|
|
147
146
|
actions: assign((context, event) => {
|
|
148
147
|
return {
|
|
149
148
|
withdrawCheck: event.data,
|
|
150
149
|
}
|
|
151
150
|
}),
|
|
152
151
|
},
|
|
153
|
-
{
|
|
154
|
-
target: 'passWithdrawCooldownTime',
|
|
155
|
-
cond: 'isPassWithdrawCooldownTime',
|
|
156
|
-
actions: assign((context, event) => {
|
|
157
|
-
return {
|
|
158
|
-
withdrawCheck: event.data,
|
|
159
|
-
}
|
|
160
|
-
}),
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
target: 'notWithdrawable',
|
|
164
|
-
cond: 'isNotWithdrawable',
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
target: 'withdrawable',
|
|
168
|
-
},
|
|
169
152
|
],
|
|
170
153
|
onError: {
|
|
171
154
|
target: '#withdraw_vn.fail',
|
|
172
155
|
},
|
|
173
156
|
},
|
|
174
157
|
},
|
|
158
|
+
checkingWithdrawStatus: {
|
|
159
|
+
always: [
|
|
160
|
+
// 提款最低存款金額
|
|
161
|
+
{ target: 'notWithdrawMinDepositAmount', cond: 'isNotWithdrawMinDepositAmount' },
|
|
162
|
+
// 提款冷卻時間
|
|
163
|
+
{ target: 'passWithdrawCooldownTime', cond: 'isPassWithdrawCooldownTime' },
|
|
164
|
+
// 提款服務時間
|
|
165
|
+
{ target: 'withdrawServiceTime', cond: 'isNotWIthdrawServiceTime' },
|
|
166
|
+
{ target: 'notWithdrawable', cond: 'isNotWithdrawable' },
|
|
167
|
+
{ target: 'withdrawable' },
|
|
168
|
+
],
|
|
169
|
+
},
|
|
175
170
|
notWithdrawMinDepositAmount: {},
|
|
176
171
|
passWithdrawCooldownTime: {},
|
|
172
|
+
withdrawServiceTime: {},
|
|
177
173
|
notWithdrawable: {},
|
|
178
174
|
unbound: {
|
|
179
175
|
// to bank_binding.js
|
|
@@ -459,10 +455,16 @@ export default function (request) {
|
|
|
459
455
|
},
|
|
460
456
|
isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
|
|
461
457
|
isNotWithdrawMinDepositAmount: (context, event) => {
|
|
462
|
-
|
|
458
|
+
const { withdrawCheck } = context
|
|
459
|
+
return !withdrawCheck?.passDepositeLimit
|
|
463
460
|
},
|
|
464
461
|
isPassWithdrawCooldownTime: (context, event) => {
|
|
465
|
-
|
|
462
|
+
const { withdrawCheck } = context
|
|
463
|
+
return !withdrawCheck?.passWithdrawCooldownTime
|
|
464
|
+
},
|
|
465
|
+
isNotWIthdrawServiceTime: (context, event) => {
|
|
466
|
+
const { withdrawCheck } = context
|
|
467
|
+
return !withdrawCheck?.withdrawInServiceTime
|
|
466
468
|
},
|
|
467
469
|
},
|
|
468
470
|
services: {
|
|
@@ -170,38 +170,34 @@ export default function (request) {
|
|
|
170
170
|
src: 'withdrawCheck',
|
|
171
171
|
onDone: [
|
|
172
172
|
{
|
|
173
|
-
target: '
|
|
174
|
-
cond: 'isNotWithdrawMinDepositAmount',
|
|
173
|
+
target: 'checkingWithdrawStatus',
|
|
175
174
|
actions: assign((context, event) => {
|
|
176
175
|
return {
|
|
177
176
|
withdrawCheck: event.data,
|
|
178
177
|
}
|
|
179
178
|
}),
|
|
180
179
|
},
|
|
181
|
-
{
|
|
182
|
-
target: 'passWithdrawCooldownTime',
|
|
183
|
-
cond: 'isPassWithdrawCooldownTime',
|
|
184
|
-
actions: assign((context, event) => {
|
|
185
|
-
return {
|
|
186
|
-
withdrawCheck: event.data,
|
|
187
|
-
}
|
|
188
|
-
}),
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
target: 'notWithdrawable',
|
|
192
|
-
cond: 'isNotWithdrawable',
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
target: 'withdrawable',
|
|
196
|
-
},
|
|
197
180
|
],
|
|
198
181
|
onError: {
|
|
199
182
|
target: '#withdraw_vn2.fail',
|
|
200
183
|
},
|
|
201
184
|
},
|
|
202
185
|
},
|
|
186
|
+
checkingWithdrawStatus: {
|
|
187
|
+
always: [
|
|
188
|
+
// 提款最低存款金額
|
|
189
|
+
{ target: 'notWithdrawMinDepositAmount', cond: 'isNotWithdrawMinDepositAmount' },
|
|
190
|
+
// 提款冷卻時間
|
|
191
|
+
{ target: 'passWithdrawCooldownTime', cond: 'isPassWithdrawCooldownTime' },
|
|
192
|
+
// 提款服務時間
|
|
193
|
+
{ target: 'withdrawServiceTime', cond: 'isNotWIthdrawServiceTime' },
|
|
194
|
+
{ target: 'notWithdrawable', cond: 'isNotWithdrawable' },
|
|
195
|
+
{ target: 'withdrawable' },
|
|
196
|
+
],
|
|
197
|
+
},
|
|
203
198
|
notWithdrawMinDepositAmount: {},
|
|
204
199
|
passWithdrawCooldownTime: {},
|
|
200
|
+
withdrawServiceTime: {},
|
|
205
201
|
notWithdrawable: {},
|
|
206
202
|
unbound: {
|
|
207
203
|
// to bank_binding.js
|
|
@@ -484,10 +480,16 @@ export default function (request) {
|
|
|
484
480
|
return event.data?.status === 'otp-verifying'
|
|
485
481
|
},
|
|
486
482
|
isNotWithdrawMinDepositAmount: (context, event) => {
|
|
487
|
-
|
|
483
|
+
const { withdrawCheck } = context
|
|
484
|
+
return !withdrawCheck?.passDepositeLimit
|
|
488
485
|
},
|
|
489
486
|
isPassWithdrawCooldownTime: (context, event) => {
|
|
490
|
-
|
|
487
|
+
const { withdrawCheck } = context
|
|
488
|
+
return !withdrawCheck?.passWithdrawCooldownTime
|
|
489
|
+
},
|
|
490
|
+
isNotWIthdrawServiceTime: (context, event) => {
|
|
491
|
+
const { withdrawCheck } = context
|
|
492
|
+
return !withdrawCheck?.withdrawInServiceTime
|
|
491
493
|
},
|
|
492
494
|
},
|
|
493
495
|
services: {
|