Skip to content

Commit

Permalink
refactor(connector): Use connector_request_reference_id for Fiserv (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tejas Mate authored Oct 27, 2023
1 parent 4138c8f commit 05c2f84
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/router/src/connector/fiserv/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ pub struct Amount {
pub struct TransactionDetails {
capture_flag: Option<bool>,
reversal_reason_code: Option<String>,
merchant_transaction_id: String,
}

#[derive(Default, Debug, Serialize, Eq, PartialEq)]
Expand Down Expand Up @@ -112,6 +113,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for FiservPaymentsRequest {
Some(enums::CaptureMethod::Automatic) | None
)),
reversal_reason_code: None,
merchant_transaction_id: item.connector_request_reference_id.clone(),
};
let metadata = item.get_connector_meta()?;
let session: SessionObject = metadata
Expand Down Expand Up @@ -208,6 +210,7 @@ impl TryFrom<&types::PaymentsCancelRouterData> for FiservCancelRequest {
transaction_details: TransactionDetails {
capture_flag: None,
reversal_reason_code: Some(item.request.get_cancellation_reason()?),
merchant_transaction_id: item.connector_request_reference_id.clone(),
},
})
}
Expand Down Expand Up @@ -407,6 +410,7 @@ impl TryFrom<&types::PaymentsCaptureRouterData> for FiservCaptureRequest {
transaction_details: TransactionDetails {
capture_flag: Some(true),
reversal_reason_code: None,
merchant_transaction_id: item.connector_request_reference_id.clone(),
},
merchant_details: MerchantDetails {
merchant_id: auth.merchant_account,
Expand Down

0 comments on commit 05c2f84

Please sign in to comment.