Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hrithikesh026 committed Feb 8, 2024
1 parent ca9487d commit 655a7d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions crates/router/src/connector/cryptopay/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use serde::{Deserialize, Serialize};

use crate::{
connector::utils::{self, is_payment_failure, CryptoData},
consts,
core::errors,
services,
types::{self, api, storage::enums},
Expand Down Expand Up @@ -159,8 +160,14 @@ impl<F, T>
let response = if is_payment_failure(status) {
let payment_response = &item.response.data;
Err(types::ErrorResponse {
code: payment_response.name.clone().unwrap_or_default(),
message: payment_response.status_context.clone().unwrap_or_default(),
code: payment_response
.name
.clone()
.unwrap_or(consts::NO_ERROR_CODE.to_string()),
message: payment_response
.status_context
.clone()
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
reason: payment_response.status_context.clone(),
status_code: item.http_code,
attempt_status: None,
Expand Down
4 changes: 2 additions & 2 deletions crates/router/src/connector/payme/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl From<(&SaleQuery, u16)> for types::ErrorResponse {
reason: sale_query_response.sale_error_text.clone(),
status_code: http_code,
attempt_status: None,
connector_transaction_id: sale_query_response.sale_error_code.clone(),
connector_transaction_id: Some(sale_query_response.sale_payme_id.clone()),
}
}
}
Expand Down Expand Up @@ -1000,7 +1000,7 @@ impl TryFrom<types::RefundsResponseRouterData<api::Execute, PaymeRefundResponse>
Err(types::ErrorResponse {
code: payme_response.status_error_code.to_string(),
message: payme_response.status_error_code.to_string(),
reason: None,
reason: Some(payme_response.status_error_code.to_string()),
status_code: item.http_code,
attempt_status: None,
connector_transaction_id: Some(payme_response.payme_transaction_id.clone()),
Expand Down

0 comments on commit 655a7d2

Please sign in to comment.