package com.tencent.mm.plugin.appbrand.jsapi.l;

import android.content.Intent;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.q;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.ui.MMActivity.a;
import java.util.HashMap;

class g$1 implements a {
    final /* synthetic */ int eIl;
    final /* synthetic */ g hTT;
    final /* synthetic */ q hsD;

    g$1(g gVar, q qVar, int i) {
        this.hTT = gVar;
        this.hsD = qVar;
        this.eIl = i;
    }

    public final void c(int i, int i2, Intent intent) {
        AppMethodBeat.i(131419);
        if (i != (this.hTT.hashCode() & 65535)) {
            AppMethodBeat.o(131419);
            return;
        }
        int intExtra;
        this.hTT.hTS = false;
        if (intent != null) {
            intExtra = intent.getIntExtra("key_err_code", 1);
        } else {
            intExtra = 1;
        }
        ab.i("MicroMsg.JsApiRequestVirtualPayment", "resultCode:%d,result:%d", new Object[]{Integer.valueOf(i2), Integer.valueOf(intExtra)});
        if (i2 != -1) {
            HashMap hashMap = new HashMap();
            hashMap.put("errCode", Integer.valueOf(intExtra));
            this.hsD.M(this.eIl, this.hTT.j("cancel", hashMap));
            AppMethodBeat.o(131419);
        } else if (intExtra == 0) {
            ab.i("MicroMsg.JsApiRequestVirtualPayment", "requestIAP ok");
            this.hsD.M(this.eIl, this.hTT.j("ok", null));
            AppMethodBeat.o(131419);
        } else {
            HashMap hashMap2 = new HashMap();
            String nullAsNil = bo.nullAsNil(intent.getStringExtra("key_err_msg"));
            hashMap2.put("errCode", Integer.valueOf(intExtra));
            ab.i("MicroMsg.JsApiRequestVirtualPayment", "requestVirtualPayment errCode: %d, errMsg: %s", new Object[]{Integer.valueOf(intExtra), nullAsNil});
            this.hsD.M(this.eIl, this.hTT.j("fail ".concat(String.valueOf(nullAsNil)), hashMap2));
            AppMethodBeat.o(131419);
        }
    }
}
