Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
fix: [CYBERSOURCE] Update status handling for AuthorizedPendingReview (#5534)
DEEPANSHU BANSAL2f3a463253c1
diff --git a/crates/router/src/connector/cybersource/transformers.rs b/crates/router/src/connector/cybersource/transformers.rsindex 86960b43ca..c68f0e6069 100644--- a/crates/router/src/connector/cybersource/transformers.rs+++ b/crates/router/src/connector/cybersource/transformers.rs@@ -1730,8 +1730,7 @@ pub enum CybersourceIncrementalAuthorizationStatus {impl ForeignFrom<(CybersourcePaymentStatus, bool)> for enums::AttemptStatus {fn foreign_from((status, capture): (CybersourcePaymentStatus, bool)) -> Self {match status {- CybersourcePaymentStatus::Authorized- | CybersourcePaymentStatus::AuthorizedPendingReview => {+ CybersourcePaymentStatus::Authorized => {if capture {// Because Cybersource will return Payment Status as Authorized even in AutoCapture PaymentSelf::Charged@@ -1739,13 +1738,6 @@ impl ForeignFrom<(CybersourcePaymentStatus, bool)> for enums::AttemptStatus {Self::Authorized}}- CybersourcePaymentStatus::Pending => {- if capture {- Self::Charged- } else {- Self::Pending- }- }CybersourcePaymentStatus::Succeeded | CybersourcePaymentStatus::Transmitted => {Self::Charged}@@ -1762,7 +1754,9 @@ impl ForeignFrom<(CybersourcePaymentStatus, bool)> for enums::AttemptStatus {CybersourcePaymentStatus::PendingReview| CybersourcePaymentStatus::StatusNotReceived| CybersourcePaymentStatus::Challenge- | CybersourcePaymentStatus::Accepted => Self::Pending,+ | CybersourcePaymentStatus::Accepted+ | CybersourcePaymentStatus::Pending+ | CybersourcePaymentStatus::AuthorizedPendingReview => Self::Pending,}}}@@ -1770,8 +1764,8 @@ impl ForeignFrom<(CybersourcePaymentStatus, bool)> for enums::AttemptStatus {impl From<CybersourceIncrementalAuthorizationStatus> for common_enums::AuthorizationStatus {fn from(item: CybersourceIncrementalAuthorizationStatus) -> Self {match item {- CybersourceIncrementalAuthorizationStatus::Authorized- | CybersourceIncrementalAuthorizationStatus::AuthorizedPendingReview => Self::Success,+ CybersourceIncrementalAuthorizationStatus::Authorized => Self::Success,+ CybersourceIncrementalAuthorizationStatus::AuthorizedPendingReview => Self::Processing,CybersourceIncrementalAuthorizationStatus::Declined => Self::Failure,}}