@jetthai/cuora 1.0.66 → 1.0.68

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.0.68](https://github.com/jetthai/cuora-module/compare/v1.0.67...v1.0.68) (2021-12-28)
6
+
7
+ ### [1.0.67](https://github.com/jetthai/cuora-module/compare/v1.0.66...v1.0.67) (2021-12-24)
8
+
5
9
  ### [1.0.66](https://github.com/jetthai/cuora-module/compare/v1.0.65...v1.0.66) (2021-12-24)
6
10
 
7
11
  ### [1.0.65](https://github.com/jetthai/cuora-module/compare/v1.0.64...v1.0.65) (2021-12-22)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.66",
3
+ "version": "1.0.68",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -47,6 +47,11 @@ export default {
47
47
  method: 'post',
48
48
  params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork },
49
49
  }),
50
+ submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri }) => ({
51
+ url: `payment/v2/${method}/transaction`,
52
+ method: 'post',
53
+ params: { transferType: 'DEPOSIT', amount, card_type, card_code, card_seri },
54
+ }),
50
55
  submitWithdrawTransaction: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
51
56
  url: `payment/v2/${method}/transaction`,
52
57
  method: 'post',
@@ -228,7 +228,8 @@ export default function (request) {
228
228
  const { data } = await request.send(activity.getRewardList({ count: 30, appSecret }))
229
229
  inbox[currentTab] = { data, page: 0, totalPage: 1 }
230
230
  } else {
231
- const nextPage = inbox[currentTab]?.page && inbox[currentTab]?.page + 1
231
+ const { page = -1 } = inbox[currentTab] || {}
232
+ const nextPage = page + 1
232
233
  const { data, ...rest } = await request.send(mailbox.getMessageList({ type: currentTab, page: nextPage }))
233
234
  const currentData = inbox[currentTab]?.data || []
234
235
  inbox[currentTab] = { data: currentData.concat(data), ...rest }
@@ -29,6 +29,7 @@ export default function (request) {
29
29
  withdrawLimit: null,
30
30
  targetWithdrawLimit: null,
31
31
 
32
+ amount: null,
32
33
  bank: null,
33
34
  branch: null,
34
35
  accountNumber: null,
@@ -43,7 +44,7 @@ export default function (request) {
43
44
  src: 'fetchInitData',
44
45
  onDone: {
45
46
  target: 'mode',
46
- actions: ['setSiteConfig', 'setUserInfo', 'setData', 'preset'],
47
+ actions: ['setSiteConfig', 'setUserInfo', 'setInitData', 'preset'],
47
48
  },
48
49
  onError: {
49
50
  target: 'fail',
@@ -111,6 +112,20 @@ export default function (request) {
111
112
  inProcessing: {},
112
113
  withdrawable: {
113
114
  on: {
115
+ SET_CURRENT_BANK: {
116
+ actions: assign((context, event) => {
117
+ return {
118
+ bank: event.data,
119
+ }
120
+ }),
121
+ },
122
+ SET_AMOUNT: {
123
+ actions: assign((context, event) => {
124
+ return {
125
+ amount: event.data,
126
+ }
127
+ }),
128
+ },
114
129
  SUBMIT: {
115
130
  target: 'submitting',
116
131
  cond: 'isSubmittable',
@@ -151,25 +166,11 @@ export default function (request) {
151
166
  REFRESH: {
152
167
  target: 'loading',
153
168
  },
154
- SET_CURRENT_BANK: {
155
- actions: assign((context, event) => {
156
- return {
157
- bank: event.data,
158
- }
159
- }),
160
- },
161
- SET_AMOUNT: {
162
- actions: assign((context, event) => {
163
- return {
164
- amount: event.data,
165
- }
166
- }),
167
- },
168
169
  },
169
170
  },
170
171
  {
171
172
  actions: {
172
- setData: assign((context, event) => {
173
+ setInitData: assign((context, event) => {
173
174
  return {
174
175
  paymentDetail: event.data.paymentDetail,
175
176
  bankInfo: event.data.bankInfo,
@@ -241,9 +242,6 @@ export default function (request) {
241
242
  haveProcessing: (context, event) => {
242
243
  return context.paymentDetail[0] && context.paymentDetail[0].processing.length > 0
243
244
  },
244
- otherPlace: (context, event) => {
245
- return context.otherPlace
246
- },
247
245
  isWithdrawDisable: (context, event) => {
248
246
  const { siteConfig } = context
249
247
  const methods = siteConfig?.paymentMethods?.withdraw || []
@@ -252,10 +250,6 @@ export default function (request) {
252
250
  isBankNotBound: (context, event) => {
253
251
  return !context.bankInfo?.length
254
252
  },
255
- isBindable: (context, event) => {
256
- const { bank, accountNumber, branch, holderName } = context
257
- return bank.bankCode && accountNumber && branch && holderName
258
- },
259
253
  isSubmittable: (context, event) => {
260
254
  const { applyerBankCode, applyerAccountNumber, branch, holderName, amount } = event.data
261
255
  return applyerBankCode, applyerAccountNumber, branch, holderName, amount