@jetthai/cuora 1.1.199 → 1.1.201

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 CHANGED
@@ -2,6 +2,10 @@
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.201](https://github.com/jetthai/cuora-module/compare/v1.1.200...v1.1.201) (2023-11-03)
6
+
7
+ ### [1.1.200](https://github.com/jetthai/cuora-module/compare/v1.1.199...v1.1.200) (2023-11-01)
8
+
5
9
  ### [1.1.199](https://github.com/jetthai/cuora-module/compare/v1.1.198...v1.1.199) (2023-10-31)
6
10
 
7
11
  ### [1.1.198](https://github.com/jetthai/cuora-module/compare/v1.1.197...v1.1.198) (2023-10-31)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.199",
3
+ "version": "1.1.201",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -143,11 +143,11 @@ export default function (request) {
143
143
  src: 'disconnectGame',
144
144
  onDone: {
145
145
  target: 'idle',
146
- // actions: 'setGameURL',
146
+ actions: 'setGameURL',
147
147
  },
148
148
  onError: {
149
149
  target: 'idle',
150
- // actions: 'setGameURL',
150
+ actions: 'setGameURL',
151
151
  },
152
152
  },
153
153
  },
@@ -23,6 +23,7 @@ export default function (request) {
23
23
  balance: 0,
24
24
  realAmount: 0,
25
25
  charge: 0,
26
+ withdrawCheck: null,
26
27
  },
27
28
  states: {
28
29
  loading: {
@@ -50,12 +51,35 @@ export default function (request) {
50
51
  },
51
52
  },
52
53
  checking: {
53
- always: [
54
- { target: 'inProcessing', cond: 'haveProcessing' },
55
- { target: 'notWithdrawable', cond: 'isNotWithdrawable' },
56
- { target: 'withdrawable' },
57
- ],
54
+ always: [{ target: 'inProcessing', cond: 'haveProcessing' }, { target: 'withdrawCheck' }],
58
55
  },
56
+ withdrawCheck: {
57
+ invoke: {
58
+ src: 'withdrawCheck',
59
+ onDone: [
60
+ {
61
+ target: 'notWithdrawMinDepositAmount',
62
+ cond: 'isNotWithdrawMinDepositAmount',
63
+ actions: assign((context, event) => {
64
+ return {
65
+ withdrawCheck: event.data,
66
+ }
67
+ }),
68
+ },
69
+ {
70
+ target: 'notWithdrawable',
71
+ cond: 'isNotWithdrawable',
72
+ },
73
+ {
74
+ target: 'withdrawable',
75
+ },
76
+ ],
77
+ onError: {
78
+ target: '#withdraw_krway.fail',
79
+ },
80
+ },
81
+ },
82
+ notWithdrawMinDepositAmount: {},
59
83
  inProcessing: {},
60
84
  notWithdrawable: {},
61
85
  withdrawable: {
@@ -145,6 +169,9 @@ export default function (request) {
145
169
  const minWithdrawAmount = paymentDetail[0]?.minimum || 0
146
170
  return !enableWithdraw || balance < minWithdrawAmount
147
171
  },
172
+ isNotWithdrawMinDepositAmount: (context, event) => {
173
+ return !event.data?.enableWithdraw
174
+ },
148
175
  },
149
176
  services: {
150
177
  fetchPaymentDetail: async (context, event) => {
@@ -171,6 +198,9 @@ export default function (request) {
171
198
  })
172
199
  )
173
200
  },
201
+ withdrawCheck: async (context, event) => {
202
+ return await request.send(payment.withdrawCheck())
203
+ },
174
204
  },
175
205
  }
176
206
  )
@@ -28,6 +28,7 @@ export default function (request) {
28
28
  enableWithdrawAmount: 0,
29
29
  enableWithdraw: false,
30
30
  withdrawRules: [],
31
+ withdrawCheck: null,
31
32
 
32
33
  amount: null,
33
34
  bank: null,
@@ -132,11 +133,37 @@ export default function (request) {
132
133
  checking: {
133
134
  always: [
134
135
  { target: 'inProcessing', cond: 'haveProcessing' },
135
- { target: 'notWithdrawable', cond: 'isNotWithdrawable' },
136
136
  { target: 'unbound', cond: 'isBankNotBound' },
137
- { target: 'withdrawable' },
137
+ { target: 'withdrawCheck' },
138
138
  ],
139
139
  },
140
+ withdrawCheck: {
141
+ invoke: {
142
+ src: 'withdrawCheck',
143
+ onDone: [
144
+ {
145
+ target: 'notWithdrawMinDepositAmount',
146
+ cond: 'isNotWithdrawMinDepositAmount',
147
+ actions: assign((context, event) => {
148
+ return {
149
+ withdrawCheck: event.data,
150
+ }
151
+ }),
152
+ },
153
+ {
154
+ target: 'notWithdrawable',
155
+ cond: 'isNotWithdrawable',
156
+ },
157
+ {
158
+ target: 'withdrawable',
159
+ },
160
+ ],
161
+ onError: {
162
+ target: '#withdraw_vn.fail',
163
+ },
164
+ },
165
+ },
166
+ notWithdrawMinDepositAmount: {},
140
167
  notWithdrawable: {},
141
168
  unbound: {
142
169
  // to bank_binding.js
@@ -421,6 +448,9 @@ export default function (request) {
421
448
  return event.data?.status === 'otp-verifying'
422
449
  },
423
450
  isNewWalletMode: (context, event) => context.siteConfig.walletMode > 0,
451
+ isNotWithdrawMinDepositAmount: (context, event) => {
452
+ return !event.data?.enableWithdraw
453
+ },
424
454
  },
425
455
  services: {
426
456
  fetchInitData: async (context, event) => {
@@ -494,6 +524,9 @@ export default function (request) {
494
524
  giveUp: async (context, event) => {
495
525
  return await request.send(payment.giveUp())
496
526
  },
527
+ withdrawCheck: async (context, event) => {
528
+ return await request.send(payment.withdrawCheck())
529
+ },
497
530
  },
498
531
  }
499
532
  )
@@ -27,6 +27,7 @@ export default function (request) {
27
27
  enableWithdraw: false,
28
28
  withdrawRules: [],
29
29
  withdrawRule: {},
30
+ withdrawCheck: {},
30
31
 
31
32
  amount: null,
32
33
  bank: null,
@@ -160,11 +161,37 @@ export default function (request) {
160
161
  checking: {
161
162
  always: [
162
163
  { target: 'inProcessing', cond: 'haveProcessing' },
163
- { target: 'notWithdrawable', cond: 'isNotWithdrawable' },
164
164
  { target: 'unbound', cond: 'isBankNotBound' },
165
- { target: 'withdrawable' },
165
+ { target: 'withdrawCheck' },
166
166
  ],
167
167
  },
168
+ withdrawCheck: {
169
+ invoke: {
170
+ src: 'withdrawCheck',
171
+ onDone: [
172
+ {
173
+ target: 'notWithdrawMinDepositAmount',
174
+ cond: 'isNotWithdrawMinDepositAmount',
175
+ actions: assign((context, event) => {
176
+ return {
177
+ withdrawCheck: event.data,
178
+ }
179
+ }),
180
+ },
181
+ {
182
+ target: 'notWithdrawable',
183
+ cond: 'isNotWithdrawable',
184
+ },
185
+ {
186
+ target: 'withdrawable',
187
+ },
188
+ ],
189
+ onError: {
190
+ target: '#withdraw_vn2.fail',
191
+ },
192
+ },
193
+ },
194
+ notWithdrawMinDepositAmount: {},
168
195
  notWithdrawable: {},
169
196
  unbound: {
170
197
  // to bank_binding.js
@@ -446,6 +473,9 @@ export default function (request) {
446
473
  isOtpRequired: (context, event) => {
447
474
  return event.data?.status === 'otp-verifying'
448
475
  },
476
+ isNotWithdrawMinDepositAmount: (context, event) => {
477
+ return !event.data?.enableWithdraw
478
+ },
449
479
  },
450
480
  services: {
451
481
  fetchInitData: async (context, event) => {
@@ -509,6 +539,9 @@ export default function (request) {
509
539
  giveUp: async (context, event) => {
510
540
  return await request.send(payment.giveUp())
511
541
  },
542
+ withdrawCheck: async (context, event) => {
543
+ return await request.send(payment.withdrawCheck())
544
+ },
512
545
  },
513
546
  }
514
547
  )