Skip to content

Commit

Permalink
chore: don't propogate error for failed save card
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangamesh26 committed Oct 16, 2023
1 parent 404586d commit ef0ef60
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions crates/router/src/core/payments/flows/complete_authorize_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,12 @@ impl Feature<api::CompleteAuthorize, types::CompleteAuthorizeData>
.await;

let pm_id = match save_payment_result {
Ok(payment_method_id) => Ok(payment_method_id),
Ok(payment_method_id) => payment_method_id,
Err(error) => {
if resp.request.setup_mandate_details.clone().is_some() {
Err(error)
} else {
services::logger::error!(save_payment_method_error=?error);
Ok(None)
}
services::logger::error!(save_payment_method_error=?error);
None
}
}?;
};

Ok(mandate::mandate_procedure(state, resp, customer, pm_id).await?)
}
Expand Down

0 comments on commit ef0ef60

Please sign in to comment.