示例#1
0
  public void payWith(String method) {
    iPayOrderView.uiShowRefreshLoading();
    String coupId = "";
    if (payOrderMode != null && payOrderMode.getDiscount() != null) {
      coupId = payOrderMode.getDiscount().getCode();
    }
    payOrderFetcher.getChar(
        oid,
        method,
        Utils.getLocalHostIp(),
        UnitUtils.getMoneyType(),
        coupId,
        new CtFetchCallback<String>() {
          @Override
          public void onSuc(String s) {
            iPayOrderView.uiHideRefreshLoading();
            iPayOrderView.requestPay(s);
          }

          @Override
          public void onFailed(CtException throwable) {
            MessageUtils.showToast(throwable.getMessage());
            iPayOrderView.uiHideRefreshLoading();
          }
        });
  }
示例#2
0
  public void onPayFailedAtClient() {
    payOrderFetcher.notifiOrderStatus(
        oid,
        new CtApiCallback() {
          @Override
          public void onSuc() {}

          @Override
          public void onFailed(CtException throwable) {}
        });
  }
示例#3
0
  public void clickPay() {

    iPayOrderView.uiShowRefreshLoading();
    String temp = "";
    if (payOrderMode != null && payOrderMode.getDiscount() != null) {
      temp = payOrderMode.getDiscount().getCode();
    }
    final String coupId = temp;
    payOrderFetcher.needCharge(
        oid,
        UnitUtils.getMoneyType(),
        coupId,
        new CtFetchCallback<Boolean>() {
          @Override
          public void onSuc(Boolean aBoolean) {
            if (aBoolean) {
              iPayOrderView.uiHideRefreshLoading();
              iPayOrderView.uiPayMethod();
            } else {
              payOrderFetcher.getChar(
                  oid,
                  "",
                  Utils.getLocalHostIp(),
                  UnitUtils.getMoneyType(),
                  coupId,
                  new CtFetchCallback<String>() {
                    @Override
                    public void onSuc(String s) {
                      iPayOrderView.uiHideRefreshLoading();
                      iPayOrderView.uiPaySuc();
                    }

                    @Override
                    public void onFailed(CtException throwable) {
                      iPayOrderView.uiHideRefreshLoading();
                      iPayOrderView.uiPayFailed(throwable.getMessage());
                    }
                  });
            }
          }

          @Override
          public void onFailed(CtException throwable) {
            MessageUtils.showToast(throwable.getMessage());
            iPayOrderView.uiHideRefreshLoading();
          }
        });
  }
示例#4
0
  public void requestPayOrderMode() {
    iPayOrderView.uiShowRefreshLoading();
    payOrderFetcher.fetchPayOrder(
        oid,
        new CtFetchCallback<PayOrderMode>() {
          @Override
          public void onSuc(PayOrderMode payOrderMode) {
            PayOrderPresent.this.payOrderMode = payOrderMode;
            iPayOrderView.renderUIWithData(payOrderMode);
            iPayOrderView.uiHideRefreshLoading();
          }

          @Override
          public void onFailed(CtException throwable) {
            iPayOrderView.uiHideRefreshLoading();
          }
        });
  }
示例#5
0
  public void removeDiscount() {
    iPayOrderView.uiShowRefreshLoading();
    payOrderFetcher.removeDiscount(
        oid,
        new CtApiCallback() {
          @Override
          public void onSuc() {
            iPayOrderView.showMessage(
                PlatformUtil.getInstance().getString(R.string.ct_cancel_discount_suc_msg));
            requestPayOrderMode();
          }

          @Override
          public void onFailed(CtException throwable) {
            iPayOrderView.showMessage(throwable.getMessage());
            iPayOrderView.uiHideRefreshLoading();
          }
        });
  }