@jetthai/cuora 1.1.65-doubleWallet-1 → 1.1.65
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 +0 -4
- package/dist/bundle.mjs +532 -700
- package/package.json +1 -1
- package/src/api/payment.js +0 -2
- package/src/machine/activity/activity.js +1 -1
- package/src/machine/deposit/crypto.js +19 -36
- package/src/machine/deposit/crypto_button.js +126 -103
- package/src/machine/deposit/direct.js +7 -69
- package/src/machine/deposit/float.js +27 -94
- package/src/machine/deposit/loadcard_vn.js +146 -114
- package/src/machine/deposit/manual_vn.js +7 -39
- package/src/machine/deposit/qrcode_v2.js +171 -155
- package/src/machine/deposit/vpay.js +26 -89
package/dist/bundle.mjs
CHANGED
|
@@ -3769,7 +3769,6 @@ var payment = {
|
|
|
3769
3769
|
checkTransaction: (paymentMethod) => ({ url: `payment/${paymentMethod}/checkTransaction`, method: 'post' }),
|
|
3770
3770
|
setBonusSetting: ({ bonus }) => ({ url: 'payment/v2/setting', method: 'post', params: { bonus } }),
|
|
3771
3771
|
getCurrentWithdrawRule: () => ({ url: 'payment/v2/getCurrentWithdrawRule', method: 'get' }),
|
|
3772
|
-
getDoubleWalletWithdrawRule: ({ walletType }) => ({ url: 'payment/v2/withdrawRule', method: 'post', params: { walletType } }),
|
|
3773
3772
|
convertFreeCredit: ({ exchangeType, cryptoNetwork, targetAddress }) => ({
|
|
3774
3773
|
url: 'payment/v2/convertFreeCredit',
|
|
3775
3774
|
method: 'post',
|
|
@@ -3868,7 +3867,6 @@ var payment = {
|
|
|
3868
3867
|
}),
|
|
3869
3868
|
giveUp: () => ({ url: 'payment/v2/bankWallet/promotion/giveUp', method: 'post' }),
|
|
3870
3869
|
restore: ({ amount }) => ({ url: 'payment/v2/bankWallet/restore', method: 'post', params: { amount } }),
|
|
3871
|
-
restore: () => ({ url: 'payment/v2/bankWallet/restore', method: 'post', params: { amount } }),
|
|
3872
3870
|
};
|
|
3873
3871
|
|
|
3874
3872
|
var user = {
|
|
@@ -9122,7 +9120,7 @@ function activity$1 (request) {
|
|
|
9122
9120
|
setActivityList: assign((context, event) => {
|
|
9123
9121
|
const noRedActivity = [2, 4, 13, 20, 90, 91, 92];
|
|
9124
9122
|
const { uidSite } = context;
|
|
9125
|
-
let list =
|
|
9123
|
+
let list = event.data;
|
|
9126
9124
|
list.forEach((activity) => {
|
|
9127
9125
|
const storageUnread = localStorage.getItem(`unread_${activity.activityNo}_${uidSite}`);
|
|
9128
9126
|
if (noRedActivity.includes(activity.activityType)) {
|
|
@@ -22698,14 +22696,12 @@ function withdraw_amb (request) {
|
|
|
22698
22696
|
}
|
|
22699
22697
|
|
|
22700
22698
|
function manual_vn (request) {
|
|
22701
|
-
const { appSecret } = request.config;
|
|
22702
22699
|
return createMachine(
|
|
22703
22700
|
{
|
|
22704
22701
|
id: 'manual',
|
|
22705
22702
|
initial: 'loading',
|
|
22706
22703
|
context: {
|
|
22707
|
-
|
|
22708
|
-
paymentDetail: [],
|
|
22704
|
+
paymentDetails: [],
|
|
22709
22705
|
|
|
22710
22706
|
houseBanks: [],
|
|
22711
22707
|
playerBanks: [],
|
|
@@ -22771,10 +22767,6 @@ function manual_vn (request) {
|
|
|
22771
22767
|
states: {
|
|
22772
22768
|
promotion: {
|
|
22773
22769
|
always: [
|
|
22774
|
-
{
|
|
22775
|
-
target: 'idle',
|
|
22776
|
-
cond: 'isDoubleWalletMode',
|
|
22777
|
-
},
|
|
22778
22770
|
{
|
|
22779
22771
|
target: 'calculating',
|
|
22780
22772
|
actions: 'setPromotionDefaultAmount',
|
|
@@ -22819,26 +22811,8 @@ function manual_vn (request) {
|
|
|
22819
22811
|
actions: 'clearCalculation',
|
|
22820
22812
|
},
|
|
22821
22813
|
TRANSACT: {
|
|
22822
|
-
target: 'checking',
|
|
22823
|
-
cond: 'isCalculated',
|
|
22824
|
-
},
|
|
22825
|
-
},
|
|
22826
|
-
},
|
|
22827
|
-
checking: {
|
|
22828
|
-
always: [
|
|
22829
|
-
{
|
|
22830
|
-
target: 'pending',
|
|
22831
|
-
cond: (context, event) => context.siteConfig?.walletMode === '4' && !!context.calculation,
|
|
22832
|
-
},
|
|
22833
|
-
{
|
|
22834
|
-
target: '#manual.step2',
|
|
22835
|
-
},
|
|
22836
|
-
],
|
|
22837
|
-
},
|
|
22838
|
-
pending: {
|
|
22839
|
-
on: {
|
|
22840
|
-
CONFIRM: {
|
|
22841
22814
|
target: '#manual.step2',
|
|
22815
|
+
cond: 'isCalculated',
|
|
22842
22816
|
},
|
|
22843
22817
|
},
|
|
22844
22818
|
},
|
|
@@ -22924,16 +22898,15 @@ function manual_vn (request) {
|
|
|
22924
22898
|
{
|
|
22925
22899
|
actions: {
|
|
22926
22900
|
setInitData: assign((context, event) => {
|
|
22927
|
-
const {
|
|
22901
|
+
const { paymentInfo, paymentDetails } = event.data;
|
|
22928
22902
|
const bankInfoList = paymentInfo?.bankInfo || [];
|
|
22929
|
-
const currentPayment =
|
|
22903
|
+
const currentPayment = paymentDetails.find((element) => element.category === context.currentCategory);
|
|
22930
22904
|
const houseBanks = currentPayment.banks.map((item) => {
|
|
22931
22905
|
item.bankCode = item.bankName;
|
|
22932
22906
|
return item
|
|
22933
22907
|
});
|
|
22934
22908
|
return {
|
|
22935
|
-
|
|
22936
|
-
paymentDetail,
|
|
22909
|
+
paymentDetails,
|
|
22937
22910
|
currentPayment,
|
|
22938
22911
|
method: currentPayment.method,
|
|
22939
22912
|
houseBanks,
|
|
@@ -23034,9 +23007,6 @@ function manual_vn (request) {
|
|
|
23034
23007
|
}),
|
|
23035
23008
|
},
|
|
23036
23009
|
guards: {
|
|
23037
|
-
isDoubleWalletMode: (context, event) => {
|
|
23038
|
-
return context.siteConfig?.walletMode === '4'
|
|
23039
|
-
},
|
|
23040
23010
|
isCalculable: (context, event) => {
|
|
23041
23011
|
const {
|
|
23042
23012
|
amount,
|
|
@@ -23060,16 +23030,13 @@ function manual_vn (request) {
|
|
|
23060
23030
|
},
|
|
23061
23031
|
services: {
|
|
23062
23032
|
fetchInitData: async (context, event) => {
|
|
23063
|
-
const [
|
|
23064
|
-
request.send(common$1.getConfig({ appSecret })),
|
|
23033
|
+
const [paymentInfo, paymentDetails] = await Promise.all([
|
|
23065
23034
|
request.send(payment.getPaymentInfo()),
|
|
23066
23035
|
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
23067
23036
|
]);
|
|
23068
|
-
const siteConfig = JSON.parse(window.atob(config));
|
|
23069
23037
|
return {
|
|
23070
|
-
siteConfig,
|
|
23071
23038
|
paymentInfo,
|
|
23072
|
-
|
|
23039
|
+
paymentDetails,
|
|
23073
23040
|
}
|
|
23074
23041
|
},
|
|
23075
23042
|
fetchBanksList: async (context, event) => {
|
|
@@ -23131,10 +23098,6 @@ function loadcard_vn (request) {
|
|
|
23131
23098
|
currentMethod: null,
|
|
23132
23099
|
currentPayment: null,
|
|
23133
23100
|
result: null,
|
|
23134
|
-
|
|
23135
|
-
// use for wallet mode 4
|
|
23136
|
-
promotion: null,
|
|
23137
|
-
bonusPreviewData: [],
|
|
23138
23101
|
},
|
|
23139
23102
|
states: {
|
|
23140
23103
|
loading: {
|
|
@@ -23142,7 +23105,7 @@ function loadcard_vn (request) {
|
|
|
23142
23105
|
src: 'fetchInitData',
|
|
23143
23106
|
onDone: {
|
|
23144
23107
|
target: 'checking',
|
|
23145
|
-
actions: 'setInitData',
|
|
23108
|
+
actions: ['setInitData', 'preset'],
|
|
23146
23109
|
},
|
|
23147
23110
|
onError: {
|
|
23148
23111
|
target: 'fail',
|
|
@@ -23150,72 +23113,135 @@ function loadcard_vn (request) {
|
|
|
23150
23113
|
},
|
|
23151
23114
|
},
|
|
23152
23115
|
checking: {
|
|
23153
|
-
always: [
|
|
23154
|
-
|
|
23155
|
-
|
|
23156
|
-
|
|
23157
|
-
|
|
23158
|
-
|
|
23159
|
-
|
|
23116
|
+
always: [{ target: 'newWalletMode', cond: 'isNewWalletMode' }, { target: 'defaultMode' }],
|
|
23117
|
+
},
|
|
23118
|
+
newWalletMode: {
|
|
23119
|
+
initial: 'loaded',
|
|
23120
|
+
states: {
|
|
23121
|
+
loaded: {
|
|
23122
|
+
entry: 'reset',
|
|
23123
|
+
on: {
|
|
23124
|
+
SELECT_CARD: {
|
|
23125
|
+
actions: 'setCard',
|
|
23126
|
+
},
|
|
23127
|
+
SELECT_AMOUNT: {
|
|
23128
|
+
target: 'pending',
|
|
23129
|
+
actions: 'setAmount',
|
|
23130
|
+
},
|
|
23160
23131
|
},
|
|
23161
23132
|
},
|
|
23162
|
-
|
|
23163
|
-
|
|
23164
|
-
|
|
23165
|
-
|
|
23166
|
-
|
|
23167
|
-
|
|
23168
|
-
|
|
23169
|
-
|
|
23170
|
-
|
|
23133
|
+
pending: {
|
|
23134
|
+
on: {
|
|
23135
|
+
SELECT_AMOUNT: {
|
|
23136
|
+
actions: 'setAmount',
|
|
23137
|
+
},
|
|
23138
|
+
CONFIRM: {
|
|
23139
|
+
target: 'debouncing',
|
|
23140
|
+
},
|
|
23141
|
+
BACK: {
|
|
23142
|
+
target: 'loaded',
|
|
23143
|
+
},
|
|
23144
|
+
},
|
|
23171
23145
|
},
|
|
23172
|
-
|
|
23173
|
-
|
|
23146
|
+
debouncing: {
|
|
23147
|
+
on: {
|
|
23148
|
+
SELECT_AMOUNT: {
|
|
23149
|
+
target: 'debouncing',
|
|
23150
|
+
actions: 'setAmount',
|
|
23151
|
+
},
|
|
23152
|
+
BACK: {
|
|
23153
|
+
target: 'loaded',
|
|
23154
|
+
},
|
|
23155
|
+
},
|
|
23156
|
+
after: {
|
|
23157
|
+
1000: {
|
|
23158
|
+
target: 'calculating',
|
|
23159
|
+
},
|
|
23160
|
+
},
|
|
23174
23161
|
},
|
|
23175
|
-
|
|
23176
|
-
|
|
23177
|
-
|
|
23178
|
-
|
|
23179
|
-
|
|
23180
|
-
|
|
23181
|
-
|
|
23182
|
-
|
|
23183
|
-
|
|
23184
|
-
|
|
23185
|
-
|
|
23186
|
-
|
|
23187
|
-
const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig;
|
|
23188
|
-
return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
|
|
23162
|
+
calculable: {
|
|
23163
|
+
entry: 'clearCalculation',
|
|
23164
|
+
on: {
|
|
23165
|
+
SELECT_AMOUNT: {
|
|
23166
|
+
target: 'debouncing',
|
|
23167
|
+
actions: 'setAmount',
|
|
23168
|
+
},
|
|
23169
|
+
CALCULATE: {
|
|
23170
|
+
target: 'debouncing',
|
|
23171
|
+
},
|
|
23172
|
+
BACK: {
|
|
23173
|
+
target: 'loaded',
|
|
23189
23174
|
},
|
|
23190
23175
|
},
|
|
23191
|
-
|
|
23192
|
-
|
|
23176
|
+
},
|
|
23177
|
+
calculating: {
|
|
23178
|
+
invoke: {
|
|
23179
|
+
src: 'fetchCalculation',
|
|
23180
|
+
onDone: [
|
|
23181
|
+
{
|
|
23182
|
+
target: 'submitting',
|
|
23183
|
+
actions: 'setCalculation',
|
|
23184
|
+
cond: 'jumpLinkEnable',
|
|
23185
|
+
},
|
|
23186
|
+
{
|
|
23187
|
+
target: 'cardInfo',
|
|
23188
|
+
actions: 'setCalculation',
|
|
23189
|
+
},
|
|
23190
|
+
],
|
|
23191
|
+
onError: {
|
|
23192
|
+
target: 'calculable',
|
|
23193
|
+
},
|
|
23193
23194
|
},
|
|
23194
|
-
|
|
23195
|
-
|
|
23196
|
-
{
|
|
23197
|
-
|
|
23198
|
-
|
|
23199
|
-
|
|
23195
|
+
},
|
|
23196
|
+
cardInfo: {
|
|
23197
|
+
on: {
|
|
23198
|
+
INPUT_CARD_NUMBER: {
|
|
23199
|
+
actions: 'setCardNumber',
|
|
23200
|
+
},
|
|
23201
|
+
INPUT_SERIAL_NUMBER: {
|
|
23202
|
+
actions: 'setSerialNumber',
|
|
23203
|
+
},
|
|
23204
|
+
SUBMIT: {
|
|
23205
|
+
target: 'submitting',
|
|
23206
|
+
cond: 'isSubmittable',
|
|
23207
|
+
},
|
|
23208
|
+
SELECT_CARD: {
|
|
23209
|
+
target: 'loaded',
|
|
23210
|
+
actions: 'setCard',
|
|
23211
|
+
},
|
|
23200
23212
|
},
|
|
23201
|
-
|
|
23202
|
-
|
|
23203
|
-
|
|
23213
|
+
},
|
|
23214
|
+
submitting: {
|
|
23215
|
+
invoke: {
|
|
23216
|
+
src: 'submitDeposit',
|
|
23217
|
+
onDone: {
|
|
23218
|
+
target: 'submitted',
|
|
23219
|
+
actions: 'setResult',
|
|
23220
|
+
},
|
|
23221
|
+
onError: {
|
|
23222
|
+
target: 'loaded',
|
|
23223
|
+
},
|
|
23204
23224
|
},
|
|
23205
|
-
|
|
23225
|
+
},
|
|
23226
|
+
submitted: {
|
|
23227
|
+
on: {
|
|
23228
|
+
BACK: {
|
|
23229
|
+
target: 'loaded',
|
|
23230
|
+
},
|
|
23231
|
+
},
|
|
23232
|
+
},
|
|
23206
23233
|
},
|
|
23207
23234
|
},
|
|
23208
|
-
|
|
23235
|
+
defaultMode: {
|
|
23236
|
+
entry: 'reset',
|
|
23209
23237
|
on: {
|
|
23238
|
+
SELECT_CARD: {
|
|
23239
|
+
actions: 'setCard',
|
|
23240
|
+
},
|
|
23210
23241
|
SELECT_AMOUNT: {
|
|
23242
|
+
target: 'debouncing',
|
|
23211
23243
|
actions: 'setAmount',
|
|
23212
23244
|
},
|
|
23213
|
-
CONFIRM: {
|
|
23214
|
-
target: 'calculating',
|
|
23215
|
-
},
|
|
23216
|
-
BACK: {
|
|
23217
|
-
target: 'loaded',
|
|
23218
|
-
},
|
|
23219
23245
|
},
|
|
23220
23246
|
},
|
|
23221
23247
|
debouncing: {
|
|
@@ -23225,7 +23251,7 @@ function loadcard_vn (request) {
|
|
|
23225
23251
|
actions: 'setAmount',
|
|
23226
23252
|
},
|
|
23227
23253
|
BACK: {
|
|
23228
|
-
target: '
|
|
23254
|
+
target: 'defaultMode',
|
|
23229
23255
|
},
|
|
23230
23256
|
},
|
|
23231
23257
|
after: {
|
|
@@ -23234,6 +23260,22 @@ function loadcard_vn (request) {
|
|
|
23234
23260
|
},
|
|
23235
23261
|
},
|
|
23236
23262
|
},
|
|
23263
|
+
fail: {},
|
|
23264
|
+
calculable: {
|
|
23265
|
+
entry: 'clearCalculation',
|
|
23266
|
+
on: {
|
|
23267
|
+
SELECT_AMOUNT: {
|
|
23268
|
+
target: 'debouncing',
|
|
23269
|
+
actions: 'setAmount',
|
|
23270
|
+
},
|
|
23271
|
+
CALCULATE: {
|
|
23272
|
+
target: 'debouncing',
|
|
23273
|
+
},
|
|
23274
|
+
BACK: {
|
|
23275
|
+
target: 'defaultMode',
|
|
23276
|
+
},
|
|
23277
|
+
},
|
|
23278
|
+
},
|
|
23237
23279
|
calculating: {
|
|
23238
23280
|
invoke: {
|
|
23239
23281
|
src: 'fetchCalculation',
|
|
@@ -23246,18 +23288,6 @@ function loadcard_vn (request) {
|
|
|
23246
23288
|
},
|
|
23247
23289
|
},
|
|
23248
23290
|
},
|
|
23249
|
-
calculable: {
|
|
23250
|
-
entry: 'clearCalculation',
|
|
23251
|
-
on: {
|
|
23252
|
-
SELECT_AMOUNT: {
|
|
23253
|
-
target: 'debouncing',
|
|
23254
|
-
actions: 'setAmount',
|
|
23255
|
-
},
|
|
23256
|
-
BACK: {
|
|
23257
|
-
target: 'loaded',
|
|
23258
|
-
},
|
|
23259
|
-
},
|
|
23260
|
-
},
|
|
23261
23291
|
calculated: {
|
|
23262
23292
|
on: {
|
|
23263
23293
|
SELECT_AMOUNT: {
|
|
@@ -23274,7 +23304,7 @@ function loadcard_vn (request) {
|
|
|
23274
23304
|
},
|
|
23275
23305
|
],
|
|
23276
23306
|
BACK: {
|
|
23277
|
-
target: '
|
|
23307
|
+
target: 'defaultMode',
|
|
23278
23308
|
},
|
|
23279
23309
|
CLEAR_CALCULATION: {
|
|
23280
23310
|
target: 'debouncing',
|
|
@@ -23294,21 +23324,10 @@ function loadcard_vn (request) {
|
|
|
23294
23324
|
target: 'submitting',
|
|
23295
23325
|
cond: 'isSubmittable',
|
|
23296
23326
|
},
|
|
23297
|
-
SELECT_CARD:
|
|
23298
|
-
|
|
23299
|
-
|
|
23300
|
-
|
|
23301
|
-
cond: (context, event) => {
|
|
23302
|
-
const { siteConfig = {}, promotion = {} } = context;
|
|
23303
|
-
const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig;
|
|
23304
|
-
return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
|
|
23305
|
-
},
|
|
23306
|
-
},
|
|
23307
|
-
{
|
|
23308
|
-
target: 'loaded',
|
|
23309
|
-
actions: 'setCard',
|
|
23310
|
-
},
|
|
23311
|
-
],
|
|
23327
|
+
SELECT_CARD: {
|
|
23328
|
+
target: 'defaultMode',
|
|
23329
|
+
actions: 'setCard',
|
|
23330
|
+
},
|
|
23312
23331
|
},
|
|
23313
23332
|
},
|
|
23314
23333
|
submitting: {
|
|
@@ -23319,23 +23338,18 @@ function loadcard_vn (request) {
|
|
|
23319
23338
|
actions: 'setResult',
|
|
23320
23339
|
},
|
|
23321
23340
|
onError: {
|
|
23322
|
-
target: '
|
|
23341
|
+
target: 'defaultMode',
|
|
23323
23342
|
},
|
|
23324
23343
|
},
|
|
23325
23344
|
},
|
|
23326
23345
|
submitted: {
|
|
23327
23346
|
on: {
|
|
23328
23347
|
BACK: {
|
|
23329
|
-
target: '
|
|
23348
|
+
target: 'defaultMode',
|
|
23330
23349
|
},
|
|
23331
23350
|
},
|
|
23332
23351
|
},
|
|
23333
23352
|
},
|
|
23334
|
-
on: {
|
|
23335
|
-
SET_PROMOTION: {
|
|
23336
|
-
actions: 'setPromotion',
|
|
23337
|
-
},
|
|
23338
|
-
},
|
|
23339
23353
|
},
|
|
23340
23354
|
{
|
|
23341
23355
|
actions: {
|
|
@@ -23348,10 +23362,9 @@ function loadcard_vn (request) {
|
|
|
23348
23362
|
}
|
|
23349
23363
|
}),
|
|
23350
23364
|
setInitData: assign((context, event) => {
|
|
23351
|
-
const {
|
|
23365
|
+
const { paymentDetail } = event.data;
|
|
23352
23366
|
const cards = paymentDetail.filter((element) => element.category === context.currentCategory);
|
|
23353
23367
|
return {
|
|
23354
|
-
siteConfig,
|
|
23355
23368
|
paymentDetail,
|
|
23356
23369
|
cards,
|
|
23357
23370
|
selectedCard: cards[0],
|
|
@@ -23359,9 +23372,10 @@ function loadcard_vn (request) {
|
|
|
23359
23372
|
options: cards[0].optional,
|
|
23360
23373
|
}
|
|
23361
23374
|
}),
|
|
23362
|
-
|
|
23375
|
+
preset: assign((context, event) => {
|
|
23376
|
+
const { siteConfig } = event.data;
|
|
23363
23377
|
return {
|
|
23364
|
-
|
|
23378
|
+
siteConfig,
|
|
23365
23379
|
}
|
|
23366
23380
|
}),
|
|
23367
23381
|
setCard: assign((context, event) => {
|
|
@@ -23399,15 +23413,9 @@ function loadcard_vn (request) {
|
|
|
23399
23413
|
result: event.data,
|
|
23400
23414
|
}
|
|
23401
23415
|
}),
|
|
23402
|
-
setPromotion: assign((context, event) => {
|
|
23403
|
-
const promotion = event.data;
|
|
23404
|
-
return {
|
|
23405
|
-
promotion,
|
|
23406
|
-
}
|
|
23407
|
-
}),
|
|
23408
23416
|
},
|
|
23409
23417
|
guards: {
|
|
23410
|
-
|
|
23418
|
+
isNewWalletMode: (context, event) => {
|
|
23411
23419
|
return context.siteConfig?.walletMode === '2'
|
|
23412
23420
|
},
|
|
23413
23421
|
isSubmittable: (context, event) => {
|
|
@@ -23428,25 +23436,17 @@ function loadcard_vn (request) {
|
|
|
23428
23436
|
const siteConfig = JSON.parse(window.atob(config));
|
|
23429
23437
|
return { siteConfig, paymentDetail }
|
|
23430
23438
|
},
|
|
23431
|
-
fetchBonusPreview: async (context, event) => {
|
|
23432
|
-
const { currentMethod, promotion } = context;
|
|
23433
|
-
return await request.send({
|
|
23434
|
-
paymentMethod: currentMethod,
|
|
23435
|
-
promotionsNo: promotion?.activityNo,
|
|
23436
|
-
})
|
|
23437
|
-
},
|
|
23438
23439
|
fetchCalculation: async (context, event) => {
|
|
23439
|
-
const { currentMethod, selectedAmount
|
|
23440
|
+
const { currentMethod, selectedAmount } = context;
|
|
23440
23441
|
return await request.send(
|
|
23441
23442
|
payment.getDepositExpectedResult({
|
|
23442
23443
|
method: currentMethod,
|
|
23443
23444
|
amount: selectedAmount,
|
|
23444
|
-
promotionsNo: promotion?.activityNo,
|
|
23445
23445
|
})
|
|
23446
23446
|
)
|
|
23447
23447
|
},
|
|
23448
23448
|
submitDeposit: async (context, event) => {
|
|
23449
|
-
const { currentMethod, selectedCard, selectedAmount, cardNumber, serialNumber
|
|
23449
|
+
const { currentMethod, selectedCard, selectedAmount, cardNumber, serialNumber } = context;
|
|
23450
23450
|
return await request.send(
|
|
23451
23451
|
payment.submitDepositTransactionLoadcard({
|
|
23452
23452
|
method: currentMethod,
|
|
@@ -23454,7 +23454,6 @@ function loadcard_vn (request) {
|
|
|
23454
23454
|
card_type: selectedCard.channel_id,
|
|
23455
23455
|
card_code: cardNumber,
|
|
23456
23456
|
card_seri: serialNumber,
|
|
23457
|
-
promotionsNo: promotion?.activityNo,
|
|
23458
23457
|
})
|
|
23459
23458
|
)
|
|
23460
23459
|
},
|
|
@@ -23487,9 +23486,8 @@ function qrcode_v2 (request) {
|
|
|
23487
23486
|
|
|
23488
23487
|
grandTotalEnable: 1,
|
|
23489
23488
|
|
|
23490
|
-
// use for wallet mode 3
|
|
23489
|
+
// use for wallet mode 3
|
|
23491
23490
|
promotion: null,
|
|
23492
|
-
bonusPreviewData: [],
|
|
23493
23491
|
},
|
|
23494
23492
|
states: {
|
|
23495
23493
|
loading: {
|
|
@@ -23497,7 +23495,7 @@ function qrcode_v2 (request) {
|
|
|
23497
23495
|
src: 'fetchInitData',
|
|
23498
23496
|
onDone: {
|
|
23499
23497
|
target: 'checking',
|
|
23500
|
-
actions: 'setInitData',
|
|
23498
|
+
actions: ['setInitData', 'preset'],
|
|
23501
23499
|
},
|
|
23502
23500
|
onError: {
|
|
23503
23501
|
target: 'fail',
|
|
@@ -23506,113 +23504,177 @@ function qrcode_v2 (request) {
|
|
|
23506
23504
|
},
|
|
23507
23505
|
checking: {
|
|
23508
23506
|
always: [
|
|
23507
|
+
{ target: 'newWalletMode', cond: 'isNewWalletMode' },
|
|
23509
23508
|
{
|
|
23510
|
-
target: '
|
|
23511
|
-
|
|
23512
|
-
|
|
23513
|
-
|
|
23514
|
-
|
|
23509
|
+
target: 'debouncing',
|
|
23510
|
+
actions: 'setPromotionDefaultAmount',
|
|
23511
|
+
cond: 'hasMinPromotionDeposit',
|
|
23512
|
+
},
|
|
23513
|
+
{ target: 'defaultMode' },
|
|
23514
|
+
],
|
|
23515
|
+
},
|
|
23516
|
+
newWalletMode: {
|
|
23517
|
+
initial: 'loaded',
|
|
23518
|
+
states: {
|
|
23519
|
+
loaded: {
|
|
23520
|
+
entry: 'reset',
|
|
23521
|
+
on: {
|
|
23522
|
+
SELECT_QRCODE: {
|
|
23523
|
+
actions: 'setQrcode',
|
|
23524
|
+
},
|
|
23525
|
+
SELECT_AMOUNT: [
|
|
23526
|
+
{
|
|
23527
|
+
target: 'pending',
|
|
23528
|
+
actions: 'addAmount',
|
|
23529
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
23530
|
+
},
|
|
23531
|
+
{
|
|
23532
|
+
target: 'pending',
|
|
23533
|
+
actions: 'setAmount',
|
|
23534
|
+
},
|
|
23535
|
+
],
|
|
23536
|
+
KEY_IN: {
|
|
23537
|
+
target: 'pending',
|
|
23538
|
+
actions: 'setAmount',
|
|
23539
|
+
},
|
|
23540
|
+
},
|
|
23541
|
+
},
|
|
23542
|
+
pending: {
|
|
23543
|
+
on: {
|
|
23544
|
+
SELECT_AMOUNT: [
|
|
23545
|
+
{
|
|
23546
|
+
actions: 'addAmount',
|
|
23547
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
23548
|
+
},
|
|
23549
|
+
{
|
|
23550
|
+
actions: 'setAmount',
|
|
23551
|
+
},
|
|
23552
|
+
],
|
|
23553
|
+
KEY_IN: {
|
|
23554
|
+
actions: 'setAmount',
|
|
23555
|
+
},
|
|
23556
|
+
CONFIRM: {
|
|
23557
|
+
target: 'debouncing',
|
|
23558
|
+
},
|
|
23559
|
+
BACK: {
|
|
23560
|
+
target: 'loaded',
|
|
23561
|
+
},
|
|
23562
|
+
},
|
|
23563
|
+
},
|
|
23564
|
+
debouncing: {
|
|
23565
|
+
on: {
|
|
23566
|
+
SELECT_AMOUNT: [
|
|
23567
|
+
{
|
|
23568
|
+
target: 'debouncing',
|
|
23569
|
+
actions: 'addAmount',
|
|
23570
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
23571
|
+
},
|
|
23572
|
+
{
|
|
23573
|
+
target: 'debouncing',
|
|
23574
|
+
actions: 'setAmount',
|
|
23575
|
+
},
|
|
23576
|
+
],
|
|
23577
|
+
KEY_IN: {
|
|
23578
|
+
target: 'debouncing',
|
|
23579
|
+
actions: 'setAmount',
|
|
23580
|
+
},
|
|
23581
|
+
BACK: {
|
|
23582
|
+
target: 'loaded',
|
|
23583
|
+
},
|
|
23584
|
+
},
|
|
23585
|
+
after: {
|
|
23586
|
+
1000: {
|
|
23587
|
+
target: 'calculating',
|
|
23588
|
+
},
|
|
23589
|
+
},
|
|
23590
|
+
},
|
|
23591
|
+
calculable: {
|
|
23592
|
+
entry: 'clearCalculation',
|
|
23593
|
+
on: {
|
|
23594
|
+
SELECT_AMOUNT: [
|
|
23595
|
+
{
|
|
23596
|
+
target: 'debouncing',
|
|
23597
|
+
actions: 'addAmount',
|
|
23598
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
23599
|
+
},
|
|
23600
|
+
{
|
|
23601
|
+
target: 'debouncing',
|
|
23602
|
+
actions: 'setAmount',
|
|
23603
|
+
},
|
|
23604
|
+
],
|
|
23605
|
+
KEY_IN: {
|
|
23606
|
+
target: 'debouncing',
|
|
23607
|
+
actions: 'setAmount',
|
|
23608
|
+
},
|
|
23609
|
+
CALCULATE: {
|
|
23610
|
+
target: 'debouncing',
|
|
23611
|
+
},
|
|
23612
|
+
BACK: {
|
|
23613
|
+
target: 'loaded',
|
|
23614
|
+
},
|
|
23615
|
+
},
|
|
23616
|
+
},
|
|
23617
|
+
calculating: {
|
|
23618
|
+
invoke: {
|
|
23619
|
+
src: 'fetchCalculation',
|
|
23620
|
+
onDone: {
|
|
23621
|
+
target: 'submitting',
|
|
23622
|
+
actions: 'setCalculation',
|
|
23623
|
+
},
|
|
23624
|
+
onError: {
|
|
23625
|
+
target: 'calculable',
|
|
23626
|
+
},
|
|
23515
23627
|
},
|
|
23516
23628
|
},
|
|
23517
|
-
{
|
|
23518
|
-
|
|
23519
|
-
|
|
23520
|
-
|
|
23521
|
-
|
|
23522
|
-
|
|
23629
|
+
submitting: {
|
|
23630
|
+
invoke: {
|
|
23631
|
+
src: 'submitDeposit',
|
|
23632
|
+
onDone: {
|
|
23633
|
+
target: 'submitted',
|
|
23634
|
+
actions: 'setResult',
|
|
23635
|
+
},
|
|
23636
|
+
onError: {
|
|
23637
|
+
target: 'pending',
|
|
23638
|
+
},
|
|
23523
23639
|
},
|
|
23524
23640
|
},
|
|
23525
|
-
|
|
23526
|
-
|
|
23527
|
-
|
|
23528
|
-
|
|
23529
|
-
|
|
23530
|
-
|
|
23531
|
-
|
|
23532
|
-
target: 'loaded',
|
|
23533
|
-
actions: 'setBonusPreview',
|
|
23534
|
-
},
|
|
23535
|
-
onError: {
|
|
23536
|
-
target: 'loaded',
|
|
23641
|
+
submitted: {
|
|
23642
|
+
on: {
|
|
23643
|
+
SELECT_QRCODE: {
|
|
23644
|
+
target: 'loaded',
|
|
23645
|
+
actions: 'setQrcode',
|
|
23646
|
+
},
|
|
23647
|
+
},
|
|
23537
23648
|
},
|
|
23538
23649
|
},
|
|
23539
23650
|
},
|
|
23540
|
-
|
|
23541
|
-
loaded: {
|
|
23651
|
+
defaultMode: {
|
|
23542
23652
|
entry: 'reset',
|
|
23543
23653
|
on: {
|
|
23544
23654
|
SELECT_QRCODE: [
|
|
23545
|
-
{
|
|
23546
|
-
target: 'fetching',
|
|
23547
|
-
actions: 'setQrcode',
|
|
23548
|
-
cond: (context, event) => {
|
|
23549
|
-
const { siteConfig = {}, promotion = {} } = context;
|
|
23550
|
-
const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig;
|
|
23551
|
-
return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
|
|
23552
|
-
},
|
|
23553
|
-
},
|
|
23554
23655
|
{
|
|
23555
23656
|
target: 'debouncing',
|
|
23556
23657
|
actions: ['setQrcode', 'setPromotionDefaultAmount'],
|
|
23557
|
-
cond:
|
|
23658
|
+
cond: 'hasMinPromotionDeposit',
|
|
23558
23659
|
},
|
|
23559
23660
|
{
|
|
23560
23661
|
actions: 'setQrcode',
|
|
23561
23662
|
},
|
|
23562
23663
|
],
|
|
23563
23664
|
SELECT_AMOUNT: [
|
|
23564
|
-
{
|
|
23565
|
-
target: 'pending',
|
|
23566
|
-
actions: 'addAmount',
|
|
23567
|
-
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
23568
|
-
},
|
|
23569
|
-
{
|
|
23570
|
-
target: 'pending',
|
|
23571
|
-
actions: 'setAmount',
|
|
23572
|
-
cond: 'isFreeWalletMode',
|
|
23573
|
-
},
|
|
23574
23665
|
{
|
|
23575
23666
|
target: 'debouncing',
|
|
23576
23667
|
actions: 'addAmount',
|
|
23577
|
-
cond:
|
|
23668
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
23578
23669
|
},
|
|
23579
23670
|
{
|
|
23580
23671
|
target: 'debouncing',
|
|
23581
23672
|
actions: 'setAmount',
|
|
23582
23673
|
},
|
|
23583
23674
|
],
|
|
23584
|
-
KEY_IN: [
|
|
23585
|
-
{
|
|
23586
|
-
target: 'pending',
|
|
23587
|
-
actions: 'setAmount',
|
|
23588
|
-
cond: 'isFreeWalletMode',
|
|
23589
|
-
},
|
|
23590
|
-
{
|
|
23591
|
-
target: 'calculating',
|
|
23592
|
-
actions: 'setAmount',
|
|
23593
|
-
},
|
|
23594
|
-
],
|
|
23595
|
-
},
|
|
23596
|
-
},
|
|
23597
|
-
pending: {
|
|
23598
|
-
on: {
|
|
23599
|
-
SELECT_AMOUNT: [
|
|
23600
|
-
{
|
|
23601
|
-
actions: 'addAmount',
|
|
23602
|
-
cond: 'isGrandTotalEnable',
|
|
23603
|
-
},
|
|
23604
|
-
{
|
|
23605
|
-
actions: 'setAmount',
|
|
23606
|
-
},
|
|
23607
|
-
],
|
|
23608
23675
|
KEY_IN: {
|
|
23609
|
-
actions: 'setAmount',
|
|
23610
|
-
},
|
|
23611
|
-
CONFIRM: {
|
|
23612
23676
|
target: 'calculating',
|
|
23613
|
-
|
|
23614
|
-
BACK: {
|
|
23615
|
-
target: 'loaded',
|
|
23677
|
+
actions: 'setAmount',
|
|
23616
23678
|
},
|
|
23617
23679
|
},
|
|
23618
23680
|
},
|
|
@@ -23622,25 +23684,19 @@ function qrcode_v2 (request) {
|
|
|
23622
23684
|
{
|
|
23623
23685
|
target: 'debouncing',
|
|
23624
23686
|
actions: 'addAmount',
|
|
23625
|
-
cond: (context, event) => context.
|
|
23626
|
-
},
|
|
23627
|
-
{
|
|
23628
|
-
target: 'debouncing',
|
|
23629
|
-
actions: 'setAmount',
|
|
23630
|
-
cond: 'isFreeWalletMode',
|
|
23631
|
-
},
|
|
23632
|
-
{
|
|
23633
|
-
target: 'debouncing',
|
|
23634
|
-
actions: 'addAmount',
|
|
23635
|
-
cond: 'isGrandTotalEnable',
|
|
23687
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
23636
23688
|
},
|
|
23637
23689
|
{
|
|
23638
23690
|
target: 'debouncing',
|
|
23639
23691
|
actions: 'setAmount',
|
|
23640
23692
|
},
|
|
23641
23693
|
],
|
|
23694
|
+
KEY_IN: {
|
|
23695
|
+
target: 'debouncing',
|
|
23696
|
+
actions: 'setAmount',
|
|
23697
|
+
},
|
|
23642
23698
|
BACK: {
|
|
23643
|
-
target: '
|
|
23699
|
+
target: 'defaultMode',
|
|
23644
23700
|
},
|
|
23645
23701
|
},
|
|
23646
23702
|
after: {
|
|
@@ -23649,24 +23705,15 @@ function qrcode_v2 (request) {
|
|
|
23649
23705
|
},
|
|
23650
23706
|
},
|
|
23651
23707
|
},
|
|
23708
|
+
fail: {},
|
|
23652
23709
|
calculable: {
|
|
23653
23710
|
entry: 'clearCalculation',
|
|
23654
23711
|
on: {
|
|
23655
23712
|
SELECT_AMOUNT: [
|
|
23656
|
-
{
|
|
23657
|
-
target: 'pending',
|
|
23658
|
-
actions: 'addAmount',
|
|
23659
|
-
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
23660
|
-
},
|
|
23661
|
-
{
|
|
23662
|
-
target: 'pending',
|
|
23663
|
-
actions: 'setAmount',
|
|
23664
|
-
cond: 'isFreeWalletMode',
|
|
23665
|
-
},
|
|
23666
23713
|
{
|
|
23667
23714
|
target: 'debouncing',
|
|
23668
23715
|
actions: 'addAmount',
|
|
23669
|
-
cond:
|
|
23716
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
23670
23717
|
},
|
|
23671
23718
|
{
|
|
23672
23719
|
target: 'debouncing',
|
|
@@ -23674,28 +23721,24 @@ function qrcode_v2 (request) {
|
|
|
23674
23721
|
},
|
|
23675
23722
|
],
|
|
23676
23723
|
KEY_IN: {
|
|
23677
|
-
target: '
|
|
23724
|
+
target: 'debouncing',
|
|
23678
23725
|
actions: 'setAmount',
|
|
23679
23726
|
},
|
|
23727
|
+
CALCULATE: {
|
|
23728
|
+
target: 'debouncing',
|
|
23729
|
+
},
|
|
23680
23730
|
BACK: {
|
|
23681
|
-
target: '
|
|
23731
|
+
target: 'defaultMode',
|
|
23682
23732
|
},
|
|
23683
23733
|
},
|
|
23684
23734
|
},
|
|
23685
23735
|
calculating: {
|
|
23686
23736
|
invoke: {
|
|
23687
23737
|
src: 'fetchCalculation',
|
|
23688
|
-
onDone:
|
|
23689
|
-
|
|
23690
|
-
|
|
23691
|
-
|
|
23692
|
-
cond: 'isFreeWalletMode',
|
|
23693
|
-
},
|
|
23694
|
-
{
|
|
23695
|
-
target: 'calculated',
|
|
23696
|
-
actions: 'setCalculation',
|
|
23697
|
-
},
|
|
23698
|
-
],
|
|
23738
|
+
onDone: {
|
|
23739
|
+
target: 'calculated',
|
|
23740
|
+
actions: 'setCalculation',
|
|
23741
|
+
},
|
|
23699
23742
|
onError: {
|
|
23700
23743
|
target: 'calculable',
|
|
23701
23744
|
},
|
|
@@ -23704,20 +23747,10 @@ function qrcode_v2 (request) {
|
|
|
23704
23747
|
calculated: {
|
|
23705
23748
|
on: {
|
|
23706
23749
|
SELECT_AMOUNT: [
|
|
23707
|
-
{
|
|
23708
|
-
target: 'pending',
|
|
23709
|
-
actions: 'addAmount',
|
|
23710
|
-
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
23711
|
-
},
|
|
23712
|
-
{
|
|
23713
|
-
target: 'pending',
|
|
23714
|
-
actions: 'setAmount',
|
|
23715
|
-
cond: 'isFreeWalletMode',
|
|
23716
|
-
},
|
|
23717
23750
|
{
|
|
23718
23751
|
target: 'debouncing',
|
|
23719
23752
|
actions: 'addAmount',
|
|
23720
|
-
cond:
|
|
23753
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
23721
23754
|
},
|
|
23722
23755
|
{
|
|
23723
23756
|
target: 'debouncing',
|
|
@@ -23725,14 +23758,14 @@ function qrcode_v2 (request) {
|
|
|
23725
23758
|
},
|
|
23726
23759
|
],
|
|
23727
23760
|
KEY_IN: {
|
|
23728
|
-
target: '
|
|
23761
|
+
target: 'debouncing',
|
|
23729
23762
|
actions: 'setAmount',
|
|
23730
23763
|
},
|
|
23731
23764
|
CONFIRM: {
|
|
23732
23765
|
target: 'submitting',
|
|
23733
23766
|
},
|
|
23734
23767
|
BACK: {
|
|
23735
|
-
target: '
|
|
23768
|
+
target: 'defaultMode',
|
|
23736
23769
|
},
|
|
23737
23770
|
CLEAR_CALCULATION: {
|
|
23738
23771
|
target: 'debouncing',
|
|
@@ -23754,21 +23787,10 @@ function qrcode_v2 (request) {
|
|
|
23754
23787
|
},
|
|
23755
23788
|
submitted: {
|
|
23756
23789
|
on: {
|
|
23757
|
-
SELECT_QRCODE:
|
|
23758
|
-
|
|
23759
|
-
|
|
23760
|
-
|
|
23761
|
-
cond: (context, event) => {
|
|
23762
|
-
const { siteConfig = {}, promotion = {} } = context;
|
|
23763
|
-
const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig;
|
|
23764
|
-
return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
|
|
23765
|
-
},
|
|
23766
|
-
},
|
|
23767
|
-
{
|
|
23768
|
-
target: 'loaded',
|
|
23769
|
-
actions: 'setQrcode',
|
|
23770
|
-
},
|
|
23771
|
-
],
|
|
23790
|
+
SELECT_QRCODE: {
|
|
23791
|
+
target: 'defaultMode',
|
|
23792
|
+
actions: 'setQrcode',
|
|
23793
|
+
},
|
|
23772
23794
|
},
|
|
23773
23795
|
},
|
|
23774
23796
|
},
|
|
@@ -23787,11 +23809,10 @@ function qrcode_v2 (request) {
|
|
|
23787
23809
|
}
|
|
23788
23810
|
}),
|
|
23789
23811
|
setInitData: assign((context, event) => {
|
|
23790
|
-
const {
|
|
23812
|
+
const { paymentDetail } = event.data;
|
|
23791
23813
|
const qrcodes = paymentDetail.filter((element) => element.category === context.currentCategory);
|
|
23792
23814
|
|
|
23793
23815
|
return {
|
|
23794
|
-
siteConfig,
|
|
23795
23816
|
paymentDetail,
|
|
23796
23817
|
qrcodes,
|
|
23797
23818
|
selectedQrcode: qrcodes[0],
|
|
@@ -23800,9 +23821,10 @@ function qrcode_v2 (request) {
|
|
|
23800
23821
|
grandTotalEnable: qrcodes[0].grandTotalEnable,
|
|
23801
23822
|
}
|
|
23802
23823
|
}),
|
|
23803
|
-
|
|
23824
|
+
preset: assign((context, event) => {
|
|
23825
|
+
const { siteConfig } = event.data;
|
|
23804
23826
|
return {
|
|
23805
|
-
|
|
23827
|
+
siteConfig,
|
|
23806
23828
|
}
|
|
23807
23829
|
}),
|
|
23808
23830
|
setQrcode: assign((context, event) => {
|
|
@@ -23847,11 +23869,11 @@ function qrcode_v2 (request) {
|
|
|
23847
23869
|
}),
|
|
23848
23870
|
},
|
|
23849
23871
|
guards: {
|
|
23850
|
-
|
|
23872
|
+
isNewWalletMode: (context, event) => {
|
|
23851
23873
|
return context.siteConfig?.walletMode === '2'
|
|
23852
23874
|
},
|
|
23853
|
-
|
|
23854
|
-
return context.
|
|
23875
|
+
hasMinPromotionDeposit: (context, event) => {
|
|
23876
|
+
return context.promotion?.minimumAmount
|
|
23855
23877
|
},
|
|
23856
23878
|
},
|
|
23857
23879
|
services: {
|
|
@@ -23863,13 +23885,6 @@ function qrcode_v2 (request) {
|
|
|
23863
23885
|
const siteConfig = JSON.parse(window.atob(config));
|
|
23864
23886
|
return { siteConfig, paymentDetail }
|
|
23865
23887
|
},
|
|
23866
|
-
fetchBonusPreview: async (context, event) => {
|
|
23867
|
-
const { currentMethod, promotion } = context;
|
|
23868
|
-
return await request.send({
|
|
23869
|
-
paymentMethod: currentMethod,
|
|
23870
|
-
promotionsNo: promotion?.activityNo,
|
|
23871
|
-
})
|
|
23872
|
-
},
|
|
23873
23888
|
fetchCalculation: async (context, event) => {
|
|
23874
23889
|
const { currentMethod, selectedAmount, promotion } = context;
|
|
23875
23890
|
return await request.send(
|
|
@@ -24499,14 +24514,14 @@ function padStart(string, length, chars) {
|
|
|
24499
24514
|
|
|
24500
24515
|
var padStart_1 = padStart;
|
|
24501
24516
|
|
|
24517
|
+
// const padStart = require('lodash/padStart')
|
|
24518
|
+
|
|
24502
24519
|
function crypto (request) {
|
|
24503
|
-
const { appSecret } = request.config;
|
|
24504
24520
|
return createMachine(
|
|
24505
24521
|
{
|
|
24506
24522
|
id: 'crypto',
|
|
24507
24523
|
initial: 'loading',
|
|
24508
24524
|
context: {
|
|
24509
|
-
siteConfig: null,
|
|
24510
24525
|
paymentDetails: [],
|
|
24511
24526
|
|
|
24512
24527
|
channels: [],
|
|
@@ -24523,17 +24538,14 @@ function crypto (request) {
|
|
|
24523
24538
|
|
|
24524
24539
|
calculation: null,
|
|
24525
24540
|
result: null,
|
|
24526
|
-
|
|
24527
|
-
// use for wallet mode 4
|
|
24528
|
-
promotion: null,
|
|
24529
24541
|
},
|
|
24530
24542
|
states: {
|
|
24531
24543
|
loading: {
|
|
24532
24544
|
invoke: {
|
|
24533
|
-
src: '
|
|
24545
|
+
src: 'fetchPayments',
|
|
24534
24546
|
onDone: {
|
|
24535
24547
|
target: 'idle',
|
|
24536
|
-
actions: '
|
|
24548
|
+
actions: 'setCryptos',
|
|
24537
24549
|
},
|
|
24538
24550
|
onError: {
|
|
24539
24551
|
target: '#crypto.fail',
|
|
@@ -24550,6 +24562,13 @@ function crypto (request) {
|
|
|
24550
24562
|
},
|
|
24551
24563
|
},
|
|
24552
24564
|
},
|
|
24565
|
+
// calculable: {
|
|
24566
|
+
// on: {
|
|
24567
|
+
// CALCULATE: {
|
|
24568
|
+
// target: 'calculating',
|
|
24569
|
+
// },
|
|
24570
|
+
// },
|
|
24571
|
+
// },
|
|
24553
24572
|
calculating: {
|
|
24554
24573
|
invoke: {
|
|
24555
24574
|
src: 'fetchCalculation',
|
|
@@ -24563,20 +24582,6 @@ function crypto (request) {
|
|
|
24563
24582
|
},
|
|
24564
24583
|
},
|
|
24565
24584
|
calculated: {
|
|
24566
|
-
on: {
|
|
24567
|
-
SUBMIT: [
|
|
24568
|
-
{
|
|
24569
|
-
target: 'pending',
|
|
24570
|
-
cond: 'isDoubleWalletMode',
|
|
24571
|
-
},
|
|
24572
|
-
{
|
|
24573
|
-
target: 'submitting',
|
|
24574
|
-
cond: 'isSubmittable',
|
|
24575
|
-
},
|
|
24576
|
-
],
|
|
24577
|
-
},
|
|
24578
|
-
},
|
|
24579
|
-
pending: {
|
|
24580
24585
|
on: {
|
|
24581
24586
|
SUBMIT: {
|
|
24582
24587
|
target: 'submitting',
|
|
@@ -24619,6 +24624,10 @@ function crypto (request) {
|
|
|
24619
24624
|
target: '.idle',
|
|
24620
24625
|
actions: ['setAmount', 'clearCalculation'],
|
|
24621
24626
|
},
|
|
24627
|
+
// CLEAR_CALCULATION: {
|
|
24628
|
+
// target: '.idle',
|
|
24629
|
+
// actions: 'clearCalculation',
|
|
24630
|
+
// },
|
|
24622
24631
|
CALCULATE: {
|
|
24623
24632
|
target: '.debouncing',
|
|
24624
24633
|
actions: 'clearCalculation',
|
|
@@ -24627,9 +24636,8 @@ function crypto (request) {
|
|
|
24627
24636
|
},
|
|
24628
24637
|
{
|
|
24629
24638
|
actions: {
|
|
24630
|
-
|
|
24631
|
-
const {
|
|
24632
|
-
const cryptos = paymentDetail.map?.((crypto) => ({ ...crypto, label: crypto.channel, value: crypto.method, icon: crypto.channel })) || [];
|
|
24639
|
+
setCryptos: assign((context, event) => {
|
|
24640
|
+
const cryptos = event.data?.map?.((crypto) => ({ ...crypto, label: crypto.channel, value: crypto.method, icon: crypto.channel })) || [];
|
|
24633
24641
|
const currentPayment = cryptos.find((element) => element.category === context.currentCategory);
|
|
24634
24642
|
const channels = cryptos.map((item, i) => ({ ...item, label: `Channel ${padStart_1(String(i + 1), 2, '0')}`, icon: 'channel' }));
|
|
24635
24643
|
const defaultNetworks =
|
|
@@ -24641,7 +24649,6 @@ function crypto (request) {
|
|
|
24641
24649
|
}
|
|
24642
24650
|
}) || [];
|
|
24643
24651
|
return {
|
|
24644
|
-
siteConfig,
|
|
24645
24652
|
channels,
|
|
24646
24653
|
cryptos,
|
|
24647
24654
|
networks: defaultNetworks,
|
|
@@ -24726,9 +24733,6 @@ function crypto (request) {
|
|
|
24726
24733
|
}),
|
|
24727
24734
|
},
|
|
24728
24735
|
guards: {
|
|
24729
|
-
isDoubleWalletMode: (context, event) => {
|
|
24730
|
-
return context.siteConfig?.walletMode === '4'
|
|
24731
|
-
},
|
|
24732
24736
|
isCalculable: (context, event) => {
|
|
24733
24737
|
const {
|
|
24734
24738
|
selectedCrypto,
|
|
@@ -24744,13 +24748,8 @@ function crypto (request) {
|
|
|
24744
24748
|
},
|
|
24745
24749
|
},
|
|
24746
24750
|
services: {
|
|
24747
|
-
|
|
24748
|
-
|
|
24749
|
-
request.send(common$1.getConfig({ appSecret })),
|
|
24750
|
-
request.send(payment$1.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
24751
|
-
]);
|
|
24752
|
-
const siteConfig = JSON.parse(window.atob(config));
|
|
24753
|
-
return { siteConfig, paymentDetail }
|
|
24751
|
+
fetchPayments: async (context, event) => {
|
|
24752
|
+
return await request.send(payment$1.getPaymentDetail({ transferType: 'DEPOSIT' }))
|
|
24754
24753
|
},
|
|
24755
24754
|
fetchCalculation: async (context, event) => {
|
|
24756
24755
|
const { selectedCrypto, amount } = context;
|
|
@@ -24806,18 +24805,14 @@ function crypto_button (request) {
|
|
|
24806
24805
|
result: null,
|
|
24807
24806
|
|
|
24808
24807
|
grandTotalEnable: 1,
|
|
24809
|
-
|
|
24810
|
-
// use for wallet mode 4
|
|
24811
|
-
promotion: null,
|
|
24812
|
-
bonusPreviewData: [],
|
|
24813
24808
|
},
|
|
24814
24809
|
states: {
|
|
24815
24810
|
loading: {
|
|
24816
24811
|
invoke: {
|
|
24817
24812
|
src: 'fetchInitData',
|
|
24818
24813
|
onDone: {
|
|
24819
|
-
target: '
|
|
24820
|
-
actions: 'setInitData',
|
|
24814
|
+
target: 'checking',
|
|
24815
|
+
actions: ['setInitData', 'preset'],
|
|
24821
24816
|
},
|
|
24822
24817
|
onError: {
|
|
24823
24818
|
target: 'fail',
|
|
@@ -24825,31 +24820,116 @@ function crypto_button (request) {
|
|
|
24825
24820
|
},
|
|
24826
24821
|
},
|
|
24827
24822
|
checking: {
|
|
24828
|
-
always: [
|
|
24829
|
-
|
|
24830
|
-
|
|
24831
|
-
|
|
24832
|
-
|
|
24833
|
-
|
|
24834
|
-
|
|
24823
|
+
always: [{ target: 'newWalletMode', cond: 'isNewWalletMode' }, { target: 'defaultMode' }],
|
|
24824
|
+
},
|
|
24825
|
+
newWalletMode: {
|
|
24826
|
+
initial: 'loaded',
|
|
24827
|
+
states: {
|
|
24828
|
+
loaded: {
|
|
24829
|
+
entry: 'reset',
|
|
24830
|
+
on: {
|
|
24831
|
+
SET_CHANNEL: {
|
|
24832
|
+
actions: 'setChannel',
|
|
24833
|
+
},
|
|
24834
|
+
SET_CRYPTO: {
|
|
24835
|
+
actions: 'setCrypto',
|
|
24836
|
+
},
|
|
24837
|
+
SET_NETWORK: {
|
|
24838
|
+
actions: 'setNetwork',
|
|
24839
|
+
},
|
|
24840
|
+
SET_ADDRESS: {
|
|
24841
|
+
actions: 'setAddress',
|
|
24842
|
+
},
|
|
24843
|
+
CONFIRM: {
|
|
24844
|
+
target: 'selecting',
|
|
24845
|
+
cond: 'isConfirmable',
|
|
24846
|
+
},
|
|
24835
24847
|
},
|
|
24836
24848
|
},
|
|
24837
|
-
|
|
24838
|
-
|
|
24839
|
-
|
|
24840
|
-
|
|
24841
|
-
|
|
24842
|
-
|
|
24843
|
-
|
|
24844
|
-
|
|
24845
|
-
|
|
24849
|
+
selecting: {
|
|
24850
|
+
entry: 'reset',
|
|
24851
|
+
on: {
|
|
24852
|
+
SELECT_AMOUNT: [
|
|
24853
|
+
{
|
|
24854
|
+
actions: 'addAmount',
|
|
24855
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
24856
|
+
},
|
|
24857
|
+
{
|
|
24858
|
+
actions: 'setAmount',
|
|
24859
|
+
},
|
|
24860
|
+
],
|
|
24861
|
+
KEY_IN: {
|
|
24862
|
+
actions: 'setAmount',
|
|
24863
|
+
},
|
|
24864
|
+
SUBMIT: {
|
|
24865
|
+
target: 'debouncing',
|
|
24866
|
+
},
|
|
24867
|
+
BACK: {
|
|
24868
|
+
target: 'loaded',
|
|
24869
|
+
},
|
|
24870
|
+
CLEAR_ALL: {
|
|
24871
|
+
actions: 'reset',
|
|
24872
|
+
},
|
|
24873
|
+
},
|
|
24846
24874
|
},
|
|
24847
|
-
|
|
24848
|
-
|
|
24875
|
+
debouncing: {
|
|
24876
|
+
on: {
|
|
24877
|
+
SELECT_AMOUNT: [
|
|
24878
|
+
{
|
|
24879
|
+
target: 'debouncing',
|
|
24880
|
+
actions: 'addAmount',
|
|
24881
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
24882
|
+
},
|
|
24883
|
+
{
|
|
24884
|
+
target: 'debouncing',
|
|
24885
|
+
actions: 'setAmount',
|
|
24886
|
+
},
|
|
24887
|
+
],
|
|
24888
|
+
KEY_IN: {
|
|
24889
|
+
target: 'debouncing',
|
|
24890
|
+
actions: 'setAmount',
|
|
24891
|
+
},
|
|
24892
|
+
BACK: {
|
|
24893
|
+
target: 'loaded',
|
|
24894
|
+
},
|
|
24895
|
+
CLEAR_ALL: {
|
|
24896
|
+
actions: 'reset',
|
|
24897
|
+
},
|
|
24898
|
+
},
|
|
24899
|
+
after: {
|
|
24900
|
+
1000: {
|
|
24901
|
+
target: 'calculating',
|
|
24902
|
+
},
|
|
24903
|
+
},
|
|
24904
|
+
},
|
|
24905
|
+
calculating: {
|
|
24906
|
+
invoke: {
|
|
24907
|
+
src: 'fetchCalculation',
|
|
24908
|
+
onDone: {
|
|
24909
|
+
target: 'submitting',
|
|
24910
|
+
actions: 'setCalculation',
|
|
24911
|
+
},
|
|
24912
|
+
onError: {
|
|
24913
|
+
target: 'selecting',
|
|
24914
|
+
actions: 'reset',
|
|
24915
|
+
},
|
|
24916
|
+
},
|
|
24917
|
+
},
|
|
24918
|
+
submitting: {
|
|
24919
|
+
invoke: {
|
|
24920
|
+
src: 'submitDeposit',
|
|
24921
|
+
onDone: {
|
|
24922
|
+
target: '#crypro_button.submitted',
|
|
24923
|
+
actions: 'setResult',
|
|
24924
|
+
},
|
|
24925
|
+
onError: {
|
|
24926
|
+
target: 'selecting',
|
|
24927
|
+
},
|
|
24928
|
+
},
|
|
24849
24929
|
},
|
|
24850
24930
|
},
|
|
24851
24931
|
},
|
|
24852
|
-
|
|
24932
|
+
defaultMode: {
|
|
24853
24933
|
on: {
|
|
24854
24934
|
SET_CHANNEL: {
|
|
24855
24935
|
actions: 'setChannel',
|
|
@@ -24876,45 +24956,20 @@ function crypto_button (request) {
|
|
|
24876
24956
|
SELECT_AMOUNT: [
|
|
24877
24957
|
{
|
|
24878
24958
|
target: 'debouncing',
|
|
24879
|
-
actions: '
|
|
24880
|
-
cond:
|
|
24881
|
-
},
|
|
24882
|
-
{
|
|
24883
|
-
actions: 'addAmount',
|
|
24884
|
-
cond: (context, event) => context.siteConfig?.walletMode === '2' && context.grandTotalEnable === 1,
|
|
24885
|
-
},
|
|
24886
|
-
{
|
|
24887
|
-
actions: 'setAmount',
|
|
24888
|
-
cond: (context, event) => context.siteConfig?.walletMode === '2',
|
|
24889
|
-
},
|
|
24890
|
-
{
|
|
24891
|
-
target: 'debouncing',
|
|
24892
|
-
actions: 'addAmount',
|
|
24893
|
-
cond: 'isGrandTotalEnable',
|
|
24894
|
-
},
|
|
24895
|
-
{
|
|
24896
|
-
target: 'debouncing',
|
|
24897
|
-
actions: 'setAmount',
|
|
24898
|
-
},
|
|
24899
|
-
],
|
|
24900
|
-
KEY_IN: [
|
|
24901
|
-
{
|
|
24902
|
-
actions: 'setAmount',
|
|
24903
|
-
cond: 'isFreeWalletMode',
|
|
24959
|
+
actions: 'addAmount',
|
|
24960
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
24904
24961
|
},
|
|
24905
24962
|
{
|
|
24906
24963
|
target: 'debouncing',
|
|
24907
24964
|
actions: 'setAmount',
|
|
24908
24965
|
},
|
|
24909
24966
|
],
|
|
24910
|
-
|
|
24967
|
+
KEY_IN: {
|
|
24911
24968
|
target: 'debouncing',
|
|
24969
|
+
actions: 'setAmount',
|
|
24912
24970
|
},
|
|
24913
24971
|
BACK: {
|
|
24914
|
-
target: '
|
|
24915
|
-
},
|
|
24916
|
-
CLEAR_ALL: {
|
|
24917
|
-
actions: 'reset',
|
|
24972
|
+
target: 'defaultMode',
|
|
24918
24973
|
},
|
|
24919
24974
|
},
|
|
24920
24975
|
},
|
|
@@ -24924,7 +24979,7 @@ function crypto_button (request) {
|
|
|
24924
24979
|
{
|
|
24925
24980
|
target: 'debouncing',
|
|
24926
24981
|
actions: 'addAmount',
|
|
24927
|
-
cond:
|
|
24982
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
24928
24983
|
},
|
|
24929
24984
|
{
|
|
24930
24985
|
target: 'debouncing',
|
|
@@ -24945,17 +25000,10 @@ function crypto_button (request) {
|
|
|
24945
25000
|
calculating: {
|
|
24946
25001
|
invoke: {
|
|
24947
25002
|
src: 'fetchCalculation',
|
|
24948
|
-
onDone:
|
|
24949
|
-
|
|
24950
|
-
|
|
24951
|
-
|
|
24952
|
-
cond: 'isFreeWalletMode',
|
|
24953
|
-
},
|
|
24954
|
-
{
|
|
24955
|
-
target: 'calculated',
|
|
24956
|
-
actions: 'setCalculation',
|
|
24957
|
-
},
|
|
24958
|
-
],
|
|
25003
|
+
onDone: {
|
|
25004
|
+
target: 'calculated',
|
|
25005
|
+
actions: 'setCalculation',
|
|
25006
|
+
},
|
|
24959
25007
|
onError: {
|
|
24960
25008
|
target: 'selecting',
|
|
24961
25009
|
actions: 'reset',
|
|
@@ -24968,7 +25016,7 @@ function crypto_button (request) {
|
|
|
24968
25016
|
{
|
|
24969
25017
|
target: 'debouncing',
|
|
24970
25018
|
actions: 'addAmount',
|
|
24971
|
-
cond:
|
|
25019
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
24972
25020
|
},
|
|
24973
25021
|
{
|
|
24974
25022
|
target: 'debouncing',
|
|
@@ -25007,11 +25055,6 @@ function crypto_button (request) {
|
|
|
25007
25055
|
},
|
|
25008
25056
|
submitted: {},
|
|
25009
25057
|
},
|
|
25010
|
-
on: {
|
|
25011
|
-
SET_PROMOTION: {
|
|
25012
|
-
actions: 'setPromotion',
|
|
25013
|
-
},
|
|
25014
|
-
},
|
|
25015
25058
|
},
|
|
25016
25059
|
{
|
|
25017
25060
|
actions: {
|
|
@@ -25022,7 +25065,7 @@ function crypto_button (request) {
|
|
|
25022
25065
|
}
|
|
25023
25066
|
}),
|
|
25024
25067
|
setInitData: assign((context, event) => {
|
|
25025
|
-
const {
|
|
25068
|
+
const { paymentDetail } = event.data;
|
|
25026
25069
|
const cryptos = paymentDetail?.map?.((crypto) => ({ ...crypto, label: crypto.channel, value: crypto.method, icon: crypto.channel })) || [];
|
|
25027
25070
|
const currentPayment = cryptos.find((element) => element.category === context.currentCategory);
|
|
25028
25071
|
const channels = cryptos.map((item, i) => ({ ...item, label: `Channel ${padStart_1(String(i + 1), 2, '0')}`, icon: 'channel' }));
|
|
@@ -25036,7 +25079,6 @@ function crypto_button (request) {
|
|
|
25036
25079
|
}) || [];
|
|
25037
25080
|
const options = cryptos[0].optional;
|
|
25038
25081
|
return {
|
|
25039
|
-
siteConfig,
|
|
25040
25082
|
channels,
|
|
25041
25083
|
cryptos,
|
|
25042
25084
|
networks: defaultNetworks,
|
|
@@ -25048,6 +25090,12 @@ function crypto_button (request) {
|
|
|
25048
25090
|
options,
|
|
25049
25091
|
}
|
|
25050
25092
|
}),
|
|
25093
|
+
preset: assign((context, event) => {
|
|
25094
|
+
const { siteConfig } = event.data;
|
|
25095
|
+
return {
|
|
25096
|
+
siteConfig,
|
|
25097
|
+
}
|
|
25098
|
+
}),
|
|
25051
25099
|
setChannel: assign((context, event) => {
|
|
25052
25100
|
const { cryptos } = context;
|
|
25053
25101
|
const selectedCrypto = cryptos.find((crypto) => crypto.method === event.data.value);
|
|
@@ -25099,11 +25147,6 @@ function crypto_button (request) {
|
|
|
25099
25147
|
setNetwork: assign((context, event) => {
|
|
25100
25148
|
return { selectedNetwork: event.data }
|
|
25101
25149
|
}),
|
|
25102
|
-
setBonusPreview: assign((context, event) => {
|
|
25103
|
-
return {
|
|
25104
|
-
bonusPreviewData: event.data.bonus,
|
|
25105
|
-
}
|
|
25106
|
-
}),
|
|
25107
25150
|
addAmount: assign((context, event) => {
|
|
25108
25151
|
return { selectedAmount: (context.selectedAmount || 0) + event.data }
|
|
25109
25152
|
}),
|
|
@@ -25130,23 +25173,11 @@ function crypto_button (request) {
|
|
|
25130
25173
|
result: event.data,
|
|
25131
25174
|
}
|
|
25132
25175
|
}),
|
|
25133
|
-
setPromotion: assign((context, event) => {
|
|
25134
|
-
const promotion = event.data;
|
|
25135
|
-
return {
|
|
25136
|
-
promotion,
|
|
25137
|
-
}
|
|
25138
|
-
}),
|
|
25139
25176
|
},
|
|
25140
25177
|
guards: {
|
|
25141
|
-
|
|
25178
|
+
isNewWalletMode: (context, event) => {
|
|
25142
25179
|
return context.siteConfig?.walletMode === '2'
|
|
25143
25180
|
},
|
|
25144
|
-
isDoubleWalletMode: (context, event) => {
|
|
25145
|
-
return context.siteConfig?.walletMode === '4'
|
|
25146
|
-
},
|
|
25147
|
-
isGrandTotalEnable: (context, event) => {
|
|
25148
|
-
return context.grandTotalEnable === 1
|
|
25149
|
-
},
|
|
25150
25181
|
isConfirmable: (context, event) => {
|
|
25151
25182
|
const { selectedCrypto, selectedNetwork } = context;
|
|
25152
25183
|
return selectedCrypto && selectedNetwork
|
|
@@ -25165,26 +25196,18 @@ function crypto_button (request) {
|
|
|
25165
25196
|
const siteConfig = JSON.parse(window.atob(config));
|
|
25166
25197
|
return { siteConfig, paymentDetail }
|
|
25167
25198
|
},
|
|
25168
|
-
fetchBonusPreview: async (context, event) => {
|
|
25169
|
-
const { selectedCrypto, promotion } = context;
|
|
25170
|
-
return await request.send({
|
|
25171
|
-
paymentMethod: selectedCrypto.method,
|
|
25172
|
-
promotionsNo: promotion?.activityNo,
|
|
25173
|
-
})
|
|
25174
|
-
},
|
|
25175
25199
|
fetchCalculation: async (context, event) => {
|
|
25176
|
-
const { selectedCrypto, selectedAmount
|
|
25200
|
+
const { selectedCrypto, selectedAmount } = context;
|
|
25177
25201
|
return await request.send(
|
|
25178
25202
|
payment.getDepositExpectedResult({
|
|
25179
25203
|
method: selectedCrypto.method,
|
|
25180
25204
|
amount: selectedAmount,
|
|
25181
25205
|
cryptoCurrency: selectedCrypto.channel,
|
|
25182
|
-
promotionsNo: promotion?.activityNo,
|
|
25183
25206
|
})
|
|
25184
25207
|
)
|
|
25185
25208
|
},
|
|
25186
25209
|
submitDeposit: async (context, event) => {
|
|
25187
|
-
const { selectedCrypto, selectedNetwork, calculation, sourceAddress
|
|
25210
|
+
const { selectedCrypto, selectedNetwork, calculation, sourceAddress } = context;
|
|
25188
25211
|
return await request.send(
|
|
25189
25212
|
payment.submitDepositTransactionCrypto({
|
|
25190
25213
|
method: selectedCrypto.method,
|
|
@@ -25192,7 +25215,6 @@ function crypto_button (request) {
|
|
|
25192
25215
|
cryptoCurrency: selectedCrypto.channel,
|
|
25193
25216
|
cryptoNetwork: selectedNetwork.value,
|
|
25194
25217
|
sourceAddress: sourceAddress,
|
|
25195
|
-
promotionsNo: promotion?.activityNo,
|
|
25196
25218
|
})
|
|
25197
25219
|
)
|
|
25198
25220
|
},
|
|
@@ -25202,14 +25224,12 @@ function crypto_button (request) {
|
|
|
25202
25224
|
}
|
|
25203
25225
|
|
|
25204
25226
|
function direct (request) {
|
|
25205
|
-
const { appSecret } = request.config;
|
|
25206
25227
|
return createMachine(
|
|
25207
25228
|
{
|
|
25208
25229
|
id: 'direct',
|
|
25209
25230
|
initial: 'loading',
|
|
25210
25231
|
context: {
|
|
25211
|
-
|
|
25212
|
-
paymentDetail: [],
|
|
25232
|
+
paymentDetails: [],
|
|
25213
25233
|
directs: [],
|
|
25214
25234
|
currentDirect: null,
|
|
25215
25235
|
banks: [],
|
|
@@ -25255,10 +25275,6 @@ function direct (request) {
|
|
|
25255
25275
|
},
|
|
25256
25276
|
promotion: {
|
|
25257
25277
|
always: [
|
|
25258
|
-
{
|
|
25259
|
-
target: 'loaded',
|
|
25260
|
-
cond: 'isDoubleWalletMode',
|
|
25261
|
-
},
|
|
25262
25278
|
{
|
|
25263
25279
|
target: 'calculating',
|
|
25264
25280
|
actions: 'setPromotionDefaultAmount',
|
|
@@ -25285,61 +25301,15 @@ function direct (request) {
|
|
|
25285
25301
|
actions: 'clearCalculation',
|
|
25286
25302
|
},
|
|
25287
25303
|
CALCULATE: {
|
|
25288
|
-
target: '
|
|
25304
|
+
target: 'calculating',
|
|
25305
|
+
cond: 'isCalculable',
|
|
25289
25306
|
},
|
|
25290
|
-
SUBMIT: [
|
|
25291
|
-
{
|
|
25292
|
-
target: 'pending',
|
|
25293
|
-
cond: (context, event) => context.siteConfig?.walletMode === '4' && !!context.calculation,
|
|
25294
|
-
},
|
|
25295
|
-
{
|
|
25296
|
-
target: 'submitting',
|
|
25297
|
-
cond: 'isSubmittable',
|
|
25298
|
-
},
|
|
25299
|
-
],
|
|
25300
|
-
},
|
|
25301
|
-
},
|
|
25302
|
-
pending: {
|
|
25303
|
-
on: {
|
|
25304
25307
|
SUBMIT: {
|
|
25305
25308
|
target: 'submitting',
|
|
25306
25309
|
cond: 'isSubmittable',
|
|
25307
25310
|
},
|
|
25308
25311
|
},
|
|
25309
25312
|
},
|
|
25310
|
-
debouncing: {
|
|
25311
|
-
on: {
|
|
25312
|
-
SELECT_DIRECT: {
|
|
25313
|
-
actions: ['setDirect', 'reset'],
|
|
25314
|
-
target: 'loading.fetching',
|
|
25315
|
-
},
|
|
25316
|
-
SELECT_BANK: {
|
|
25317
|
-
actions: 'setSelectedBank',
|
|
25318
|
-
},
|
|
25319
|
-
SET_AMOUNT: {
|
|
25320
|
-
actions: ['setAmount', 'clearCalculation'],
|
|
25321
|
-
},
|
|
25322
|
-
CLEAR_CALCULATION: {
|
|
25323
|
-
actions: 'clearCalculation',
|
|
25324
|
-
},
|
|
25325
|
-
CALCULATE: {
|
|
25326
|
-
target: 'debouncing',
|
|
25327
|
-
},
|
|
25328
|
-
SUBMIT: [
|
|
25329
|
-
{
|
|
25330
|
-
target: 'pending',
|
|
25331
|
-
cond: (context, event) => context.siteConfig?.walletMode === '4' && !!context.calculation,
|
|
25332
|
-
},
|
|
25333
|
-
{
|
|
25334
|
-
target: 'submitting',
|
|
25335
|
-
cond: 'isSubmittable',
|
|
25336
|
-
},
|
|
25337
|
-
],
|
|
25338
|
-
},
|
|
25339
|
-
after: {
|
|
25340
|
-
1000: [{ target: 'calculating', cond: 'isCalculable' }, { target: 'loaded' }],
|
|
25341
|
-
},
|
|
25342
|
-
},
|
|
25343
25313
|
calculating: {
|
|
25344
25314
|
invoke: {
|
|
25345
25315
|
src: 'fetchCalculation',
|
|
@@ -25384,12 +25354,11 @@ function direct (request) {
|
|
|
25384
25354
|
}
|
|
25385
25355
|
}),
|
|
25386
25356
|
setInitData: assign((context, event) => {
|
|
25387
|
-
const
|
|
25388
|
-
const directs =
|
|
25357
|
+
const paymentDetails = event.data;
|
|
25358
|
+
const directs = paymentDetails.filter((element) => element.category === context.currentCategory);
|
|
25389
25359
|
|
|
25390
25360
|
return {
|
|
25391
|
-
|
|
25392
|
-
paymentDetail,
|
|
25361
|
+
paymentDetails,
|
|
25393
25362
|
directs,
|
|
25394
25363
|
currentDirect: directs[0],
|
|
25395
25364
|
currentMethod: directs[0]?.method,
|
|
@@ -25446,9 +25415,6 @@ function direct (request) {
|
|
|
25446
25415
|
}),
|
|
25447
25416
|
},
|
|
25448
25417
|
guards: {
|
|
25449
|
-
isDoubleWalletMode: (context, event) => {
|
|
25450
|
-
return context.siteConfig?.walletMode === '4'
|
|
25451
|
-
},
|
|
25452
25418
|
isCalculable: (context, event) => {
|
|
25453
25419
|
const {
|
|
25454
25420
|
amount,
|
|
@@ -25467,12 +25433,7 @@ function direct (request) {
|
|
|
25467
25433
|
},
|
|
25468
25434
|
services: {
|
|
25469
25435
|
fetchInitData: async (context, event) => {
|
|
25470
|
-
|
|
25471
|
-
request.send(common$1.getConfig({ appSecret })),
|
|
25472
|
-
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
25473
|
-
]);
|
|
25474
|
-
const siteConfig = JSON.parse(window.atob(config));
|
|
25475
|
-
return { siteConfig, paymentDetail }
|
|
25436
|
+
return await request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' }))
|
|
25476
25437
|
},
|
|
25477
25438
|
fetchBanksList: async (context, event) => {
|
|
25478
25439
|
const { currentDirect } = context;
|
|
@@ -25595,7 +25556,6 @@ function amb (request) {
|
|
|
25595
25556
|
}
|
|
25596
25557
|
|
|
25597
25558
|
function float (request) {
|
|
25598
|
-
const { appSecret } = request.config;
|
|
25599
25559
|
return createMachine(
|
|
25600
25560
|
{
|
|
25601
25561
|
id: 'float',
|
|
@@ -25603,7 +25563,6 @@ function float (request) {
|
|
|
25603
25563
|
context: {
|
|
25604
25564
|
method: 'amb_float',
|
|
25605
25565
|
userAccount: {},
|
|
25606
|
-
siteConfig: null,
|
|
25607
25566
|
amount: 0,
|
|
25608
25567
|
|
|
25609
25568
|
bankList: [],
|
|
@@ -25620,9 +25579,6 @@ function float (request) {
|
|
|
25620
25579
|
|
|
25621
25580
|
grandTotalEnable: 1,
|
|
25622
25581
|
ttl: 120,
|
|
25623
|
-
|
|
25624
|
-
promotion: null,
|
|
25625
|
-
bonusPreviewData: [],
|
|
25626
25582
|
},
|
|
25627
25583
|
states: {
|
|
25628
25584
|
loading: {
|
|
@@ -25647,10 +25603,7 @@ function float (request) {
|
|
|
25647
25603
|
initializing: {
|
|
25648
25604
|
invoke: {
|
|
25649
25605
|
src: 'initialize',
|
|
25650
|
-
onDone: {
|
|
25651
|
-
target: '#float.loaded',
|
|
25652
|
-
actions: 'setInitialization',
|
|
25653
|
-
},
|
|
25606
|
+
onDone: { target: '#float.loaded', actions: 'setInitialization' },
|
|
25654
25607
|
onError: {
|
|
25655
25608
|
target: '#float.unavailable',
|
|
25656
25609
|
},
|
|
@@ -25658,38 +25611,14 @@ function float (request) {
|
|
|
25658
25611
|
},
|
|
25659
25612
|
},
|
|
25660
25613
|
},
|
|
25661
|
-
checking: {
|
|
25662
|
-
always: [
|
|
25663
|
-
{
|
|
25664
|
-
target: 'fetching',
|
|
25665
|
-
cond: (context, event) => {
|
|
25666
|
-
const { siteConfig = {}, promotion = {} } = context;
|
|
25667
|
-
const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig;
|
|
25668
|
-
return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
|
|
25669
|
-
},
|
|
25670
|
-
},
|
|
25671
|
-
{ target: 'loaded' },
|
|
25672
|
-
],
|
|
25673
|
-
},
|
|
25674
|
-
fetching: {
|
|
25675
|
-
invoke: {
|
|
25676
|
-
src: 'fetchBonusPreview',
|
|
25677
|
-
onDone: {
|
|
25678
|
-
target: 'loaded',
|
|
25679
|
-
actions: 'setBonusPreview',
|
|
25680
|
-
},
|
|
25681
|
-
onError: {
|
|
25682
|
-
target: 'loaded',
|
|
25683
|
-
},
|
|
25684
|
-
},
|
|
25685
|
-
},
|
|
25686
25614
|
loaded: {
|
|
25615
|
+
entry: 'reset',
|
|
25687
25616
|
on: {
|
|
25688
25617
|
SELECT_AMOUNT: [
|
|
25689
25618
|
{
|
|
25690
25619
|
target: 'debouncing',
|
|
25691
25620
|
actions: 'addAmount',
|
|
25692
|
-
cond:
|
|
25621
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
25693
25622
|
},
|
|
25694
25623
|
{
|
|
25695
25624
|
target: 'debouncing',
|
|
@@ -25700,10 +25629,6 @@ function float (request) {
|
|
|
25700
25629
|
target: 'calculating',
|
|
25701
25630
|
actions: 'setAmount',
|
|
25702
25631
|
},
|
|
25703
|
-
CLEAR_CALCULATION: {
|
|
25704
|
-
target: 'debouncing',
|
|
25705
|
-
actions: 'clearCalculation',
|
|
25706
|
-
},
|
|
25707
25632
|
},
|
|
25708
25633
|
},
|
|
25709
25634
|
debouncing: {
|
|
@@ -25712,7 +25637,7 @@ function float (request) {
|
|
|
25712
25637
|
{
|
|
25713
25638
|
target: 'debouncing',
|
|
25714
25639
|
actions: 'addAmount',
|
|
25715
|
-
cond:
|
|
25640
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
25716
25641
|
},
|
|
25717
25642
|
{
|
|
25718
25643
|
target: 'debouncing',
|
|
@@ -25723,6 +25648,9 @@ function float (request) {
|
|
|
25723
25648
|
target: 'debouncing',
|
|
25724
25649
|
actions: 'setAmount',
|
|
25725
25650
|
},
|
|
25651
|
+
BACK: {
|
|
25652
|
+
target: 'loaded',
|
|
25653
|
+
},
|
|
25726
25654
|
},
|
|
25727
25655
|
after: {
|
|
25728
25656
|
1000: {
|
|
@@ -25737,7 +25665,7 @@ function float (request) {
|
|
|
25737
25665
|
{
|
|
25738
25666
|
target: 'debouncing',
|
|
25739
25667
|
actions: 'addAmount',
|
|
25740
|
-
cond:
|
|
25668
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
25741
25669
|
},
|
|
25742
25670
|
{
|
|
25743
25671
|
target: 'debouncing',
|
|
@@ -25748,12 +25676,11 @@ function float (request) {
|
|
|
25748
25676
|
target: 'debouncing',
|
|
25749
25677
|
actions: 'setAmount',
|
|
25750
25678
|
},
|
|
25751
|
-
|
|
25679
|
+
CALCULATE: {
|
|
25752
25680
|
target: 'debouncing',
|
|
25753
|
-
actions: 'clearCalculation',
|
|
25754
25681
|
},
|
|
25755
|
-
|
|
25756
|
-
|
|
25682
|
+
BACK: {
|
|
25683
|
+
target: 'loaded',
|
|
25757
25684
|
},
|
|
25758
25685
|
},
|
|
25759
25686
|
},
|
|
@@ -25775,7 +25702,7 @@ function float (request) {
|
|
|
25775
25702
|
{
|
|
25776
25703
|
target: 'debouncing',
|
|
25777
25704
|
actions: 'addAmount',
|
|
25778
|
-
cond:
|
|
25705
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
25779
25706
|
},
|
|
25780
25707
|
{
|
|
25781
25708
|
target: 'debouncing',
|
|
@@ -25789,8 +25716,8 @@ function float (request) {
|
|
|
25789
25716
|
CONFIRM: {
|
|
25790
25717
|
target: 'submitting',
|
|
25791
25718
|
},
|
|
25792
|
-
|
|
25793
|
-
|
|
25719
|
+
BACK: {
|
|
25720
|
+
target: 'loaded',
|
|
25794
25721
|
},
|
|
25795
25722
|
CLEAR_CALCULATION: {
|
|
25796
25723
|
target: 'debouncing',
|
|
@@ -25801,10 +25728,7 @@ function float (request) {
|
|
|
25801
25728
|
submitting: {
|
|
25802
25729
|
invoke: {
|
|
25803
25730
|
src: 'submitDeposit',
|
|
25804
|
-
onDone: {
|
|
25805
|
-
target: 'countdown',
|
|
25806
|
-
actions: 'setHouseBank',
|
|
25807
|
-
},
|
|
25731
|
+
onDone: { target: 'countdown', actions: 'setHouseBank' },
|
|
25808
25732
|
onError: {
|
|
25809
25733
|
target: 'calculated',
|
|
25810
25734
|
},
|
|
@@ -25827,11 +25751,6 @@ function float (request) {
|
|
|
25827
25751
|
accountUnbound: {},
|
|
25828
25752
|
unavailable: {},
|
|
25829
25753
|
},
|
|
25830
|
-
on: {
|
|
25831
|
-
SET_PROMOTION: {
|
|
25832
|
-
actions: 'setPromotion',
|
|
25833
|
-
},
|
|
25834
|
-
},
|
|
25835
25754
|
},
|
|
25836
25755
|
{
|
|
25837
25756
|
actions: {
|
|
@@ -25840,17 +25759,6 @@ function float (request) {
|
|
|
25840
25759
|
userAccount: event.data.bankInfo?.[0],
|
|
25841
25760
|
}
|
|
25842
25761
|
}),
|
|
25843
|
-
setPromotion: assign((context, event) => {
|
|
25844
|
-
const promotion = event.data;
|
|
25845
|
-
return {
|
|
25846
|
-
promotion,
|
|
25847
|
-
}
|
|
25848
|
-
}),
|
|
25849
|
-
setBonusPreview: assign((context, event) => {
|
|
25850
|
-
return {
|
|
25851
|
-
bonusPreviewData: event.data.bonus,
|
|
25852
|
-
}
|
|
25853
|
-
}),
|
|
25854
25762
|
setHouseBank: assign((context, event) => {
|
|
25855
25763
|
const { accountName, accountNumber, bankName, amount } = event.data;
|
|
25856
25764
|
return {
|
|
@@ -25861,10 +25769,9 @@ function float (request) {
|
|
|
25861
25769
|
}
|
|
25862
25770
|
}),
|
|
25863
25771
|
setInitialization: assign((context, event) => {
|
|
25864
|
-
const {
|
|
25772
|
+
const { housePayment, bankList } = event.data;
|
|
25865
25773
|
const { optional, minimum, maximum, grandTotalEnable } = housePayment;
|
|
25866
25774
|
return {
|
|
25867
|
-
siteConfig,
|
|
25868
25775
|
options: optional,
|
|
25869
25776
|
minimum,
|
|
25870
25777
|
maximum,
|
|
@@ -25879,8 +25786,11 @@ function float (request) {
|
|
|
25879
25786
|
}
|
|
25880
25787
|
}),
|
|
25881
25788
|
setAmount: assign((context, event) => {
|
|
25789
|
+
return { amount: event.data }
|
|
25790
|
+
}),
|
|
25791
|
+
clear: assign((context, event) => {
|
|
25882
25792
|
return {
|
|
25883
|
-
amount:
|
|
25793
|
+
amount: 0,
|
|
25884
25794
|
}
|
|
25885
25795
|
}),
|
|
25886
25796
|
setCalculation: assign((context, event) => {
|
|
@@ -25904,47 +25814,31 @@ function float (request) {
|
|
|
25904
25814
|
hasUserAccount: (context, event) => {
|
|
25905
25815
|
return event.data.bankInfo?.[0]
|
|
25906
25816
|
},
|
|
25907
|
-
isGrandTotalEnable: (context, event) => {
|
|
25908
|
-
return context.grandTotalEnable === 1
|
|
25909
|
-
},
|
|
25910
25817
|
},
|
|
25911
25818
|
services: {
|
|
25912
25819
|
fetchPaymentInfo: async (context, event) => {
|
|
25913
25820
|
return await request.send(payment.getPaymentInfo())
|
|
25914
25821
|
},
|
|
25915
25822
|
initialize: async (context, event) => {
|
|
25916
|
-
const [
|
|
25917
|
-
request.send(common$1.getConfig({ appSecret })),
|
|
25823
|
+
const [payments, bankList] = await Promise.all([
|
|
25918
25824
|
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
25919
25825
|
request.send(payment.getBankList('amb')),
|
|
25920
25826
|
]);
|
|
25921
|
-
|
|
25922
|
-
return { siteConfig, housePayment: payments.find((payment) => payment.method === context.method), bankList }
|
|
25923
|
-
},
|
|
25924
|
-
fetchBonusPreview: async (context, event) => {
|
|
25925
|
-
const { method, promotion } = context;
|
|
25926
|
-
return await request.send({
|
|
25927
|
-
paymentMethod: method,
|
|
25928
|
-
promotionsNo: promotion?.activityNo,
|
|
25929
|
-
})
|
|
25827
|
+
return { housePayment: payments.find((payment) => payment.method === context.method), bankList }
|
|
25930
25828
|
},
|
|
25931
25829
|
submitDeposit: async (context, event) => {
|
|
25932
|
-
const { method, amount, promotion } = context;
|
|
25933
25830
|
return await request.send(
|
|
25934
25831
|
payment.submitDepositTransaction({
|
|
25935
|
-
method,
|
|
25936
|
-
amount,
|
|
25937
|
-
promotionsNo: promotion?.activityNo,
|
|
25832
|
+
method: context.method,
|
|
25833
|
+
amount: context.amount,
|
|
25938
25834
|
})
|
|
25939
25835
|
)
|
|
25940
25836
|
},
|
|
25941
25837
|
fetchCalculation: async (context, event) => {
|
|
25942
|
-
const { method, amount, promotion } = context;
|
|
25943
25838
|
return await request.send(
|
|
25944
25839
|
payment.getDepositExpectedResult({
|
|
25945
|
-
method,
|
|
25946
|
-
amount,
|
|
25947
|
-
promotionsNo: promotion?.activityNo,
|
|
25840
|
+
method: context.method,
|
|
25841
|
+
amount: context.amount,
|
|
25948
25842
|
})
|
|
25949
25843
|
)
|
|
25950
25844
|
},
|
|
@@ -25954,7 +25848,6 @@ function float (request) {
|
|
|
25954
25848
|
}
|
|
25955
25849
|
|
|
25956
25850
|
function vpay (request) {
|
|
25957
|
-
const { appSecret } = request.config;
|
|
25958
25851
|
return createMachine(
|
|
25959
25852
|
{
|
|
25960
25853
|
id: 'vpay',
|
|
@@ -25962,7 +25855,6 @@ function vpay (request) {
|
|
|
25962
25855
|
context: {
|
|
25963
25856
|
method: 'vpay',
|
|
25964
25857
|
userAccount: {},
|
|
25965
|
-
siteConfig: null,
|
|
25966
25858
|
amount: 0,
|
|
25967
25859
|
|
|
25968
25860
|
bankList: [],
|
|
@@ -25977,9 +25869,6 @@ function vpay (request) {
|
|
|
25977
25869
|
calculatedAmount: 0,
|
|
25978
25870
|
|
|
25979
25871
|
grandTotalEnable: 1,
|
|
25980
|
-
|
|
25981
|
-
promotion: null,
|
|
25982
|
-
bonusPreviewData: [],
|
|
25983
25872
|
},
|
|
25984
25873
|
states: {
|
|
25985
25874
|
loading: {
|
|
@@ -26010,7 +25899,7 @@ function vpay (request) {
|
|
|
26010
25899
|
actions: ['setInitialization', 'setPreviousOrder'],
|
|
26011
25900
|
cond: 'hasPreviousOrder',
|
|
26012
25901
|
},
|
|
26013
|
-
{ target: '#vpay.
|
|
25902
|
+
{ target: '#vpay.loaded', actions: 'setInitialization' },
|
|
26014
25903
|
],
|
|
26015
25904
|
onError: {
|
|
26016
25905
|
target: '#vpay.unavailable',
|
|
@@ -26019,31 +25908,6 @@ function vpay (request) {
|
|
|
26019
25908
|
},
|
|
26020
25909
|
},
|
|
26021
25910
|
},
|
|
26022
|
-
checking: {
|
|
26023
|
-
always: [
|
|
26024
|
-
{
|
|
26025
|
-
target: 'fetching',
|
|
26026
|
-
cond: (context, event) => {
|
|
26027
|
-
const { siteConfig = {}, promotion = {} } = context;
|
|
26028
|
-
const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig;
|
|
26029
|
-
return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
|
|
26030
|
-
},
|
|
26031
|
-
},
|
|
26032
|
-
{ target: 'loaded' },
|
|
26033
|
-
],
|
|
26034
|
-
},
|
|
26035
|
-
fetching: {
|
|
26036
|
-
invoke: {
|
|
26037
|
-
src: 'fetchBonusPreview',
|
|
26038
|
-
onDone: {
|
|
26039
|
-
target: 'loaded',
|
|
26040
|
-
actions: 'setBonusPreview',
|
|
26041
|
-
},
|
|
26042
|
-
onError: {
|
|
26043
|
-
target: 'loaded',
|
|
26044
|
-
},
|
|
26045
|
-
},
|
|
26046
|
-
},
|
|
26047
25911
|
loaded: {
|
|
26048
25912
|
entry: 'reset',
|
|
26049
25913
|
on: {
|
|
@@ -26051,7 +25915,7 @@ function vpay (request) {
|
|
|
26051
25915
|
{
|
|
26052
25916
|
target: 'debouncing',
|
|
26053
25917
|
actions: 'addAmount',
|
|
26054
|
-
cond:
|
|
25918
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
26055
25919
|
},
|
|
26056
25920
|
{
|
|
26057
25921
|
target: 'debouncing',
|
|
@@ -26062,10 +25926,6 @@ function vpay (request) {
|
|
|
26062
25926
|
target: 'calculating',
|
|
26063
25927
|
actions: 'setAmount',
|
|
26064
25928
|
},
|
|
26065
|
-
CLEAR_CALCULATION: {
|
|
26066
|
-
target: 'debouncing',
|
|
26067
|
-
actions: 'clearCalculation',
|
|
26068
|
-
},
|
|
26069
25929
|
},
|
|
26070
25930
|
},
|
|
26071
25931
|
debouncing: {
|
|
@@ -26074,7 +25934,7 @@ function vpay (request) {
|
|
|
26074
25934
|
{
|
|
26075
25935
|
target: 'debouncing',
|
|
26076
25936
|
actions: 'addAmount',
|
|
26077
|
-
cond:
|
|
25937
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
26078
25938
|
},
|
|
26079
25939
|
{
|
|
26080
25940
|
target: 'debouncing',
|
|
@@ -26085,6 +25945,9 @@ function vpay (request) {
|
|
|
26085
25945
|
target: 'debouncing',
|
|
26086
25946
|
actions: 'setAmount',
|
|
26087
25947
|
},
|
|
25948
|
+
BACK: {
|
|
25949
|
+
target: 'loaded',
|
|
25950
|
+
},
|
|
26088
25951
|
},
|
|
26089
25952
|
after: {
|
|
26090
25953
|
1000: {
|
|
@@ -26099,7 +25962,7 @@ function vpay (request) {
|
|
|
26099
25962
|
{
|
|
26100
25963
|
target: 'debouncing',
|
|
26101
25964
|
actions: 'addAmount',
|
|
26102
|
-
cond:
|
|
25965
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
26103
25966
|
},
|
|
26104
25967
|
{
|
|
26105
25968
|
target: 'debouncing',
|
|
@@ -26110,12 +25973,11 @@ function vpay (request) {
|
|
|
26110
25973
|
target: 'debouncing',
|
|
26111
25974
|
actions: 'setAmount',
|
|
26112
25975
|
},
|
|
26113
|
-
|
|
25976
|
+
CALCULATE: {
|
|
26114
25977
|
target: 'debouncing',
|
|
26115
|
-
actions: 'clearCalculation',
|
|
26116
25978
|
},
|
|
26117
|
-
|
|
26118
|
-
|
|
25979
|
+
BACK: {
|
|
25980
|
+
target: 'loaded',
|
|
26119
25981
|
},
|
|
26120
25982
|
},
|
|
26121
25983
|
},
|
|
@@ -26137,7 +25999,7 @@ function vpay (request) {
|
|
|
26137
25999
|
{
|
|
26138
26000
|
target: 'debouncing',
|
|
26139
26001
|
actions: 'addAmount',
|
|
26140
|
-
cond:
|
|
26002
|
+
cond: (context, event) => context.grandTotalEnable === 1,
|
|
26141
26003
|
},
|
|
26142
26004
|
{
|
|
26143
26005
|
target: 'debouncing',
|
|
@@ -26151,22 +26013,19 @@ function vpay (request) {
|
|
|
26151
26013
|
CONFIRM: {
|
|
26152
26014
|
target: 'submitting',
|
|
26153
26015
|
},
|
|
26016
|
+
BACK: {
|
|
26017
|
+
target: 'loaded',
|
|
26018
|
+
},
|
|
26154
26019
|
CLEAR_CALCULATION: {
|
|
26155
26020
|
target: 'debouncing',
|
|
26156
26021
|
actions: 'clearCalculation',
|
|
26157
26022
|
},
|
|
26158
|
-
CLEAR: {
|
|
26159
|
-
actions: 'setAmount',
|
|
26160
|
-
},
|
|
26161
26023
|
},
|
|
26162
26024
|
},
|
|
26163
26025
|
submitting: {
|
|
26164
26026
|
invoke: {
|
|
26165
26027
|
src: 'submitDeposit',
|
|
26166
|
-
onDone: {
|
|
26167
|
-
target: 'submitted',
|
|
26168
|
-
actions: 'setOrder',
|
|
26169
|
-
},
|
|
26028
|
+
onDone: { target: 'submitted', actions: 'setOrder' },
|
|
26170
26029
|
onError: {
|
|
26171
26030
|
target: 'calculated',
|
|
26172
26031
|
},
|
|
@@ -26176,11 +26035,6 @@ function vpay (request) {
|
|
|
26176
26035
|
accountUnbound: {},
|
|
26177
26036
|
unavailable: {},
|
|
26178
26037
|
},
|
|
26179
|
-
on: {
|
|
26180
|
-
SET_PROMOTION: {
|
|
26181
|
-
actions: 'setPromotion',
|
|
26182
|
-
},
|
|
26183
|
-
},
|
|
26184
26038
|
},
|
|
26185
26039
|
{
|
|
26186
26040
|
actions: {
|
|
@@ -26189,11 +26043,6 @@ function vpay (request) {
|
|
|
26189
26043
|
userAccount: event.data.bankInfo?.[0],
|
|
26190
26044
|
}
|
|
26191
26045
|
}),
|
|
26192
|
-
setBonusPreview: assign((context, event) => {
|
|
26193
|
-
return {
|
|
26194
|
-
bonusPreviewData: event.data.bonus,
|
|
26195
|
-
}
|
|
26196
|
-
}),
|
|
26197
26046
|
setOrder: assign((context, event) => {
|
|
26198
26047
|
const { amount, qrcode, vpayId } = event.data;
|
|
26199
26048
|
return {
|
|
@@ -26211,10 +26060,9 @@ function vpay (request) {
|
|
|
26211
26060
|
}
|
|
26212
26061
|
}),
|
|
26213
26062
|
setInitialization: assign((context, event) => {
|
|
26214
|
-
const {
|
|
26063
|
+
const { housePayment, bankList } = event.data;
|
|
26215
26064
|
const { optional, minimum, maximum, grandTotalEnable } = housePayment;
|
|
26216
26065
|
return {
|
|
26217
|
-
siteConfig,
|
|
26218
26066
|
options: optional,
|
|
26219
26067
|
minimum,
|
|
26220
26068
|
maximum,
|
|
@@ -26222,12 +26070,6 @@ function vpay (request) {
|
|
|
26222
26070
|
grandTotalEnable,
|
|
26223
26071
|
}
|
|
26224
26072
|
}),
|
|
26225
|
-
setPromotion: assign((context, event) => {
|
|
26226
|
-
const promotion = event.data;
|
|
26227
|
-
return {
|
|
26228
|
-
promotion,
|
|
26229
|
-
}
|
|
26230
|
-
}),
|
|
26231
26073
|
addAmount: assign((context, event) => {
|
|
26232
26074
|
const { amount, maximum } = context;
|
|
26233
26075
|
return {
|
|
@@ -26237,6 +26079,11 @@ function vpay (request) {
|
|
|
26237
26079
|
setAmount: assign((context, event) => {
|
|
26238
26080
|
return { amount: event.data }
|
|
26239
26081
|
}),
|
|
26082
|
+
clear: assign((context, event) => {
|
|
26083
|
+
return {
|
|
26084
|
+
amount: 0,
|
|
26085
|
+
}
|
|
26086
|
+
}),
|
|
26240
26087
|
setCalculation: assign((context, event) => {
|
|
26241
26088
|
return {
|
|
26242
26089
|
calculation: event.data,
|
|
@@ -26255,48 +26102,33 @@ function vpay (request) {
|
|
|
26255
26102
|
hasPreviousOrder: (context, event) => {
|
|
26256
26103
|
return event.data.order?.qrcode
|
|
26257
26104
|
},
|
|
26258
|
-
isGrandTotalEnable: (context, event) => {
|
|
26259
|
-
return context.grandTotalEnable === 1
|
|
26260
|
-
},
|
|
26261
26105
|
},
|
|
26262
26106
|
services: {
|
|
26263
26107
|
fetchPaymentInfo: async (context, event) => {
|
|
26264
26108
|
return await request.send(payment.getPaymentInfo())
|
|
26265
26109
|
},
|
|
26266
26110
|
initialize: async (context, event) => {
|
|
26267
|
-
const [
|
|
26268
|
-
request.send(common$1.getConfig({ appSecret })),
|
|
26111
|
+
const [payments, bankList, order] = await Promise.all([
|
|
26269
26112
|
request.send(payment.getPaymentDetail({ transferType: 'DEPOSIT' })),
|
|
26270
26113
|
request.send(payment.getBankList('amb')),
|
|
26271
26114
|
request.send(payment.checkTransaction(context.method)),
|
|
26272
26115
|
]);
|
|
26273
|
-
|
|
26274
|
-
return { siteConfig, housePayment: payments.find((payment) => payment.method === context.method), bankList, order }
|
|
26275
|
-
},
|
|
26276
|
-
fetchBonusPreview: async (context, event) => {
|
|
26277
|
-
const { method, promotion } = context;
|
|
26278
|
-
return await request.send({
|
|
26279
|
-
paymentMethod: method,
|
|
26280
|
-
promotionsNo: promotion?.activityNo,
|
|
26281
|
-
})
|
|
26116
|
+
return { housePayment: payments.find((payment) => payment.method === context.method), bankList, order }
|
|
26282
26117
|
},
|
|
26283
26118
|
submitDeposit: async (context, event) => {
|
|
26284
|
-
const { method, amount
|
|
26119
|
+
const { method, amount } = context;
|
|
26285
26120
|
return await request.send(
|
|
26286
26121
|
payment.submitDepositTransaction({
|
|
26287
26122
|
method,
|
|
26288
26123
|
amount,
|
|
26289
|
-
promotionsNo: promotion?.activityNo,
|
|
26290
26124
|
})
|
|
26291
26125
|
)
|
|
26292
26126
|
},
|
|
26293
26127
|
fetchCalculation: async (context, event) => {
|
|
26294
|
-
const { method, amount, promotion } = context;
|
|
26295
26128
|
return await request.send(
|
|
26296
26129
|
payment.getDepositExpectedResult({
|
|
26297
|
-
method,
|
|
26298
|
-
amount,
|
|
26299
|
-
promotionsNo: promotion?.activityNo,
|
|
26130
|
+
method: context.method,
|
|
26131
|
+
amount: context.amount,
|
|
26300
26132
|
})
|
|
26301
26133
|
)
|
|
26302
26134
|
},
|