mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +08:00
fix(connector): make webhook source verification mandatory for adyen (#2360)
This commit is contained in:
@ -104,6 +104,9 @@ impl ConnectorValidation for Adyen {
|
||||
}
|
||||
.into())
|
||||
}
|
||||
fn is_webhook_source_verification_mandatory(&self) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
impl api::Payment for Adyen {}
|
||||
|
||||
@ -895,6 +895,10 @@ pub async fn webhooks_core<W: types::OutgoingWebhookType>(
|
||||
merchant_account.merchant_id.clone(),
|
||||
)],
|
||||
);
|
||||
} else if connector.is_webhook_source_verification_mandatory() {
|
||||
// if webhook consumption is mandatory for connector, fail webhook
|
||||
// so that merchant can retrigger it after updating merchant_secret
|
||||
return Err(errors::ApiErrorResponse::WebhookAuthenticationFailed.into());
|
||||
}
|
||||
|
||||
logger::info!(source_verified=?source_verified);
|
||||
|
||||
@ -88,6 +88,10 @@ pub trait ConnectorValidation: ConnectorCommon {
|
||||
.change_context(errors::ConnectorError::MissingConnectorTransactionID)
|
||||
.map(|_| ())
|
||||
}
|
||||
|
||||
fn is_webhook_source_verification_mandatory(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
|
||||
Reference in New Issue
Block a user