@jetthai/cuora 1.1.41 → 1.1.42

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,8 @@
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.42](https://github.com/jetthai/cuora-module/compare/v1.1.41...v1.1.42) (2023-01-19)
6
+
5
7
  ### [1.1.41](https://github.com/jetthai/cuora-module/compare/v1.1.40...v1.1.41) (2023-01-19)
6
8
 
7
9
  ### [1.1.40](https://github.com/jetthai/cuora-module/compare/v1.1.34-2...v1.1.40) (2023-01-16)
package/dist/bundle.mjs CHANGED
@@ -3780,25 +3780,25 @@ var payment = {
3780
3780
  method: 'post',
3781
3781
  params: { transferType },
3782
3782
  }),
3783
- getDepositExpectedResult: ({ method, amount, cryptoCurrency }) => ({
3783
+ getDepositExpectedResult: ({ method, amount, cryptoCurrency, promotionsNo }) => ({
3784
3784
  url: `payment/v2/${method}/expected/result`,
3785
3785
  method: 'post',
3786
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency },
3786
+ params: { transferType: 'DEPOSIT', amount, cryptoCurrency, promotionsNo },
3787
3787
  }),
3788
3788
  getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
3789
3789
  url: `payment/v2/${method}/expected/result`,
3790
3790
  method: 'post',
3791
3791
  params: { transferType: 'WITHDRAW', amount, cryptoNetwork },
3792
3792
  }),
3793
- submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress }) => ({
3793
+ submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo }) => ({
3794
3794
  url: `payment/v2/${method}/transaction`,
3795
3795
  method: 'post',
3796
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress },
3796
+ params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo },
3797
3797
  }),
3798
- submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri }) => ({
3798
+ submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri, promotionsNo }) => ({
3799
3799
  url: `payment/v2/${method}/transaction`,
3800
3800
  method: 'post',
3801
- params: { transferType: 'DEPOSIT', amount, card_type, card_code, card_seri },
3801
+ params: { transferType: 'DEPOSIT', amount, card_type, card_code, card_seri, promotionsNo },
3802
3802
  }),
3803
3803
  submitDepositTransactionBank: ({
3804
3804
  method,
@@ -3810,6 +3810,7 @@ var payment = {
3810
3810
  targetAccountNumber,
3811
3811
  depositTime = '1234567890',
3812
3812
  receipt,
3813
+ promotionsNo,
3813
3814
  }) => ({
3814
3815
  url: `payment/v2/${method}/transaction`,
3815
3816
  method: 'post',
@@ -3823,12 +3824,13 @@ var payment = {
3823
3824
  targetAccountNumber,
3824
3825
  depositTime,
3825
3826
  receipt,
3827
+ promotionsNo,
3826
3828
  },
3827
3829
  }),
3828
- submitDepositTransaction: ({ method, amount }) => ({
3830
+ submitDepositTransaction: ({ method, amount, promotionsNo }) => ({
3829
3831
  url: `payment/v2/${method}/transaction`,
3830
3832
  method: 'post',
3831
- params: { transferType: 'DEPOSIT', amount },
3833
+ params: { transferType: 'DEPOSIT', amount, promotionsNo },
3832
3834
  }),
3833
3835
  submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
3834
3836
  url: `payment/v2/${method}/transaction`,
@@ -3838,7 +3840,14 @@ var payment = {
3838
3840
  submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch, holderName }) => ({
3839
3841
  url: `payment/v2/${method}/transaction`,
3840
3842
  method: 'post',
3841
- params: { transferType: 'WITHDRAW', amount, applyerBankCode, applyerAccountNumber, branch, holderName },
3843
+ params: {
3844
+ transferType: 'WITHDRAW',
3845
+ amount,
3846
+ applyerBankCode,
3847
+ applyerAccountNumber,
3848
+ branch,
3849
+ holderName,
3850
+ },
3842
3851
  }),
3843
3852
  submitWithdrawTransactionAmb: ({ method, amount }) => ({
3844
3853
  url: `payment/v2/${method}/transaction`,
@@ -16222,6 +16231,9 @@ function manual_vn (request) {
16222
16231
 
16223
16232
  calculation: null,
16224
16233
  processing: null,
16234
+
16235
+ // use for wallet mode 3
16236
+ promotionsNo: null,
16225
16237
  },
16226
16238
  states: {
16227
16239
  loading: {
@@ -16374,6 +16386,11 @@ function manual_vn (request) {
16374
16386
  submitted: {},
16375
16387
  fail: {},
16376
16388
  },
16389
+ on: {
16390
+ SET_PROMOTION: {
16391
+ actions: 'setPromotionsNo',
16392
+ },
16393
+ },
16377
16394
  },
16378
16395
  {
16379
16396
  actions: {
@@ -16475,6 +16492,11 @@ function manual_vn (request) {
16475
16492
  receipt: event.data,
16476
16493
  }
16477
16494
  }),
16495
+ setPromotionsNo: assign((context, event) => {
16496
+ return {
16497
+ promotionsNo: event.data,
16498
+ }
16499
+ }),
16478
16500
  },
16479
16501
  guards: {
16480
16502
  isCalculable: (context, event) => {
@@ -16511,11 +16533,12 @@ function manual_vn (request) {
16511
16533
  return await request.send(payment.getBankList(method))
16512
16534
  },
16513
16535
  fetchCalculation: async (context, event) => {
16514
- const { method, amount } = context;
16515
- return await request.send(payment.getDepositExpectedResult({ method, amount }))
16536
+ const { method, amount, promotionsNo } = context;
16537
+ return await request.send(payment.getDepositExpectedResult({ method, amount, promotionsNo }))
16516
16538
  },
16517
16539
  submitDeposit: async (context, event) => {
16518
- const { method, amount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt } = context;
16540
+ const { method, amount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt, promotionsNo } =
16541
+ context;
16519
16542
  return await request.send(
16520
16543
  payment.submitDepositTransactionBank({
16521
16544
  method,
@@ -16527,6 +16550,7 @@ function manual_vn (request) {
16527
16550
  applyerHolderName: userAccountName,
16528
16551
  depositTime,
16529
16552
  receipt,
16553
+ promotionsNo,
16530
16554
  })
16531
16555
  )
16532
16556
  },
@@ -16937,6 +16961,9 @@ function qrcode_v2 (request) {
16937
16961
  result: null,
16938
16962
 
16939
16963
  grandTotalEnable: 1,
16964
+
16965
+ // use for wallet mode 3
16966
+ promotionsNo: null,
16940
16967
  },
16941
16968
  states: {
16942
16969
  loading: {
@@ -17227,6 +17254,11 @@ function qrcode_v2 (request) {
17227
17254
  },
17228
17255
  },
17229
17256
  },
17257
+ on: {
17258
+ SET_PROMOTION: {
17259
+ actions: 'setPromotionsNo',
17260
+ },
17261
+ },
17230
17262
  },
17231
17263
  {
17232
17264
  actions: {
@@ -17284,6 +17316,11 @@ function qrcode_v2 (request) {
17284
17316
  result: event.data,
17285
17317
  }
17286
17318
  }),
17319
+ setPromotionsNo: assign((context, event) => {
17320
+ return {
17321
+ promotionsNo: event.data,
17322
+ }
17323
+ }),
17287
17324
  },
17288
17325
  guards: {
17289
17326
  isNewWalletMode: (context, event) => {
@@ -17300,20 +17337,22 @@ function qrcode_v2 (request) {
17300
17337
  return { siteConfig, paymentDetail }
17301
17338
  },
17302
17339
  fetchCalculation: async (context, event) => {
17303
- const { currentMethod, selectedAmount } = context;
17340
+ const { currentMethod, selectedAmount, promotionsNo } = context;
17304
17341
  return await request.send(
17305
17342
  payment.getDepositExpectedResult({
17306
17343
  method: currentMethod,
17307
17344
  amount: selectedAmount,
17345
+ promotionsNo,
17308
17346
  })
17309
17347
  )
17310
17348
  },
17311
17349
  submitDeposit: async (context, event) => {
17312
- const { currentMethod, selectedAmount } = context;
17350
+ const { currentMethod, selectedAmount, promotionsNo } = context;
17313
17351
  return await request.send(
17314
17352
  payment.submitDepositTransaction({
17315
17353
  method: currentMethod,
17316
17354
  amount: selectedAmount,
17355
+ promotionsNo,
17317
17356
  })
17318
17357
  )
17319
17358
  },
@@ -18651,6 +18690,9 @@ function direct (request) {
18651
18690
  currentMethod: null,
18652
18691
  amount: null,
18653
18692
  result: null,
18693
+
18694
+ // use for wallet mode 3
18695
+ promotionsNo: null,
18654
18696
  },
18655
18697
  states: {
18656
18698
  loading: {
@@ -18734,6 +18776,11 @@ function direct (request) {
18734
18776
  submitted: {},
18735
18777
  fail: {},
18736
18778
  },
18779
+ on: {
18780
+ SET_PROMOTION: {
18781
+ actions: 'setPromotionsNo',
18782
+ },
18783
+ },
18737
18784
  },
18738
18785
  {
18739
18786
  actions: {
@@ -18795,6 +18842,11 @@ function direct (request) {
18795
18842
  result: event.data,
18796
18843
  }
18797
18844
  }),
18845
+ setPromotionsNo: assign((context, event) => {
18846
+ return {
18847
+ promotionsNo: event.data,
18848
+ }
18849
+ }),
18798
18850
  },
18799
18851
  guards: {
18800
18852
  isCalculable: (context, event) => {
@@ -18820,22 +18872,24 @@ function direct (request) {
18820
18872
  return await request.send(payment.getBankList(method))
18821
18873
  },
18822
18874
  fetchCalculation: async (context, event) => {
18823
- const { currentMethod, amount } = context;
18875
+ const { currentMethod, amount, promotionsNo } = context;
18824
18876
 
18825
18877
  return await request.send(
18826
18878
  payment.getDepositExpectedResult({
18827
18879
  method: currentMethod,
18828
18880
  amount,
18881
+ promotionsNo,
18829
18882
  })
18830
18883
  )
18831
18884
  },
18832
18885
  submitDeposit: async (context, event) => {
18833
- const { currentMethod, amount, selectedBank } = context;
18886
+ const { currentMethod, amount, selectedBank, promotionsNo } = context;
18834
18887
  return await request.send(
18835
18888
  payment.submitDepositTransactionBank({
18836
18889
  method: currentMethod,
18837
18890
  amount,
18838
18891
  applyerBankCode: selectedBank.bankCode,
18892
+ promotionsNo,
18839
18893
  })
18840
18894
  )
18841
18895
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.41",
3
+ "version": "1.1.42",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -49,25 +49,25 @@ export default {
49
49
  method: 'post',
50
50
  params: { transferType },
51
51
  }),
52
- getDepositExpectedResult: ({ method, amount, cryptoCurrency }) => ({
52
+ getDepositExpectedResult: ({ method, amount, cryptoCurrency, promotionsNo }) => ({
53
53
  url: `payment/v2/${method}/expected/result`,
54
54
  method: 'post',
55
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency },
55
+ params: { transferType: 'DEPOSIT', amount, cryptoCurrency, promotionsNo },
56
56
  }),
57
57
  getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
58
58
  url: `payment/v2/${method}/expected/result`,
59
59
  method: 'post',
60
60
  params: { transferType: 'WITHDRAW', amount, cryptoNetwork },
61
61
  }),
62
- submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress }) => ({
62
+ submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo }) => ({
63
63
  url: `payment/v2/${method}/transaction`,
64
64
  method: 'post',
65
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress },
65
+ params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo },
66
66
  }),
67
- submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri }) => ({
67
+ submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri, promotionsNo }) => ({
68
68
  url: `payment/v2/${method}/transaction`,
69
69
  method: 'post',
70
- params: { transferType: 'DEPOSIT', amount, card_type, card_code, card_seri },
70
+ params: { transferType: 'DEPOSIT', amount, card_type, card_code, card_seri, promotionsNo },
71
71
  }),
72
72
  submitDepositTransactionBank: ({
73
73
  method,
@@ -79,6 +79,7 @@ export default {
79
79
  targetAccountNumber,
80
80
  depositTime = '1234567890',
81
81
  receipt,
82
+ promotionsNo,
82
83
  }) => ({
83
84
  url: `payment/v2/${method}/transaction`,
84
85
  method: 'post',
@@ -92,12 +93,13 @@ export default {
92
93
  targetAccountNumber,
93
94
  depositTime,
94
95
  receipt,
96
+ promotionsNo,
95
97
  },
96
98
  }),
97
- submitDepositTransaction: ({ method, amount }) => ({
99
+ submitDepositTransaction: ({ method, amount, promotionsNo }) => ({
98
100
  url: `payment/v2/${method}/transaction`,
99
101
  method: 'post',
100
- params: { transferType: 'DEPOSIT', amount },
102
+ params: { transferType: 'DEPOSIT', amount, promotionsNo },
101
103
  }),
102
104
  submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
103
105
  url: `payment/v2/${method}/transaction`,
@@ -107,7 +109,14 @@ export default {
107
109
  submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch, holderName }) => ({
108
110
  url: `payment/v2/${method}/transaction`,
109
111
  method: 'post',
110
- params: { transferType: 'WITHDRAW', amount, applyerBankCode, applyerAccountNumber, branch, holderName },
112
+ params: {
113
+ transferType: 'WITHDRAW',
114
+ amount,
115
+ applyerBankCode,
116
+ applyerAccountNumber,
117
+ branch,
118
+ holderName,
119
+ },
111
120
  }),
112
121
  submitWithdrawTransactionAmb: ({ method, amount }) => ({
113
122
  url: `payment/v2/${method}/transaction`,
@@ -17,6 +17,9 @@ export default function (request) {
17
17
  currentMethod: null,
18
18
  amount: null,
19
19
  result: null,
20
+
21
+ // use for wallet mode 3
22
+ promotionsNo: null,
20
23
  },
21
24
  states: {
22
25
  loading: {
@@ -100,6 +103,11 @@ export default function (request) {
100
103
  submitted: {},
101
104
  fail: {},
102
105
  },
106
+ on: {
107
+ SET_PROMOTION: {
108
+ actions: 'setPromotionsNo',
109
+ },
110
+ },
103
111
  },
104
112
  {
105
113
  actions: {
@@ -161,6 +169,11 @@ export default function (request) {
161
169
  result: event.data,
162
170
  }
163
171
  }),
172
+ setPromotionsNo: assign((context, event) => {
173
+ return {
174
+ promotionsNo: event.data,
175
+ }
176
+ }),
164
177
  },
165
178
  guards: {
166
179
  isCalculable: (context, event) => {
@@ -186,22 +199,24 @@ export default function (request) {
186
199
  return await request.send(payment.getBankList(method))
187
200
  },
188
201
  fetchCalculation: async (context, event) => {
189
- const { currentMethod, amount } = context
202
+ const { currentMethod, amount, promotionsNo } = context
190
203
 
191
204
  return await request.send(
192
205
  payment.getDepositExpectedResult({
193
206
  method: currentMethod,
194
207
  amount,
208
+ promotionsNo,
195
209
  })
196
210
  )
197
211
  },
198
212
  submitDeposit: async (context, event) => {
199
- const { currentMethod, amount, selectedBank } = context
213
+ const { currentMethod, amount, selectedBank, promotionsNo } = context
200
214
  return await request.send(
201
215
  payment.submitDepositTransactionBank({
202
216
  method: currentMethod,
203
217
  amount,
204
218
  applyerBankCode: selectedBank.bankCode,
219
+ promotionsNo,
205
220
  })
206
221
  )
207
222
  },
@@ -28,6 +28,9 @@ export default function (request) {
28
28
 
29
29
  calculation: null,
30
30
  processing: null,
31
+
32
+ // use for wallet mode 3
33
+ promotionsNo: null,
31
34
  },
32
35
  states: {
33
36
  loading: {
@@ -180,6 +183,11 @@ export default function (request) {
180
183
  submitted: {},
181
184
  fail: {},
182
185
  },
186
+ on: {
187
+ SET_PROMOTION: {
188
+ actions: 'setPromotionsNo',
189
+ },
190
+ },
183
191
  },
184
192
  {
185
193
  actions: {
@@ -281,6 +289,11 @@ export default function (request) {
281
289
  receipt: event.data,
282
290
  }
283
291
  }),
292
+ setPromotionsNo: assign((context, event) => {
293
+ return {
294
+ promotionsNo: event.data,
295
+ }
296
+ }),
284
297
  },
285
298
  guards: {
286
299
  isCalculable: (context, event) => {
@@ -317,11 +330,12 @@ export default function (request) {
317
330
  return await request.send(payment.getBankList(method))
318
331
  },
319
332
  fetchCalculation: async (context, event) => {
320
- const { method, amount } = context
321
- return await request.send(payment.getDepositExpectedResult({ method, amount }))
333
+ const { method, amount, promotionsNo } = context
334
+ return await request.send(payment.getDepositExpectedResult({ method, amount, promotionsNo }))
322
335
  },
323
336
  submitDeposit: async (context, event) => {
324
- const { method, amount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt } = context
337
+ const { method, amount, selectedHouseBank, selectedUserBank, userAccountNumber, userAccountName, depositTime, receipt, promotionsNo } =
338
+ context
325
339
  return await request.send(
326
340
  payment.submitDepositTransactionBank({
327
341
  method,
@@ -333,6 +347,7 @@ export default function (request) {
333
347
  applyerHolderName: userAccountName,
334
348
  depositTime,
335
349
  receipt,
350
+ promotionsNo,
336
351
  })
337
352
  )
338
353
  },
@@ -25,6 +25,9 @@ export default function (request) {
25
25
  result: null,
26
26
 
27
27
  grandTotalEnable: 1,
28
+
29
+ // use for wallet mode 3
30
+ promotionsNo: null,
28
31
  },
29
32
  states: {
30
33
  loading: {
@@ -315,6 +318,11 @@ export default function (request) {
315
318
  },
316
319
  },
317
320
  },
321
+ on: {
322
+ SET_PROMOTION: {
323
+ actions: 'setPromotionsNo',
324
+ },
325
+ },
318
326
  },
319
327
  {
320
328
  actions: {
@@ -372,6 +380,11 @@ export default function (request) {
372
380
  result: event.data,
373
381
  }
374
382
  }),
383
+ setPromotionsNo: assign((context, event) => {
384
+ return {
385
+ promotionsNo: event.data,
386
+ }
387
+ }),
375
388
  },
376
389
  guards: {
377
390
  isNewWalletMode: (context, event) => {
@@ -388,20 +401,22 @@ export default function (request) {
388
401
  return { siteConfig, paymentDetail }
389
402
  },
390
403
  fetchCalculation: async (context, event) => {
391
- const { currentMethod, selectedAmount } = context
404
+ const { currentMethod, selectedAmount, promotionsNo } = context
392
405
  return await request.send(
393
406
  payment.getDepositExpectedResult({
394
407
  method: currentMethod,
395
408
  amount: selectedAmount,
409
+ promotionsNo,
396
410
  })
397
411
  )
398
412
  },
399
413
  submitDeposit: async (context, event) => {
400
- const { currentMethod, selectedAmount } = context
414
+ const { currentMethod, selectedAmount, promotionsNo } = context
401
415
  return await request.send(
402
416
  payment.submitDepositTransaction({
403
417
  method: currentMethod,
404
418
  amount: selectedAmount,
419
+ promotionsNo,
405
420
  })
406
421
  )
407
422
  },