fix(connector): make webhook source verification mandatory for adyen (#2360)

This commit is contained in:
Hrithikesh
2023-09-26 12:30:51 +05:30
committed by GitHub
parent d8c384573e
commit 3d7e22a4f1
3 changed files with 11 additions and 0 deletions

View File

@ -104,6 +104,9 @@ impl ConnectorValidation for Adyen {
}
.into())
}
fn is_webhook_source_verification_mandatory(&self) -> bool {
true
}
}
impl api::Payment for Adyen {}

View File

@ -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);

View File

@ -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]