导航菜单

页面标题

页面副标题

Rilo v2.0.21 - PaymentFlowResultProcessor.java 源代码

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

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


package com.stripe.android.payments;

import android.content.Context;
import com.stripe.android.StripeIntentResult;
import com.stripe.android.core.Logger;
import com.stripe.android.core.networking.ApiRequest;
import com.stripe.android.core.networking.RetryDelaySupplier;
import com.stripe.android.model.PaymentMethod;
import com.stripe.android.model.StripeIntent;
import com.stripe.android.networking.StripeRepository;
import java.util.List;
import javax.inject.Provider;
import kotlin.Metadata;
import kotlin.Result;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.DefaultConstructorMarker;

@Metadata(d1 = {"\u0000\u0082\u0001\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\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\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\b\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010 \n\u0002\b\t\n\u0002\u0010\u000b\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b0\u0018\u0000 D*\b\b\u0000\u0010\u0001*\u00020\u0002*\u0010\b\u0001\u0010\u0003 \u0001*\b\u0012\u0004\u0012\u0002H\u00010\u00042\u00020\u0005:\u0001DB?\b\u0004\u0012\u0006\u0010\u0006\u001a\u00020\u0007\u0012\f\u0010\b\u001a\b\u0012\u0004\u0012\u00020\n0\t\u0012\u0006\u0010\u000b\u001a\u00020\f\u0012\u0006\u0010\r\u001a\u00020\u000e\u0012\u0006\u0010\u000f\u001a\u00020\u0010\u0012\b\b\u0002\u0010\u0011\u001a\u00020\u0012¢\u0006\u0002\u0010\u0013J:\u0010\u0018\u001a\b\u0012\u0004\u0012\u00028\u00000\u00192\u0006\u0010\u001a\u001a\u00020\n2\u0006\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u001d\u001a\u00020\nH¤@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\b\u001e\u0010\u001fJ'\u0010 \u001a\u00028\u00012\u0006\u0010!\u001a\u00028\u00002\u0006\u0010\"\u001a\u00020#2\b\u0010$\u001a\u0004\u0018\u00010\nH$¢\u0006\u0002\u0010%J\u0018\u0010&\u001a\u00020#2\u0006\u0010'\u001a\u00020\u00022\u0006\u0010(\u001a\u00020#H\u0002J*\u0010)\u001a\b\u0012\u0004\u0012\u00028\u00010\u00192\u0006\u0010*\u001a\u00020+H\u0086@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\b,\u0010-J@\u0010.\u001a\b\u0012\u0004\u0012\u00028\u00000\u00192\u0006\u0010/\u001a\u00020\n2\u0006\u0010\u001b\u001a\u00020\u001c2\f\u00100\u001a\b\u0012\u0004\u0012\u00020\n01H¤@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\b2\u00103J:\u00104\u001a\b\u0012\u0004\u0012\u00028\u00000\u00192\u0006\u00105\u001a\u00020\u00022\u0006\u0010/\u001a\u00020\n2\u0006\u0010\u001b\u001a\u00020\u001cH\u0082@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\b6\u00107J@\u00108\u001a\b\u0012\u0004\u0012\u00028\u00000\u00192\u0006\u0010/\u001a\u00020\n2\u0006\u0010\u001b\u001a\u00020\u001c2\f\u00100\u001a\b\u0012\u0004\u0012\u00020\n01H¤@ø\u0001\u0000ø\u0001\u0001ø\u0001\u0002ø\u0001\u0002¢\u0006\u0004\b9\u00103J\u0010\u0010:\u001a\u00020;2\u0006\u0010!\u001a\u00020\u0002H\u0002J\u0018\u0010<\u001a\u00020;2\u0006\u0010!\u001a\u00020\u00022\u0006\u0010=\u001a\u00020;H\u0002J\u0018\u0010>\u001a\u00020;2\u0006\u0010!\u001a\u00020\u00022\u0006\u0010?\u001a\u00020#H\u0002J\u001e\u0010@\u001a\u00020;2\f\u0010A\u001a\b\u0012\u0004\u0012\u00020\u00020\u0019H\u0002ø\u0001\u0002¢\u0006\u0002\u0010BJ\u001e\u0010C\u001a\u00020;2\f\u0010A\u001a\b\u0012\u0004\u0012\u00020\u00020\u0019H\u0002ø\u0001\u0002¢\u0006\u0002\u0010BR\u000e\u0010\u0014\u001a\u00020\u0015X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\b\u001a\b\u0012\u0004\u0012\u00020\n0\tX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0012X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u000b\u001a\u00020\fX\u0084\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0016\u0010\u0017R\u000e\u0010\u000f\u001a\u00020\u0010X\u0082\u0004¢\u0006\u0002\n\u0000\u0082\u0001\u0002EF\u0082\u0002\u000f\n\u0002\b!\n\u0005\b¡\u001e0\u0001\n\u0002\b\u0019¨\u0006G"}, d2 = {"Lcom/stripe/android/payments/PaymentFlowResultProcessor;", "T", "Lcom/stripe/android/model/StripeIntent;", "S", "Lcom/stripe/android/StripeIntentResult;", "", "context", "Landroid/content/Context;", "publishableKeyProvider", "Ljavax/inject/Provider;", "", "stripeRepository", "Lcom/stripe/android/networking/StripeRepository;", "logger", "Lcom/stripe/android/core/Logger;", "workContext", "Lkotlin/coroutines/CoroutineContext;", "retryDelaySupplier", "Lcom/stripe/android/core/networking/RetryDelaySupplier;", "(Landroid/content/Context;Ljavax/inject/Provider;Lcom/stripe/android/networking/StripeRepository;Lcom/stripe/android/core/Logger;Lkotlin/coroutines/CoroutineContext;Lcom/stripe/android/core/networking/RetryDelaySupplier;)V", "failureMessageFactory", "Lcom/stripe/android/payments/PaymentFlowFailureMessageFactory;", "getStripeRepository", "()Lcom/stripe/android/networking/StripeRepository;", "cancelStripeIntentSource", "Lkotlin/Result;", "stripeIntentId", "requestOptions", "Lcom/stripe/android/core/networking/ApiRequest$Options;", "sourceId", "cancelStripeIntentSource-BWLJW6A", "(Ljava/lang/String;Lcom/stripe/android/core/networking/ApiRequest$Options;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "createStripeIntentResult", "stripeIntent", "outcomeFromFlow", "", "failureMessage", "(Lcom/stripe/android/model/StripeIntent;ILjava/lang/String;)Lcom/stripe/android/StripeIntentResult;", "determineFlowOutcome", "intent", "originalFlowOutcome", "processResult", "unvalidatedResult", "Lcom/stripe/android/payments/PaymentFlowResult$Unvalidated;", "processResult-gIAlu-s", "(Lcom/stripe/android/payments/PaymentFlowResult$Unvalidated;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "refreshStripeIntent", "clientSecret", "expandFields", "", "refreshStripeIntent-BWLJW6A", "(Ljava/lang/String;Lcom/stripe/android/core/networking/ApiRequest$Options;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "refreshStripeIntentUntilTerminalState", "originalIntent", "refreshStripeIntentUntilTerminalState-BWLJW6A", "(Lcom/stripe/android/model/StripeIntent;Ljava/lang/String;Lcom/stripe/android/core/networking/ApiRequest$Options;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "retrieveStripeIntent", "retrieveStripeIntent-BWLJW6A", "shouldCallRefreshIntent", "", "shouldCancelIntentSource", "shouldCancelSource", "shouldRefreshIntent", "flowOutcome", "shouldRetry", "stripeIntentResult", "(Ljava/lang/Object;)Z", "shouldThrowException", "Companion", "Lcom/stripe/android/payments/PaymentIntentFlowResultProcessor;", "Lcom/stripe/android/payments/SetupIntentFlowResultProcessor;", "payments-core_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public abstract class PaymentFlowResultProcessor<T extends StripeIntent, S extends StripeIntentResult<? extends T>> {

    public static final Companion INSTANCE = new Companion(null);
    private static final List<String> EXPAND_PAYMENT_METHOD = CollectionsKt.listOf("payment_method");
    public static final int MAX_RETRIES = 3;
    private final PaymentFlowFailureMessageFactory failureMessageFactory;
    private final Logger logger;
    private final Provider<String> publishableKeyProvider;
    private final RetryDelaySupplier retryDelaySupplier;
    private final StripeRepository stripeRepository;
    private final CoroutineContext workContext;

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

        static {
            int[] iArr = new int[StripeIntent.Status.values().length];
            try {
                iArr[StripeIntent.Status.Succeeded.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[StripeIntent.Status.RequiresCapture.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            $EnumSwitchMapping$0 = iArr;
        }
    }

    public PaymentFlowResultProcessor(Context context, Provider provider, StripeRepository stripeRepository, Logger logger, CoroutineContext coroutineContext, RetryDelaySupplier retryDelaySupplier, DefaultConstructorMarker defaultConstructorMarker) {
        this(context, provider, stripeRepository, logger, coroutineContext, retryDelaySupplier);
    }

    protected abstract Object mo185cancelStripeIntentSourceBWLJW6A(String str, ApiRequest.Options options, String str2, Continuation<? super Result<? extends T>> continuation);

    protected abstract S createStripeIntentResult(T stripeIntent, int outcomeFromFlow, String failureMessage);

    protected abstract Object mo187refreshStripeIntentBWLJW6A(String str, ApiRequest.Options options, List<String> list, Continuation<? super Result<? extends T>> continuation);

    protected abstract Object mo188retrieveStripeIntentBWLJW6A(String str, ApiRequest.Options options, List<String> list, Continuation<? super Result<? extends T>> continuation);

    private PaymentFlowResultProcessor(Context context, Provider<String> provider, StripeRepository stripeRepository, Logger logger, CoroutineContext coroutineContext, RetryDelaySupplier retryDelaySupplier) {
        this.publishableKeyProvider = provider;
        this.stripeRepository = stripeRepository;
        this.logger = logger;
        this.workContext = coroutineContext;
        this.retryDelaySupplier = retryDelaySupplier;
        this.failureMessageFactory = new PaymentFlowFailureMessageFactory(context);
    }

    protected final StripeRepository getStripeRepository() {
        return this.stripeRepository;
    }

    public PaymentFlowResultProcessor(Context context, Provider provider, StripeRepository stripeRepository, Logger logger, CoroutineContext coroutineContext, RetryDelaySupplier retryDelaySupplier, int i2, DefaultConstructorMarker defaultConstructorMarker) {
        this(context, provider, stripeRepository, logger, coroutineContext, (i2 & 32) != 0 ? new RetryDelaySupplier() : retryDelaySupplier, null);
    }

    public final java.lang.Object m186processResultgIAlus(com.stripe.android.payments.PaymentFlowResult.Unvalidated r6, kotlin.coroutines.Continuation<? super kotlin.Result<? extends S>> r7) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.payments.PaymentFlowResultProcessor.m186processResultgIAlus(com.stripe.android.payments.PaymentFlowResult$Unvalidated, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public final boolean shouldCancelIntentSource(StripeIntent stripeIntent, boolean shouldCancelSource) {
        return shouldCancelSource && stripeIntent.requiresAction();
    }

    public final boolean shouldRefreshIntent(com.stripe.android.model.StripeIntent r8, int r9) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.payments.PaymentFlowResultProcessor.shouldRefreshIntent(com.stripe.android.model.StripeIntent, int):boolean");
    }

    public final int determineFlowOutcome(StripeIntent intent, int originalFlowOutcome) {
        StripeIntent.Status status = intent.getStatus();
        int i2 = status == null ? -1 : WhenMappings.$EnumSwitchMapping$0[status.ordinal()];
        if (i2 == 1 || i2 == 2) {
            return 1;
        }
        return originalFlowOutcome;
    }

    private final boolean shouldCallRefreshIntent(StripeIntent stripeIntent) {
        PaymentMethod paymentMethod = stripeIntent.getPaymentMethod();
        if ((paymentMethod != null ? paymentMethod.type : null) != PaymentMethod.Type.WeChatPay) {
            PaymentMethod paymentMethod2 = stripeIntent.getPaymentMethod();
            if ((paymentMethod2 != null ? paymentMethod2.type : null) != PaymentMethod.Type.Upi) {
                return false;
            }
        }
        return true;
    }

    public final java.lang.Object m184refreshStripeIntentUntilTerminalStateBWLJW6A(com.stripe.android.model.StripeIntent r12, java.lang.String r13, com.stripe.android.core.networking.ApiRequest.Options r14, kotlin.coroutines.Continuation<? super kotlin.Result<? extends T>> r15) {
        throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.payments.PaymentFlowResultProcessor.m184refreshStripeIntentUntilTerminalStateBWLJW6A(com.stripe.android.model.StripeIntent, java.lang.String, com.stripe.android.core.networking.ApiRequest$Options, kotlin.coroutines.Continuation):java.lang.Object");
    }

    private final boolean shouldRetry(Object stripeIntentResult) {
        boolean z;
        if (Result.m1553isFailureimpl(stripeIntentResult)) {
            stripeIntentResult = null;
        }
        StripeIntent stripeIntent = (StripeIntent) stripeIntentResult;
        if (stripeIntent == null) {
            return true;
        }
        boolean requiresAction = stripeIntent.requiresAction();
        if (stripeIntent.getStatus() == StripeIntent.Status.Processing) {
            PaymentMethod paymentMethod = stripeIntent.getPaymentMethod();
            if ((paymentMethod != null ? paymentMethod.type : null) == PaymentMethod.Type.Card) {
                z = true;
                return requiresAction || z;
            }
        }
        z = false;
        if (requiresAction) {
            return true;
        }
    }

    private final boolean shouldThrowException(Object stripeIntentResult) {
        if (Result.m1553isFailureimpl(stripeIntentResult)) {
            stripeIntentResult = null;
        }
        StripeIntent stripeIntent = (StripeIntent) stripeIntentResult;
        if (stripeIntent == null) {
            return true;
        }
        return stripeIntent.requiresAction() && !(stripeIntent.getNextActionData() instanceof StripeIntent.NextActionData.SdkData.Use3DS2);
    }

    @Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\b\u0080\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0017\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007R\u000e\u0010\b\u001a\u00020\tX\u0086T¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"Lcom/stripe/android/payments/PaymentFlowResultProcessor$Companion;", "", "()V", "EXPAND_PAYMENT_METHOD", "", "", "getEXPAND_PAYMENT_METHOD", "()Ljava/util/List;", "MAX_RETRIES", "", "payments-core_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }

        public final List<String> getEXPAND_PAYMENT_METHOD() {
            return PaymentFlowResultProcessor.EXPAND_PAYMENT_METHOD;
        }
    }
}