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

This commit is contained in:
Chethan Rao
2024-03-20 16:55:46 +05:30
committed by GitHub
parent 9b9bce80a6
commit 0e9b2524cf

View File

@ -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