From c52dbd6fc21c9c16ebc8f2abed1d2979bc5a606b Mon Sep 17 00:00:00 2001 From: DEEPANSHU BANSAL <41580413+deepanshu-iiitu@users.noreply.github.com> Date: Fri, 15 Mar 2024 18:57:52 +0530 Subject: [PATCH] feat(connector): [BOA/CYB] Add support for payment status ACCEPTED and CANCELLED (#4107) --- .../src/connector/bankofamerica/transformers.rs | 14 ++++++++------ .../src/connector/cybersource/transformers.rs | 12 ++++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/crates/router/src/connector/bankofamerica/transformers.rs b/crates/router/src/connector/bankofamerica/transformers.rs index 8e30e2b047..b9a1432102 100644 --- a/crates/router/src/connector/bankofamerica/transformers.rs +++ b/crates/router/src/connector/bankofamerica/transformers.rs @@ -896,6 +896,8 @@ pub enum BankofamericaPaymentStatus { ServerError, PendingAuthentication, PendingReview, + Accepted, + Cancelled, //PartialAuthorized, not being consumed yet. } @@ -921,9 +923,9 @@ impl ForeignFrom<(BankofamericaPaymentStatus, bool)> for enums::AttemptStatus { BankofamericaPaymentStatus::Succeeded | BankofamericaPaymentStatus::Transmitted => { Self::Charged } - BankofamericaPaymentStatus::Voided | BankofamericaPaymentStatus::Reversed => { - Self::Voided - } + BankofamericaPaymentStatus::Voided + | BankofamericaPaymentStatus::Reversed + | BankofamericaPaymentStatus::Cancelled => Self::Voided, BankofamericaPaymentStatus::Failed | BankofamericaPaymentStatus::Declined | BankofamericaPaymentStatus::AuthorizedRiskDeclined @@ -931,9 +933,9 @@ impl ForeignFrom<(BankofamericaPaymentStatus, bool)> for enums::AttemptStatus { | BankofamericaPaymentStatus::Rejected | BankofamericaPaymentStatus::ServerError => Self::Failure, BankofamericaPaymentStatus::PendingAuthentication => Self::AuthenticationPending, - BankofamericaPaymentStatus::PendingReview | BankofamericaPaymentStatus::Challenge => { - Self::Pending - } + BankofamericaPaymentStatus::PendingReview + | BankofamericaPaymentStatus::Challenge + | BankofamericaPaymentStatus::Accepted => Self::Pending, } } } diff --git a/crates/router/src/connector/cybersource/transformers.rs b/crates/router/src/connector/cybersource/transformers.rs index fb80c0a1c4..d9fab9a902 100644 --- a/crates/router/src/connector/cybersource/transformers.rs +++ b/crates/router/src/connector/cybersource/transformers.rs @@ -1397,6 +1397,8 @@ pub enum CybersourcePaymentStatus { ServerError, PendingAuthentication, PendingReview, + Accepted, + Cancelled, //PartialAuthorized, not being consumed yet. } @@ -1430,7 +1432,9 @@ impl ForeignFrom<(CybersourcePaymentStatus, bool)> for enums::AttemptStatus { CybersourcePaymentStatus::Succeeded | CybersourcePaymentStatus::Transmitted => { Self::Charged } - CybersourcePaymentStatus::Voided | CybersourcePaymentStatus::Reversed => Self::Voided, + CybersourcePaymentStatus::Voided + | CybersourcePaymentStatus::Reversed + | CybersourcePaymentStatus::Cancelled => Self::Voided, CybersourcePaymentStatus::Failed | CybersourcePaymentStatus::Declined | CybersourcePaymentStatus::AuthorizedRiskDeclined @@ -1438,9 +1442,9 @@ impl ForeignFrom<(CybersourcePaymentStatus, bool)> for enums::AttemptStatus { | CybersourcePaymentStatus::InvalidRequest | CybersourcePaymentStatus::ServerError => Self::Failure, CybersourcePaymentStatus::PendingAuthentication => Self::AuthenticationPending, - CybersourcePaymentStatus::PendingReview | CybersourcePaymentStatus::Challenge => { - Self::Pending - } + CybersourcePaymentStatus::PendingReview + | CybersourcePaymentStatus::Challenge + | CybersourcePaymentStatus::Accepted => Self::Pending, } } }