fix(connector): adyen - propagate connector mandate details in incoming webhooks (#6720)

This commit is contained in:
Kashif
2024-12-02 23:34:00 +05:30
committed by GitHub
parent f6dde13d6c
commit bea4b9e7f4
2 changed files with 24 additions and 0 deletions

View File

@ -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 {}

View File

@ -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)]