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

fix(payment_methods): update payment method status only if existing status is not active (#4149)

Chethan Rao0e9b2524cf22
diff --git a/crates/router/src/core/payments/operations/payment_response.rs b/crates/router/src/core/payments/operations/payment_response.rs
index ae350d6de2..0167f16cb8 100644
--- a/crates/router/src/core/payments/operations/payment_response.rs
+++ b/crates/router/src/core/payments/operations/payment_response.rs
@@ -936,7 +936,9 @@ async fn update_payment_method_status<F: Clone>(
.await
.to_not_found_response(errors::ApiErrorResponse::PaymentMethodNotFound)?;
- if pm.status != attempt_status.into() {
+ if pm.status != common_enums::PaymentMethodStatus::Active
+ && pm.status != attempt_status.into()
+ {
let updated_pm_status = common_enums::PaymentMethodStatus::from(attempt_status);
payment_data