connectionTBF method
Implementation
Future connectionTBF(String? payId, String? price, req, {back}) {
if (!showLoading) {
showLoading = true;
delegate.showLoadingDialog();
return RechargeDao.rechargeOrder(payId, req: req).then((res) {
if (res.result) {
if (res.data.result.orderSucceed == 0) {
popDialog();
delegate.showErrorToast(res.data.result.orderResult);
return -2;
} else {
orderId = res.data.id;
payPrice = price;
if (res.data.result.redirectURL?.isEmpty == false) {
popDialog();
delegate.logEvent('发起tbf3d支付');
back?.call(true);
delegate
.navigatorPushWebView(res.data.result.redirectURL, 1)
.then((value) {
back?.call(false);
});
return -2;
}
return res.data.result.orderSucceed;
}
} else {
popDialog();
delegate.showErrorToast(res);
return -2;
}
});
} else {
return Future(() {});
}
}