Skip to content

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

feat(connector): [BOA/CYBERSOURCE] Populate connector_transaction_id (#3202)

DEEPANSHU BANSAL110d3d211be2
diff --git a/crates/router/src/connector/bankofamerica/transformers.rs b/crates/router/src/connector/bankofamerica/transformers.rs
index bae9d43da2..477bbec735 100644
--- a/crates/router/src/connector/bankofamerica/transformers.rs
+++ b/crates/router/src/connector/bankofamerica/transformers.rs
@@ -551,8 +551,16 @@ pub enum BankofamericaPaymentStatus {
Reversed,
Pending,
Declined,
+ Rejected,
+ Challenge,
AuthorizedPendingReview,
+ AuthorizedRiskDeclined,
Transmitted,
+ InvalidRequest,
+ ServerError,
+ PendingAuthentication,
+ PendingReview,
+ //PartialAuthorized, not being consumed yet.
}
impl ForeignFrom<(BankofamericaPaymentStatus, bool)> for enums::AttemptStatus {
@@ -580,8 +588,15 @@ impl ForeignFrom<(BankofamericaPaymentStatus, bool)> for enums::AttemptStatus {
BankofamericaPaymentStatus::Voided | BankofamericaPaymentStatus::Reversed => {
Self::Voided
}
- BankofamericaPaymentStatus::Failed | BankofamericaPaymentStatus::Declined => {
- Self::Failure
+ BankofamericaPaymentStatus::Failed
+ | BankofamericaPaymentStatus::Declined
+ | BankofamericaPaymentStatus::AuthorizedRiskDeclined
+ | BankofamericaPaymentStatus::InvalidRequest
+ | BankofamericaPaymentStatus::Rejected
+ | BankofamericaPaymentStatus::ServerError => Self::Failure,
+ BankofamericaPaymentStatus::PendingAuthentication => Self::AuthenticationPending,
+ BankofamericaPaymentStatus::PendingReview | BankofamericaPaymentStatus::Challenge => {
+ Self::Pending
}
}
}
@@ -747,7 +762,7 @@ impl<F>
reason: error_response.error_information.reason,
status_code: item.http_code,
attempt_status: None,
- connector_transaction_id: None,
+ connector_transaction_id: Some(error_response.id),
}),
status: enums::AttemptStatus::Failure,
..item.data
@@ -796,7 +811,7 @@ impl<F>
reason: error_response.error_information.reason,
status_code: item.http_code,
attempt_status: None,
- connector_transaction_id: None,
+ connector_transaction_id: Some(error_response.id),
}),
..item.data
}),
@@ -844,7 +859,7 @@ impl<F>
reason: error_response.error_information.reason,
status_code: item.http_code,
attempt_status: None,
- connector_transaction_id: None,
+ connector_transaction_id: Some(error_response.id),
}),
..item.data
}),
diff --git a/crates/router/src/connector/cybersource/transformers.rs b/crates/router/src/connector/cybersource/transformers.rs
index a19dc0d3c3..1d828a95d6 100644
--- a/crates/router/src/connector/cybersource/transformers.rs
+++ b/crates/router/src/connector/cybersource/transformers.rs
@@ -773,8 +773,16 @@ pub enum CybersourcePaymentStatus {
Reversed,
Pending,
Declined,
+ Rejected,
+ Challenge,
AuthorizedPendingReview,
+ AuthorizedRiskDeclined,
Transmitted,
+ InvalidRequest,
+ ServerError,
+ PendingAuthentication,
+ PendingReview,
+ //PartialAuthorized, not being consumed yet.
}
#[derive(Debug, Clone, Deserialize)]
@@ -808,7 +816,16 @@ impl ForeignFrom<(CybersourcePaymentStatus, bool)> for enums::AttemptStatus {
Self::Charged
}
CybersourcePaymentStatus::Voided | CybersourcePaymentStatus::Reversed => Self::Voided,
- CybersourcePaymentStatus::Failed | CybersourcePaymentStatus::Declined => Self::Failure,
+ CybersourcePaymentStatus::Failed
+ | CybersourcePaymentStatus::Declined
+ | CybersourcePaymentStatus::AuthorizedRiskDeclined
+ | CybersourcePaymentStatus::Rejected
+ | CybersourcePaymentStatus::InvalidRequest
+ | CybersourcePaymentStatus::ServerError => Self::Failure,
+ CybersourcePaymentStatus::PendingAuthentication => Self::AuthenticationPending,
+ CybersourcePaymentStatus::PendingReview | CybersourcePaymentStatus::Challenge => {
+ Self::Pending
+ }
}
}
}
@@ -922,7 +939,7 @@ impl<F, T>
reason: error_response.error_information.reason.clone(),
status_code: item.http_code,
attempt_status: None,
- connector_transaction_id: None,
+ connector_transaction_id: Some(error_response.id.clone()),
}),
..item.data
}