mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 02:57:02 +08:00
feat(mandate_kv): add kv support for mandate (#4275)
Co-authored-by: Akshay S <akshay.s@Akshay-Subramanian-D66TQ6D97K.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -434,6 +434,7 @@ pub async fn mandates_incoming_webhook_flow(
|
||||
.find_mandate_by_merchant_id_mandate_id(
|
||||
&merchant_account.merchant_id,
|
||||
mandate_id.as_str(),
|
||||
merchant_account.storage_scheme,
|
||||
)
|
||||
.await
|
||||
.to_not_found_response(errors::ApiErrorResponse::MandateNotFound)?,
|
||||
@ -443,6 +444,7 @@ pub async fn mandates_incoming_webhook_flow(
|
||||
.find_mandate_by_merchant_id_connector_mandate_id(
|
||||
&merchant_account.merchant_id,
|
||||
connector_mandate_id.as_str(),
|
||||
merchant_account.storage_scheme,
|
||||
)
|
||||
.await
|
||||
.to_not_found_response(errors::ApiErrorResponse::MandateNotFound)?,
|
||||
@ -452,11 +454,14 @@ pub async fn mandates_incoming_webhook_flow(
|
||||
let mandate_status = common_enums::MandateStatus::foreign_try_from(event_type)
|
||||
.change_context(errors::ApiErrorResponse::WebhookProcessingFailure)
|
||||
.attach_printable("event type to mandate status mapping failed")?;
|
||||
let mandate_id = mandate.mandate_id.clone();
|
||||
let updated_mandate = db
|
||||
.update_mandate_by_merchant_id_mandate_id(
|
||||
&merchant_account.merchant_id,
|
||||
&mandate.mandate_id,
|
||||
&mandate_id,
|
||||
storage::MandateUpdate::StatusUpdate { mandate_status },
|
||||
mandate,
|
||||
merchant_account.storage_scheme,
|
||||
)
|
||||
.await
|
||||
.to_not_found_response(errors::ApiErrorResponse::MandateNotFound)?;
|
||||
|
||||
Reference in New Issue
Block a user