mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(payments): add outgoing payments webhooks (#3133)
This commit is contained in:
@ -89,7 +89,7 @@ pub async fn payments_operation_core<F, Req, Op, FData, Ctx>(
|
|||||||
)>
|
)>
|
||||||
where
|
where
|
||||||
F: Send + Clone + Sync,
|
F: Send + Clone + Sync,
|
||||||
Req: Authenticate,
|
Req: Authenticate + Clone,
|
||||||
Op: Operation<F, Req, Ctx> + Send + Sync,
|
Op: Operation<F, Req, Ctx> + Send + Sync,
|
||||||
|
|
||||||
// To create connector flow specific interface data
|
// To create connector flow specific interface data
|
||||||
@ -423,6 +423,23 @@ where
|
|||||||
.await?;
|
.await?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let cloned_payment_data = payment_data.clone();
|
||||||
|
let cloned_customer = customer.clone();
|
||||||
|
let cloned_request = req.clone();
|
||||||
|
|
||||||
|
crate::utils::trigger_payments_webhook(
|
||||||
|
merchant_account,
|
||||||
|
business_profile,
|
||||||
|
cloned_payment_data,
|
||||||
|
Some(cloned_request),
|
||||||
|
cloned_customer,
|
||||||
|
state,
|
||||||
|
operation,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.map_err(|error| logger::warn!(payments_outgoing_webhook_error=?error))
|
||||||
|
.ok();
|
||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
payment_data,
|
payment_data,
|
||||||
req,
|
req,
|
||||||
@ -624,7 +641,7 @@ where
|
|||||||
F: Send + Clone + Sync,
|
F: Send + Clone + Sync,
|
||||||
FData: Send + Sync,
|
FData: Send + Sync,
|
||||||
Op: Operation<F, Req, Ctx> + Send + Sync + Clone,
|
Op: Operation<F, Req, Ctx> + Send + Sync + Clone,
|
||||||
Req: Debug + Authenticate,
|
Req: Debug + Authenticate + Clone,
|
||||||
Res: transformers::ToResponse<Req, PaymentData<F>, Op>,
|
Res: transformers::ToResponse<Req, PaymentData<F>, Op>,
|
||||||
// To create connector flow specific interface data
|
// To create connector flow specific interface data
|
||||||
PaymentData<F>: ConstructFlowSpecificData<F, FData, router_types::PaymentsResponseData>,
|
PaymentData<F>: ConstructFlowSpecificData<F, FData, router_types::PaymentsResponseData>,
|
||||||
|
|||||||
Reference in New Issue
Block a user