导航菜单

页面标题

页面副标题

Crafto v9.3.3 - PaymentRelayStarter.java 源代码

正在查看: Crafto v9.3.3 应用的 PaymentRelayStarter.java JAVA 源代码文件

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


package com.stripe.android;

import android.os.Parcel;
import android.os.Parcelable;
import c0.u0;
import com.stripe.android.core.exception.StripeException;
import com.stripe.android.model.PaymentIntent;
import com.stripe.android.model.SetupIntent;
import com.stripe.android.model.Source;
import com.stripe.android.model.Stripe3ds2AuthParams;
import com.stripe.android.model.StripeIntent;
import com.stripe.android.payments.PaymentFlowResult;
import com.stripe.android.view.AuthActivityStarter;
import com.stripe.android.view.AuthActivityStarterHost;
import com.stripe.android.view.PaymentRelayActivity;
import java.io.Serializable;
import kotlin.Metadata;
import kotlin.NoWhenBranchMatchedException;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;

@Metadata
public interface PaymentRelayStarter extends AuthActivityStarter<Args> {

    @Metadata
    public static abstract class Args implements Parcelable {
        public static final int $stable = 0;

        @NotNull
        public static final Companion Companion = new Companion(null);

        @Metadata
        public static final class Companion {
            public Companion(DefaultConstructorMarker defaultConstructorMarker) {
                this();
            }

            public static Args create$default(Companion companion, StripeIntent stripeIntent, String str, int i, Object obj) {
                if ((i & 2) != 0) {
                    str = null;
                }
                return companion.create(stripeIntent, str);
            }

            @NotNull
            public final Args create(@NotNull StripeIntent stripeIntent, String str) {
                Intrinsics.checkNotNullParameter(stripeIntent, "stripeIntent");
                if (stripeIntent instanceof PaymentIntent) {
                    return new PaymentIntentArgs((PaymentIntent) stripeIntent, str);
                }
                if (stripeIntent instanceof SetupIntent) {
                    return new SetupIntentArgs((SetupIntent) stripeIntent, str);
                }
                throw new NoWhenBranchMatchedException();
            }

            private Companion() {
            }
        }

        @Metadata
        public static final class ErrorArgs extends Args {

            @NotNull
            private final StripeException exception;
            private final int requestCode;

            @NotNull
            public static final Companion Companion = new Companion(null);

            @NotNull
            public static final Parcelable.Creator<ErrorArgs> CREATOR = new Creator();
            public static final int $stable = 8;

            @Metadata
            public static final class Companion {
                public Companion(DefaultConstructorMarker defaultConstructorMarker) {
                    this();
                }

                @NotNull
                public ErrorArgs[] m13newArray(int i) {
                    ol.a.a();
                    throw null;
                }

                private Companion() {
                }

                @NotNull
                public ErrorArgs m12create(@NotNull Parcel parcel) {
                    Intrinsics.checkNotNullParameter(parcel, "parcel");
                    Serializable readSerializable = parcel.readSerializable();
                    if (readSerializable != null) {
                        return new ErrorArgs((StripeException) readSerializable, parcel.readInt());
                    }
                    throw new NullPointerException("null cannot be cast to non-null type com.stripe.android.core.exception.StripeException");
                }

                public void write(@NotNull ErrorArgs errorArgs, @NotNull Parcel parcel, int i) {
                    Intrinsics.checkNotNullParameter(errorArgs, "<this>");
                    Intrinsics.checkNotNullParameter(parcel, "parcel");
                    parcel.writeSerializable(errorArgs.getException$payments_core_release());
                    parcel.writeInt(errorArgs.getRequestCode());
                }
            }

            @Metadata
            public static final class Creator implements Parcelable.Creator<ErrorArgs> {
                @Override
                @NotNull
                public final ErrorArgs createFromParcel(@NotNull Parcel parcel) {
                    Intrinsics.checkNotNullParameter(parcel, "parcel");
                    return ErrorArgs.Companion.m12create(parcel);
                }

                @Override
                @NotNull
                public final ErrorArgs[] newArray(int i) {
                    return new ErrorArgs[i];
                }
            }

            public ErrorArgs(@NotNull StripeException stripeException, int i) {
                super(null);
                Intrinsics.checkNotNullParameter(stripeException, "exception");
                this.exception = stripeException;
                this.requestCode = i;
            }

            public static ErrorArgs copy$default(ErrorArgs errorArgs, StripeException stripeException, int i, int i2, Object obj) {
                if ((i2 & 1) != 0) {
                    stripeException = errorArgs.exception;
                }
                if ((i2 & 2) != 0) {
                    i = errorArgs.getRequestCode();
                }
                return errorArgs.copy(stripeException, i);
            }

            @NotNull
            public final StripeException component1$payments_core_release() {
                return this.exception;
            }

            public final int component2() {
                return getRequestCode();
            }

            @NotNull
            public final ErrorArgs copy(@NotNull StripeException stripeException, int i) {
                Intrinsics.checkNotNullParameter(stripeException, "exception");
                return new ErrorArgs(stripeException, i);
            }

            @Override
            public int describeContents() {
                return 0;
            }

            public boolean equals(Object obj) {
                if (this == obj) {
                    return true;
                }
                if (!(obj instanceof ErrorArgs)) {
                    return false;
                }
                ErrorArgs errorArgs = (ErrorArgs) obj;
                return Intrinsics.areEqual(this.exception, errorArgs.exception) && getRequestCode() == errorArgs.getRequestCode();
            }

            @NotNull
            public final StripeException getException$payments_core_release() {
                return this.exception;
            }

            @Override
            public int getRequestCode() {
                return this.requestCode;
            }

            public int hashCode() {
                return getRequestCode() + (this.exception.hashCode() * 31);
            }

            @Override
            @NotNull
            public PaymentFlowResult.Unvalidated toResult() {
                return new PaymentFlowResult.Unvalidated(null, 0, this.exception, false, null, null, null, 123, null);
            }

            @NotNull
            public String toString() {
                return "ErrorArgs(exception=" + this.exception + ", requestCode=" + getRequestCode() + ')';
            }

            @Override
            public void writeToParcel(@NotNull Parcel parcel, int i) {
                Intrinsics.checkNotNullParameter(parcel, "out");
                Companion.write(this, parcel, i);
            }
        }

        @Metadata
        public static final class PaymentIntentArgs extends Args {

            @NotNull
            private final PaymentIntent paymentIntent;
            private final String stripeAccountId;

            @NotNull
            public static final Parcelable.Creator<PaymentIntentArgs> CREATOR = new Creator();
            public static final int $stable = 8;

            @Metadata
            public static final class Creator implements Parcelable.Creator<PaymentIntentArgs> {
                @Override
                @NotNull
                public final PaymentIntentArgs createFromParcel(@NotNull Parcel parcel) {
                    Intrinsics.checkNotNullParameter(parcel, "parcel");
                    return new PaymentIntentArgs(PaymentIntent.CREATOR.createFromParcel(parcel), parcel.readString());
                }

                @Override
                @NotNull
                public final PaymentIntentArgs[] newArray(int i) {
                    return new PaymentIntentArgs[i];
                }
            }

            public PaymentIntentArgs(PaymentIntent paymentIntent, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
                this(paymentIntent, (i & 2) != 0 ? null : str);
            }

            public static PaymentIntentArgs copy$default(PaymentIntentArgs paymentIntentArgs, PaymentIntent paymentIntent, String str, int i, Object obj) {
                if ((i & 1) != 0) {
                    paymentIntent = paymentIntentArgs.paymentIntent;
                }
                if ((i & 2) != 0) {
                    str = paymentIntentArgs.stripeAccountId;
                }
                return paymentIntentArgs.copy(paymentIntent, str);
            }

            @NotNull
            public final PaymentIntent component1$payments_core_release() {
                return this.paymentIntent;
            }

            public final String component2$payments_core_release() {
                return this.stripeAccountId;
            }

            @NotNull
            public final PaymentIntentArgs copy(@NotNull PaymentIntent paymentIntent, String str) {
                Intrinsics.checkNotNullParameter(paymentIntent, "paymentIntent");
                return new PaymentIntentArgs(paymentIntent, str);
            }

            @Override
            public int describeContents() {
                return 0;
            }

            public boolean equals(Object obj) {
                if (this == obj) {
                    return true;
                }
                if (!(obj instanceof PaymentIntentArgs)) {
                    return false;
                }
                PaymentIntentArgs paymentIntentArgs = (PaymentIntentArgs) obj;
                return Intrinsics.areEqual(this.paymentIntent, paymentIntentArgs.paymentIntent) && Intrinsics.areEqual(this.stripeAccountId, paymentIntentArgs.stripeAccountId);
            }

            @NotNull
            public final PaymentIntent getPaymentIntent$payments_core_release() {
                return this.paymentIntent;
            }

            @Override
            public int getRequestCode() {
                return StripePaymentController.PAYMENT_REQUEST_CODE;
            }

            public final String getStripeAccountId$payments_core_release() {
                return this.stripeAccountId;
            }

            public int hashCode() {
                int hashCode = this.paymentIntent.hashCode() * 31;
                String str = this.stripeAccountId;
                return hashCode + (str == null ? 0 : str.hashCode());
            }

            @Override
            @NotNull
            public PaymentFlowResult.Unvalidated toResult() {
                return new PaymentFlowResult.Unvalidated(this.paymentIntent.getClientSecret(), 0, null, false, null, null, this.stripeAccountId, 62, null);
            }

            @NotNull
            public String toString() {
                StringBuilder sb = new StringBuilder("PaymentIntentArgs(paymentIntent=");
                sb.append(this.paymentIntent);
                sb.append(", stripeAccountId=");
                return u0.a(sb, this.stripeAccountId, ')');
            }

            @Override
            public void writeToParcel(@NotNull Parcel parcel, int i) {
                Intrinsics.checkNotNullParameter(parcel, "out");
                this.paymentIntent.writeToParcel(parcel, i);
                parcel.writeString(this.stripeAccountId);
            }

            public PaymentIntentArgs(@NotNull PaymentIntent paymentIntent, String str) {
                super(null);
                Intrinsics.checkNotNullParameter(paymentIntent, "paymentIntent");
                this.paymentIntent = paymentIntent;
                this.stripeAccountId = str;
            }
        }

        @Metadata
        public static final class SetupIntentArgs extends Args {

            @NotNull
            private final SetupIntent setupIntent;
            private final String stripeAccountId;

            @NotNull
            public static final Parcelable.Creator<SetupIntentArgs> CREATOR = new Creator();
            public static final int $stable = 8;

            @Metadata
            public static final class Creator implements Parcelable.Creator<SetupIntentArgs> {
                @Override
                @NotNull
                public final SetupIntentArgs createFromParcel(@NotNull Parcel parcel) {
                    Intrinsics.checkNotNullParameter(parcel, "parcel");
                    return new SetupIntentArgs(SetupIntent.CREATOR.createFromParcel(parcel), parcel.readString());
                }

                @Override
                @NotNull
                public final SetupIntentArgs[] newArray(int i) {
                    return new SetupIntentArgs[i];
                }
            }

            public SetupIntentArgs(SetupIntent setupIntent, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
                this(setupIntent, (i & 2) != 0 ? null : str);
            }

            public static SetupIntentArgs copy$default(SetupIntentArgs setupIntentArgs, SetupIntent setupIntent, String str, int i, Object obj) {
                if ((i & 1) != 0) {
                    setupIntent = setupIntentArgs.setupIntent;
                }
                if ((i & 2) != 0) {
                    str = setupIntentArgs.stripeAccountId;
                }
                return setupIntentArgs.copy(setupIntent, str);
            }

            @NotNull
            public final SetupIntent component1$payments_core_release() {
                return this.setupIntent;
            }

            public final String component2$payments_core_release() {
                return this.stripeAccountId;
            }

            @NotNull
            public final SetupIntentArgs copy(@NotNull SetupIntent setupIntent, String str) {
                Intrinsics.checkNotNullParameter(setupIntent, "setupIntent");
                return new SetupIntentArgs(setupIntent, str);
            }

            @Override
            public int describeContents() {
                return 0;
            }

            public boolean equals(Object obj) {
                if (this == obj) {
                    return true;
                }
                if (!(obj instanceof SetupIntentArgs)) {
                    return false;
                }
                SetupIntentArgs setupIntentArgs = (SetupIntentArgs) obj;
                return Intrinsics.areEqual(this.setupIntent, setupIntentArgs.setupIntent) && Intrinsics.areEqual(this.stripeAccountId, setupIntentArgs.stripeAccountId);
            }

            @Override
            public int getRequestCode() {
                return StripePaymentController.SETUP_REQUEST_CODE;
            }

            @NotNull
            public final SetupIntent getSetupIntent$payments_core_release() {
                return this.setupIntent;
            }

            public final String getStripeAccountId$payments_core_release() {
                return this.stripeAccountId;
            }

            public int hashCode() {
                int hashCode = this.setupIntent.hashCode() * 31;
                String str = this.stripeAccountId;
                return hashCode + (str == null ? 0 : str.hashCode());
            }

            @Override
            @NotNull
            public PaymentFlowResult.Unvalidated toResult() {
                return new PaymentFlowResult.Unvalidated(this.setupIntent.getClientSecret(), 0, null, false, null, null, this.stripeAccountId, 62, null);
            }

            @NotNull
            public String toString() {
                StringBuilder sb = new StringBuilder("SetupIntentArgs(setupIntent=");
                sb.append(this.setupIntent);
                sb.append(", stripeAccountId=");
                return u0.a(sb, this.stripeAccountId, ')');
            }

            @Override
            public void writeToParcel(@NotNull Parcel parcel, int i) {
                Intrinsics.checkNotNullParameter(parcel, "out");
                this.setupIntent.writeToParcel(parcel, i);
                parcel.writeString(this.stripeAccountId);
            }

            public SetupIntentArgs(@NotNull SetupIntent setupIntent, String str) {
                super(null);
                Intrinsics.checkNotNullParameter(setupIntent, "setupIntent");
                this.setupIntent = setupIntent;
                this.stripeAccountId = str;
            }
        }

        @Metadata
        public static final class SourceArgs extends Args {

            @NotNull
            private final Source source;
            private final String stripeAccountId;

            @NotNull
            public static final Parcelable.Creator<SourceArgs> CREATOR = new Creator();
            public static final int $stable = 8;

            @Metadata
            public static final class Creator implements Parcelable.Creator<SourceArgs> {
                @Override
                @NotNull
                public final SourceArgs createFromParcel(@NotNull Parcel parcel) {
                    Intrinsics.checkNotNullParameter(parcel, "parcel");
                    return new SourceArgs(Source.CREATOR.createFromParcel(parcel), parcel.readString());
                }

                @Override
                @NotNull
                public final SourceArgs[] newArray(int i) {
                    return new SourceArgs[i];
                }
            }

            public SourceArgs(Source source, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
                this(source, (i & 2) != 0 ? null : str);
            }

            public static SourceArgs copy$default(SourceArgs sourceArgs, Source source, String str, int i, Object obj) {
                if ((i & 1) != 0) {
                    source = sourceArgs.source;
                }
                if ((i & 2) != 0) {
                    str = sourceArgs.stripeAccountId;
                }
                return sourceArgs.copy(source, str);
            }

            @NotNull
            public final Source component1$payments_core_release() {
                return this.source;
            }

            public final String component2$payments_core_release() {
                return this.stripeAccountId;
            }

            @NotNull
            public final SourceArgs copy(@NotNull Source source, String str) {
                Intrinsics.checkNotNullParameter(source, Stripe3ds2AuthParams.FIELD_SOURCE);
                return new SourceArgs(source, str);
            }

            @Override
            public int describeContents() {
                return 0;
            }

            public boolean equals(Object obj) {
                if (this == obj) {
                    return true;
                }
                if (!(obj instanceof SourceArgs)) {
                    return false;
                }
                SourceArgs sourceArgs = (SourceArgs) obj;
                return Intrinsics.areEqual(this.source, sourceArgs.source) && Intrinsics.areEqual(this.stripeAccountId, sourceArgs.stripeAccountId);
            }

            @Override
            public int getRequestCode() {
                return StripePaymentController.SOURCE_REQUEST_CODE;
            }

            @NotNull
            public final Source getSource$payments_core_release() {
                return this.source;
            }

            public final String getStripeAccountId$payments_core_release() {
                return this.stripeAccountId;
            }

            public int hashCode() {
                int hashCode = this.source.hashCode() * 31;
                String str = this.stripeAccountId;
                return hashCode + (str == null ? 0 : str.hashCode());
            }

            @Override
            @NotNull
            public PaymentFlowResult.Unvalidated toResult() {
                return new PaymentFlowResult.Unvalidated(null, 0, null, false, null, this.source, this.stripeAccountId, 31, null);
            }

            @NotNull
            public String toString() {
                StringBuilder sb = new StringBuilder("SourceArgs(source=");
                sb.append(this.source);
                sb.append(", stripeAccountId=");
                return u0.a(sb, this.stripeAccountId, ')');
            }

            @Override
            public void writeToParcel(@NotNull Parcel parcel, int i) {
                Intrinsics.checkNotNullParameter(parcel, "out");
                this.source.writeToParcel(parcel, i);
                parcel.writeString(this.stripeAccountId);
            }

            public SourceArgs(@NotNull Source source, String str) {
                super(null);
                Intrinsics.checkNotNullParameter(source, Stripe3ds2AuthParams.FIELD_SOURCE);
                this.source = source;
                this.stripeAccountId = str;
            }
        }

        public Args(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        public abstract int getRequestCode();

        @NotNull
        public abstract PaymentFlowResult.Unvalidated toResult();

        private Args() {
        }
    }

    @Metadata
    public static final class Legacy implements PaymentRelayStarter {
        public static final int $stable = 0;

        @NotNull
        private final AuthActivityStarterHost host;

        public Legacy(@NotNull AuthActivityStarterHost authActivityStarterHost) {
            Intrinsics.checkNotNullParameter(authActivityStarterHost, "host");
            this.host = authActivityStarterHost;
        }

        public void start(@NotNull Args args) {
            Intrinsics.checkNotNullParameter(args, "args");
            this.host.startActivityForResult(PaymentRelayActivity.class, args.toResult().toBundle(), args.getRequestCode());
        }
    }

    @Metadata
    public static final class Modern implements PaymentRelayStarter {
        public static final int $stable = 8;

        @NotNull
        private final i.c<Args> launcher;

        public Modern(@NotNull i.c<Args> cVar) {
            Intrinsics.checkNotNullParameter(cVar, "launcher");
            this.launcher = cVar;
        }

        public void start(@NotNull Args args) {
            Intrinsics.checkNotNullParameter(args, "args");
            this.launcher.launch(args);
        }
    }
}