discord-jadx/app/src/main/java/com/discord/utilities/billing/BillingUtils$verifyPurchase...

40 lines
1.9 KiB
Java

package com.discord.utilities.billing;
import com.android.billingclient.api.Purchase;
import com.discord.restapi.RestAPIParams;
import com.discord.stores.StoreGooglePlayPurchases;
import com.discord.stores.StoreStream;
import d0.z.d.m;
import d0.z.d.o;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
/* compiled from: BillingUtils.kt */
public final class BillingUtils$verifyPurchase$1 extends o implements Function1<RestAPIParams.VerifyPurchaseResponse, Unit> {
public final /* synthetic */ Purchase $purchase;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public BillingUtils$verifyPurchase$1(Purchase purchase) {
super(1);
this.$purchase = purchase;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(RestAPIParams.VerifyPurchaseResponse verifyPurchaseResponse) {
invoke(verifyPurchaseResponse);
return Unit.a;
}
public final void invoke(RestAPIParams.VerifyPurchaseResponse verifyPurchaseResponse) {
StoreStream.Companion.getGooglePlayPurchases().onVerificationSuccess(new StoreGooglePlayPurchases.VerificationResult(this.$purchase, verifyPurchaseResponse));
GooglePlayInAppSkus googlePlayInAppSkus = GooglePlayInAppSkus.INSTANCE;
String b = this.$purchase.b();
m.checkNotNullExpressionValue(b, "purchase.sku");
GooglePlayInAppSku inAppSku = googlePlayInAppSkus.getInAppSku(b);
if (inAppSku != null) {
GooglePlayBillingManager.INSTANCE.consumePurchase(this.$purchase, inAppSku.getType(), verifyPurchaseResponse != null ? Long.valueOf(verifyPurchaseResponse.getVerifiedSkuId()) : null);
}
}
}