paypal_rust/resources/enums/
capture_status_reason.rs

1use serde::{Deserialize, Serialize};
2
3/// The reason why the captured payment status is PENDING or DENIED.
4#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
5pub enum CaptureStatusReason {
6    /// The payer initiated a dispute for this captured payment with PayPal.
7    #[serde(rename = "BUYER_COMPLAINT")]
8    BuyerComplaint,
9    /// The captured funds were reversed in response to the payer disputing this captured payment with the issuer of the
10    /// financial instrument used to pay for this captured payment.
11    #[serde(rename = "CHARGEBACK")]
12    Chargeback,
13    /// The payer paid by an eCheck that has not yet cleared.
14    #[serde(rename = "ECHECK")]
15    Echeck,
16    /// Visit your online account. In your **Account Overview**, accept and deny this payment.
17    #[serde(rename = "INTERNATIONAL_WITHDRAWAL")]
18    InternationalWithdrawal,
19    /// No additional specific reason can be provided. For more information about this captured payment, visit your account online
20    /// or contact PayPal.
21    #[serde(rename = "OTHER")]
22    Other,
23    /// The captured payment is pending manual review.
24    #[serde(rename = "PENDING_REVIEW")]
25    PendingReview,
26    /// The payee has not yet set up appropriate receiving preferences for their account.
27    /// For more information about how to accept or deny this payment, visit your account online. This reason is typically offered in
28    /// scenarios such as when the currency of the captured payment is different from the primary holding currency of the payee.
29    #[serde(rename = "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION")]
30    ReceivingPreferenceMandatesManualAction,
31    /// The captured funds were refunded.
32    #[serde(rename = "REFUNDED")]
33    Refunded,
34    /// The payer must send the funds for this captured payment. This code generally appears for
35    /// manual EFTs.
36    #[serde(rename = "TRANSACTION_APPROVED_AWAITING_FUNDING")]
37    TransactionApprovedAwaitingFunding,
38    /// The payee does not have a PayPal account.
39    #[serde(rename = "UNILATERAL")]
40    Unilateral,
41    /// The payee's PayPal account is not verified.
42    #[serde(rename = "VERIFICATION_REQUIRED")]
43    VerificationRequired,
44}
45
46impl CaptureStatusReason {
47    pub const fn as_str(self) -> &'static str {
48        match self {
49            Self::BuyerComplaint => "BUYER_COMPLAINT",
50            Self::Chargeback => "CHARGEBACK",
51            Self::Echeck => "ECHECK",
52            Self::InternationalWithdrawal => "INTERNATIONAL_WITHDRAWAL",
53            Self::Other => "OTHER",
54            Self::PendingReview => "PENDING_REVIEW",
55            Self::ReceivingPreferenceMandatesManualAction => {
56                "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION"
57            }
58            Self::Refunded => "REFUNDED",
59            Self::TransactionApprovedAwaitingFunding => "TRANSACTION_APPROVED_AWAITING_FUNDING",
60            Self::Unilateral => "UNILATERAL",
61            Self::VerificationRequired => "VERIFICATION_REQUIRED",
62        }
63    }
64}
65
66impl AsRef<str> for CaptureStatusReason {
67    fn as_ref(&self) -> &str {
68        self.as_str()
69    }
70}
71
72impl std::fmt::Display for CaptureStatusReason {
73    fn fmt(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
74        self.as_str().fmt(formatter)
75    }
76}