正在查看: Crafto v9.3.3 应用的 NextActionDataParser.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Crafto v9.3.3 应用的 NextActionDataParser.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.stripe.android.model.parsers;
import android.net.Uri;
import com.stripe.android.core.model.StripeJsonUtils;
import com.stripe.android.core.model.parsers.ModelJsonParser;
import com.stripe.android.model.MicrodepositType;
import com.stripe.android.model.StripeIntent;
import com.stripe.android.model.WeChat;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
@Metadata
public final class NextActionDataParser implements ModelJsonParser<StripeIntent.NextActionData> {
@NotNull
private static final Companion Companion = new Companion(null);
@Deprecated
@NotNull
private static final String FIELD_NEXT_ACTION_TYPE = "type";
@Metadata
public static final class AlipayRedirectParser implements ModelJsonParser<StripeIntent.NextActionData.AlipayRedirect> {
@NotNull
private static final Companion Companion = new Companion(null);
@Deprecated
@NotNull
public static final String FIELD_NATIVE_DATA = "native_data";
@Deprecated
@NotNull
public static final String FIELD_RETURN_URL = "return_url";
@Deprecated
@NotNull
public static final String FIELD_URL = "url";
@Metadata
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
@Override
@NotNull
public StripeIntent.NextActionData.AlipayRedirect parse(@NotNull JSONObject jSONObject) {
Intrinsics.checkNotNullParameter(jSONObject, "json");
String string = jSONObject.getString(FIELD_NATIVE_DATA);
Intrinsics.checkNotNullExpressionValue(string, "json.getString(FIELD_NATIVE_DATA)");
String string2 = jSONObject.getString("url");
Intrinsics.checkNotNullExpressionValue(string2, "json.getString(FIELD_URL)");
return new StripeIntent.NextActionData.AlipayRedirect(string, string2, StripeJsonUtils.optString(jSONObject, "return_url"));
}
}
@Metadata
public static final class BlikAuthorizeParser implements ModelJsonParser<StripeIntent.NextActionData.BlikAuthorize> {
@Override
@NotNull
public StripeIntent.NextActionData.BlikAuthorize parse(@NotNull JSONObject jSONObject) {
Intrinsics.checkNotNullParameter(jSONObject, "json");
return StripeIntent.NextActionData.BlikAuthorize.INSTANCE;
}
}
@Metadata
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
@Metadata
public static final class DisplayOxxoDetailsJsonParser implements ModelJsonParser<StripeIntent.NextActionData.DisplayOxxoDetails> {
@NotNull
private static final Companion Companion = new Companion(null);
@Deprecated
@NotNull
private static final String FIELD_EXPIRES_AFTER = "expires_after";
@Deprecated
@NotNull
private static final String FIELD_HOSTED_VOUCHER_URL = "hosted_voucher_url";
@Deprecated
@NotNull
private static final String FIELD_NUMBER = "number";
@Metadata
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
@Override
@NotNull
public StripeIntent.NextActionData.DisplayOxxoDetails parse(@NotNull JSONObject jSONObject) {
Intrinsics.checkNotNullParameter(jSONObject, "json");
return new StripeIntent.NextActionData.DisplayOxxoDetails(jSONObject.optInt(FIELD_EXPIRES_AFTER), StripeJsonUtils.optString(jSONObject, FIELD_NUMBER), StripeJsonUtils.optString(jSONObject, FIELD_HOSTED_VOUCHER_URL));
}
}
@Metadata
public static final class RedirectToUrlParser implements ModelJsonParser<StripeIntent.NextActionData.RedirectToUrl> {
@NotNull
private static final Companion Companion = new Companion(null);
@Deprecated
@NotNull
public static final String FIELD_RETURN_URL = "return_url";
@Deprecated
@NotNull
public static final String FIELD_URL = "url";
@Metadata
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
@Override
public StripeIntent.NextActionData.RedirectToUrl parse(@NotNull JSONObject jSONObject) {
Intrinsics.checkNotNullParameter(jSONObject, "json");
if (!jSONObject.has("url")) {
return null;
}
Uri parse = Uri.parse(jSONObject.getString("url"));
Intrinsics.checkNotNullExpressionValue(parse, "parse(json.getString(FIELD_URL))");
return new StripeIntent.NextActionData.RedirectToUrl(parse, jSONObject.optString("return_url"));
}
}
@Metadata
public static final class SdkDataJsonParser implements ModelJsonParser<StripeIntent.NextActionData.SdkData> {
@NotNull
private static final Companion Companion = new Companion(null);
@Deprecated
@NotNull
private static final String FIELD_CERTIFICATE = "certificate";
@Deprecated
@NotNull
private static final String FIELD_DIRECTORY_SERVER_ENCRYPTION = "directory_server_encryption";
@Deprecated
@NotNull
private static final String FIELD_DIRECTORY_SERVER_ID = "directory_server_id";
@Deprecated
@NotNull
private static final String FIELD_DIRECTORY_SERVER_NAME = "directory_server_name";
@Deprecated
@NotNull
private static final String FIELD_KEY_ID = "key_id";
@Deprecated
@NotNull
private static final String FIELD_ROOT_CAS = "root_certificate_authorities";
@Deprecated
@NotNull
private static final String FIELD_SERVER_TRANSACTION_ID = "server_transaction_id";
@Deprecated
@NotNull
private static final String FIELD_STRIPE_JS = "stripe_js";
@Deprecated
@NotNull
private static final String FIELD_THREE_D_SECURE_2_SOURCE = "three_d_secure_2_source";
@Deprecated
@NotNull
private static final String FIELD_TYPE = "type";
@Deprecated
@NotNull
private static final String TYPE_3DS1 = "three_d_secure_redirect";
@Deprecated
@NotNull
private static final String TYPE_3DS2 = "stripe_3ds2_fingerprint";
@Metadata
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
private final com.stripe.android.model.StripeIntent.NextActionData.SdkData.Use3DS2.DirectoryServerEncryption parseDirectoryServerEncryption(org.json.JSONObject r6) {
throw new UnsupportedOperationException("Method not decompiled: com.stripe.android.model.parsers.NextActionDataParser.SdkDataJsonParser.parseDirectoryServerEncryption(org.json.JSONObject):com.stripe.android.model.StripeIntent$NextActionData$SdkData$Use3DS2$DirectoryServerEncryption");
}
@Override
public StripeIntent.NextActionData.SdkData parse(@NotNull JSONObject jSONObject) {
Intrinsics.checkNotNullParameter(jSONObject, "json");
String optString = StripeJsonUtils.optString(jSONObject, FIELD_TYPE);
if (Intrinsics.areEqual(optString, TYPE_3DS1)) {
String optString2 = jSONObject.optString(FIELD_STRIPE_JS);
Intrinsics.checkNotNullExpressionValue(optString2, "json.optString(FIELD_STRIPE_JS)");
return new StripeIntent.NextActionData.SdkData.Use3DS1(optString2);
}
if (!Intrinsics.areEqual(optString, TYPE_3DS2)) {
return null;
}
String optString3 = jSONObject.optString(FIELD_THREE_D_SECURE_2_SOURCE);
Intrinsics.checkNotNullExpressionValue(optString3, "json.optString(FIELD_THREE_D_SECURE_2_SOURCE)");
String optString4 = jSONObject.optString(FIELD_DIRECTORY_SERVER_NAME);
Intrinsics.checkNotNullExpressionValue(optString4, "json.optString(FIELD_DIRECTORY_SERVER_NAME)");
String optString5 = jSONObject.optString(FIELD_SERVER_TRANSACTION_ID);
Intrinsics.checkNotNullExpressionValue(optString5, "json.optString(FIELD_SERVER_TRANSACTION_ID)");
JSONObject optJSONObject = jSONObject.optJSONObject(FIELD_DIRECTORY_SERVER_ENCRYPTION);
if (optJSONObject == null) {
optJSONObject = new JSONObject();
}
return new StripeIntent.NextActionData.SdkData.Use3DS2(optString3, optString4, optString5, parseDirectoryServerEncryption(optJSONObject));
}
}
@Metadata
public static final class VerifyWithMicrodepositsParser implements ModelJsonParser<StripeIntent.NextActionData.VerifyWithMicrodeposits> {
@Deprecated
@NotNull
private static final String ARRIVAL_DATE = "arrival_date";
@NotNull
private static final Companion Companion = new Companion(null);
@Deprecated
@NotNull
private static final String HOSTED_VERIFICATION_URL = "hosted_verification_url";
@Deprecated
@NotNull
private static final String MICRODEPOSIT_TYPE = "microdeposit_type";
@Metadata
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
private final MicrodepositType parseMicrodepositType(JSONObject jSONObject) {
MicrodepositType microdepositType;
MicrodepositType[] values = MicrodepositType.values();
int length = values.length;
int i = 0;
while (true) {
if (i >= length) {
microdepositType = null;
break;
}
microdepositType = values[i];
if (Intrinsics.areEqual(microdepositType.getValue(), jSONObject.optString(MICRODEPOSIT_TYPE))) {
break;
}
i++;
}
return microdepositType == null ? MicrodepositType.UNKNOWN : microdepositType;
}
@Override
@NotNull
public StripeIntent.NextActionData.VerifyWithMicrodeposits parse(@NotNull JSONObject jSONObject) {
Intrinsics.checkNotNullParameter(jSONObject, "json");
long optLong = jSONObject.optLong(ARRIVAL_DATE);
String optString = jSONObject.optString(HOSTED_VERIFICATION_URL);
Intrinsics.checkNotNullExpressionValue(optString, "json.optString(HOSTED_VERIFICATION_URL)");
return new StripeIntent.NextActionData.VerifyWithMicrodeposits(optLong, optString, parseMicrodepositType(jSONObject));
}
}
@Metadata
public static final class WeChatPayRedirectParser implements ModelJsonParser<StripeIntent.NextActionData.WeChatPayRedirect> {
@Deprecated
@NotNull
private static final String APP_ID = "app_id";
@NotNull
private static final Companion Companion = new Companion(null);
@Deprecated
@NotNull
private static final String NONCE_STR = "nonce_str";
@Deprecated
@NotNull
private static final String PACKAGE = "package";
@Deprecated
@NotNull
private static final String PARTNER_ID = "partner_id";
@Deprecated
@NotNull
private static final String PREPAY_ID = "prepay_id";
@Deprecated
@NotNull
private static final String SIGN = "sign";
@Deprecated
@NotNull
private static final String TIMESTAMP = "timestamp";
@Metadata
public static final class Companion {
public Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
private Companion() {
}
}
@Override
@NotNull
public StripeIntent.NextActionData.WeChatPayRedirect parse(@NotNull JSONObject jSONObject) {
Intrinsics.checkNotNullParameter(jSONObject, "json");
return new StripeIntent.NextActionData.WeChatPayRedirect(new WeChat(null, jSONObject.optString("app_id"), jSONObject.optString(NONCE_STR), jSONObject.optString(PACKAGE), jSONObject.optString(PARTNER_ID), jSONObject.optString(PREPAY_ID), jSONObject.optString(SIGN), jSONObject.optString("timestamp"), null, 257, null));
}
}
@Metadata
public class WhenMappings {
public static final int[] $EnumSwitchMapping$0;
static {
int[] iArr = new int[StripeIntent.NextActionType.values().length];
iArr[StripeIntent.NextActionType.DisplayOxxoDetails.ordinal()] = 1;
iArr[StripeIntent.NextActionType.RedirectToUrl.ordinal()] = 2;
iArr[StripeIntent.NextActionType.UseStripeSdk.ordinal()] = 3;
iArr[StripeIntent.NextActionType.AlipayRedirect.ordinal()] = 4;
iArr[StripeIntent.NextActionType.BlikAuthorize.ordinal()] = 5;
iArr[StripeIntent.NextActionType.WeChatPayRedirect.ordinal()] = 6;
iArr[StripeIntent.NextActionType.VerifyWithMicrodeposits.ordinal()] = 7;
$EnumSwitchMapping$0 = iArr;
}
}
@Override
public StripeIntent.NextActionData parse(@NotNull JSONObject jSONObject) {
ModelJsonParser displayOxxoDetailsJsonParser;
Intrinsics.checkNotNullParameter(jSONObject, "json");
StripeIntent.NextActionType fromCode$payments_core_release = StripeIntent.NextActionType.Companion.fromCode$payments_core_release(jSONObject.optString(FIELD_NEXT_ACTION_TYPE));
switch (fromCode$payments_core_release == null ? -1 : WhenMappings.$EnumSwitchMapping$0[fromCode$payments_core_release.ordinal()]) {
case 1:
displayOxxoDetailsJsonParser = new DisplayOxxoDetailsJsonParser();
break;
case 2:
displayOxxoDetailsJsonParser = new RedirectToUrlParser();
break;
case 3:
displayOxxoDetailsJsonParser = new SdkDataJsonParser();
break;
case 4:
displayOxxoDetailsJsonParser = new AlipayRedirectParser();
break;
case 5:
displayOxxoDetailsJsonParser = new BlikAuthorizeParser();
break;
case 6:
displayOxxoDetailsJsonParser = new WeChatPayRedirectParser();
break;
case 7:
displayOxxoDetailsJsonParser = new VerifyWithMicrodepositsParser();
break;
default:
return null;
}
JSONObject optJSONObject = jSONObject.optJSONObject(fromCode$payments_core_release.getCode());
if (optJSONObject == null) {
optJSONObject = new JSONObject();
}
return (StripeIntent.NextActionData) displayOxxoDetailsJsonParser.parse(optJSONObject);
}
}