导航菜单

页面标题

页面副标题

Crafto v9.3.3 - PaymentLauncherViewModel$confirmStripeIntent$1.java 源代码

正在查看: Crafto v9.3.3 应用的 PaymentLauncherViewModel$confirmStripeIntent$1.java JAVA 源代码文件

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


package com.stripe.android.payments.paymentlauncher;

import Hk.p;
import Hk.q;
import Mk.e;
import Mk.i;
import androidx.lifecycle.e0;
import com.stripe.android.camera.scanui.CameraView;
import com.stripe.android.core.networking.ApiRequest;
import com.stripe.android.model.ConfirmStripeIntentParams;
import com.stripe.android.model.StripeIntent;
import com.stripe.android.payments.DefaultReturnUrl;
import com.stripe.android.payments.core.authentication.PaymentAuthenticator;
import com.stripe.android.payments.core.authentication.PaymentAuthenticatorRegistry;
import com.stripe.android.payments.paymentlauncher.PaymentResult;
import com.stripe.android.view.AuthActivityStarterHost;
import dl.H;
import java.util.Map;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import org.jetbrains.annotations.NotNull;

@Metadata
@e(c = "com.stripe.android.payments.paymentlauncher.PaymentLauncherViewModel$confirmStripeIntent$1", f = "PaymentLauncherViewModel.kt", l = {110, 120}, m = "invokeSuspend")
public final class PaymentLauncherViewModel$confirmStripeIntent$1 extends i implements Function2<H, Kk.c<? super Unit>, Object> {
    final ConfirmStripeIntentParams $confirmStripeIntentParams;
    final AuthActivityStarterHost $host;
    private Object L$0;
    int label;
    final PaymentLauncherViewModel this$0;

    public PaymentLauncherViewModel$confirmStripeIntent$1(PaymentLauncherViewModel paymentLauncherViewModel, ConfirmStripeIntentParams confirmStripeIntentParams, AuthActivityStarterHost authActivityStarterHost, Kk.c<? super PaymentLauncherViewModel$confirmStripeIntent$1> cVar) {
        super(2, cVar);
        this.this$0 = paymentLauncherViewModel;
        this.$confirmStripeIntentParams = confirmStripeIntentParams;
        this.$host = authActivityStarterHost;
    }

    @NotNull
    public final Kk.c<Unit> create(Object obj, @NotNull Kk.c<?> cVar) {
        PaymentLauncherViewModel$confirmStripeIntent$1 paymentLauncherViewModel$confirmStripeIntent$1 = new PaymentLauncherViewModel$confirmStripeIntent$1(this.this$0, this.$confirmStripeIntentParams, this.$host, cVar);
        paymentLauncherViewModel$confirmStripeIntent$1.L$0 = obj;
        return paymentLauncherViewModel$confirmStripeIntent$1;
    }

    public final Object invoke(@NotNull H h, Kk.c<? super Unit> cVar) {
        return create(h, cVar).invokeSuspend(Unit.a);
    }

    public final Object invokeSuspend(@NotNull Object obj) {
        StripeIntent a;
        int i;
        PaymentAuthenticatorRegistry paymentAuthenticatorRegistry;
        xk.a aVar;
        String id;
        Map map;
        e0 e0Var;
        boolean z;
        String returnUrl;
        DefaultReturnUrl defaultReturnUrl;
        Lk.a aVar2 = Lk.a.COROUTINE_SUSPENDED;
        int i2 = this.label;
        try {
        } catch (Throwable th) {
            p.a aVar3 = p.b;
            a = q.a(th);
            i = i2;
        }
        if (i2 == 0) {
            q.b(obj);
            e0Var = this.this$0.savedStateHandle;
            e0Var.e(Boolean.TRUE, PaymentLauncherViewModel.KEY_HAS_STARTED);
            this.this$0.logReturnUrl(this.$confirmStripeIntentParams.getReturnUrl());
            z = this.this$0.isInstantApp;
            if (z) {
                returnUrl = this.$confirmStripeIntentParams.getReturnUrl();
            } else {
                returnUrl = this.$confirmStripeIntentParams.getReturnUrl();
                if (returnUrl == null || StringsKt.J(returnUrl)) {
                    returnUrl = null;
                }
                if (returnUrl == null) {
                    defaultReturnUrl = this.this$0.defaultReturnUrl;
                    returnUrl = defaultReturnUrl.getValue();
                }
            }
            ?? r1 = returnUrl;
            PaymentLauncherViewModel paymentLauncherViewModel = this.this$0;
            ConfirmStripeIntentParams confirmStripeIntentParams = this.$confirmStripeIntentParams;
            p.a aVar4 = p.b;
            this.L$0 = r1;
            this.label = 1;
            obj = paymentLauncherViewModel.confirmIntent(confirmStripeIntentParams, r1, this);
            i2 = r1;
            if (obj == aVar2) {
                return aVar2;
            }
        } else {
            if (i2 != 1) {
                if (i2 != 2) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                q.b(obj);
                return Unit.a;
            }
            ?? r12 = (String) this.L$0;
            q.b(obj);
            i2 = r12;
        }
        a = (StripeIntent) obj;
        p.a aVar5 = p.b;
        i = i2;
        PaymentLauncherViewModel paymentLauncherViewModel2 = this.this$0;
        AuthActivityStarterHost authActivityStarterHost = this.$host;
        Throwable a2 = p.a(a);
        if (a2 == null) {
            StripeIntent stripeIntent = a;
            StripeIntent.NextActionData nextActionData = stripeIntent.getNextActionData();
            if (nextActionData != null && (nextActionData instanceof StripeIntent.NextActionData.SdkData.Use3DS1) && (id = stripeIntent.getId()) != null) {
                map = paymentLauncherViewModel2.threeDs1IntentReturnUrlMap;
                int i3 = i;
                if (i == 0) {
                    i3 = CameraView.FILL_ASPECT_RATIO;
                }
                map.put(id, i3);
            }
            paymentAuthenticatorRegistry = paymentLauncherViewModel2.authenticatorRegistry;
            PaymentAuthenticator authenticator = paymentAuthenticatorRegistry.getAuthenticator(stripeIntent);
            aVar = paymentLauncherViewModel2.apiRequestOptionsProvider;
            Object obj2 = aVar.get();
            Intrinsics.checkNotNullExpressionValue(obj2, "apiRequestOptionsProvider.get()");
            this.L$0 = null;
            this.label = 2;
            if (authenticator.authenticate(authActivityStarterHost, stripeIntent, (ApiRequest.Options) obj2, this) == aVar2) {
                return aVar2;
            }
        } else {
            paymentLauncherViewModel2.getPaymentLauncherResult$payments_core_release().postValue(new PaymentResult.Failed(a2));
        }
        return Unit.a;
    }
}