Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

fix(router): [Iatapay] make error status and error message optional (#5382)

AkshayaFoiger37e34e3bfde9
diff --git a/crates/router/src/connector/iatapay.rs b/crates/router/src/connector/iatapay.rs
index 8dc7479889..cf4a1d6e16 100644
--- a/crates/router/src/connector/iatapay.rs
+++ b/crates/router/src/connector/iatapay.rs
@@ -149,7 +149,9 @@ impl ConnectorCommon for Iatapay {
ErrorResponse {
status_code: res.status_code,
code: response.error,
- message: response.message,
+ message: response
+ .message
+ .unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
reason: response.reason,
attempt_status: None,
connector_transaction_id: None,
diff --git a/crates/router/src/connector/iatapay/transformers.rs b/crates/router/src/connector/iatapay/transformers.rs
index 1ce07fb49e..845e079e13 100644
--- a/crates/router/src/connector/iatapay/transformers.rs
+++ b/crates/router/src/connector/iatapay/transformers.rs
@@ -581,9 +581,9 @@ impl TryFrom<types::RefundsResponseRouterData<api::RSync, RefundResponse>>
#[derive(Debug, Deserialize, Serialize)]
pub struct IatapayErrorResponse {
- pub status: u16,
+ pub status: Option<u16>,
pub error: String,
- pub message: String,
+ pub message: Option<String>,
pub reason: Option<String>,
}