mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-08 09:18:39 +01:00
committed by
Greyson Parrelli
parent
be92b3cf0a
commit
cafbf48783
@@ -58,7 +58,7 @@ sealed class PaymentSourceType {
|
||||
|
||||
companion object {
|
||||
fun fromCode(code: String?): PaymentSourceType {
|
||||
return when (Codes.values().firstOrNull { it.code == code } ?: Codes.UNKNOWN) {
|
||||
return when (Codes.entries.firstOrNull { it.code == code } ?: Codes.UNKNOWN) {
|
||||
Codes.UNKNOWN -> Unknown
|
||||
Codes.PAY_PAL -> PayPal
|
||||
Codes.CREDIT_CARD -> Stripe.CreditCard
|
||||
|
||||
@@ -58,7 +58,7 @@ sealed class StripeDeclineCode(val rawCode: String) {
|
||||
return Unknown("null")
|
||||
}
|
||||
|
||||
val typedCode: Code? = Code.values().firstOrNull { it.code == code }
|
||||
val typedCode: Code? = Code.entries.firstOrNull { it.code == code }
|
||||
return typedCode?.let { Known(typedCode) } ?: Unknown(code)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ sealed class StripeFailureCode(val rawCode: String) {
|
||||
return Unknown("null")
|
||||
}
|
||||
|
||||
val typedCode: Code? = Code.values().firstOrNull { it.code == code }
|
||||
val typedCode: Code? = Code.entries.firstOrNull { it.code == code }
|
||||
return typedCode?.let { Known(typedCode) } ?: Unknown(code)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,6 @@ enum class StripeIntentStatus(private val code: String) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@JsonCreator
|
||||
fun fromCode(code: String): StripeIntentStatus = StripeIntentStatus.values().first { it.code == code }
|
||||
fun fromCode(code: String): StripeIntentStatus = entries.first { it.code == code }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user