@jetthai/cuora 1.0.152 → 1.0.153-1

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,12 +2,26 @@
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.0.153-1](https://github.com/jetthai/cuora-module/compare/v1.0.153...v1.0.153-1) (2022-07-28)
6
+
7
+ ### [1.0.153](https://github.com/jetthai/cuora-module/compare/v1.0.149-2...v1.0.153) (2022-07-28)
8
+
9
+ ### [1.0.152](https://github.com/jetthai/cuora-module/compare/v1.0.149-1...v1.0.152) (2022-07-27)
10
+
11
+ ### [1.0.151](https://github.com/jetthai/cuora-module/compare/v1.0.150...v1.0.151) (2022-07-27)
12
+
13
+ ### [1.0.150](https://github.com/jetthai/cuora-module/compare/v1.0.149...v1.0.150) (2022-07-27)
14
+
5
15
  ### [1.0.152](https://github.com/jetthai/cuora-module/compare/v1.0.151...v1.0.152) (2022-07-27)
6
16
 
7
17
  ### [1.0.151](https://github.com/jetthai/cuora-module/compare/v1.0.150...v1.0.151) (2022-07-27)
8
18
 
9
19
  ### [1.0.150](https://github.com/jetthai/cuora-module/compare/v1.0.149...v1.0.150) (2022-07-27)
10
20
 
21
+ ### [1.0.149-2](https://github.com/jetthai/cuora-module/compare/v1.0.149-1...v1.0.149-2) (2022-07-28)
22
+
23
+ ### [1.0.149-1](https://github.com/jetthai/cuora-module/compare/v1.0.149...v1.0.149-1) (2022-07-27)
24
+
11
25
  ### [1.0.149](https://github.com/jetthai/cuora-module/compare/v1.0.148...v1.0.149) (2022-07-26)
12
26
 
13
27
  ### [1.0.148](https://github.com/jetthai/cuora-module/compare/v1.0.147...v1.0.148) (2022-07-26)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.152",
3
+ "version": "1.0.153-1",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -291,14 +291,14 @@ export default function (request) {
291
291
  const redirectURL = urljoin(
292
292
  request.config.fullURL,
293
293
  'login?' +
294
- qs.stringify({
295
- provider,
296
- redirectURI: `${window.location.protocol}//${window.location.host}`,
297
- channel: cookies.get('channel') || channel || defaultChannel || 'official',
298
- subchannel: cookies.get('subchannel') || subchannel || defaultSubchannel || 'pwa',
299
- // dt,
300
- platform: 'pwa',
301
- })
294
+ qs.stringify({
295
+ provider,
296
+ redirectURI: `${window.location.protocol}//${window.location.host}`,
297
+ channel: cookies.get('channel') || channel || defaultChannel || 'official',
298
+ subchannel: cookies.get('subchannel') || subchannel || defaultSubchannel || 'pwa',
299
+ // dt,
300
+ platform: 'pwa',
301
+ })
302
302
  )
303
303
  window.location.href = redirectURL
304
304
  },
@@ -16,7 +16,7 @@ export default function (request) {
16
16
  states: {
17
17
  fetching: {
18
18
  invoke: {
19
- src: 'fetchBanks',
19
+ src: 'fetchInitData',
20
20
  onDone: {
21
21
  target: 'idle',
22
22
  actions: 'setBanks',
@@ -79,8 +79,9 @@ export default function (request) {
79
79
  {
80
80
  actions: {
81
81
  setBanks: assign((context, event) => {
82
- const bankList = event.data || []
82
+ const { bankList = [], paymentInfo = {} } = event.data
83
83
  return {
84
+ holderName: paymentInfo.bankInfo[0]?.holderName,
84
85
  bankList,
85
86
  bank: bankList[0],
86
87
  }
@@ -93,10 +94,14 @@ export default function (request) {
93
94
  },
94
95
  },
95
96
  services: {
96
- fetchBanks: async (context, event) => {
97
+ fetchInitData: async (context, event) => {
97
98
  const paymentDetail = await request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' }))
98
99
  const method = paymentDetail.find((payment) => payment.category === 'manual').method
99
- return await request.send(payment.getBankList(method))
100
+ const [bankList, paymentInfo] = await Promise.all([
101
+ request.send(payment.getBankList(method)),
102
+ request.send(payment.getPaymentInfo())
103
+ ])
104
+ return { bankList, paymentInfo }
100
105
  },
101
106
  updatePaymentInfo: async (context, event) => {
102
107
  const { bank, branch, accountNumber, holderName } = context
@@ -16,7 +16,7 @@ export default function (request) {
16
16
  currentCategory: 'direct',
17
17
  currentMethod: null,
18
18
  amount: null,
19
- result: null,
19
+ result: null
20
20
  },
21
21
  states: {
22
22
  loading: {
@@ -51,7 +51,7 @@ export default function (request) {
51
51
  loaded: {
52
52
  on: {
53
53
  SELECT_DIRECT: {
54
- actions: ['setDirect', 'reset'],
54
+ actions: ['setDirect', 'reset']
55
55
  },
56
56
  SELECT_BANK: {
57
57
  actions: 'setSelectedBank',
@@ -142,7 +142,7 @@ export default function (request) {
142
142
  }),
143
143
  setAmount: assign((context, event) => {
144
144
  return {
145
- amount: event.data,
145
+ amount: event.data
146
146
  }
147
147
  }),
148
148
  setCalculation: assign((context, event) => {
@@ -200,7 +200,7 @@ export default function (request) {
200
200
  payment.submitDepositTransactionBank({
201
201
  method: currentMethod,
202
202
  amount,
203
- applyerBankCode: selectedBank.bankCode,
203
+ applyerBankCode: selectedBank.bankCode
204
204
  })
205
205
  )
206
206
  },
@@ -7,13 +7,6 @@ export default function (request) {
7
7
  initial: 'fetching',
8
8
  context: {
9
9
  vipTable: [],
10
- filterVipTable: [],
11
- fasterWithdraw: [],
12
- fasterReward: [],
13
- cashbackOthers: [],
14
- cashbackSlot: [],
15
- cashbackFishing: [],
16
- upgradeReward: [],
17
10
  },
18
11
  states: {
19
12
  fetching: {
@@ -26,53 +19,32 @@ export default function (request) {
26
19
  onError: {
27
20
  target: 'fail',
28
21
  },
29
- },
22
+ }
30
23
  },
31
24
  completed: {},
32
- fail: {},
33
- },
25
+ fail: {}
26
+ }
34
27
  },
35
28
  {
36
29
  actions: {
37
30
  setVipTable: assign((context, event) => {
38
31
  const vipTable = event.data
39
- const filterVipTable = vipTable.filter((item) => item.title !== 'rookie' && item.title !== 'guest')
40
- const fasterWithdraw = filterVipTable.map((item) => item.fasterWithdraw)
41
- const fasterReward = filterVipTable.map((item) => item.fasterReward)
42
- const cashbackOthers = filterVipTable.map((item) => item.cashbackOther)
43
- const cashbackSlot = filterVipTable.map((item) => item.cashbackSlot)
44
- const cashbackFishing = filterVipTable.map((item) => item.cashbackFishing)
45
- const upgradeReward = filterVipTable.map((item) => {
46
- return {
47
- reward: item.upgradeReward,
48
- type: item.rewardType,
49
- }
50
- })
51
32
 
52
- return {
53
- vipTable,
54
- filterVipTable,
55
- fasterWithdraw,
56
- fasterReward,
57
- cashbackOthers,
58
- cashbackSlot,
59
- cashbackFishing,
60
- upgradeReward,
61
- }
33
+ return { vipTable }
62
34
  }),
63
35
  },
64
36
  services: {
65
37
  fetchVipTable: async (context, event) => {
66
38
  const { viptable = {} } = await request.send(activity.getVipTable())
67
39
  const { data = [] } = viptable
68
- data.map((item) => {
40
+ data.map(item => {
69
41
  item.title = item.title.toLowerCase()
70
42
  return item
71
43
  })
72
44
 
73
45
  return data
74
46
  },
75
- },
47
+ }
76
48
  }
77
49
  )
78
- }
50
+ }