@jetthai/cuora 1.1.361-v2api-1 → 1.1.362

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,28 +2,20 @@
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.361-v2api-1](https://github.com/jetthai/cuora-module/compare/v1.1.361...v1.1.361-v2api-1) (2025-06-05)
5
+ ### [1.1.362](https://github.com/jetthai/cuora-module/compare/v1.1.361...v1.1.362) (2025-06-20)
6
6
 
7
7
  ### [1.1.361](https://github.com/jetthai/cuora-module/compare/v1.1.360...v1.1.361) (2025-06-03)
8
8
 
9
9
  ### [1.1.360](https://github.com/jetthai/cuora-module/compare/v1.1.359...v1.1.360) (2025-06-03)
10
10
 
11
- ### [1.1.358-apiv2-2](https://github.com/jetthai/cuora-module/compare/v1.1.359...v1.1.358-apiv2-2) (2025-05-27)
12
-
13
11
  ### [1.1.359](https://github.com/jetthai/cuora-module/compare/v1.1.358...v1.1.359) (2025-05-23)
14
12
 
15
- ### [1.1.358-apiv2-1](https://github.com/jetthai/cuora-module/compare/v1.1.358...v1.1.358-apiv2-1) (2025-05-09)
16
-
17
13
  ### [1.1.358](https://github.com/jetthai/cuora-module/compare/v1.1.357...v1.1.358) (2025-05-09)
18
14
 
19
15
  ### [1.1.357](https://github.com/jetthai/cuora-module/compare/v1.1.356...v1.1.357) (2025-05-06)
20
16
 
21
17
  ### [1.1.356](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.356) (2025-04-29)
22
18
 
23
- ### [1.1.355-apiv2-2](https://github.com/jetthai/cuora-module/compare/v1.1.355-apiv2-1...v1.1.355-apiv2-2) (2025-05-07)
24
-
25
- ### [1.1.355-apiv2-1](https://github.com/jetthai/cuora-module/compare/v1.1.355...v1.1.355-apiv2-1) (2025-05-05)
26
-
27
19
  ### [1.1.355](https://github.com/jetthai/cuora-module/compare/v1.1.353-data-1...v1.1.355) (2025-04-22)
28
20
 
29
21
  ### [1.1.354](https://github.com/jetthai/cuora-module/compare/v1.1.353...v1.1.354) (2025-04-14)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.361-v2api-1",
3
+ "version": "1.1.362",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -19,6 +19,8 @@ export default {
19
19
  lastNameTh,
20
20
  firstNameEn,
21
21
  lastNameEn,
22
+ firstNameLocale,
23
+ lastNameLocale,
22
24
  bonus,
23
25
  paymentProvider,
24
26
  pixType,
@@ -41,6 +43,8 @@ export default {
41
43
  lastNameTh,
42
44
  firstNameEn,
43
45
  lastNameEn,
46
+ firstNameLocale,
47
+ lastNameLocale,
44
48
  bonus,
45
49
  paymentProvider,
46
50
  pixType,
@@ -27,6 +27,8 @@ export default function (request) {
27
27
  branchCode: null,
28
28
  accountNumber: null,
29
29
  holderName: null,
30
+ lastNameLocale: null,
31
+ firstNameLocale: null,
30
32
  pixType: null,
31
33
  },
32
34
  states: {
@@ -114,6 +116,20 @@ export default function (request) {
114
116
  }
115
117
  }),
116
118
  },
119
+ SET_FIRST_NAME: {
120
+ actions: assign((context, event) => {
121
+ return {
122
+ firstNameLocale: event.data,
123
+ }
124
+ }),
125
+ },
126
+ SET_LAST_NAME: {
127
+ actions: assign((context, event) => {
128
+ return {
129
+ lastNameLocale: event.data,
130
+ }
131
+ }),
132
+ },
117
133
  SET_PIX_TYPE: {
118
134
  actions: assign((context, event) => {
119
135
  return {
@@ -156,6 +172,8 @@ export default function (request) {
156
172
  return {
157
173
  hasAnyAccount: bankInfo.length > 0,
158
174
  holderName: bankInfo[0]?.holderName,
175
+ firstNameLocale: bankInfo[0]?.firstNameLocale || null,
176
+ lastNameLocale: bankInfo[0]?.lastNameLocale || null,
159
177
  paymentList,
160
178
  bank: null, // 不預選銀行,玩家可能不知道這裡可以選 by Gordan
161
179
  }
@@ -167,21 +185,21 @@ export default function (request) {
167
185
 
168
186
  if (bindingType === 'CRYPTO') {
169
187
  // 虛擬貨幣
170
- const { crypto, network, cryptoAddress, holderName } = context
171
- return crypto && network && cryptoAddress && holderName
188
+ const { crypto, network, cryptoAddress, holderName, firstNameLocale, lastNameLocale } = context
189
+ return crypto && network && cryptoAddress && (holderName || (firstNameLocale && lastNameLocale))
172
190
  } else if (bindingType === 'EWALLET') {
173
191
  // 電子錢包
174
- const { walletCode, accountNumber, holderName } = context
175
- return walletCode?.bankCode && accountNumber && holderName
192
+ const { walletCode, accountNumber, holderName, firstNameLocale, lastNameLocale } = context
193
+ return walletCode?.bankCode && accountNumber && (holderName || (firstNameLocale && lastNameLocale))
176
194
  } else {
177
195
  // 一般銀行
178
196
  if (currency === 'INR') {
179
197
  // 如果是印度幣別
180
- const { bank, ifscCode, accountNumber, branch, holderName } = context
181
- return bank.bankCode && ifscCode && accountNumber && branch && holderName
198
+ const { bank, ifscCode, accountNumber, branch, holderName, firstNameLocale, lastNameLocale } = context
199
+ return bank.bankCode && ifscCode && accountNumber && branch && (holderName || (firstNameLocale && lastNameLocale))
182
200
  } else {
183
- const { bank, accountNumber, branch, holderName } = context
184
- return bank.bankCode && accountNumber && branch && holderName
201
+ const { bank, accountNumber, branch, holderName, firstNameLocale, lastNameLocale } = context
202
+ return bank.bankCode && accountNumber && branch && (holderName || (firstNameLocale && lastNameLocale))
185
203
  }
186
204
  }
187
205
  },
@@ -195,8 +213,22 @@ export default function (request) {
195
213
  return { paymentList, paymentInfo }
196
214
  },
197
215
  updatePaymentInfo: async (context, event) => {
198
- const { bindingType, bank, ifscCode, crypto, network, cryptoAddress, walletCode, branch, branchCode, accountNumber, holderName, pixType } =
199
- context
216
+ const {
217
+ bindingType,
218
+ bank,
219
+ ifscCode,
220
+ crypto,
221
+ network,
222
+ cryptoAddress,
223
+ walletCode,
224
+ branch,
225
+ branchCode,
226
+ accountNumber,
227
+ holderName,
228
+ firstNameLocale,
229
+ lastNameLocale,
230
+ pixType,
231
+ } = context
200
232
  return await request.send(
201
233
  payment.updatePaymentInfo({
202
234
  bindingType,
@@ -210,6 +242,8 @@ export default function (request) {
210
242
  branchCode,
211
243
  bankAccount: accountNumber,
212
244
  holderName,
245
+ firstNameLocale,
246
+ lastNameLocale,
213
247
  pixType,
214
248
  })
215
249
  )
@@ -579,7 +579,7 @@ export default function (request) {
579
579
  payment.submitWithdrawTransactionManual({
580
580
  method,
581
581
  amount,
582
- applyerBankCode: currentBank.bankCode,
582
+ applyerBankCode: currentBank.bankCode || currentBank.walletCode,
583
583
  applyerAccountNumber: currentBank.accountNumber,
584
584
  applyerIfscCode: currentBank.ifscCode,
585
585
  branch: branchTemp,
@@ -266,7 +266,7 @@ export default function (request, context) {
266
266
  payment.submitWithdrawTransactionVN({
267
267
  method: currentPayment.method,
268
268
  amount: selectedAmount,
269
- applyerBankCode: selectedUserBank.bankCode,
269
+ applyerBankCode: selectedUserBank.bankCode || selectedUserBank.walletCode,
270
270
  applyerAccountNumber: selectedUserBank.accountNumber,
271
271
  applyerIfscCode: selectedUserBank.ifscCode,
272
272
  branch: branchTemp,
@@ -2,80 +2,6 @@ import pickBy from 'lodash/pickBy.js'
2
2
  import storage from '../util/storage.js'
3
3
 
4
4
  // const pickBy = require('lodash/pickBy')
5
- const supportVersion2List = [
6
- 'game/play',
7
- 'game/gameReplay',
8
- 'game/logout',
9
- 'game/list/v3/root',
10
- 'game/list/v3/category',
11
- 'game/list/v3/addition',
12
- 'game/list/v3/categoryByRange',
13
- 'game/list/v3/additionByRange',
14
- 'game/list/v3/myFavorite',
15
- 'game/list/v3/addMyFavorite',
16
- 'game/list/v3/removeMyFavorite',
17
- 'login',
18
- 'callback/:strategy',
19
- 'guestLogin',
20
- 'appLogin',
21
- 'logout',
22
- 'self',
23
- 'register',
24
- 'settings/password',
25
- 'verify',
26
- 'reset',
27
- 'acknowledge',
28
- 'friends',
29
- 'friends/home',
30
- 'friends/reward-list',
31
- 'recovery',
32
- 'recovery/abandon',
33
- 'recovery/acknowledge',
34
- 'checkDt',
35
- 'updateDt',
36
- 'checkAC',
37
- 'checkAccount',
38
- 'getAllAvatar',
39
- 'updateUserAvatar',
40
- 'getConfig',
41
- 'getQuickLayout',
42
- 'getNavbarSetting',
43
- 'getAffiliateCode',
44
- 'get-site-config',
45
- 'friends/dashboard',
46
- 'friends/dashboard/list',
47
- 'mailbox/sendMessage',
48
- 'mailbox/getMessageList',
49
- 'mailbox/getMessage',
50
- 'mailbox/updateMessage',
51
- 'mailbox/getMessageTypes',
52
- ]
53
-
54
- const version2ListName = {
55
- 'game/gameReplay': 'game/game-replay',
56
- 'game/list/v3/categoryByRange': 'game/list/v3/category-by-range',
57
- 'game/list/v3/additionByRange': 'game/list/v3/addition-by-range',
58
- 'game/list/v3/myFavorite': 'game/list/v3/my-favorite',
59
- 'game/list/v3/addMyFavorite': 'game/list/v3/add-my-favorite',
60
- 'game/list/v3/removeMyFavorite': 'game/list/v3/remove-my-favorite',
61
- guestLogin: 'guest-login',
62
- appLogin: 'app-login',
63
- checkDt: 'check-dt',
64
- updateDt: 'update-dt',
65
- checkAC: 'check-ac',
66
- checkAccount: 'check-account',
67
- getAllAvatar: 'get-all-avatar',
68
- updateUserAvatar: 'update-user-avatar',
69
- getConfig: 'get-config',
70
- getQuickLayout: 'get-quick-layout',
71
- getNavbarSetting: 'get-navbar-setting',
72
- getAffiliateCode: 'get-affiliate-code',
73
- 'mailbox/sendMessage': 'mailbox/send-message',
74
- 'mailbox/getMessageList': 'mailbox/get-message-list',
75
- 'mailbox/getMessage': 'mailbox/get-message',
76
- 'mailbox/updateMessage': 'mailbox/update-message',
77
- 'mailbox/getMessageTypes': 'mailbox/get-message-types',
78
- }
79
5
 
80
6
  function isValid(value) {
81
7
  return value !== undefined && value !== null
@@ -98,8 +24,7 @@ export default class Request {
98
24
  axiosConfig.headers['X-TH1GAMES-VERSION'] = this.config.version
99
25
  axiosConfig.headers['X-TH1GAMES-PLATFORM'] = this.config.platform
100
26
  if (this.getToken()) {
101
- // 為了支援V2版本的API接口新增Bearer來進行身份驗證
102
- axiosConfig.headers.Authorization = `Bearer ${this.getToken()}`
27
+ axiosConfig.headers.Authorization = this.getToken()
103
28
  }
104
29
  return axiosConfig
105
30
  })
@@ -160,21 +85,11 @@ export default class Request {
160
85
 
161
86
  _createConfig(req, cancelToken) {
162
87
  const { method, url, params, isPublic, isFormData, headers } = req
163
- let fullURL = this.config.fullURL
164
- let urlName = url
165
- // 有些API會將參數(/?)直接帶在URL上,所以要將參數排除
166
- if (supportVersion2List.includes(url.split('?')[0])) {
167
- fullURL = fullURL.replace('/v1/', '/v2/')
168
- urlName = version2ListName[url] || url
169
- console.log('*[DEV_ONLY]支援V2API-原本路徑:', url)
170
- console.log('*[DEV_ONLY]支援V2API-調整路徑:', fullURL, urlName)
171
- }
172
-
173
88
  if (isFormData) {
174
89
  return {
175
- baseURL: fullURL,
90
+ baseURL: this.config.fullURL,
176
91
  method,
177
- url: urlName,
92
+ url,
178
93
  cancelToken,
179
94
  isPublic,
180
95
  headers: { 'Content-Type': 'multipart/form-data' },
@@ -182,9 +97,9 @@ export default class Request {
182
97
  }
183
98
  } else {
184
99
  return {
185
- baseURL: fullURL,
100
+ baseURL: this.config.fullURL,
186
101
  method,
187
- url: urlName,
102
+ url,
188
103
  cancelToken,
189
104
  isPublic,
190
105
  headers,