mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
fix(router/webhooks): correct webhook error mapping and make source verification optional for all connectors (#1333)
This commit is contained in:
@ -629,7 +629,9 @@ pub async fn webhooks_core<W: api::OutgoingWebhookType>(
|
||||
connector_name,
|
||||
api::GetToken::Connector,
|
||||
)
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.change_context(errors::ApiErrorResponse::InvalidRequestData {
|
||||
message: "invalid connnector name received".to_string(),
|
||||
})
|
||||
.attach_printable("Failed construction of ConnectorData")?;
|
||||
|
||||
let connector = connector.connector;
|
||||
@ -654,7 +656,7 @@ pub async fn webhooks_core<W: api::OutgoingWebhookType>(
|
||||
|
||||
let event_type = connector
|
||||
.get_webhook_event_type(&request_details)
|
||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||
.switch()
|
||||
.attach_printable("Could not find event type in incoming webhook body")?;
|
||||
|
||||
let process_webhook_further = utils::lookup_webhook_event(
|
||||
|
||||
Reference in New Issue
Block a user