导航菜单

页面标题

页面副标题

Rilo v2.0.21 - StripePaymentController.java 源代码

正在查看: Rilo v2.0.21 应用的 StripePaymentController.java JAVA 源代码文件

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


package com.stripe.android;

import android.content.Context;
import android.content.Intent;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultCaller;
import androidx.activity.result.ActivityResultLauncher;
import com.google.android.instantapps.InstantApps;
import com.google.firebase.messaging.Constants;
import com.stripe.android.PaymentController;
import com.stripe.android.PaymentRelayStarter;
import com.stripe.android.core.Logger;
import com.stripe.android.core.injection.NamedConstantsKt;
import com.stripe.android.core.networking.AnalyticsRequestExecutor;
import com.stripe.android.core.networking.ApiRequest;
import com.stripe.android.core.networking.RequestHeadersFactory;
import com.stripe.android.model.ConfirmPaymentIntentParams;
import com.stripe.android.model.ConfirmSetupIntentParams;
import com.stripe.android.model.ConfirmStripeIntentParams;
import com.stripe.android.model.PaymentIntent;
import com.stripe.android.model.Source;
import com.stripe.android.model.StripeIntent;
import com.stripe.android.model.Token;
import com.stripe.android.networking.AlipayRepository;
import com.stripe.android.networking.PaymentAnalyticsEvent;
import com.stripe.android.networking.PaymentAnalyticsRequestFactory;
import com.stripe.android.networking.StripeRepository;
import com.stripe.android.payments.DefaultReturnUrl;
import com.stripe.android.payments.PaymentFlowFailureMessageFactory;
import com.stripe.android.payments.PaymentFlowResult;
import com.stripe.android.payments.PaymentIntentFlowResultProcessor;
import com.stripe.android.payments.SetupIntentFlowResultProcessor;
import com.stripe.android.payments.core.authentication.DefaultPaymentAuthenticatorRegistry;
import com.stripe.android.payments.core.authentication.PaymentAuthenticatorRegistry;
import com.stripe.android.view.AuthActivityStarterHost;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import kotlin.Metadata;
import kotlin.NoWhenBranchMatchedException;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.jvm.JvmStatic;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.BuildersKt;

@Metadata(d1 = {"\u0000\u008e\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010%\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0000\u0018\u0000 t2\u00020\u0001:\u0001tB_\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005\u0012\u0006\u0010\u0007\u001a\u00020\b\u0012\b\b\u0002\u0010\t\u001a\u00020\n\u0012\b\b\u0002\u0010\u000b\u001a\u00020\f\u0012\b\b\u0002\u0010\r\u001a\u00020\u000e\u0012\b\b\u0002\u0010\u000f\u001a\u00020\u0010\u0012\b\b\u0002\u0010\u0011\u001a\u00020\u0012\u0012\b\b\u0002\u0010\u0013\u001a\u00020\f¢\u0006\u0002\u0010\u0014J:\u0010)\u001a\b\u0012\u0004\u0012\u00020+0*2\u0006\u0010,\u001a\u00020-2\u0006\u0010.\u001a\u00020/2\u0006\u00100\u001a\u000201H\u0082@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\b2\u00103J:\u00104\u001a\b\u0012\u0004\u0012\u00020+0*2\u0006\u00105\u001a\u0002062\u0006\u0010.\u001a\u00020/2\u0006\u00100\u001a\u000201H\u0096@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\b7\u00108J2\u00109\u001a\b\u0012\u0004\u0012\u00020-0*2\u0006\u0010:\u001a\u0002062\u0006\u00100\u001a\u000201H\u0082@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\b;\u0010<J2\u0010=\u001a\b\u0012\u0004\u0012\u00020>0*2\u0006\u0010:\u001a\u00020?2\u0006\u00100\u001a\u000201H\u0082@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\b@\u0010AJ2\u0010B\u001a\b\u0012\u0004\u0012\u00020C0*2\u0006\u00105\u001a\u0002062\u0006\u00100\u001a\u000201H\u0096@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\bD\u0010<J*\u0010E\u001a\b\u0012\u0004\u0012\u00020F0*2\u0006\u0010G\u001a\u00020HH\u0096@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\bI\u0010JJ*\u0010K\u001a\b\u0012\u0004\u0012\u00020+0*2\u0006\u0010G\u001a\u00020HH\u0096@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\bL\u0010JJ*\u0010M\u001a\b\u0012\u0004\u0012\u00020N0*2\u0006\u0010G\u001a\u00020HH\u0096@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\bO\u0010JJ)\u0010P\u001a\u00020Q2\u0006\u0010R\u001a\u00020#2\u0006\u0010S\u001a\u00020T2\u0006\u0010U\u001a\u00020VH\u0082@ø\u0001\u0002¢\u0006\u0002\u0010WJ)\u0010X\u001a\u00020Q2\u0006\u0010R\u001a\u00020#2\u0006\u0010Y\u001a\u00020Z2\u0006\u00100\u001a\u000201H\u0097@ø\u0001\u0002¢\u0006\u0002\u0010[J\u0012\u0010\\\u001a\u00020Q2\b\u0010]\u001a\u0004\u0018\u00010\u0006H\u0002J)\u0010^\u001a\u00020Q2\u0006\u0010R\u001a\u00020#2\u0006\u0010_\u001a\u00020F2\u0006\u00100\u001a\u000201H\u0082@ø\u0001\u0002¢\u0006\u0002\u0010`J\u001e\u0010a\u001a\u00020Q2\u0006\u0010b\u001a\u00020c2\f\u0010d\u001a\b\u0012\u0004\u0012\u00020f0eH\u0016J\u001a\u0010g\u001a\u00020\n2\u0006\u0010S\u001a\u00020T2\b\u0010G\u001a\u0004\u0018\u00010HH\u0016J\u001a\u0010h\u001a\u00020\n2\u0006\u0010S\u001a\u00020T2\b\u0010G\u001a\u0004\u0018\u00010HH\u0016J\u001a\u0010i\u001a\u00020\n2\u0006\u0010S\u001a\u00020T2\b\u0010G\u001a\u0004\u0018\u00010HH\u0016J1\u0010j\u001a\u00020Q2\u0006\u0010R\u001a\u00020#2\u0006\u0010k\u001a\u00020\u00062\u0006\u00100\u001a\u0002012\u0006\u0010l\u001a\u00020mH\u0096@ø\u0001\u0002¢\u0006\u0002\u0010nJ)\u0010o\u001a\u00020Q2\u0006\u0010R\u001a\u00020#2\u0006\u0010_\u001a\u00020F2\u0006\u00100\u001a\u000201H\u0096@ø\u0001\u0002¢\u0006\u0002\u0010`J)\u0010p\u001a\u00020Q2\u0006\u0010R\u001a\u00020#2\u0006\u0010:\u001a\u00020q2\u0006\u00100\u001a\u000201H\u0096@ø\u0001\u0002¢\u0006\u0002\u0010rJ\b\u0010s\u001a\u00020QH\u0016R\u000e\u0010\u0011\u001a\u00020\u0012X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0015\u001a\u00020\u0016X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0017\u001a\u00020\u0018X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\nX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0019\u001a\u00020\u001aX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u001b\u001a\u00020\nX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\u0010X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u001c\u001a\u00020\u001dX\u0082\u0004¢\u0006\u0002\n\u0000R\u0016\u0010\u001e\u001a\n\u0012\u0004\u0012\u00020 \u0018\u00010\u001fX\u0082\u000e¢\u0006\u0002\n\u0000R\u001a\u0010!\u001a\u000e\u0012\u0004\u0012\u00020#\u0012\u0004\u0012\u00020$0\"X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010%\u001a\u00020&X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u001a\u0010'\u001a\u000e\u0012\u0004\u0012\u00020\u0006\u0012\u0004\u0012\u00020\u00060(X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0013\u001a\u00020\fX\u0082\u0004¢\u0006\u0002\n\u0000\u0082\u0002\u000f\n\u0002\b!\n\u0005\b¡\u001e0\u0001\n\u0002\b\u0019¨\u0006u"}, d2 = {"Lcom/stripe/android/StripePaymentController;", "Lcom/stripe/android/PaymentController;", "context", "Landroid/content/Context;", "publishableKeyProvider", "Lkotlin/Function0;", "", "stripeRepository", "Lcom/stripe/android/networking/StripeRepository;", NamedConstantsKt.ENABLE_LOGGING, "", "workContext", "Lkotlin/coroutines/CoroutineContext;", "analyticsRequestExecutor", "Lcom/stripe/android/core/networking/AnalyticsRequestExecutor;", "paymentAnalyticsRequestFactory", "Lcom/stripe/android/networking/PaymentAnalyticsRequestFactory;", "alipayRepository", "Lcom/stripe/android/networking/AlipayRepository;", "uiContext", "(Landroid/content/Context;Lkotlin/jvm/functions/Function0;Lcom/stripe/android/networking/StripeRepository;ZLkotlin/coroutines/CoroutineContext;Lcom/stripe/android/core/networking/AnalyticsRequestExecutor;Lcom/stripe/android/networking/PaymentAnalyticsRequestFactory;Lcom/stripe/android/networking/AlipayRepository;Lkotlin/coroutines/CoroutineContext;)V", "authenticatorRegistry", "Lcom/stripe/android/payments/core/authentication/PaymentAuthenticatorRegistry;", "defaultReturnUrl", "Lcom/stripe/android/payments/DefaultReturnUrl;", "failureMessageFactory", "Lcom/stripe/android/payments/PaymentFlowFailureMessageFactory;", "isInstantApp", "paymentIntentFlowResultProcessor", "Lcom/stripe/android/payments/PaymentIntentFlowResultProcessor;", "paymentRelayLauncher", "Landroidx/activity/result/ActivityResultLauncher;", "Lcom/stripe/android/PaymentRelayStarter$Args;", "paymentRelayStarterFactory", "Lkotlin/Function1;", "Lcom/stripe/android/view/AuthActivityStarterHost;", "Lcom/stripe/android/PaymentRelayStarter;", "setupIntentFlowResultProcessor", "Lcom/stripe/android/payments/SetupIntentFlowResultProcessor;", "threeDs1IntentReturnUrlMap", "", "authenticateAlipay", "Lkotlin/Result;", "Lcom/stripe/android/PaymentIntentResult;", "paymentIntent", "Lcom/stripe/android/model/PaymentIntent;", "authenticator", "Lcom/stripe/android/AlipayAuthenticator;", "requestOptions", "Lcom/stripe/android/core/networking/ApiRequest$Options;", "authenticateAlipay-BWLJW6A", "(Lcom/stripe/android/model/PaymentIntent;Lcom/stripe/android/AlipayAuthenticator;Lcom/stripe/android/core/networking/ApiRequest$Options;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "confirmAndAuthenticateAlipay", "confirmPaymentIntentParams", "Lcom/stripe/android/model/ConfirmPaymentIntentParams;", "confirmAndAuthenticateAlipay-BWLJW6A", "(Lcom/stripe/android/model/ConfirmPaymentIntentParams;Lcom/stripe/android/AlipayAuthenticator;Lcom/stripe/android/core/networking/ApiRequest$Options;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "confirmPaymentIntent", "confirmStripeIntentParams", "confirmPaymentIntent-0E7RQCE", "(Lcom/stripe/android/model/ConfirmPaymentIntentParams;Lcom/stripe/android/core/networking/ApiRequest$Options;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "confirmSetupIntent", "Lcom/stripe/android/model/SetupIntent;", "Lcom/stripe/android/model/ConfirmSetupIntentParams;", "confirmSetupIntent-0E7RQCE", "(Lcom/stripe/android/model/ConfirmSetupIntentParams;Lcom/stripe/android/core/networking/ApiRequest$Options;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "confirmWeChatPay", "Lcom/stripe/android/model/WeChatPayNextAction;", "confirmWeChatPay-0E7RQCE", "getAuthenticateSourceResult", "Lcom/stripe/android/model/Source;", Constants.ScionAnalytics.MessageType.DATA_MESSAGE, "Landroid/content/Intent;", "getAuthenticateSourceResult-gIAlu-s", "(Landroid/content/Intent;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "getPaymentIntentResult", "getPaymentIntentResult-gIAlu-s", "getSetupIntentResult", "Lcom/stripe/android/SetupIntentResult;", "getSetupIntentResult-gIAlu-s", "handleError", "", "host", "requestCode", "", "throwable", "", "(Lcom/stripe/android/view/AuthActivityStarterHost;ILjava/lang/Throwable;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "handleNextAction", "stripeIntent", "Lcom/stripe/android/model/StripeIntent;", "(Lcom/stripe/android/view/AuthActivityStarterHost;Lcom/stripe/android/model/StripeIntent;Lcom/stripe/android/core/networking/ApiRequest$Options;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "logReturnUrl", "returnUrl", "onSourceRetrieved", "source", "(Lcom/stripe/android/view/AuthActivityStarterHost;Lcom/stripe/android/model/Source;Lcom/stripe/android/core/networking/ApiRequest$Options;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "registerLaunchersWithActivityResultCaller", "activityResultCaller", "Landroidx/activity/result/ActivityResultCaller;", "activityResultCallback", "Landroidx/activity/result/ActivityResultCallback;", "Lcom/stripe/android/payments/PaymentFlowResult$Unvalidated;", "shouldHandlePaymentResult", "shouldHandleSetupResult", "shouldHandleSourceResult", "startAuth", "clientSecret", RequestHeadersFactory.TYPE, "Lcom/stripe/android/PaymentController$StripeIntentType;", "(Lcom/stripe/android/view/AuthActivityStarterHost;Ljava/lang/String;Lcom/stripe/android/core/networking/ApiRequest$Options;Lcom/stripe/android/PaymentController$StripeIntentType;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "startAuthenticateSource", "startConfirmAndAuth", "Lcom/stripe/android/model/ConfirmStripeIntentParams;", "(Lcom/stripe/android/view/AuthActivityStarterHost;Lcom/stripe/android/model/ConfirmStripeIntentParams;Lcom/stripe/android/core/networking/ApiRequest$Options;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "unregisterLaunchers", "Companion", "payments-core_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class StripePaymentController implements PaymentController {
    public static final int PAYMENT_REQUEST_CODE = 50000;
    public static final int SETUP_REQUEST_CODE = 50001;
    public static final int SOURCE_REQUEST_CODE = 50002;
    private final AlipayRepository alipayRepository;
    private final AnalyticsRequestExecutor analyticsRequestExecutor;
    private final PaymentAuthenticatorRegistry authenticatorRegistry;
    private final DefaultReturnUrl defaultReturnUrl;
    private final boolean enableLogging;
    private final PaymentFlowFailureMessageFactory failureMessageFactory;
    private final boolean isInstantApp;
    private final PaymentAnalyticsRequestFactory paymentAnalyticsRequestFactory;
    private final PaymentIntentFlowResultProcessor paymentIntentFlowResultProcessor;
    private ActivityResultLauncher<PaymentRelayStarter.Args> paymentRelayLauncher;
    private final Function1<AuthActivityStarterHost, PaymentRelayStarter> paymentRelayStarterFactory;
    private final Function0<String> publishableKeyProvider;
    private final SetupIntentFlowResultProcessor setupIntentFlowResultProcessor;
    private final StripeRepository stripeRepository;
    private final Map<String, String> threeDs1IntentReturnUrlMap;
    private final CoroutineContext uiContext;

    public static final Companion INSTANCE = new Companion(null);
    private static final List<String> EXPAND_PAYMENT_METHOD = CollectionsKt.listOf("payment_method");
    private static final long CHALLENGE_DELAY = TimeUnit.SECONDS.toMillis(2);

    @Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
    public class WhenMappings {
        public static final int[] $EnumSwitchMapping$0;

        static {
            int[] iArr = new int[PaymentController.StripeIntentType.values().length];
            try {
                iArr[PaymentController.StripeIntentType.PaymentIntent.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[PaymentController.StripeIntentType.SetupIntent.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            $EnumSwitchMapping$0 = iArr;
        }
    }

    @JvmStatic
    public static final PaymentController create(Context context, String str, StripeRepository stripeRepository) {
        return INSTANCE.create(context, str, stripeRepository);
    }

    @JvmStatic
    public static final PaymentController create(Context context, String str, StripeRepository stripeRepository, boolean z) {
        return INSTANCE.create(context, str, stripeRepository, z);
    }

    @Override
    public boolean shouldHandlePaymentResult(int requestCode, Intent data) {
        return requestCode == 50000 && data != null;
    }

    @Override
    public boolean shouldHandleSetupResult(int requestCode, Intent data) {
        return requestCode == 50001 && data != null;
    }

    @Override
    public boolean shouldHandleSourceResult(int requestCode, Intent data) {
        return requestCode == 50002 && data != null;
    }

    public StripePaymentController(Context context, Function0<String> function0, StripeRepository stripeRepository, boolean z, CoroutineContext coroutineContext, AnalyticsRequestExecutor analyticsRequestExecutor, PaymentAnalyticsRequestFactory paymentAnalyticsRequestFactory, AlipayRepository alipayRepository, CoroutineContext coroutineContext2) {
        Intrinsics.checkNotNullParameter(context, "context");
        Intrinsics.checkNotNullParameter(function0, "publishableKeyProvider");
        Intrinsics.checkNotNullParameter(stripeRepository, "stripeRepository");
        Intrinsics.checkNotNullParameter(coroutineContext, "workContext");
        Intrinsics.checkNotNullParameter(analyticsRequestExecutor, "analyticsRequestExecutor");
        Intrinsics.checkNotNullParameter(paymentAnalyticsRequestFactory, "paymentAnalyticsRequestFactory");
        Intrinsics.checkNotNullParameter(alipayRepository, "alipayRepository");
        Intrinsics.checkNotNullParameter(coroutineContext2, "uiContext");
        this.publishableKeyProvider = function0;
        this.stripeRepository = stripeRepository;
        this.enableLogging = z;
        this.analyticsRequestExecutor = analyticsRequestExecutor;
        this.paymentAnalyticsRequestFactory = paymentAnalyticsRequestFactory;
        this.alipayRepository = alipayRepository;
        this.uiContext = coroutineContext2;
        this.failureMessageFactory = new PaymentFlowFailureMessageFactory(context);
        this.paymentIntentFlowResultProcessor = new PaymentIntentFlowResultProcessor(context, function0, stripeRepository, Logger.INSTANCE.getInstance(z), coroutineContext);
        this.setupIntentFlowResultProcessor = new SetupIntentFlowResultProcessor(context, function0, stripeRepository, Logger.INSTANCE.getInstance(z), coroutineContext);
        this.defaultReturnUrl = DefaultReturnUrl.Companion.create(context);
        boolean isInstantApp = InstantApps.isInstantApp(context);
        this.isInstantApp = isInstantApp;
        this.paymentRelayStarterFactory = new Function1<AuthActivityStarterHost, PaymentRelayStarter>() {
            {
                super(1);
            }

            public final PaymentRelayStarter invoke(AuthActivityStarterHost authActivityStarterHost) {
                ActivityResultLauncher activityResultLauncher;
                Intrinsics.checkNotNullParameter(authActivityStarterHost, "host");
                activityResultLauncher = StripePaymentController.this.paymentRelayLauncher;
                if (activityResultLauncher != null) {
                    return new PaymentRelayStarter.Modern(activityResultLauncher);
                }
                return new PaymentRelayStarter.Legacy(authActivityStarterHost);
            }
        };
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        this.threeDs1IntentReturnUrlMap = linkedHashMap;
        this.authenticatorRegistry = DefaultPaymentAuthenticatorRegistry.Companion.createInstance(context, paymentAnalyticsRequestFactory, z, coroutineContext, coroutineContext2, linkedHashMap, function0, paymentAnalyticsRequestFactory.getDefaultProductUsageTokens$payments_core_release(), isInstantApp, false);
    }

    public StripePaymentController(android.content.Context r13, final kotlin.jvm.functions.Function0 r14, com.stripe.android.networking.StripeRepository r15, boolean r16, kotlin.coroutines.CoroutineContext r17, com.stripe.android.core.networking.AnalyticsRequestExecutor r18, com.stripe.android.networking.PaymentAnalyticsRequestFactory r19, com.stripe.android.networking.AlipayRepository r20, kotlin.coroutines.CoroutineContext r21, int r22, kotlin.jvm.internal.DefaultConstructorMarker r23) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.<init>(android.content.Context, kotlin.jvm.functions.Function0, com.stripe.android.networking.StripeRepository, boolean, kotlin.coroutines.CoroutineContext, com.stripe.android.core.networking.AnalyticsRequestExecutor, com.stripe.android.networking.PaymentAnalyticsRequestFactory, com.stripe.android.networking.AlipayRepository, kotlin.coroutines.CoroutineContext, int, kotlin.jvm.internal.DefaultConstructorMarker):void");
    }

    public static final String _init_$lambda$0(Function0 function0) {
        Intrinsics.checkNotNullParameter(function0, "$tmp0");
        return (String) function0.invoke();
    }

    @Override
    public void registerLaunchersWithActivityResultCaller(ActivityResultCaller activityResultCaller, ActivityResultCallback<PaymentFlowResult.Unvalidated> activityResultCallback) {
        Intrinsics.checkNotNullParameter(activityResultCaller, "activityResultCaller");
        Intrinsics.checkNotNullParameter(activityResultCallback, "activityResultCallback");
        this.paymentRelayLauncher = activityResultCaller.registerForActivityResult(new PaymentRelayContract(), activityResultCallback);
        this.authenticatorRegistry.onNewActivityResultCaller(activityResultCaller, activityResultCallback);
    }

    @Override
    public void unregisterLaunchers() {
        ActivityResultLauncher<PaymentRelayStarter.Args> activityResultLauncher = this.paymentRelayLauncher;
        if (activityResultLauncher != null) {
            activityResultLauncher.unregister();
        }
        this.paymentRelayLauncher = null;
        this.authenticatorRegistry.onLauncherInvalidated();
    }

    @Override
    public java.lang.Object startConfirmAndAuth(com.stripe.android.view.AuthActivityStarterHost r10, com.stripe.android.model.ConfirmStripeIntentParams r11, com.stripe.android.core.networking.ApiRequest.Options r12, kotlin.coroutines.Continuation<? super kotlin.Unit> r13) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.startConfirmAndAuth(com.stripe.android.view.AuthActivityStarterHost, com.stripe.android.model.ConfirmStripeIntentParams, com.stripe.android.core.networking.ApiRequest$Options, kotlin.coroutines.Continuation):java.lang.Object");
    }

    @Override
    public java.lang.Object mo365confirmAndAuthenticateAlipayBWLJW6A(com.stripe.android.model.ConfirmPaymentIntentParams r6, com.stripe.android.AlipayAuthenticator r7, com.stripe.android.core.networking.ApiRequest.Options r8, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.PaymentIntentResult>> r9) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.mo365confirmAndAuthenticateAlipayBWLJW6A(com.stripe.android.model.ConfirmPaymentIntentParams, com.stripe.android.AlipayAuthenticator, com.stripe.android.core.networking.ApiRequest$Options, kotlin.coroutines.Continuation):java.lang.Object");
    }

    @Override
    public java.lang.Object mo366confirmWeChatPay0E7RQCE(com.stripe.android.model.ConfirmPaymentIntentParams r5, com.stripe.android.core.networking.ApiRequest.Options r6, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.model.WeChatPayNextAction>> r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.mo366confirmWeChatPay0E7RQCE(com.stripe.android.model.ConfirmPaymentIntentParams, com.stripe.android.core.networking.ApiRequest$Options, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final java.lang.Object m381confirmPaymentIntent0E7RQCE(com.stripe.android.model.ConfirmPaymentIntentParams r5, com.stripe.android.core.networking.ApiRequest.Options r6, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.model.PaymentIntent>> r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.m381confirmPaymentIntent0E7RQCE(com.stripe.android.model.ConfirmPaymentIntentParams, com.stripe.android.core.networking.ApiRequest$Options, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final java.lang.Object m382confirmSetupIntent0E7RQCE(com.stripe.android.model.ConfirmSetupIntentParams r5, com.stripe.android.core.networking.ApiRequest.Options r6, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.model.SetupIntent>> r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.m382confirmSetupIntent0E7RQCE(com.stripe.android.model.ConfirmSetupIntentParams, com.stripe.android.core.networking.ApiRequest$Options, kotlin.coroutines.Continuation):java.lang.Object");
    }

    @Override
    public java.lang.Object startAuth(com.stripe.android.view.AuthActivityStarterHost r18, java.lang.String r19, com.stripe.android.core.networking.ApiRequest.Options r20, com.stripe.android.PaymentController.StripeIntentType r21, kotlin.coroutines.Continuation<? super kotlin.Unit> r22) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.startAuth(com.stripe.android.view.AuthActivityStarterHost, java.lang.String, com.stripe.android.core.networking.ApiRequest$Options, com.stripe.android.PaymentController$StripeIntentType, kotlin.coroutines.Continuation):java.lang.Object");
    }

    @Override
    public java.lang.Object startAuthenticateSource(com.stripe.android.view.AuthActivityStarterHost r18, com.stripe.android.model.Source r19, com.stripe.android.core.networking.ApiRequest.Options r20, kotlin.coroutines.Continuation<? super kotlin.Unit> r21) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.startAuthenticateSource(com.stripe.android.view.AuthActivityStarterHost, com.stripe.android.model.Source, com.stripe.android.core.networking.ApiRequest$Options, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final Object onSourceRetrieved(AuthActivityStarterHost authActivityStarterHost, Source source, ApiRequest.Options options, Continuation<? super Unit> continuation) {
        Object authenticate = this.authenticatorRegistry.getAuthenticator(source).authenticate(authActivityStarterHost, source, options, continuation);
        return authenticate == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? authenticate : Unit.INSTANCE;
    }

    @Override
    public java.lang.Object mo368getPaymentIntentResultgIAlus(android.content.Intent r5, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.PaymentIntentResult>> r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.mo368getPaymentIntentResultgIAlus(android.content.Intent, kotlin.coroutines.Continuation):java.lang.Object");
    }

    @Override
    public java.lang.Object mo369getSetupIntentResultgIAlus(android.content.Intent r5, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.SetupIntentResult>> r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.mo369getSetupIntentResultgIAlus(android.content.Intent, kotlin.coroutines.Continuation):java.lang.Object");
    }

    @Override
    public java.lang.Object mo367getAuthenticateSourceResultgIAlus(android.content.Intent r23, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.model.Source>> r24) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.mo367getAuthenticateSourceResultgIAlus(android.content.Intent, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final java.lang.Object m380authenticateAlipayBWLJW6A(com.stripe.android.model.PaymentIntent r7, com.stripe.android.AlipayAuthenticator r8, com.stripe.android.core.networking.ApiRequest.Options r9, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.PaymentIntentResult>> r10) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.StripePaymentController.m380authenticateAlipayBWLJW6A(com.stripe.android.model.PaymentIntent, com.stripe.android.AlipayAuthenticator, com.stripe.android.core.networking.ApiRequest$Options, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final Object handleError(AuthActivityStarterHost authActivityStarterHost, int i, Throwable th, Continuation<? super Unit> continuation) {
        Object withContext = BuildersKt.withContext(this.uiContext, new StripePaymentController$handleError$2(this, authActivityStarterHost, th, i, null), continuation);
        return withContext == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? withContext : Unit.INSTANCE;
    }

    @Override
    public Object handleNextAction(AuthActivityStarterHost authActivityStarterHost, StripeIntent stripeIntent, ApiRequest.Options options, Continuation<? super Unit> continuation) {
        Object authenticate = this.authenticatorRegistry.getAuthenticator(stripeIntent).authenticate(authActivityStarterHost, stripeIntent, options, continuation);
        return authenticate == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? authenticate : Unit.INSTANCE;
    }

    private final void logReturnUrl(String returnUrl) {
        PaymentAnalyticsEvent paymentAnalyticsEvent;
        if (Intrinsics.areEqual(returnUrl, this.defaultReturnUrl.getValue())) {
            paymentAnalyticsEvent = PaymentAnalyticsEvent.ConfirmReturnUrlDefault;
        } else if (returnUrl == null) {
            paymentAnalyticsEvent = PaymentAnalyticsEvent.ConfirmReturnUrlNull;
        } else {
            paymentAnalyticsEvent = PaymentAnalyticsEvent.ConfirmReturnUrlCustom;
        }
        this.analyticsRequestExecutor.executeAsync(PaymentAnalyticsRequestFactory.createRequest$payments_core_release$default(this.paymentAnalyticsRequestFactory, paymentAnalyticsEvent, (Set) null, (String) null, (Token.Type) null, (PaymentAnalyticsRequestFactory.ThreeDS2UiType) null, 30, (Object) null));
    }

    @Metadata(d1 = {"\u0000R\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\b\u0080\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J*\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00132\u0006\u0010\u0014\u001a\u00020\t2\u0006\u0010\u0015\u001a\u00020\u00162\b\b\u0002\u0010\u0017\u001a\u00020\u0018H\u0007J\u0015\u0010\u0019\u001a\u00020\r2\u0006\u0010\u001a\u001a\u00020\u001bH\u0000¢\u0006\u0002\b\u001cJ\u0015\u0010\u0019\u001a\u00020\r2\u0006\u0010\u001d\u001a\u00020\u001eH\u0000¢\u0006\u0002\b\u001cR\u0014\u0010\u0003\u001a\u00020\u0004X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006R\u001a\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\t0\bX\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u000bR\u000e\u0010\f\u001a\u00020\rX\u0080T¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\rX\u0080T¢\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\rX\u0080T¢\u0006\u0002\n\u0000¨\u0006\u001f"}, d2 = {"Lcom/stripe/android/StripePaymentController$Companion;", "", "()V", "CHALLENGE_DELAY", "", "getCHALLENGE_DELAY$payments_core_release", "()J", "EXPAND_PAYMENT_METHOD", "", "", "getEXPAND_PAYMENT_METHOD$payments_core_release", "()Ljava/util/List;", "PAYMENT_REQUEST_CODE", "", "SETUP_REQUEST_CODE", "SOURCE_REQUEST_CODE", "create", "Lcom/stripe/android/PaymentController;", "context", "Landroid/content/Context;", NamedConstantsKt.PUBLISHABLE_KEY, "stripeRepository", "Lcom/stripe/android/networking/StripeRepository;", NamedConstantsKt.ENABLE_LOGGING, "", "getRequestCode", "params", "Lcom/stripe/android/model/ConfirmStripeIntentParams;", "getRequestCode$payments_core_release", "intent", "Lcom/stripe/android/model/StripeIntent;", "payments-core_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        @JvmStatic
        public final PaymentController create(Context context, String str, StripeRepository stripeRepository) {
            Intrinsics.checkNotNullParameter(context, "context");
            Intrinsics.checkNotNullParameter(str, NamedConstantsKt.PUBLISHABLE_KEY);
            Intrinsics.checkNotNullParameter(stripeRepository, "stripeRepository");
            return create$default(this, context, str, stripeRepository, false, 8, null);
        }

        private Companion() {
        }

        public final int getRequestCode$payments_core_release(StripeIntent intent) {
            Intrinsics.checkNotNullParameter(intent, "intent");
            return intent instanceof PaymentIntent ? StripePaymentController.PAYMENT_REQUEST_CODE : StripePaymentController.SETUP_REQUEST_CODE;
        }

        public final int getRequestCode$payments_core_release(ConfirmStripeIntentParams params) {
            Intrinsics.checkNotNullParameter(params, "params");
            if (params instanceof ConfirmPaymentIntentParams) {
                return StripePaymentController.PAYMENT_REQUEST_CODE;
            }
            if (params instanceof ConfirmSetupIntentParams) {
                return StripePaymentController.SETUP_REQUEST_CODE;
            }
            throw new NoWhenBranchMatchedException();
        }

        public static PaymentController create$default(Companion companion, Context context, String str, StripeRepository stripeRepository, boolean z, int i, Object obj) {
            if ((i & 8) != 0) {
                z = false;
            }
            return companion.create(context, str, stripeRepository, z);
        }

        @JvmStatic
        public final PaymentController create(Context context, final String publishableKey, StripeRepository stripeRepository, boolean enableLogging) {
            Intrinsics.checkNotNullParameter(context, "context");
            Intrinsics.checkNotNullParameter(publishableKey, NamedConstantsKt.PUBLISHABLE_KEY);
            Intrinsics.checkNotNullParameter(stripeRepository, "stripeRepository");
            Context applicationContext = context.getApplicationContext();
            Intrinsics.checkNotNullExpressionValue(applicationContext, "context.applicationContext");
            return new StripePaymentController(applicationContext, new Function0<String>() {
                {
                    super(0);
                }

                public final String invoke() {
                    return publishableKey;
                }
            }, stripeRepository, enableLogging, null, null, null, null, null, 496, null);
        }

        public final List<String> getEXPAND_PAYMENT_METHOD$payments_core_release() {
            return StripePaymentController.EXPAND_PAYMENT_METHOD;
        }

        public final long getCHALLENGE_DELAY$payments_core_release() {
            return StripePaymentController.CHALLENGE_DELAY;
        }
    }
}