mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 12:06:56 +08:00
fix(connector): adyen - propagate connector mandate details in incoming webhooks (#6720)
This commit is contained in:
@ -1908,6 +1908,27 @@ impl api::IncomingWebhook for Adyen {
|
|||||||
updated_at: notif.event_date,
|
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 {}
|
impl api::Dispute for Adyen {}
|
||||||
|
|||||||
@ -4261,6 +4261,9 @@ pub struct AdyenAdditionalDataWH {
|
|||||||
pub chargeback_reason_code: Option<String>,
|
pub chargeback_reason_code: Option<String>,
|
||||||
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
|
#[serde(default, with = "common_utils::custom_serde::iso8601::option")]
|
||||||
pub defense_period_ends_at: Option<PrimitiveDateTime>,
|
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)]
|
#[derive(Debug, Deserialize)]
|
||||||
|
|||||||
Reference in New Issue
Block a user