Skip to content

Commit

Permalink
fix(core): fix setup mandate payments to store connector mandate deta…
Browse files Browse the repository at this point in the history
…ils (#6446)
  • Loading branch information
Aprabhat19 committed Oct 28, 2024
1 parent 8384182 commit 3ee735e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions crates/router/src/core/payments/operations/payment_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,34 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestDa
))
.await?;

payment_data.payment_method_info = if let Some(payment_method_id) = &payment_method_id {
match state
.store
.find_payment_method(
&(state.into()),
key_store,
payment_method_id,
merchant_account.storage_scheme,
)
.await
{
Ok(payment_method) => Some(payment_method),
Err(error) => {
if error.current_context().is_db_not_found() {
logger::info!("Payment Method not found in db {:?}", error);
None
} else {
Err(error)
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Error retrieving payment method from db")
.map_err(|err| logger::error!(payment_method_retrieve=?err))
.ok()
}
}
}
} else {
None
};
let mandate_id = mandate::mandate_procedure(
state,
resp,
Expand Down

0 comments on commit 3ee735e

Please sign in to comment.