mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(database): add profile & organisation id to transaction tables (#5696)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -158,6 +158,8 @@ impl PaymentAttemptInterface for MockDb {
|
||||
client_source: payment_attempt.client_source,
|
||||
client_version: payment_attempt.client_version,
|
||||
customer_acceptance: payment_attempt.customer_acceptance,
|
||||
organization_id: payment_attempt.organization_id,
|
||||
profile_id: payment_attempt.profile_id,
|
||||
};
|
||||
payment_attempts.push(payment_attempt.clone());
|
||||
Ok(payment_attempt)
|
||||
|
||||
@ -419,6 +419,8 @@ impl<T: DatabaseStore> PaymentAttemptInterface for KVRouterStore<T> {
|
||||
client_source: payment_attempt.client_source.clone(),
|
||||
client_version: payment_attempt.client_version.clone(),
|
||||
customer_acceptance: payment_attempt.customer_acceptance.clone(),
|
||||
organization_id: payment_attempt.organization_id.clone(),
|
||||
profile_id: payment_attempt.profile_id.clone(),
|
||||
};
|
||||
|
||||
let field = format!("pa_{}", created_attempt.attempt_id);
|
||||
@ -1189,6 +1191,15 @@ impl DataModelExt for PaymentAttempt {
|
||||
connector_metadata: self.connector_metadata,
|
||||
payment_experience: self.payment_experience,
|
||||
payment_method_type: self.payment_method_type,
|
||||
card_network: self
|
||||
.payment_method_data
|
||||
.as_ref()
|
||||
.and_then(|data| data.as_object())
|
||||
.and_then(|card| card.get("card"))
|
||||
.and_then(|data| data.as_object())
|
||||
.and_then(|card| card.get("card_network"))
|
||||
.and_then(|network| network.as_str())
|
||||
.map(|network| network.to_string()),
|
||||
payment_method_data: self.payment_method_data,
|
||||
business_sub_label: self.business_sub_label,
|
||||
straight_through_algorithm: self.straight_through_algorithm,
|
||||
@ -1215,6 +1226,8 @@ impl DataModelExt for PaymentAttempt {
|
||||
client_source: self.client_source,
|
||||
client_version: self.client_version,
|
||||
customer_acceptance: self.customer_acceptance,
|
||||
organization_id: self.organization_id,
|
||||
profile_id: self.profile_id,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1282,6 +1295,8 @@ impl DataModelExt for PaymentAttempt {
|
||||
client_source: storage_model.client_source,
|
||||
client_version: storage_model.client_version,
|
||||
customer_acceptance: storage_model.customer_acceptance,
|
||||
organization_id: storage_model.organization_id,
|
||||
profile_id: storage_model.profile_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1330,6 +1345,15 @@ impl DataModelExt for PaymentAttempt {
|
||||
connector_metadata: self.connector_metadata,
|
||||
payment_experience: self.payment_experience,
|
||||
payment_method_type: self.payment_method_type,
|
||||
card_network: self
|
||||
.payment_method_data
|
||||
.as_ref()
|
||||
.and_then(|data| data.as_object())
|
||||
.and_then(|card| card.get("card"))
|
||||
.and_then(|data| data.as_object())
|
||||
.and_then(|card| card.get("card_network"))
|
||||
.and_then(|network| network.as_str())
|
||||
.map(|network| network.to_string()),
|
||||
payment_method_data: self.payment_method_data,
|
||||
business_sub_label: self.business_sub_label,
|
||||
straight_through_algorithm: self.straight_through_algorithm,
|
||||
@ -1356,6 +1380,8 @@ impl DataModelExt for PaymentAttempt {
|
||||
client_source: self.client_source,
|
||||
client_version: self.client_version,
|
||||
customer_acceptance: self.customer_acceptance,
|
||||
organization_id: self.organization_id,
|
||||
profile_id: self.profile_id,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1423,6 +1449,8 @@ impl DataModelExt for PaymentAttempt {
|
||||
client_source: storage_model.client_source,
|
||||
client_version: storage_model.client_version,
|
||||
customer_acceptance: storage_model.customer_acceptance,
|
||||
organization_id: storage_model.organization_id,
|
||||
profile_id: storage_model.profile_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1471,6 +1499,15 @@ impl DataModelExt for PaymentAttemptNew {
|
||||
connector_metadata: self.connector_metadata,
|
||||
payment_experience: self.payment_experience,
|
||||
payment_method_type: self.payment_method_type,
|
||||
card_network: self
|
||||
.payment_method_data
|
||||
.as_ref()
|
||||
.and_then(|data| data.as_object())
|
||||
.and_then(|card| card.get("card"))
|
||||
.and_then(|value| value.as_object())
|
||||
.and_then(|map| map.get("card_network"))
|
||||
.and_then(|network| network.as_str())
|
||||
.map(|network| network.to_string()),
|
||||
payment_method_data: self.payment_method_data,
|
||||
business_sub_label: self.business_sub_label,
|
||||
straight_through_algorithm: self.straight_through_algorithm,
|
||||
@ -1497,6 +1534,8 @@ impl DataModelExt for PaymentAttemptNew {
|
||||
client_source: self.client_source,
|
||||
client_version: self.client_version,
|
||||
customer_acceptance: self.customer_acceptance,
|
||||
organization_id: self.organization_id,
|
||||
profile_id: self.profile_id,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1563,6 +1602,8 @@ impl DataModelExt for PaymentAttemptNew {
|
||||
client_source: storage_model.client_source,
|
||||
client_version: storage_model.client_version,
|
||||
customer_acceptance: storage_model.customer_acceptance,
|
||||
organization_id: storage_model.organization_id,
|
||||
profile_id: storage_model.profile_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user