refactor(payment_attempt_v2): add payment attempt v2 domain and diesel models (#6027)

Co-authored-by: hrithikesh026 <hrithikesh.vm@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Narayan Bhat
2024-09-27 18:52:40 +05:30
committed by GitHub
parent 354f5306e7
commit c7bb9ccda3
56 changed files with 2643 additions and 2050 deletions

View File

@ -1224,6 +1224,7 @@ pub fn is_merchant_enabled_for_payment_id_as_connector_request_id(
config_map.contains(merchant_id)
}
#[cfg(feature = "v1")]
pub fn get_connector_request_reference_id(
conf: &Settings,
merchant_id: &common_utils::id_type::MerchantId,
@ -1235,10 +1236,20 @@ pub fn get_connector_request_reference_id(
if is_config_enabled_for_merchant {
payment_attempt.payment_id.get_string_repr().to_owned()
} else {
payment_attempt.attempt_id.clone()
payment_attempt.attempt_id.to_owned()
}
}
// TODO: Based on the connector configuration, the connector_request_reference_id should be generated
#[cfg(feature = "v2")]
pub fn get_connector_request_reference_id(
conf: &Settings,
merchant_id: &common_utils::id_type::MerchantId,
payment_attempt: &hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt,
) -> String {
todo!()
}
/// Validate whether the profile_id exists and is associated with the merchant_id
pub async fn validate_and_get_business_profile(
db: &dyn StorageInterface,