fix(connector): [Adyen Platform] wasm configs and webhook status mapping (#6161)

This commit is contained in:
Sakil Mostak
2024-09-30 20:16:38 +05:30
committed by GitHub
parent da1f23d235
commit 6b0f7e4870
4 changed files with 29 additions and 15 deletions

View File

@ -367,7 +367,8 @@ pub struct AdyenplatformIncomingWebhookData {
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AdyenplatformInstantStatus {
status: InstantPriorityStatus,
status: Option<InstantPriorityStatus>,
estimated_arrival_time: Option<String>,
}
#[cfg(feature = "payouts")]
@ -416,20 +417,14 @@ impl
) -> Self {
match (event_type, status, instant_status) {
(AdyenplatformWebhookEventType::PayoutCreated, _, _) => Self::PayoutCreated,
(
AdyenplatformWebhookEventType::PayoutUpdated,
_,
Some(AdyenplatformInstantStatus {
status: InstantPriorityStatus::Credited,
}),
) => Self::PayoutSuccess,
(
AdyenplatformWebhookEventType::PayoutUpdated,
_,
Some(AdyenplatformInstantStatus {
status: InstantPriorityStatus::Pending,
}),
) => Self::PayoutProcessing,
(AdyenplatformWebhookEventType::PayoutUpdated, _, Some(instant_status)) => {
match (instant_status.status, instant_status.estimated_arrival_time) {
(Some(InstantPriorityStatus::Credited), _) | (None, Some(_)) => {
Self::PayoutSuccess
}
_ => Self::PayoutProcessing,
}
}
(AdyenplatformWebhookEventType::PayoutUpdated, status, _) => match status {
AdyenplatformWebhookStatus::Authorised
| AdyenplatformWebhookStatus::Booked