Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(connector): [Adyen] Response Handling in case of RefusalResponse #1877

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions crates/router/src/connector/adyen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,17 @@ impl
),
}
}
adyen::AdyenRedirectRequestTypes::AdyenRefusal(req) => {
adyen::AdyenRedirectRequest {
details: adyen::AdyenRedirectRequestTypes::AdyenRefusal(
adyen::AdyenRefusal {
payload: req.payload,
type_of_redirection_result: None,
result_code: None,
},
),
}
}
};

let adyen_request = types::RequestBody::log_and_get_request_body(
Expand Down
10 changes: 10 additions & 0 deletions crates/router/src/connector/adyen/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ pub struct AdyenRedirectRequest {
pub enum AdyenRedirectRequestTypes {
AdyenRedirection(AdyenRedirection),
AdyenThreeDS(AdyenThreeDS),
AdyenRefusal(AdyenRefusal),
}

#[derive(Debug, Clone, Serialize, serde::Deserialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct AdyenRefusal {
pub payload: String,
#[serde(rename = "type")]
pub type_of_redirection_result: Option<String>,
pub result_code: Option<String>,
}

#[derive(Debug, Clone, Serialize, serde::Deserialize, Eq, PartialEq)]
Expand Down
Loading