feat(connector): Fix FPX refunds for Fiuu (#7890)

This commit is contained in:
awasthi21
2025-04-25 17:56:48 +05:30
committed by GitHub
parent fa46593093
commit f71bbb5004
6 changed files with 102 additions and 1 deletions

View File

@ -4818,6 +4818,12 @@ pub async fn get_additional_payment_data(
details: None,
},
)),
domain::BankRedirectData::OnlineBankingFpx { issuer } => Ok(Some(
api_models::payments::AdditionalPaymentData::BankRedirect {
bank_name: Some(issuer.to_owned()),
details: None,
},
)),
domain::BankRedirectData::Ideal { bank_name, .. } => Ok(Some(
api_models::payments::AdditionalPaymentData::BankRedirect {
bank_name: bank_name.to_owned(),

View File

@ -111,6 +111,7 @@ pub async fn construct_relay_refund_router_data<F>(
merchant_account_id: None,
merchant_config_currency: None,
capture_method: None,
additional_payment_method_data: None,
},
response: Err(ErrorResponse::default()),

View File

@ -349,6 +349,7 @@ pub async fn construct_refund_router_data<'a, F>(
merchant_config_currency,
refund_connector_metadata: refund.metadata.clone(),
capture_method: Some(capture_method),
additional_payment_method_data: None,
},
response: Ok(types::RefundsResponseData {
@ -497,6 +498,17 @@ pub async fn construct_refund_router_data<'a, F>(
.and_then(|braintree| braintree.merchant_account_id.clone());
let merchant_config_currency =
braintree_metadata.and_then(|braintree| braintree.merchant_config_currency);
let additional_payment_method_data: Option<api_models::payments::AdditionalPaymentData> =
payment_attempt
.payment_method_data
.clone()
.and_then(|value| match serde_json::from_value(value) {
Ok(data) => Some(data),
Err(e) => {
router_env::logger::error!("Failed to deserialize payment_method_data: {}", e);
None
}
});
let router_data = types::RouterData {
flow: PhantomData,
@ -540,6 +552,7 @@ pub async fn construct_refund_router_data<'a, F>(
merchant_account_id,
merchant_config_currency,
capture_method,
additional_payment_method_data,
},
response: Ok(types::RefundsResponseData {