Java Code Examples for com.tencent.mm.sdk.modelbase.BaseResp#getType()

The following examples show how to use com.tencent.mm.sdk.modelbase.BaseResp#getType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WXPayEntryActivity.java    From letv with Apache License 2.0 5 votes vote down vote up
public void onResp(BaseResp resp) {
    LogInfo.log("weixin", "onPayFinish, errCode = " + resp.errCode);
    finish();
    if (resp.getType() == 5) {
        if (resp.errCode == 0) {
            LetvAlipayManager.getInstance().startPaySucceedActivity("");
        } else if (resp.errCode != -2) {
            PayFailedActivity.launch(this);
        }
    }
    LetvAlipayManager.getInstance().finishWxPay();
}
 
Example 2
Source File: WXPayCallbackActivity.java    From PayAndroid with Apache License 2.0 5 votes vote down vote up
@Override
public void onResp(BaseResp baseResp) {
    if(baseResp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
        if(WXPay.getInstance() != null) {
            if(baseResp.errStr != null) {
                Log.e("wxpay", "errstr=" + baseResp.errStr);
            }

            WXPay.getInstance().onResp(baseResp.errCode);
            finish();
        }
    }
}
 
Example 3
Source File: WeixinPayHelper.java    From android-common-utils with Apache License 2.0 5 votes vote down vote up
@Override
public void onResp(BaseResp resp) {
    if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
        if (mPayCallback != null) {
            mPayCallback.onResponse(resp.errCode, resp.errStr);
            mPayCallback = null;
        }
    }
    mProcessing.set(false);
}
 
Example 4
Source File: WXEntryActivity.java    From letv with Apache License 2.0 4 votes vote down vote up
public void onResp(BaseResp resq) {
    if (resq != null && (resq instanceof Resp) && resq.getType() == 1) {
        Resp resps = (Resp) resq;
        if (resps != null) {
            try {
                if (resps.state.equals("none_weixin_login")) {
                    getCode(resps);
                }
            } catch (Exception e) {
                finish();
                e.printStackTrace();
            }
        }
    } else if (resq.getType() != 4) {
        try {
            switch (resq.errCode) {
                case -5:
                case -4:
                case -3:
                case -1:
                    ToastUtils.showToast((Context) this, getString(2131100850));
                    if (observers != null && observers.size() > 0) {
                        for (WXShareResultObserver observer : observers) {
                            observer.onWXShareFail();
                        }
                        break;
                    }
                case -2:
                    if (observers != null && observers.size() > 0) {
                        for (WXShareResultObserver observer2 : observers) {
                            observer2.onWXCanneled();
                        }
                        break;
                    }
                case 0:
                    ToastUtils.showToast((Context) this, getString(2131100851));
                    LogInfo.log("lxx", "weixin ERR_OK");
                    if (PointsUtils.canShareGainPoints()) {
                    }
                    if (LetvWeixinShare.isShareFriendZone) {
                        LogInfo.log("fornia", "isShareFriendZone true LetvWeixinShare.mFragId" + LetvWeixinShare.mFragId + "|LetvWeixinShare.mStaticsId" + LetvWeixinShare.mStaticsId);
                        if (!TextUtils.isEmpty(LetvWeixinShare.mFragId)) {
                            StatisticsUtils.staticticsInfoPost(this, "19", LetvWeixinShare.mFragId, "5001", 1, null, LetvWeixinShare.mStaticsId, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE);
                        }
                    } else {
                        LogInfo.log("fornia", "isShareFriendZone false LetvWeixinShare.mFragId" + LetvWeixinShare.mFragId + "|LetvWeixinShare.mStaticsId" + LetvWeixinShare.mStaticsId);
                        if (!TextUtils.isEmpty(LetvWeixinShare.mFragId)) {
                            StatisticsUtils.staticticsInfoPost(this, "19", LetvWeixinShare.mFragId, "5002", 2, null, LetvWeixinShare.mStaticsId, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE, NetworkUtils.DELIMITER_LINE);
                        }
                    }
                    LogInfo.log("fornia", "showAwardPage LetvWeixinShare.mGiftShareAwardCallback:" + LetvWeixinShare.mGiftShareAwardCallback + "|" + LetvWeixinShare.mAwardUrl);
                    if (!(LetvWeixinShare.mGiftShareAwardCallback == null || TextUtils.isEmpty(LetvWeixinShare.mAwardUrl))) {
                        LetvWeixinShare.mGiftShareAwardCallback.showAwardPage(LetvWeixinShare.mAwardUrl);
                        LetvWeixinShare.mGiftShareAwardCallback = null;
                        LetvWeixinShare.mAwardUrl = "";
                    }
                    if (LetvWeixinShare.mLaunchMode == 22 && LetvWeixinShare.mActivity != null) {
                        LetvWeixinShare.mLaunchMode = -1;
                        RedPacketSdkController.shareSuccess(LetvWeixinShare.mActivity);
                    }
                    if (observers != null && observers.size() > 0) {
                        for (WXShareResultObserver observer22 : observers) {
                            LogInfo.log("lxx", "observer.onWXShareSucceed()");
                            observer22.onWXShareSucceed();
                        }
                        break;
                    }
                default:
                    if (observers != null && observers.size() > 0) {
                        for (WXShareResultObserver observer222 : observers) {
                            observer222.onWXShareFail();
                        }
                        break;
                    }
            }
            LogInfo.log("wx", "WXEntryActivity -------------- onResp arg0 = " + resq.errCode);
            finish();
        } catch (Exception e2) {
            finish();
            e2.printStackTrace();
        }
    }
}