fix(connector): Fixed status mapping for Plaid (#5525)

This commit is contained in:
Sarthak Soni
2024-08-05 19:50:39 +05:30
committed by GitHub
parent a3e01bb4ae
commit 4364630d6f

View File

@ -233,16 +233,16 @@ impl From<PlaidPaymentStatus> for enums::AttemptStatus {
fn from(item: PlaidPaymentStatus) -> Self {
match item {
PlaidPaymentStatus::PaymentStatusAuthorising => Self::Authorizing,
PlaidPaymentStatus::PaymentStatusBlocked => Self::AuthorizationFailed,
PlaidPaymentStatus::PaymentStatusBlocked
| PlaidPaymentStatus::PaymentStatusInsufficientFunds
| PlaidPaymentStatus::PaymentStatusRejected => Self::AuthorizationFailed,
PlaidPaymentStatus::PaymentStatusCancelled => Self::Voided,
PlaidPaymentStatus::PaymentStatusEstablished => Self::Authorized,
PlaidPaymentStatus::PaymentStatusExecuted => Self::Authorized,
PlaidPaymentStatus::PaymentStatusExecuted
| PlaidPaymentStatus::PaymentStatusSettled
| PlaidPaymentStatus::PaymentStatusInitiated => Self::Charged,
PlaidPaymentStatus::PaymentStatusFailed => Self::Failure,
PlaidPaymentStatus::PaymentStatusInitiated => Self::AuthenticationPending,
PlaidPaymentStatus::PaymentStatusInputNeeded => Self::AuthenticationPending,
PlaidPaymentStatus::PaymentStatusInsufficientFunds => Self::AuthorizationFailed,
PlaidPaymentStatus::PaymentStatusRejected => Self::AuthorizationFailed,
PlaidPaymentStatus::PaymentStatusSettled => Self::Charged,
}
}
}