id stringlengths 20 153 | type stringclasses 1
value | granularity stringclasses 14
values | content stringlengths 16 84.3k | metadata dict |
|---|---|---|---|---|
hyperswitch_fn_common_utils_8862846706511494694 | clm | function | // hyperswitch/crates/common_utils/src/id_type/profile_acquirer.rs
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "partial_cmp",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_449376582951733790 | clm | function | // hyperswitch/crates/common_utils/src/id_type/profile_acquirer.rs
fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {
Some(crate::events::ApiEventsType::ProfileAcquirer {
profile_acquirer_id: self.clone(),
})
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_api_event_type",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_8719811768271635489 | clm | function | // hyperswitch/crates/common_utils/src/id_type/profile_acquirer.rs
fn from_str(s: &str) -> Result<Self, Self::Err> {
let cow_string = std::borrow::Cow::Owned(s.to_string());
Self::try_from(cow_string)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from_str",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_3799425987050966959 | clm | function | // hyperswitch/crates/common_utils/src/id_type/profile_acquirer.rs
fn from(val: ProfileAcquirerId) -> Self {
Self::from(val.0 .0 .0)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_2465210197570681049 | clm | function | // hyperswitch/crates/common_utils/src/id_type/authentication.rs
pub fn generate_authentication_id(prefix: &'static str) -> Self {
Self(crate::generate_ref_id_with_default_length(prefix))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "generate_authentication_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_8282229937849210711 | clm | function | // hyperswitch/crates/common_utils/src/id_type/authentication.rs
pub fn get_external_authentication_request_poll_id(&self) -> String {
format!("external_authentication_{}", self.get_string_repr())
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_external_authentication_request_poll_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-2785706309057719467 | clm | function | // hyperswitch/crates/common_utils/src/id_type/authentication.rs
fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {
Some(crate::events::ApiEventsType::Authentication {
authentication_id: self.1.clone(),
})
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_api_event_type",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_917754819626737253 | clm | function | // hyperswitch/crates/common_utils/src/id_type/routing.rs
fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {
Some(crate::events::ApiEventsType::Routing)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_api_event_type",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_6062148155410751490 | clm | function | // hyperswitch/crates/common_utils/src/id_type/api_key.rs
pub fn generate_key_id(prefix: &'static str) -> Self {
Self(crate::generate_ref_id_with_default_length(prefix))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "generate_key_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-3527770715909212275 | clm | function | // hyperswitch/crates/common_utils/src/id_type/api_key.rs
fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {
Some(crate::events::ApiEventsType::ApiKey {
key_id: self.1.clone(),
})
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_api_event_type",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_544087425881676325 | clm | function | // hyperswitch/crates/common_utils/src/id_type/relay.rs
fn from_str(s: &str) -> Result<Self, Self::Err> {
let cow_string = std::borrow::Cow::Owned(s.to_string());
Self::try_from(cow_string)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from_str",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-4570144968668960452 | clm | function | // hyperswitch/crates/common_utils/src/id_type/webhook_endpoint.rs
pub fn try_from_string(webhook_endpoint_id: String) -> CustomResult<Self, ValidationError> {
Self::try_from(std::borrow::Cow::from(webhook_endpoint_id))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "try_from_string",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-7478490553646289582 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
pub fn generate(cell_id: &CellId) -> error_stack::Result<Self, GlobalPaymentMethodIdError> {
let global_id = GlobalId::generate(cell_id, GlobalEntity::PaymentMethod);
Ok(Self(global_id))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "generate",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_5124161509480918758 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_string_repr",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-6684253717286168844 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
pub fn get_redis_key(&self) -> String {
format!("payment_method_session:{}", self.get_string_repr())
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_redis_key",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_7356647218570476580 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {
Some(
crate::events::ApiEventsType::PaymentMethodListForPaymentMethods {
payment_method_id: self.clone(),
},
)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_api_event_type",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_2130076089399597222 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
pub fn generate_from_string(value: String) -> CustomResult<Self, GlobalPaymentMethodIdError> {
let id = GlobalId::from_string(value.into())
.change_context(GlobalPaymentMethodIdError::ConstructionError)?;
Ok(Self(id))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "generate_from_string",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-63818740234468844 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
fn build(row: Self::Row) -> diesel::deserialize::Result<Self> {
Ok(row)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "build",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-3132350169333438602 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "to_sql",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_7977353613264719559 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
let global_id = GlobalId::from_sql(value)?;
Ok(Self(global_id))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from_sql",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-202468159406824928 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/refunds.rs
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_string_repr",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_1212963491948142077 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/refunds.rs
pub fn generate(cell_id: &crate::id_type::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Refund);
Self(global_id)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "generate",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_2285966955453691313 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/refunds.rs
fn try_from(value: std::borrow::Cow<'static, str>) -> Result<Self, Self::Error> {
let merchant_ref_id = super::GlobalId::from_string(value).change_context(
errors::ValidationError::IncorrectValueProvided {
field_name: "refund_id",
},
)?;
Ok(Self(merchant_ref_id))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "try_from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_7569560917972613573 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/refunds.rs
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "to_sql",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-5665531721892921692 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/refunds.rs
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
super::GlobalId::from_sql(value).map(Self)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from_sql",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-2824347681026395992 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/token.rs
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_string_repr",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_3938487458690036138 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/token.rs
pub fn from_string(token_string: &str) -> CustomResult<Self, ValidationError> {
let token = super::GlobalId::from_string(Cow::Owned(token_string.to_string()))
.change_context(ValidationError::IncorrectValueProvided {
field_name: "GlobalTokenId",
})?;
Ok(Self(token))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from_string",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_7754282546648203615 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/token.rs
pub fn generate(cell_id: &crate::id_type::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Token);
Self(global_id)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "generate",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-8991917027189227075 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/token.rs
fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {
Some(crate::events::ApiEventsType::Token {
token_id: Some(self.clone()),
})
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_api_event_type",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_7371750482180610771 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment.rs
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_string_repr",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_6271083162998729536 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment.rs
pub fn generate(cell_id: &super::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Attempt);
Self(global_id)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "generate",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_4280463181362497374 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment.rs
pub fn get_execute_revenue_recovery_id(
&self,
task: &str,
runner: enums::ProcessTrackerRunner,
) -> String {
format!("{runner}_{task}_{}", self.get_string_repr())
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_execute_revenue_recovery_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_3321636674375406568 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment.rs
pub fn get_gift_card_connector_key(&self) -> String {
format!("gift_mca_{}", self.get_string_repr())
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_gift_card_connector_key",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-8898041047821384194 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment.rs
fn try_from(value: std::borrow::Cow<'static, str>) -> Result<Self, Self::Error> {
let global_attempt_id = super::GlobalId::from_string(value).change_context(
errors::ValidationError::IncorrectValueProvided {
field_name: "payment_id",
},
)?;
Ok(Self(global_attempt_id))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "try_from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_976264373899601767 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/payment.rs
pub fn get_psync_revenue_recovery_id(
&self,
task: &str,
runner: enums::ProcessTrackerRunner,
) -> String {
format!("{runner}_{task}_{}", self.get_string_repr())
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_psync_revenue_recovery_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_8002551990414599033 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/customer.rs
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_string_repr",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_2707997728524684102 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/customer.rs
pub fn generate(cell_id: &crate::id_type::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Customer);
Self(global_id)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "generate",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-3469298579660722806 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/customer.rs
fn try_from(value: GlobalCustomerId) -> Result<Self, Self::Error> {
Self::try_from(std::borrow::Cow::from(value.get_string_repr().to_owned()))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "try_from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_common_utils_-3180745636465716411 | clm | function | // hyperswitch/crates/common_utils/src/id_type/global_id/customer.rs
fn get_api_event_type(&self) -> Option<crate::events::ApiEventsType> {
Some(crate::events::ApiEventsType::Customer {
customer_id: Some(self.clone()),
})
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_api_event_type",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_5866108812908375201 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/tokenization.rs
pub fn is_disabled(&self) -> bool {
self.flag == common_enums::TokenizationFlag::Disabled
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "is_disabled",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_494862411249966856 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/tokenization.rs
fn from(value: TokenizationUpdate) -> Self {
let now = date_time::now();
match value {
TokenizationUpdate::DeleteTokenizationRecordUpdate { flag } => Self {
updated_at: now,
flag,
},
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-8214441198816909440 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/tokenization.rs
async fn convert(self) -> CustomResult<Self::DstType, ValidationError> {
Ok(diesel_models::tokenization::Tokenization {
id: self.id,
merchant_id: self.merchant_id,
customer_id: self.customer_id,
locker_id: self.locker_id,
created_at: self.created_at,
updated_at: self.updated_at,
version: self.version,
flag: self.flag,
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "convert",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-5844600751596873768 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/tokenization.rs
async fn convert_back(
_state: &keymanager::KeyManagerState,
item: Self::DstType,
_key: &Secret<Vec<u8>>,
_key_manager_identifier: keymanager::Identifier,
) -> CustomResult<Self, ValidationError> {
Ok(Self {
id: item.id,
merchant_id: item.merchant_id,
customer_id: item.customer_id,
locker_id: item.locker_id,
created_at: item.created_at,
updated_at: item.updated_at,
flag: item.flag,
version: item.version,
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "convert_back",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-4453271863053619959 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/tokenization.rs
async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> {
Ok(diesel_models::tokenization::Tokenization {
id: self.id,
merchant_id: self.merchant_id,
customer_id: self.customer_id,
locker_id: self.locker_id,
created_at: self.created_at,
updated_at: self.updated_at,
version: self.version,
flag: self.flag,
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "construct_new",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_7302806321443020457 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/ext_traits.rs
fn check_value_present(&self, field_name: &'static str) -> DomainResult<()> {
when(self.is_none(), || {
Err(error_stack::Report::new(
api_error_response::ApiErrorResponse::MissingRequiredField { field_name },
)
.attach_printable(format!("Missing required field {field_name}")))
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "check_value_present",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-2235478061668370553 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/ext_traits.rs
fn get_required_value(self, field_name: &'static str) -> DomainResult<T> {
match self {
Some(v) => Ok(v),
None => Err(error_stack::Report::new(
api_error_response::ApiErrorResponse::MissingRequiredField { field_name },
)
.attach_printable(format!("Missing required field {field_name}"))),
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_required_value",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-3274542317070453654 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/ext_traits.rs
fn parse_enum<E>(self, enum_name: &'static str) -> CustomResult<E, errors::ParsingError>
where
T: AsRef<str>,
E: std::str::FromStr,
<E as std::str::FromStr>::Err: std::error::Error + Send + Sync + 'static,
{
let value = self
.get_required_value(enum_name)
.change_context(errors::ParsingError::UnknownError)?;
E::from_str(value.as_ref())
.change_context(errors::ParsingError::UnknownError)
.attach_printable_lazy(|| format!("Invalid {{ {enum_name} }} "))
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "parse_enum",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-8125388077936750065 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/ext_traits.rs
fn parse_value<U>(self, type_name: &'static str) -> CustomResult<U, errors::ParsingError>
where
T: ValueExt,
U: serde::de::DeserializeOwned,
{
let value = self
.get_required_value(type_name)
.change_context(errors::ParsingError::UnknownError)?;
value.parse_value(type_name)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "parse_value",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-4928546623491347974 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/ext_traits.rs
fn update_value(&mut self, value: Self) {
if let Some(a) = value {
*self = Some(a)
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "update_value",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-5026289694646595439 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/router_request_types.rs
fn try_from(
(connector_auth, authentication_token): (
router_data::ConnectorAuthType,
Option<AccessTokenAuthenticationResponse>,
),
) -> Result<Self, Self::Error> {
let mut access_token_request_data = Self::try_from(connector_auth)?;
access_token_request_data.authentication_token = authentication_token;
Ok(access_token_request_data)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "try_from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-4111512529450614525 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/router_request_types.rs
fn from(
(_request_surcharge_details, _payment_attempt): (
&RequestSurchargeDetails,
&payments::payment_attempt::PaymentAttempt,
),
) -> Self {
todo!()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_358180620509529274 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/router_request_types.rs
pub fn get_connector_transaction_id(
&self,
) -> errors::CustomResult<String, errors::ValidationError> {
match self {
Self::ConnectorTransactionId(txn_id) => Ok(txn_id.to_string()),
_ => Err(errors::ValidationError::IncorrectValueProvided {
field_name: "connector_transaction_id",
})
.attach_printable("Expected connector transaction ID not found"),
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_connector_transaction_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-8690602468812763405 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/router_request_types.rs
pub fn get_total_surcharge_amount(&self) -> MinorUnit {
self.surcharge_amount + self.tax_on_surcharge_amount
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_total_surcharge_amount",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_5068677258259340297 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/callback_mapper.rs
pub fn new(
id: String,
callback_mapper_id_type: common_enums::CallbackMapperIdType,
data: CallbackMapperData,
created_at: time::PrimitiveDateTime,
last_modified_at: time::PrimitiveDateTime,
) -> Self {
Self {
id,
callback_mapper_id_type,
data,
created_at,
last_modified_at,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "new",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-2449252272078410492 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
pub fn get_string_repr(&self) -> &String {
&self.0
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_string_repr",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_3962978962692340111 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
pub fn generate(id: String) -> Self {
Self(id)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "generate",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_9039016082343367288 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
pub fn get_id(&self) -> &id_type::GlobalPaymentMethodId {
&self.id
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-8534511233958709093 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
pub fn get_payment_methods_data(
&self,
) -> Option<domain_payment_method_data::PaymentMethodsData> {
self.payment_method_data
.clone()
.map(|value| value.into_inner().expose())
.and_then(|value| {
serde_json::from_value::<domain_payment_method_data::PaymentMethodsData>(value)
.map_err(|error| {
logger::warn!(
?error,
"Failed to parse payment method data in payment method info"
);
})
.ok()
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_payment_methods_data",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-4720815544245442728 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
pub fn get_payment_method_type(&self) -> Option<storage_enums::PaymentMethod> {
self.payment_method_type
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_payment_method_type",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_1694509592240732963 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
pub fn get_payment_method_subtype(&self) -> Option<storage_enums::PaymentMethodType> {
self.payment_method_subtype
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_payment_method_subtype",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-4689313331737684291 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
pub fn get_common_mandate_reference(&self) -> Result<CommonMandateReference, ParsingError> {
if let Some(value) = &self.connector_mandate_details {
Ok(value.clone())
} else {
Ok(CommonMandateReference {
payments: None,
payouts: None,
})
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_common_mandate_reference",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_6767499923590694235 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
pub fn set_payment_method_type(&mut self, payment_method_type: common_enums::PaymentMethod) {
self.payment_method_type = Some(payment_method_type);
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "set_payment_method_type",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_2810918276263834153 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
pub fn set_payment_method_subtype(
&mut self,
payment_method_subtype: common_enums::PaymentMethodType,
) {
self.payment_method_subtype = Some(payment_method_subtype);
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "set_payment_method_subtype",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-5966810628599725089 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
async fn convert(self) -> CustomResult<Self::DstType, ValidationError> {
Ok(Self::DstType {
id: self.id,
customer_id: self.customer_id,
billing: self.billing.map(|val| val.into()),
psp_tokenization: self.psp_tokenization,
network_tokenization: self.network_tokenization,
tokenization_data: self.tokenization_data,
expires_at: self.expires_at,
associated_payment_methods: self.associated_payment_methods,
associated_payment: self.associated_payment,
return_url: self.return_url,
associated_token_id: self.associated_token_id,
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "convert",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_7676602092426665437 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
async fn convert_back(
state: &keymanager::KeyManagerState,
storage_model: Self::DstType,
key: &Secret<Vec<u8>>,
key_manager_identifier: keymanager::Identifier,
) -> CustomResult<Self, ValidationError>
where
Self: Sized,
{
use common_utils::ext_traits::ValueExt;
async {
let decrypted_data = crypto_operation(
state,
type_name!(Self::DstType),
CryptoOperation::BatchDecrypt(EncryptedPaymentMethodSession::to_encryptable(
EncryptedPaymentMethodSession {
billing: storage_model.billing,
},
)),
key_manager_identifier,
key.peek(),
)
.await
.and_then(|val| val.try_into_batchoperation())?;
let data = EncryptedPaymentMethodSession::from_encryptable(decrypted_data)
.change_context(common_utils::errors::CryptoError::DecodingFailed)
.attach_printable("Invalid batch operation data")?;
let billing = data
.billing
.map(|billing| {
billing.deserialize_inner_value(|value| value.parse_value("Address"))
})
.transpose()
.change_context(common_utils::errors::CryptoError::DecodingFailed)
.attach_printable("Error while deserializing Address")?;
Ok::<Self, error_stack::Report<common_utils::errors::CryptoError>>(Self {
id: storage_model.id,
customer_id: storage_model.customer_id,
billing,
psp_tokenization: storage_model.psp_tokenization,
network_tokenization: storage_model.network_tokenization,
tokenization_data: storage_model.tokenization_data,
expires_at: storage_model.expires_at,
associated_payment_methods: storage_model.associated_payment_methods,
associated_payment: storage_model.associated_payment,
return_url: storage_model.return_url,
associated_token_id: storage_model.associated_token_id,
})
}
.await
.change_context(ValidationError::InvalidValue {
message: "Failed while decrypting payment method data".to_string(),
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "convert_back",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-7769920758039841831 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> {
Ok(Self::NewDstType {
id: self.id,
customer_id: self.customer_id,
billing: self.billing.map(|val| val.into()),
psp_tokenization: self.psp_tokenization,
network_tokenization: self.network_tokenization,
tokenization_data: self.tokenization_data,
expires_at: self.expires_at,
associated_payment_methods: self.associated_payment_methods,
associated_payment: self.associated_payment,
return_url: self.return_url,
associated_token_id: self.associated_token_id,
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "construct_new",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-347548533201489815 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
fn from(value: PaymentMethodVaultSourceDetails) -> Self {
match value {
PaymentMethodVaultSourceDetails::ExternalVault {
external_vault_source,
} => (
Some(storage_enums::VaultType::External),
Some(external_vault_source),
),
PaymentMethodVaultSourceDetails::InternalVault => {
(Some(storage_enums::VaultType::Internal), None)
}
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_6302452203293647851 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
pub fn apply_changeset(self, update_session: PaymentMethodsSessionUpdateInternal) -> Self {
let Self {
id,
customer_id,
billing,
psp_tokenization,
network_tokenization,
tokenization_data,
expires_at,
return_url,
associated_payment_methods,
associated_payment,
associated_token_id,
} = self;
Self {
id,
customer_id,
billing: update_session.billing.or(billing),
psp_tokenization: update_session.psp_tokenization.or(psp_tokenization),
network_tokenization: update_session.network_tokenization.or(network_tokenization),
tokenization_data: update_session.tokenization_data.or(tokenization_data),
expires_at,
return_url,
associated_payment_methods: update_session
.associated_payment_methods
.or(associated_payment_methods),
associated_payment,
associated_token_id,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "apply_changeset",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_4462463440713686839 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
fn try_from(
value: (
Option<storage_enums::VaultType>,
Option<id_type::MerchantConnectorAccountId>,
),
) -> Result<Self, Self::Error> {
match value {
(Some(storage_enums::VaultType::External), Some(external_vault_source)) => {
Ok(Self::ExternalVault {
external_vault_source,
})
}
(Some(storage_enums::VaultType::External), None) => {
Err(ValidationError::MissingRequiredField {
field_name: "external vault mca id".to_string(),
}
.into())
}
(Some(storage_enums::VaultType::Internal), _) | (None, _) => Ok(Self::InternalVault), // defaulting to internal vault if vault type is none
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "try_from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-5490307897963726165 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
fn foreign_try_from(
(records, merchant_id): (&[payment_methods::PaymentMethodRecord], id_type::MerchantId),
) -> Result<Self, Self::Error> {
let (customers_migration, migration_errors): (Self, Vec<_>) = records
.iter()
.map(|record| {
PaymentMethodCustomerMigrate::try_from((record.clone(), merchant_id.clone()))
})
.fold((Self::new(), Vec::new()), |mut acc, result| {
match result {
Ok(customer) => acc.0.push(customer),
Err(e) => acc.1.push(e.to_string()),
}
acc
});
migration_errors
.is_empty()
.then_some(customers_migration)
.ok_or_else(|| {
error_stack::report!(ValidationError::InvalidValue {
message: migration_errors.join(", "),
})
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "foreign_try_from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_1731465946497030872 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
fn get_payment_method_with_mandate_data(
mandate_data: Option<serde_json::Value>,
) -> PaymentMethod {
let payment_method = PaymentMethod {
customer_id: id_type::CustomerId::default(),
merchant_id: id_type::MerchantId::default(),
payment_method_id: String::from("abc"),
accepted_currency: None,
scheme: None,
token: None,
cardholder_name: None,
issuer_name: None,
issuer_country: None,
payer_country: None,
is_stored: None,
swift_code: None,
direct_debit_token: None,
created_at: common_utils::date_time::now(),
last_modified: common_utils::date_time::now(),
payment_method: None,
payment_method_type: None,
payment_method_issuer: None,
payment_method_issuer_code: None,
metadata: None,
payment_method_data: None,
locker_id: None,
last_used_at: common_utils::date_time::now(),
connector_mandate_details: mandate_data,
customer_acceptance: None,
status: storage_enums::PaymentMethodStatus::Active,
network_transaction_id: None,
client_secret: None,
payment_method_billing_address: None,
updated_by: None,
version: common_enums::ApiVersion::V1,
network_token_requestor_reference_id: None,
network_token_locker_id: None,
network_token_payment_method_data: None,
vault_source_details: Default::default(),
};
payment_method.clone()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_payment_method_with_mandate_data",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-4896982616291137593 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
fn test_get_common_mandate_reference_payments_only() {
let connector_mandate_details = serde_json::json!({
"mca_kGz30G8B95MxRwmeQqy6": {
"mandate_metadata": null,
"payment_method_type": null,
"connector_mandate_id": "RcBww0a02c-R22w22w22wNJV-V14o20u24y18sTB18sB24y06g04eVZ04e20u14o",
"connector_mandate_status": "active",
"original_payment_authorized_amount": 51,
"original_payment_authorized_currency": "USD",
"connector_mandate_request_reference_id": "RowbU9ULN9H59bMhWk"
}
});
let payment_method = get_payment_method_with_mandate_data(Some(connector_mandate_details));
let result = payment_method.get_common_mandate_reference();
assert!(result.is_ok());
let common_mandate = result.unwrap();
assert!(common_mandate.payments.is_some());
assert!(common_mandate.payouts.is_none());
let payments = common_mandate.payments.unwrap();
let result_mca = MerchantConnectorAccountId::wrap("mca_kGz30G8B95MxRwmeQqy6".to_string());
assert!(
result_mca.is_ok(),
"Expected Ok, but got Err: {result_mca:?}",
);
let mca = result_mca.unwrap();
assert!(payments.0.contains_key(&mca));
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "test_get_common_mandate_reference_payments_only",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-7103548892371766 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
fn test_get_common_mandate_reference_empty_details() {
let payment_method = get_payment_method_with_mandate_data(None);
let result = payment_method.get_common_mandate_reference();
assert!(result.is_ok());
let common_mandate = result.unwrap();
assert!(common_mandate.payments.is_none());
assert!(common_mandate.payouts.is_none());
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "test_get_common_mandate_reference_empty_details",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_8035191019340356698 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
fn test_get_common_mandate_reference_payouts_only() {
let connector_mandate_details = serde_json::json!({
"payouts": {
"mca_DAHVXbXpbYSjnL7fQWEs": {
"transfer_method_id": "TRM-678ab3997b16cb7cd"
}
}
});
let payment_method = get_payment_method_with_mandate_data(Some(connector_mandate_details));
let result = payment_method.get_common_mandate_reference();
assert!(result.is_ok());
let common_mandate = result.unwrap();
assert!(common_mandate.payments.is_some());
assert!(common_mandate.payouts.is_some());
let payouts = common_mandate.payouts.unwrap();
let result_mca = MerchantConnectorAccountId::wrap("mca_DAHVXbXpbYSjnL7fQWEs".to_string());
assert!(
result_mca.is_ok(),
"Expected Ok, but got Err: {result_mca:?}",
);
let mca = result_mca.unwrap();
assert!(payouts.0.contains_key(&mca));
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "test_get_common_mandate_reference_payouts_only",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-8169582826578153342 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
fn test_get_common_mandate_reference_invalid_data() {
let connector_mandate_details = serde_json::json!("invalid");
let payment_method = get_payment_method_with_mandate_data(Some(connector_mandate_details));
let result = payment_method.get_common_mandate_reference();
assert!(result.is_err());
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "test_get_common_mandate_reference_invalid_data",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_3899503830431150924 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
fn test_get_common_mandate_reference_with_payments_and_payouts_details() {
let connector_mandate_details = serde_json::json!({
"mca_kGz30G8B95MxRwmeQqy6": {
"mandate_metadata": null,
"payment_method_type": null,
"connector_mandate_id": "RcBww0a02c-R22w22w22wNJV-V14o20u24y18sTB18sB24y06g04eVZ04e20u14o",
"connector_mandate_status": "active",
"original_payment_authorized_amount": 51,
"original_payment_authorized_currency": "USD",
"connector_mandate_request_reference_id": "RowbU9ULN9H59bMhWk"
},
"payouts": {
"mca_DAHVXbXpbYSjnL7fQWEs": {
"transfer_method_id": "TRM-678ab3997b16cb7cd"
}
}
});
let payment_method = get_payment_method_with_mandate_data(Some(connector_mandate_details));
let result = payment_method.get_common_mandate_reference();
assert!(result.is_ok());
let common_mandate = result.unwrap();
assert!(common_mandate.payments.is_some());
assert!(common_mandate.payouts.is_some());
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "test_get_common_mandate_reference_with_payments_and_payouts_details",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_4142250603467124837 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/refunds.rs
fn try_from(
(value, auth_profile_id_list): (
api_models::refunds::RefundListRequest,
Option<Vec<common_utils::id_type::ProfileId>>,
),
) -> Result<Self, Self::Error> {
let api_models::refunds::RefundListRequest {
connector,
currency,
refund_status,
payment_id,
refund_id,
profile_id,
limit,
offset,
time_range,
amount_filter,
merchant_connector_id,
} = value;
let profile_id_from_request_body = profile_id;
let profile_id_list = match (profile_id_from_request_body, auth_profile_id_list) {
(None, None) => None,
(None, Some(auth_profile_id_list)) => Some(auth_profile_id_list),
(Some(profile_id_from_request_body), None) => Some(vec![profile_id_from_request_body]),
(Some(profile_id_from_request_body), Some(auth_profile_id_list)) => {
let profile_id_from_request_body_is_available_in_auth_profile_id_list =
auth_profile_id_list.contains(&profile_id_from_request_body);
if profile_id_from_request_body_is_available_in_auth_profile_id_list {
Some(vec![profile_id_from_request_body])
} else {
// This scenario is very unlikely to happen
return Err(error_stack::Report::new(
errors::api_error_response::ApiErrorResponse::PreconditionFailed {
message: format!(
"Access not available for the given profile_id {profile_id_from_request_body:?}",
),
},
));
}
}
};
Ok(Self {
payment_id,
refund_id,
profile_id: profile_id_list,
limit,
offset,
time_range,
amount_filter,
connector,
merchant_connector_id,
currency,
refund_status,
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "try_from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-142803337040856177 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/refunds.rs
fn from((value, profile): (api_models::refunds::RefundListRequest, Profile)) -> Self {
let api_models::refunds::RefundListRequest {
payment_id,
refund_id,
connector,
currency,
refund_status,
limit,
offset,
time_range,
amount_filter,
connector_id_list,
} = value;
Self {
payment_id,
refund_id,
profile_id: profile.get_id().to_owned(),
limit,
offset,
time_range,
amount_filter,
connector,
connector_id_list,
currency,
refund_status,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-3958834106249533095 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
pub fn new(
shipping: Option<Address>,
billing: Option<Address>,
payment_method_billing: Option<Address>,
should_unify_address: Option<bool>,
) -> Self {
// billing -> .billing, this is the billing details passed in the root of payments request
// payment_method_billing -> .payment_method_data.billing
let unified_payment_method_billing = if should_unify_address.unwrap_or(true) {
// Merge the billing details field from both `payment.billing` and `payment.payment_method_data.billing`
// The unified payment_method_billing will be used as billing address and passed to the connector module
// This unification is required in order to provide backwards compatibility
// so that if `payment.billing` is passed it should be sent to the connector module
// Unify the billing details with `payment_method_data.billing`
payment_method_billing
.as_ref()
.map(|payment_method_billing| {
payment_method_billing
.clone()
.unify_address(billing.as_ref())
})
.or(billing.clone())
} else {
payment_method_billing.clone()
};
Self {
shipping,
billing,
unified_payment_method_billing,
payment_method_billing,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "new",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_5675889582065308135 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
pub fn get_shipping(&self) -> Option<&Address> {
self.shipping.as_ref()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_shipping",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_7290442795566173844 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
pub fn get_payment_method_billing(&self) -> Option<&Address> {
self.unified_payment_method_billing.as_ref()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_payment_method_billing",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-5457982189527829118 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
pub fn unify_with_payment_method_data_billing(
self,
payment_method_data_billing: Option<Address>,
) -> Self {
// Unify the billing details with `payment_method_data.billing_details`
let unified_payment_method_billing = payment_method_data_billing
.map(|payment_method_data_billing| {
payment_method_data_billing.unify_address(self.get_payment_method_billing())
})
.or(self.get_payment_method_billing().cloned());
Self {
shipping: self.shipping,
billing: self.billing,
unified_payment_method_billing,
payment_method_billing: self.payment_method_billing,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "unify_with_payment_method_data_billing",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-2947484009875713540 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
pub fn unify_with_payment_data_billing(
self,
other_payment_method_billing: Option<Address>,
) -> Self {
let unified_payment_method_billing = self
.get_payment_method_billing()
.map(|payment_method_billing| {
payment_method_billing
.clone()
.unify_address(other_payment_method_billing.as_ref())
})
.or(other_payment_method_billing);
Self {
shipping: self.shipping,
billing: self.billing,
unified_payment_method_billing,
payment_method_billing: self.payment_method_billing,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "unify_with_payment_data_billing",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-99058618574148553 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
pub fn get_request_payment_method_billing(&self) -> Option<&Address> {
self.payment_method_billing.as_ref()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_request_payment_method_billing",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_7234373660407506869 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
pub fn get_payment_billing(&self) -> Option<&Address> {
self.billing.as_ref()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_payment_billing",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_5558074118916809458 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
fn from(merchant_account_update: MerchantAccountUpdate) -> Self {
let now = date_time::now();
match merchant_account_update {
MerchantAccountUpdate::Update {
merchant_name,
merchant_details,
publishable_key,
metadata,
} => Self {
merchant_name: merchant_name.map(Encryption::from),
merchant_details: merchant_details.map(Encryption::from),
publishable_key,
metadata: metadata.map(|metadata| *metadata),
modified_at: now,
storage_scheme: None,
organization_id: None,
recon_status: None,
is_platform_account: None,
product_type: None,
},
MerchantAccountUpdate::StorageSchemeUpdate { storage_scheme } => Self {
storage_scheme: Some(storage_scheme),
modified_at: now,
merchant_name: None,
merchant_details: None,
publishable_key: None,
metadata: None,
organization_id: None,
recon_status: None,
is_platform_account: None,
product_type: None,
},
MerchantAccountUpdate::ReconUpdate { recon_status } => Self {
recon_status: Some(recon_status),
modified_at: now,
merchant_name: None,
merchant_details: None,
publishable_key: None,
storage_scheme: None,
metadata: None,
organization_id: None,
is_platform_account: None,
product_type: None,
},
MerchantAccountUpdate::ModifiedAtUpdate => Self {
modified_at: now,
merchant_name: None,
merchant_details: None,
publishable_key: None,
storage_scheme: None,
metadata: None,
organization_id: None,
recon_status: None,
is_platform_account: None,
product_type: None,
},
MerchantAccountUpdate::ToPlatformAccount => Self {
modified_at: now,
merchant_name: None,
merchant_details: None,
publishable_key: None,
storage_scheme: None,
metadata: None,
organization_id: None,
recon_status: None,
is_platform_account: Some(true),
product_type: None,
},
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-1398659117687601526 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
pub fn get_id(&self) -> &common_utils::id_type::MerchantId {
&self.id
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-7301904716059648660 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
pub fn get_org_id(&self) -> &common_utils::id_type::OrganizationId {
&self.organization_id
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_org_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_5600439363431565742 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
pub fn get_merchant_details(&self) -> &OptionalEncryptableValue {
&self.merchant_details
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_merchant_details",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_437819324082836098 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
pub fn get_merchant_tax_registration_id(&self) -> Option<Secret<String>> {
self.merchant_details.as_ref().and_then(|details| {
details
.get_inner()
.peek()
.get("merchant_tax_registration_id")
.and_then(|id| id.as_str().map(|s| Secret::new(s.to_string())))
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_merchant_tax_registration_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-5668010460183456343 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
pub fn is_platform_account(&self) -> bool {
matches!(
self.merchant_account_type,
common_enums::MerchantAccountType::Platform
)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "is_platform_account",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-1998830960095561668 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
async fn convert(self) -> CustomResult<Self::DstType, ValidationError> {
let setter = diesel_models::merchant_account::MerchantAccountSetter {
merchant_id: self.merchant_id,
return_url: self.return_url,
enable_payment_response_hash: self.enable_payment_response_hash,
payment_response_hash_key: self.payment_response_hash_key,
redirect_to_merchant_with_http_post: self.redirect_to_merchant_with_http_post,
merchant_name: self.merchant_name.map(|name| name.into()),
merchant_details: self.merchant_details.map(|details| details.into()),
webhook_details: self.webhook_details,
sub_merchants_enabled: self.sub_merchants_enabled,
parent_merchant_id: self.parent_merchant_id,
publishable_key: Some(self.publishable_key),
storage_scheme: self.storage_scheme,
locker_id: self.locker_id,
metadata: self.metadata,
routing_algorithm: self.routing_algorithm,
primary_business_details: self.primary_business_details,
created_at: self.created_at,
modified_at: self.modified_at,
intent_fulfillment_time: self.intent_fulfillment_time,
frm_routing_algorithm: self.frm_routing_algorithm,
payout_routing_algorithm: self.payout_routing_algorithm,
organization_id: self.organization_id,
is_recon_enabled: self.is_recon_enabled,
default_profile: self.default_profile,
recon_status: self.recon_status,
payment_link_config: self.payment_link_config,
pm_collect_link_config: self.pm_collect_link_config,
version: self.version,
is_platform_account: self.is_platform_account,
product_type: self.product_type,
merchant_account_type: self.merchant_account_type,
};
Ok(diesel_models::MerchantAccount::from(setter))
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "convert",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_4180777758290478584 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
async fn convert_back(
state: &keymanager::KeyManagerState,
item: Self::DstType,
key: &Secret<Vec<u8>>,
key_manager_identifier: keymanager::Identifier,
) -> CustomResult<Self, ValidationError>
where
Self: Sized,
{
let merchant_id = item.get_id().to_owned();
let publishable_key =
item.publishable_key
.ok_or(ValidationError::MissingRequiredField {
field_name: "publishable_key".to_string(),
})?;
async {
Ok::<Self, error_stack::Report<common_utils::errors::CryptoError>>(Self {
merchant_id,
return_url: item.return_url,
enable_payment_response_hash: item.enable_payment_response_hash,
payment_response_hash_key: item.payment_response_hash_key,
redirect_to_merchant_with_http_post: item.redirect_to_merchant_with_http_post,
merchant_name: item
.merchant_name
.async_lift(|inner| async {
crypto_operation(
state,
type_name!(Self::DstType),
CryptoOperation::DecryptOptional(inner),
key_manager_identifier.clone(),
key.peek(),
)
.await
.and_then(|val| val.try_into_optionaloperation())
})
.await?,
merchant_details: item
.merchant_details
.async_lift(|inner| async {
crypto_operation(
state,
type_name!(Self::DstType),
CryptoOperation::DecryptOptional(inner),
key_manager_identifier.clone(),
key.peek(),
)
.await
.and_then(|val| val.try_into_optionaloperation())
})
.await?,
webhook_details: item.webhook_details,
sub_merchants_enabled: item.sub_merchants_enabled,
parent_merchant_id: item.parent_merchant_id,
publishable_key,
storage_scheme: item.storage_scheme,
locker_id: item.locker_id,
metadata: item.metadata,
routing_algorithm: item.routing_algorithm,
frm_routing_algorithm: item.frm_routing_algorithm,
primary_business_details: item.primary_business_details,
created_at: item.created_at,
modified_at: item.modified_at,
intent_fulfillment_time: item.intent_fulfillment_time,
payout_routing_algorithm: item.payout_routing_algorithm,
organization_id: item.organization_id,
is_recon_enabled: item.is_recon_enabled,
default_profile: item.default_profile,
recon_status: item.recon_status,
payment_link_config: item.payment_link_config,
pm_collect_link_config: item.pm_collect_link_config,
version: item.version,
is_platform_account: item.is_platform_account,
product_type: item.product_type,
merchant_account_type: item.merchant_account_type.unwrap_or_default(),
})
}
.await
.change_context(ValidationError::InvalidValue {
message: "Failed while decrypting merchant data".to_string(),
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "convert_back",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_4133214877180630186 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
async fn construct_new(self) -> CustomResult<Self::NewDstType, ValidationError> {
let now = date_time::now();
Ok(diesel_models::merchant_account::MerchantAccountNew {
id: Some(self.merchant_id.clone()),
merchant_id: self.merchant_id,
merchant_name: self.merchant_name.map(Encryption::from),
merchant_details: self.merchant_details.map(Encryption::from),
return_url: self.return_url,
webhook_details: self.webhook_details,
sub_merchants_enabled: self.sub_merchants_enabled,
parent_merchant_id: self.parent_merchant_id,
enable_payment_response_hash: Some(self.enable_payment_response_hash),
payment_response_hash_key: self.payment_response_hash_key,
redirect_to_merchant_with_http_post: Some(self.redirect_to_merchant_with_http_post),
publishable_key: Some(self.publishable_key),
locker_id: self.locker_id,
metadata: self.metadata,
routing_algorithm: self.routing_algorithm,
primary_business_details: self.primary_business_details,
created_at: now,
modified_at: now,
intent_fulfillment_time: self.intent_fulfillment_time,
frm_routing_algorithm: self.frm_routing_algorithm,
payout_routing_algorithm: self.payout_routing_algorithm,
organization_id: self.organization_id,
is_recon_enabled: self.is_recon_enabled,
default_profile: self.default_profile,
recon_status: self.recon_status,
payment_link_config: self.payment_link_config,
pm_collect_link_config: self.pm_collect_link_config,
version: common_types::consts::API_VERSION,
is_platform_account: self.is_platform_account,
product_type: self
.product_type
.or(Some(common_enums::MerchantProductType::Orchestration)),
merchant_account_type: self.merchant_account_type,
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "construct_new",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_3664602577428000236 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
pub fn get_compatible_connector(&self) -> Option<api_models::enums::Connector> {
let metadata: Option<api_models::admin::MerchantAccountMetadata> =
self.metadata.as_ref().and_then(|meta| {
meta.clone()
.parse_value("MerchantAccountMetadata")
.map_err(|err| logger::error!("Failed to deserialize {:?}", err))
.ok()
});
metadata.and_then(|a| a.compatible_connector)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_compatible_connector",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-5700763917070023383 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/router_data_v2.rs
fn deref(&self) -> &Self::Target {
&self.resource_common_data
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "deref",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-4828278502855885153 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/payouts.rs
fn from(value: api_models::payouts::PayoutListFilterConstraints) -> Self {
if let Some(payout_id) = value.payout_id {
Self::Single { payout_id }
} else {
Self::List(Box::new(PayoutListParams {
offset: value.offset.unwrap_or_default(),
starting_at: value.time_range.map(|t| t.start_time),
ending_at: value.time_range.and_then(|t| t.end_time),
connector: value.connector,
currency: value.currency,
status: value.status,
payout_method: value.payout_method,
profile_id: value.profile_id,
customer_id: value.customer_id,
starting_after_id: None,
ending_before_id: None,
entity_type: value.entity_type,
merchant_order_reference_id: value.merchant_order_reference_id,
limit: Some(std::cmp::min(
value.limit,
consts::PAYOUTS_LIST_MAX_LIMIT_POST,
)),
}))
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "from",
"is_async": false,
"is_pub": false,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-709265895512787993 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.id.clone()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_id",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-6136478301032818222 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
pub fn get_connector_account_details(
&self,
) -> error_stack::Result<router_data::ConnectorAuthType, common_utils::errors::ParsingError>
{
use common_utils::ext_traits::ValueExt;
self.connector_account_details
.get_inner()
.clone()
.parse_value("ConnectorAuthType")
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_connector_account_details",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_fn_hyperswitch_domain_models_-3956939442850388343 | clm | function | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
pub fn get_connector_wallets_details(&self) -> Option<Secret<Value>> {
self.connector_wallets_details.as_deref().cloned()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": null,
"function_name": "get_connector_wallets_details",
"is_async": false,
"is_pub": true,
"lines": null,
"method_name": null,
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.