导航菜单

页面标题

页面副标题

Clash Legends v0.0.1 - PaymentResponseUpiSdkActivity.java 源代码

正在查看: Clash Legends v0.0.1 应用的 PaymentResponseUpiSdkActivity.java JAVA 源代码文件

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


package com.payu.upisdk.upiintent;

import android.app.AlertDialog;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Base64;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.fragment.app.FragmentActivity;
import com.payu.checkoutpro.utils.PayUCheckoutProConstants;
import com.payu.otpassist.utils.Constants;
import com.payu.payuanalytics.analytics.factory.AnalyticsFactory;
import com.payu.payuanalytics.analytics.model.AnalyticsType;
import com.payu.payuanalytics.analytics.model.PayUAnalytics;
import com.payu.socketverification.bean.PayUNetworkAsyncTaskData;
import com.payu.socketverification.core.PayUNetworkAsyncTask;
import com.payu.socketverification.interfaces.PayUSocketEventListener;
import com.payu.socketverification.socket.SocketHandler;
import com.payu.socketverification.socket.SocketPaymentResponse;
import com.payu.socketverification.widgets.PayUProgressDialog;
import com.payu.upisdk.PaymentOption;
import com.payu.upisdk.R;
import com.payu.upisdk.Upi;
import com.payu.upisdk.bean.UpiConfig;
import com.payu.upisdk.callbacks.PayUUPICallback;
import com.payu.upisdk.util.UpiConstant;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class PaymentResponseUpiSdkActivity extends FragmentActivity implements com.payu.upisdk.upiinterface.a, PayUSocketEventListener {
    public static String p;
    public e a;
    public String b;
    public ArrayList<com.payu.upisdk.upiintent.a> c;
    public ArrayList<com.payu.upisdk.upiintent.a> d;
    public PayUAnalytics e;
    public String f;
    public PaymentOption g;
    public WebView h;
    public UpiConfig i;
    public f k;
    public PayUProgressDialog m;
    public SocketPaymentResponse n;
    public AlertDialog o;
    public Boolean j = Boolean.FALSE;
    public String l = "";

    public class a extends WebViewClient {
        public a() {
        }

        @Override
        public void onPageFinished(WebView webView, String str) {
            super.onPageFinished(webView, str);
            PaymentResponseUpiSdkActivity paymentResponseUpiSdkActivity = PaymentResponseUpiSdkActivity.this;
            PayUProgressDialog payUProgressDialog = paymentResponseUpiSdkActivity.m;
            if (payUProgressDialog == null || !payUProgressDialog.isShowing() || paymentResponseUpiSdkActivity.isDestroyed() || paymentResponseUpiSdkActivity.isFinishing()) {
                return;
            }
            paymentResponseUpiSdkActivity.m.dismiss();
            paymentResponseUpiSdkActivity.m = null;
        }

        @Override
        public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
            super.onPageStarted(webView, str, bitmap);
        }
    }

    @Override
    public void a(f fVar) {
        ArrayList<com.payu.upisdk.upiintent.a> arrayList;
        String str;
        String str2;
        this.k = fVar;
        if (fVar == null) {
            a();
            return;
        }
        if (!((TextUtils.isEmpty(fVar.b) || TextUtils.isEmpty(this.k.c) || TextUtils.isEmpty(this.k.d)) ? false : true)) {
            if (fVar.n != 0 || !TextUtils.isEmpty(fVar.l)) {
                a();
                return;
            }
            try {
                str2 = new String(Base64.decode(fVar.l, 0));
            } catch (IllegalArgumentException e) {
                str2 = null;
            }
            if (str2 == null) {
                a();
                return;
            }
            PayUUPICallback payUUPICallback = com.payu.upisdk.b.SINGLETON.f;
            if (payUUPICallback != null) {
                payUUPICallback.onPaymentFailure(str2, null);
                return;
            }
            return;
        }
        PaymentOption paymentOption = this.g;
        if (paymentOption == PaymentOption.TEZ) {
            this.a.a(PayUCheckoutProConstants.CP_GOOGLE_PAY_PACKAGE_NAME);
            return;
        }
        if ((paymentOption != PaymentOption.UPI_INTENT && paymentOption != PaymentOption.UPI_INTENT_TPV) || isFinishing() || isDestroyed() || this.j.booleanValue()) {
            return;
        }
        if (this.i.getPackageNameForSpecificApp() != null && this.i.getPackageNameForSpecificApp().length() > 0) {
            String packageNameForSpecificApp = this.i.getPackageNameForSpecificApp();
            String packageNameForSpecificApp2 = this.i.getPackageNameForSpecificApp();
            try {
                PackageInfo packageInfo = getPackageManager().getPackageInfo(packageNameForSpecificApp2, 0);
                com.payu.upisdk.util.a.a("PackageName: " + packageNameForSpecificApp2 + " App version: " + packageInfo.versionName);
                str = packageInfo.versionName;
            } catch (PackageManager.NameNotFoundException e2) {
                e2.printStackTrace();
                str = "";
            }
            a(packageNameForSpecificApp, str);
            return;
        }
        p = fVar.b;
        this.d = new ArrayList<>();
        List<com.payu.upisdk.upiintent.a> list = fVar.i;
        if (list != null && list.size() > 0) {
            for (com.payu.upisdk.upiintent.a aVar : fVar.i) {
                Iterator<com.payu.upisdk.upiintent.a> it = this.c.iterator();
                while (it.hasNext()) {
                    com.payu.upisdk.upiintent.a next = it.next();
                    if (next.equals(aVar)) {
                        next.a = aVar.a;
                        this.d.add(next);
                        it.remove();
                    }
                }
            }
        }
        ArrayList<com.payu.upisdk.upiintent.a> arrayList2 = this.d;
        if (arrayList2 != null && (arrayList = this.c) != null) {
            arrayList2.addAll(arrayList);
        }
        ArrayList<com.payu.upisdk.upiintent.a> arrayList3 = this.d;
        UpiConfig upiConfig = this.i;
        com.payu.upisdk.a aVar2 = new com.payu.upisdk.a();
        Bundle bundle = new Bundle();
        bundle.putParcelableArrayList("list", arrayList3);
        bundle.putParcelable("cb_config", upiConfig);
        bundle.putParcelable("paymentResponse", fVar);
        aVar2.setArguments(bundle);
        aVar2.setStyle(0, R.style.UpiSdkFullScreenDialogStyle);
        aVar2.setRetainInstance(true);
        aVar2.show(getSupportFragmentManager(), "packageList");
        this.j = Boolean.TRUE;
    }

    public final void b() {
        WebView webView = this.h;
        if (webView != null) {
            webView.getSettings().setJavaScriptEnabled(true);
            this.h.addJavascriptInterface(new com.payu.upisdk.upi.a(this, this.e, this.i), "PayU");
            this.h.setVisibility(8);
            this.h.setWebViewClient(new a());
        }
    }

    public final void c() {
        if (isFinishing() || isDestroyed()) {
            return;
        }
        if (this.m == null) {
            this.m = new PayUProgressDialog(this, com.payu.upisdk.b.SINGLETON.a);
        }
        this.m.setCancelable(false);
        if (com.payu.upisdk.b.SINGLETON.a != null || isFinishing() || isDestroyed()) {
            return;
        }
        this.m.setPayUDialogSettings(this);
        this.m.show();
    }

    @Override
    public void errorReceived(int i, String str) {
        com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Error Received " + str);
        if (i == 1003) {
            e eVar = this.a;
            if (eVar != null) {
                eVar.a("cancel", UpiConstant.TECHNICAL_ERROR);
                return;
            }
            return;
        }
        PayUUPICallback payUUPICallback = com.payu.upisdk.b.SINGLETON.f;
        if (payUUPICallback != null) {
            payUUPICallback.onUpiErrorReceived(i, str);
        } else {
            com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Upi callback class should not be null onPaymentSuccess");
        }
    }

    @Override
    public void getSocketResult(String str, String str2, String str3, boolean z) {
        if (str3.equals("success")) {
            com.payu.upisdk.b bVar = com.payu.upisdk.b.SINGLETON;
            if (bVar.f != null) {
                this.e.log(com.payu.upisdk.util.c.a(getApplicationContext(), "trxn_status_upi_sdk", "success_transaction", this.i.getMerchantKey(), this.i.getTransactionID()));
                bVar.f.onPaymentSuccess(str2, null);
            } else {
                com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Upi callback class should not be null onPaymentSuccess");
            }
        } else {
            com.payu.upisdk.b bVar2 = com.payu.upisdk.b.SINGLETON;
            if (bVar2.f != null) {
                this.e.log(com.payu.upisdk.util.c.a(getApplicationContext(), "trxn_status_upi_sdk", "failure_transaction", this.i.getMerchantKey(), this.i.getTransactionID()));
                bVar2.f.onPaymentFailure(str2, null);
            } else {
                com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Upi callback class should not be null onPaymentFailure");
            }
        }
        if (isFinishing() || isDestroyed()) {
            return;
        }
        finish();
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        SocketPaymentResponse socketPaymentResponse;
        PaymentOption paymentOption;
        super.onActivityResult(i, i2, intent);
        if (i == 101) {
            com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Result code " + i2 + " Dataa  " + intent);
            com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Is UpiDisabled ... " + this.k.o.getUpiPushDisabled());
            if (i2 != -1 || intent == null) {
                com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Cancel return");
                this.a.a("cancel", UpiConstant.CUSTOMER_CANCELLED_ON_PSP_APP);
                return;
            }
            String stringExtra = intent.hasExtra("Status") ? intent.getStringExtra("Status") : intent.hasExtra("response") ? com.payu.upisdk.util.c.a(intent.getStringExtra("response")).get("Status") : null;
            if (this.e != null && (paymentOption = this.g) != null && paymentOption.getAnalyticsKey() != null) {
                this.e.log(com.payu.upisdk.util.c.a(getApplicationContext(), this.g.getAnalyticsKey().toLowerCase() + "_payment_app_response", stringExtra, this.i.getMerchantKey(), this.i.getTransactionID()));
            }
            if (stringExtra != null && !stringExtra.equalsIgnoreCase("SUCCESS")) {
                com.payu.upisdk.util.a.a("Payment App response " + stringExtra);
                this.l = UpiConstant.GET_RESPONSE_FROM_PSP;
                this.a.a(stringExtra, UpiConstant.GET_RESPONSE_FROM_PSP);
                return;
            }
            String str = this.l;
            this.e.log(com.payu.upisdk.util.c.a(getApplicationContext(), "upi_socket", UpiConstant.PUSH_ENABLED, this.i.getMerchantKey(), this.i.getTransactionID()));
            f fVar = this.k;
            if (fVar == null || (socketPaymentResponse = fVar.o) == null || socketPaymentResponse.getUpiPushDisabled() == null || !this.k.o.getUpiPushDisabled().equals("0")) {
                this.e.log(com.payu.upisdk.util.c.a(getApplicationContext(), "long_polling_from", "verify_using_http", this.i.getMerchantKey(), this.i.getTransactionID()));
                this.a.a(UpiConstant.FAILURE, str);
            } else {
                this.e.log(com.payu.upisdk.util.c.a(getApplicationContext(), UpiConstant.VERIFY_TYPE, UpiConstant.SOCKET, this.i.getMerchantKey(), this.i.getTransactionID()));
                SocketPaymentResponse socketPaymentResponse2 = new SocketPaymentResponse();
                this.n = socketPaymentResponse2;
                f fVar2 = this.k;
                if (fVar2 != null) {
                    socketPaymentResponse2.setReferenceId(fVar2.d);
                    UpiConfig upiConfig = this.i;
                    if (upiConfig != null && upiConfig.getTransactionID() != null) {
                        this.n.setTxnId(this.i.getTransactionID());
                    }
                    this.n.setUpiPushDisabled(this.k.o.getUpiPushDisabled());
                    this.n.setUpiServicePollInterval(this.k.o.getUpiServicePollInterval());
                    this.n.setSdkUpiPushExpiry(this.k.o.getSdkUpiPushExpiry());
                    this.n.setSdkUpiVerificationInterval(this.k.o.getSdkUpiVerificationInterval());
                    this.n.setPushServiceUrl(this.k.o.getPushServiceUrl());
                }
                SocketPaymentResponse socketPaymentResponse3 = this.n;
                if (socketPaymentResponse3 != null && socketPaymentResponse3.getTxnId() != null) {
                    SocketHandler.getInstance().createSocket(this.n, this, this);
                }
            }
            com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Return " + UpiConstant.FAILURE);
        }
    }

    public void onBackPressed() {
        g gVar = new g(this);
        if (isFinishing() || isDestroyed()) {
            return;
        }
        String string = getString(R.string.do_you_really_want_to_cancel_the_transaction);
        AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.upi_sdk_dialog);
        if (string != null) {
            builder.setMessage(string);
        }
        builder.setPositiveButton("Ok", gVar);
        builder.setNegativeButton("Cancel", gVar);
        PayUUPICallback payUUPICallback = com.payu.upisdk.b.SINGLETON.f;
        if (payUUPICallback != null) {
            payUUPICallback.onBackButton(builder);
            AlertDialog create = builder.create();
            this.o = create;
            create.show();
        }
    }

    public void onCreate(Bundle bundle) {
        char c;
        PayUAnalytics payUAnalytics;
        String str;
        super.onCreate(bundle);
        if (getIntent() == null || getIntent().getExtras() == null) {
            return;
        }
        this.i = (UpiConfig) getIntent().getExtras().getParcelable(UpiConstant.UPI_CONFIG);
        SocketHandler.getInstance().onActivityCreated(this, this);
        if (bundle != null) {
            if (bundle.get(UpiConstant.IS_UPI_APP_ALREADY_OPENED) != null) {
                this.j = Boolean.valueOf(bundle.getBoolean(UpiConstant.IS_UPI_APP_ALREADY_OPENED));
            }
            if (bundle.get(UpiConstant.UPI_CONFIG) != null) {
                this.i = (UpiConfig) bundle.getParcelable(UpiConstant.UPI_CONFIG);
            }
            if (bundle.get(UpiConstant.PAYMENT_RESPONSE) != null) {
                this.k = (f) bundle.getParcelable(UpiConstant.PAYMENT_RESPONSE);
            }
        }
        UpiConfig upiConfig = this.i;
        if (upiConfig != null) {
            this.b = upiConfig.getPayuPostData();
            this.f = this.i.getPaymentType();
            this.i.setProgressDialogCustomView(com.payu.upisdk.b.SINGLETON.a);
            if ("upi".equalsIgnoreCase(this.f) || UpiConstant.UPI_COLLECT_GENERIC.equalsIgnoreCase(this.f)) {
                setTheme(R.style.upi_sdk_opaque_screen);
            }
            setContentView(R.layout.activity_payment_response);
            this.e = (PayUAnalytics) new AnalyticsFactory(getApplicationContext()).getAnalyticsClass(AnalyticsType.PAYU_ANALYTICS);
            this.h = (WebView) findViewById(R.id.wvCollect);
            this.e.log(com.payu.upisdk.util.c.a(getApplicationContext(), UpiConstant.PAYMENT_OPTION, this.f.toLowerCase(), this.i.getMerchantKey(), this.i.getTransactionID()));
            String lowerCase = this.f.toLowerCase();
            lowerCase.hashCode();
            switch (lowerCase.hashCode()) {
                case -1183762788:
                    if (lowerCase.equals(UpiConstant.UPI_INTENT_S)) {
                        c = 0;
                        break;
                    }
                    c = 65535;
                    break;
                case -1183748309:
                    if (lowerCase.equals(UpiConstant.UPI_INTENT_TPV)) {
                        c = 1;
                        break;
                    }
                    c = 65535;
                    break;
                case -876960591:
                    if (lowerCase.equals(UpiConstant.TEZ_TPV)) {
                        c = 2;
                        break;
                    }
                    c = 65535;
                    break;
                case -838679156:
                    if (lowerCase.equals(UpiConstant.UPI_COLLECT_TPV)) {
                        c = 3;
                        break;
                    }
                    c = 65535;
                    break;
                case 116014:
                    if (lowerCase.equals("upi")) {
                        c = 4;
                        break;
                    }
                    c = 65535;
                    break;
                case 1149331398:
                    if (lowerCase.equals(UpiConstant.UPI_COLLECT_GENERIC)) {
                        c = 5;
                        break;
                    }
                    c = 65535;
                    break;
                default:
                    c = 65535;
                    break;
            }
            switch (c) {
                case 0:
                case 1:
                    if (this.f.equalsIgnoreCase(UpiConstant.UPI_INTENT_TPV)) {
                        this.g = PaymentOption.UPI_INTENT_TPV;
                    } else {
                        this.g = PaymentOption.UPI_INTENT;
                    }
                    if (!isFinishing() && !isDestroyed()) {
                        f fVar = this.k;
                        if (fVar != null && (str = fVar.j) != null) {
                            this.a = new e(this, this.b, str);
                        }
                        if (!this.j.booleanValue()) {
                            this.a = new e(this, this.b);
                            this.c = new ArrayList<>();
                            Intent intent = new Intent();
                            intent.setData(Uri.parse(PayUCheckoutProConstants.CP_UPI_INTENT_PREFIX));
                            for (ResolveInfo resolveInfo : getPackageManager().queryIntentActivities(intent, 65536)) {
                                try {
                                    com.payu.upisdk.util.a.a("UPI Installed App....... " + resolveInfo.activityInfo.packageName);
                                    PackageInfo packageInfo = getPackageManager().getPackageInfo(resolveInfo.activityInfo.packageName, 0);
                                    this.c.add(new com.payu.upisdk.upiintent.a((String) getPackageManager().getApplicationLabel(packageInfo.applicationInfo), packageInfo.packageName));
                                } catch (PackageManager.NameNotFoundException e) {
                                    e.printStackTrace();
                                }
                            }
                            e eVar = this.a;
                            eVar.a();
                            PayUNetworkAsyncTaskData payUNetworkAsyncTaskData = new PayUNetworkAsyncTaskData();
                            payUNetworkAsyncTaskData.setHttpMethod("POST");
                            payUNetworkAsyncTaskData.setPostData(eVar.b.concat("&txn_s2s_flow=2"));
                            com.payu.upisdk.b bVar = com.payu.upisdk.b.SINGLETON;
                            UpiConfig upiConfig2 = bVar.c;
                            if (upiConfig2 != null) {
                                payUNetworkAsyncTaskData.setUrl(upiConfig2.getPostUrl());
                                new PayUNetworkAsyncTask(eVar, UpiConstant.INITIATE).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, payUNetworkAsyncTaskData);
                                break;
                            } else {
                                PayUUPICallback payUUPICallback = bVar.f;
                                if (payUUPICallback != null) {
                                    payUUPICallback.onUpiErrorReceived(1022, UpiConstant.PROVIDED_UPI_CONFIG_NULL + e.class.getSimpleName());
                                    break;
                                }
                            }
                        }
                    }
                    break;
                case 2:
                case 3:
                case 4:
                    b();
                    if (this.f.equalsIgnoreCase(UpiConstant.UPI_COLLECT_TPV)) {
                        this.g = PaymentOption.UPI_COLLECT_TPV;
                    } else if (this.f.equalsIgnoreCase(UpiConstant.TEZ_TPV)) {
                        this.g = PaymentOption.TEZ_TPV;
                    } else {
                        this.g = PaymentOption.UPI_COLLECT;
                    }
                    com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Payment Started for UpiCollect >>> " + this.g.getPackageName());
                    com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "PostDataUpiSdk " + this.b);
                    c();
                    b(this.i.getPostUrl(), this.b);
                    break;
                case 5:
                    Upi.isRecreating = true;
                    b();
                    c();
                    this.g = PaymentOption.UPI_COLLECT_GENERIC;
                    com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Payment Started for UpiCollect >>> " + this.g.getPackageName());
                    if (getIntent() != null && getIntent().getExtras() != null && getIntent().getStringExtra(UpiConstant.POST_DATA_UPI_COLLECT_GENERIC) != null && getIntent().getStringExtra("returnUrl") != null) {
                        String string = getIntent().getExtras().getString(UpiConstant.POST_DATA_UPI_COLLECT_GENERIC);
                        String stringExtra = getIntent().getStringExtra("returnUrl");
                        p = stringExtra;
                        b(stringExtra, string);
                        break;
                    }
                    break;
            }
            PaymentOption paymentOption = this.g;
            if (paymentOption == null || paymentOption.getAnalyticsKey() == null || (payUAnalytics = this.e) == null) {
                return;
            }
            payUAnalytics.log(com.payu.upisdk.util.c.a(getApplicationContext(), this.g.getAnalyticsKey().toLowerCase(), this.g.getAnalyticsKey().toLowerCase() + UpiConstant.LAUNCHED, this.i.getMerchantKey(), this.i.getTransactionID()));
        }
    }

    public void onDestroy() {
        super.onDestroy();
        com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "OnDestroy ");
        SocketHandler.getInstance().onActivityDestroyed(this);
        e eVar = this.a;
        if (eVar != null) {
            PayUProgressDialog payUProgressDialog = eVar.c;
            if (payUProgressDialog != null && !payUProgressDialog.isShowing()) {
                eVar.c.dismiss();
                eVar.c = null;
            }
            eVar.a = null;
        }
        AlertDialog alertDialog = this.o;
        if (alertDialog != null) {
            alertDialog.dismiss();
        }
        PayUProgressDialog payUProgressDialog2 = this.m;
        if (payUProgressDialog2 != null) {
            if (payUProgressDialog2.isShowing()) {
                this.m.dismiss();
            }
            this.m = null;
        }
        com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Is recreating " + Upi.isRecreating);
        if (Upi.isRecreating) {
            Upi.isRecreating = false;
            return;
        }
        PayUUPICallback payUUPICallback = com.payu.upisdk.b.SINGLETON.f;
        if (payUUPICallback != null) {
            payUUPICallback.onPaymentTerminate();
        }
    }

    public void onPause() {
        super.onPause();
        SocketHandler.getInstance().onActivityPaused(this);
    }

    public void onRestoreInstanceState(Bundle bundle) {
        super.onRestoreInstanceState(bundle);
        this.i = (UpiConfig) bundle.getParcelable(UpiConstant.UPI_CONFIG);
        this.k = (f) bundle.getParcelable(UpiConstant.PAYMENT_RESPONSE);
        this.j = Boolean.valueOf(bundle.getBoolean(UpiConstant.IS_UPI_APP_ALREADY_OPENED));
    }

    public void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        bundle.putParcelable(UpiConstant.UPI_CONFIG, this.i);
        bundle.putParcelable(UpiConstant.PAYMENT_RESPONSE, this.k);
        bundle.putBoolean(UpiConstant.IS_UPI_APP_ALREADY_OPENED, this.j.booleanValue());
    }

    @Override
    public void onSocketCreated() {
        SocketHandler.getInstance().startSocketEvents(this.i.getMerchantKey(), this.i.getTransactionID(), this, this.i.getProgressDialogCustomView());
    }

    @Override
    public void transactionCancelled() {
        a(true, UpiConstant.CUSTOMER_CANCELLED_ON_PSP_APP);
    }

    public final void b(String str, String str2) {
        com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "URL web " + str);
        com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + "Postdata web " + str2);
        if (this.h != null) {
            getWindow().setLayout(-1, -1);
            this.h.setVisibility(0);
            this.h.postUrl(str, str2.getBytes());
        }
    }

    @Override
    public void a(String str, String str2) {
        PaymentOption paymentOption;
        PayUAnalytics payUAnalytics;
        if (this.i != null && (paymentOption = this.g) != null && paymentOption.getAnalyticsKey() != null && (payUAnalytics = this.e) != null) {
            payUAnalytics.log(com.payu.upisdk.util.c.a(getApplicationContext(), this.g.getAnalyticsKey().toLowerCase() + "_payment_app", str + "_" + str2, this.i.getMerchantKey(), this.i.getTransactionID()));
        }
        this.a.a(str);
    }

    @Override
    public void a(boolean z, String str) {
        PaymentOption paymentOption;
        PayUAnalytics payUAnalytics;
        PaymentOption paymentOption2;
        PayUAnalytics payUAnalytics2;
        if (z) {
            if (this.i != null && (paymentOption2 = this.g) != null && paymentOption2.getAnalyticsKey() != null && (payUAnalytics2 = this.e) != null) {
                payUAnalytics2.log(com.payu.upisdk.util.c.a(getApplicationContext(), this.g.getAnalyticsKey().toLowerCase(), "back_button_cancel", this.i.getMerchantKey(), this.i.getTransactionID()));
            }
            this.a.a("cancel", str);
            return;
        }
        if (this.i != null && (paymentOption = this.g) != null && paymentOption.getAnalyticsKey() != null && (payUAnalytics = this.e) != null) {
            payUAnalytics.log(com.payu.upisdk.util.c.a(getApplicationContext(), this.g.getAnalyticsKey().toLowerCase(), "No Upi apps present and collect disabled.", this.i.getMerchantKey(), this.i.getTransactionID()));
        }
        this.a.a(Constants.FAILURE, "No Upi apps present and collect disabled.");
    }

    public final void a() {
        com.payu.upisdk.util.a.a("Class Name: " + getClass().getCanonicalName() + " Err 1002");
        PayUUPICallback payUUPICallback = com.payu.upisdk.b.SINGLETON.f;
        if (payUUPICallback != null) {
            payUUPICallback.onUpiErrorReceived(1002, "MERCHANT_INFO_NOT_PRESENT");
        }
        if (isFinishing() || isDestroyed()) {
            return;
        }
        finish();
    }
}