203 lines
5.3 KiB
Smali
203 lines
5.3 KiB
Smali
.class public final Lcom/discord/models/domain/ModelPaymentSource$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "ModelPaymentSource.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/models/domain/ModelPaymentSource;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Companion"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/models/domain/ModelPaymentSource$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final wrap(Lcom/discord/models/domain/PaymentSourceRaw;)Lcom/discord/models/domain/ModelPaymentSource;
|
|
.locals 10
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lcom/discord/models/domain/ModelPaymentSource$UnableToWrapException;
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
:try_start_0
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getType()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-eq v1, v2, :cond_2
|
|
|
|
const/4 v2, 0x2
|
|
|
|
if-ne v1, v2, :cond_1
|
|
|
|
new-instance v1, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourcePaypal;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getEmail()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getId()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getInvalid()Z
|
|
|
|
move-result v6
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getBillingAddress()Lcom/discord/models/domain/ModelBillingAddress;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getDefault()Z
|
|
|
|
move-result v8
|
|
|
|
move-object v3, v1
|
|
|
|
invoke-direct/range {v3 .. v8}, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourcePaypal;-><init>(Ljava/lang/String;Ljava/lang/String;ZLcom/discord/models/domain/ModelBillingAddress;Z)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-static {}, Lt/u/b/j;->throwNpe()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
:try_start_1
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "unsupported payment source type: "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getType()I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
new-instance v9, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getBrand()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getLast_4()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getExpiresMonth()I
|
|
|
|
move-result v3
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getExpiresYear()I
|
|
|
|
move-result v4
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getId()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getInvalid()Z
|
|
|
|
move-result v6
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getBillingAddress()Lcom/discord/models/domain/ModelBillingAddress;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/PaymentSourceRaw;->getDefault()Z
|
|
|
|
move-result v8
|
|
|
|
move-object v0, v9
|
|
|
|
invoke-direct/range {v0 .. v8}, Lcom/discord/models/domain/ModelPaymentSource$ModelPaymentSourceCard;-><init>(Ljava/lang/String;Ljava/lang/String;IILjava/lang/String;ZLcom/discord/models/domain/ModelBillingAddress;Z)V
|
|
|
|
move-object v1, v9
|
|
|
|
:goto_0
|
|
return-object v1
|
|
|
|
:cond_3
|
|
invoke-static {}, Lt/u/b/j;->throwNpe()V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw v0
|
|
|
|
:cond_4
|
|
:try_start_2
|
|
invoke-static {}, Lt/u/b/j;->throwNpe()V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
throw v0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
new-instance v0, Lcom/discord/models/domain/ModelPaymentSource$UnableToWrapException;
|
|
|
|
invoke-direct {v0, p1}, Lcom/discord/models/domain/ModelPaymentSource$UnableToWrapException;-><init>(Ljava/lang/Throwable;)V
|
|
|
|
throw v0
|
|
|
|
:cond_5
|
|
const-string p1, "raw"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|