feat(connector): enforce logging for connector requests (#1467)

Signed-off-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com>
Co-authored-by: Chethan <chethan.rao@juspay.in>
Co-authored-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com>
Co-authored-by: hrithikesh026 <hrithikeshmylatty@gmail.com>
Co-authored-by: Shankar Singh C <shankar.singh@juspay.in>
Co-authored-by: Prasunna Soppa <prasunna.soppa@juspay.in>
This commit is contained in:
Sai Harsha Vardhan
2023-06-22 15:08:32 +05:30
committed by GitHub
parent d321aa1f72
commit e575fde6dc
51 changed files with 1082 additions and 751 deletions

View File

@ -18,7 +18,7 @@ use crate::{
routes::AppState,
services,
types::{
api, domain,
self, api, domain,
storage::{self, enums},
transformers::{ForeignInto, ForeignTryInto},
},
@ -570,10 +570,12 @@ pub async fn trigger_webhook_to_merchant<W: api::OutgoingWebhookType>(
let transformed_outgoing_webhook = W::from(webhook);
let transformed_outgoing_webhook_string =
Encode::<serde_json::Value>::encode_to_string_of_json(&transformed_outgoing_webhook)
.change_context(errors::WebhooksFlowError::OutgoingWebhookEncodingFailed)
.attach_printable("There was an issue when encoding the outgoing webhook body")?;
let transformed_outgoing_webhook_string = types::RequestBody::log_and_get_request_body(
&transformed_outgoing_webhook,
Encode::<serde_json::Value>::encode_to_string_of_json,
)
.change_context(errors::WebhooksFlowError::OutgoingWebhookEncodingFailed)
.attach_printable("There was an issue when encoding the outgoing webhook body")?;
let mut header = vec![(
reqwest::header::CONTENT_TYPE.to_string(),