Skip to content

Commit

Permalink
fix(clippy): refactor transaction_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshayaFoiger committed Jan 19, 2024
1 parent 285442f commit e96c62a
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions crates/router/src/connector/bluesnap/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,14 @@ impl TryFrom<&BluesnapRouterData<&types::PaymentsAuthorizeRouterData>> for Blues
Some(enums::CaptureMethod::Manual) => BluesnapTxnType::AuthOnly,
_ => BluesnapTxnType::AuthCapture,
};
let transaction_meta_data = match item.router_data.request.metadata.as_ref() {
Some(metadata) => Some(BluesnapMetadata {
meta_data: Vec::<RequestMetadata>::foreign_from(metadata.peek().to_owned()),
}),
None => None,
};
let transaction_meta_data =
item.router_data
.request
.metadata
.as_ref()
.map(|metadata| BluesnapMetadata {
meta_data: Vec::<RequestMetadata>::foreign_from(metadata.peek().to_owned()),
});

let (payment_method, card_holder_info) = match item
.router_data
Expand Down Expand Up @@ -621,13 +623,14 @@ impl TryFrom<&BluesnapRouterData<&types::PaymentsCompleteAuthorizeRouterData>>
.parse_value("BluesnapRedirectionResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;

let transaction_meta_data = match item.router_data.request.metadata.as_ref() {
Some(metadata) => Some(BluesnapMetadata {
meta_data: Vec::<RequestMetadata>::foreign_from(metadata.peek().to_owned()),
}),

None => None,
};
let transaction_meta_data =
item.router_data
.request
.metadata
.as_ref()
.map(|metadata| BluesnapMetadata {
meta_data: Vec::<RequestMetadata>::foreign_from(metadata.peek().to_owned()),
});

let pf_token = item
.router_data
Expand Down

0 comments on commit e96c62a

Please sign in to comment.