stripe/model/review.rs
1use serde::{Serialize, Deserialize};
2/**Reviews can be used to supplement automated fraud detection with human expertise.
3
4Learn more about [Radar](/radar) and reviewing payments
5[here](https://stripe.com/docs/radar/reviews).*/
6#[derive(Debug, Clone, Serialize, Deserialize, Default)]
7pub struct Review {
8 ///The ZIP or postal code of the card used, if applicable.
9 #[serde(skip_serializing_if = "Option::is_none")]
10 pub billing_zip: Option<String>,
11 ///The charge associated with this review.
12 #[serde(skip_serializing_if = "Option::is_none")]
13 pub charge: Option<serde_json::Value>,
14 ///The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`.
15 #[serde(skip_serializing_if = "Option::is_none")]
16 pub closed_reason: Option<String>,
17 ///Time at which the object was created. Measured in seconds since the Unix epoch.
18 pub created: i64,
19 ///Unique identifier for the object.
20 pub id: String,
21 ///The IP address where the payment originated.
22 #[serde(skip_serializing_if = "Option::is_none")]
23 pub ip_address: Option<String>,
24 ///Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address.
25 #[serde(skip_serializing_if = "Option::is_none")]
26 pub ip_address_location: Option<serde_json::Value>,
27 ///Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
28 pub livemode: bool,
29 ///String representing the object's type. Objects of the same type share the same value.
30 pub object: String,
31 ///If `true`, the review needs action.
32 pub open: bool,
33 ///The reason the review was opened. One of `rule` or `manual`.
34 pub opened_reason: String,
35 ///The PaymentIntent ID associated with this review, if one exists.
36 #[serde(skip_serializing_if = "Option::is_none")]
37 pub payment_intent: Option<serde_json::Value>,
38 ///The reason the review is currently open or closed. One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`.
39 pub reason: String,
40 ///Information related to the browsing session of the user who initiated the payment.
41 #[serde(skip_serializing_if = "Option::is_none")]
42 pub session: Option<serde_json::Value>,
43}
44impl std::fmt::Display for Review {
45 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
46 write!(f, "{}", serde_json::to_string(self).unwrap())
47 }
48}