@jetthai/cuora 1.1.8 → 1.1.9-bc88-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 +14 -0
- package/dist/bundle.mjs +2416 -10
- package/package.json +1 -1
- package/src/api/payment.js +25 -5
- package/src/machine/activity/affiliate_invite_friends_activity.js +2 -2
- package/src/machine/bank_binding_amb.js +141 -0
- package/src/machine/deposit/amb.js +90 -0
- package/src/machine/deposit/crypto.js +1 -1
- package/src/machine/deposit/crypto_button.js +1 -1
- package/src/machine/deposit/deposit_fc.js +8 -5
- package/src/machine/deposit/float.js +158 -0
- package/src/machine/deposit/index.js +16 -1
- package/src/machine/deposit/qrcode_v2.js +1 -1
- package/src/machine/deposit/qrcode_vn.js +1 -1
- package/src/machine/deposit/vpay.js +141 -0
- package/src/machine/index.js +4 -0
- package/src/machine/withdraw_amb.js +424 -0
- package/src/machine/withdraw_crypto.js +37 -25
- package/src/machine/withdraw_fc.js +1 -1
package/package.json
CHANGED
package/src/api/payment.js
CHANGED
|
@@ -2,14 +2,29 @@ export default {
|
|
|
2
2
|
// getPaymentHistory: () => ({ url: 'payment/history', method: 'post' }),
|
|
3
3
|
getPaymentHistory: (returnDays) => ({ url: 'payment/v2/history', method: 'post', params: { returnDays } }),
|
|
4
4
|
getSpotMarket: () => ({ url: 'payment/spotmarket', method: 'get' }),
|
|
5
|
-
getTransactionHistory: (payload) => ({
|
|
5
|
+
getTransactionHistory: (payload) => ({
|
|
6
|
+
url: 'payment/v2/transactionHistory',
|
|
7
|
+
method: 'post',
|
|
8
|
+
params: { ...payload },
|
|
9
|
+
}),
|
|
6
10
|
getTransactionHistoryOptions: () => ({ url: 'payment/v2/category/options', method: 'get' }),
|
|
7
11
|
// getPaymentInfo: () => ({ url: `payment/paymentInfo`, method: 'get' }),
|
|
8
12
|
getPaymentInfo: () => ({ url: `payment/v2/paymentInfo`, method: 'get' }),
|
|
9
13
|
updatePaymentInfo: ({ bankCode, branch, holderName, bankAccount, firstNameTh, lastNameTh, firstNameEn, lastNameEn, bonus, paymentProvider }) => ({
|
|
10
14
|
url: 'payment/v2/updatePaymentInfo',
|
|
11
15
|
method: 'post',
|
|
12
|
-
params: {
|
|
16
|
+
params: {
|
|
17
|
+
bankCode,
|
|
18
|
+
branch,
|
|
19
|
+
holderName,
|
|
20
|
+
bankAccount,
|
|
21
|
+
firstNameTh,
|
|
22
|
+
lastNameTh,
|
|
23
|
+
firstNameEn,
|
|
24
|
+
lastNameEn,
|
|
25
|
+
bonus,
|
|
26
|
+
paymentProvider,
|
|
27
|
+
},
|
|
13
28
|
}),
|
|
14
29
|
getBankList: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/getBankList`, method: 'get' }),
|
|
15
30
|
makeTransaction: ({ type, payload, paymentMethod }) => ({
|
|
@@ -44,7 +59,7 @@ export default {
|
|
|
44
59
|
method: 'post',
|
|
45
60
|
params: { transferType: 'WITHDRAW', amount, cryptoNetwork },
|
|
46
61
|
}),
|
|
47
|
-
|
|
62
|
+
submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress }) => ({
|
|
48
63
|
url: `payment/v2/${method}/transaction`,
|
|
49
64
|
method: 'post',
|
|
50
65
|
params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress },
|
|
@@ -79,12 +94,12 @@ export default {
|
|
|
79
94
|
receipt,
|
|
80
95
|
},
|
|
81
96
|
}),
|
|
82
|
-
|
|
97
|
+
submitDepositTransaction: ({ method, amount }) => ({
|
|
83
98
|
url: `payment/v2/${method}/transaction`,
|
|
84
99
|
method: 'post',
|
|
85
100
|
params: { transferType: 'DEPOSIT', amount },
|
|
86
101
|
}),
|
|
87
|
-
|
|
102
|
+
submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
|
|
88
103
|
url: `payment/v2/${method}/transaction`,
|
|
89
104
|
method: 'post',
|
|
90
105
|
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress },
|
|
@@ -94,4 +109,9 @@ export default {
|
|
|
94
109
|
method: 'post',
|
|
95
110
|
params: { transferType: 'WITHDRAW', amount, applyerBankCode, applyerAccountNumber, branch, holderName },
|
|
96
111
|
}),
|
|
112
|
+
submitWithdrawTransactionAmb: ({ method, amount }) => ({
|
|
113
|
+
url: `payment/v2/${method}/transaction`,
|
|
114
|
+
method: 'post',
|
|
115
|
+
params: { transferType: 'WITHDRAW', amount },
|
|
116
|
+
}),
|
|
97
117
|
}
|
|
@@ -79,7 +79,7 @@ export default function (request) {
|
|
|
79
79
|
target: 'awarding',
|
|
80
80
|
},
|
|
81
81
|
onError: {
|
|
82
|
-
target: '
|
|
82
|
+
target: 'idle',
|
|
83
83
|
},
|
|
84
84
|
},
|
|
85
85
|
},
|
|
@@ -90,7 +90,7 @@ export default function (request) {
|
|
|
90
90
|
target: 'bound',
|
|
91
91
|
},
|
|
92
92
|
onError: {
|
|
93
|
-
target: '
|
|
93
|
+
target: 'idle',
|
|
94
94
|
},
|
|
95
95
|
},
|
|
96
96
|
},
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { assign, createMachine } from 'xstate'
|
|
2
|
+
import payment from '../api/payment.js'
|
|
3
|
+
|
|
4
|
+
export default function (request) {
|
|
5
|
+
return createMachine(
|
|
6
|
+
{
|
|
7
|
+
id: 'bank_binding_amb',
|
|
8
|
+
initial: 'fetching',
|
|
9
|
+
context: {
|
|
10
|
+
hasAnyAccount: false,
|
|
11
|
+
bankList: [],
|
|
12
|
+
bank: null,
|
|
13
|
+
// bonus: 0,
|
|
14
|
+
bankAccount: null,
|
|
15
|
+
firstNameTh: null,
|
|
16
|
+
lastNameTh: null,
|
|
17
|
+
firstNameEn: null,
|
|
18
|
+
lastNameEn: null,
|
|
19
|
+
},
|
|
20
|
+
states: {
|
|
21
|
+
fetching: {
|
|
22
|
+
invoke: {
|
|
23
|
+
src: 'fetchInitData',
|
|
24
|
+
onDone: {
|
|
25
|
+
target: 'idle',
|
|
26
|
+
actions: 'setBanks',
|
|
27
|
+
},
|
|
28
|
+
onError: {
|
|
29
|
+
target: 'idle',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
idle: {
|
|
34
|
+
on: {
|
|
35
|
+
SET_BANK_CODE: {
|
|
36
|
+
actions: assign((context, event) => {
|
|
37
|
+
console.log(event.data)
|
|
38
|
+
return {
|
|
39
|
+
bank: event.data,
|
|
40
|
+
}
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
SET_BANK_ACCOUNT: {
|
|
44
|
+
actions: assign((context, event) => {
|
|
45
|
+
return {
|
|
46
|
+
bankAccount: event.data,
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
SET_FIRST_NAME_TH: {
|
|
51
|
+
actions: assign((context, event) => {
|
|
52
|
+
return {
|
|
53
|
+
firstNameTh: event.data,
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
},
|
|
57
|
+
SET_LAST_NAME_TH: {
|
|
58
|
+
actions: assign((context, event) => {
|
|
59
|
+
return {
|
|
60
|
+
lastNameTh: event.data,
|
|
61
|
+
}
|
|
62
|
+
}),
|
|
63
|
+
},
|
|
64
|
+
SET_FIRST_NAME_EN: {
|
|
65
|
+
actions: assign((context, event) => {
|
|
66
|
+
return {
|
|
67
|
+
firstNameEn: event.data,
|
|
68
|
+
}
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
SET_LAST_NAME_EN: {
|
|
72
|
+
actions: assign((context, event) => {
|
|
73
|
+
return {
|
|
74
|
+
lastNameEn: event.data,
|
|
75
|
+
}
|
|
76
|
+
}),
|
|
77
|
+
},
|
|
78
|
+
BIND_BANK: {
|
|
79
|
+
target: 'binding',
|
|
80
|
+
cond: 'isBindable',
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
binding: {
|
|
85
|
+
invoke: {
|
|
86
|
+
src: 'updatePaymentInfo',
|
|
87
|
+
onDone: {
|
|
88
|
+
target: 'bound',
|
|
89
|
+
},
|
|
90
|
+
onError: {
|
|
91
|
+
target: 'idle',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
bound: {},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
actions: {
|
|
100
|
+
setBanks: assign((context, event) => {
|
|
101
|
+
const { bankList = [], paymentInfo = {} } = event.data
|
|
102
|
+
const { bankInfo = [] } = paymentInfo
|
|
103
|
+
return {
|
|
104
|
+
hasAnyAccount: bankInfo.length > 0,
|
|
105
|
+
holderName: bankInfo[0]?.holderName,
|
|
106
|
+
bankList,
|
|
107
|
+
bank: bankList[0],
|
|
108
|
+
}
|
|
109
|
+
}),
|
|
110
|
+
},
|
|
111
|
+
guards: {
|
|
112
|
+
isBindable: (context, event) => {
|
|
113
|
+
const { bank, bankAccount, firstNameTh, lastNameTh, firstNameEn, lastNameEn } = context
|
|
114
|
+
|
|
115
|
+
return bank.bankCode && bankAccount && firstNameTh && lastNameTh && firstNameEn && lastNameEn
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
services: {
|
|
119
|
+
fetchInitData: async (context, event) => {
|
|
120
|
+
const [bankList, paymentInfo] = await Promise.all([request.send(payment.getBankList('amb')), request.send(payment.getPaymentInfo())])
|
|
121
|
+
return { bankList, paymentInfo }
|
|
122
|
+
},
|
|
123
|
+
updatePaymentInfo: async (context, event) => {
|
|
124
|
+
const { bonus, bank, bankAccount, firstNameTh, lastNameTh, firstNameEn, lastNameEn } = context
|
|
125
|
+
return await request.send(
|
|
126
|
+
payment.updatePaymentInfo({
|
|
127
|
+
paymentProvider: 'amb',
|
|
128
|
+
// bonus,
|
|
129
|
+
bankCode: bank.bankCode,
|
|
130
|
+
bankAccount,
|
|
131
|
+
firstNameTh,
|
|
132
|
+
lastNameTh,
|
|
133
|
+
firstNameEn,
|
|
134
|
+
lastNameEn,
|
|
135
|
+
})
|
|
136
|
+
)
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { assign, createMachine } from 'xstate'
|
|
2
|
+
import payment from '../../api/payment.js'
|
|
3
|
+
|
|
4
|
+
export default function (request) {
|
|
5
|
+
return createMachine(
|
|
6
|
+
{
|
|
7
|
+
id: 'amb',
|
|
8
|
+
initial: 'loading',
|
|
9
|
+
context: {
|
|
10
|
+
bankList: [],
|
|
11
|
+
userAccount: {},
|
|
12
|
+
houseAccountName: null,
|
|
13
|
+
houseAccountNumber: null,
|
|
14
|
+
houseBankName: null,
|
|
15
|
+
method: 'amb',
|
|
16
|
+
},
|
|
17
|
+
states: {
|
|
18
|
+
loading: {
|
|
19
|
+
initial: 'checkingUserAccount',
|
|
20
|
+
states: {
|
|
21
|
+
checkingUserAccount: {
|
|
22
|
+
invoke: {
|
|
23
|
+
src: 'fetchPaymentInfo',
|
|
24
|
+
onDone: [
|
|
25
|
+
{
|
|
26
|
+
target: 'initializing',
|
|
27
|
+
actions: 'setUserAccount',
|
|
28
|
+
cond: 'hasUserAccount',
|
|
29
|
+
},
|
|
30
|
+
{ target: '#amb.accountUnbound' },
|
|
31
|
+
],
|
|
32
|
+
onError: {
|
|
33
|
+
target: '#amb.unavailable',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
initializing: {
|
|
38
|
+
invoke: {
|
|
39
|
+
src: 'initialize',
|
|
40
|
+
onDone: { target: '#amb.finish', actions: 'setInitialization' },
|
|
41
|
+
onError: {
|
|
42
|
+
target: '#amb.unavailable',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
finish: {},
|
|
49
|
+
accountUnbound: {},
|
|
50
|
+
unavailable: {},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
actions: {
|
|
55
|
+
setUserAccount: assign((context, event) => {
|
|
56
|
+
return {
|
|
57
|
+
userAccount: event.data.bankInfo?.[0],
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
60
|
+
setInitialization: assign((context, event) => {
|
|
61
|
+
const { houseAccount, bankList } = event.data
|
|
62
|
+
return {
|
|
63
|
+
houseAccountName: houseAccount.accountName,
|
|
64
|
+
houseAccountNumber: houseAccount.accountNumber,
|
|
65
|
+
houseBankName: houseAccount.bankName,
|
|
66
|
+
bankList,
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
},
|
|
70
|
+
guards: {
|
|
71
|
+
hasUserAccount: (context, event) => {
|
|
72
|
+
return event.data.bankInfo?.[0]
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
services: {
|
|
76
|
+
fetchPaymentInfo: async (context, event) => {
|
|
77
|
+
return await request.send(payment.getPaymentInfo())
|
|
78
|
+
},
|
|
79
|
+
initialize: async (context, event) => {
|
|
80
|
+
const { method } = context
|
|
81
|
+
const [houseAccount, bankList] = await Promise.all([
|
|
82
|
+
request.send(payment.submitDepositTransaction({ method })),
|
|
83
|
+
request.send(payment.getBankList(method)),
|
|
84
|
+
])
|
|
85
|
+
return { houseAccount, bankList }
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
}
|
|
@@ -252,7 +252,7 @@ export default function (request) {
|
|
|
252
252
|
submitDeposit: async (context, event) => {
|
|
253
253
|
const { selectedCrypto, selectedNetwork, calculation, sourceAddress } = context
|
|
254
254
|
return await request.send(
|
|
255
|
-
payment.
|
|
255
|
+
payment.submitDepositTransactionCrypto({
|
|
256
256
|
method: selectedCrypto.method,
|
|
257
257
|
amount: calculation.actualAmount,
|
|
258
258
|
cryptoCurrency: selectedCrypto.channel,
|
|
@@ -304,7 +304,7 @@ export default function (request) {
|
|
|
304
304
|
submitDeposit: async (context, event) => {
|
|
305
305
|
const { selectedCrypto, selectedNetwork, calculation, sourceAddress } = context
|
|
306
306
|
return await request.send(
|
|
307
|
-
payment.
|
|
307
|
+
payment.submitDepositTransactionCrypto({
|
|
308
308
|
method: selectedCrypto.method,
|
|
309
309
|
amount: calculation.actualAmount,
|
|
310
310
|
cryptoCurrency: selectedCrypto.channel,
|
|
@@ -59,9 +59,7 @@ export default function (request) {
|
|
|
59
59
|
},
|
|
60
60
|
checking: {
|
|
61
61
|
entry: 'clearCalculatedResult',
|
|
62
|
-
always: [
|
|
63
|
-
{ target: 'debouncing', cond: 'isCalculable' },
|
|
64
|
-
{ target: 'loaded'}]
|
|
62
|
+
always: [{ target: 'debouncing', cond: 'isCalculable' }, { target: 'loaded' }],
|
|
65
63
|
},
|
|
66
64
|
debouncing: {
|
|
67
65
|
after: {
|
|
@@ -132,7 +130,12 @@ export default function (request) {
|
|
|
132
130
|
actions: {
|
|
133
131
|
setCryptos: assign((context, event) => {
|
|
134
132
|
return {
|
|
135
|
-
cryptos: event.data.map((crypto) => ({
|
|
133
|
+
cryptos: event.data.map((crypto) => ({
|
|
134
|
+
...crypto,
|
|
135
|
+
label: crypto.channel,
|
|
136
|
+
value: crypto.method,
|
|
137
|
+
icon: crypto.channel,
|
|
138
|
+
})),
|
|
136
139
|
}
|
|
137
140
|
}),
|
|
138
141
|
setCrypto: assign((context, event) => {
|
|
@@ -238,7 +241,7 @@ export default function (request) {
|
|
|
238
241
|
submitDeposit: async (context, event) => {
|
|
239
242
|
const { currentCrypto, currentNetwork, calculatedResult } = context
|
|
240
243
|
return await request.send(
|
|
241
|
-
payment.
|
|
244
|
+
payment.submitDepositTransactionCrypto({
|
|
242
245
|
method: currentCrypto.method,
|
|
243
246
|
amount: calculatedResult.actualAmount,
|
|
244
247
|
cryptoCurrency: currentCrypto.channel,
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { assign, createMachine } from 'xstate'
|
|
2
|
+
import payment from '../../api/payment.js'
|
|
3
|
+
|
|
4
|
+
export default function (request) {
|
|
5
|
+
return createMachine(
|
|
6
|
+
{
|
|
7
|
+
id: 'float',
|
|
8
|
+
initial: 'loading',
|
|
9
|
+
context: {
|
|
10
|
+
method: 'amb_float',
|
|
11
|
+
userAccount: {},
|
|
12
|
+
amount: 0,
|
|
13
|
+
|
|
14
|
+
bankList: [],
|
|
15
|
+
options: [],
|
|
16
|
+
minimum: 0,
|
|
17
|
+
maximum: 0,
|
|
18
|
+
|
|
19
|
+
houseAccountName: null,
|
|
20
|
+
houseAccountNumber: null,
|
|
21
|
+
houseBankName: null,
|
|
22
|
+
calculatedAmount: 0,
|
|
23
|
+
|
|
24
|
+
ttl: 120,
|
|
25
|
+
},
|
|
26
|
+
states: {
|
|
27
|
+
loading: {
|
|
28
|
+
initial: 'checkingUserAccount',
|
|
29
|
+
states: {
|
|
30
|
+
checkingUserAccount: {
|
|
31
|
+
invoke: {
|
|
32
|
+
src: 'fetchPaymentInfo',
|
|
33
|
+
onDone: [
|
|
34
|
+
{
|
|
35
|
+
target: 'initializing',
|
|
36
|
+
actions: 'setUserAccount',
|
|
37
|
+
cond: 'hasUserAccount',
|
|
38
|
+
},
|
|
39
|
+
{ target: '#float.accountUnbound' },
|
|
40
|
+
],
|
|
41
|
+
onError: {
|
|
42
|
+
target: '#float.unavailable',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
initializing: {
|
|
47
|
+
invoke: {
|
|
48
|
+
src: 'initialize',
|
|
49
|
+
onDone: { target: '#float.submittable', actions: 'setInitialization' },
|
|
50
|
+
onError: {
|
|
51
|
+
target: '#float.unavailable',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
submittable: {
|
|
58
|
+
on: {
|
|
59
|
+
ADD: {
|
|
60
|
+
actions: 'add',
|
|
61
|
+
},
|
|
62
|
+
CLEAR: {
|
|
63
|
+
actions: 'clear',
|
|
64
|
+
},
|
|
65
|
+
SUBMIT: {
|
|
66
|
+
target: 'submitting',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
submitting: {
|
|
71
|
+
invoke: {
|
|
72
|
+
src: 'submitDeposit',
|
|
73
|
+
onDone: { target: 'countdown', actions: 'setHouseBank' },
|
|
74
|
+
onError: {
|
|
75
|
+
target: 'submittable',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
countdown: {
|
|
80
|
+
after: {
|
|
81
|
+
1000: {
|
|
82
|
+
target: 'countdown',
|
|
83
|
+
actions: 'decreaseTtl',
|
|
84
|
+
cond: (context) => context.ttl > 0,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
accountUnbound: {},
|
|
89
|
+
unavailable: {},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
actions: {
|
|
94
|
+
setUserAccount: assign((context, event) => {
|
|
95
|
+
return {
|
|
96
|
+
userAccount: event.data.bankInfo?.[0],
|
|
97
|
+
}
|
|
98
|
+
}),
|
|
99
|
+
setHouseBank: assign((context, event) => {
|
|
100
|
+
const { accountName, accountNumber, bankName, amount } = event.data
|
|
101
|
+
return {
|
|
102
|
+
houseAccountName: accountName,
|
|
103
|
+
houseAccountNumber: accountNumber,
|
|
104
|
+
houseBankName: bankName,
|
|
105
|
+
calculatedAmount: amount,
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
setInitialization: assign((context, event) => {
|
|
109
|
+
const { housePayment, bankList } = event.data
|
|
110
|
+
const { optional, minimum, maximum } = housePayment
|
|
111
|
+
return {
|
|
112
|
+
options: optional,
|
|
113
|
+
minimum,
|
|
114
|
+
maximum,
|
|
115
|
+
bankList,
|
|
116
|
+
}
|
|
117
|
+
}),
|
|
118
|
+
add: assign((context, event) => {
|
|
119
|
+
const { amount, maximum } = context
|
|
120
|
+
return {
|
|
121
|
+
amount: Math.min(amount + event.data, maximum),
|
|
122
|
+
}
|
|
123
|
+
}),
|
|
124
|
+
clear: assign((context, event) => {
|
|
125
|
+
return {
|
|
126
|
+
amount: 0,
|
|
127
|
+
}
|
|
128
|
+
}),
|
|
129
|
+
decreaseTtl: assign((context, evnet) => {
|
|
130
|
+
const ms = context.ttl
|
|
131
|
+
return {
|
|
132
|
+
ttl: Math.max(ms - 1, 0),
|
|
133
|
+
}
|
|
134
|
+
}),
|
|
135
|
+
},
|
|
136
|
+
guards: {
|
|
137
|
+
hasUserAccount: (context, event) => {
|
|
138
|
+
return event.data.bankInfo?.[0]
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
services: {
|
|
142
|
+
fetchPaymentInfo: async (context, event) => {
|
|
143
|
+
return await request.send(payment.getPaymentInfo())
|
|
144
|
+
},
|
|
145
|
+
initialize: async (context, event) => {
|
|
146
|
+
const [payments, bankList] = await Promise.all([
|
|
147
|
+
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
148
|
+
request.send(payment.getBankList('amb')),
|
|
149
|
+
])
|
|
150
|
+
return { housePayment: payments.find((payment) => payment.method === context.method), bankList }
|
|
151
|
+
},
|
|
152
|
+
submitDeposit: async (context, event) => {
|
|
153
|
+
return await request.send(payment.submitDepositTransaction({ method: 'amb', amount: context.amount }))
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
}
|
|
@@ -6,5 +6,20 @@ import deposit_fc from './deposit_fc.js'
|
|
|
6
6
|
import crypto from './crypto.js'
|
|
7
7
|
import crypto_button from './crypto_button.js'
|
|
8
8
|
import direct from './direct.js'
|
|
9
|
+
import amb from './amb.js'
|
|
10
|
+
import float from './float.js'
|
|
11
|
+
import vpay from './vpay.js'
|
|
9
12
|
|
|
10
|
-
export default {
|
|
13
|
+
export default {
|
|
14
|
+
manual_vn,
|
|
15
|
+
loadcard_vn,
|
|
16
|
+
qrcode_vn,
|
|
17
|
+
qrcode_v2,
|
|
18
|
+
deposit_fc,
|
|
19
|
+
crypto,
|
|
20
|
+
crypto_button,
|
|
21
|
+
direct,
|
|
22
|
+
amb,
|
|
23
|
+
float,
|
|
24
|
+
vpay,
|
|
25
|
+
}
|
|
@@ -239,7 +239,7 @@ export default function (request) {
|
|
|
239
239
|
submitDeposit: async (context, event) => {
|
|
240
240
|
const { currentMethod, selectedAmount } = context
|
|
241
241
|
return await request.send(
|
|
242
|
-
payment.
|
|
242
|
+
payment.submitDepositTransaction({
|
|
243
243
|
method: currentMethod,
|
|
244
244
|
amount: selectedAmount,
|
|
245
245
|
})
|
|
@@ -194,7 +194,7 @@ export default function (request) {
|
|
|
194
194
|
submitDeposit: async (context, event) => {
|
|
195
195
|
const { currentMethod, selectedAmount } = context
|
|
196
196
|
return await request.send(
|
|
197
|
-
payment.
|
|
197
|
+
payment.submitDepositTransaction({
|
|
198
198
|
method: currentMethod,
|
|
199
199
|
amount: selectedAmount,
|
|
200
200
|
})
|