refactor(business_profile): change id for business profile (#5748)

This commit is contained in:
Narayan Bhat
2024-09-02 15:25:22 +05:30
committed by GitHub
parent c03587f9c6
commit 8e5c33e2d8
27 changed files with 538 additions and 274 deletions

View File

@ -544,7 +544,7 @@ impl CreateBusinessProfile {
if business_profiles.len() == 1 {
merchant_account.default_profile = business_profiles
.first()
.map(|business_profile| business_profile.profile_id.clone())
.map(|business_profile| business_profile.get_id().to_owned())
}
}
Self::CreateDefaultBusinessProfile => {
@ -552,7 +552,7 @@ impl CreateBusinessProfile {
.create_default_business_profile(state, merchant_account.clone(), key_store)
.await?;
merchant_account.default_profile = Some(business_profile.profile_id);
merchant_account.default_profile = Some(business_profile.get_id().to_owned());
}
}
@ -899,7 +899,7 @@ impl MerchantAccountUpdateBridge for api::MerchantAccountUpdate {
merchant_id,
)
.await?
.map(|business_profile| Some(business_profile.profile_id))
.map(|business_profile| Some(business_profile.get_id().to_owned()))
} else {
None
};
@ -2449,7 +2449,7 @@ impl MerchantConnectorAccountCreateBridge for api::MerchantConnectorCreate {
}
None => None,
},
profile_id: business_profile.profile_id.clone(),
profile_id: business_profile.get_id().to_owned(),
applepay_verified_domains: None,
pm_auth_config: self.pm_auth_config.clone(),
status: connector_status,
@ -2618,7 +2618,7 @@ impl MerchantConnectorAccountCreateBridge for api::MerchantConnectorCreate {
}
None => None,
},
profile_id: business_profile.profile_id.clone(),
profile_id: business_profile.get_id().to_owned(),
applepay_verified_domains: None,
pm_auth_config: self.pm_auth_config.clone(),
status: connector_status,
@ -2745,7 +2745,7 @@ pub async fn create_connector(
pm_auth_config: &req.pm_auth_config,
db: store,
merchant_id,
profile_id: &business_profile.profile_id,
profile_id: business_profile.get_id(),
key_store: &key_store,
key_manager_state,
};
@ -2791,7 +2791,7 @@ pub async fn create_connector(
.await
.to_duplicate_response(
errors::ApiErrorResponse::DuplicateMerchantConnectorAccount {
profile_id: business_profile.profile_id.get_string_repr().to_owned(),
profile_id: business_profile.get_id().get_string_repr().to_owned(),
connector_label: merchant_connector_account
.connector_label
.unwrap_or_default(),
@ -2808,7 +2808,7 @@ pub async fn create_connector(
merchant_connector_id: &mca.get_id(),
store,
merchant_id,
profile_id: &business_profile.profile_id,
profile_id: business_profile.get_id(),
transaction_type: &req.get_transaction_type(),
};
@ -3480,72 +3480,74 @@ impl BusinessProfileCreateBridge for api::BusinessProfileCreate {
})
.transpose()?;
Ok(domain::BusinessProfile {
profile_id,
merchant_id: merchant_account.get_id().clone(),
profile_name,
created_at: current_time,
modified_at: current_time,
return_url: self
.return_url
.map(|return_url| return_url.to_string())
.or(merchant_account.return_url.clone()),
enable_payment_response_hash: self
.enable_payment_response_hash
.unwrap_or(merchant_account.enable_payment_response_hash),
payment_response_hash_key: Some(payment_response_hash_key),
redirect_to_merchant_with_http_post: self
.redirect_to_merchant_with_http_post
.unwrap_or(merchant_account.redirect_to_merchant_with_http_post),
webhook_details: webhook_details.or(merchant_account.webhook_details.clone()),
metadata: self.metadata,
routing_algorithm: None,
intent_fulfillment_time: self
.intent_fulfillment_time
.map(i64::from)
.or(merchant_account.intent_fulfillment_time)
.or(Some(common_utils::consts::DEFAULT_INTENT_FULFILLMENT_TIME)),
frm_routing_algorithm: self
.frm_routing_algorithm
.or(merchant_account.frm_routing_algorithm.clone()),
#[cfg(feature = "payouts")]
payout_routing_algorithm: self
.payout_routing_algorithm
.or(merchant_account.payout_routing_algorithm.clone()),
#[cfg(not(feature = "payouts"))]
payout_routing_algorithm: None,
is_recon_enabled: merchant_account.is_recon_enabled,
applepay_verified_domains: self.applepay_verified_domains,
payment_link_config,
session_expiry: self
.session_expiry
.map(i64::from)
.or(Some(common_utils::consts::DEFAULT_SESSION_EXPIRY)),
authentication_connector_details: self
.authentication_connector_details
.map(ForeignInto::foreign_into),
payout_link_config,
is_connector_agnostic_mit_enabled: self.is_connector_agnostic_mit_enabled,
is_extended_card_info_enabled: None,
extended_card_info_config: None,
use_billing_as_payment_method_billing: self
.use_billing_as_payment_method_billing
.or(Some(true)),
collect_shipping_details_from_wallet_connector: self
.collect_shipping_details_from_wallet_connector
.or(Some(false)),
collect_billing_details_from_wallet_connector: self
.collect_billing_details_from_wallet_connector
.or(Some(false)),
outgoing_webhook_custom_http_headers: outgoing_webhook_custom_http_headers
.map(Into::into),
tax_connector_id: self.tax_connector_id,
is_tax_connector_enabled: self.is_tax_connector_enabled,
always_collect_billing_details_from_wallet_connector: self
.always_collect_billing_details_from_wallet_connector,
always_collect_shipping_details_from_wallet_connector: self
.always_collect_shipping_details_from_wallet_connector,
})
Ok(domain::BusinessProfile::from(
domain::BusinessProfileSetter {
profile_id,
merchant_id: merchant_account.get_id().clone(),
profile_name,
created_at: current_time,
modified_at: current_time,
return_url: self
.return_url
.map(|return_url| return_url.to_string())
.or(merchant_account.return_url.clone()),
enable_payment_response_hash: self
.enable_payment_response_hash
.unwrap_or(merchant_account.enable_payment_response_hash),
payment_response_hash_key: Some(payment_response_hash_key),
redirect_to_merchant_with_http_post: self
.redirect_to_merchant_with_http_post
.unwrap_or(merchant_account.redirect_to_merchant_with_http_post),
webhook_details: webhook_details.or(merchant_account.webhook_details.clone()),
metadata: self.metadata,
routing_algorithm: None,
intent_fulfillment_time: self
.intent_fulfillment_time
.map(i64::from)
.or(merchant_account.intent_fulfillment_time)
.or(Some(common_utils::consts::DEFAULT_INTENT_FULFILLMENT_TIME)),
frm_routing_algorithm: self
.frm_routing_algorithm
.or(merchant_account.frm_routing_algorithm.clone()),
#[cfg(feature = "payouts")]
payout_routing_algorithm: self
.payout_routing_algorithm
.or(merchant_account.payout_routing_algorithm.clone()),
#[cfg(not(feature = "payouts"))]
payout_routing_algorithm: None,
is_recon_enabled: merchant_account.is_recon_enabled,
applepay_verified_domains: self.applepay_verified_domains,
payment_link_config,
session_expiry: self
.session_expiry
.map(i64::from)
.or(Some(common_utils::consts::DEFAULT_SESSION_EXPIRY)),
authentication_connector_details: self
.authentication_connector_details
.map(ForeignInto::foreign_into),
payout_link_config,
is_connector_agnostic_mit_enabled: self.is_connector_agnostic_mit_enabled,
is_extended_card_info_enabled: None,
extended_card_info_config: None,
use_billing_as_payment_method_billing: self
.use_billing_as_payment_method_billing
.or(Some(true)),
collect_shipping_details_from_wallet_connector: self
.collect_shipping_details_from_wallet_connector
.or(Some(false)),
collect_billing_details_from_wallet_connector: self
.collect_billing_details_from_wallet_connector
.or(Some(false)),
outgoing_webhook_custom_http_headers: outgoing_webhook_custom_http_headers
.map(Into::into),
tax_connector_id: self.tax_connector_id,
is_tax_connector_enabled: self.is_tax_connector_enabled,
always_collect_billing_details_from_wallet_connector: self
.always_collect_billing_details_from_wallet_connector,
always_collect_shipping_details_from_wallet_connector: self
.always_collect_shipping_details_from_wallet_connector,
},
))
}
#[cfg(all(feature = "v2", feature = "business_profile_v2"))]
@ -3593,61 +3595,63 @@ impl BusinessProfileCreateBridge for api::BusinessProfileCreate {
})
.transpose()?;
Ok(domain::BusinessProfile {
profile_id,
merchant_id: merchant_id.clone(),
profile_name,
created_at: current_time,
modified_at: current_time,
return_url: self.return_url.map(|return_url| return_url.to_string()),
enable_payment_response_hash: self.enable_payment_response_hash.unwrap_or(true),
payment_response_hash_key: Some(payment_response_hash_key),
redirect_to_merchant_with_http_post: self
.redirect_to_merchant_with_http_post
.unwrap_or(true),
webhook_details,
metadata: self.metadata,
is_recon_enabled: false,
applepay_verified_domains: self.applepay_verified_domains,
payment_link_config,
session_expiry: self
.session_expiry
.map(i64::from)
.or(Some(common_utils::consts::DEFAULT_SESSION_EXPIRY)),
authentication_connector_details: self
.authentication_connector_details
.map(ForeignInto::foreign_into),
payout_link_config,
is_connector_agnostic_mit_enabled: self.is_connector_agnostic_mit_enabled,
is_extended_card_info_enabled: None,
extended_card_info_config: None,
use_billing_as_payment_method_billing: self
.use_billing_as_payment_method_billing
.or(Some(true)),
collect_shipping_details_from_wallet_connector: self
.collect_shipping_details_from_wallet_connector_if_required
.or(Some(false)),
collect_billing_details_from_wallet_connector: self
.collect_billing_details_from_wallet_connector_if_required
.or(Some(false)),
outgoing_webhook_custom_http_headers: outgoing_webhook_custom_http_headers
.map(Into::into),
always_collect_billing_details_from_wallet_connector: self
.always_collect_billing_details_from_wallet_connector,
always_collect_shipping_details_from_wallet_connector: self
.always_collect_shipping_details_from_wallet_connector,
routing_algorithm_id: None,
frm_routing_algorithm_id: None,
payout_routing_algorithm_id: None,
order_fulfillment_time: self
.order_fulfillment_time
.map(|order_fulfillment_time| order_fulfillment_time.into_inner())
.or(Some(common_utils::consts::DEFAULT_ORDER_FULFILLMENT_TIME)),
order_fulfillment_time_origin: self.order_fulfillment_time_origin,
default_fallback_routing: None,
tax_connector_id: self.tax_connector_id,
is_tax_connector_enabled: self.is_tax_connector_enabled,
})
Ok(domain::BusinessProfile::from(
domain::BusinessProfileSetter {
id: profile_id,
merchant_id: merchant_id.clone(),
profile_name,
created_at: current_time,
modified_at: current_time,
return_url: self.return_url.map(|return_url| return_url.to_string()),
enable_payment_response_hash: self.enable_payment_response_hash.unwrap_or(true),
payment_response_hash_key: Some(payment_response_hash_key),
redirect_to_merchant_with_http_post: self
.redirect_to_merchant_with_http_post
.unwrap_or(true),
webhook_details,
metadata: self.metadata,
is_recon_enabled: false,
applepay_verified_domains: self.applepay_verified_domains,
payment_link_config,
session_expiry: self
.session_expiry
.map(i64::from)
.or(Some(common_utils::consts::DEFAULT_SESSION_EXPIRY)),
authentication_connector_details: self
.authentication_connector_details
.map(ForeignInto::foreign_into),
payout_link_config,
is_connector_agnostic_mit_enabled: self.is_connector_agnostic_mit_enabled,
is_extended_card_info_enabled: None,
extended_card_info_config: None,
use_billing_as_payment_method_billing: self
.use_billing_as_payment_method_billing
.or(Some(true)),
collect_shipping_details_from_wallet_connector: self
.collect_shipping_details_from_wallet_connector_if_required
.or(Some(false)),
collect_billing_details_from_wallet_connector: self
.collect_billing_details_from_wallet_connector_if_required
.or(Some(false)),
outgoing_webhook_custom_http_headers: outgoing_webhook_custom_http_headers
.map(Into::into),
always_collect_billing_details_from_wallet_connector: self
.always_collect_billing_details_from_wallet_connector,
always_collect_shipping_details_from_wallet_connector: self
.always_collect_shipping_details_from_wallet_connector,
routing_algorithm_id: None,
frm_routing_algorithm_id: None,
payout_routing_algorithm_id: None,
order_fulfillment_time: self
.order_fulfillment_time
.map(|order_fulfillment_time| order_fulfillment_time.into_inner())
.or(Some(common_utils::consts::DEFAULT_ORDER_FULFILLMENT_TIME)),
order_fulfillment_time_origin: self.order_fulfillment_time_origin,
default_fallback_routing: None,
tax_connector_id: self.tax_connector_id,
is_tax_connector_enabled: self.is_tax_connector_enabled,
},
))
}
}
@ -3674,7 +3678,7 @@ pub async fn create_business_profile(
.create_domain_model_from_request(&state, &key_store, merchant_account.get_id())
.await?;
let profile_id = business_profile.profile_id.clone();
let profile_id = business_profile.get_id().to_owned();
let business_profile = db
.insert_business_profile(key_manager_state, &key_store, business_profile)
@ -4056,7 +4060,7 @@ impl BusinessProfileWrapper {
fn get_routing_config_cache_key(self) -> storage_impl::redis::cache::CacheKind<'static> {
let merchant_id = self.profile.merchant_id.clone();
let profile_id = self.profile.profile_id.clone();
let profile_id = self.profile.get_id().to_owned();
storage_impl::redis::cache::CacheKind::Routing(
format!(
@ -4144,7 +4148,7 @@ impl BusinessProfileWrapper {
pub fn get_default_routing_configs_from_profile(
&self,
) -> RouterResult<routing_types::ProfileDefaultRoutingConfig> {
let profile_id = self.profile.profile_id.clone();
let profile_id = self.profile.get_id().to_owned();
let connectors = self.get_default_fallback_list_of_connector_under_profile()?;
Ok(routing_types::ProfileDefaultRoutingConfig {

View File

@ -133,7 +133,7 @@ pub async fn perform_pre_authentication(
business_profile.merchant_id.clone(),
authentication_connector_name.clone(),
token,
business_profile.profile_id.clone(),
business_profile.get_id().to_owned(),
payment_id,
three_ds_connector_account
.get_mca_id()

View File

@ -284,15 +284,15 @@ pub async fn get_authentication_connector_data(
.first()
.ok_or(errors::ApiErrorResponse::UnprocessableEntity {
message: format!(
"No authentication_connector found for profile_id {}",
business_profile.profile_id.get_string_repr()
"No authentication_connector found for profile_id {:?}",
business_profile.get_id()
),
})
.attach_printable(
"No authentication_connector found from merchant_account.authentication_details",
)?
.to_owned();
let profile_id = &business_profile.profile_id;
let profile_id = business_profile.get_id();
let authentication_connector_mca = payments::helpers::get_merchant_connector_account(
state,
&business_profile.merchant_id,

View File

@ -4844,7 +4844,7 @@ async fn generate_saved_pm_response(
pi.off_session_payment_flag,
pi.business_profile
.as_ref()
.map(|profile| profile.profile_id.clone()),
.map(|profile| profile.get_id().to_owned()),
)
})
.unwrap_or((false, false, false, Default::default()));

View File

@ -4284,7 +4284,7 @@ pub async fn get_apple_pay_retryable_connectors<F>(
where
F: Send + Clone,
{
let profile_id = &business_profile.profile_id;
let profile_id = business_profile.get_id();
let pre_decided_connector_data_first = pre_routing_connector_data_list
.first()
@ -5118,7 +5118,7 @@ pub async fn get_payment_external_authentication_flow_during_confirm<F: Clone>(
&business_profile.merchant_id,
None,
key_store,
&business_profile.profile_id,
business_profile.get_id(),
connector_data.connector_name.to_string().as_str(),
connector_data.merchant_connector_id.as_ref(),
)

View File

@ -302,7 +302,7 @@ pub async fn perform_static_routing_v1<F: Clone>(
))]
let fallback_config = routing::helpers::get_merchant_default_config(
&*state.clone().store,
business_profile.profile_id.get_string_repr(),
business_profile.get_id().get_string_repr(),
&api_enums::TransactionType::from(transaction_data),
)
.await
@ -322,7 +322,7 @@ pub async fn perform_static_routing_v1<F: Clone>(
state,
merchant_id,
&algorithm_id,
business_profile.profile_id.clone(),
business_profile.get_id().to_owned(),
&api_enums::TransactionType::from(transaction_data),
)
.await?;
@ -780,7 +780,7 @@ pub async fn perform_fallback_routing<F: Clone>(
fallback_config,
backend_input,
eligible_connectors,
business_profile.profile_id.clone(),
business_profile.get_id().to_owned(),
&api_enums::TransactionType::from(transaction_data),
)
.await
@ -800,7 +800,7 @@ pub async fn perform_eligibility_analysis_with_fallback<F: Clone>(
chosen,
transaction_data,
eligible_connectors.as_ref(),
business_profile.profile_id.clone(),
business_profile.get_id().to_owned(),
)
.await?;

View File

@ -140,13 +140,13 @@ pub async fn create_routing_algorithm_under_profile(
.await?;
let name_mca_id_set = helpers::ConnectNameAndMCAIdForProfile(
all_mcas.filter_by_profile(&business_profile.profile_id, |mca| {
all_mcas.filter_by_profile(business_profile.get_id(), |mca| {
(&mca.connector_name, mca.get_id())
}),
);
let name_set = helpers::ConnectNameForProfile(
all_mcas.filter_by_profile(&business_profile.profile_id, |mca| &mca.connector_name),
all_mcas.filter_by_profile(business_profile.get_id(), |mca| &mca.connector_name),
);
let algorithm_helper = helpers::RoutingAlgorithmHelpers {
@ -160,7 +160,7 @@ pub async fn create_routing_algorithm_under_profile(
let algo = RoutingAlgorithmUpdate::create_new_routing_algorithm(
&request,
merchant_account.get_id(),
business_profile.profile_id,
business_profile.get_id().to_owned(),
transaction_type,
);
@ -853,7 +853,7 @@ pub async fn retrieve_routing_config_under_profile(
let record = db
.list_routing_algorithm_metadata_by_profile_id(
&business_profile.profile_id,
business_profile.get_id(),
i64::from(query_params.limit.unwrap_or_default()),
i64::from(query_params.offset.unwrap_or_default()),
)
@ -914,6 +914,8 @@ pub async fn retrieve_linked_routing_config(
let mut active_algorithms = Vec::new();
for business_profile in business_profiles {
let profile_id = business_profile.get_id().to_owned();
let routing_ref: routing_types::RoutingAlgorithmRef = match transaction_type {
enums::TransactionType::Payment => business_profile.routing_algorithm,
#[cfg(feature = "payouts")]
@ -930,7 +932,7 @@ pub async fn retrieve_linked_routing_config(
let record = db
.find_routing_algorithm_metadata_by_algorithm_id_profile_id(
&algorithm_id,
&business_profile.profile_id,
&profile_id,
)
.await
.to_not_found_response(errors::ApiErrorResponse::ResourceIdNotFound)?;
@ -970,7 +972,7 @@ pub async fn retrieve_default_routing_config_for_profiles(
.map(|prof| {
helpers::get_merchant_default_config(
db,
prof.profile_id.get_string_repr(),
prof.get_id().get_string_repr(),
transaction_type,
)
})
@ -983,7 +985,7 @@ pub async fn retrieve_default_routing_config_for_profiles(
let default_configs = configs
.into_iter()
.zip(all_profiles.iter().map(|prof| prof.profile_id.clone()))
.zip(all_profiles.iter().map(|prof| prof.get_id().to_owned()))
.map(
|(config, profile_id)| routing_types::ProfileDefaultRoutingConfig {
profile_id,
@ -1022,7 +1024,7 @@ pub async fn update_default_routing_config_for_profile(
})?;
let default_config = helpers::get_merchant_default_config(
db,
business_profile.profile_id.get_string_repr(),
business_profile.get_id().get_string_repr(),
transaction_type,
)
.await?;
@ -1064,7 +1066,7 @@ pub async fn update_default_routing_config_for_profile(
helpers::update_merchant_default_config(
db,
business_profile.profile_id.get_string_repr(),
business_profile.get_id().get_string_repr(),
updated_config.clone(),
transaction_type,
)
@ -1073,7 +1075,7 @@ pub async fn update_default_routing_config_for_profile(
metrics::ROUTING_UPDATE_CONFIG_FOR_PROFILE_SUCCESS_RESPONSE.add(&metrics::CONTEXT, 1, &[]);
Ok(service_api::ApplicationResponse::Json(
routing_types::ProfileDefaultRoutingConfig {
profile_id: business_profile.profile_id,
profile_id: business_profile.get_id().to_owned(),
connectors: updated_config,
},
))

View File

@ -203,7 +203,7 @@ pub async fn update_business_profile_active_algorithm_ref(
let merchant_id = current_business_profile.merchant_id.clone();
let profile_id = current_business_profile.profile_id.clone();
let profile_id = current_business_profile.get_id().to_owned();
let routing_cache_key = cache::CacheKind::Routing(
format!(

View File

@ -2423,7 +2423,7 @@ pub async fn list_profiles_for_user_in_org_and_merchant_account(
.into_iter()
.map(
|profile| user_api::ListProfilesForUserInOrgAndMerchantAccountResponse {
profile_id: profile.profile_id,
profile_id: profile.get_id().to_owned(),
profile_name: profile.profile_name,
},
)
@ -2461,7 +2461,7 @@ pub async fn list_profiles_for_user_in_org_and_merchant_account(
.into_iter()
.map(
|profile| user_api::ListProfilesForUserInOrgAndMerchantAccountResponse {
profile_id: profile.profile_id,
profile_id: profile.get_id().to_owned(),
profile_name: profile.profile_name,
},
)
@ -2550,8 +2550,8 @@ pub async fn switch_org_for_user(
.first()
.ok_or(UserErrors::InternalServerError)
.attach_printable("No business profile found for the merchant_id")?
.profile_id
.clone()
.get_id()
.to_owned()
};
let token = utils::user::generate_jwt_auth_token_with_attributes(
@ -2638,8 +2638,8 @@ pub async fn switch_merchant_for_user_in_org(
.first()
.ok_or(UserErrors::InternalServerError)
.attach_printable("No business profile found for the given merchant_id")?
.profile_id
.clone();
.get_id()
.to_owned();
(
merchant_account.organization_id,
@ -2691,8 +2691,8 @@ pub async fn switch_merchant_for_user_in_org(
.first()
.ok_or(UserErrors::InternalServerError)
.attach_printable("No business profile found for the merchant_id")?
.profile_id
.clone();
.get_id()
.to_owned();
(
user_from_token.org_id.clone(),
@ -2752,8 +2752,8 @@ pub async fn switch_merchant_for_user_in_org(
.first()
.ok_or(UserErrors::InternalServerError)
.attach_printable("No business profile found for the given merchant_id")?
.profile_id
.clone()
.get_id()
.to_owned()
};
(
user_from_token.org_id,
@ -2838,7 +2838,8 @@ pub async fn switch_profile_for_user_in_org_and_merchant(
.change_context(UserErrors::InvalidRoleOperationWithMessage(
"No such profile found for the merchant".to_string(),
))?
.profile_id;
.get_id()
.to_owned();
(profile_id, user_from_token.role_id)
}

View File

@ -1097,7 +1097,7 @@ pub async fn validate_and_get_business_profile(
// Check if the merchant_id of business profile is same as the current merchant_id
if business_profile.merchant_id.ne(merchant_id) {
Err(errors::ApiErrorResponse::AccessForbidden {
resource: business_profile.profile_id.get_string_repr().to_owned(),
resource: business_profile.get_id().get_string_repr().to_owned(),
}
.into())
} else {
@ -1193,7 +1193,7 @@ pub async fn get_profile_id_from_business_details(
id: profile_name,
})?;
Ok(business_profile.profile_id)
Ok(business_profile.get_id().to_owned())
}
_ => Err(report!(errors::ApiErrorResponse::MissingRequiredField {
field_name: "profile_id or business_country, business_label"

View File

@ -932,7 +932,7 @@ async fn get_or_update_dispute_object(
challenge_required_by: dispute_details.challenge_required_by,
connector_created_at: dispute_details.created_at,
connector_updated_at: dispute_details.updated_at,
profile_id: Some(business_profile.profile_id.clone()),
profile_id: Some(business_profile.get_id().to_owned()),
evidence: None,
merchant_connector_id: payment_attempt.merchant_connector_id.clone(),
dispute_amount: dispute_details.amount.parse::<i64>().unwrap_or(0),

View File

@ -71,7 +71,7 @@ pub(crate) async fn create_event_and_trigger_outgoing_webhook(
|| webhook_url_result.as_ref().is_ok_and(String::is_empty)
{
logger::debug!(
business_profile_id=?business_profile.profile_id,
business_profile_id=?business_profile.get_id(),
%idempotent_event_id,
"Outgoing webhooks are disabled in application configuration, or merchant webhook URL \
could not be obtained; skipping outgoing webhooks for event"
@ -107,7 +107,7 @@ pub(crate) async fn create_event_and_trigger_outgoing_webhook(
primary_object_type,
created_at: now,
merchant_id: Some(business_profile.merchant_id.clone()),
business_profile_id: Some(business_profile.profile_id.clone()),
business_profile_id: Some(business_profile.get_id().to_owned()),
primary_object_created_at,
idempotent_event_id: Some(idempotent_event_id.clone()),
initial_attempt_id: Some(event_id.clone()),
@ -533,7 +533,7 @@ pub(crate) async fn add_outgoing_webhook_retry_task_to_process_tracker(
let tracking_data = types::OutgoingWebhookTrackingData {
merchant_id: business_profile.merchant_id.clone(),
business_profile_id: business_profile.profile_id.clone(),
business_profile_id: business_profile.get_id().to_owned(),
event_type: event.event_type,
event_class: event.event_class,
primary_object_id: event.primary_object_id.clone(),

View File

@ -45,7 +45,7 @@ pub async fn list_initial_delivery_attempts(
.await,
MerchantAccountOrBusinessProfile::BusinessProfile(business_profile) => store
.list_initial_events_by_profile_id_primary_object_id(key_manager_state,
&business_profile.profile_id,
business_profile.get_id(),
&object_id,
&key_store,
)
@ -85,7 +85,7 @@ pub async fn list_initial_delivery_attempts(
.await,
MerchantAccountOrBusinessProfile::BusinessProfile(business_profile) => store
.list_initial_events_by_profile_id_constraints(key_manager_state,
&business_profile.profile_id,
business_profile.get_id(),
created_after,
created_before,
limit,
@ -208,7 +208,7 @@ pub async fn retry_delivery_attempt(
primary_object_type: event_to_retry.primary_object_type,
created_at: now,
merchant_id: Some(business_profile.merchant_id.clone()),
business_profile_id: Some(business_profile.profile_id.clone()),
business_profile_id: Some(business_profile.get_id().to_owned()),
primary_object_created_at: event_to_retry.primary_object_created_at,
idempotent_event_id: Some(idempotent_event_id),
initial_attempt_id: event_to_retry.initial_attempt_id,