导航菜单

页面标题

页面副标题

新暖心缘 v8.1.1 - WXPayEntryActivity.java 源代码

正在查看: 新暖心缘 v8.1.1 应用的 WXPayEntryActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.luanxingyuan.app.wxapi;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import com.luanxingyuan.app.base.AppManager;
import com.luanxingyuan.app.util.LogUtil;
import com.luanxingyuan.app.util.ToastUtil;
import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;

public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {

    private IWXAPI f8647a;

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        IWXAPI createWXAPI = WXAPIFactory.createWXAPI(this, "wx592dcebca0f03440", true);
        this.f8647a = createWXAPI;
        createWXAPI.handleIntent(getIntent(), this);
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        setIntent(intent);
        this.f8647a.handleIntent(intent, this);
    }

    @Override
    public void onReq(BaseReq baseReq) {
    }

    @Override
    public void onResp(BaseResp baseResp) {
        LogUtil.i("支付返回,errCode=" + baseResp.errCode + "  原因: " + baseResp.errStr);
        if (baseResp.getType() == 5) {
            int i8 = baseResp.errCode;
            if (i8 == -2) {
                LogUtil.i("支付已取消");
                ToastUtil.showToast(getApplicationContext(), "支付已取消");
                finish();
            } else {
                if (i8 != 0) {
                    LogUtil.i("支付失败");
                    ToastUtil.showToast(getApplicationContext(), "支付失败");
                    finish();
                    return;
                }
                LogUtil.i("支付成功");
                ToastUtil.showToast(getApplicationContext(), 2131821140);
                if (AppManager.f().h()) {
                    LogUtil.i("是充值VIP");
                } else {
                    LogUtil.i("是充值金币");
                    sendBroadcast(new Intent("com.newslapp.live.chargeclose"));
                }
                finish();
            }
        }
    }
}