id stringlengths 20 153 | type stringclasses 1
value | granularity stringclasses 14
values | content stringlengths 16 84.3k | metadata dict |
|---|---|---|---|---|
hyperswitch_method_hyperswitch_interfaces_MerchantConnectorAccountType_is_disabled | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/configs.rs
// impl for MerchantConnectorAccountType
pub fn is_disabled(&self) -> bool {
match self {
Self::DbVal(ref inner) => inner.disabled.unwrap_or(false),
// Cached merchant connector account, only contains the account details,
// the merchant connector account must only be cached if it's not disabled
Self::CacheVal(_) => false,
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccountType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_disabled",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_MerchantConnectorAccountType_is_test_mode_on | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/configs.rs
// impl for MerchantConnectorAccountType
pub fn is_test_mode_on(&self) -> Option<bool> {
None
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccountType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_test_mode_on",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_MerchantConnectorAccountType_get_mca_id | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/configs.rs
// impl for MerchantConnectorAccountType
pub fn get_mca_id(&self) -> Option<id_type::MerchantConnectorAccountId> {
match self {
Self::DbVal(db_val) => Some(db_val.get_id()),
Self::CacheVal(_) => None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccountType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_mca_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_MerchantConnectorAccountType_get_connector_name | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/configs.rs
// impl for MerchantConnectorAccountType
pub fn get_connector_name(&self) -> Option<common_enums::connector_enums::Connector> {
match self {
Self::DbVal(db_val) => Some(db_val.connector_name),
Self::CacheVal(_) => None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccountType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_name",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_MerchantConnectorAccountType_get_additional_merchant_data | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/configs.rs
// impl for MerchantConnectorAccountType
pub fn get_additional_merchant_data(&self) -> Option<Encryptable<Secret<serde_json::Value>>> {
match self {
Self::DbVal(db_val) => db_val.additional_merchant_data.clone(),
Self::CacheVal(_) => None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccountType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_additional_merchant_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_MerchantConnectorAccountType_get_webhook_details | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/configs.rs
// impl for MerchantConnectorAccountType
pub fn get_webhook_details(
&self,
) -> CustomResult<Option<&Secret<serde_json::Value>>, api_error_response::ApiErrorResponse>
{
match self {
Self::DbVal(db_val) => Ok(db_val.connector_webhook_details.as_ref()),
Self::CacheVal(_) => Ok(None),
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccountType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_webhook_details",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_ConnectorEnum_get_connector_integration | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/connector_integration_interface.rs
// impl for ConnectorEnum
pub fn get_connector_integration<F, ResourceCommonData, Req, Resp>(
&self,
) -> BoxedConnectorIntegrationInterface<F, ResourceCommonData, Req, Resp>
where
dyn Connector + Sync: ConnectorIntegration<F, Req, Resp>,
dyn ConnectorV2 + Sync: ConnectorIntegrationV2<F, ResourceCommonData, Req, Resp>,
ResourceCommonData: RouterDataConversion<F, Req, Resp> + Clone + 'static,
F: Clone + 'static,
Req: Clone + 'static,
Resp: Clone + 'static,
{
match self {
Self::Old(old_integration) => Box::new(ConnectorIntegrationEnum::Old(
old_integration.get_connector_integration(),
)),
Self::New(new_integration) => Box::new(ConnectorIntegrationEnum::New(
new_integration.get_connector_integration_v2(),
)),
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorEnum",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_integration",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_ConnectorEnum_validate_file_upload | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/connector_integration_interface.rs
// impl for ConnectorEnum
pub fn validate_file_upload(
&self,
purpose: api::files::FilePurpose,
file_size: i32,
file_type: mime::Mime,
) -> CustomResult<(), errors::ConnectorError> {
match self {
Self::Old(connector) => connector.validate_file_upload(purpose, file_size, file_type),
Self::New(connector) => {
connector.validate_file_upload_v2(purpose, file_size, file_type)
}
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorEnum",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "validate_file_upload",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_ConnectorError_is_connector_timeout | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/errors.rs
// impl for ConnectorError
pub fn is_connector_timeout(&self) -> bool {
self == &Self::RequestTimeoutReceived
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorError",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_connector_timeout",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_SecretStateContainer<T, S>_into_inner | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/secrets_interface/secret_state.rs
// impl for SecretStateContainer<T, S>
pub fn into_inner(self) -> T {
self.inner
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "SecretStateContainer<T, S>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "into_inner",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_SecretStateContainer<T, S>_get_inner | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/secrets_interface/secret_state.rs
// impl for SecretStateContainer<T, S>
pub fn get_inner(&self) -> &T {
&self.inner
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "SecretStateContainer<T, S>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_inner",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_SecretStateContainer<T, SecuredSecret>_transition_state | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/secrets_interface/secret_state.rs
// impl for SecretStateContainer<T, SecuredSecret>
pub fn transition_state(
mut self,
decryptor_fn: impl FnOnce(T) -> T,
) -> SecretStateContainer<T, RawSecret> {
self.inner = decryptor_fn(self.inner);
SecretStateContainer {
inner: self.inner,
marker: PhantomData,
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "SecretStateContainer<T, SecuredSecret>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "transition_state",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_new | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn new(
tenant_id: common_utils::id_type::TenantId,
routable_connectors: String,
flow: &str,
request: serde_json::Value,
url: String,
method: ApiMethod,
payment_id: String,
profile_id: common_utils::id_type::ProfileId,
merchant_id: common_utils::id_type::MerchantId,
request_id: Option<RequestId>,
routing_engine: RoutingEngine,
) -> Self {
Self {
tenant_id,
routable_connectors,
flow: flow.to_string(),
request: request.to_string(),
response: None,
error: None,
url,
method: method.to_string(),
payment_id,
profile_id,
merchant_id,
created_at: OffsetDateTime::now_utc().unix_timestamp_nanos(),
status_code: None,
request_id: request_id
.map(|i| i.as_hyphenated().to_string())
.unwrap_or("NO_REQUEST_ID".to_string()),
routing_engine,
payment_connector: None,
routing_approach: None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_set_response_body | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn set_response_body<T: Serialize>(&mut self, response: &T) {
match masking::masked_serialize(response) {
Ok(masked) => {
self.response = Some(masked.to_string());
}
Err(er) => self.set_error(json!({"error": er.to_string()})),
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_response_body",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_set_error_response_body | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn set_error_response_body<T: Serialize>(&mut self, response: &T) {
match masking::masked_serialize(response) {
Ok(masked) => {
self.error = Some(masked.to_string());
}
Err(er) => self.set_error(json!({"error": er.to_string()})),
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_error_response_body",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_set_error | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn set_error(&mut self, error: serde_json::Value) {
self.error = Some(error.to_string());
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_error",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_set_status_code | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn set_status_code(&mut self, code: u16) {
self.status_code = Some(code);
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_status_code",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_set_routable_connectors | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn set_routable_connectors(&mut self, connectors: Vec<RoutableConnectorChoice>) {
let connectors = connectors
.into_iter()
.map(|c| {
format!(
"{:?}:{:?}",
c.connector,
c.merchant_connector_id
.map(|id| id.get_string_repr().to_string())
.unwrap_or(String::from(""))
)
})
.collect::<Vec<_>>()
.join(",");
self.routable_connectors = connectors;
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_routable_connectors",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_set_payment_connector | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn set_payment_connector(&mut self, connector: RoutableConnectorChoice) {
self.payment_connector = Some(format!(
"{:?}:{:?}",
connector.connector,
connector
.merchant_connector_id
.map(|id| id.get_string_repr().to_string())
.unwrap_or(String::from(""))
));
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_payment_connector",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_set_routing_approach | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn set_routing_approach(&mut self, approach: String) {
self.routing_approach = Some(approach);
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_routing_approach",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_get_request_id | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn get_request_id(&self) -> &str {
&self.request_id
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_request_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_get_merchant_id | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn get_merchant_id(&self) -> &str {
self.merchant_id.get_string_repr()
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_get_payment_id | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn get_payment_id(&self) -> &str {
&self.payment_id
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_RoutingEvent_get_profile_id | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/routing_api_logs.rs
// impl for RoutingEvent
pub fn get_profile_id(&self) -> &str {
self.profile_id.get_string_repr()
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "RoutingEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_profile_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_ConnectorEvent_new | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/connector_api_logs.rs
// impl for ConnectorEvent
pub fn new(
tenant_id: common_utils::id_type::TenantId,
connector_name: String,
flow: &str,
request: serde_json::Value,
url: String,
method: Method,
payment_id: String,
merchant_id: common_utils::id_type::MerchantId,
request_id: Option<&RequestId>,
latency: u128,
refund_id: Option<String>,
dispute_id: Option<String>,
status_code: u16,
) -> Self {
Self {
tenant_id,
connector_name,
flow: flow
.rsplit_once("::")
.map(|(_, s)| s)
.unwrap_or(flow)
.to_string(),
request: request.to_string(),
masked_response: None,
error: None,
url,
method: method.to_string(),
payment_id,
merchant_id,
created_at: OffsetDateTime::now_utc().unix_timestamp_nanos() / 1_000_000,
request_id: request_id
.map(|i| i.as_hyphenated().to_string())
.unwrap_or("NO_REQUEST_ID".to_string()),
latency,
refund_id,
dispute_id,
status_code,
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_ConnectorEvent_set_response_body | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/connector_api_logs.rs
// impl for ConnectorEvent
pub fn set_response_body<T: Serialize>(&mut self, response: &T) {
match masking::masked_serialize(response) {
Ok(masked) => {
self.masked_response = Some(masked.to_string());
}
Err(er) => self.set_error(json!({"error": er.to_string()})),
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_response_body",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_ConnectorEvent_set_error_response_body | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/connector_api_logs.rs
// impl for ConnectorEvent
pub fn set_error_response_body<T: Serialize>(&mut self, response: &T) {
match masking::masked_serialize(response) {
Ok(masked) => {
self.error = Some(masked.to_string());
}
Err(er) => self.set_error(json!({"error": er.to_string()})),
}
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_error_response_body",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_interfaces_ConnectorEvent_set_error | clm | method | // hyperswitch/crates/hyperswitch_interfaces/src/events/connector_api_logs.rs
// impl for ConnectorEvent
pub fn set_error(&mut self, error: serde_json::Value) {
self.error = Some(error.to_string());
}
| {
"chunk": null,
"crate": "hyperswitch_interfaces",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorEvent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_error",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AppClient<Guest>_guest | clm | method | // hyperswitch/crates/router/tests/utils.rs
// impl for AppClient<Guest>
pub fn guest() -> Self {
Self { state: Guest }
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AppClient<Guest>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "guest",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AppClient<Admin>_create_merchant_account | clm | method | // hyperswitch/crates/router/tests/utils.rs
// impl for AppClient<Admin>
pub async fn create_merchant_account<T: DeserializeOwned, S, B>(
&self,
app: &S,
merchant_id: impl Into<Option<String>>,
) -> T
where
S: Service<Request, Response = ServiceResponse<B>, Error = actix_web::Error>,
B: MessageBody,
{
let request = TestRequest::post()
.uri("/accounts")
.append_header(("api-key".to_owned(), self.state.authkey.clone()))
.set_json(mk_merchant_account(merchant_id.into()))
.to_request();
call_and_read_body_json(app, request).await
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AppClient<Admin>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_merchant_account",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AppClient<Admin>_create_connector | clm | method | // hyperswitch/crates/router/tests/utils.rs
// impl for AppClient<Admin>
pub async fn create_connector<T: DeserializeOwned, S, B>(
&self,
app: &S,
merchant_id: &common_utils::id_type::MerchantId,
connector_name: &str,
api_key: &str,
) -> T
where
S: Service<Request, Response = ServiceResponse<B>, Error = actix_web::Error>,
B: MessageBody,
{
let request = TestRequest::post()
.uri(&format!(
"/account/{}/connectors",
merchant_id.get_string_repr()
))
.append_header(("api-key".to_owned(), self.state.authkey.clone()))
.set_json(mk_connector(connector_name, api_key))
.to_request();
call_and_read_body_json(app, request).await
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AppClient<Admin>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_connector",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AppClient<User>_create_payment | clm | method | // hyperswitch/crates/router/tests/utils.rs
// impl for AppClient<User>
pub async fn create_payment<T: DeserializeOwned, S, B>(
&self,
app: &S,
amount: i64,
amount_to_capture: i32,
) -> T
where
S: Service<Request, Response = ServiceResponse<B>, Error = actix_web::Error>,
B: MessageBody,
{
let request = TestRequest::post()
.uri("/payments")
.append_header(("api-key".to_owned(), self.state.authkey.clone()))
.set_json(mk_payment(amount, amount_to_capture))
.to_request();
call_and_read_body_json(app, request).await
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AppClient<User>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_payment",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AppClient<User>_create_refund | clm | method | // hyperswitch/crates/router/tests/utils.rs
// impl for AppClient<User>
pub async fn create_refund<T: DeserializeOwned, S, B>(
&self,
app: &S,
payment_id: &common_utils::id_type::PaymentId,
amount: usize,
) -> T
where
S: Service<Request, Response = ServiceResponse<B>, Error = actix_web::Error>,
B: MessageBody,
{
let request = TestRequest::post()
.uri("/refunds")
.append_header(("api-key".to_owned(), self.state.authkey.clone()))
.set_json(mk_refund(payment_id, amount))
.to_request();
call_and_read_body_json(app, request).await
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AppClient<User>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_refund",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AppClient<T>_admin | clm | method | // hyperswitch/crates/router/tests/utils.rs
// impl for AppClient<T>
pub fn admin(&self, authkey: &str) -> AppClient<Admin> {
AppClient {
state: Admin {
authkey: authkey.to_string(),
},
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AppClient<T>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "admin",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AppClient<T>_user | clm | method | // hyperswitch/crates/router/tests/utils.rs
// impl for AppClient<T>
pub fn user(&self, authkey: &str) -> AppClient<User> {
AppClient {
state: User {
authkey: authkey.to_string(),
},
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AppClient<T>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "user",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AppClient<T>_health | clm | method | // hyperswitch/crates/router/tests/utils.rs
// impl for AppClient<T>
pub async fn health<S, B>(&self, app: &S) -> String
where
S: Service<Request, Response = ServiceResponse<B>, Error = actix_web::Error>,
B: MessageBody,
{
let request = TestRequest::get().uri("/health").to_request();
let bytes = actix_web::test::call_and_read_body(app, request).await;
String::from_utf8(bytes.to_vec()).unwrap()
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AppClient<T>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "health",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_NomupayTest_get_payout_info | clm | method | // hyperswitch/crates/router/tests/connectors/nomupay.rs
// impl for NomupayTest
fn get_payout_info() -> Option<PaymentInfo> {
Some(PaymentInfo {
currency: Some(enums::Currency::GBP),
address: Some(PaymentAddress::new(
None,
Some(
Address {
address: Some(AddressDetails {
country: Some(api_models::enums::CountryAlpha2::GB),
city: Some("London".to_string()),
zip: Some(Secret::new("10025".to_string())),
line1: Some(Secret::new("50 Branson Ave".to_string())),
..Default::default()
}),
phone: None,
email: None,
}
.into(),
),
None,
None,
)),
payout_method_data: Some(api::PayoutMethodData::Bank(api::payouts::BankPayout::Sepa(
api::SepaBankTransfer {
bank_name: Some("Deutsche Bank".to_string()),
bank_country_code: Some(enums::CountryAlpha2::DE),
bank_city: Some("Munich".to_string()),
iban: Secret::new("DE57331060435647542639".to_string()),
bic: Some(Secret::new("DEUTDE5M551".to_string())),
},
))),
..Default::default()
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "NomupayTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payout_info",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AdyenTest_get_payment_info | clm | method | // hyperswitch/crates/router/tests/connectors/adyen.rs
// impl for AdyenTest
fn get_payment_info() -> Option<PaymentInfo> {
Some(PaymentInfo {
address: Some(PaymentAddress::new(
None,
Some(Address {
address: Some(AddressDetails {
country: Some(api_models::enums::CountryAlpha2::US),
state: Some(Secret::new("California".to_string())),
city: Some("San Francisco".to_string()),
zip: Some(Secret::new("94122".to_string())),
line1: Some(Secret::new("1467".to_string())),
line2: Some(Secret::new("Harrison Street".to_string())),
line3: None,
first_name: Some(Secret::new("John".to_string())),
last_name: Some(Secret::new("Dough".to_string())),
origin_zip: None,
}),
phone: Some(PhoneDetails {
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+351".to_string()),
}),
email: None,
}),
None,
None,
)),
..Default::default()
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AdyenTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_info",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AdyenTest_get_payout_info | clm | method | // hyperswitch/crates/router/tests/connectors/adyen.rs
// impl for AdyenTest
fn get_payout_info(payout_type: enums::PayoutType) -> Option<PaymentInfo> {
use common_utils::pii::Email;
Some(PaymentInfo {
currency: Some(enums::Currency::EUR),
address: Some(PaymentAddress::new(
None,
Some(Address {
address: Some(AddressDetails {
country: Some(api_models::enums::CountryAlpha2::US),
state: Some(Secret::new("California".to_string())),
city: Some("San Francisco".to_string()),
zip: Some(Secret::new("94122".to_string())),
line1: Some(Secret::new("1467".to_string())),
line2: Some(Secret::new("Harrison Street".to_string())),
..Default::default()
}),
phone: None,
email: None,
}),
None,
None,
)),
payout_method_data: match payout_type {
enums::PayoutType::Card => Some(types::api::PayoutMethodData::Card(
types::api::payouts::CardPayout {
card_number: cards::CardNumber::from_str("4111111111111111").unwrap(),
expiry_month: Secret::new("3".to_string()),
expiry_year: Secret::new("2030".to_string()),
card_holder_name: Some(Secret::new("John Doe".to_string())),
},
)),
enums::PayoutType::Bank => Some(types::api::PayoutMethodData::Bank(
types::api::payouts::BankPayout::Sepa(types::api::SepaBankTransfer {
iban: "NL46TEST0136169112".to_string().into(),
bic: Some("ABNANL2A".to_string().into()),
bank_name: Some("Deutsche Bank".to_string()),
bank_country_code: Some(enums::CountryAlpha2::NL),
bank_city: Some("Amsterdam".to_string()),
}),
)),
enums::PayoutType::Wallet => Some(types::api::PayoutMethodData::Wallet(
types::api::payouts::WalletPayout::Paypal(api_models::payouts::Paypal {
email: Email::from_str("EmailUsedForPayPalAccount@example.com").ok(),
telephone_number: None,
paypal_id: None,
}),
)),
enums::PayoutType::BankRedirect => {
Some(types::api::PayoutMethodData::BankRedirect(
types::api::payouts::BankRedirectPayout::Interac(
api_models::payouts::Interac {
email: Email::from_str("EmailUsedForPayPalAccount@example.com")
.ok()?,
},
),
))
}
},
..Default::default()
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AdyenTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payout_info",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AdyenTest_get_payment_authorize_data | clm | method | // hyperswitch/crates/router/tests/connectors/adyen.rs
// impl for AdyenTest
fn get_payment_authorize_data(
card_number: &str,
card_exp_month: &str,
card_exp_year: &str,
card_cvc: &str,
capture_method: enums::CaptureMethod,
) -> Option<types::PaymentsAuthorizeData> {
Some(types::PaymentsAuthorizeData {
amount: 3500,
currency: enums::Currency::USD,
payment_method_data: types::domain::PaymentMethodData::Card(types::domain::Card {
card_number: cards::CardNumber::from_str(card_number).unwrap(),
card_exp_month: Secret::new(card_exp_month.to_string()),
card_exp_year: Secret::new(card_exp_year.to_string()),
card_cvc: Secret::new(card_cvc.to_string()),
card_issuer: None,
card_network: None,
card_type: None,
card_issuing_country: None,
bank_code: None,
nick_name: Some(Secret::new("nick_name".into())),
card_holder_name: Some(Secret::new("card holder name".into())),
co_badged_card_data: None,
}),
confirm: true,
statement_descriptor_suffix: None,
statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
setup_mandate_details: None,
capture_method: Some(capture_method),
browser_info: None,
order_details: None,
order_category: None,
email: None,
customer_name: None,
payment_experience: None,
payment_method_type: None,
session_token: None,
enrolled_for_3ds: false,
related_transaction_id: None,
router_return_url: Some(String::from("http://localhost:8080")),
webhook_url: None,
complete_authorize_url: None,
customer_id: None,
surcharge_details: None,
request_incremental_authorization: false,
metadata: None,
authentication_data: None,
customer_acceptance: None,
locale: None,
..utils::PaymentAuthorizeType::default().0
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AdyenTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_authorize_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_JuspaythreedsserverTest_new | clm | method | // hyperswitch/crates/router/tests/connectors/juspaythreedsserver.rs
// impl for JuspaythreedsserverTest
fn new() -> Self {
Self
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "JuspaythreedsserverTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_CashtocodeTest_get_payment_authorize_data | clm | method | // hyperswitch/crates/router/tests/connectors/cashtocode.rs
// impl for CashtocodeTest
fn get_payment_authorize_data(
payment_method_type: Option<enums::PaymentMethodType>,
payment_method_data: domain::PaymentMethodData,
) -> Option<types::PaymentsAuthorizeData> {
let cust_id = id_type::CustomerId::try_from(std::borrow::Cow::from("John Doe"));
Some(types::PaymentsAuthorizeData {
amount: 1000,
currency: enums::Currency::EUR,
payment_method_data,
confirm: true,
statement_descriptor_suffix: None,
statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
setup_mandate_details: None,
capture_method: None,
browser_info: None,
order_details: None,
order_category: None,
email: None,
customer_name: None,
payment_experience: None,
payment_method_type,
session_token: None,
enrolled_for_3ds: false,
related_transaction_id: None,
router_return_url: Some(String::from("https://google.com")),
webhook_url: None,
complete_authorize_url: None,
customer_id: cust_id.ok(),
surcharge_details: None,
request_incremental_authorization: false,
metadata: None,
authentication_data: None,
customer_acceptance: None,
..utils::PaymentAuthorizeType::default().0
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "CashtocodeTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_authorize_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_CashtocodeTest_get_payment_info | clm | method | // hyperswitch/crates/router/tests/connectors/cashtocode.rs
// impl for CashtocodeTest
fn get_payment_info() -> Option<utils::PaymentInfo> {
Some(utils::PaymentInfo {
address: Some(types::PaymentAddress::new(
None,
Some(Address {
address: Some(AddressDetails {
country: Some(api_models::enums::CountryAlpha2::US),
..Default::default()
}),
phone: None,
email: None,
}),
None,
None,
)),
..Default::default()
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "CashtocodeTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_info",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_JpmorganTest_new | clm | method | // hyperswitch/crates/router/tests/connectors/jpmorgan.rs
// impl for JpmorganTest
fn new() -> Self {
Self
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "JpmorganTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_WorldlineTest_get_payment_info | clm | method | // hyperswitch/crates/router/tests/connectors/worldline.rs
// impl for WorldlineTest
fn get_payment_info() -> Option<PaymentInfo> {
Some(PaymentInfo {
address: Some(PaymentAddress::new(
None,
Some(Address {
address: Some(AddressDetails {
country: Some(api_models::enums::CountryAlpha2::US),
first_name: Some(Secret::new(String::from("John"))),
last_name: Some(Secret::new(String::from("Dough"))),
..Default::default()
}),
phone: None,
email: None,
}),
None,
None,
)),
..Default::default()
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "WorldlineTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_info",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_WorldlineTest_get_payment_authorize_data | clm | method | // hyperswitch/crates/router/tests/connectors/worldline.rs
// impl for WorldlineTest
fn get_payment_authorize_data(
card_number: &str,
card_exp_month: &str,
card_exp_year: &str,
card_cvc: &str,
capture_method: enums::CaptureMethod,
) -> Option<types::PaymentsAuthorizeData> {
Some(types::PaymentsAuthorizeData {
amount: 3500,
currency: enums::Currency::USD,
payment_method_data: types::domain::PaymentMethodData::Card(types::domain::Card {
card_number: cards::CardNumber::from_str(card_number).unwrap(),
card_exp_month: Secret::new(card_exp_month.to_string()),
card_exp_year: Secret::new(card_exp_year.to_string()),
card_cvc: Secret::new(card_cvc.to_string()),
card_issuer: None,
card_network: None,
card_type: None,
card_issuing_country: None,
bank_code: None,
nick_name: Some(Secret::new("nick_name".into())),
card_holder_name: Some(Secret::new("card holder name".into())),
co_badged_card_data: None,
}),
confirm: true,
statement_descriptor_suffix: None,
statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
setup_mandate_details: None,
capture_method: Some(capture_method),
browser_info: None,
order_details: None,
order_category: None,
email: None,
customer_name: None,
session_token: None,
enrolled_for_3ds: false,
related_transaction_id: None,
payment_experience: None,
payment_method_type: None,
router_return_url: None,
webhook_url: None,
complete_authorize_url: None,
customer_id: None,
surcharge_details: None,
request_incremental_authorization: false,
metadata: None,
authentication_data: None,
customer_acceptance: None,
..utils::PaymentAuthorizeType::default().0
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "WorldlineTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_authorize_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_Globalpay_get_request_interval | clm | method | // hyperswitch/crates/router/tests/connectors/globalpay.rs
// impl for Globalpay
fn get_request_interval(&self) -> u64 {
5
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "Globalpay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_request_interval",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_Globalpay_get_payment_info | clm | method | // hyperswitch/crates/router/tests/connectors/globalpay.rs
// impl for Globalpay
fn get_payment_info() -> Option<PaymentInfo> {
Some(PaymentInfo {
address: Some(types::PaymentAddress::new(
None,
Some(Address {
address: Some(AddressDetails {
country: Some(api_models::enums::CountryAlpha2::US),
..Default::default()
}),
phone: None,
..Default::default()
}),
None,
None,
)),
access_token: get_access_token(),
connector_meta_data: CONNECTOR.get_connector_meta(),
..Default::default()
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "Globalpay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_info",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PayeezyTest_get_payment_data | clm | method | // hyperswitch/crates/router/tests/connectors/payeezy.rs
// impl for PayeezyTest
fn get_payment_data() -> Option<PaymentsAuthorizeData> {
Some(PaymentsAuthorizeData {
payment_method_data: types::domain::PaymentMethodData::Card(types::domain::Card {
card_number: CardNumber::from_str("4012000033330026").unwrap(),
..utils::CCardType::default().0
}),
..utils::PaymentAuthorizeType::default().0
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PayeezyTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PayeezyTest_get_payment_info | clm | method | // hyperswitch/crates/router/tests/connectors/payeezy.rs
// impl for PayeezyTest
fn get_payment_info() -> Option<PaymentInfo> {
Some(PaymentInfo {
address: Some(types::PaymentAddress::new(
None,
Some(Address {
address: Some(AddressDetails {
..Default::default()
}),
phone: None,
email: None,
}),
None,
None,
)),
..Default::default()
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PayeezyTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_info",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PayeezyTest_get_request_interval | clm | method | // hyperswitch/crates/router/tests/connectors/payeezy.rs
// impl for PayeezyTest
fn get_request_interval(self) -> u64 {
20
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PayeezyTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_request_interval",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_WiseTest_get_payout_info | clm | method | // hyperswitch/crates/router/tests/connectors/wise.rs
// impl for WiseTest
fn get_payout_info() -> Option<PaymentInfo> {
Some(PaymentInfo {
currency: Some(enums::Currency::GBP),
address: Some(PaymentAddress::new(
None,
Some(Address {
address: Some(AddressDetails {
country: Some(api_models::enums::CountryAlpha2::GB),
city: Some("London".to_string()),
zip: Some(Secret::new("10025".to_string())),
line1: Some(Secret::new("50 Branson Ave".to_string())),
..Default::default()
}),
phone: None,
email: None,
}),
None,
None,
)),
payout_method_data: Some(api::PayoutMethodData::Bank(api::payouts::BankPayout::Bacs(
api::BacsBankTransfer {
bank_sort_code: "231470".to_string().into(),
bank_account_number: "28821822".to_string().into(),
bank_name: Some("Deutsche Bank".to_string()),
bank_country_code: Some(enums::CountryAlpha2::NL),
bank_city: Some("Amsterdam".to_string()),
},
))),
..Default::default()
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "WiseTest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payout_info",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PaymentInfo_with_default_billing_name | clm | method | // hyperswitch/crates/router/tests/connectors/utils.rs
// impl for PaymentInfo
pub fn with_default_billing_name() -> Self {
Self {
address: Some(PaymentAddress::new(
None,
None,
Some(hyperswitch_domain_models::address::Address {
address: Some(hyperswitch_domain_models::address::AddressDetails {
first_name: Some(Secret::new("John".to_string())),
last_name: Some(Secret::new("Doe".to_string())),
..Default::default()
}),
phone: None,
email: None,
}),
None,
)),
..Default::default()
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PaymentInfo",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "with_default_billing_name",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PollConfig_get_poll_config_key | clm | method | // hyperswitch/crates/router/src/types.rs
// impl for PollConfig
pub fn get_poll_config_key(connector: String) -> String {
format!("poll_config_external_three_ds_{connector}")
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PollConfig",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_poll_config_key",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_EventsConfig_get_event_handler | clm | method | // hyperswitch/crates/router/src/events.rs
// impl for EventsConfig
pub async fn get_event_handler(&self) -> StorageResult<EventsHandler> {
Ok(match self {
Self::Kafka { kafka } => EventsHandler::Kafka(
KafkaProducer::create(kafka)
.await
.change_context(StorageError::InitializationError)?,
),
Self::Logs => EventsHandler::Logs(event_logger::EventLogger::default()),
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "EventsConfig",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_event_handler",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_EventsConfig_validate | clm | method | // hyperswitch/crates/router/src/events.rs
// impl for EventsConfig
pub fn validate(&self) -> Result<(), ApplicationError> {
match self {
Self::Kafka { kafka } => kafka.validate(),
Self::Logs => Ok(()),
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "EventsConfig",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "validate",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_EventsHandler_log_event | clm | method | // hyperswitch/crates/router/src/events.rs
// impl for EventsHandler
pub fn log_event<T: KafkaMessage>(&self, event: &T) {
match self {
Self::Kafka(kafka) => kafka.log_event(event).unwrap_or_else(|e| {
logger::error!("Failed to log event: {:?}", e);
}),
Self::Logs(logger) => logger.log_event(event),
};
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "EventsHandler",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "log_event",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_EventsHandler_add_tenant | clm | method | // hyperswitch/crates/router/src/events.rs
// impl for EventsHandler
pub fn add_tenant(&mut self, tenant_config: &dyn TenantConfig) {
if let Self::Kafka(kafka_producer) = self {
kafka_producer.set_tenancy(tenant_config);
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "EventsHandler",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "add_tenant",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_Analytics_server | clm | method | // hyperswitch/crates/router/src/analytics.rs
// impl for Analytics
pub fn server(state: AppState) -> Scope {
web::scope("/analytics")
.app_data(web::Data::new(state))
.service(
web::scope("/v1")
.service(
web::resource("metrics/payments")
.route(web::post().to(get_merchant_payment_metrics)),
)
.service(
web::resource("metrics/routing")
.route(web::post().to(get_merchant_payment_metrics)),
)
.service(
web::resource("metrics/refunds")
.route(web::post().to(get_merchant_refund_metrics)),
)
.service(
web::resource("filters/payments")
.route(web::post().to(get_merchant_payment_filters)),
)
.service(
web::resource("filters/routing")
.route(web::post().to(get_merchant_payment_filters)),
)
.service(
web::resource("filters/frm").route(web::post().to(get_frm_filters)),
)
.service(
web::resource("filters/refunds")
.route(web::post().to(get_merchant_refund_filters)),
)
.service(web::resource("{domain}/info").route(web::get().to(get_info)))
.service(
web::resource("report/dispute")
.route(web::post().to(generate_merchant_dispute_report)),
)
.service(
web::resource("report/refunds")
.route(web::post().to(generate_merchant_refund_report)),
)
.service(
web::resource("report/payments")
.route(web::post().to(generate_merchant_payment_report)),
)
.service(
web::resource("report/authentications")
.route(web::post().to(generate_merchant_authentication_report)),
)
.service(
web::resource("metrics/sdk_events")
.route(web::post().to(get_sdk_event_metrics)),
)
.service(
web::resource("metrics/active_payments")
.route(web::post().to(get_active_payments_metrics)),
)
.service(
web::resource("filters/sdk_events")
.route(web::post().to(get_sdk_event_filters)),
)
.service(
web::resource("metrics/auth_events")
.route(web::post().to(get_merchant_auth_event_metrics)),
)
.service(
web::resource("filters/auth_events")
.route(web::post().to(get_merchant_auth_events_filters)),
)
.service(
web::resource("metrics/frm").route(web::post().to(get_frm_metrics)),
)
.service(
web::resource("api_event_logs")
.route(web::get().to(get_profile_api_events)),
)
.service(
web::resource("sdk_event_logs")
.route(web::post().to(get_profile_sdk_events)),
)
.service(
web::resource("connector_event_logs")
.route(web::get().to(get_profile_connector_events)),
)
.service(
web::resource("routing_event_logs")
.route(web::get().to(get_profile_routing_events)),
)
.service(
web::resource("outgoing_webhook_event_logs")
.route(web::get().to(get_profile_outgoing_webhook_events)),
)
.service(
web::resource("metrics/api_events")
.route(web::post().to(get_merchant_api_events_metrics)),
)
.service(
web::resource("filters/api_events")
.route(web::post().to(get_merchant_api_event_filters)),
)
.service(
web::resource("search")
.route(web::post().to(get_global_search_results)),
)
.service(
web::resource("search/{domain}")
.route(web::post().to(get_search_results)),
)
.service(
web::resource("metrics/disputes")
.route(web::post().to(get_merchant_dispute_metrics)),
)
.service(
web::resource("filters/disputes")
.route(web::post().to(get_merchant_dispute_filters)),
)
.service(
web::resource("metrics/sankey")
.route(web::post().to(get_merchant_sankey)),
)
.service(
web::resource("metrics/auth_events/sankey")
.route(web::post().to(get_merchant_auth_event_sankey)),
)
.service(
web::scope("/merchant")
.service(
web::resource("metrics/payments")
.route(web::post().to(get_merchant_payment_metrics)),
)
.service(
web::resource("metrics/routing")
.route(web::post().to(get_merchant_payment_metrics)),
)
.service(
web::resource("metrics/refunds")
.route(web::post().to(get_merchant_refund_metrics)),
)
.service(
web::resource("metrics/auth_events")
.route(web::post().to(get_merchant_auth_event_metrics)),
)
.service(
web::resource("filters/payments")
.route(web::post().to(get_merchant_payment_filters)),
)
.service(
web::resource("filters/routing")
.route(web::post().to(get_merchant_payment_filters)),
)
.service(
web::resource("filters/refunds")
.route(web::post().to(get_merchant_refund_filters)),
)
.service(
web::resource("filters/auth_events")
.route(web::post().to(get_merchant_auth_events_filters)),
)
.service(
web::resource("{domain}/info").route(web::get().to(get_info)),
)
.service(
web::resource("report/dispute")
.route(web::post().to(generate_merchant_dispute_report)),
)
.service(
web::resource("report/refunds")
.route(web::post().to(generate_merchant_refund_report)),
)
.service(
web::resource("report/payments")
.route(web::post().to(generate_merchant_payment_report)),
)
.service(
web::resource("report/authentications").route(
web::post().to(generate_merchant_authentication_report),
),
)
.service(
web::resource("metrics/api_events")
.route(web::post().to(get_merchant_api_events_metrics)),
)
.service(
web::resource("filters/api_events")
.route(web::post().to(get_merchant_api_event_filters)),
)
.service(
web::resource("metrics/disputes")
.route(web::post().to(get_merchant_dispute_metrics)),
)
.service(
web::resource("filters/disputes")
.route(web::post().to(get_merchant_dispute_filters)),
)
.service(
web::resource("metrics/sankey")
.route(web::post().to(get_merchant_sankey)),
)
.service(
web::resource("metrics/auth_events/sankey")
.route(web::post().to(get_merchant_auth_event_sankey)),
),
)
.service(
web::scope("/org")
.service(
web::resource("{domain}/info").route(web::get().to(get_info)),
)
.service(
web::resource("metrics/payments")
.route(web::post().to(get_org_payment_metrics)),
)
.service(
web::resource("filters/payments")
.route(web::post().to(get_org_payment_filters)),
)
.service(
web::resource("metrics/routing")
.route(web::post().to(get_org_payment_metrics)),
)
.service(
web::resource("filters/routing")
.route(web::post().to(get_org_payment_filters)),
)
.service(
web::resource("metrics/refunds")
.route(web::post().to(get_org_refund_metrics)),
)
.service(
web::resource("filters/refunds")
.route(web::post().to(get_org_refund_filters)),
)
.service(
web::resource("metrics/disputes")
.route(web::post().to(get_org_dispute_metrics)),
)
.service(
web::resource("metrics/auth_events")
.route(web::post().to(get_org_auth_event_metrics)),
)
.service(
web::resource("filters/disputes")
.route(web::post().to(get_org_dispute_filters)),
)
.service(
web::resource("filters/auth_events")
.route(web::post().to(get_org_auth_events_filters)),
)
.service(
web::resource("report/dispute")
.route(web::post().to(generate_org_dispute_report)),
)
.service(
web::resource("report/refunds")
.route(web::post().to(generate_org_refund_report)),
)
.service(
web::resource("report/payments")
.route(web::post().to(generate_org_payment_report)),
)
.service(
web::resource("report/authentications")
.route(web::post().to(generate_org_authentication_report)),
)
.service(
web::resource("metrics/sankey")
.route(web::post().to(get_org_sankey)),
)
.service(
web::resource("metrics/auth_events/sankey")
.route(web::post().to(get_org_auth_event_sankey)),
),
)
.service(
web::scope("/profile")
.service(
web::resource("{domain}/info").route(web::get().to(get_info)),
)
.service(
web::resource("metrics/payments")
.route(web::post().to(get_profile_payment_metrics)),
)
.service(
web::resource("filters/payments")
.route(web::post().to(get_profile_payment_filters)),
)
.service(
web::resource("metrics/routing")
.route(web::post().to(get_profile_payment_metrics)),
)
.service(
web::resource("filters/routing")
.route(web::post().to(get_profile_payment_filters)),
)
.service(
web::resource("metrics/refunds")
.route(web::post().to(get_profile_refund_metrics)),
)
.service(
web::resource("filters/refunds")
.route(web::post().to(get_profile_refund_filters)),
)
.service(
web::resource("metrics/disputes")
.route(web::post().to(get_profile_dispute_metrics)),
)
.service(
web::resource("metrics/auth_events")
.route(web::post().to(get_profile_auth_event_metrics)),
)
.service(
web::resource("filters/disputes")
.route(web::post().to(get_profile_dispute_filters)),
)
.service(
web::resource("filters/auth_events")
.route(web::post().to(get_profile_auth_events_filters)),
)
.service(
web::resource("connector_event_logs")
.route(web::get().to(get_profile_connector_events)),
)
.service(
web::resource("routing_event_logs")
.route(web::get().to(get_profile_routing_events)),
)
.service(
web::resource("outgoing_webhook_event_logs")
.route(web::get().to(get_profile_outgoing_webhook_events)),
)
.service(
web::resource("report/dispute")
.route(web::post().to(generate_profile_dispute_report)),
)
.service(
web::resource("report/refunds")
.route(web::post().to(generate_profile_refund_report)),
)
.service(
web::resource("report/payments")
.route(web::post().to(generate_profile_payment_report)),
)
.service(
web::resource("report/authentications").route(
web::post().to(generate_profile_authentication_report),
),
)
.service(
web::resource("api_event_logs")
.route(web::get().to(get_profile_api_events)),
)
.service(
web::resource("sdk_event_logs")
.route(web::post().to(get_profile_sdk_events)),
)
.service(
web::resource("metrics/sankey")
.route(web::post().to(get_profile_sankey)),
)
.service(
web::resource("metrics/auth_events/sankey")
.route(web::post().to(get_profile_auth_event_sankey)),
),
),
)
.service(
web::scope("/v2")
.service(
web::resource("/metrics/payments")
.route(web::post().to(get_merchant_payment_intent_metrics)),
)
.service(
web::resource("/filters/payments")
.route(web::post().to(get_payment_intents_filters)),
)
.service(
web::scope("/merchant")
.service(
web::resource("/metrics/payments")
.route(web::post().to(get_merchant_payment_intent_metrics)),
)
.service(
web::resource("/filters/payments")
.route(web::post().to(get_payment_intents_filters)),
),
)
.service(
web::scope("/org").service(
web::resource("/metrics/payments")
.route(web::post().to(get_org_payment_intent_metrics)),
),
)
.service(
web::scope("/profile").service(
web::resource("/metrics/payments")
.route(web::post().to(get_profile_payment_intent_metrics)),
),
),
)
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "Analytics",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "server",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_StripeApis_server | clm | method | // hyperswitch/crates/router/src/compatibility/stripe.rs
// impl for StripeApis
pub fn server(state: routes::AppState) -> Scope {
let max_depth = 10;
let strict = false;
web::scope("/vs/v1")
.app_data(web::Data::new(serde_qs::Config::new(max_depth, strict)))
.service(app::SetupIntents::server(state.clone()))
.service(app::PaymentIntents::server(state.clone()))
.service(app::Refunds::server(state.clone()))
.service(app::Customers::server(state.clone()))
.service(app::Webhooks::server(state.clone()))
.service(app::Mandates::server(state))
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "StripeApis",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "server",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_Mandates_server | clm | method | // hyperswitch/crates/router/src/compatibility/stripe/app.rs
// impl for Mandates
pub fn server(config: routes::AppState) -> Scope {
web::scope("/payment_methods")
.app_data(web::Data::new(config))
.service(web::resource("/{id}/detach").route(web::post().to(mandates::revoke_mandate)))
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "Mandates",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "server",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_Charges_new | clm | method | // hyperswitch/crates/router/src/compatibility/stripe/payment_intents/types.rs
// impl for Charges
pub fn new() -> Self {
Self {
object: "list",
data: vec![],
has_more: false,
total_count: 0,
url: "http://placeholder".to_string(),
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "Charges",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_NetworkTokenRequestorData_is_update_required | clm | method | // hyperswitch/crates/router/src/types/payment_methods.rs
// impl for NetworkTokenRequestorData
pub fn is_update_required(
&self,
data_stored_in_vault: api::payment_methods::CardDetailFromLocker,
) -> bool {
//if the expiry year and month in the vault are not the same as the ones in the requestor data,
//then we need to update the vault data with the updated expiry year and month.
!((data_stored_in_vault.expiry_year.unwrap_or_default() == self.expiry_year)
&& (data_stored_in_vault.expiry_month.unwrap_or_default() == self.expiry_month))
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "NetworkTokenRequestorData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_update_required",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_SessionConnectorData_new | clm | method | // hyperswitch/crates/router/src/types/api.rs
// impl for SessionConnectorData
pub fn new(
payment_method_sub_type: api_enums::PaymentMethodType,
connector: ConnectorData,
business_sub_label: Option<String>,
payment_method_type: api_enums::PaymentMethod,
) -> Self {
Self {
payment_method_sub_type,
connector,
business_sub_label,
payment_method_type,
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "SessionConnectorData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_SessionSurchargeDetails_fetch_surcharge_details | clm | method | // hyperswitch/crates/router/src/types/api.rs
// impl for SessionSurchargeDetails
pub fn fetch_surcharge_details(
&self,
payment_method: enums::PaymentMethod,
payment_method_type: enums::PaymentMethodType,
card_network: Option<&enums::CardNetwork>,
) -> Option<payments_types::SurchargeDetails> {
match self {
Self::Calculated(surcharge_metadata) => surcharge_metadata
.get_surcharge_details(payments_types::SurchargeKey::PaymentMethodData(
payment_method,
payment_method_type,
card_network.cloned(),
))
.cloned(),
Self::PreDetermined(surcharge_details) => Some(surcharge_details.clone()),
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "SessionSurchargeDetails",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "fetch_surcharge_details",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_TaxCalculateConnectorData_get_connector_by_name | clm | method | // hyperswitch/crates/router/src/types/api.rs
// impl for TaxCalculateConnectorData
pub fn get_connector_by_name(name: &str) -> CustomResult<Self, errors::ApiErrorResponse> {
let connector_name = enums::TaxConnectors::from_str(name)
.change_context(errors::ApiErrorResponse::IncorrectConnectorNameGiven)
.attach_printable_lazy(|| format!("unable to parse connector: {name}"))?;
let connector = Self::convert_connector(connector_name)?;
Ok(Self {
connector,
connector_name,
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "TaxCalculateConnectorData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_by_name",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_TaxCalculateConnectorData_convert_connector | clm | method | // hyperswitch/crates/router/src/types/api.rs
// impl for TaxCalculateConnectorData
fn convert_connector(
connector_name: enums::TaxConnectors,
) -> CustomResult<ConnectorEnum, errors::ApiErrorResponse> {
match connector_name {
enums::TaxConnectors::Taxjar => {
Ok(ConnectorEnum::Old(Box::new(connector::Taxjar::new())))
}
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "TaxCalculateConnectorData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "convert_connector",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PaymentAttempt_get_total_amount | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
// impl for PaymentAttempt
pub fn get_total_amount(&self) -> MinorUnit {
self.net_amount.get_total_amount()
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAttempt",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_total_amount",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PaymentTokenData_permanent_card | clm | method | // hyperswitch/crates/router/src/types/storage/payment_method.rs
// impl for PaymentTokenData
pub fn permanent_card(
payment_method_id: common_utils::id_type::GlobalPaymentMethodId,
locker_id: Option<String>,
token: String,
) -> Self {
Self::PermanentCard(CardTokenData {
payment_method_id,
locker_id,
token,
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PaymentTokenData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "permanent_card",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PaymentTokenData_temporary_generic | clm | method | // hyperswitch/crates/router/src/types/storage/payment_method.rs
// impl for PaymentTokenData
pub fn temporary_generic(token: String) -> Self {
Self::TemporaryGeneric(GenericTokenData { token })
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PaymentTokenData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "temporary_generic",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PaymentTokenData_wallet_token | clm | method | // hyperswitch/crates/router/src/types/storage/payment_method.rs
// impl for PaymentTokenData
pub fn wallet_token(payment_method_id: String) -> Self {
Self::WalletToken(WalletTokenData { payment_method_id })
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PaymentTokenData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "wallet_token",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PaymentTokenData_is_permanent_card | clm | method | // hyperswitch/crates/router/src/types/storage/payment_method.rs
// impl for PaymentTokenData
pub fn is_permanent_card(&self) -> bool {
matches!(self, Self::PermanentCard(_))
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PaymentTokenData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_permanent_card",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PaymentMethodListContext_get_token_data | clm | method | // hyperswitch/crates/router/src/types/storage/payment_method.rs
// impl for PaymentMethodListContext
pub(crate) fn get_token_data(&self) -> Option<PaymentTokenData> {
match self {
Self::Card { token_data, .. }
| Self::Bank { token_data }
| Self::BankTransfer { token_data, .. }
| Self::TemporaryToken { token_data } => token_data.clone(),
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethodListContext",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_token_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_RetryLimitsConfig_get_network_config | clm | method | // hyperswitch/crates/router/src/types/storage/revenue_recovery.rs
// impl for RetryLimitsConfig
pub fn get_network_config(&self, network: Option<CardNetwork>) -> &NetworkRetryConfig {
// Hardcoded fallback default config
static DEFAULT_CONFIG: NetworkRetryConfig = NetworkRetryConfig {
max_retries_per_day: 20,
max_retry_count_for_thirty_day: 20,
};
if let Some(net) = network {
self.0.get(&net).unwrap_or(&DEFAULT_CONFIG)
} else {
self.0.get(&CardNetwork::Visa).unwrap_or(&DEFAULT_CONFIG)
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "RetryLimitsConfig",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_network_config",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_FraudCheckConnectorData_get_connector_by_name | clm | method | // hyperswitch/crates/router/src/types/api/fraud_check.rs
// impl for FraudCheckConnectorData
pub fn get_connector_by_name(name: &str) -> CustomResult<Self, errors::ApiErrorResponse> {
let connector_name = enums::FrmConnectors::from_str(name)
.change_context(errors::ApiErrorResponse::IncorrectConnectorNameGiven)
.attach_printable_lazy(|| {
format!("unable to parse connector: {:?}", name.to_string())
})?;
let connector = Self::convert_connector(connector_name)?;
Ok(Self {
connector,
connector_name,
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "FraudCheckConnectorData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_by_name",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_FraudCheckConnectorData_convert_connector | clm | method | // hyperswitch/crates/router/src/types/api/fraud_check.rs
// impl for FraudCheckConnectorData
fn convert_connector(
connector_name: enums::FrmConnectors,
) -> CustomResult<ConnectorEnum, errors::ApiErrorResponse> {
match connector_name {
enums::FrmConnectors::Signifyd => {
Ok(ConnectorEnum::Old(Box::new(&connector::Signifyd)))
}
enums::FrmConnectors::Riskified => {
Ok(ConnectorEnum::Old(Box::new(connector::Riskified::new())))
}
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "FraudCheckConnectorData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "convert_connector",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_VerifyConnectorData_get_payment_authorize_data | clm | method | // hyperswitch/crates/router/src/types/api/verify_connector.rs
// impl for VerifyConnectorData
fn get_payment_authorize_data(&self) -> types::PaymentsAuthorizeData {
types::PaymentsAuthorizeData {
payment_method_data: domain::PaymentMethodData::Card(self.card_details.clone()),
email: None,
customer_name: None,
amount: 1000,
minor_amount: common_utils::types::MinorUnit::new(1000),
confirm: true,
order_tax_amount: None,
currency: storage_enums::Currency::USD,
metadata: None,
mandate_id: None,
webhook_url: None,
customer_id: None,
off_session: None,
browser_info: None,
session_token: None,
order_details: None,
order_category: None,
capture_method: None,
enrolled_for_3ds: false,
router_return_url: None,
surcharge_details: None,
setup_future_usage: None,
payment_experience: None,
payment_method_type: None,
statement_descriptor: None,
setup_mandate_details: None,
complete_authorize_url: None,
related_transaction_id: None,
statement_descriptor_suffix: None,
request_extended_authorization: None,
request_incremental_authorization: false,
authentication_data: None,
customer_acceptance: None,
split_payments: None,
merchant_order_reference_id: None,
integrity_object: None,
additional_payment_method_data: None,
shipping_cost: None,
merchant_account_id: None,
merchant_config_currency: None,
connector_testing_data: None,
order_id: None,
locale: None,
payment_channel: None,
enable_partial_authorization: None,
enable_overcapture: None,
is_stored_credential: None,
mit_category: None,
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "VerifyConnectorData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_authorize_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_VerifyConnectorData_get_router_data | clm | method | // hyperswitch/crates/router/src/types/api/verify_connector.rs
// impl for VerifyConnectorData
fn get_router_data<F, R1, R2>(
&self,
state: &SessionState,
request_data: R1,
access_token: Option<types::AccessToken>,
) -> types::RouterData<F, R1, R2> {
let attempt_id =
common_utils::generate_id_with_default_len(consts::VERIFY_CONNECTOR_ID_PREFIX);
types::RouterData {
flow: std::marker::PhantomData,
status: storage_enums::AttemptStatus::Started,
request: request_data,
response: Err(errors::ApiErrorResponse::InternalServerError.into()),
connector: self.connector.id().to_string(),
auth_type: storage_enums::AuthenticationType::NoThreeDs,
test_mode: None,
attempt_id: attempt_id.clone(),
description: None,
customer_id: None,
tenant_id: state.tenant.tenant_id.clone(),
merchant_id: common_utils::id_type::MerchantId::default(),
reference_id: None,
access_token,
session_token: None,
payment_method: storage_enums::PaymentMethod::Card,
payment_method_type: None,
amount_captured: None,
minor_amount_captured: None,
preprocessing_id: None,
connector_customer: None,
connector_auth_type: self.connector_auth.clone(),
connector_meta_data: None,
connector_wallets_details: None,
payment_method_token: None,
connector_api_version: None,
recurring_mandate_payment_data: None,
payment_method_status: None,
connector_request_reference_id: attempt_id,
address: types::PaymentAddress::new(None, None, None, None),
payment_id: common_utils::id_type::PaymentId::default()
.get_string_repr()
.to_owned(),
#[cfg(feature = "payouts")]
payout_method_data: None,
#[cfg(feature = "payouts")]
quote_id: None,
payment_method_balance: None,
connector_http_status_code: None,
external_latency: None,
apple_pay_flow: None,
frm_metadata: None,
refund_id: None,
dispute_id: None,
connector_response: None,
integrity_check: Ok(()),
additional_merchant_data: None,
header_payload: None,
connector_mandate_request_reference_id: None,
authentication_id: None,
psd2_sca_exemption_type: None,
raw_connector_response: None,
is_payment_id_from_merchant: None,
l2_l3_data: None,
minor_amount_capturable: None,
authorized_amount: None,
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "VerifyConnectorData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_router_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AuthenticationConnectorData_get_connector_by_name | clm | method | // hyperswitch/crates/router/src/types/api/authentication.rs
// impl for AuthenticationConnectorData
pub fn get_connector_by_name(name: &str) -> CustomResult<Self, errors::ApiErrorResponse> {
let connector_name = enums::AuthenticationConnectors::from_str(name)
.change_context(errors::ApiErrorResponse::IncorrectConnectorNameGiven)
.attach_printable_lazy(|| format!("unable to parse connector: {name}"))?;
let connector = Self::convert_connector(connector_name)?;
Ok(Self {
connector,
connector_name,
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AuthenticationConnectorData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_by_name",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_AuthenticationConnectorData_convert_connector | clm | method | // hyperswitch/crates/router/src/types/api/authentication.rs
// impl for AuthenticationConnectorData
fn convert_connector(
connector_name: enums::AuthenticationConnectors,
) -> CustomResult<ConnectorEnum, errors::ApiErrorResponse> {
match connector_name {
enums::AuthenticationConnectors::Threedsecureio => {
Ok(ConnectorEnum::Old(Box::new(&connector::Threedsecureio)))
}
enums::AuthenticationConnectors::Netcetera => {
Ok(ConnectorEnum::Old(Box::new(&connector::Netcetera)))
}
enums::AuthenticationConnectors::Gpayments => {
Ok(ConnectorEnum::Old(Box::new(connector::Gpayments::new())))
}
enums::AuthenticationConnectors::CtpMastercard => {
Ok(ConnectorEnum::Old(Box::new(&connector::CtpMastercard)))
}
enums::AuthenticationConnectors::CtpVisa => Ok(ConnectorEnum::Old(Box::new(
connector::UnifiedAuthenticationService::new(),
))),
enums::AuthenticationConnectors::UnifiedAuthenticationService => Ok(
ConnectorEnum::Old(Box::new(connector::UnifiedAuthenticationService::new())),
),
enums::AuthenticationConnectors::Juspaythreedsserver => Ok(ConnectorEnum::Old(
Box::new(connector::Juspaythreedsserver::new()),
)),
enums::AuthenticationConnectors::Cardinal => Ok(ConnectorEnum::Old(Box::new(
connector::UnifiedAuthenticationService::new(),
))),
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "AuthenticationConnectorData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "convert_connector",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PartnerReferralRequest_new | clm | method | // hyperswitch/crates/router/src/types/api/connector_onboarding/paypal.rs
// impl for PartnerReferralRequest
pub fn new(tracking_id: String, return_url: String) -> Self {
Self {
tracking_id,
operations: vec![PartnerReferralOperations {
operation: PayPalReferralOperationType::ApiIntegration,
api_integration_preference: PartnerReferralIntegrationPreference {
rest_api_integration: PartnerReferralRestApiIntegration {
integration_method: IntegrationMethod::Paypal,
integration_type: PayPalIntegrationType::ThirdParty,
third_party_details: PartnerReferralThirdPartyDetails {
features: vec![
PayPalFeatures::Payment,
PayPalFeatures::Refund,
PayPalFeatures::Vault,
PayPalFeatures::AccessMerchantInformation,
PayPalFeatures::BillingAgreement,
PayPalFeatures::ReadSellerDispute,
],
},
},
},
}],
products: vec![PayPalProducts::Ppcp, PayPalProducts::AdvancedVaulting],
capabilities: vec![PayPalCapabilities::PaypalWalletVaultingAdvanced],
partner_config_override: PartnerConfigOverride {
partner_logo_url: "https://hyperswitch.io/img/websiteIcon.svg".to_string(),
return_url,
},
legal_consents: vec![LegalConsent {
consent_type: LegalConsentType::ShareDataConsent,
granted: true,
}],
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PartnerReferralRequest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_SellerStatusResponse_extract_merchant_details_url | clm | method | // hyperswitch/crates/router/src/types/api/connector_onboarding/paypal.rs
// impl for SellerStatusResponse
pub fn extract_merchant_details_url(self, paypal_base_url: &str) -> RouterResult<String> {
self.links
.first()
.and_then(|link| link.href.strip_prefix('/'))
.map(|link| format!("{paypal_base_url}{link}"))
.ok_or(ApiErrorResponse::InternalServerError)
.attach_printable("Merchant details not received in onboarding status")
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "SellerStatusResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "extract_merchant_details_url",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_SellerStatusDetailsResponse_check_payments_receivable | clm | method | // hyperswitch/crates/router/src/types/api/connector_onboarding/paypal.rs
// impl for SellerStatusDetailsResponse
pub fn check_payments_receivable(&self) -> Option<api::PayPalOnboardingStatus> {
if !self.payments_receivable {
return Some(api::PayPalOnboardingStatus::PaymentsNotReceivable);
}
None
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "SellerStatusDetailsResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "check_payments_receivable",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_SellerStatusDetailsResponse_check_ppcp_custom_status | clm | method | // hyperswitch/crates/router/src/types/api/connector_onboarding/paypal.rs
// impl for SellerStatusDetailsResponse
pub fn check_ppcp_custom_status(&self) -> Option<api::PayPalOnboardingStatus> {
match self.get_ppcp_custom_status() {
Some(VettingStatus::Denied) => Some(api::PayPalOnboardingStatus::PpcpCustomDenied),
Some(VettingStatus::Subscribed) => None,
_ => Some(api::PayPalOnboardingStatus::MorePermissionsNeeded),
}
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "SellerStatusDetailsResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "check_ppcp_custom_status",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_SellerStatusDetailsResponse_check_email_confirmation | clm | method | // hyperswitch/crates/router/src/types/api/connector_onboarding/paypal.rs
// impl for SellerStatusDetailsResponse
fn check_email_confirmation(&self) -> Option<api::PayPalOnboardingStatus> {
if !self.primary_email_confirmed {
return Some(api::PayPalOnboardingStatus::EmailNotVerified);
}
None
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "SellerStatusDetailsResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "check_email_confirmation",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_SellerStatusDetailsResponse_get_eligibility_status | clm | method | // hyperswitch/crates/router/src/types/api/connector_onboarding/paypal.rs
// impl for SellerStatusDetailsResponse
pub async fn get_eligibility_status(&self) -> RouterResult<api::PayPalOnboardingStatus> {
Ok(self
.check_payments_receivable()
.or(self.check_email_confirmation())
.or(self.check_ppcp_custom_status())
.unwrap_or(api::PayPalOnboardingStatus::Success(
api::PayPalOnboardingDone {
payer_id: self.get_payer_id(),
},
)))
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "SellerStatusDetailsResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_eligibility_status",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_SellerStatusDetailsResponse_get_ppcp_custom_status | clm | method | // hyperswitch/crates/router/src/types/api/connector_onboarding/paypal.rs
// impl for SellerStatusDetailsResponse
fn get_ppcp_custom_status(&self) -> Option<VettingStatus> {
self.products
.iter()
.find(|product| product.name == "PPCP_CUSTOM")
.and_then(|ppcp_custom| ppcp_custom.vetting_status.clone())
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "SellerStatusDetailsResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_ppcp_custom_status",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_SellerStatusDetailsResponse_get_payer_id | clm | method | // hyperswitch/crates/router/src/types/api/connector_onboarding/paypal.rs
// impl for SellerStatusDetailsResponse
fn get_payer_id(&self) -> common_utils::id_type::MerchantId {
self.merchant_id.to_owned()
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "SellerStatusDetailsResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payer_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_PartnerReferralResponse_extract_action_url | clm | method | // hyperswitch/crates/router/src/types/api/connector_onboarding/paypal.rs
// impl for PartnerReferralResponse
pub fn extract_action_url(self) -> RouterResult<String> {
Ok(self
.links
.into_iter()
.find(|hateoas_link| hateoas_link.rel == "action_url")
.ok_or(ApiErrorResponse::InternalServerError)
.attach_printable("Failed to get action_url from paypal response")?
.href)
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "PartnerReferralResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "extract_action_url",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_UserEmail_from_pii_email | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for UserEmail
pub fn from_pii_email(email: pii::Email) -> UserResult<Self> {
let email_string = email.expose().map(|inner| inner.to_lowercase());
Self::new(email_string)
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "UserEmail",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "from_pii_email",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_UserEmail_get_inner | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for UserEmail
pub fn get_inner(&self) -> &pii::Email {
&self.0
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "UserEmail",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_inner",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_UserEmail_extract_domain | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for UserEmail
pub fn extract_domain(&self) -> UserResult<&str> {
let (_username, domain) = self
.peek()
.split_once('@')
.ok_or(UserErrors::InternalServerError)?;
Ok(domain)
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "UserEmail",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "extract_domain",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_NewUserOrganization_insert_org_in_db | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for NewUserOrganization
pub async fn insert_org_in_db(self, state: SessionState) -> UserResult<Organization> {
state
.accounts_store
.insert_organization(self.0)
.await
.map_err(|e| {
if e.current_context().is_db_unique_violation() {
e.change_context(UserErrors::DuplicateOrganizationId)
} else {
e.change_context(UserErrors::InternalServerError)
}
})
.attach_printable("Error while inserting organization")
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "NewUserOrganization",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "insert_org_in_db",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_NewUserOrganization_get_organization_id | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for NewUserOrganization
pub fn get_organization_id(&self) -> id_type::OrganizationId {
self.0.get_organization_id()
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "NewUserOrganization",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_organization_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_MerchantId_get_secret | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for MerchantId
pub fn get_secret(&self) -> String {
self.0.clone()
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "MerchantId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_secret",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_NewUserMerchant_get_company_name | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for NewUserMerchant
pub fn get_company_name(&self) -> Option<String> {
self.company_name.clone().map(UserCompanyName::get_secret)
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "NewUserMerchant",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_company_name",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_NewUserMerchant_get_merchant_id | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for NewUserMerchant
pub fn get_merchant_id(&self) -> id_type::MerchantId {
self.merchant_id.clone()
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "NewUserMerchant",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_merchant_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_NewUserMerchant_get_new_organization | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for NewUserMerchant
pub fn get_new_organization(&self) -> NewUserOrganization {
self.new_organization.clone()
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "NewUserMerchant",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_new_organization",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_NewUserMerchant_get_product_type | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for NewUserMerchant
pub fn get_product_type(&self) -> Option<common_enums::MerchantProductType> {
self.product_type
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "NewUserMerchant",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_product_type",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_router_NewUserMerchant_create_merchant_account_request | clm | method | // hyperswitch/crates/router/src/types/domain/user.rs
// impl for NewUserMerchant
fn create_merchant_account_request(&self) -> UserResult<admin_api::MerchantAccountCreate> {
Ok(admin_api::MerchantAccountCreate {
merchant_id: self.get_merchant_id(),
metadata: None,
locker_id: None,
return_url: None,
merchant_name: self.get_company_name().map(Secret::new),
webhook_details: None,
publishable_key: None,
organization_id: Some(self.new_organization.get_organization_id()),
merchant_details: None,
routing_algorithm: None,
parent_merchant_id: None,
sub_merchants_enabled: None,
frm_routing_algorithm: None,
#[cfg(feature = "payouts")]
payout_routing_algorithm: None,
primary_business_details: None,
payment_response_hash_key: None,
enable_payment_response_hash: None,
redirect_to_merchant_with_http_post: None,
pm_collect_link_config: None,
product_type: self.get_product_type(),
merchant_account_type: self.merchant_account_type,
})
}
| {
"chunk": null,
"crate": "router",
"enum_name": null,
"file_size": null,
"for_type": "NewUserMerchant",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_merchant_account_request",
"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.