showInPayDialog method

void showInPayDialog(
  1. String? token,
  2. String? orderId,
  3. String? productID, {
  4. String? sign,
  5. String? price,
  6. bool showLeft = true,
  7. bool restored = false,
})

Implementation

void showInPayDialog(String? token, String? orderId, String? productID,
    {String? sign,
    String? price,
    bool showLeft = true,
    bool restored = false}) {
  if (showInPay || restored) {
    return;
  }
  showInPay = true;
  delegate.showDialogBase(showLeft ? 3 : 4).then((value) async {
    showInPay = false;
    if (value == true) {
      if (productID!.startsWith(RechargeConfig.subStart)) {
        delegate.logEvent('内购订阅手动重试');
      } else {
        delegate.logEvent('${payInType ?? ''}手动重试');
      }
      startInPayPurchase(token, orderId, productID, sign: sign, price: price);
    } else if (value == null) {
      if (productID!.startsWith(RechargeConfig.subStart)) {
        delegate.logEvent('内购订阅取消重试');
      } else {
        delegate.logEvent('${payInType ?? ''}取消重试');
      }
      if (!showLoading) {
        showLoading = true;
        delegate.showLoadingDialog();
        RechargeDao.rechargeFailLog(token, sign, orderId, rechargeError)
            .then((res) async {
          if (showLoading) {
            showLoading = false;
            delegate.popDialog();
          }
          if (!res.result) {
            delegate.showErrorToast(res);
          }
        });
      }
    }
  });
}