mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
feat(connector): [Cybersource] Use connector_request_reference_id as reference to the connector (#2512)
Co-authored-by: Prasunna Soppa <70575890+prasunna09@users.noreply.github.com>
This commit is contained in:
@ -21,6 +21,7 @@ pub struct CybersourcePaymentsRequest {
|
||||
processing_information: ProcessingInformation,
|
||||
payment_information: PaymentInformation,
|
||||
order_information: OrderInformationWithBill,
|
||||
client_reference_information: ClientReferenceInformation,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Serialize, Eq, PartialEq)]
|
||||
@ -150,10 +151,15 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for CybersourcePaymentsRequest
|
||||
capture_options: None,
|
||||
};
|
||||
|
||||
let client_reference_information = ClientReferenceInformation {
|
||||
code: Some(item.connector_request_reference_id.clone()),
|
||||
};
|
||||
|
||||
Ok(Self {
|
||||
processing_information,
|
||||
payment_information,
|
||||
order_information,
|
||||
client_reference_information,
|
||||
})
|
||||
}
|
||||
_ => Err(errors::ConnectorError::NotImplemented("Payment methods".to_string()).into()),
|
||||
@ -179,6 +185,9 @@ impl TryFrom<&types::PaymentsCaptureRouterData> for CybersourcePaymentsRequest {
|
||||
},
|
||||
..Default::default()
|
||||
},
|
||||
client_reference_information: ClientReferenceInformation {
|
||||
code: Some(value.connector_request_reference_id.clone()),
|
||||
},
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
@ -195,6 +204,9 @@ impl TryFrom<&types::RefundExecuteRouterData> for CybersourcePaymentsRequest {
|
||||
},
|
||||
..Default::default()
|
||||
},
|
||||
client_reference_information: ClientReferenceInformation {
|
||||
code: Some(value.connector_request_reference_id.clone()),
|
||||
},
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
@ -278,7 +290,7 @@ pub struct CybersourcePaymentsResponse {
|
||||
client_reference_information: Option<ClientReferenceInformation>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Deserialize, Eq, PartialEq)]
|
||||
#[derive(Default, Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ClientReferenceInformation {
|
||||
code: Option<String>,
|
||||
|
||||
Reference in New Issue
Block a user