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

refactor(router): refactor relay flow addressing comments of /relay feature pr #6954

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
10 changes: 5 additions & 5 deletions crates/hyperswitch_domain_models/src/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Relay {
) -> Self {
let relay_id = id_type::RelayId::generate();
Self {
id: relay_id.clone(),
id: relay_id,
connector_resource_id: relay_request.connector_resource_id.clone(),
connector_id: relay_request.connector_id.clone(),
profile_id: profile_id.clone(),
Expand Down Expand Up @@ -198,7 +198,7 @@ impl super::behaviour::Conversion for Relay {
.request_data
.map(|data| {
serde_json::to_value(data).change_context(ValidationError::InvalidValue {
message: "Failed while decrypting business profile data".to_string(),
message: "Failed to serialize relay request data".to_string(),
})
})
.transpose()?
Expand All @@ -225,13 +225,13 @@ impl super::behaviour::Conversion for Relay {
connector_id: item.connector_id,
profile_id: item.profile_id,
merchant_id: item.merchant_id,
relay_type: enums::RelayType::Refund,
relay_type: item.relay_type,
request_data: item
.request_data
.map(|data| {
serde_json::from_value(data.expose()).change_context(
ValidationError::InvalidValue {
message: "Failed while decrypting business profile data".to_string(),
message: "Failed to deserialize relay request data".to_string(),
},
)
})
Expand All @@ -258,7 +258,7 @@ impl super::behaviour::Conversion for Relay {
.request_data
.map(|data| {
serde_json::to_value(data).change_context(ValidationError::InvalidValue {
message: "Failed while decrypting business profile data".to_string(),
message: "Failed to serialize relay request data".to_string(),
})
})
.transpose()?
Expand Down
2 changes: 1 addition & 1 deletion crates/router/src/core/relay/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub async fn construct_relay_refund_router_data<'a, F>(
let webhook_url = Some(payments::helpers::create_webhook_url(
&state.base_url.clone(),
merchant_id,
connector_name,
connector_account.merchant_connector_id.get_string_repr(),
SanchithHegde marked this conversation as resolved.
Show resolved Hide resolved
));

let supported_connector = &state
Expand Down
Loading