@jetthai/cuora 1.1.269 → 1.1.270-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 CHANGED
@@ -2,6 +2,76 @@
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-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.270-dev-4...v1.1.270-dev-5) (2024-06-12)
6
+
7
+ ### [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)
8
+
9
+ ### [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)
10
+
11
+ ### [1.1.279-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.279...v1.1.279-dev-2) (2024-06-10)
12
+
13
+ ### [1.1.279-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.279...v1.1.279-dev-1) (2024-06-06)
14
+
15
+ ### [1.1.279](https://github.com/jetthai/cuora-module/compare/v1.1.270-fix-6...v1.1.279) (2024-06-06)
16
+
17
+ ### [1.1.278](https://github.com/jetthai/cuora-module/compare/v1.1.270-fix-2...v1.1.278) (2024-06-04)
18
+
19
+ ### [1.1.277](https://github.com/jetthai/cuora-module/compare/v1.1.276...v1.1.277) (2024-05-31)
20
+
21
+ ### [1.1.276](https://github.com/jetthai/cuora-module/compare/v1.1.275...v1.1.276) (2024-05-31)
22
+
23
+ ### [1.1.275](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-6...v1.1.275) (2024-05-30)
24
+
25
+ ### [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)
26
+
27
+ ### [1.1.273-withdraw-5](https://github.com/jetthai/cuora-module/compare/v1.1.270-fix...v1.1.273-withdraw-5) (2024-05-29)
28
+
29
+ ### [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)
30
+
31
+ ### [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)
32
+
33
+ ### [1.1.273-withdraw-2](https://github.com/jetthai/cuora-module/compare/v1.1.274...v1.1.273-withdraw-2) (2024-05-29)
34
+
35
+ ### [1.1.274](https://github.com/jetthai/cuora-module/compare/v1.1.273-withdraw-1...v1.1.274) (2024-05-28)
36
+
37
+ ### [1.1.273-withdraw-1](https://github.com/jetthai/cuora-module/compare/v1.1.273...v1.1.273-withdraw-1) (2024-05-28)
38
+
39
+ ### [1.1.273](https://github.com/jetthai/cuora-module/compare/v1.1.272...v1.1.273) (2024-05-27)
40
+
41
+ ### [1.1.272](https://github.com/jetthai/cuora-module/compare/v1.1.271...v1.1.272) (2024-05-21)
42
+
43
+ ### [1.1.271](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.271) (2024-05-21)
44
+
45
+ ### [1.1.278](https://github.com/jetthai/cuora-module/compare/v1.1.277...v1.1.278) (2024-06-04)
46
+
47
+ ### [1.1.277](https://github.com/jetthai/cuora-module/compare/v1.1.276...v1.1.277) (2024-05-31)
48
+
49
+ ### [1.1.276](https://github.com/jetthai/cuora-module/compare/v1.1.275...v1.1.276) (2024-05-31)
50
+
51
+ ### [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)
52
+
53
+ ### [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)
54
+
55
+ ### [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)
56
+
57
+ ### [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)
58
+
59
+ ### [1.1.273-withdraw-2](https://github.com/jetthai/cuora-module/compare/v1.1.274...v1.1.273-withdraw-2) (2024-05-29)
60
+
61
+ ### [1.1.273-withdraw-1](https://github.com/jetthai/cuora-module/compare/v1.1.273...v1.1.273-withdraw-1) (2024-05-28)
62
+
63
+ ### [1.1.275](https://github.com/jetthai/cuora-module/compare/v1.1.274...v1.1.275) (2024-05-30)
64
+
65
+ ### [1.1.274](https://github.com/jetthai/cuora-module/compare/v1.1.273...v1.1.274) (2024-05-28)
66
+
67
+ ### [1.1.273](https://github.com/jetthai/cuora-module/compare/v1.1.272...v1.1.273) (2024-05-27)
68
+
69
+ ### [1.1.272](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.272) (2024-05-21)
70
+
71
+ ### [1.1.271](https://github.com/jetthai/cuora-module/compare/v1.1.270...v1.1.271) (2024-05-21)
72
+
73
+ ### [1.1.270](https://github.com/jetthai/cuora-module/compare/v1.1.269...v1.1.270) (2024-05-16)
74
+
5
75
  ### [1.1.269](https://github.com/jetthai/cuora-module/compare/v1.1.268...v1.1.269) (2024-05-15)
6
76
 
7
77
  ### [1.1.268](https://github.com/jetthai/cuora-module/compare/v1.1.267...v1.1.268) (2024-05-15)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.269",
3
+ "version": "1.1.270-dev-5",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -6,6 +6,12 @@ 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
+ }),
9
15
  getTournamentDetail: ({ activityNo, appSecret }) => ({
10
16
  url: 'tournament/detail',
11
17
  method: 'get',
package/src/api/game.js CHANGED
@@ -91,4 +91,5 @@ 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 } }),
94
95
  }
@@ -1,5 +1,4 @@
1
1
  export default {
2
- // getPaymentHistory: () => ({ url: 'payment/history', method: 'post' }),
3
2
  getPaymentHistory: (returnDays) => ({ url: 'payment/v2/history', method: 'post', params: { returnDays } }),
4
3
  getSpotMarket: () => ({ url: 'payment/spotmarket', method: 'get' }),
5
4
  getTransactionHistory: (payload) => ({
@@ -8,7 +7,6 @@ export default {
8
7
  params: { ...payload },
9
8
  }),
10
9
  getTransactionHistoryOptions: () => ({ url: 'payment/v2/category/options', method: 'get' }),
11
- // getPaymentInfo: () => ({ url: `payment/paymentInfo`, method: 'get' }),
12
10
  getPaymentInfo: () => ({ url: `payment/v2/paymentInfo`, method: 'get' }),
13
11
  getBindingPaymentInfo: () => ({ url: `payment/getBindingPaymentInfo`, method: 'get' }),
14
12
  updatePaymentInfo: ({
@@ -29,6 +27,7 @@ export default {
29
27
  cryptoNetwork,
30
28
  cryptoAddress,
31
29
  walletCode,
30
+ ifscCode,
32
31
  }) => ({
33
32
  url: 'payment/v2/updatePaymentInfo',
34
33
  method: 'post',
@@ -50,6 +49,7 @@ export default {
50
49
  cryptoNetwork,
51
50
  cryptoAddress,
52
51
  walletCode,
52
+ ifscCode,
53
53
  },
54
54
  }),
55
55
  getBankList: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/getBankList`, method: 'get' }),
@@ -93,6 +93,11 @@ 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
+ }),
96
101
  getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
97
102
  url: `payment/v2/${method}/expected/result`,
98
103
  method: 'post',
@@ -127,11 +132,15 @@ export default {
127
132
  amount,
128
133
  applyerBankCode,
129
134
  applyerAccountNumber,
135
+ applyerIfscCode,
130
136
  applyerHolderName,
131
137
  applyerBranch,
132
138
  applyerBranchCode,
133
139
  targetBankCode,
134
140
  targetAccountNumber,
141
+ targetIfscCode,
142
+ targetUpi,
143
+ transactionId,
135
144
  depositTime,
136
145
  receipt,
137
146
  promotionsNo,
@@ -143,11 +152,15 @@ export default {
143
152
  amount,
144
153
  applyerBankCode,
145
154
  applyerAccountNumber,
155
+ applyerIfscCode,
146
156
  applyerHolderName,
147
157
  applyerBranch,
148
158
  applyerBranchCode,
149
159
  targetBankCode,
150
160
  targetAccountNumber,
161
+ targetIfscCode,
162
+ targetUpi,
163
+ transactionId,
151
164
  depositTime,
152
165
  receipt,
153
166
  promotionsNo,
@@ -158,12 +171,12 @@ export default {
158
171
  method: 'post',
159
172
  params: { transferType: 'DEPOSIT', amount, promotionsNo },
160
173
  }),
161
- submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
174
+ submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress, applyerHolderName }) => ({
162
175
  url: `payment/v2/${method}/transaction`,
163
176
  method: 'post',
164
- params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress },
177
+ params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress, applyerHolderName },
165
178
  }),
166
- submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch, holderName }) => ({
179
+ submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, applyerIfscCode, branch, applyerHolderName }) => ({
167
180
  url: `payment/v2/${method}/transaction`,
168
181
  method: 'post',
169
182
  params: {
@@ -171,8 +184,36 @@ export default {
171
184
  amount,
172
185
  applyerBankCode,
173
186
  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,
174
212
  branch,
175
213
  holderName,
214
+ cryptoCurrency,
215
+ cryptoNetwork,
216
+ targetAddress,
176
217
  },
177
218
  }),
178
219
  submitWithdrawTransactionAmb: ({ method, amount }) => ({
@@ -200,4 +241,5 @@ export default {
200
241
  }),
201
242
  getPendingOrder: ({ transferType }) => ({ url: 'payment/v2/pendingOrder', method: 'post', params: { transferType } }),
202
243
  withdrawCheck: () => ({ url: `payment/v2/withdrawCheck`, method: 'post' }),
244
+ updateUtr: ({ applyId, utr }) => ({ url: 'payment/v2/updateUtr', method: 'post', params: { applyId, utr } }),
203
245
  }
package/src/api/user.js CHANGED
@@ -57,4 +57,6 @@ 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 }),
60
62
  }
@@ -10,10 +10,11 @@ export default function (request) {
10
10
  initial: 'init',
11
11
  context: {
12
12
  tick: 2000,
13
- specifyActivities: [29, 34],
13
+ specifyActivities: [4, 29, 34],
14
14
  activitiesDetailList: [],
15
15
  activityList: [],
16
16
  promotionList: [],
17
+ jackpotList: [],
17
18
  activityMap: {},
18
19
  tournamentList: [],
19
20
  refs: {},
@@ -34,7 +35,7 @@ export default function (request) {
34
35
  src: 'fetchList',
35
36
  onDone: {
36
37
  target: 'idle',
37
- actions: ['setActivityList', 'setTournamentList', 'setPromotionList'],
38
+ actions: ['setActivityList', 'setTournamentList', 'setPromotionList', 'setJackpotList'],
38
39
  },
39
40
  onError: {
40
41
  target: 'idle',
@@ -123,6 +124,12 @@ export default function (request) {
123
124
  promotionList,
124
125
  }
125
126
  }),
127
+ setJackpotList: assign((context, event) => {
128
+ const { jackpotList } = event.data
129
+ return {
130
+ jackpotList,
131
+ }
132
+ }),
126
133
  setActivitiesDetailList: assign((context, event) => {
127
134
  return {
128
135
  activitiesDetailList: event.data.map((item) => item.data),
@@ -162,12 +169,13 @@ export default function (request) {
162
169
  const hasToken = request.getToken()
163
170
  const isDoubleWallet = context.siteConfig?.walletMode === '4'
164
171
  const apiCallable = hasToken && isDoubleWallet
165
- const [{ data }, promotionList] = await Promise.all([
172
+ const [{ data }, promotionList, jackpotList] = await Promise.all([
166
173
  request.send(activity.getActivityList({ appSecret })),
167
174
  apiCallable ? request.send(payment.getPromotionsList()) : [],
175
+ request.send(activity.getJackpotList({ appSecret })),
168
176
  ])
169
177
 
170
- return { activityList: data, promotionList }
178
+ return { activityList: data, promotionList, jackpotList: jackpotList.data }
171
179
  },
172
180
  fetchActivitiesDetail: async (context, event) => {
173
181
  await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
@@ -13,6 +13,7 @@ export default function (request) {
13
13
  activityList: [],
14
14
  tournamentList: [],
15
15
  promotionList: [],
16
+ jackpotList: [],
16
17
  uidSite: '',
17
18
  detailNeededActivityTypes: [29, 34],
18
19
  activityDetailList: [],
@@ -23,7 +24,7 @@ export default function (request) {
23
24
  src: 'fetchList',
24
25
  onDone: {
25
26
  target: 'checking',
26
- actions: ['setActivityList', 'setTournamentList', 'setPromotionList'],
27
+ actions: ['setActivityList', 'setTournamentList', 'setPromotionList', 'setJackpotList'],
27
28
  },
28
29
  onError: {
29
30
  target: 'pending',
@@ -96,6 +97,12 @@ export default function (request) {
96
97
  promotionList,
97
98
  }
98
99
  }),
100
+ setJackpotList: assign((context, event) => {
101
+ const { jackpotList } = event.data
102
+ return {
103
+ jackpotList,
104
+ }
105
+ }),
99
106
  setUnread: assign((context, event) => {
100
107
  const { uidSite, activityNo, unread } = event.data
101
108
  const list = JSON.parse(JSON.stringify(context.activityList))
@@ -132,12 +139,13 @@ export default function (request) {
132
139
  services: {
133
140
  fetchList: async (context, event) => {
134
141
  const hasToken = request.getToken()
135
- const [{ data }, promotionList] = await Promise.all([
142
+ const [{ data }, promotionList, jackpotList] = await Promise.all([
136
143
  request.send(activity.getActivityList({ appSecret })),
137
144
  hasToken ? request.send(payment.getPromotionsList()) : [],
145
+ request.send(activity.getJackpotList({ appSecret })),
138
146
  ])
139
147
 
140
- return { activityList: data, promotionList }
148
+ return { activityList: data, promotionList, jackpotList: jackpotList.data }
141
149
  },
142
150
  fetchActivityDetailList: async (context, event) => {
143
151
  await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
@@ -14,6 +14,7 @@ export default function (request, context) {
14
14
 
15
15
  // 領獎後得到的資訊
16
16
  amount: null,
17
+ rewardType: null,
17
18
  message: null,
18
19
  canReceiveQuantity: null,
19
20
  receivedQuantity: null,
@@ -108,9 +109,10 @@ export default function (request, context) {
108
109
  }
109
110
  }),
110
111
  setAward: assign((context, event) => {
111
- const { amount, message, canReceiveQuantity, receivedQuantity } = event.data
112
+ const { amount, rewardType, message, canReceiveQuantity, receivedQuantity } = event.data
112
113
  return {
113
114
  amount,
115
+ rewardType,
114
116
  message,
115
117
  canReceiveQuantity,
116
118
  receivedQuantity,
@@ -124,6 +126,7 @@ export default function (request, context) {
124
126
  resetAward: assign((context, event) => {
125
127
  return {
126
128
  amount: null,
129
+ rewardType: null,
127
130
  message: null,
128
131
  }
129
132
  }),
@@ -100,7 +100,7 @@ export default function (request) {
100
100
  invoke: {
101
101
  src: 'fetchUserInfo',
102
102
  onDone: {
103
- target: 'inline',
103
+ target: 'loginSuccess',
104
104
  actions: ['setUserInfo', 'extendToken'],
105
105
  },
106
106
  onError: {
@@ -108,6 +108,13 @@ export default function (request) {
108
108
  },
109
109
  },
110
110
  },
111
+ loginSuccess: {
112
+ after: {
113
+ 0: {
114
+ target: 'inline',
115
+ },
116
+ },
117
+ },
111
118
  tokenAuthenticated: {
112
119
  invoke: {
113
120
  src: 'fetchUserInfo',
@@ -10,14 +10,15 @@ export default function (request) {
10
10
  initial: 'fetching',
11
11
  context: {
12
12
  hasAnyAccount: false,
13
- bankList: [],
14
13
  paymentList: {
15
14
  bankList: [],
16
15
  cryptoList: [],
17
16
  ewalletList: [],
18
17
  },
18
+ currency: null,
19
19
  bindingType: 'BANK',
20
20
  bank: null,
21
+ ifscCode: null,
21
22
  crypto: null,
22
23
  network: null,
23
24
  cryptoAddress: null,
@@ -113,10 +114,6 @@ export default function (request) {
113
114
  }
114
115
  }),
115
116
  },
116
- BIND_BANK: {
117
- target: 'binding',
118
- cond: 'isBindable',
119
- },
120
117
  SET_PIX_TYPE: {
121
118
  actions: assign((context, event) => {
122
119
  return {
@@ -124,6 +121,17 @@ export default function (request) {
124
121
  }
125
122
  }),
126
123
  },
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
+ },
127
135
  },
128
136
  },
129
137
  binding: {
@@ -143,47 +151,56 @@ export default function (request) {
143
151
  {
144
152
  actions: {
145
153
  setBanks: assign((context, event) => {
146
- const { bankList = [], paymentList = {}, paymentInfo = {} } = event.data
154
+ const { paymentList = {}, paymentInfo = {} } = event.data
147
155
  const { bankInfo = [] } = paymentInfo
148
156
  return {
149
157
  hasAnyAccount: bankInfo.length > 0,
150
158
  holderName: bankInfo[0]?.holderName,
151
159
  paymentList,
152
- bankList,
153
160
  bank: null, // 不預選銀行,玩家可能不知道這裡可以選 by Gordan
154
161
  }
155
162
  }),
156
163
  },
157
164
  guards: {
158
165
  isBindable: (context, event) => {
159
- const { bindingType } = context
166
+ const { bindingType, currency } = context
160
167
 
161
168
  if (bindingType === 'CRYPTO') {
169
+ // 虛擬貨幣
162
170
  const { crypto, network, cryptoAddress, holderName } = context
163
171
  return crypto && network && cryptoAddress && holderName
164
- }
165
- if (bindingType === 'EWALLET') {
172
+ } else if (bindingType === 'EWALLET') {
173
+ // 電子錢包
166
174
  const { walletCode, accountNumber, holderName } = context
167
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
+ }
168
186
  }
169
- const { bank, accountNumber, branch, holderName } = context
170
- return bank.bankCode && accountNumber && branch && holderName
171
187
  },
172
188
  },
173
189
  services: {
174
190
  fetchInitData: async (context, event) => {
175
- const [bankList, paymentList, paymentInfo] = await Promise.all([
176
- request.send(payment.getBindingBankList({ appSecret })),
191
+ const [paymentList, paymentInfo] = await Promise.all([
177
192
  request.send(payment.getBindingPaymentList({ appSecret })),
178
193
  request.send(payment.getPaymentInfo()),
179
194
  ])
180
- return { bankList, paymentList, paymentInfo }
195
+ return { paymentList, paymentInfo }
181
196
  },
182
197
  updatePaymentInfo: async (context, event) => {
183
- const { bindingType, bank, crypto, network, cryptoAddress, walletCode, branch, branchCode, accountNumber, holderName, pixType } = context
198
+ const { bindingType, bank, ifscCode, crypto, network, cryptoAddress, walletCode, branch, branchCode, accountNumber, holderName, pixType } =
199
+ context
184
200
  return await request.send(
185
201
  payment.updatePaymentInfo({
186
202
  bindingType,
203
+ ifscCode,
187
204
  bankCode: bank?.bankCode || '',
188
205
  cryptoCurrency: crypto?.symbol || '',
189
206
  cryptoNetwork: network?.label || '',
@@ -286,7 +286,18 @@ 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
- return { siteConfig: JSON.parse(window.atob(site.config)), layoutConfig: layout.config }
289
+ const base64Url = site.config.split('.')[0]
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 }
290
301
  },
291
302
  fetchFeeds: async (context, event) => {
292
303
  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.bankInfo?.[0],
57
+ userAccount: event.data?.[0],
58
58
  }
59
59
  }),
60
60
  setInitialization: assign((context, event) => {
@@ -69,12 +69,14 @@ export default function (request) {
69
69
  },
70
70
  guards: {
71
71
  hasUserAccount: (context, event) => {
72
- return event.data.bankInfo?.[0]
72
+ return event.data?.[0]
73
73
  },
74
74
  },
75
75
  services: {
76
76
  fetchPaymentInfo: async (context, event) => {
77
- return await request.send(payment.getPaymentInfo())
77
+ const { bankInfo } = await request.send(payment.getPaymentInfo())
78
+ const filterArray = bankInfo?.filter((item) => item.bindingType !== 'CRYPTO' && item.bindingType !== 'EWALLET')
79
+ return filterArray || []
78
80
  },
79
81
  initialize: async (context, event) => {
80
82
  const { method } = context
@@ -245,7 +245,7 @@ export default function (request) {
245
245
  actions: {
246
246
  setUserAccount: assign((context, event) => {
247
247
  return {
248
- userAccount: event.data.bankInfo?.[0],
248
+ userAccount: event.data?.[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.bankInfo?.[0]
313
+ return event.data?.[0]
314
314
  },
315
315
  isGrandTotalEnable: (context, event) => {
316
316
  return context.grandTotalEnable === 1
@@ -318,7 +318,9 @@ export default function (request) {
318
318
  },
319
319
  services: {
320
320
  fetchPaymentInfo: async (context, event) => {
321
- return await request.send(payment.getPaymentInfo())
321
+ const { bankInfo } = await request.send(payment.getPaymentInfo())
322
+ const filterArray = bankInfo?.filter((item) => item.bindingType !== 'CRYPTO' && item.bindingType !== 'EWALLET')
323
+ return filterArray || []
322
324
  },
323
325
  initialize: async (context, event) => {
324
326
  const [{ config }, payments, bankList] = await Promise.all([