mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(core): Add support for process tracker retrieve api in v2 (#7602)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -121,6 +121,7 @@ pub enum ApiEventsType {
|
||||
PaymentMethodSession {
|
||||
payment_method_session_id: id_type::GlobalPaymentMethodSessionId,
|
||||
},
|
||||
ProcessTracker,
|
||||
}
|
||||
|
||||
impl ApiEventMetric for serde_json::Value {}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
use common_enums::enums;
|
||||
use error_stack::ResultExt;
|
||||
|
||||
use crate::{errors, generate_id_with_default_len, generate_time_ordered_id_without_prefix, types};
|
||||
@ -31,6 +32,15 @@ impl GlobalPaymentId {
|
||||
pub fn generate_client_secret(&self) -> types::ClientSecret {
|
||||
types::ClientSecret::new(self.clone(), generate_time_ordered_id_without_prefix())
|
||||
}
|
||||
|
||||
/// Generate the id for revenue recovery Execute PT workflow
|
||||
pub fn get_execute_revenue_recovery_id(
|
||||
&self,
|
||||
task: &str,
|
||||
runner: enums::ProcessTrackerRunner,
|
||||
) -> String {
|
||||
format!("{task}_{runner}_{}", self.get_string_repr())
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: refactor the macro to include this id use case as well
|
||||
@ -67,6 +77,15 @@ impl GlobalAttemptId {
|
||||
pub fn get_string_repr(&self) -> &str {
|
||||
self.0.get_string_repr()
|
||||
}
|
||||
|
||||
/// Generate the id for Revenue Recovery Psync PT workflow
|
||||
pub fn get_psync_revenue_recovery_id(
|
||||
&self,
|
||||
task: &str,
|
||||
runner: enums::ProcessTrackerRunner,
|
||||
) -> String {
|
||||
format!("{runner}_{task}_{}", self.get_string_repr())
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<std::borrow::Cow<'static, str>> for GlobalAttemptId {
|
||||
|
||||
Reference in New Issue
Block a user