Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/sms_verification/prelude_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,23 @@ pub enum PreludeBlockedReason {
InBlockList,
/// The phone number is not a valid line number (e.g. landline).
InvalidPhoneLine,
/// The phone number is not a valid phone number (e.g. unallocated range).
InvalidPhoneNumber,
/// The signature of the SDK signals is invalid.
InvalidSignature,
/// The phone number has made too many verification attempts.
RepeatedAttempts,
/// The verification attempt was deemed suspicious by the anti-fraud system.
Suspicious,
/// Prelude API returned Blocked status without a reason.
/// Prelude API returned a blocked reason we don't recognise.
#[serde(other)]
Unknown,
}

fn default_blocked_reason() -> PreludeBlockedReason {
PreludeBlockedReason::Unknown
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(tag = "status", rename_all = "lowercase")]
pub enum PreludeCreateVerificationResponse {
Expand All @@ -170,6 +177,7 @@ pub enum PreludeCreateVerificationResponse {
},
Blocked {
id: String,
#[serde(default = "default_blocked_reason")]
reason: PreludeBlockedReason,
},
}
Expand Down
Loading