-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(webhook): add frm webhook support #4662
Conversation
…_webhooks Signed-off-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com>
crates/router/src/core/webhooks.rs
Outdated
payments::PaymentApprove, | ||
api::PaymentsCaptureRequest { | ||
payment_id: payment_attempt.payment_id, | ||
amount_to_capture: Some(payment_attempt.amount), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please send payment_attempt.amount_to_capture
here
crates/router/src/core/webhooks.rs
Outdated
HeaderPayload::default(), | ||
)) | ||
.await?; | ||
match payments_response { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove this redundant logic and get the payments_response using the event type
crates/router/src/core/webhooks.rs
Outdated
.change_context(errors::ApiErrorResponse::WebhookProcessingFailure) | ||
.attach_printable("payment id not received from payments core")?; | ||
let status = payments_response.status; | ||
let _event_type: Option<enums::EventType> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please trigger an outgoing webhook here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
crates/router/src/core/webhooks.rs
Outdated
key_store: domain::MerchantKeyStore, | ||
source_verified: bool, | ||
event_type: webhooks::IncomingWebhookEvent, | ||
_request_details: &api::IncomingWebhookRequestDetails<'_>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove unused fields here
crates/router/src/core/webhooks.rs
Outdated
business_profile, | ||
)) | ||
.await | ||
.attach_printable("Incoming webhook flow for external authentication failed")?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.attach_printable("Incoming webhook flow for external authentication failed")?, | |
.attach_printable("Incoming webhook flow for fraud check failed")?, |
Type of Change
Description
This PR introduces FRM webhooks . Frm webhooks are consumed when payments are held due to manual review pending from FRM processors. When merchant/ Frm provides decision , webhook is triggered . Based on decision we take action whether to approve or decline the payment.
Additional Changes
Motivation and Context
Upon merchant decision on manual review, FRM send us webhooks. Based on FRM webhooks decision we should approve/decline the transaction.
How did you test it?
Test cases
1 . Test signifyd webhooks.(process both incoming and outgoing webhooks)
2. Test any payment processor webhook.
Checklist
cargo +nightly fmt --all
cargo clippy