@jetthai/cuora 1.1.270-dev-6 → 1.1.270-fix
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 +1 -69
- package/package.json +1 -1
- package/src/api/activity.js +0 -6
- package/src/api/game.js +0 -1
- package/src/api/payment.js +5 -47
- package/src/api/user.js +0 -2
- package/src/machine/activity/activity.js +4 -12
- package/src/machine/activity/activity_cash.js +3 -11
- package/src/machine/activity/cash_rain_activity.js +1 -4
- package/src/machine/activity/instant_rebate_activity.js +0 -3
- package/src/machine/bank_binding.js +14 -93
- package/src/machine/common.js +1 -12
- package/src/machine/deposit/amb.js +3 -5
- package/src/machine/deposit/crypto_way_cash.js +1 -15
- package/src/machine/deposit/float.js +3 -5
- package/src/machine/deposit/manual_cash.js +44 -49
- package/src/machine/deposit/manual_vn.js +54 -62
- package/src/machine/deposit/vpay.js +3 -5
- package/src/machine/game_search_cash.js +4 -14
- package/src/machine/game_v2_1.js +0 -23
- package/src/machine/index.js +0 -4
- package/src/machine/withdraw/index.js +0 -2
- package/src/machine/withdraw/withdraw_manual_cash.js +21 -44
- package/src/machine/game_info.js +0 -57
- package/src/machine/user_photo.js +0 -65
- package/src/machine/withdraw/withdraw_manual.js +0 -595
package/CHANGELOG.md
CHANGED
|
@@ -2,75 +2,7 @@
|
|
|
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.270-
|
|
6
|
-
|
|
7
|
-
### [1.1.270-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.270-dev-4...v1.1.270-dev-5) (2024-06-12)
|
|
8
|
-
|
|
9
|
-
### [1.1.270-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.279-dev-3...v1.1.270-dev-4) (2024-06-12)
|
|
10
|
-
|
|
11
|
-
### [1.1.279-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.279-dev-2...v1.1.279-dev-3) (2024-06-12)
|
|
12
|
-
|
|
13
|
-
### [1.1.279-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.279...v1.1.279-dev-2) (2024-06-10)
|
|
14
|
-
|
|
15
|
-
### [1.1.279-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.279...v1.1.279-dev-1) (2024-06-06)
|
|
16
|
-
|
|
17
|
-
### [1.1.279](https://github.com/jetthai/cuora-module/compare/v1.1.270-fix-6...v1.1.279) (2024-06-06)
|
|
18
|
-
|
|
19
|
-
### [1.1.278](https://github.com/jetthai/cuora-module/compare/v1.1.270-fix-2...v1.1.278) (2024-06-04)
|
|
20
|
-
|
|
21
|
-
### [1.1.277](https://github.com/jetthai/cuora-module/compare/v1.1.276...v1.1.277) (2024-05-31)
|
|
22
|
-
|
|
23
|
-
### [1.1.276](https://github.com/jetthai/cuora-module/compare/v1.1.275...v1.1.276) (2024-05-31)
|
|
24
|
-
|
|
25
|
-
### [1.1.275](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-6...v1.1.275) (2024-05-30)
|
|
26
|
-
|
|
27
|
-
### [1.1.273-withdraw-6](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-5...v1.1.273-withdraw-6) (2024-05-29)
|
|
28
|
-
|
|
29
|
-
### [1.1.273-withdraw-5](https://github.com/jetthai/cuora-module/compare/v1.1.270-fix...v1.1.273-withdraw-5) (2024-05-29)
|
|
30
|
-
|
|
31
|
-
### [1.1.273-withdraw-4](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-3...v1.1.273-withdraw-4) (2024-05-29)
|
|
32
|
-
|
|
33
|
-
### [1.1.273-withdraw-3](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-2...v1.1.273-withdraw-3) (2024-05-29)
|
|
34
|
-
|
|
35
|
-
### [1.1.273-withdraw-2](https://github.com/jetthai/cuora-module/compare/v1.1.274...v1.1.273-withdraw-2) (2024-05-29)
|
|
36
|
-
|
|
37
|
-
### [1.1.274](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-1...v1.1.274) (2024-05-28)
|
|
38
|
-
|
|
39
|
-
### [1.1.273-withdraw-1](https://github.com/jetthai/cuora-module/compare/v1.1.273...v1.1.273-withdraw-1) (2024-05-28)
|
|
40
|
-
|
|
41
|
-
### [1.1.273](https://github.com/jetthai/cuora-module/compare/v1.1.272...v1.1.273) (2024-05-27)
|
|
42
|
-
|
|
43
|
-
### [1.1.272](https://github.com/jetthai/cuora-module/compare/v1.1.271...v1.1.272) (2024-05-21)
|
|
44
|
-
|
|
45
|
-
### [1.1.271](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.271) (2024-05-21)
|
|
46
|
-
|
|
47
|
-
### [1.1.278](https://github.com/jetthai/cuora-module/compare/v1.1.277...v1.1.278) (2024-06-04)
|
|
48
|
-
|
|
49
|
-
### [1.1.277](https://github.com/jetthai/cuora-module/compare/v1.1.276...v1.1.277) (2024-05-31)
|
|
50
|
-
|
|
51
|
-
### [1.1.276](https://github.com/jetthai/cuora-module/compare/v1.1.275...v1.1.276) (2024-05-31)
|
|
52
|
-
|
|
53
|
-
### [1.1.273-withdraw-6](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-5...v1.1.273-withdraw-6) (2024-05-29)
|
|
54
|
-
|
|
55
|
-
### [1.1.273-withdraw-5](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-4...v1.1.273-withdraw-5) (2024-05-29)
|
|
56
|
-
|
|
57
|
-
### [1.1.273-withdraw-4](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-3...v1.1.273-withdraw-4) (2024-05-29)
|
|
58
|
-
|
|
59
|
-
### [1.1.273-withdraw-3](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-2...v1.1.273-withdraw-3) (2024-05-29)
|
|
60
|
-
|
|
61
|
-
### [1.1.273-withdraw-2](https://github.com/jetthai/cuora-module/compare/v1.1.274...v1.1.273-withdraw-2) (2024-05-29)
|
|
62
|
-
|
|
63
|
-
### [1.1.273-withdraw-1](https://github.com/jetthai/cuora-module/compare/v1.1.273...v1.1.273-withdraw-1) (2024-05-28)
|
|
64
|
-
|
|
65
|
-
### [1.1.275](https://github.com/jetthai/cuora-module/compare/v1.1.274...v1.1.275) (2024-05-30)
|
|
66
|
-
|
|
67
|
-
### [1.1.274](https://github.com/jetthai/cuora-module/compare/v1.1.273...v1.1.274) (2024-05-28)
|
|
68
|
-
|
|
69
|
-
### [1.1.273](https://github.com/jetthai/cuora-module/compare/v1.1.272...v1.1.273) (2024-05-27)
|
|
70
|
-
|
|
71
|
-
### [1.1.272](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.272) (2024-05-21)
|
|
72
|
-
|
|
73
|
-
### [1.1.271](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.271) (2024-05-21)
|
|
5
|
+
### [1.1.270-fix](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.270-fix) (2024-05-29)
|
|
74
6
|
|
|
75
7
|
### [1.1.270](https://github.com/jetthai/cuora-module/compare/v1.1.269...v1.1.270) (2024-05-16)
|
|
76
8
|
|
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -6,12 +6,6 @@ export default {
|
|
|
6
6
|
params: { appSecret, include },
|
|
7
7
|
isPublic: true,
|
|
8
8
|
}),
|
|
9
|
-
getJackpotList: ({ appSecret }) => ({
|
|
10
|
-
url: 'activities/jackpot/list',
|
|
11
|
-
method: 'get',
|
|
12
|
-
params: { appSecret },
|
|
13
|
-
isPublic: true,
|
|
14
|
-
}),
|
|
15
9
|
getTournamentDetail: ({ activityNo, appSecret }) => ({
|
|
16
10
|
url: 'tournament/detail',
|
|
17
11
|
method: 'get',
|
package/src/api/game.js
CHANGED
|
@@ -91,5 +91,4 @@ export default {
|
|
|
91
91
|
}),
|
|
92
92
|
addListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/addMyFavorite', params: { games: [code] } }),
|
|
93
93
|
removeListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/removeMyFavorite', params: { games: [code] } }),
|
|
94
|
-
getGameInfo: ({ appSecret, gameCode }) => ({ method: 'get', url: 'game/info', params: { appSecret, gameCode } }),
|
|
95
94
|
}
|
package/src/api/payment.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
|
+
// getPaymentHistory: () => ({ url: 'payment/history', method: 'post' }),
|
|
2
3
|
getPaymentHistory: (returnDays) => ({ url: 'payment/v2/history', method: 'post', params: { returnDays } }),
|
|
3
4
|
getSpotMarket: () => ({ url: 'payment/spotmarket', method: 'get' }),
|
|
4
5
|
getTransactionHistory: (payload) => ({
|
|
@@ -7,6 +8,7 @@ export default {
|
|
|
7
8
|
params: { ...payload },
|
|
8
9
|
}),
|
|
9
10
|
getTransactionHistoryOptions: () => ({ url: 'payment/v2/category/options', method: 'get' }),
|
|
11
|
+
// getPaymentInfo: () => ({ url: `payment/paymentInfo`, method: 'get' }),
|
|
10
12
|
getPaymentInfo: () => ({ url: `payment/v2/paymentInfo`, method: 'get' }),
|
|
11
13
|
getBindingPaymentInfo: () => ({ url: `payment/getBindingPaymentInfo`, method: 'get' }),
|
|
12
14
|
updatePaymentInfo: ({
|
|
@@ -27,7 +29,6 @@ export default {
|
|
|
27
29
|
cryptoNetwork,
|
|
28
30
|
cryptoAddress,
|
|
29
31
|
walletCode,
|
|
30
|
-
ifscCode,
|
|
31
32
|
}) => ({
|
|
32
33
|
url: 'payment/v2/updatePaymentInfo',
|
|
33
34
|
method: 'post',
|
|
@@ -49,7 +50,6 @@ export default {
|
|
|
49
50
|
cryptoNetwork,
|
|
50
51
|
cryptoAddress,
|
|
51
52
|
walletCode,
|
|
52
|
-
ifscCode,
|
|
53
53
|
},
|
|
54
54
|
}),
|
|
55
55
|
getBankList: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/getBankList`, method: 'get' }),
|
|
@@ -93,11 +93,6 @@ export default {
|
|
|
93
93
|
method: 'post',
|
|
94
94
|
params: { transferType: 'DEPOSIT', amount, cryptoCurrency, promotionsNo },
|
|
95
95
|
}),
|
|
96
|
-
getCryptoWithdrawExpectedResult: ({ method, amount, cryptoCurrency, promotionsNo }) => ({
|
|
97
|
-
url: `payment/v2/${method}/crypto/expected/result`,
|
|
98
|
-
method: 'post',
|
|
99
|
-
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, promotionsNo },
|
|
100
|
-
}),
|
|
101
96
|
getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
|
|
102
97
|
url: `payment/v2/${method}/expected/result`,
|
|
103
98
|
method: 'post',
|
|
@@ -132,15 +127,11 @@ export default {
|
|
|
132
127
|
amount,
|
|
133
128
|
applyerBankCode,
|
|
134
129
|
applyerAccountNumber,
|
|
135
|
-
applyerIfscCode,
|
|
136
130
|
applyerHolderName,
|
|
137
131
|
applyerBranch,
|
|
138
132
|
applyerBranchCode,
|
|
139
133
|
targetBankCode,
|
|
140
134
|
targetAccountNumber,
|
|
141
|
-
targetIfscCode,
|
|
142
|
-
targetUpi,
|
|
143
|
-
transactionId,
|
|
144
135
|
depositTime,
|
|
145
136
|
receipt,
|
|
146
137
|
promotionsNo,
|
|
@@ -152,15 +143,11 @@ export default {
|
|
|
152
143
|
amount,
|
|
153
144
|
applyerBankCode,
|
|
154
145
|
applyerAccountNumber,
|
|
155
|
-
applyerIfscCode,
|
|
156
146
|
applyerHolderName,
|
|
157
147
|
applyerBranch,
|
|
158
148
|
applyerBranchCode,
|
|
159
149
|
targetBankCode,
|
|
160
150
|
targetAccountNumber,
|
|
161
|
-
targetIfscCode,
|
|
162
|
-
targetUpi,
|
|
163
|
-
transactionId,
|
|
164
151
|
depositTime,
|
|
165
152
|
receipt,
|
|
166
153
|
promotionsNo,
|
|
@@ -171,12 +158,12 @@ export default {
|
|
|
171
158
|
method: 'post',
|
|
172
159
|
params: { transferType: 'DEPOSIT', amount, promotionsNo },
|
|
173
160
|
}),
|
|
174
|
-
submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress
|
|
161
|
+
submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
|
|
175
162
|
url: `payment/v2/${method}/transaction`,
|
|
176
163
|
method: 'post',
|
|
177
|
-
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress
|
|
164
|
+
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress },
|
|
178
165
|
}),
|
|
179
|
-
submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber,
|
|
166
|
+
submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch, holderName }) => ({
|
|
180
167
|
url: `payment/v2/${method}/transaction`,
|
|
181
168
|
method: 'post',
|
|
182
169
|
params: {
|
|
@@ -184,36 +171,8 @@ export default {
|
|
|
184
171
|
amount,
|
|
185
172
|
applyerBankCode,
|
|
186
173
|
applyerAccountNumber,
|
|
187
|
-
applyerIfscCode,
|
|
188
|
-
branch,
|
|
189
|
-
applyerHolderName,
|
|
190
|
-
},
|
|
191
|
-
}),
|
|
192
|
-
submitWithdrawTransactionManual: ({
|
|
193
|
-
method,
|
|
194
|
-
amount,
|
|
195
|
-
applyerBankCode,
|
|
196
|
-
applyerAccountNumber,
|
|
197
|
-
applyerIfscCode,
|
|
198
|
-
branch,
|
|
199
|
-
holderName,
|
|
200
|
-
cryptoCurrency,
|
|
201
|
-
cryptoNetwork,
|
|
202
|
-
targetAddress,
|
|
203
|
-
}) => ({
|
|
204
|
-
url: `payment/v2/${method}/transaction`,
|
|
205
|
-
method: 'post',
|
|
206
|
-
params: {
|
|
207
|
-
transferType: 'WITHDRAW',
|
|
208
|
-
amount,
|
|
209
|
-
applyerBankCode,
|
|
210
|
-
applyerAccountNumber,
|
|
211
|
-
applyerIfscCode,
|
|
212
174
|
branch,
|
|
213
175
|
holderName,
|
|
214
|
-
cryptoCurrency,
|
|
215
|
-
cryptoNetwork,
|
|
216
|
-
targetAddress,
|
|
217
176
|
},
|
|
218
177
|
}),
|
|
219
178
|
submitWithdrawTransactionAmb: ({ method, amount }) => ({
|
|
@@ -241,5 +200,4 @@ export default {
|
|
|
241
200
|
}),
|
|
242
201
|
getPendingOrder: ({ transferType }) => ({ url: 'payment/v2/pendingOrder', method: 'post', params: { transferType } }),
|
|
243
202
|
withdrawCheck: () => ({ url: `payment/v2/withdrawCheck`, method: 'post' }),
|
|
244
|
-
updateUtr: ({ applyId, utr }) => ({ url: 'payment/v2/updateUtr', method: 'post', params: { applyId, utr } }),
|
|
245
203
|
}
|
package/src/api/user.js
CHANGED
|
@@ -57,6 +57,4 @@ export default {
|
|
|
57
57
|
isPublic: true,
|
|
58
58
|
}),
|
|
59
59
|
otpReset: ({ requestId, target }) => ({ url: '/otpsso/reset', method: 'post', params: { requestId, target }, isPublic: true }),
|
|
60
|
-
getUserPhotoList: () => ({ url: 'getAllAvatar', method: 'get' }),
|
|
61
|
-
updateUserPhoto: (data) => ({ url: 'updateUserAvatar', method: 'post', params: data }),
|
|
62
60
|
}
|
|
@@ -10,11 +10,10 @@ export default function (request) {
|
|
|
10
10
|
initial: 'init',
|
|
11
11
|
context: {
|
|
12
12
|
tick: 2000,
|
|
13
|
-
specifyActivities: [
|
|
13
|
+
specifyActivities: [29, 34],
|
|
14
14
|
activitiesDetailList: [],
|
|
15
15
|
activityList: [],
|
|
16
16
|
promotionList: [],
|
|
17
|
-
jackpotList: [],
|
|
18
17
|
activityMap: {},
|
|
19
18
|
tournamentList: [],
|
|
20
19
|
refs: {},
|
|
@@ -35,7 +34,7 @@ export default function (request) {
|
|
|
35
34
|
src: 'fetchList',
|
|
36
35
|
onDone: {
|
|
37
36
|
target: 'idle',
|
|
38
|
-
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'
|
|
37
|
+
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'],
|
|
39
38
|
},
|
|
40
39
|
onError: {
|
|
41
40
|
target: 'idle',
|
|
@@ -124,12 +123,6 @@ export default function (request) {
|
|
|
124
123
|
promotionList,
|
|
125
124
|
}
|
|
126
125
|
}),
|
|
127
|
-
setJackpotList: assign((context, event) => {
|
|
128
|
-
const { jackpotList } = event.data
|
|
129
|
-
return {
|
|
130
|
-
jackpotList,
|
|
131
|
-
}
|
|
132
|
-
}),
|
|
133
126
|
setActivitiesDetailList: assign((context, event) => {
|
|
134
127
|
return {
|
|
135
128
|
activitiesDetailList: event.data.map((item) => item.data),
|
|
@@ -169,13 +162,12 @@ export default function (request) {
|
|
|
169
162
|
const hasToken = request.getToken()
|
|
170
163
|
const isDoubleWallet = context.siteConfig?.walletMode === '4'
|
|
171
164
|
const apiCallable = hasToken && isDoubleWallet
|
|
172
|
-
const [{ data }, promotionList
|
|
165
|
+
const [{ data }, promotionList] = await Promise.all([
|
|
173
166
|
request.send(activity.getActivityList({ appSecret })),
|
|
174
167
|
apiCallable ? request.send(payment.getPromotionsList()) : [],
|
|
175
|
-
request.send(activity.getJackpotList({ appSecret })),
|
|
176
168
|
])
|
|
177
169
|
|
|
178
|
-
return { activityList: data, promotionList
|
|
170
|
+
return { activityList: data, promotionList }
|
|
179
171
|
},
|
|
180
172
|
fetchActivitiesDetail: async (context, event) => {
|
|
181
173
|
await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
|
|
@@ -13,7 +13,6 @@ export default function (request) {
|
|
|
13
13
|
activityList: [],
|
|
14
14
|
tournamentList: [],
|
|
15
15
|
promotionList: [],
|
|
16
|
-
jackpotList: [],
|
|
17
16
|
uidSite: '',
|
|
18
17
|
detailNeededActivityTypes: [29, 34],
|
|
19
18
|
activityDetailList: [],
|
|
@@ -24,7 +23,7 @@ export default function (request) {
|
|
|
24
23
|
src: 'fetchList',
|
|
25
24
|
onDone: {
|
|
26
25
|
target: 'checking',
|
|
27
|
-
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'
|
|
26
|
+
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'],
|
|
28
27
|
},
|
|
29
28
|
onError: {
|
|
30
29
|
target: 'pending',
|
|
@@ -97,12 +96,6 @@ export default function (request) {
|
|
|
97
96
|
promotionList,
|
|
98
97
|
}
|
|
99
98
|
}),
|
|
100
|
-
setJackpotList: assign((context, event) => {
|
|
101
|
-
const { jackpotList } = event.data
|
|
102
|
-
return {
|
|
103
|
-
jackpotList,
|
|
104
|
-
}
|
|
105
|
-
}),
|
|
106
99
|
setUnread: assign((context, event) => {
|
|
107
100
|
const { uidSite, activityNo, unread } = event.data
|
|
108
101
|
const list = JSON.parse(JSON.stringify(context.activityList))
|
|
@@ -139,13 +132,12 @@ export default function (request) {
|
|
|
139
132
|
services: {
|
|
140
133
|
fetchList: async (context, event) => {
|
|
141
134
|
const hasToken = request.getToken()
|
|
142
|
-
const [{ data }, promotionList
|
|
135
|
+
const [{ data }, promotionList] = await Promise.all([
|
|
143
136
|
request.send(activity.getActivityList({ appSecret })),
|
|
144
137
|
hasToken ? request.send(payment.getPromotionsList()) : [],
|
|
145
|
-
request.send(activity.getJackpotList({ appSecret })),
|
|
146
138
|
])
|
|
147
139
|
|
|
148
|
-
return { activityList: data, promotionList
|
|
140
|
+
return { activityList: data, promotionList }
|
|
149
141
|
},
|
|
150
142
|
fetchActivityDetailList: async (context, event) => {
|
|
151
143
|
await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
|
|
@@ -14,7 +14,6 @@ export default function (request, context) {
|
|
|
14
14
|
|
|
15
15
|
// 領獎後得到的資訊
|
|
16
16
|
amount: null,
|
|
17
|
-
rewardType: null,
|
|
18
17
|
message: null,
|
|
19
18
|
canReceiveQuantity: null,
|
|
20
19
|
receivedQuantity: null,
|
|
@@ -109,10 +108,9 @@ export default function (request, context) {
|
|
|
109
108
|
}
|
|
110
109
|
}),
|
|
111
110
|
setAward: assign((context, event) => {
|
|
112
|
-
const { amount,
|
|
111
|
+
const { amount, message, canReceiveQuantity, receivedQuantity } = event.data
|
|
113
112
|
return {
|
|
114
113
|
amount,
|
|
115
|
-
rewardType,
|
|
116
114
|
message,
|
|
117
115
|
canReceiveQuantity,
|
|
118
116
|
receivedQuantity,
|
|
@@ -126,7 +124,6 @@ export default function (request, context) {
|
|
|
126
124
|
resetAward: assign((context, event) => {
|
|
127
125
|
return {
|
|
128
126
|
amount: null,
|
|
129
|
-
rewardType: null,
|
|
130
127
|
message: null,
|
|
131
128
|
}
|
|
132
129
|
}),
|
|
@@ -13,7 +13,6 @@ export default function (request) {
|
|
|
13
13
|
settlementTime: null,
|
|
14
14
|
validTurnover: null,
|
|
15
15
|
rebateAmount: null,
|
|
16
|
-
rewardType: null,
|
|
17
16
|
singleMinimumAmountReceive: null,
|
|
18
17
|
remainingCount: 0,
|
|
19
18
|
dailyRedemptionLimit: 0,
|
|
@@ -130,7 +129,6 @@ export default function (request) {
|
|
|
130
129
|
settlementTime = 0,
|
|
131
130
|
validTurnover = '0',
|
|
132
131
|
rebateAmount = '0',
|
|
133
|
-
rewardType = null,
|
|
134
132
|
singleMinimumAmountReceive = 0,
|
|
135
133
|
remainingCount = 0,
|
|
136
134
|
dailyRedemptionLimit = 0,
|
|
@@ -142,7 +140,6 @@ export default function (request) {
|
|
|
142
140
|
settlementTime,
|
|
143
141
|
validTurnover,
|
|
144
142
|
rebateAmount,
|
|
145
|
-
rewardType,
|
|
146
143
|
singleMinimumAmountReceive,
|
|
147
144
|
remainingCount,
|
|
148
145
|
dailyRedemptionLimit,
|
|
@@ -10,19 +10,8 @@ export default function (request) {
|
|
|
10
10
|
initial: 'fetching',
|
|
11
11
|
context: {
|
|
12
12
|
hasAnyAccount: false,
|
|
13
|
-
|
|
14
|
-
bankList: [],
|
|
15
|
-
cryptoList: [],
|
|
16
|
-
ewalletList: [],
|
|
17
|
-
},
|
|
18
|
-
currency: null,
|
|
19
|
-
bindingType: 'BANK',
|
|
13
|
+
bankList: [],
|
|
20
14
|
bank: null,
|
|
21
|
-
ifscCode: null,
|
|
22
|
-
crypto: null,
|
|
23
|
-
network: null,
|
|
24
|
-
cryptoAddress: null,
|
|
25
|
-
walletCode: null,
|
|
26
15
|
branch: null,
|
|
27
16
|
branchCode: null,
|
|
28
17
|
accountNumber: null,
|
|
@@ -44,13 +33,6 @@ export default function (request) {
|
|
|
44
33
|
},
|
|
45
34
|
idle: {
|
|
46
35
|
on: {
|
|
47
|
-
SET_BIND_TYPE: {
|
|
48
|
-
actions: assign((context, event) => {
|
|
49
|
-
return {
|
|
50
|
-
bindingType: event.data,
|
|
51
|
-
}
|
|
52
|
-
}),
|
|
53
|
-
},
|
|
54
36
|
SET_BANK_CODE: {
|
|
55
37
|
actions: assign((context, event) => {
|
|
56
38
|
return {
|
|
@@ -58,34 +40,6 @@ export default function (request) {
|
|
|
58
40
|
}
|
|
59
41
|
}),
|
|
60
42
|
},
|
|
61
|
-
SET_CRYPTO_CODE: {
|
|
62
|
-
actions: assign((context, event) => {
|
|
63
|
-
return {
|
|
64
|
-
crypto: event.data,
|
|
65
|
-
}
|
|
66
|
-
}),
|
|
67
|
-
},
|
|
68
|
-
SET_NETWORK_CODE: {
|
|
69
|
-
actions: assign((context, event) => {
|
|
70
|
-
return {
|
|
71
|
-
network: event.data,
|
|
72
|
-
}
|
|
73
|
-
}),
|
|
74
|
-
},
|
|
75
|
-
SET_CRYPTO_ADDRESS: {
|
|
76
|
-
actions: assign((context, event) => {
|
|
77
|
-
return {
|
|
78
|
-
cryptoAddress: event.data,
|
|
79
|
-
}
|
|
80
|
-
}),
|
|
81
|
-
},
|
|
82
|
-
SET_WALLET_CODE: {
|
|
83
|
-
actions: assign((context, event) => {
|
|
84
|
-
return {
|
|
85
|
-
walletCode: event.data,
|
|
86
|
-
}
|
|
87
|
-
}),
|
|
88
|
-
},
|
|
89
43
|
SET_BRANCH: {
|
|
90
44
|
actions: assign((context, event) => {
|
|
91
45
|
return {
|
|
@@ -114,6 +68,10 @@ export default function (request) {
|
|
|
114
68
|
}
|
|
115
69
|
}),
|
|
116
70
|
},
|
|
71
|
+
BIND_BANK: {
|
|
72
|
+
target: 'binding',
|
|
73
|
+
cond: 'isBindable',
|
|
74
|
+
},
|
|
117
75
|
SET_PIX_TYPE: {
|
|
118
76
|
actions: assign((context, event) => {
|
|
119
77
|
return {
|
|
@@ -121,17 +79,6 @@ export default function (request) {
|
|
|
121
79
|
}
|
|
122
80
|
}),
|
|
123
81
|
},
|
|
124
|
-
SET_IFSC_CODE: {
|
|
125
|
-
actions: assign((context, event) => {
|
|
126
|
-
return {
|
|
127
|
-
ifscCode: event.data,
|
|
128
|
-
}
|
|
129
|
-
}),
|
|
130
|
-
},
|
|
131
|
-
BIND_BANK: {
|
|
132
|
-
target: 'binding',
|
|
133
|
-
cond: 'isBindable',
|
|
134
|
-
},
|
|
135
82
|
},
|
|
136
83
|
},
|
|
137
84
|
binding: {
|
|
@@ -151,61 +98,35 @@ export default function (request) {
|
|
|
151
98
|
{
|
|
152
99
|
actions: {
|
|
153
100
|
setBanks: assign((context, event) => {
|
|
154
|
-
const {
|
|
101
|
+
const { bankList = [], paymentInfo = {} } = event.data
|
|
155
102
|
const { bankInfo = [] } = paymentInfo
|
|
156
103
|
return {
|
|
157
104
|
hasAnyAccount: bankInfo.length > 0,
|
|
158
105
|
holderName: bankInfo[0]?.holderName,
|
|
159
|
-
|
|
106
|
+
bankList,
|
|
160
107
|
bank: null, // 不預選銀行,玩家可能不知道這裡可以選 by Gordan
|
|
161
108
|
}
|
|
162
109
|
}),
|
|
163
110
|
},
|
|
164
111
|
guards: {
|
|
165
112
|
isBindable: (context, event) => {
|
|
166
|
-
const {
|
|
167
|
-
|
|
168
|
-
if (bindingType === 'CRYPTO') {
|
|
169
|
-
// 虛擬貨幣
|
|
170
|
-
const { crypto, network, cryptoAddress, holderName } = context
|
|
171
|
-
return crypto && network && cryptoAddress && holderName
|
|
172
|
-
} else if (bindingType === 'EWALLET') {
|
|
173
|
-
// 電子錢包
|
|
174
|
-
const { walletCode, accountNumber, holderName } = context
|
|
175
|
-
return walletCode?.bankCode && accountNumber && holderName
|
|
176
|
-
} else {
|
|
177
|
-
// 一般銀行
|
|
178
|
-
if (currency === 'INR') {
|
|
179
|
-
// 如果是印度幣別
|
|
180
|
-
const { bank, ifscCode, accountNumber, branch, holderName } = context
|
|
181
|
-
return bank.bankCode && ifscCode && accountNumber && branch && holderName
|
|
182
|
-
} else {
|
|
183
|
-
const { bank, accountNumber, branch, holderName } = context
|
|
184
|
-
return bank.bankCode && accountNumber && branch && holderName
|
|
185
|
-
}
|
|
186
|
-
}
|
|
113
|
+
const { bank, accountNumber, branch, holderName } = context
|
|
114
|
+
return bank.bankCode && accountNumber && branch && holderName
|
|
187
115
|
},
|
|
188
116
|
},
|
|
189
117
|
services: {
|
|
190
118
|
fetchInitData: async (context, event) => {
|
|
191
|
-
const [
|
|
192
|
-
request.send(payment.
|
|
119
|
+
const [bankList, paymentInfo] = await Promise.all([
|
|
120
|
+
request.send(payment.getBindingBankList({ appSecret })),
|
|
193
121
|
request.send(payment.getPaymentInfo()),
|
|
194
122
|
])
|
|
195
|
-
return {
|
|
123
|
+
return { bankList, paymentInfo }
|
|
196
124
|
},
|
|
197
125
|
updatePaymentInfo: async (context, event) => {
|
|
198
|
-
const {
|
|
199
|
-
context
|
|
126
|
+
const { bank, branch, branchCode, accountNumber, holderName, pixType } = context
|
|
200
127
|
return await request.send(
|
|
201
128
|
payment.updatePaymentInfo({
|
|
202
|
-
|
|
203
|
-
ifscCode,
|
|
204
|
-
bankCode: bank?.bankCode || '',
|
|
205
|
-
cryptoCurrency: crypto?.symbol || '',
|
|
206
|
-
cryptoNetwork: network?.label || '',
|
|
207
|
-
cryptoAddress: cryptoAddress,
|
|
208
|
-
walletCode: walletCode?.bankCode || '',
|
|
129
|
+
bankCode: bank.bankCode,
|
|
209
130
|
branch: branch === 'BLANK' ? '' : branch, // 'BLANK'會置換成空值
|
|
210
131
|
branchCode,
|
|
211
132
|
bankAccount: accountNumber,
|
package/src/machine/common.js
CHANGED
|
@@ -286,18 +286,7 @@ export default function (request) {
|
|
|
286
286
|
services: {
|
|
287
287
|
fetchConfig: async (context, event) => {
|
|
288
288
|
const [site, layout] = await Promise.all([request.send(api.getConfig({ appSecret })), request.send(api.getLayoutConfig({ appSecret }))])
|
|
289
|
-
|
|
290
|
-
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')
|
|
291
|
-
const decodeResult = decodeURIComponent(
|
|
292
|
-
window
|
|
293
|
-
.atob(base64)
|
|
294
|
-
.split('')
|
|
295
|
-
.map((c) => {
|
|
296
|
-
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
|
|
297
|
-
})
|
|
298
|
-
.join('')
|
|
299
|
-
)
|
|
300
|
-
return { siteConfig: JSON.parse(decodeResult), layoutConfig: layout.config }
|
|
289
|
+
return { siteConfig: JSON.parse(window.atob(site.config)), layoutConfig: layout.config }
|
|
301
290
|
},
|
|
302
291
|
fetchFeeds: async (context, event) => {
|
|
303
292
|
return await request.send(api.feeds({ appSecret }))
|
|
@@ -54,7 +54,7 @@ export default function (request) {
|
|
|
54
54
|
actions: {
|
|
55
55
|
setUserAccount: assign((context, event) => {
|
|
56
56
|
return {
|
|
57
|
-
userAccount: event.data?.[0],
|
|
57
|
+
userAccount: event.data.bankInfo?.[0],
|
|
58
58
|
}
|
|
59
59
|
}),
|
|
60
60
|
setInitialization: assign((context, event) => {
|
|
@@ -69,14 +69,12 @@ export default function (request) {
|
|
|
69
69
|
},
|
|
70
70
|
guards: {
|
|
71
71
|
hasUserAccount: (context, event) => {
|
|
72
|
-
return event.data?.[0]
|
|
72
|
+
return event.data.bankInfo?.[0]
|
|
73
73
|
},
|
|
74
74
|
},
|
|
75
75
|
services: {
|
|
76
76
|
fetchPaymentInfo: async (context, event) => {
|
|
77
|
-
|
|
78
|
-
const filterArray = bankInfo?.filter((item) => item.bindingType !== 'CRYPTO' && item.bindingType !== 'EWALLET')
|
|
79
|
-
return filterArray || []
|
|
77
|
+
return await request.send(payment.getPaymentInfo())
|
|
80
78
|
},
|
|
81
79
|
initialize: async (context, event) => {
|
|
82
80
|
const { method } = context
|
|
@@ -152,9 +152,7 @@ export default function (request, context) {
|
|
|
152
152
|
setAmount: assign((context, event) => {
|
|
153
153
|
// 現金網可自由填額度,grandTotalEnable 欄位感覺不再需要?
|
|
154
154
|
if (context.selectedCrypto?.grandTotalEnable === 1) {
|
|
155
|
-
return {
|
|
156
|
-
selectedAmount: preciseAdd(`${parseFloat(context.selectedAmount || 0)}`, `${parseFloat(event.data)}`),
|
|
157
|
-
}
|
|
155
|
+
return { selectedAmount: parseFloat(context.selectedAmount || 0) + parseFloat(event.data) }
|
|
158
156
|
} else {
|
|
159
157
|
return { selectedAmount: event.data }
|
|
160
158
|
}
|
|
@@ -242,15 +240,3 @@ export default function (request, context) {
|
|
|
242
240
|
}
|
|
243
241
|
)
|
|
244
242
|
}
|
|
245
|
-
|
|
246
|
-
function preciseAdd(a, b) {
|
|
247
|
-
let aStr = a.toString()
|
|
248
|
-
let bStr = b.toString()
|
|
249
|
-
|
|
250
|
-
let aDecimalPlaces = aStr.split('.')[1] ? aStr.split('.')[1].length : 0
|
|
251
|
-
let bDecimalPlaces = bStr.split('.')[1] ? bStr.split('.')[1].length : 0
|
|
252
|
-
|
|
253
|
-
let factor = Math.pow(10, Math.max(aDecimalPlaces, bDecimalPlaces))
|
|
254
|
-
|
|
255
|
-
return (Math.round(a * factor) + Math.round(b * factor)) / factor
|
|
256
|
-
}
|
|
@@ -245,7 +245,7 @@ export default function (request) {
|
|
|
245
245
|
actions: {
|
|
246
246
|
setUserAccount: assign((context, event) => {
|
|
247
247
|
return {
|
|
248
|
-
userAccount: event.data?.[0],
|
|
248
|
+
userAccount: event.data.bankInfo?.[0],
|
|
249
249
|
}
|
|
250
250
|
}),
|
|
251
251
|
setPromotion: assign((context, event) => {
|
|
@@ -310,7 +310,7 @@ export default function (request) {
|
|
|
310
310
|
},
|
|
311
311
|
guards: {
|
|
312
312
|
hasUserAccount: (context, event) => {
|
|
313
|
-
return event.data?.[0]
|
|
313
|
+
return event.data.bankInfo?.[0]
|
|
314
314
|
},
|
|
315
315
|
isGrandTotalEnable: (context, event) => {
|
|
316
316
|
return context.grandTotalEnable === 1
|
|
@@ -318,9 +318,7 @@ export default function (request) {
|
|
|
318
318
|
},
|
|
319
319
|
services: {
|
|
320
320
|
fetchPaymentInfo: async (context, event) => {
|
|
321
|
-
|
|
322
|
-
const filterArray = bankInfo?.filter((item) => item.bindingType !== 'CRYPTO' && item.bindingType !== 'EWALLET')
|
|
323
|
-
return filterArray || []
|
|
321
|
+
return await request.send(payment.getPaymentInfo())
|
|
324
322
|
},
|
|
325
323
|
initialize: async (context, event) => {
|
|
326
324
|
const [{ config }, payments, bankList] = await Promise.all([
|