mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 21:37:41 +08:00
fix(core): fix setup mandate payments to store connector mandate details (#6446)
This commit is contained in:
@ -1085,6 +1085,34 @@ impl<F: Clone> PostUpdateTracker<F, PaymentData<F>, types::SetupMandateRequestDa
|
|||||||
))
|
))
|
||||||
.await?;
|
.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(
|
let mandate_id = mandate::mandate_procedure(
|
||||||
state,
|
state,
|
||||||
resp,
|
resp,
|
||||||
|
|||||||
Reference in New Issue
Block a user