Skip to content

Commit

Permalink
fix(connector): adyen - propagate connector mandate details in incomi…
Browse files Browse the repository at this point in the history
…ng webhooks (#6720)
  • Loading branch information
kashif-m authored Dec 2, 2024
1 parent f6dde13 commit bea4b9e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions crates/router/src/connector/adyen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1908,6 +1908,27 @@ impl api::IncomingWebhook for Adyen {
updated_at: notif.event_date,
})
}

fn get_mandate_details(
&self,
request: &api::IncomingWebhookRequestDetails<'_>,
) -> CustomResult<
Option<hyperswitch_domain_models::router_flow_types::ConnectorMandateDetails>,
errors::ConnectorError,
> {
let notif = get_webhook_object_from_body(request.body)
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
let mandate_reference =
notif
.additional_data
.recurring_detail_reference
.map(|mandate_id| {
hyperswitch_domain_models::router_flow_types::ConnectorMandateDetails {
connector_mandate_id: mandate_id.clone(),
}
});
Ok(mandate_reference)
}
}

impl api::Dispute for Adyen {}
Expand Down
3 changes: 3 additions & 0 deletions crates/router/src/connector/adyen/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4261,6 +4261,9 @@ pub struct AdyenAdditionalDataWH {
pub chargeback_reason_code: Option<String>,
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
pub defense_period_ends_at: Option<PrimitiveDateTime>,
/// Enable recurring details in dashboard to receive this ID, https://docs.adyen.com/online-payments/tokenization/create-and-use-tokens#test-and-go-live
#[serde(rename = "recurring.recurringDetailReference")]
pub recurring_detail_reference: Option<Secret<String>>,
}

#[derive(Debug, Deserialize)]
Expand Down

0 comments on commit bea4b9e

Please sign in to comment.