正在查看: Biko v2.0.23 应用的 PaymentFlowFailureMessageFactory.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Biko v2.0.23 应用的 PaymentFlowFailureMessageFactory.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.stripe.android.payments;
import android.content.Context;
import com.stripe.android.model.PaymentIntent;
import com.stripe.android.model.PaymentMethod;
import com.stripe.android.model.SetupIntent;
import com.stripe.android.model.StripeIntent;
import com.stripe.android.networking.StripeErrorMappingKt;
import kotlin.Metadata;
import kotlin.NoWhenBranchMatchedException;
import kotlin.jvm.internal.Intrinsics;
@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0018\u0010\u0005\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\nJ\u0012\u0010\u000b\u001a\u0004\u0018\u00010\u00062\u0006\u0010\f\u001a\u00020\rH\u0002J\u0012\u0010\u000e\u001a\u0004\u0018\u00010\u00062\u0006\u0010\u000f\u001a\u00020\u0010H\u0002J\f\u0010\u0011\u001a\u00020\u0012*\u00020\bH\u0002R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0013"}, d2 = {"Lcom/stripe/android/payments/PaymentFlowFailureMessageFactory;", "", "context", "Landroid/content/Context;", "(Landroid/content/Context;)V", "create", "", "intent", "Lcom/stripe/android/model/StripeIntent;", "outcome", "", "createForPaymentIntent", "paymentIntent", "Lcom/stripe/android/model/PaymentIntent;", "createForSetupIntent", "setupIntent", "Lcom/stripe/android/model/SetupIntent;", "is3DS2", "", "payments-core_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class PaymentFlowFailureMessageFactory {
private final Context context;
public PaymentFlowFailureMessageFactory(Context context) {
Intrinsics.checkNotNullParameter(context, "context");
this.context = context;
}
public final String create(StripeIntent intent, int outcome) {
Intrinsics.checkNotNullParameter(intent, "intent");
if (outcome == 4) {
return this.context.getResources().getString(com.stripe.android.R.string.stripe_failure_reason_timed_out);
}
if (is3DS2(intent)) {
return null;
}
if (intent.getStatus() != StripeIntent.Status.RequiresPaymentMethod && intent.getStatus() != StripeIntent.Status.RequiresAction) {
return null;
}
if (intent instanceof PaymentIntent) {
return createForPaymentIntent((PaymentIntent) intent);
}
if (intent instanceof SetupIntent) {
return createForSetupIntent((SetupIntent) intent);
}
throw new NoWhenBranchMatchedException();
}
private final java.lang.String createForPaymentIntent(com.stripe.android.model.PaymentIntent r5) {
throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.payments.PaymentFlowFailureMessageFactory.createForPaymentIntent(com.stripe.android.model.PaymentIntent):java.lang.String");
}
private final String createForSetupIntent(SetupIntent setupIntent) {
SetupIntent.Error lastSetupError = setupIntent.getLastSetupError();
if (Intrinsics.areEqual(lastSetupError != null ? lastSetupError.getCode() : null, SetupIntent.Error.CODE_AUTHENTICATION_ERROR)) {
return this.context.getResources().getString(com.stripe.android.R.string.stripe_failure_reason_authentication);
}
SetupIntent.Error lastSetupError2 = setupIntent.getLastSetupError();
if ((lastSetupError2 != null ? lastSetupError2.getType() : null) == SetupIntent.Error.Type.CardError) {
return StripeErrorMappingKt.withLocalizedMessage(setupIntent.getLastSetupError(), this.context).getMessage();
}
return null;
}
private final boolean is3DS2(StripeIntent stripeIntent) {
PaymentMethod paymentMethod = stripeIntent.getPaymentMethod();
return (paymentMethod != null ? paymentMethod.type : null) == PaymentMethod.Type.Card && (stripeIntent.getNextActionData() instanceof StripeIntent.NextActionData.SdkData.Use3DS2);
}
}