Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
use actix_web::{web, HttpRequest, Responder};
use router_env::{instrument, Flow};
use super::app::AppState;
use crate::{
core::{api_locking, webhooks},
services::{api, authentication as auth},
types::domain,
};
#[instrument(skip_all, fields(flow = ?Flow::IncomingWebhookReceive))]
pub async fn recovery_receive_incoming_webhook(
state: web::Data<AppState>,
req: HttpRequest,
body: web::Bytes,
path: web::Path<(
common_utils::id_type::MerchantId,
common_utils::id_type::ProfileId,
common_utils::id_type::MerchantConnectorAccountId,
)>,
) -> impl Responder {
let flow = Flow::RecoveryIncomingWebhookReceive;
let (merchant_id, profile_id, connector_id) = path.into_inner();
Box::pin(api::server_wrap(
flow,
state,
&req,
(),
|state, auth, _, req_state| {
webhooks::incoming_webhooks_wrapper(
state.to_owned(),
req_state,
&req,
auth.platform,
auth.profile,
&connector_id,
body.clone(),
false,
)
},
&auth::MerchantIdAndProfileIdAuth {
merchant_id,
profile_id,
},
api_locking::LockAction::NotApplicable,
))
.await
}