Kufar v3.2.0版本的 MD5 值为:6a4d203db1c561c7e3bcd50d23fed59f
以下内容为反编译后的 i.java 源代码,内容仅作参考
package op;
import androidx.compose.runtime.internal.StabilityInferred;
import by.kufar.feature.toggles.FeatureToggles;
import by.kufar.vasapi.model.AdditionalDataX;
import by.kufar.vasapi.model.Checkout;
import by.kufar.vasapi.model.Order;
import by.kufar.vasapi.model.Payload;
import by.kufar.vasapi.model.ProductPayBody;
import by.kufar.vasapi.model.ProductPayResponse;
import by.kufar.vasapi.model.ProductResponse;
import by.kufar.vasapi.model.Settings;
import com.begateway.mobilepayments.models.network.request.Contract;
import d80.q;
import e80.u;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.s;
import nc0.e0;
import okhttp3.ResponseBody;
import op.k;
import q10.v;
@StabilityInferred(parameters = 0)
@Metadata(d1 = {"\u0000\\\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0005\b\u0007\u0018\u00002\u00020\u0001B1\b\u0007\u0012\u0006\u0010\u0011\u001a\u00020\u000e\u0012\u0006\u0010\u0015\u001a\u00020\u0012\u0012\u0006\u0010\u0019\u001a\u00020\u0016\u0012\u0006\u0010\u001d\u001a\u00020\u001a\u0012\u0006\u0010!\u001a\u00020\u001e¢\u0006\u0004\b%\u0010&J8\u0010\f\u001a\b\u0012\u0004\u0012\u00020\u000b0\n2\u0006\u0010\u0003\u001a\u00020\u00022\b\u0010\u0005\u001a\u0004\u0018\u00010\u00042\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\bH\u0086\u0002¢\u0006\u0004\b\f\u0010\rR\u0014\u0010\u0011\u001a\u00020\u000e8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u000f\u0010\u0010R\u0014\u0010\u0015\u001a\u00020\u00128\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0013\u0010\u0014R\u0014\u0010\u0019\u001a\u00020\u00168\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0017\u0010\u0018R\u0014\u0010\u001d\u001a\u00020\u001a8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001b\u0010\u001cR\u0014\u0010!\u001a\u00020\u001e8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u001f\u0010 R\u0014\u0010$\u001a\u00020\"8\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\f\u0010#¨\u0006'"}, d2 = {"Lop/i;", "", "Lan/a;", "vasType", "", "adID", "", "productID", "Lir/c;", "paymentType", "Lkotlinx/coroutines/flow/g;", "Lop/k$a;", "f", "(Lan/a;Ljava/lang/Long;Ljava/lang/String;Lir/c;)Lkotlinx/coroutines/flow/g;", "Lyo/i;", "a", "Lyo/i;", "bumpRepository", "Lop/a;", "b", "Lop/a;", "findPaymentForProductIDUseCase", "Lbr/a;", "c", "Lbr/a;", "getProductUseCase", "Ld6/a;", "d", "Ld6/a;", "dispatchersProvider", "Lq10/v;", "e", "Lq10/v;", "moshi", "", "Z", "isTest", "<init>", "(Lyo/i;Lop/a;Lbr/a;Ld6/a;Lq10/v;)V", "feature-vas_googleRelease"}, k = 1, mv = {1, 9, 0})
public final class i {
public final yo.i bumpRepository;
public final op.a findPaymentForProductIDUseCase;
public final br.a getProductUseCase;
public final d6.a dispatchersProvider;
public final v moshi;
public final boolean isTest;
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002*\b\u0012\u0004\u0012\u00020\u00010\u0000H\u008a@"}, d2 = {"Lkotlinx/coroutines/flow/h;", "Lop/k$a;", "", "<anonymous>"}, k = 3, mv = {1, 9, 0})
@l80.f(c = "by.kufar.vas.ui.vas.bump.base.usecase.GetPaymentDataForBePaidUseCase$invoke$1", f = "GetPaymentDataForBePaidUseCase.kt", l = {33, 36, 73}, m = "invokeSuspend")
public static final class a extends l80.l implements Function2<kotlinx.coroutines.flow.h<? super k.BePaidPayData>, j80.d<? super Unit>, Object> {
public int f87705b;
public Object f87706c;
public final an.a f87708e;
public final Long f87709f;
public final String f87710g;
public final ir.c f87711h;
public a(an.a aVar, Long l11, String str, ir.c cVar, j80.d<? super a> dVar) {
super(2, dVar);
this.f87708e = aVar;
this.f87709f = l11;
this.f87710g = str;
this.f87711h = cVar;
}
@Override
public final j80.d<Unit> create(Object obj, j80.d<?> dVar) {
a aVar = new a(this.f87708e, this.f87709f, this.f87710g, this.f87711h, dVar);
aVar.f87706c = obj;
return aVar;
}
@Override
public final Object invokeSuspend(Object obj) {
kotlinx.coroutines.flow.h hVar;
Object z11;
Object i11;
ProductPayResponse productPayResponse;
Checkout checkout;
String publicKey;
String str;
Checkout checkout2;
Order order;
Long amount;
Checkout checkout3;
Order order2;
String currency;
Checkout checkout4;
Order order3;
String description;
Checkout checkout5;
Order order4;
String trackingId;
Checkout checkout6;
Order order5;
AdditionalDataX additionalData;
List<String> contract;
int i12;
Checkout checkout7;
Settings settings;
String notificationUrl;
Checkout checkout8;
Settings settings2;
Integer autoReturn;
Checkout checkout9;
Settings settings3;
String string;
String str2;
String str3;
Object f11 = k80.c.f();
int i13 = this.f87705b;
boolean z12 = false;
if (i13 != 0) {
if (i13 != 1) {
if (i13 != 2) {
if (i13 == 3) {
q.b(obj);
return Unit.f82492a;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
hVar = (kotlinx.coroutines.flow.h) this.f87706c;
q.b(obj);
i11 = obj;
e0 e0Var = (e0) i11;
productPayResponse = (ProductPayResponse) e0Var.a();
String str4 = null;
if (productPayResponse == null) {
ResponseBody d11 = e0Var.d();
if (d11 != null && (string = d11.string()) != null) {
i iVar = i.this;
if (string.length() == 0) {
z12 = true;
}
if (z12) {
ProductPayResponse productPayResponse2 = (ProductPayResponse) e0Var.a();
if (productPayResponse2 != null) {
str3 = productPayResponse2.getMessage();
} else {
str3 = null;
}
throw new ap.a(str3, null, 2, null);
}
ProductPayResponse productPayResponse3 = (ProductPayResponse) iVar.moshi.c(ProductPayResponse.class).fromJson(string);
if (productPayResponse3 != null) {
str2 = productPayResponse3.getMessage();
} else {
str2 = null;
}
if (productPayResponse3 != null) {
str4 = productPayResponse3.getCode();
}
throw new ap.a(str2, str4);
}
productPayResponse = null;
}
if (productPayResponse == null) {
if (!e0Var.f()) {
String message = productPayResponse.getMessage();
if (message == null) {
message = "result is not successful";
}
throw new IllegalStateException(message.toString());
}
Payload payload = productPayResponse.getPayload();
if (payload != null && (checkout = payload.getCheckout()) != null && (publicKey = checkout.getPublicKey()) != null) {
Payload payload2 = productPayResponse.getPayload();
if (payload2 != null) {
payload2.getCheckoutUrl();
}
Payload payload3 = productPayResponse.getPayload();
if (payload3 == null || (checkout9 = payload3.getCheckout()) == null || (settings3 = checkout9.getSettings()) == null || (str = settings3.getSuccessUrl()) == null) {
str = "https://www.kufar.by/";
}
String str5 = str;
Payload payload4 = productPayResponse.getPayload();
if (payload4 != null && (checkout2 = payload4.getCheckout()) != null && (order = checkout2.getOrder()) != null && (amount = order.getAmount()) != null) {
long longValue = amount.longValue();
Payload payload5 = productPayResponse.getPayload();
if (payload5 != null && (checkout3 = payload5.getCheckout()) != null && (order2 = checkout3.getOrder()) != null && (currency = order2.getCurrency()) != null) {
Payload payload6 = productPayResponse.getPayload();
if (payload6 != null && (checkout4 = payload6.getCheckout()) != null && (order3 = checkout4.getOrder()) != null && (description = order3.getDescription()) != null) {
Payload payload7 = productPayResponse.getPayload();
if (payload7 != null && (checkout5 = payload7.getCheckout()) != null && (order4 = checkout5.getOrder()) != null && (trackingId = order4.getTrackingId()) != null) {
Payload payload8 = productPayResponse.getPayload();
if (payload8 != null && (checkout6 = payload8.getCheckout()) != null && (order5 = checkout6.getOrder()) != null && (additionalData = order5.getAdditionalData()) != null && (contract = additionalData.getContract()) != null) {
List<String> list = contract;
ArrayList arrayList = new ArrayList(u.y(list, 10));
Iterator<T> it = list.iterator();
while (it.hasNext()) {
String upperCase = ((String) it.next()).toUpperCase(Locale.ROOT);
s.i(upperCase, "this as java.lang.String).toUpperCase(Locale.ROOT)");
arrayList.add(Contract.valueOf(upperCase));
}
Payload payload9 = productPayResponse.getPayload();
if (payload9 != null && (checkout8 = payload9.getCheckout()) != null && (settings2 = checkout8.getSettings()) != null && (autoReturn = settings2.getAutoReturn()) != null) {
i12 = autoReturn.intValue();
} else {
i12 = 0;
}
Payload payload10 = productPayResponse.getPayload();
if (payload10 != null && (checkout7 = payload10.getCheckout()) != null && (settings = checkout7.getSettings()) != null && (notificationUrl = settings.getNotificationUrl()) != null) {
String orderId = productPayResponse.getOrderId();
if (orderId != null) {
k.BePaidPayData bePaidPayData = new k.BePaidPayData(publicKey, "https://checkout.bepaid.by/ctp/api/", i.this.isTest, longValue, currency, description, trackingId, arrayList, str5, i12, notificationUrl, orderId);
this.f87706c = null;
this.f87705b = 3;
if (hVar.emit(bePaidPayData, this) == f11) {
return f11;
}
return Unit.f82492a;
}
throw new IllegalStateException("orderID is null".toString());
}
throw new IllegalStateException("notificationUrl is null".toString());
}
throw new IllegalStateException("contract is null".toString());
}
throw new IllegalStateException("trackingId is null".toString());
}
throw new IllegalStateException("description is null".toString());
}
throw new IllegalStateException("currency is null".toString());
}
throw new IllegalStateException("amount is null".toString());
}
throw new IllegalStateException("publicKey is null".toString());
}
throw new ap.a("unknown", null, 2, null);
}
hVar = (kotlinx.coroutines.flow.h) this.f87706c;
q.b(obj);
z11 = obj;
} else {
q.b(obj);
hVar = (kotlinx.coroutines.flow.h) this.f87706c;
kotlinx.coroutines.flow.g<ProductResponse> c11 = i.this.getProductUseCase.c(this.f87708e, this.f87709f, false);
this.f87706c = hVar;
this.f87705b = 1;
z11 = kotlinx.coroutines.flow.i.z(c11, this);
if (z11 == f11) {
return f11;
}
}
ProductResponse productResponse = (ProductResponse) z11;
if (productResponse != null) {
ProductPayBody productPayBody = new ProductPayBody(this.f87709f, this.f87710g, i.this.findPaymentForProductIDUseCase.a(productResponse, this.f87710g, this.f87711h), null, 8, null);
yo.i iVar2 = i.this.bumpRepository;
this.f87706c = hVar;
this.f87705b = 2;
i11 = iVar2.i(productPayBody, this);
if (i11 == f11) {
return f11;
}
e0 e0Var2 = (e0) i11;
productPayResponse = (ProductPayResponse) e0Var2.a();
String str42 = null;
if (productPayResponse == null) {
}
if (productPayResponse == null) {
}
} else {
throw new IllegalStateException("could not get product".toString());
}
}
@Override
public final Object mo1invoke(kotlinx.coroutines.flow.h<? super k.BePaidPayData> hVar, j80.d<? super Unit> dVar) {
return ((a) create(hVar, dVar)).invokeSuspend(Unit.f82492a);
}
}
public i(yo.i bumpRepository, op.a findPaymentForProductIDUseCase, br.a getProductUseCase, d6.a dispatchersProvider, v moshi) {
s.j(bumpRepository, "bumpRepository");
s.j(findPaymentForProductIDUseCase, "findPaymentForProductIDUseCase");
s.j(getProductUseCase, "getProductUseCase");
s.j(dispatchersProvider, "dispatchersProvider");
s.j(moshi, "moshi");
this.bumpRepository = bumpRepository;
this.findPaymentForProductIDUseCase = findPaymentForProductIDUseCase;
this.getProductUseCase = getProductUseCase;
this.dispatchersProvider = dispatchersProvider;
this.moshi = moshi;
this.isTest = FeatureToggles.INSTANCE.getBEPAID_NATIVE_WIDGET_DEBUG_MODE().isEnabled();
}
public final kotlinx.coroutines.flow.g<k.BePaidPayData> f(an.a vasType, Long adID, String productID, ir.c paymentType) {
s.j(vasType, "vasType");
s.j(productID, "productID");
s.j(paymentType, "paymentType");
return kotlinx.coroutines.flow.i.L(kotlinx.coroutines.flow.i.H(new a(vasType, adID, productID, paymentType, null)), this.dispatchersProvider.getIO());
}
}