导航菜单

页面标题

页面副标题

Rilo v2.0.21 - DefaultPaymentSheetLoader.java 源代码

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

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


package com.stripe.android.paymentsheet.state;

import com.stripe.android.core.Logger;
import com.stripe.android.core.injection.IOContext;
import com.stripe.android.googlepaylauncher.GooglePayEnvironment;
import com.stripe.android.googlepaylauncher.GooglePayRepository;
import com.stripe.android.link.model.AccountStatus;
import com.stripe.android.model.ElementsSession;
import com.stripe.android.model.StripeIntent;
import com.stripe.android.paymentsheet.PaymentSheet;
import com.stripe.android.paymentsheet.PrefsRepository;
import com.stripe.android.paymentsheet.analytics.EventReporter;
import com.stripe.android.paymentsheet.model.IntentKt;
import com.stripe.android.paymentsheet.model.SupportedPaymentMethodKtxKt;
import com.stripe.android.paymentsheet.repositories.CustomerRepository;
import com.stripe.android.paymentsheet.repositories.ElementsSessionRepository;
import com.stripe.android.paymentsheet.state.PaymentSheetState;
import com.stripe.android.ui.core.forms.resources.LpmRepository;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Singleton;
import kotlin.Metadata;
import kotlin.Result;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.coroutines.jvm.internal.Boxing;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.CoroutineScopeKt;

@Singleton
@Metadata(d1 = {"\u0000¨\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\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\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\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\t\b\u0001\u0018\u00002\u00020\u0001Bu\b\u0007\u0012\u0019\u0010\u0002\u001a\u0015\u0012\u0006\u0012\u0004\u0018\u00010\u0004\u0012\u0004\u0012\u00020\u00050\u0003¢\u0006\u0002\b\u0006\u0012\u0017\u0010\u0007\u001a\u0013\u0012\u0004\u0012\u00020\b\u0012\u0004\u0012\u00020\t0\u0003¢\u0006\u0002\b\u0006\u0012\u0006\u0010\n\u001a\u00020\u000b\u0012\u0006\u0010\f\u001a\u00020\r\u0012\u0006\u0010\u000e\u001a\u00020\u000f\u0012\u0006\u0010\u0010\u001a\u00020\u0011\u0012\u0006\u0010\u0012\u001a\u00020\u0013\u0012\b\b\u0001\u0010\u0014\u001a\u00020\u0015\u0012\u0006\u0010\u0016\u001a\u00020\u0017¢\u0006\u0002\u0010\u0018J)\u0010\u0019\u001a\u00020\u001a2\u0006\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u001d\u001a\u00020\u001e2\u0006\u0010\u001f\u001a\u00020 H\u0082@ø\u0001\u0000¢\u0006\u0002\u0010!J3\u0010\"\u001a\u00020#2\u0006\u0010\u001d\u001a\u00020\u001e2\u0006\u0010$\u001a\u00020%2\b\u0010&\u001a\u0004\u0018\u00010'2\u0006\u0010(\u001a\u00020 H\u0082@ø\u0001\u0000¢\u0006\u0002\u0010)J!\u0010\u001f\u001a\u00020 2\u0006\u0010*\u001a\u00020\u001e2\u0006\u0010\u001b\u001a\u00020\u001cH\u0082@ø\u0001\u0000¢\u0006\u0002\u0010+J2\u0010,\u001a\b\u0012\u0004\u0012\u00020\u001a0-2\u0006\u0010.\u001a\u00020/2\u0006\u0010*\u001a\u00020\u001eH\u0096@ø\u0001\u0001ø\u0001\u0002ø\u0001\u0000ø\u0001\u0000¢\u0006\u0004\b0\u00101J3\u00102\u001a\u0002032\u0006\u0010\u001d\u001a\u00020\u001e2\u0006\u0010$\u001a\u00020%2\b\u0010&\u001a\u0004\u0018\u00010'2\u0006\u0010(\u001a\u00020 H\u0082@ø\u0001\u0000¢\u0006\u0002\u0010)J\u001e\u00104\u001a\u0002052\f\u00106\u001a\b\u0012\u0004\u0012\u00020\u001c0-H\u0002ø\u0001\u0000¢\u0006\u0002\u00107J/\u00108\u001a\b\u0012\u0004\u0012\u00020:092\u0006\u0010$\u001a\u00020%2\u0006\u0010\u001d\u001a\u00020\u001e2\u0006\u0010;\u001a\u00020\u0004H\u0082@ø\u0001\u0000¢\u0006\u0002\u0010<J2\u0010=\u001a\b\u0012\u0004\u0012\u00020\u001c0-2\u0006\u0010.\u001a\u00020/2\u0006\u0010>\u001a\u00020\u001eH\u0082@ø\u0001\u0001ø\u0001\u0002ø\u0001\u0000ø\u0001\u0000¢\u0006\u0004\b?\u00101J\u0018\u0010@\u001a\u00020 2\u0006\u0010$\u001a\u00020%2\u0006\u0010\u001d\u001a\u00020\u001eH\u0002J\u0010\u0010A\u001a\u0002052\u0006\u0010$\u001a\u00020%H\u0002J\u0015\u0010\u001f\u001a\u00020 *\u00020\u001eH\u0082@ø\u0001\u0000¢\u0006\u0002\u0010BR\u000e\u0010\u0016\u001a\u00020\u0017X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\rX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u000bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u0013X\u0082\u0004¢\u0006\u0002\n\u0000R\u001f\u0010\u0007\u001a\u0013\u0012\u0004\u0012\u00020\b\u0012\u0004\u0012\u00020\t0\u0003¢\u0006\u0002\b\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u0011X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082\u0004¢\u0006\u0002\n\u0000R!\u0010\u0002\u001a\u0015\u0012\u0006\u0012\u0004\u0018\u00010\u0004\u0012\u0004\u0012\u00020\u00050\u0003¢\u0006\u0002\b\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0015X\u0082\u0004¢\u0006\u0002\n\u0000\u0082\u0002\u000f\n\u0002\b\u0019\n\u0002\b!\n\u0005\b¡\u001e0\u0001¨\u0006C"}, d2 = {"Lcom/stripe/android/paymentsheet/state/DefaultPaymentSheetLoader;", "Lcom/stripe/android/paymentsheet/state/PaymentSheetLoader;", "prefsRepositoryFactory", "Lkotlin/Function1;", "Lcom/stripe/android/paymentsheet/PaymentSheet$CustomerConfiguration;", "Lcom/stripe/android/paymentsheet/PrefsRepository;", "Lkotlin/jvm/JvmSuppressWildcards;", "googlePayRepositoryFactory", "Lcom/stripe/android/googlepaylauncher/GooglePayEnvironment;", "Lcom/stripe/android/googlepaylauncher/GooglePayRepository;", "elementsSessionRepository", "Lcom/stripe/android/paymentsheet/repositories/ElementsSessionRepository;", "customerRepository", "Lcom/stripe/android/paymentsheet/repositories/CustomerRepository;", "lpmRepository", "Lcom/stripe/android/ui/core/forms/resources/LpmRepository;", "logger", "Lcom/stripe/android/core/Logger;", "eventReporter", "Lcom/stripe/android/paymentsheet/analytics/EventReporter;", "workContext", "Lkotlin/coroutines/CoroutineContext;", "accountStatusProvider", "Lcom/stripe/android/paymentsheet/state/LinkAccountStatusProvider;", "(Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lcom/stripe/android/paymentsheet/repositories/ElementsSessionRepository;Lcom/stripe/android/paymentsheet/repositories/CustomerRepository;Lcom/stripe/android/ui/core/forms/resources/LpmRepository;Lcom/stripe/android/core/Logger;Lcom/stripe/android/paymentsheet/analytics/EventReporter;Lkotlin/coroutines/CoroutineContext;Lcom/stripe/android/paymentsheet/state/LinkAccountStatusProvider;)V", "create", "Lcom/stripe/android/paymentsheet/state/PaymentSheetState$Full;", "elementsSession", "Lcom/stripe/android/model/ElementsSession;", "config", "Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;", "isGooglePayReady", "", "(Lcom/stripe/android/model/ElementsSession;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;", "createLinkConfiguration", "Lcom/stripe/android/link/LinkConfiguration;", "stripeIntent", "Lcom/stripe/android/model/StripeIntent;", "merchantCountry", "", "passthroughModeEnabled", "(Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;Lcom/stripe/android/model/StripeIntent;Ljava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;", "paymentSheetConfiguration", "(Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;Lcom/stripe/android/model/ElementsSession;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "load", "Lkotlin/Result;", "initializationMode", "Lcom/stripe/android/paymentsheet/PaymentSheet$InitializationMode;", "load-0E7RQCE", "(Lcom/stripe/android/paymentsheet/PaymentSheet$InitializationMode;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "loadLinkState", "Lcom/stripe/android/paymentsheet/state/LinkState;", "reportLoadResult", "", "loaderResult", "(Ljava/lang/Object;)V", "retrieveCustomerPaymentMethods", "", "Lcom/stripe/android/model/PaymentMethod;", "customerConfig", "(Lcom/stripe/android/model/StripeIntent;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;Lcom/stripe/android/paymentsheet/PaymentSheet$CustomerConfiguration;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "retrieveElementsSession", "configuration", "retrieveElementsSession-0E7RQCE", "supportsIntent", "warnUnactivatedIfNeeded", "(Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "paymentsheet_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class DefaultPaymentSheetLoader implements PaymentSheetLoader {
    private final LinkAccountStatusProvider accountStatusProvider;
    private final CustomerRepository customerRepository;
    private final ElementsSessionRepository elementsSessionRepository;
    private final EventReporter eventReporter;
    private final Function1<GooglePayEnvironment, GooglePayRepository> googlePayRepositoryFactory;
    private final Logger logger;
    private final LpmRepository lpmRepository;
    private final Function1<PaymentSheet.CustomerConfiguration, PrefsRepository> prefsRepositoryFactory;
    private final CoroutineContext workContext;

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

        static {
            int[] iArr = new int[PaymentSheet.GooglePayConfiguration.Environment.values().length];
            try {
                iArr[PaymentSheet.GooglePayConfiguration.Environment.Production.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[PaymentSheet.GooglePayConfiguration.Environment.Test.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            $EnumSwitchMapping$0 = iArr;
            int[] iArr2 = new int[AccountStatus.values().length];
            try {
                iArr2[AccountStatus.Verified.ordinal()] = 1;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                iArr2[AccountStatus.NeedsVerification.ordinal()] = 2;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                iArr2[AccountStatus.VerificationStarted.ordinal()] = 3;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                iArr2[AccountStatus.SignedOut.ordinal()] = 4;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                iArr2[AccountStatus.Error.ordinal()] = 5;
            } catch (NoSuchFieldError unused7) {
            }
            $EnumSwitchMapping$1 = iArr2;
        }
    }

    @Inject
    public DefaultPaymentSheetLoader(Function1<PaymentSheet.CustomerConfiguration, PrefsRepository> function1, Function1<GooglePayEnvironment, GooglePayRepository> function12, ElementsSessionRepository elementsSessionRepository, CustomerRepository customerRepository, LpmRepository lpmRepository, Logger logger, EventReporter eventReporter, @IOContext CoroutineContext coroutineContext, LinkAccountStatusProvider linkAccountStatusProvider) {
        Intrinsics.checkNotNullParameter(function1, "prefsRepositoryFactory");
        Intrinsics.checkNotNullParameter(function12, "googlePayRepositoryFactory");
        Intrinsics.checkNotNullParameter(elementsSessionRepository, "elementsSessionRepository");
        Intrinsics.checkNotNullParameter(customerRepository, "customerRepository");
        Intrinsics.checkNotNullParameter(lpmRepository, "lpmRepository");
        Intrinsics.checkNotNullParameter(logger, "logger");
        Intrinsics.checkNotNullParameter(eventReporter, "eventReporter");
        Intrinsics.checkNotNullParameter(coroutineContext, "workContext");
        Intrinsics.checkNotNullParameter(linkAccountStatusProvider, "accountStatusProvider");
        this.prefsRepositoryFactory = function1;
        this.googlePayRepositoryFactory = function12;
        this.elementsSessionRepository = elementsSessionRepository;
        this.customerRepository = customerRepository;
        this.lpmRepository = lpmRepository;
        this.logger = logger;
        this.eventReporter = eventReporter;
        this.workContext = coroutineContext;
        this.accountStatusProvider = linkAccountStatusProvider;
    }

    @Override
    public java.lang.Object mo545load0E7RQCE(com.stripe.android.paymentsheet.PaymentSheet.InitializationMode r6, com.stripe.android.paymentsheet.PaymentSheet.Configuration r7, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.paymentsheet.state.PaymentSheetState.Full>> r8) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.state.DefaultPaymentSheetLoader.mo545load0E7RQCE(com.stripe.android.paymentsheet.PaymentSheet$InitializationMode, com.stripe.android.paymentsheet.PaymentSheet$Configuration, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final Object isGooglePayReady(PaymentSheet.Configuration configuration, ElementsSession elementsSession, Continuation<? super Boolean> continuation) {
        return elementsSession.isGooglePayEnabled() ? isGooglePayReady(configuration, continuation) : Boxing.boxBoolean(false);
    }

    public final java.lang.Object isGooglePayReady(com.stripe.android.paymentsheet.PaymentSheet.Configuration r6, kotlin.coroutines.Continuation<? super java.lang.Boolean> r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.state.DefaultPaymentSheetLoader.isGooglePayReady(com.stripe.android.paymentsheet.PaymentSheet$Configuration, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final Object create(ElementsSession elementsSession, PaymentSheet.Configuration configuration, boolean z, Continuation<? super PaymentSheetState.Full> continuation) {
        return CoroutineScopeKt.coroutineScope(new DefaultPaymentSheetLoader$create$2(configuration, this, elementsSession, z, null), continuation);
    }

    public final java.lang.Object retrieveCustomerPaymentMethods(com.stripe.android.model.StripeIntent r5, com.stripe.android.paymentsheet.PaymentSheet.Configuration r6, com.stripe.android.paymentsheet.PaymentSheet.CustomerConfiguration r7, kotlin.coroutines.Continuation<? super java.util.List<com.stripe.android.model.PaymentMethod>> r8) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.state.DefaultPaymentSheetLoader.retrieveCustomerPaymentMethods(com.stripe.android.model.StripeIntent, com.stripe.android.paymentsheet.PaymentSheet$Configuration, com.stripe.android.paymentsheet.PaymentSheet$CustomerConfiguration, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final java.lang.Object m544retrieveElementsSession0E7RQCE(com.stripe.android.paymentsheet.PaymentSheet.InitializationMode r5, com.stripe.android.paymentsheet.PaymentSheet.Configuration r6, kotlin.coroutines.Continuation<? super kotlin.Result<com.stripe.android.model.ElementsSession>> r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.state.DefaultPaymentSheetLoader.m544retrieveElementsSession0E7RQCE(com.stripe.android.paymentsheet.PaymentSheet$InitializationMode, com.stripe.android.paymentsheet.PaymentSheet$Configuration, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final java.lang.Object loadLinkState(com.stripe.android.paymentsheet.PaymentSheet.Configuration r11, com.stripe.android.model.StripeIntent r12, java.lang.String r13, boolean r14, kotlin.coroutines.Continuation<? super com.stripe.android.paymentsheet.state.LinkState> r15) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.state.DefaultPaymentSheetLoader.loadLinkState(com.stripe.android.paymentsheet.PaymentSheet$Configuration, com.stripe.android.model.StripeIntent, java.lang.String, boolean, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final java.lang.Object createLinkConfiguration(com.stripe.android.paymentsheet.PaymentSheet.Configuration r22, com.stripe.android.model.StripeIntent r23, java.lang.String r24, boolean r25, kotlin.coroutines.Continuation<? super com.stripe.android.link.LinkConfiguration> r26) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.paymentsheet.state.DefaultPaymentSheetLoader.createLinkConfiguration(com.stripe.android.paymentsheet.PaymentSheet$Configuration, com.stripe.android.model.StripeIntent, java.lang.String, boolean, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final void warnUnactivatedIfNeeded(StripeIntent stripeIntent) {
        if (stripeIntent.getUnactivatedPaymentMethods().isEmpty()) {
            return;
        }
        this.logger.warning("[Stripe SDK] Warning: Your Intent contains the following payment method types which are activated for test mode but not activated for live mode: " + stripeIntent.getUnactivatedPaymentMethods() + ". These payment method types will not be displayed in live mode until they are activated. To activate these payment method types visit your Stripe dashboard.More information: https://support.stripe.com/questions/activate-a-new-payment-method");
    }

    public final boolean supportsIntent(StripeIntent stripeIntent, PaymentSheet.Configuration config) {
        List pMsToAdd$default = SupportedPaymentMethodKtxKt.getPMsToAdd$default(stripeIntent, config, this.lpmRepository, null, 8, null);
        Set set = CollectionsKt.toSet(stripeIntent.getPaymentMethodTypes());
        List list = pMsToAdd$default;
        ArrayList arrayList = new ArrayList(CollectionsKt.collectionSizeOrDefault(list, 10));
        Iterator it2 = list.iterator();
        while (it2.hasNext()) {
            arrayList.add(((LpmRepository.SupportedPaymentMethod) it2.next()).getCode());
        }
        return !CollectionsKt.intersect(CollectionsKt.toSet(arrayList), set).isEmpty();
    }

    public final void reportLoadResult(Object loaderResult) {
        Throwable m1550exceptionOrNullimpl = Result.m1550exceptionOrNullimpl(loaderResult);
        if (m1550exceptionOrNullimpl == null) {
            ElementsSession elementsSession = (ElementsSession) loaderResult;
            Throwable sessionsError = elementsSession.getSessionsError();
            if (sessionsError != null) {
                this.eventReporter.onElementsSessionLoadFailed(sessionsError);
            }
            this.eventReporter.onLoadSucceeded(elementsSession.isLinkEnabled(), IntentKt.getCurrency(elementsSession.getStripeIntent()));
            return;
        }
        this.logger.error("Failure loading PaymentSheetState", m1550exceptionOrNullimpl);
        this.eventReporter.onLoadFailed(m1550exceptionOrNullimpl);
    }
}