connectionTBF method

Future connectionTBF(
  1. String? payId,
  2. String? price,
  3. dynamic req, {
  4. dynamic back,
})

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(() {});
  }
}