Skip to content

Commit

Permalink
fix(connector): [fiuu] update PSync and webhooks response (#7211)
Browse files Browse the repository at this point in the history
  • Loading branch information
kashif-m authored Feb 10, 2025
1 parent 7ea63b4 commit 1c54211
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
4 changes: 3 additions & 1 deletion crates/hyperswitch_connectors/src/connectors/fiuu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 11 additions & 6 deletions crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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()),
})
Expand Down Expand Up @@ -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>,
Expand Down

0 comments on commit 1c54211

Please sign in to comment.