stripe/model/
identity_verification_session.rs

1use serde::{Serialize, Deserialize};
2/**A VerificationSession guides you through the process of collecting and verifying the identities
3of your users. It contains details about the type of verification, such as what [verification
4check](/docs/identity/verification-checks) to perform. Only create one VerificationSession for
5each verification in your system.
6
7A VerificationSession transitions through [multiple
8statuses](/docs/identity/how-sessions-work) throughout its lifetime as it progresses through
9the verification flow. The VerificationSession contains the user's verified data after
10verification checks are complete.
11
12Related guide: [The Verification Sessions API](https://stripe.com/docs/identity/verification-sessions)*/
13#[derive(Debug, Clone, Serialize, Deserialize, Default)]
14pub struct IdentityVerificationSession {
15    ///The short-lived client secret used by Stripe.js to [show a verification modal](https://stripe.com/docs/js/identity/modal) inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on [passing the client secret to the frontend](https://stripe.com/docs/identity/verification-sessions#client-secret) to learn more.
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub client_secret: Option<String>,
18    ///Time at which the object was created. Measured in seconds since the Unix epoch.
19    pub created: i64,
20    ///Unique identifier for the object.
21    pub id: String,
22    ///If present, this property tells you the last error encountered when processing the verification.
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub last_error: Option<serde_json::Value>,
25    ///ID of the most recent VerificationReport. [Learn more about accessing detailed verification results.](https://stripe.com/docs/identity/verification-sessions#results)
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub last_verification_report: Option<serde_json::Value>,
28    ///Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
29    pub livemode: bool,
30    ///Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
31    pub metadata: serde_json::Value,
32    ///String representing the object's type. Objects of the same type share the same value.
33    pub object: String,
34    ///A set of options for the session’s verification checks.
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub options: Option<serde_json::Value>,
37    ///Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
38    #[serde(skip_serializing_if = "Option::is_none")]
39    pub redaction: Option<serde_json::Value>,
40    ///Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work).
41    pub status: String,
42    ///The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed.
43    #[serde(rename = "type")]
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub type_: Option<String>,
46    ///The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on [verifying identity documents](https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe.
47    #[serde(skip_serializing_if = "Option::is_none")]
48    pub url: Option<String>,
49    ///The user’s verified data.
50    #[serde(skip_serializing_if = "Option::is_none")]
51    pub verified_outputs: Option<serde_json::Value>,
52}
53impl std::fmt::Display for IdentityVerificationSession {
54    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
55        write!(f, "{}", serde_json::to_string(self).unwrap())
56    }
57}