Skip to content

Commit

Permalink
fix(connector): [Adyen Platform] wasm configs and webhook status mapp…
Browse files Browse the repository at this point in the history
…ing (#6161)
  • Loading branch information
Sakilmostak authored Sep 30, 2024
1 parent da1f23d commit 6b0f7e4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
2 changes: 2 additions & 0 deletions crates/connector_configs/toml/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ label="Source balance account ID"
placeholder="Enter Source balance account ID"
required=true
type="Text"
[adyenplatform_payout.connector_webhook_details]
merchant_secret="Source verification key"

[airwallex]
[[airwallex.credit]]
Expand Down
15 changes: 15 additions & 0 deletions crates/connector_configs/toml/production.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ key1="Adyen Account Id"
[adyen.connector_webhook_details]
merchant_secret="Source verification key"

[adyenplatform_payout]
[[adyenplatform_payout.bank_transfer]]
payment_method_type = "sepa"
[adyenplatform_payout.connector_auth.HeaderKey]
api_key = "Adyen platform's API Key"

[adyenplatform_payout.metadata.source_balance_account]
name="source_balance_account"
label="Source balance account ID"
placeholder="Enter Source balance account ID"
required=true
type="Text"
[adyenplatform_payout.connector_webhook_details]
merchant_secret="Source verification key"

[[adyen.metadata.apple_pay]]
name="certificate"
label="Merchant Certificate (Base64 Encoded)"
Expand Down
2 changes: 2 additions & 0 deletions crates/connector_configs/toml/sandbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ label="Source balance account ID"
placeholder="Enter Source balance account ID"
required=true
type="Text"
[adyenplatform_payout.connector_webhook_details]
merchant_secret="Source verification key"

[airwallex]
[[airwallex.credit]]
Expand Down
25 changes: 10 additions & 15 deletions crates/router/src/connector/adyenplatform/transformers/payouts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6b0f7e4

Please sign in to comment.