mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
refactor(schema): add a new column for storing large connector transaction IDs (#7017)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1420,7 +1420,7 @@ crate::impl_to_sql_from_sql_json!(BrowserInformation);
|
||||
/// In case connector's use an identifier whose length exceeds 128 characters,
|
||||
/// the hash value of such identifiers will be stored as connector_transaction_id.
|
||||
/// The actual connector's identifier will be stored in a separate column -
|
||||
/// connector_transaction_data or something with a similar name.
|
||||
/// processor_transaction_data or something with a similar name.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize, AsExpression)]
|
||||
#[diesel(sql_type = sql_types::Text)]
|
||||
pub enum ConnectorTransactionId {
|
||||
@ -1438,7 +1438,7 @@ impl ConnectorTransactionId {
|
||||
}
|
||||
}
|
||||
|
||||
/// Implementation for forming ConnectorTransactionId and an optional string to be used for connector_transaction_id and connector_transaction_data
|
||||
/// Implementation for forming ConnectorTransactionId and an optional string to be used for connector_transaction_id and processor_transaction_data
|
||||
pub fn form_id_and_data(src: String) -> (Self, Option<String>) {
|
||||
let txn_id = Self::from(src.clone());
|
||||
match txn_id {
|
||||
@ -1456,10 +1456,10 @@ impl ConnectorTransactionId {
|
||||
(Self::TxnId(id), _) => Ok(id),
|
||||
(Self::HashedData(_), Some(id)) => Ok(id),
|
||||
(Self::HashedData(id), None) => Err(report!(ValidationError::InvalidValue {
|
||||
message: "connector_transaction_data is empty for HashedData variant".to_string(),
|
||||
message: "processor_transaction_data is empty for HashedData variant".to_string(),
|
||||
})
|
||||
.attach_printable(format!(
|
||||
"connector_transaction_data is empty for connector_transaction_id {}",
|
||||
"processor_transaction_data is empty for connector_transaction_id {}",
|
||||
id
|
||||
))),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user