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(connector): [fiuu] update PSync and webhooks response (#7211)

Kashif1c54211b2f8a
diff --git a/crates/hyperswitch_connectors/src/connectors/fiuu.rs b/crates/hyperswitch_connectors/src/connectors/fiuu.rs
index 4dc87c244a..7e9bb8c120 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiuu.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiuu.rs
@@ -866,7 +866,9 @@ impl webhooks::IncomingWebhook for Fiuu {
webhooks_payment_response.paydate,
webhooks_payment_response.domain.peek(),
md5_key0,
- webhooks_payment_response.appcode.peek(),
+ webhooks_payment_response
+ .appcode
+ .map_or("".to_string(), |appcode| appcode.expose()),
String::from_utf8_lossy(&connector_webhook_secrets.secret)
);
key1
diff --git a/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs b/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
index e23cdd548c..b5d4408d6b 100644
--- a/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
@@ -1145,8 +1145,8 @@ pub struct FiuuPaymentSyncResponse {
stat_name: StatName,
#[serde(rename = "TranID")]
tran_id: String,
- error_code: String,
- error_desc: String,
+ error_code: Option<String>,
+ error_desc: Option<String>,
#[serde(rename = "miscellaneous")]
miscellaneous: Option<HashMap<String, Secret<String>>>,
#[serde(rename = "SchemeTransactionID")]
@@ -1228,9 +1228,14 @@ impl TryFrom<PaymentsSyncResponseRouterData<FiuuPaymentResponse>> for PaymentsSy
let error_response = if status == enums::AttemptStatus::Failure {
Some(ErrorResponse {
status_code: item.http_code,
- code: response.error_code.clone(),
- message: response.error_desc.clone(),
- reason: Some(response.error_desc),
+ code: response
+ .error_code
+ .unwrap_or(consts::NO_ERROR_CODE.to_owned()),
+ message: response
+ .error_desc
+ .clone()
+ .unwrap_or(consts::NO_ERROR_MESSAGE.to_owned()),
+ reason: response.error_desc,
attempt_status: Some(enums::AttemptStatus::Failure),
connector_transaction_id: Some(txn_id.clone()),
})
@@ -1759,7 +1764,7 @@ pub struct FiuuWebhooksPaymentResponse {
pub amount: StringMajorUnit,
pub currency: String,
pub domain: Secret<String>,
- pub appcode: Secret<String>,
+ pub appcode: Option<Secret<String>>,
pub paydate: String,
pub channel: String,
pub error_desc: Option<String>,