@jetthai/cuora 1.1.355-qa-1 → 1.1.355
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 +0 -2
- package/package.json +1 -1
- package/src/api/game.js +0 -1
- package/src/machine/activity/activity.js +6 -1
- package/src/machine/activity/activity_cash.js +4 -0
- package/src/machine/deposit/direct.js +6 -2
- package/src/machine/deposit/float.js +2 -2
- package/src/machine/deposit/loadcard_vn.js +51 -10
- package/src/machine/deposit/manual_vn.js +23 -3
- package/src/machine/deposit/qrcode_v2.js +132 -6
- package/src/machine/deposit/virtual_bank_vn.js +31 -3
- package/src/machine/deposit/vpay.js +2 -2
- package/src/machine/game_v2_1.js +6 -59
- package/src/machine/promotions.js +5 -4
- package/src/machine/websocket.js +0 -12
- package/src/machine/withdraw/withdraw_crypto.js +3 -1
- package/src/machine/withdraw/withdraw_crypto2.js +1 -1
- package/src/machine/withdraw/withdraw_manual.js +2 -1
- package/src/machine/withdraw/withdraw_vn.js +3 -1
- package/src/machine/withdraw/withdraw_vn2.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
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.355-qa-1](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.355-qa-1) (2025-04-25)
|
|
6
|
-
|
|
7
5
|
### [1.1.355](https://github.com/jetthai/cuora-module/compare/v1.1.353-data-1...v1.1.355) (2025-04-22)
|
|
8
6
|
|
|
9
7
|
### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.354) (2025-04-14)
|
package/package.json
CHANGED
package/src/api/game.js
CHANGED
|
@@ -4,7 +4,6 @@ export default {
|
|
|
4
4
|
removeFavoriteGame: (code) => ({ method: 'post', url: 'game/myfavorite/remove', params: { games: [code] } }),
|
|
5
5
|
getStatements: () => ({ url: 'game/statements', method: 'get' }),
|
|
6
6
|
playGame: (params) => ({ url: 'game/play', method: 'get', params }),
|
|
7
|
-
demoGame: (params) => ({ url: 'game/demo', method: 'get', params, isPublic: true }),
|
|
8
7
|
logoutGame: ({ uid_site, provider_id }) => ({ url: 'game/logout', method: 'get', params: { uid_site, provider_id } }),
|
|
9
8
|
|
|
10
9
|
getGameTags: ({ q, lang }) => ({ url: 'game/search', method: 'get', params: { q, lang } }),
|
|
@@ -152,8 +152,12 @@ export default function (request) {
|
|
|
152
152
|
}
|
|
153
153
|
}),
|
|
154
154
|
resetActivities: assign((context, event) => {
|
|
155
|
+
const { activityList = [], specifyActivities = [] } = context
|
|
156
|
+
const keepActivities = activityList.filter((activity) => specifyActivities.includes(activity.activityType))
|
|
155
157
|
return {
|
|
156
158
|
isPlaying: true,
|
|
159
|
+
activityList: keepActivities,
|
|
160
|
+
promotionList: [],
|
|
157
161
|
}
|
|
158
162
|
}),
|
|
159
163
|
leaveGame: assign((context, event) => {
|
|
@@ -184,7 +188,8 @@ export default function (request) {
|
|
|
184
188
|
services: {
|
|
185
189
|
fetchList: async (context, event) => {
|
|
186
190
|
const hasToken = request.getToken()
|
|
187
|
-
const
|
|
191
|
+
const isDoubleWallet = context.siteConfig?.walletMode === '4'
|
|
192
|
+
const apiCallable = hasToken && isDoubleWallet
|
|
188
193
|
const [{ data }, promotionList] = await Promise.all([
|
|
189
194
|
hasToken ? request.send(activity.getActivityList({ appSecret })) : request.send(activity.getAllActivityList({ appSecret })),
|
|
190
195
|
apiCallable && !context.isPlaying ? request.send(payment.getPromotionsList()) : [],
|
|
@@ -123,8 +123,12 @@ export default function (request) {
|
|
|
123
123
|
}
|
|
124
124
|
}),
|
|
125
125
|
resetActivities: assign((context, event) => {
|
|
126
|
+
const { activityList = [], detailNeededActivityTypes = [] } = context
|
|
127
|
+
const keepActivities = activityList.filter((activity) => detailNeededActivityTypes.includes(activity.activityType))
|
|
126
128
|
return {
|
|
127
129
|
isPlaying: true,
|
|
130
|
+
activityList: keepActivities,
|
|
131
|
+
promotionList: [],
|
|
128
132
|
}
|
|
129
133
|
}),
|
|
130
134
|
leaveGame: assign((context, event) => {
|
|
@@ -58,6 +58,7 @@ export default function (request) {
|
|
|
58
58
|
always: [
|
|
59
59
|
{
|
|
60
60
|
target: 'loaded',
|
|
61
|
+
cond: 'isDoubleWalletMode',
|
|
61
62
|
},
|
|
62
63
|
{
|
|
63
64
|
target: 'calculating',
|
|
@@ -90,7 +91,7 @@ export default function (request) {
|
|
|
90
91
|
SUBMIT: [
|
|
91
92
|
{
|
|
92
93
|
target: 'pending',
|
|
93
|
-
cond: (context, event) => !!context.calculation,
|
|
94
|
+
cond: (context, event) => context.siteConfig?.walletMode === '4' && !!context.calculation,
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
97
|
target: 'submitting',
|
|
@@ -128,7 +129,7 @@ export default function (request) {
|
|
|
128
129
|
SUBMIT: [
|
|
129
130
|
{
|
|
130
131
|
target: 'pending',
|
|
131
|
-
cond: (context, event) => !!context.calculation,
|
|
132
|
+
cond: (context, event) => context.siteConfig?.walletMode === '4' && !!context.calculation,
|
|
132
133
|
},
|
|
133
134
|
{
|
|
134
135
|
target: 'submitting',
|
|
@@ -246,6 +247,9 @@ export default function (request) {
|
|
|
246
247
|
}),
|
|
247
248
|
},
|
|
248
249
|
guards: {
|
|
250
|
+
isDoubleWalletMode: (context, event) => {
|
|
251
|
+
return context.siteConfig?.walletMode === '4'
|
|
252
|
+
},
|
|
249
253
|
isCalculable: (context, event) => {
|
|
250
254
|
const {
|
|
251
255
|
amount,
|
|
@@ -72,8 +72,8 @@ export default function (request) {
|
|
|
72
72
|
target: 'fetching',
|
|
73
73
|
cond: (context, event) => {
|
|
74
74
|
const { siteConfig = {}, promotion = {} } = context
|
|
75
|
-
const { bonusPreviewEnable } = siteConfig
|
|
76
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
75
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
76
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
77
77
|
},
|
|
78
78
|
},
|
|
79
79
|
{ target: 'loaded' },
|
|
@@ -49,8 +49,8 @@ export default function (request) {
|
|
|
49
49
|
target: 'fetching',
|
|
50
50
|
cond: (context, event) => {
|
|
51
51
|
const { siteConfig = {}, promotion = {}, selectedCard } = context
|
|
52
|
-
const { bonusPreviewEnable } = siteConfig
|
|
53
|
-
return !!selectedCard && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
52
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
53
|
+
return !!selectedCard && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
54
54
|
},
|
|
55
55
|
},
|
|
56
56
|
{ target: 'loaded' },
|
|
@@ -78,8 +78,8 @@ export default function (request) {
|
|
|
78
78
|
actions: 'setCard',
|
|
79
79
|
cond: (context, event) => {
|
|
80
80
|
const { siteConfig = {}, promotion = {} } = context
|
|
81
|
-
const { bonusPreviewEnable } = siteConfig
|
|
82
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
81
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
82
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
83
83
|
},
|
|
84
84
|
},
|
|
85
85
|
{
|
|
@@ -87,6 +87,11 @@ export default function (request) {
|
|
|
87
87
|
},
|
|
88
88
|
],
|
|
89
89
|
SELECT_AMOUNT: [
|
|
90
|
+
{
|
|
91
|
+
target: 'pending',
|
|
92
|
+
actions: 'setAmount',
|
|
93
|
+
cond: 'isFreeWalletMode',
|
|
94
|
+
},
|
|
90
95
|
{
|
|
91
96
|
target: 'debouncing',
|
|
92
97
|
actions: 'setAmount',
|
|
@@ -94,6 +99,19 @@ export default function (request) {
|
|
|
94
99
|
],
|
|
95
100
|
},
|
|
96
101
|
},
|
|
102
|
+
pending: {
|
|
103
|
+
on: {
|
|
104
|
+
SELECT_AMOUNT: {
|
|
105
|
+
actions: 'setAmount',
|
|
106
|
+
},
|
|
107
|
+
CONFIRM: {
|
|
108
|
+
target: 'debouncing',
|
|
109
|
+
},
|
|
110
|
+
BACK: {
|
|
111
|
+
target: 'loaded',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
97
115
|
debouncing: {
|
|
98
116
|
on: {
|
|
99
117
|
SELECT_AMOUNT: {
|
|
@@ -114,6 +132,19 @@ export default function (request) {
|
|
|
114
132
|
invoke: {
|
|
115
133
|
src: 'fetchCalculation',
|
|
116
134
|
onDone: [
|
|
135
|
+
{
|
|
136
|
+
target: 'submitting',
|
|
137
|
+
actions: 'setCalculation',
|
|
138
|
+
cond: (context, event) => {
|
|
139
|
+
const { siteConfig = {}, selectedCard = {} } = context
|
|
140
|
+
return siteConfig.walletMode === '2' && selectedCard.jumpLinkEnable === 1
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
target: 'cardInfo',
|
|
145
|
+
actions: 'setCalculation',
|
|
146
|
+
cond: 'isFreeWalletMode',
|
|
147
|
+
},
|
|
117
148
|
{
|
|
118
149
|
target: 'calculated',
|
|
119
150
|
actions: 'setCalculation',
|
|
@@ -127,10 +158,17 @@ export default function (request) {
|
|
|
127
158
|
calculable: {
|
|
128
159
|
entry: 'clearCalculation',
|
|
129
160
|
on: {
|
|
130
|
-
SELECT_AMOUNT:
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
161
|
+
SELECT_AMOUNT: [
|
|
162
|
+
{
|
|
163
|
+
target: 'pending',
|
|
164
|
+
actions: 'setAmount',
|
|
165
|
+
cond: 'isFreeWalletMode',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
target: 'debouncing',
|
|
169
|
+
actions: 'setAmount',
|
|
170
|
+
},
|
|
171
|
+
],
|
|
134
172
|
BACK: {
|
|
135
173
|
target: 'loaded',
|
|
136
174
|
},
|
|
@@ -178,8 +216,8 @@ export default function (request) {
|
|
|
178
216
|
actions: 'setCard',
|
|
179
217
|
cond: (context, event) => {
|
|
180
218
|
const { siteConfig = {}, promotion = {} } = context
|
|
181
|
-
const { bonusPreviewEnable } = siteConfig
|
|
182
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
219
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
220
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
183
221
|
},
|
|
184
222
|
},
|
|
185
223
|
{
|
|
@@ -287,6 +325,9 @@ export default function (request) {
|
|
|
287
325
|
}),
|
|
288
326
|
},
|
|
289
327
|
guards: {
|
|
328
|
+
isFreeWalletMode: (context, event) => {
|
|
329
|
+
return context.siteConfig?.walletMode === '2'
|
|
330
|
+
},
|
|
290
331
|
isSubmittable: (context, event) => {
|
|
291
332
|
const { cardNumber, serialNumber } = context
|
|
292
333
|
return cardNumber && serialNumber
|
|
@@ -75,8 +75,24 @@ export default function (request) {
|
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
77
|
step1: {
|
|
78
|
-
initial: '
|
|
78
|
+
initial: 'promotion',
|
|
79
79
|
states: {
|
|
80
|
+
promotion: {
|
|
81
|
+
always: [
|
|
82
|
+
{
|
|
83
|
+
target: 'idle',
|
|
84
|
+
cond: 'isDoubleWalletMode',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
target: 'calculating',
|
|
88
|
+
actions: 'setPromotionDefaultAmount',
|
|
89
|
+
cond: 'hasMinPromotionDeposit',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
target: 'idle',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
80
96
|
idle: {},
|
|
81
97
|
calculating: {
|
|
82
98
|
invoke: {
|
|
@@ -121,10 +137,11 @@ export default function (request) {
|
|
|
121
137
|
{
|
|
122
138
|
target: 'pending',
|
|
123
139
|
cond: (context, event) => {
|
|
124
|
-
const { calculation, promotion } = context
|
|
140
|
+
const { siteConfig = {}, calculation, promotion } = context
|
|
141
|
+
const { walletMode } = siteConfig
|
|
125
142
|
const { promotionsNo, activityNo } = promotion
|
|
126
143
|
const isNoBonus = promotionsNo === 'none' || activityNo === 'none'
|
|
127
|
-
return !!calculation && !isNoBonus
|
|
144
|
+
return walletMode === '4' && !!calculation && !isNoBonus
|
|
128
145
|
},
|
|
129
146
|
},
|
|
130
147
|
{
|
|
@@ -368,6 +385,9 @@ export default function (request) {
|
|
|
368
385
|
}),
|
|
369
386
|
},
|
|
370
387
|
guards: {
|
|
388
|
+
isDoubleWalletMode: (context, event) => {
|
|
389
|
+
return context.siteConfig?.walletMode === '4'
|
|
390
|
+
},
|
|
371
391
|
isCalculable: (context, event) => {
|
|
372
392
|
const {
|
|
373
393
|
amount,
|
|
@@ -49,8 +49,16 @@ export default function (request) {
|
|
|
49
49
|
target: 'fetching',
|
|
50
50
|
cond: (context, event) => {
|
|
51
51
|
const { siteConfig = {}, promotion = {}, selectedQrcode } = context
|
|
52
|
-
const { bonusPreviewEnable } = siteConfig
|
|
53
|
-
return !!selectedQrcode && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
52
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
53
|
+
return !!selectedQrcode && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
target: 'debouncing',
|
|
58
|
+
actions: 'setPromotionDefaultAmount',
|
|
59
|
+
cond: (context, event) => {
|
|
60
|
+
const { siteConfig = {}, promotion = {} } = context
|
|
61
|
+
return siteConfig.walletMode === '3' && !!promotion?.minimumAmount
|
|
54
62
|
},
|
|
55
63
|
},
|
|
56
64
|
{ target: 'loaded' },
|
|
@@ -78,21 +86,51 @@ export default function (request) {
|
|
|
78
86
|
actions: 'setQrcode',
|
|
79
87
|
cond: (context, event) => {
|
|
80
88
|
const { siteConfig = {}, promotion = {} } = context
|
|
81
|
-
const { bonusPreviewEnable } = siteConfig
|
|
82
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
89
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
90
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
83
91
|
},
|
|
84
92
|
},
|
|
93
|
+
{
|
|
94
|
+
target: 'debouncing',
|
|
95
|
+
actions: ['setQrcode', 'setPromotionDefaultAmount'],
|
|
96
|
+
cond: (context, event) => context.siteConfig?.walletMode === '3' && context.promotion?.minimumAmount,
|
|
97
|
+
},
|
|
85
98
|
{
|
|
86
99
|
actions: 'setQrcode',
|
|
87
100
|
},
|
|
88
101
|
],
|
|
89
102
|
SELECT_AMOUNT: [
|
|
103
|
+
{
|
|
104
|
+
target: 'debouncing',
|
|
105
|
+
actions: 'setAmount',
|
|
106
|
+
cond: 'isDoubleWalletMode',
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
target: 'pending',
|
|
110
|
+
actions: 'addAmount',
|
|
111
|
+
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
target: 'pending',
|
|
115
|
+
actions: 'setAmount',
|
|
116
|
+
cond: 'isFreeWalletMode',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
target: 'debouncing',
|
|
120
|
+
actions: 'addAmount',
|
|
121
|
+
cond: 'isGrandTotalEnable',
|
|
122
|
+
},
|
|
90
123
|
{
|
|
91
124
|
target: 'debouncing',
|
|
92
125
|
actions: 'setAmount',
|
|
93
126
|
},
|
|
94
127
|
],
|
|
95
128
|
KEY_IN: [
|
|
129
|
+
{
|
|
130
|
+
target: 'pending',
|
|
131
|
+
actions: 'setAmount',
|
|
132
|
+
cond: 'isFreeWalletMode',
|
|
133
|
+
},
|
|
96
134
|
{
|
|
97
135
|
target: 'calculating',
|
|
98
136
|
actions: 'setAmount',
|
|
@@ -100,9 +138,51 @@ export default function (request) {
|
|
|
100
138
|
],
|
|
101
139
|
},
|
|
102
140
|
},
|
|
141
|
+
pending: {
|
|
142
|
+
on: {
|
|
143
|
+
SELECT_AMOUNT: [
|
|
144
|
+
{
|
|
145
|
+
actions: 'addAmount',
|
|
146
|
+
cond: 'isGrandTotalEnable',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
actions: 'setAmount',
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
KEY_IN: {
|
|
153
|
+
actions: 'setAmount',
|
|
154
|
+
},
|
|
155
|
+
CONFIRM: {
|
|
156
|
+
target: 'calculating',
|
|
157
|
+
},
|
|
158
|
+
BACK: {
|
|
159
|
+
target: 'loaded',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
103
163
|
debouncing: {
|
|
104
164
|
on: {
|
|
105
165
|
SELECT_AMOUNT: [
|
|
166
|
+
{
|
|
167
|
+
target: 'debouncing',
|
|
168
|
+
actions: 'setAmount',
|
|
169
|
+
cond: 'isDoubleWalletMode',
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
target: 'debouncing',
|
|
173
|
+
actions: 'addAmount',
|
|
174
|
+
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
target: 'debouncing',
|
|
178
|
+
actions: 'setAmount',
|
|
179
|
+
cond: 'isFreeWalletMode',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
target: 'debouncing',
|
|
183
|
+
actions: 'addAmount',
|
|
184
|
+
cond: 'isGrandTotalEnable',
|
|
185
|
+
},
|
|
106
186
|
{
|
|
107
187
|
target: 'debouncing',
|
|
108
188
|
actions: 'setAmount',
|
|
@@ -122,6 +202,26 @@ export default function (request) {
|
|
|
122
202
|
entry: 'clearCalculation',
|
|
123
203
|
on: {
|
|
124
204
|
SELECT_AMOUNT: [
|
|
205
|
+
{
|
|
206
|
+
target: 'debouncing',
|
|
207
|
+
actions: 'setAmount',
|
|
208
|
+
cond: 'isDoubleWalletMode',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
target: 'pending',
|
|
212
|
+
actions: 'addAmount',
|
|
213
|
+
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
target: 'pending',
|
|
217
|
+
actions: 'setAmount',
|
|
218
|
+
cond: 'isFreeWalletMode',
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
target: 'debouncing',
|
|
222
|
+
actions: 'addAmount',
|
|
223
|
+
cond: 'isGrandTotalEnable',
|
|
224
|
+
},
|
|
125
225
|
{
|
|
126
226
|
target: 'debouncing',
|
|
127
227
|
actions: 'setAmount',
|
|
@@ -140,6 +240,11 @@ export default function (request) {
|
|
|
140
240
|
invoke: {
|
|
141
241
|
src: 'fetchCalculation',
|
|
142
242
|
onDone: [
|
|
243
|
+
{
|
|
244
|
+
target: 'submitting',
|
|
245
|
+
actions: 'setCalculation',
|
|
246
|
+
cond: 'isFreeWalletMode',
|
|
247
|
+
},
|
|
143
248
|
{
|
|
144
249
|
target: 'calculated',
|
|
145
250
|
actions: 'setCalculation',
|
|
@@ -153,6 +258,16 @@ export default function (request) {
|
|
|
153
258
|
calculated: {
|
|
154
259
|
on: {
|
|
155
260
|
SELECT_AMOUNT: [
|
|
261
|
+
{
|
|
262
|
+
target: 'pending',
|
|
263
|
+
actions: 'addAmount',
|
|
264
|
+
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
target: 'pending',
|
|
268
|
+
actions: 'setAmount',
|
|
269
|
+
cond: 'isFreeWalletMode',
|
|
270
|
+
},
|
|
156
271
|
{
|
|
157
272
|
target: 'debouncing',
|
|
158
273
|
actions: 'addAmount',
|
|
@@ -199,8 +314,8 @@ export default function (request) {
|
|
|
199
314
|
actions: 'setQrcode',
|
|
200
315
|
cond: (context, event) => {
|
|
201
316
|
const { siteConfig = {}, promotion = {} } = context
|
|
202
|
-
const { bonusPreviewEnable } = siteConfig
|
|
203
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
317
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
318
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
204
319
|
},
|
|
205
320
|
},
|
|
206
321
|
{
|
|
@@ -280,8 +395,19 @@ export default function (request) {
|
|
|
280
395
|
promotion,
|
|
281
396
|
}
|
|
282
397
|
}),
|
|
398
|
+
setPromotionDefaultAmount: assign((context, event) => {
|
|
399
|
+
return {
|
|
400
|
+
selectedAmount: context.promotion.minimumAmount,
|
|
401
|
+
}
|
|
402
|
+
}),
|
|
283
403
|
},
|
|
284
404
|
guards: {
|
|
405
|
+
isDoubleWalletMode: (context, event) => {
|
|
406
|
+
return context.siteConfig?.walletMode === '4'
|
|
407
|
+
},
|
|
408
|
+
isFreeWalletMode: (context, event) => {
|
|
409
|
+
return context.siteConfig?.walletMode === '2'
|
|
410
|
+
},
|
|
285
411
|
isGrandTotalEnable: (context, event) => {
|
|
286
412
|
return context.grandTotalEnable === 1
|
|
287
413
|
},
|
|
@@ -45,8 +45,24 @@ export default function (request) {
|
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
47
|
step1: {
|
|
48
|
-
initial: '
|
|
48
|
+
initial: 'promotion',
|
|
49
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
|
+
},
|
|
50
66
|
idle: {},
|
|
51
67
|
calculating: {
|
|
52
68
|
invoke: {
|
|
@@ -88,10 +104,11 @@ export default function (request) {
|
|
|
88
104
|
{
|
|
89
105
|
target: 'pending',
|
|
90
106
|
cond: (context, event) => {
|
|
91
|
-
const { calculation, promotion } = context
|
|
107
|
+
const { siteConfig = {}, calculation, promotion } = context
|
|
108
|
+
const { walletMode } = siteConfig
|
|
92
109
|
const { promotionsNo, activityNo } = promotion
|
|
93
110
|
const isNoBonus = promotionsNo === 'none' || activityNo === 'none'
|
|
94
|
-
return !!calculation && !isNoBonus
|
|
111
|
+
return walletMode === '4' && !!calculation && !isNoBonus
|
|
95
112
|
},
|
|
96
113
|
},
|
|
97
114
|
{
|
|
@@ -214,8 +231,16 @@ export default function (request) {
|
|
|
214
231
|
promotion: event.data,
|
|
215
232
|
}
|
|
216
233
|
}),
|
|
234
|
+
setPromotionDefaultAmount: assign((context, event) => {
|
|
235
|
+
return {
|
|
236
|
+
amount: context.promotion.minimumAmount,
|
|
237
|
+
}
|
|
238
|
+
}),
|
|
217
239
|
},
|
|
218
240
|
guards: {
|
|
241
|
+
isDoubleWalletMode: (context, event) => {
|
|
242
|
+
return context.siteConfig?.walletMode === '4'
|
|
243
|
+
},
|
|
219
244
|
isCalculable: (context, event) => {
|
|
220
245
|
const {
|
|
221
246
|
amount,
|
|
@@ -229,6 +254,9 @@ export default function (request) {
|
|
|
229
254
|
isProcessing: (context, event) => {
|
|
230
255
|
return context.processing
|
|
231
256
|
},
|
|
257
|
+
hasMinPromotionDeposit: (context, event) => {
|
|
258
|
+
return context.promotion?.minimumAmount
|
|
259
|
+
},
|
|
232
260
|
},
|
|
233
261
|
services: {
|
|
234
262
|
fetchPaymentDetail: async (context, event) => {
|
|
@@ -74,8 +74,8 @@ export default function (request) {
|
|
|
74
74
|
target: 'fetching',
|
|
75
75
|
cond: (context, event) => {
|
|
76
76
|
const { siteConfig = {}, promotion = {} } = context
|
|
77
|
-
const { bonusPreviewEnable } = siteConfig
|
|
78
|
-
return bonusPreviewEnable && promotion.activityNo != 'none'
|
|
77
|
+
const { walletMode = '', bonusPreviewEnable } = siteConfig
|
|
78
|
+
return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
81
|
{ target: 'loaded' },
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -40,9 +40,8 @@ export default function (request) {
|
|
|
40
40
|
gameCode: null,
|
|
41
41
|
name: null,
|
|
42
42
|
},
|
|
43
|
-
|
|
43
|
+
walletMode: null,
|
|
44
44
|
lang: 'en_US',
|
|
45
|
-
site: '',
|
|
46
45
|
isMobile: new UAParser().getResult().device.type,
|
|
47
46
|
gameURL: null,
|
|
48
47
|
gameToken: null,
|
|
@@ -82,11 +81,7 @@ export default function (request) {
|
|
|
82
81
|
},
|
|
83
82
|
ENTER_GAME: {
|
|
84
83
|
target: 'connecting',
|
|
85
|
-
actions: ['setGameInfo', 'setLang', '
|
|
86
|
-
},
|
|
87
|
-
DEMO_GAME: {
|
|
88
|
-
target: 'demoGame',
|
|
89
|
-
actions: ['setGameInfo', 'setLang', 'setSite'],
|
|
84
|
+
actions: ['setGameInfo', 'setLang', 'setWalletMode'],
|
|
90
85
|
},
|
|
91
86
|
MENU_ENTER_GAME: {
|
|
92
87
|
target: 'connecting',
|
|
@@ -177,24 +172,6 @@ export default function (request) {
|
|
|
177
172
|
},
|
|
178
173
|
},
|
|
179
174
|
},
|
|
180
|
-
demoGame: {
|
|
181
|
-
invoke: {
|
|
182
|
-
src: 'demoGame',
|
|
183
|
-
onDone: {
|
|
184
|
-
target: 'playingDemo',
|
|
185
|
-
actions: 'setGameURL',
|
|
186
|
-
},
|
|
187
|
-
onError: {
|
|
188
|
-
target: 'idle',
|
|
189
|
-
actions: 'setGameURL',
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
on: {
|
|
193
|
-
EXIT_GAME: {
|
|
194
|
-
target: 'disconnect',
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
175
|
connectSwitching: {
|
|
199
176
|
invoke: {
|
|
200
177
|
src: 'disconnectGame',
|
|
@@ -230,17 +207,6 @@ export default function (request) {
|
|
|
230
207
|
},
|
|
231
208
|
},
|
|
232
209
|
},
|
|
233
|
-
playingDemo: {
|
|
234
|
-
on: {
|
|
235
|
-
EXIT_DEMO_GAME: {
|
|
236
|
-
target: 'idle',
|
|
237
|
-
},
|
|
238
|
-
ENTER_GAME: {
|
|
239
|
-
target: 'connecting',
|
|
240
|
-
actions: ['setGameInfo', 'setLang', 'setWalletMode'],
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
210
|
refreshing: {
|
|
245
211
|
invoke: {
|
|
246
212
|
src: 'disconnectGame',
|
|
@@ -451,17 +417,13 @@ export default function (request) {
|
|
|
451
417
|
const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name } = context.switchGame
|
|
452
418
|
return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name } }
|
|
453
419
|
}),
|
|
454
|
-
|
|
455
|
-
return {
|
|
420
|
+
setWalletMode: assign((context, event) => {
|
|
421
|
+
return { walletMode: event.data.walletMode }
|
|
456
422
|
}),
|
|
457
423
|
setLang: assign((context, event) => {
|
|
458
424
|
const lang = event.data.locale.replace('-', '_')
|
|
459
425
|
return { lang }
|
|
460
426
|
}),
|
|
461
|
-
setSite: assign((context, event) => {
|
|
462
|
-
const site = event.data.site
|
|
463
|
-
return { site }
|
|
464
|
-
}),
|
|
465
427
|
setPageLoadingDone: assign((context, event) => {
|
|
466
428
|
return {
|
|
467
429
|
pageLoading: true,
|
|
@@ -594,7 +556,7 @@ export default function (request) {
|
|
|
594
556
|
},
|
|
595
557
|
connectGame: async (context, event) => {
|
|
596
558
|
const returnProviders = ['RSG', 'KP', 'EPICWIN', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
|
|
597
|
-
const { lang, isMobile,
|
|
559
|
+
const { lang, isMobile, walletMode } = context
|
|
598
560
|
const { providerId, gameId, gameTypeId, mappingId } = context.game
|
|
599
561
|
const params = {
|
|
600
562
|
provider_id: providerId,
|
|
@@ -604,27 +566,12 @@ export default function (request) {
|
|
|
604
566
|
is_demo: false,
|
|
605
567
|
is_mobile: isMobile === 'mobile' ? 'y' : null,
|
|
606
568
|
lang,
|
|
607
|
-
selected_wallet_type:
|
|
569
|
+
selected_wallet_type: walletMode,
|
|
608
570
|
return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
|
|
609
571
|
}
|
|
610
572
|
const { type, redirect_url, gameToken, gameHtml, wallet_type } = await request.send(api.playGame(params))
|
|
611
573
|
return { type, gameToken, gameHtml, gameURL: redirect_url, gameWalletType: wallet_type }
|
|
612
574
|
},
|
|
613
|
-
demoGame: async (context, event) => {
|
|
614
|
-
const { lang, site, isMobile } = context
|
|
615
|
-
const { providerId, gameId, gameTypeId, mappingId } = context.game
|
|
616
|
-
const params = {
|
|
617
|
-
site,
|
|
618
|
-
provider_id: providerId,
|
|
619
|
-
game_id: gameId,
|
|
620
|
-
gametype_id: gameTypeId,
|
|
621
|
-
mapping_id: mappingId,
|
|
622
|
-
is_mobile: isMobile === 'mobile' ? 'y' : null,
|
|
623
|
-
lang,
|
|
624
|
-
}
|
|
625
|
-
const { type, redirect_url, gameToken, gameHtml } = await request.send(api.demoGame(params))
|
|
626
|
-
return { type, gameToken, gameHtml, gameURL: redirect_url }
|
|
627
|
-
},
|
|
628
575
|
disconnectGame: async (context, event) => {
|
|
629
576
|
const uid_site = event.data
|
|
630
577
|
const provider_id = context.game.providerId
|
|
@@ -7,6 +7,7 @@ export default function (request) {
|
|
|
7
7
|
id: 'promotions',
|
|
8
8
|
initial: 'loading',
|
|
9
9
|
context: {
|
|
10
|
+
noBonus: {},
|
|
10
11
|
userInfo: {},
|
|
11
12
|
siteConfig: {},
|
|
12
13
|
withdrawRule: {},
|
|
@@ -86,10 +87,10 @@ export default function (request) {
|
|
|
86
87
|
actions: {
|
|
87
88
|
setPromotionsList: assign((context, event) => {
|
|
88
89
|
const promotionsList = JSON.parse(JSON.stringify(event.data))
|
|
89
|
-
const { userInfo, siteConfig } = context
|
|
90
|
+
const { noBonus, userInfo, siteConfig } = context
|
|
90
91
|
const { withdraw_rule, balance, bank_amount } = userInfo
|
|
91
|
-
const { currencyConversionLimit } = siteConfig
|
|
92
|
-
const balanceAvailable = parseFloat(bank_amount) < parseFloat(`${currencyConversionLimit}`)
|
|
92
|
+
const { currencyConversionLimit, walletMode } = siteConfig
|
|
93
|
+
const balanceAvailable = parseFloat(`${walletMode === '4' ? bank_amount : balance}`) < parseFloat(`${currencyConversionLimit}`)
|
|
93
94
|
const isFreeLimitRule = withdraw_rule.includes('FREE_LIMIT')
|
|
94
95
|
const includesDefaultRule = withdraw_rule === 'DEFAULT' || withdraw_rule.includes('FREE_DEFAULT')
|
|
95
96
|
|
|
@@ -111,7 +112,7 @@ export default function (request) {
|
|
|
111
112
|
}
|
|
112
113
|
return {
|
|
113
114
|
promotionsList,
|
|
114
|
-
selectedPromo: promotionsList[0],
|
|
115
|
+
selectedPromo: siteConfig?.walletMode === '4' ? promotionsList[0] : noBonus,
|
|
115
116
|
}
|
|
116
117
|
}),
|
|
117
118
|
setSelectedPromo: assign((context, event) => {
|
package/src/machine/websocket.js
CHANGED
|
@@ -278,18 +278,6 @@ export default function (request) {
|
|
|
278
278
|
callback({ type: 'PUSH_ANALYTICS', data })
|
|
279
279
|
})
|
|
280
280
|
|
|
281
|
-
// 監聽 activity-reward-info 事件
|
|
282
|
-
clientSocket.on('activity-reward-info', (data) => {
|
|
283
|
-
console.log('[socket][activity-reward-info]:', data)
|
|
284
|
-
callback({ type: 'ACTIVITY_INFO', data })
|
|
285
|
-
})
|
|
286
|
-
|
|
287
|
-
// 監聽 message-notice-info 事件
|
|
288
|
-
clientSocket.on('message-notice-info', (data) => {
|
|
289
|
-
console.log('[socket][message-notice-info]:', data)
|
|
290
|
-
callback({ type: 'ACTIVITY_INFO', data })
|
|
291
|
-
})
|
|
292
|
-
|
|
293
281
|
// 監聽 payment-info 事件
|
|
294
282
|
clientSocket.on('payment-info', (data) => {
|
|
295
283
|
console.log('[socket][payment-info]:', data)
|
|
@@ -147,6 +147,7 @@ export default function (request) {
|
|
|
147
147
|
},
|
|
148
148
|
SET_ATTACHMENT_TYPE: {
|
|
149
149
|
actions: 'setAttachmentType',
|
|
150
|
+
cond: 'isNewWalletMode',
|
|
150
151
|
},
|
|
151
152
|
POOL: {
|
|
152
153
|
target: 'pooling',
|
|
@@ -322,7 +323,7 @@ export default function (request) {
|
|
|
322
323
|
balance,
|
|
323
324
|
siteConfig,
|
|
324
325
|
userInfo,
|
|
325
|
-
attachmentType: 'withdraw',
|
|
326
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
326
327
|
}
|
|
327
328
|
}),
|
|
328
329
|
updateWithdrawCondition: assign((context, event) => {
|
|
@@ -433,6 +434,7 @@ export default function (request) {
|
|
|
433
434
|
isOtpRequired: (context, event) => {
|
|
434
435
|
return event.data?.status === 'otp-verifying'
|
|
435
436
|
},
|
|
437
|
+
isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
|
|
436
438
|
},
|
|
437
439
|
services: {
|
|
438
440
|
fetchInitData: async (context, event) => {
|
|
@@ -355,7 +355,7 @@ export default function (request) {
|
|
|
355
355
|
const methods = siteConfig?.paymentMethods?.withdraw || []
|
|
356
356
|
return {
|
|
357
357
|
methods,
|
|
358
|
-
attachmentType: 'withdraw',
|
|
358
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
359
359
|
}
|
|
360
360
|
}),
|
|
361
361
|
setMode: assign((context, event) => {
|
|
@@ -397,8 +397,9 @@ export default function (request) {
|
|
|
397
397
|
return { bindingPaymentList, bindingPaymentInfo, boundBanks: combinedData, currentBank: combinedData[0] }
|
|
398
398
|
}),
|
|
399
399
|
preset: assign((context, event) => {
|
|
400
|
+
const { siteConfig } = context
|
|
400
401
|
return {
|
|
401
|
-
attachmentType: 'withdraw',
|
|
402
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
402
403
|
}
|
|
403
404
|
}),
|
|
404
405
|
setMode: assign((context, event) => {
|
|
@@ -193,6 +193,7 @@ export default function (request) {
|
|
|
193
193
|
},
|
|
194
194
|
SET_ATTACHMENT_TYPE: {
|
|
195
195
|
actions: 'setAttachmentType',
|
|
196
|
+
cond: 'isNewWalletMode',
|
|
196
197
|
},
|
|
197
198
|
SUBMIT: [
|
|
198
199
|
{
|
|
@@ -358,7 +359,7 @@ export default function (request) {
|
|
|
358
359
|
balance,
|
|
359
360
|
siteConfig,
|
|
360
361
|
userInfo,
|
|
361
|
-
attachmentType: 'withdraw',
|
|
362
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
362
363
|
}
|
|
363
364
|
}),
|
|
364
365
|
updateWithdrawCondition: assign((context, event) => {
|
|
@@ -452,6 +453,7 @@ export default function (request) {
|
|
|
452
453
|
isOtpRequired: (context, event) => {
|
|
453
454
|
return event.data?.status === 'otp-verifying'
|
|
454
455
|
},
|
|
456
|
+
isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
|
|
455
457
|
isNotWithdrawMinDepositAmount: (context, event) => {
|
|
456
458
|
const { withdrawCheck } = context
|
|
457
459
|
return !withdrawCheck?.passDepositeLimit
|
|
@@ -373,7 +373,7 @@ export default function (request) {
|
|
|
373
373
|
const methods = siteConfig?.paymentMethods?.withdraw || []
|
|
374
374
|
return {
|
|
375
375
|
methods,
|
|
376
|
-
attachmentType: 'withdraw',
|
|
376
|
+
attachmentType: siteConfig.walletMode > 0 ? 'withdraw' : null,
|
|
377
377
|
}
|
|
378
378
|
}),
|
|
379
379
|
setMode: assign((context, event) => {
|