revert: connector_label in webhook url is reverted back to connector_name (#1779)

This commit is contained in:
Hrithikesh
2023-07-25 09:58:28 +05:30
committed by GitHub
parent 4ce53092a6
commit a229c37a7c
7 changed files with 167 additions and 45 deletions

View File

@ -630,18 +630,9 @@ pub async fn webhooks_core<W: types::OutgoingWebhookType>(
req: &actix_web::HttpRequest,
merchant_account: domain::MerchantAccount,
key_store: domain::MerchantKeyStore,
connector_label: &str,
connector_name: &str,
body: actix_web::web::Bytes,
) -> RouterResponse<serde_json::Value> {
let connector_name = connector_label
.split('_') //connector_name will be the first string after splitting connector_label
.next()
.ok_or(errors::ApiErrorResponse::InvalidDataValue {
field_name: "connector_label",
})
.into_report()
.attach_printable("Failed to infer connector_name from connector_label")?;
metrics::WEBHOOK_INCOMING_COUNT.add(
&metrics::CONTEXT,
1,
@ -688,7 +679,7 @@ pub async fn webhooks_core<W: types::OutgoingWebhookType>(
let process_webhook_further = utils::lookup_webhook_event(
&*state.store,
connector_label,
connector_name,
&merchant_account.merchant_id,
&event_type,
)
@ -704,7 +695,7 @@ pub async fn webhooks_core<W: types::OutgoingWebhookType>(
&*state.store,
&request_details,
&merchant_account.merchant_id,
connector_label,
connector_name,
&key_store,
)
.await