mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat(webhook): add frm webhook support (#4662)
Signed-off-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -599,3 +599,8 @@ pub fn convert_pm_auth_connector(connector_name: &str) -> Option<PmAuthConnector
|
||||
pub fn convert_authentication_connector(connector_name: &str) -> Option<AuthenticationConnectors> {
|
||||
AuthenticationConnectors::from_str(connector_name).ok()
|
||||
}
|
||||
|
||||
#[cfg(feature = "frm")]
|
||||
pub fn convert_frm_connector(connector_name: &str) -> Option<FrmConnectors> {
|
||||
FrmConnectors::from_str(connector_name).ok()
|
||||
}
|
||||
|
||||
@ -39,6 +39,8 @@ pub enum IncomingWebhookEvent {
|
||||
MandateRevoked,
|
||||
EndpointVerification,
|
||||
ExternalAuthenticationARes,
|
||||
FrmApproved,
|
||||
FrmRejected,
|
||||
}
|
||||
|
||||
pub enum WebhookFlow {
|
||||
@ -50,6 +52,7 @@ pub enum WebhookFlow {
|
||||
BankTransfer,
|
||||
Mandate,
|
||||
ExternalAuthentication,
|
||||
FraudCheck,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||||
@ -119,6 +122,9 @@ impl From<IncomingWebhookEvent> for WebhookFlow {
|
||||
IncomingWebhookEvent::SourceChargeable
|
||||
| IncomingWebhookEvent::SourceTransactionCreated => Self::BankTransfer,
|
||||
IncomingWebhookEvent::ExternalAuthenticationARes => Self::ExternalAuthentication,
|
||||
IncomingWebhookEvent::FrmApproved | IncomingWebhookEvent::FrmRejected => {
|
||||
Self::FraudCheck
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user