-
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
fix(webhooks): add support for updating mandate details in webhooks flow #6523
Conversation
Changed Files
|
crates/api_models/src/webhooks.rs
Outdated
@@ -246,3 +246,8 @@ pub struct ConnectorWebhookSecrets { | |||
pub secret: Vec<u8>, | |||
pub additional_secret: Option<masking::Secret<String>>, | |||
} | |||
|
|||
#[derive(Debug, Clone, Serialize)] | |||
pub struct ConnectorMandateDetails { |
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 move this to domain models
request | ||
.body | ||
.parse_struct("fiuu::FiuuWebhooksResponse") | ||
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)? |
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.
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)? | |
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)? |
.change_context(errors::ConnectorError::WebhookResourceObjectNotFound)? | ||
}; | ||
match payload.clone() { | ||
FiuuWebhooksResponse::FiuuWebhookPaymentResponse(webhook_payment_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.
We can directly parse it into FiuuWebhookPaymentResponse
.await | ||
.to_not_found_response(errors::ApiErrorResponse::PaymentMethodNotFound)?; | ||
|
||
if payment_method_info.connector_mandate_details.is_none() { |
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.
is_none
won't work here, we should check the existence of mca_id in the hashmap
37a5774
to
efe9117
Compare
f239f59
…low (#6523) Co-authored-by: Chikke Srujan <[email protected]> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
…low (#6523) Co-authored-by: Chikke Srujan <[email protected]> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
…low (#6523) Co-authored-by: Chikke Srujan <[email protected]> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
…low (#6523) Co-authored-by: Chikke Srujan <[email protected]> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Type of Change
Description
For Fiuu, the mandate ID is updated via webhooks in the case of 3DS payments. The payment webhook body was not consumed when the payment was successful, causing intermittent issues in the sandbox environment. This PR adds support to address this issue.
more detailed issue description :
Additional Changes
Motivation and Context
How did you test it?
Cannot be tested directly this is an intermediate issue in sandbox. So please test this flow multiple time and mandate id should be stored in CIT transaction against both payment attempt & payment method for the transaction.
Checklist
cargo +nightly fmt --all
cargo clippy