package com.tencent.mm.plugin.luckymoney.appbrand.ui.prepare;

import android.content.Intent;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.pluginsdk.wallet.PayInfo;
import com.tencent.mm.pluginsdk.wallet.h;
import com.tencent.mm.protocal.protobuf.bsv;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.ui.MMActivity;
import com.tencent.mm.vending.c.a;
import com.tencent.ytcommon.BuildConfig;

class d$1 implements a<Void, com.tencent.mm.ai.a.a<bsv>> {
    final /* synthetic */ d nTA;

    d$1(d dVar) {
        this.nTA = dVar;
    }

    public final /* synthetic */ Object call(Object obj) {
        AppMethodBeat.i(42089);
        com.tencent.mm.ai.a.a aVar = (com.tencent.mm.ai.a.a) obj;
        if (aVar.errType == 0 && aVar.errCode == 0) {
            this.nTA.nTx = (bsv) aVar.fsy;
            if (this.nTA.nTx == null) {
                this.nTA.af(new Intent().putExtra("result_error_code", -1).putExtra("result_error_msg", "fail:system error {{service error Request resp is nil}}"));
            } else if (this.nTA.nTx.wKy != 0 || this.nTA.nTx.nYX.equalsIgnoreCase(BuildConfig.FLAVOR)) {
                ab.i("MicroMsg.WxaPrepareLuckyMoneyLogic", "CgiRequestWxaHB fail.  sendid = [%s] reqkey = [%s] wxahb_status = [%d]", new Object[]{this.nTA.nTx.wKw, this.nTA.nTx.nYX, Integer.valueOf(this.nTA.nTx.wKy)});
                this.nTA.af(new Intent().putExtra("result_error_code", -1).putExtra("result_error_msg", "fail:system error {{service error Request errStatus = " + this.nTA.nTx.wKy + ",errMsg" + this.nTA.nTx.wKJ + "}}"));
                AppMethodBeat.o(42089);
                return null;
            } else {
                ab.i("MicroMsg.WxaPrepareLuckyMoneyLogic", "CgiRequestWxaHB succeed sendid = [%s] reqkey = [%s]", new Object[]{((bsv) aVar.fsy).wKw, ((bsv) aVar.fsy).nYX});
                d dVar = this.nTA;
                String str = this.nTA.nTx.nYX;
                if (dVar.nTw == null) {
                    ab.i("MicroMsg.WxaPrepareLuckyMoneyLogic", "doWalletPay() called with: ui == null");
                } else {
                    MMActivity bKU = dVar.nTw.bKU();
                    bKU.ifE = dVar;
                    PayInfo payInfo = new PayInfo();
                    payInfo.czZ = str;
                    payInfo.cIf = 37;
                    payInfo.cIb = 50;
                    h.a(bKU, payInfo, dVar.nTz);
                }
                AppMethodBeat.o(42089);
                return null;
            }
        }
        ab.i("MicroMsg.WxaPrepareLuckyMoneyLogic", "CgiRequestWxaHB fail. [%d, %d, %s]", new Object[]{Integer.valueOf(aVar.errType), Integer.valueOf(aVar.errCode), aVar.aIm});
        this.nTA.af(new Intent().putExtra("result_error_code", -1).putExtra("result_error_msg", "fail:system error {{service error Request errType = " + aVar.errType + ",errCode" + aVar.errCode + "}}"));
        AppMethodBeat.o(42089);
        return null;
    }
}
