id stringlengths 20 153 | type stringclasses 1
value | granularity stringclasses 14
values | content stringlengths 16 84.3k | metadata dict |
|---|---|---|---|---|
hyperswitch_method_common_types_MerchantCountryCode_new | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for MerchantCountryCode
pub fn new(country_code: String) -> Self {
Self(country_code)
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "MerchantCountryCode",
"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_common_types_CustomerAcceptance_get_ip_address | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for CustomerAcceptance
pub fn get_ip_address(&self) -> Option<String> {
self.online
.as_ref()
.and_then(|data| data.ip_address.as_ref().map(|ip| ip.peek().to_owned()))
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "CustomerAcceptance",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_ip_address",
"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_common_types_CustomerAcceptance_get_user_agent | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for CustomerAcceptance
pub fn get_user_agent(&self) -> Option<String> {
self.online.as_ref().map(|data| data.user_agent.clone())
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "CustomerAcceptance",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_user_agent",
"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_common_types_CustomerAcceptance_get_accepted_at | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for CustomerAcceptance
pub fn get_accepted_at(&self) -> PrimitiveDateTime {
self.accepted_at.unwrap_or_else(date_time::now)
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "CustomerAcceptance",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_accepted_at",
"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_common_types_GpayTokenizationData_get_encrypted_google_pay_payment_data_mandatory | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for GpayTokenizationData
pub fn get_encrypted_google_pay_payment_data_mandatory(
&self,
) -> Result<&GpayEcryptedTokenizationData, errors::ValidationError> {
match self {
Self::Encrypted(encrypted_data) => Ok(encrypted_data),
Self::Decrypted(_) => Err(errors::ValidationError::InvalidValue {
message: "Encrypted Google Pay payment data is mandatory".to_string(),
}
.into()),
}
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "GpayTokenizationData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_encrypted_google_pay_payment_data_mandatory",
"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_common_types_GpayTokenizationData_get_encrypted_google_pay_token | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for GpayTokenizationData
pub fn get_encrypted_google_pay_token(&self) -> Result<String, errors::ValidationError> {
Ok(self
.get_encrypted_google_pay_payment_data_mandatory()?
.token
.clone())
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "GpayTokenizationData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_encrypted_google_pay_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_common_types_GpayTokenizationData_get_encrypted_token_type | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for GpayTokenizationData
pub fn get_encrypted_token_type(&self) -> Result<String, errors::ValidationError> {
Ok(self
.get_encrypted_google_pay_payment_data_mandatory()?
.token_type
.clone())
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "GpayTokenizationData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_encrypted_token_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_common_types_ApplePayPaymentData_get_encrypted_apple_pay_payment_data_optional | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for ApplePayPaymentData
pub fn get_encrypted_apple_pay_payment_data_optional(&self) -> Option<&String> {
match self {
Self::Encrypted(encrypted_data) => Some(encrypted_data),
Self::Decrypted(_) => None,
}
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ApplePayPaymentData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_encrypted_apple_pay_payment_data_optional",
"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_common_types_ApplePayPaymentData_get_decrypted_apple_pay_payment_data_optional | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for ApplePayPaymentData
pub fn get_decrypted_apple_pay_payment_data_optional(&self) -> Option<&ApplePayPredecryptData> {
match self {
Self::Encrypted(_) => None,
Self::Decrypted(decrypted_data) => Some(decrypted_data),
}
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ApplePayPaymentData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_decrypted_apple_pay_payment_data_optional",
"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_common_types_ApplePayPaymentData_get_encrypted_apple_pay_payment_data_mandatory | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for ApplePayPaymentData
pub fn get_encrypted_apple_pay_payment_data_mandatory(
&self,
) -> Result<&String, errors::ValidationError> {
self.get_encrypted_apple_pay_payment_data_optional()
.get_required_value("Encrypted Apple Pay payment data")
.attach_printable("Encrypted Apple Pay payment data is mandatory")
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ApplePayPaymentData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_encrypted_apple_pay_payment_data_mandatory",
"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_common_types_ApplePayPaymentData_get_decrypted_apple_pay_payment_data_mandatory | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for ApplePayPaymentData
pub fn get_decrypted_apple_pay_payment_data_mandatory(
&self,
) -> Result<&ApplePayPredecryptData, errors::ValidationError> {
self.get_decrypted_apple_pay_payment_data_optional()
.get_required_value("Decrypted Apple Pay payment data")
.attach_printable("Decrypted Apple Pay payment data is mandatory")
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ApplePayPaymentData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_decrypted_apple_pay_payment_data_mandatory",
"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_common_types_ApplePayPredecryptData_get_four_digit_expiry_year | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for ApplePayPredecryptData
pub fn get_four_digit_expiry_year(&self) -> Secret<String> {
let mut year = self.application_expiration_year.peek().clone();
if year.len() == 2 {
year = format!("20{year}");
}
Secret::new(year)
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ApplePayPredecryptData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_four_digit_expiry_year",
"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_common_types_ApplePayPredecryptData_get_two_digit_expiry_year | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for ApplePayPredecryptData
pub fn get_two_digit_expiry_year(&self) -> Result<Secret<String>, errors::ValidationError> {
let binding = self.application_expiration_year.clone();
let year = binding.peek();
Ok(Secret::new(
year.get(year.len() - 2..)
.ok_or(errors::ValidationError::InvalidValue {
message: "Invalid two-digit year".to_string(),
})?
.to_string(),
))
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ApplePayPredecryptData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_two_digit_expiry_year",
"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_common_types_ApplePayPredecryptData_get_expiry_date_as_mmyy | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for ApplePayPredecryptData
pub fn get_expiry_date_as_mmyy(&self) -> Result<Secret<String>, errors::ValidationError> {
let year = self.get_two_digit_expiry_year()?.expose();
let month = self.get_expiry_month()?.expose();
Ok(Secret::new(format!("{month}{year}")))
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ApplePayPredecryptData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_expiry_date_as_mmyy",
"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_common_types_ApplePayPredecryptData_get_expiry_month | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for ApplePayPredecryptData
pub fn get_expiry_month(&self) -> Result<Secret<String>, errors::ValidationError> {
let month_str = self.application_expiration_month.peek();
let month = month_str
.parse::<u8>()
.map_err(|_| errors::ValidationError::InvalidValue {
message: format!("Failed to parse expiry month: {month_str}"),
})?;
if !(1..=12).contains(&month) {
return Err(errors::ValidationError::InvalidValue {
message: format!("Invalid expiry month: {month}. Must be between 1 and 12"),
}
.into());
}
Ok(self.application_expiration_month.clone())
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ApplePayPredecryptData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_expiry_month",
"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_common_types_ApplePayPredecryptData_get_expiry_date_as_yymm | clm | method | // hyperswitch/crates/common_types/src/payments.rs
// impl for ApplePayPredecryptData
pub fn get_expiry_date_as_yymm(&self) -> Result<Secret<String>, errors::ValidationError> {
let year = self.get_two_digit_expiry_year()?.expose();
let month = self.get_expiry_month()?.expose();
Ok(Secret::new(format!("{year}{month}")))
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ApplePayPredecryptData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_expiry_date_as_yymm",
"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_common_types_GsmFeatureData_get_retry_feature_data | clm | method | // hyperswitch/crates/common_types/src/domain.rs
// impl for GsmFeatureData
pub fn get_retry_feature_data(&self) -> Option<RetryFeatureData> {
match self {
Self::Retry(data) => Some(data.clone()),
}
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "GsmFeatureData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_retry_feature_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_common_types_RequestExtendedAuthorizationBool_is_true | clm | method | // hyperswitch/crates/common_utils/src/types/primitive_wrappers.rs
// impl for RequestExtendedAuthorizationBool
pub fn is_true(&self) -> bool {
self.0
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "RequestExtendedAuthorizationBool",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_true",
"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_common_types_AlwaysEnableOvercaptureBool_is_true | clm | method | // hyperswitch/crates/common_types/src/primitive_wrappers.rs
// impl for AlwaysEnableOvercaptureBool
pub fn is_true(&self) -> bool {
self.0
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "AlwaysEnableOvercaptureBool",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_true",
"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_common_types_SafeString_new | clm | method | // hyperswitch/crates/common_types/src/primitive_wrappers.rs
// impl for SafeString
pub fn new(value: String) -> Result<Self, String> {
if contains_potential_xss_or_sqli(&value) {
return Err("Input contains potentially malicious content".into());
}
Ok(Self(value))
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "SafeString",
"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_common_types_SafeString_from_string_slice | clm | method | // hyperswitch/crates/common_types/src/primitive_wrappers.rs
// impl for SafeString
pub fn from_string_slice(value: &str) -> Result<Self, String> {
Self::new(value.to_string())
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "SafeString",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "from_string_slice",
"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_common_types_SafeString_as_str | clm | method | // hyperswitch/crates/common_types/src/primitive_wrappers.rs
// impl for SafeString
pub fn as_str(&self) -> &str {
&self.0
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "SafeString",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "as_str",
"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_common_types_SafeString_into_inner | clm | method | // hyperswitch/crates/common_types/src/primitive_wrappers.rs
// impl for SafeString
pub fn into_inner(self) -> String {
self.0
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "SafeString",
"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_common_types_SafeString_is_empty | clm | method | // hyperswitch/crates/common_types/src/primitive_wrappers.rs
// impl for SafeString
pub fn is_empty(&self) -> bool {
self.0.is_empty()
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "SafeString",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_empty",
"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_common_types_SafeString_len | clm | method | // hyperswitch/crates/common_types/src/primitive_wrappers.rs
// impl for SafeString
pub fn len(&self) -> usize {
self.0.len()
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "SafeString",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "len",
"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_common_types_ThreeDSDecision_should_force_3ds_challenge | clm | method | // hyperswitch/crates/common_types/src/three_ds_decision_rule_engine.rs
// impl for ThreeDSDecision
pub fn should_force_3ds_challenge(self) -> bool {
matches!(self, Self::ChallengeRequested)
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ThreeDSDecision",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "should_force_3ds_challenge",
"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_common_types_ThreeDSDecisionRule_get_decision | clm | method | // hyperswitch/crates/common_types/src/three_ds_decision_rule_engine.rs
// impl for ThreeDSDecisionRule
pub fn get_decision(&self) -> ThreeDSDecision {
self.decision
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ThreeDSDecisionRule",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_decision",
"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_common_types_ConnectorCustomerMap_new | clm | method | // hyperswitch/crates/common_types/src/customers.rs
// impl for ConnectorCustomerMap
pub fn new(
map: std::collections::HashMap<common_utils::id_type::MerchantConnectorAccountId, String>,
) -> Self {
Self(map)
}
| {
"chunk": null,
"crate": "common_types",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorCustomerMap",
"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_cards_CardExpirationYear_two_digits | clm | method | // hyperswitch/crates/cards/src/lib.rs
// impl for CardExpirationYear
pub fn two_digits(&self) -> String {
let year = self.peek() % 100;
year.to_string()
}
| {
"chunk": null,
"crate": "cards",
"enum_name": null,
"file_size": null,
"for_type": "CardExpirationYear",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "two_digits",
"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_cards_CardExpirationYear_four_digits | clm | method | // hyperswitch/crates/cards/src/lib.rs
// impl for CardExpirationYear
pub fn four_digits(&self) -> String {
self.peek().to_string()
}
| {
"chunk": null,
"crate": "cards",
"enum_name": null,
"file_size": null,
"for_type": "CardExpirationYear",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "four_digits",
"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_cards_CardExpiration_is_expired | clm | method | // hyperswitch/crates/cards/src/lib.rs
// impl for CardExpiration
pub fn is_expired(&self) -> Result<bool, error_stack::Report<errors::ValidationError>> {
let current_datetime_utc = date_time::now();
let expiration_month = time::Month::try_from(*self.month.peek()).map_err(|_| {
report!(errors::ValidationError::InvalidValue {
message: "invalid month".to_string()
})
})?;
let expiration_year = *self.year.peek();
let expiration_day = expiration_month.length(i32::from(expiration_year));
let expiration_date =
Date::from_calendar_date(i32::from(expiration_year), expiration_month, expiration_day)
.map_err(|_| {
report!(errors::ValidationError::InvalidValue {
message: "error while constructing calendar date".to_string()
})
})?;
let expiration_time = Time::MIDNIGHT;
// actual expiry date specified on card w.r.t. local timezone
// max diff b/w utc and other timezones is 14 hours
let mut expiration_datetime_utc = PrimitiveDateTime::new(expiration_date, expiration_time);
// compensating time difference b/w local and utc timezone by adding a day
expiration_datetime_utc = expiration_datetime_utc.saturating_add(Duration::days(1));
Ok(current_datetime_utc > expiration_datetime_utc)
}
| {
"chunk": null,
"crate": "cards",
"enum_name": null,
"file_size": null,
"for_type": "CardExpiration",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_expired",
"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_cards_CardExpiration_get_month | clm | method | // hyperswitch/crates/cards/src/lib.rs
// impl for CardExpiration
pub fn get_month(&self) -> &CardExpirationMonth {
&self.month
}
| {
"chunk": null,
"crate": "cards",
"enum_name": null,
"file_size": null,
"for_type": "CardExpiration",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_month",
"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_cards_CardExpiration_get_year | clm | method | // hyperswitch/crates/cards/src/lib.rs
// impl for CardExpiration
pub fn get_year(&self) -> &CardExpirationYear {
&self.year
}
| {
"chunk": null,
"crate": "cards",
"enum_name": null,
"file_size": null,
"for_type": "CardExpiration",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_year",
"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_cards_NetworkToken_get_card_isin | clm | method | // hyperswitch/crates/cards/src/validate.rs
// impl for NetworkToken
pub fn get_card_isin(&self) -> String {
self.0.peek().chars().take(6).collect::<String>()
}
| {
"chunk": null,
"crate": "cards",
"enum_name": null,
"file_size": null,
"for_type": "NetworkToken",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_card_isin",
"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_cards_NetworkToken_get_extended_card_bin | clm | method | // hyperswitch/crates/cards/src/validate.rs
// impl for NetworkToken
pub fn get_extended_card_bin(&self) -> String {
self.0.peek().chars().take(8).collect::<String>()
}
| {
"chunk": null,
"crate": "cards",
"enum_name": null,
"file_size": null,
"for_type": "NetworkToken",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_extended_card_bin",
"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_cards_NetworkToken_get_card_no | clm | method | // hyperswitch/crates/cards/src/validate.rs
// impl for NetworkToken
pub fn get_card_no(&self) -> String {
self.0.peek().chars().collect::<String>()
}
| {
"chunk": null,
"crate": "cards",
"enum_name": null,
"file_size": null,
"for_type": "NetworkToken",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_card_no",
"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_cards_NetworkToken_get_last4 | clm | method | // hyperswitch/crates/cards/src/validate.rs
// impl for NetworkToken
pub fn get_last4(&self) -> String {
self.0
.peek()
.chars()
.rev()
.take(4)
.collect::<String>()
.chars()
.rev()
.collect::<String>()
}
| {
"chunk": null,
"crate": "cards",
"enum_name": null,
"file_size": null,
"for_type": "NetworkToken",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_last4",
"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_currency_conversion_ExchangeRates_new | clm | method | // hyperswitch/crates/currency_conversion/src/types.rs
// impl for ExchangeRates
pub fn new(base_currency: Currency, conversion: HashMap<Currency, CurrencyFactors>) -> Self {
Self {
base_currency,
conversion,
}
}
| {
"chunk": null,
"crate": "currency_conversion",
"enum_name": null,
"file_size": null,
"for_type": "ExchangeRates",
"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_currency_conversion_ExchangeRates_forward_conversion | clm | method | // hyperswitch/crates/currency_conversion/src/types.rs
// impl for ExchangeRates
pub fn forward_conversion(
&self,
amt: Decimal,
from_currency: Currency,
) -> Result<Decimal, CurrencyConversionError> {
let from_factor = self
.conversion
.get(&from_currency)
.ok_or_else(|| {
CurrencyConversionError::ConversionNotSupported(from_currency.to_string())
})?
.from_factor;
amt.checked_mul(from_factor)
.ok_or(CurrencyConversionError::DecimalMultiplicationFailed)
}
| {
"chunk": null,
"crate": "currency_conversion",
"enum_name": null,
"file_size": null,
"for_type": "ExchangeRates",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "forward_conversion",
"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_currency_conversion_ExchangeRates_backward_conversion | clm | method | // hyperswitch/crates/currency_conversion/src/types.rs
// impl for ExchangeRates
pub fn backward_conversion(
&self,
amt: Decimal,
to_currency: Currency,
) -> Result<Decimal, CurrencyConversionError> {
let to_factor = self
.conversion
.get(&to_currency)
.ok_or_else(|| {
CurrencyConversionError::ConversionNotSupported(to_currency.to_string())
})?
.to_factor;
amt.checked_mul(to_factor)
.ok_or(CurrencyConversionError::DecimalMultiplicationFailed)
}
| {
"chunk": null,
"crate": "currency_conversion",
"enum_name": null,
"file_size": null,
"for_type": "ExchangeRates",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "backward_conversion",
"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_diesel_models_DBOperation_operation | clm | method | // hyperswitch/crates/diesel_models/src/kv.rs
// impl for DBOperation
pub fn operation<'a>(&self) -> &'a str {
match self {
Self::Insert { .. } => "insert",
Self::Update { .. } => "update",
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "DBOperation",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "operation",
"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_diesel_models_DBOperation_table | clm | method | // hyperswitch/crates/diesel_models/src/kv.rs
// impl for DBOperation
pub fn table<'a>(&self) -> &'a str {
match self {
Self::Insert { insertable } => match **insertable {
Insertable::PaymentIntent(_) => "payment_intent",
Insertable::PaymentAttempt(_) => "payment_attempt",
Insertable::Refund(_) => "refund",
Insertable::Address(_) => "address",
Insertable::Payouts(_) => "payouts",
Insertable::PayoutAttempt(_) => "payout_attempt",
Insertable::Customer(_) => "customer",
Insertable::ReverseLookUp(_) => "reverse_lookup",
Insertable::PaymentMethod(_) => "payment_method",
Insertable::Mandate(_) => "mandate",
},
Self::Update { updatable } => match **updatable {
Updateable::PaymentIntentUpdate(_) => "payment_intent",
Updateable::PaymentAttemptUpdate(_) => "payment_attempt",
Updateable::RefundUpdate(_) => "refund",
Updateable::CustomerUpdate(_) => "customer",
Updateable::AddressUpdate(_) => "address",
Updateable::PayoutsUpdate(_) => "payouts",
Updateable::PayoutAttemptUpdate(_) => "payout_attempt",
Updateable::PaymentMethodUpdate(_) => "payment_method",
Updateable::MandateUpdate(_) => " mandate",
},
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "DBOperation",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "table",
"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_diesel_models_DBOperation_execute | clm | method | // hyperswitch/crates/diesel_models/src/kv.rs
// impl for DBOperation
pub async fn execute(self, conn: &PgPooledConn) -> crate::StorageResult<DBResult> {
Ok(match self {
Self::Insert { insertable } => match *insertable {
Insertable::PaymentIntent(a) => {
DBResult::PaymentIntent(Box::new(a.insert(conn).await?))
}
Insertable::PaymentAttempt(a) => {
DBResult::PaymentAttempt(Box::new(a.insert(conn).await?))
}
Insertable::Refund(a) => DBResult::Refund(Box::new(a.insert(conn).await?)),
Insertable::Address(addr) => DBResult::Address(Box::new(addr.insert(conn).await?)),
Insertable::Customer(cust) => {
DBResult::Customer(Box::new(cust.insert(conn).await?))
}
Insertable::ReverseLookUp(rev) => {
DBResult::ReverseLookUp(Box::new(rev.insert(conn).await?))
}
Insertable::Payouts(rev) => DBResult::Payouts(Box::new(rev.insert(conn).await?)),
Insertable::PayoutAttempt(rev) => {
DBResult::PayoutAttempt(Box::new(rev.insert(conn).await?))
}
Insertable::PaymentMethod(rev) => {
DBResult::PaymentMethod(Box::new(rev.insert(conn).await?))
}
Insertable::Mandate(m) => DBResult::Mandate(Box::new(m.insert(conn).await?)),
},
Self::Update { updatable } => match *updatable {
#[cfg(feature = "v1")]
Updateable::PaymentIntentUpdate(a) => {
DBResult::PaymentIntent(Box::new(a.orig.update(conn, a.update_data).await?))
}
#[cfg(feature = "v2")]
Updateable::PaymentIntentUpdate(a) => {
DBResult::PaymentIntent(Box::new(a.orig.update(conn, a.update_data).await?))
}
#[cfg(feature = "v1")]
Updateable::PaymentAttemptUpdate(a) => DBResult::PaymentAttempt(Box::new(
a.orig.update_with_attempt_id(conn, a.update_data).await?,
)),
#[cfg(feature = "v2")]
Updateable::PaymentAttemptUpdate(a) => DBResult::PaymentAttempt(Box::new(
a.orig.update_with_attempt_id(conn, a.update_data).await?,
)),
#[cfg(feature = "v1")]
Updateable::RefundUpdate(a) => {
DBResult::Refund(Box::new(a.orig.update(conn, a.update_data).await?))
}
#[cfg(feature = "v2")]
Updateable::RefundUpdate(a) => {
DBResult::Refund(Box::new(a.orig.update_with_id(conn, a.update_data).await?))
}
Updateable::AddressUpdate(a) => {
DBResult::Address(Box::new(a.orig.update(conn, a.update_data).await?))
}
Updateable::PayoutsUpdate(a) => {
DBResult::Payouts(Box::new(a.orig.update(conn, a.update_data).await?))
}
Updateable::PayoutAttemptUpdate(a) => DBResult::PayoutAttempt(Box::new(
a.orig.update_with_attempt_id(conn, a.update_data).await?,
)),
#[cfg(feature = "v1")]
Updateable::PaymentMethodUpdate(v) => DBResult::PaymentMethod(Box::new(
v.orig
.update_with_payment_method_id(conn, v.update_data)
.await?,
)),
#[cfg(feature = "v2")]
Updateable::PaymentMethodUpdate(v) => DBResult::PaymentMethod(Box::new(
v.orig.update_with_id(conn, v.update_data).await?,
)),
Updateable::MandateUpdate(m) => DBResult::Mandate(Box::new(
Mandate::update_by_merchant_id_mandate_id(
conn,
&m.orig.merchant_id,
&m.orig.mandate_id,
m.update_data,
)
.await?,
)),
#[cfg(feature = "v1")]
Updateable::CustomerUpdate(cust) => DBResult::Customer(Box::new(
Customer::update_by_customer_id_merchant_id(
conn,
cust.orig.customer_id.clone(),
cust.orig.merchant_id.clone(),
cust.update_data,
)
.await?,
)),
#[cfg(feature = "v2")]
Updateable::CustomerUpdate(cust) => DBResult::Customer(Box::new(
Customer::update_by_id(conn, cust.orig.id, cust.update_data).await?,
)),
},
})
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "DBOperation",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "execute",
"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_diesel_models_TypedSql_to_field_value_pairs | clm | method | // hyperswitch/crates/diesel_models/src/kv.rs
// impl for TypedSql
pub fn to_field_value_pairs(
&self,
request_id: String,
global_id: String,
) -> crate::StorageResult<Vec<(&str, String)>> {
let pushed_at = common_utils::date_time::now_unix_timestamp();
Ok(vec![
(
"typed_sql",
serde_json::to_string(self)
.change_context(errors::DatabaseError::QueryGenerationFailed)?,
),
("global_id", global_id),
("request_id", request_id),
("pushed_at", pushed_at.to_string()),
])
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "TypedSql",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "to_field_value_pairs",
"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_diesel_models_ConnectorMandateReferenceId_get_connector_mandate_request_reference_id | clm | method | // hyperswitch/crates/diesel_models/src/payment_attempt.rs
// impl for ConnectorMandateReferenceId
pub fn get_connector_mandate_request_reference_id(&self) -> Option<String> {
self.connector_mandate_request_reference_id.clone()
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorMandateReferenceId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_mandate_request_reference_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_diesel_models_ConnectorTokenDetails_get_connector_token_request_reference_id | clm | method | // hyperswitch/crates/diesel_models/src/payment_attempt.rs
// impl for ConnectorTokenDetails
pub fn get_connector_token_request_reference_id(&self) -> Option<String> {
self.connector_token_request_reference_id.clone()
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ConnectorTokenDetails",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_token_request_reference_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_diesel_models_PaymentAttemptUpdateInternal_populate_derived_fields | clm | method | // hyperswitch/crates/diesel_models/src/payment_attempt.rs
// impl for PaymentAttemptUpdateInternal
pub fn populate_derived_fields(self, source: &PaymentAttempt) -> Self {
let mut update_internal = self;
update_internal.net_amount = Some(
update_internal.amount.unwrap_or(source.amount)
+ update_internal
.surcharge_amount
.or(source.surcharge_amount)
.unwrap_or(MinorUnit::new(0))
+ update_internal
.tax_amount
.or(source.tax_amount)
.unwrap_or(MinorUnit::new(0))
+ update_internal
.shipping_cost
.or(source.shipping_cost)
.unwrap_or(MinorUnit::new(0))
+ update_internal
.order_tax_amount
.or(source.order_tax_amount)
.unwrap_or(MinorUnit::new(0)),
);
update_internal.card_network = update_internal
.payment_method_data
.as_ref()
.and_then(|data| data.as_object())
.and_then(|card| card.get("card"))
.and_then(|data| data.as_object())
.and_then(|card| card.get("card_network"))
.and_then(|network| network.as_str())
.map(|network| network.to_string());
update_internal
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAttemptUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "populate_derived_fields",
"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_diesel_models_PaymentAttemptUpdate_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/payment_attempt.rs
// impl for PaymentAttemptUpdate
pub fn apply_changeset(self, source: PaymentAttempt) -> PaymentAttempt {
let PaymentAttemptUpdateInternal {
amount,
net_amount,
currency,
status,
connector_transaction_id,
amount_to_capture,
connector,
authentication_type,
payment_method,
error_message,
payment_method_id,
cancellation_reason,
modified_at: _,
mandate_id,
browser_info,
payment_token,
error_code,
connector_metadata,
payment_method_data,
payment_method_type,
payment_experience,
business_sub_label,
straight_through_algorithm,
preprocessing_step_id,
error_reason,
capture_method,
connector_response_reference_id,
multiple_capture_count,
surcharge_amount,
tax_amount,
amount_capturable,
updated_by,
merchant_connector_id,
authentication_data,
encoded_data,
unified_code,
unified_message,
external_three_ds_authentication_attempted,
authentication_connector,
authentication_id,
payment_method_billing_address_id,
fingerprint_id,
client_source,
client_version,
customer_acceptance,
card_network,
shipping_cost,
order_tax_amount,
processor_transaction_data,
connector_mandate_detail,
capture_before,
extended_authorization_applied,
card_discovery,
charges,
issuer_error_code,
issuer_error_message,
setup_future_usage_applied,
routing_approach,
connector_request_reference_id,
network_transaction_id,
is_overcapture_enabled,
network_details,
is_stored_credential,
request_extended_authorization,
authorized_amount,
} = PaymentAttemptUpdateInternal::from(self).populate_derived_fields(&source);
PaymentAttempt {
amount: amount.unwrap_or(source.amount),
net_amount: net_amount.or(source.net_amount),
currency: currency.or(source.currency),
status: status.unwrap_or(source.status),
connector_transaction_id: connector_transaction_id.or(source.connector_transaction_id),
amount_to_capture: amount_to_capture.or(source.amount_to_capture),
connector: connector.unwrap_or(source.connector),
authentication_type: authentication_type.or(source.authentication_type),
payment_method: payment_method.or(source.payment_method),
error_message: error_message.unwrap_or(source.error_message),
payment_method_id: payment_method_id.or(source.payment_method_id),
cancellation_reason: cancellation_reason.or(source.cancellation_reason),
modified_at: common_utils::date_time::now(),
mandate_id: mandate_id.or(source.mandate_id),
browser_info: browser_info.or(source.browser_info),
payment_token: payment_token.or(source.payment_token),
error_code: error_code.unwrap_or(source.error_code),
connector_metadata: connector_metadata.or(source.connector_metadata),
payment_method_data: payment_method_data.or(source.payment_method_data),
payment_method_type: payment_method_type.or(source.payment_method_type),
payment_experience: payment_experience.or(source.payment_experience),
business_sub_label: business_sub_label.or(source.business_sub_label),
straight_through_algorithm: straight_through_algorithm
.or(source.straight_through_algorithm),
preprocessing_step_id: preprocessing_step_id.or(source.preprocessing_step_id),
error_reason: error_reason.unwrap_or(source.error_reason),
capture_method: capture_method.or(source.capture_method),
connector_response_reference_id: connector_response_reference_id
.or(source.connector_response_reference_id),
multiple_capture_count: multiple_capture_count.or(source.multiple_capture_count),
surcharge_amount: surcharge_amount.or(source.surcharge_amount),
tax_amount: tax_amount.or(source.tax_amount),
amount_capturable: amount_capturable.unwrap_or(source.amount_capturable),
updated_by,
merchant_connector_id: merchant_connector_id.unwrap_or(source.merchant_connector_id),
authentication_data: authentication_data.or(source.authentication_data),
encoded_data: encoded_data.or(source.encoded_data),
unified_code: unified_code.unwrap_or(source.unified_code),
unified_message: unified_message.unwrap_or(source.unified_message),
external_three_ds_authentication_attempted: external_three_ds_authentication_attempted
.or(source.external_three_ds_authentication_attempted),
authentication_connector: authentication_connector.or(source.authentication_connector),
authentication_id: authentication_id.or(source.authentication_id),
payment_method_billing_address_id: payment_method_billing_address_id
.or(source.payment_method_billing_address_id),
fingerprint_id: fingerprint_id.or(source.fingerprint_id),
client_source: client_source.or(source.client_source),
client_version: client_version.or(source.client_version),
customer_acceptance: customer_acceptance.or(source.customer_acceptance),
card_network: card_network.or(source.card_network),
shipping_cost: shipping_cost.or(source.shipping_cost),
order_tax_amount: order_tax_amount.or(source.order_tax_amount),
processor_transaction_data: processor_transaction_data
.or(source.processor_transaction_data),
connector_mandate_detail: connector_mandate_detail.or(source.connector_mandate_detail),
capture_before: capture_before.or(source.capture_before),
extended_authorization_applied: extended_authorization_applied
.or(source.extended_authorization_applied),
card_discovery: card_discovery.or(source.card_discovery),
charges: charges.or(source.charges),
issuer_error_code: issuer_error_code.or(source.issuer_error_code),
issuer_error_message: issuer_error_message.or(source.issuer_error_message),
setup_future_usage_applied: setup_future_usage_applied
.or(source.setup_future_usage_applied),
routing_approach: routing_approach.or(source.routing_approach),
connector_request_reference_id: connector_request_reference_id
.or(source.connector_request_reference_id),
network_transaction_id: network_transaction_id.or(source.network_transaction_id),
is_overcapture_enabled: is_overcapture_enabled.or(source.is_overcapture_enabled),
network_details: network_details.or(source.network_details),
is_stored_credential: is_stored_credential.or(source.is_stored_credential),
request_extended_authorization: request_extended_authorization
.or(source.request_extended_authorization),
authorized_amount: authorized_amount.or(source.authorized_amount),
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAttemptUpdate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_PaymentAttemptUpdate_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/payment_attempt.rs
// impl for PaymentAttemptUpdate
pub fn apply_changeset(self, source: PaymentAttempt) -> PaymentAttempt {
let PaymentAttemptUpdateInternal {
amount,
net_amount,
currency,
status,
connector_transaction_id,
amount_to_capture,
connector,
authentication_type,
payment_method,
error_message,
payment_method_id,
cancellation_reason,
modified_at: _,
mandate_id,
browser_info,
payment_token,
error_code,
connector_metadata,
payment_method_data,
payment_method_type,
payment_experience,
business_sub_label,
straight_through_algorithm,
preprocessing_step_id,
error_reason,
capture_method,
connector_response_reference_id,
multiple_capture_count,
surcharge_amount,
tax_amount,
amount_capturable,
updated_by,
merchant_connector_id,
authentication_data,
encoded_data,
unified_code,
unified_message,
external_three_ds_authentication_attempted,
authentication_connector,
authentication_id,
payment_method_billing_address_id,
fingerprint_id,
client_source,
client_version,
customer_acceptance,
card_network,
shipping_cost,
order_tax_amount,
processor_transaction_data,
connector_mandate_detail,
capture_before,
extended_authorization_applied,
card_discovery,
charges,
issuer_error_code,
issuer_error_message,
setup_future_usage_applied,
routing_approach,
connector_request_reference_id,
network_transaction_id,
is_overcapture_enabled,
network_details,
is_stored_credential,
request_extended_authorization,
authorized_amount,
} = PaymentAttemptUpdateInternal::from(self).populate_derived_fields(&source);
PaymentAttempt {
amount: amount.unwrap_or(source.amount),
net_amount: net_amount.or(source.net_amount),
currency: currency.or(source.currency),
status: status.unwrap_or(source.status),
connector_transaction_id: connector_transaction_id.or(source.connector_transaction_id),
amount_to_capture: amount_to_capture.or(source.amount_to_capture),
connector: connector.unwrap_or(source.connector),
authentication_type: authentication_type.or(source.authentication_type),
payment_method: payment_method.or(source.payment_method),
error_message: error_message.unwrap_or(source.error_message),
payment_method_id: payment_method_id.or(source.payment_method_id),
cancellation_reason: cancellation_reason.or(source.cancellation_reason),
modified_at: common_utils::date_time::now(),
mandate_id: mandate_id.or(source.mandate_id),
browser_info: browser_info.or(source.browser_info),
payment_token: payment_token.or(source.payment_token),
error_code: error_code.unwrap_or(source.error_code),
connector_metadata: connector_metadata.or(source.connector_metadata),
payment_method_data: payment_method_data.or(source.payment_method_data),
payment_method_type: payment_method_type.or(source.payment_method_type),
payment_experience: payment_experience.or(source.payment_experience),
business_sub_label: business_sub_label.or(source.business_sub_label),
straight_through_algorithm: straight_through_algorithm
.or(source.straight_through_algorithm),
preprocessing_step_id: preprocessing_step_id.or(source.preprocessing_step_id),
error_reason: error_reason.unwrap_or(source.error_reason),
capture_method: capture_method.or(source.capture_method),
connector_response_reference_id: connector_response_reference_id
.or(source.connector_response_reference_id),
multiple_capture_count: multiple_capture_count.or(source.multiple_capture_count),
surcharge_amount: surcharge_amount.or(source.surcharge_amount),
tax_amount: tax_amount.or(source.tax_amount),
amount_capturable: amount_capturable.unwrap_or(source.amount_capturable),
updated_by,
merchant_connector_id: merchant_connector_id.unwrap_or(source.merchant_connector_id),
authentication_data: authentication_data.or(source.authentication_data),
encoded_data: encoded_data.or(source.encoded_data),
unified_code: unified_code.unwrap_or(source.unified_code),
unified_message: unified_message.unwrap_or(source.unified_message),
external_three_ds_authentication_attempted: external_three_ds_authentication_attempted
.or(source.external_three_ds_authentication_attempted),
authentication_connector: authentication_connector.or(source.authentication_connector),
authentication_id: authentication_id.or(source.authentication_id),
payment_method_billing_address_id: payment_method_billing_address_id
.or(source.payment_method_billing_address_id),
fingerprint_id: fingerprint_id.or(source.fingerprint_id),
client_source: client_source.or(source.client_source),
client_version: client_version.or(source.client_version),
customer_acceptance: customer_acceptance.or(source.customer_acceptance),
card_network: card_network.or(source.card_network),
shipping_cost: shipping_cost.or(source.shipping_cost),
order_tax_amount: order_tax_amount.or(source.order_tax_amount),
processor_transaction_data: processor_transaction_data
.or(source.processor_transaction_data),
connector_mandate_detail: connector_mandate_detail.or(source.connector_mandate_detail),
capture_before: capture_before.or(source.capture_before),
extended_authorization_applied: extended_authorization_applied
.or(source.extended_authorization_applied),
card_discovery: card_discovery.or(source.card_discovery),
charges: charges.or(source.charges),
issuer_error_code: issuer_error_code.or(source.issuer_error_code),
issuer_error_message: issuer_error_message.or(source.issuer_error_message),
setup_future_usage_applied: setup_future_usage_applied
.or(source.setup_future_usage_applied),
routing_approach: routing_approach.or(source.routing_approach),
connector_request_reference_id: connector_request_reference_id
.or(source.connector_request_reference_id),
network_transaction_id: network_transaction_id.or(source.network_transaction_id),
is_overcapture_enabled: is_overcapture_enabled.or(source.is_overcapture_enabled),
network_details: network_details.or(source.network_details),
is_stored_credential: is_stored_credential.or(source.is_stored_credential),
request_extended_authorization: request_extended_authorization
.or(source.request_extended_authorization),
authorized_amount: authorized_amount.or(source.authorized_amount),
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAttemptUpdate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_Organization_get_organization_type | clm | method | // hyperswitch/crates/diesel_models/src/organization.rs
// impl for Organization
pub fn get_organization_type(&self) -> common_enums::OrganizationType {
self.organization_type.unwrap_or_default()
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Organization",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_organization_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_diesel_models_Organization_get_organization_type | clm | method | // hyperswitch/crates/diesel_models/src/organization.rs
// impl for Organization
pub fn get_organization_type(&self) -> common_enums::OrganizationType {
self.organization_type.unwrap_or_default()
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Organization",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_organization_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_diesel_models_OrganizationNew_new | clm | method | // hyperswitch/crates/diesel_models/src/organization.rs
// impl for OrganizationNew
pub fn new(
id: id_type::OrganizationId,
organization_type: common_enums::OrganizationType,
organization_name: Option<String>,
) -> Self {
Self {
id,
organization_name,
organization_details: None,
metadata: None,
created_at: common_utils::date_time::now(),
modified_at: common_utils::date_time::now(),
version: common_types::consts::API_VERSION,
organization_type,
platform_merchant_id: None,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "OrganizationNew",
"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_diesel_models_OrganizationNew_new | clm | method | // hyperswitch/crates/api_models/src/organization.rs
// impl for OrganizationNew
pub fn new(org_type: OrganizationType, org_name: Option<String>) -> Self {
Self {
org_id: id_type::OrganizationId::default(),
org_type,
org_name,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "OrganizationNew",
"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_diesel_models_OrganizationNew_new | clm | method | // hyperswitch/crates/diesel_models/src/organization.rs
// impl for OrganizationNew
pub fn new(
id: id_type::OrganizationId,
organization_type: common_enums::OrganizationType,
organization_name: Option<String>,
) -> Self {
Self {
id,
organization_name,
organization_details: None,
metadata: None,
created_at: common_utils::date_time::now(),
modified_at: common_utils::date_time::now(),
version: common_types::consts::API_VERSION,
organization_type,
platform_merchant_id: None,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "OrganizationNew",
"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_diesel_models_OrganizationNew_new | clm | method | // hyperswitch/crates/api_models/src/organization.rs
// impl for OrganizationNew
pub fn new(org_type: OrganizationType, org_name: Option<String>) -> Self {
Self {
org_id: id_type::OrganizationId::default(),
org_type,
org_name,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "OrganizationNew",
"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_diesel_models_MerchantAccount_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
// impl for MerchantAccount
pub fn get_id(&self) -> &common_utils::id_type::MerchantId {
&self.id
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_diesel_models_MerchantAccount_get_id | clm | method | // hyperswitch/crates/diesel_models/src/merchant_account.rs
// impl for MerchantAccount
pub fn get_id(&self) -> &common_utils::id_type::MerchantId {
&self.id
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_diesel_models_MerchantAccountUpdateInternal_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/merchant_account.rs
// impl for MerchantAccountUpdateInternal
pub fn apply_changeset(self, source: MerchantAccount) -> MerchantAccount {
let Self {
merchant_name,
merchant_details,
return_url,
webhook_details,
sub_merchants_enabled,
parent_merchant_id,
enable_payment_response_hash,
payment_response_hash_key,
redirect_to_merchant_with_http_post,
publishable_key,
storage_scheme,
locker_id,
metadata,
routing_algorithm,
primary_business_details,
modified_at,
intent_fulfillment_time,
frm_routing_algorithm,
payout_routing_algorithm,
organization_id,
is_recon_enabled,
default_profile,
recon_status,
payment_link_config,
pm_collect_link_config,
is_platform_account,
product_type,
} = self;
MerchantAccount {
merchant_id: source.merchant_id,
return_url: return_url.or(source.return_url),
enable_payment_response_hash: enable_payment_response_hash
.unwrap_or(source.enable_payment_response_hash),
payment_response_hash_key: payment_response_hash_key
.or(source.payment_response_hash_key),
redirect_to_merchant_with_http_post: redirect_to_merchant_with_http_post
.unwrap_or(source.redirect_to_merchant_with_http_post),
merchant_name: merchant_name.or(source.merchant_name),
merchant_details: merchant_details.or(source.merchant_details),
webhook_details: webhook_details.or(source.webhook_details),
sub_merchants_enabled: sub_merchants_enabled.or(source.sub_merchants_enabled),
parent_merchant_id: parent_merchant_id.or(source.parent_merchant_id),
publishable_key: publishable_key.or(source.publishable_key),
storage_scheme: storage_scheme.unwrap_or(source.storage_scheme),
locker_id: locker_id.or(source.locker_id),
metadata: metadata.or(source.metadata),
routing_algorithm: routing_algorithm.or(source.routing_algorithm),
primary_business_details: primary_business_details
.unwrap_or(source.primary_business_details),
intent_fulfillment_time: intent_fulfillment_time.or(source.intent_fulfillment_time),
created_at: source.created_at,
modified_at,
frm_routing_algorithm: frm_routing_algorithm.or(source.frm_routing_algorithm),
payout_routing_algorithm: payout_routing_algorithm.or(source.payout_routing_algorithm),
organization_id: organization_id.unwrap_or(source.organization_id),
is_recon_enabled: is_recon_enabled.unwrap_or(source.is_recon_enabled),
default_profile: default_profile.unwrap_or(source.default_profile),
recon_status: recon_status.unwrap_or(source.recon_status),
payment_link_config: payment_link_config.or(source.payment_link_config),
pm_collect_link_config: pm_collect_link_config.or(source.pm_collect_link_config),
version: source.version,
is_platform_account: is_platform_account.unwrap_or(source.is_platform_account),
id: source.id,
product_type: product_type.or(source.product_type),
merchant_account_type: source.merchant_account_type,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccountUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_MerchantAccountUpdateInternal_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/merchant_account.rs
// impl for MerchantAccountUpdateInternal
pub fn apply_changeset(self, source: MerchantAccount) -> MerchantAccount {
let Self {
merchant_name,
merchant_details,
return_url,
webhook_details,
sub_merchants_enabled,
parent_merchant_id,
enable_payment_response_hash,
payment_response_hash_key,
redirect_to_merchant_with_http_post,
publishable_key,
storage_scheme,
locker_id,
metadata,
routing_algorithm,
primary_business_details,
modified_at,
intent_fulfillment_time,
frm_routing_algorithm,
payout_routing_algorithm,
organization_id,
is_recon_enabled,
default_profile,
recon_status,
payment_link_config,
pm_collect_link_config,
is_platform_account,
product_type,
} = self;
MerchantAccount {
merchant_id: source.merchant_id,
return_url: return_url.or(source.return_url),
enable_payment_response_hash: enable_payment_response_hash
.unwrap_or(source.enable_payment_response_hash),
payment_response_hash_key: payment_response_hash_key
.or(source.payment_response_hash_key),
redirect_to_merchant_with_http_post: redirect_to_merchant_with_http_post
.unwrap_or(source.redirect_to_merchant_with_http_post),
merchant_name: merchant_name.or(source.merchant_name),
merchant_details: merchant_details.or(source.merchant_details),
webhook_details: webhook_details.or(source.webhook_details),
sub_merchants_enabled: sub_merchants_enabled.or(source.sub_merchants_enabled),
parent_merchant_id: parent_merchant_id.or(source.parent_merchant_id),
publishable_key: publishable_key.or(source.publishable_key),
storage_scheme: storage_scheme.unwrap_or(source.storage_scheme),
locker_id: locker_id.or(source.locker_id),
metadata: metadata.or(source.metadata),
routing_algorithm: routing_algorithm.or(source.routing_algorithm),
primary_business_details: primary_business_details
.unwrap_or(source.primary_business_details),
intent_fulfillment_time: intent_fulfillment_time.or(source.intent_fulfillment_time),
created_at: source.created_at,
modified_at,
frm_routing_algorithm: frm_routing_algorithm.or(source.frm_routing_algorithm),
payout_routing_algorithm: payout_routing_algorithm.or(source.payout_routing_algorithm),
organization_id: organization_id.unwrap_or(source.organization_id),
is_recon_enabled: is_recon_enabled.unwrap_or(source.is_recon_enabled),
default_profile: default_profile.unwrap_or(source.default_profile),
recon_status: recon_status.unwrap_or(source.recon_status),
payment_link_config: payment_link_config.or(source.payment_link_config),
pm_collect_link_config: pm_collect_link_config.or(source.pm_collect_link_config),
version: source.version,
is_platform_account: is_platform_account.unwrap_or(source.is_platform_account),
id: source.id,
product_type: product_type.or(source.product_type),
merchant_account_type: source.merchant_account_type,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccountUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_PayoutsUpdate_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/payouts.rs
// impl for PayoutsUpdate
pub fn apply_changeset(self, source: Payouts) -> Payouts {
let PayoutsUpdateInternal {
amount,
destination_currency,
source_currency,
description,
recurring,
auto_fulfill,
return_url,
entity_type,
metadata,
payout_method_id,
profile_id,
status,
last_modified_at,
attempt_count,
confirm,
payout_type,
address_id,
customer_id,
} = self.into();
Payouts {
amount: amount.unwrap_or(source.amount),
destination_currency: destination_currency.unwrap_or(source.destination_currency),
source_currency: source_currency.unwrap_or(source.source_currency),
description: description.or(source.description),
recurring: recurring.unwrap_or(source.recurring),
auto_fulfill: auto_fulfill.unwrap_or(source.auto_fulfill),
return_url: return_url.or(source.return_url),
entity_type: entity_type.unwrap_or(source.entity_type),
metadata: metadata.or(source.metadata),
payout_method_id: payout_method_id.or(source.payout_method_id),
profile_id: profile_id.unwrap_or(source.profile_id),
status: status.unwrap_or(source.status),
last_modified_at,
attempt_count: attempt_count.unwrap_or(source.attempt_count),
confirm: confirm.or(source.confirm),
payout_type: payout_type.or(source.payout_type),
address_id: address_id.or(source.address_id),
customer_id: customer_id.or(source.customer_id),
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutsUpdate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_PaymentMethod_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for PaymentMethod
pub fn get_id(&self) -> &id_type::GlobalPaymentMethodId {
&self.id
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_diesel_models_PaymentMethodNew_get_id | clm | method | // hyperswitch/crates/diesel_models/src/payment_method.rs
// impl for PaymentMethodNew
pub fn get_id(&self) -> &common_utils::id_type::GlobalPaymentMethodId {
&self.id
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethodNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_diesel_models_PaymentMethodNew_update_storage_scheme | clm | method | // hyperswitch/crates/diesel_models/src/payment_method.rs
// impl for PaymentMethodNew
pub fn update_storage_scheme(&mut self, storage_scheme: MerchantStorageScheme) {
self.updated_by = Some(storage_scheme.to_string());
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethodNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_storage_scheme",
"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_diesel_models_PaymentMethodUpdate_convert_to_payment_method_update | clm | method | // hyperswitch/crates/diesel_models/src/payment_method.rs
// impl for PaymentMethodUpdate
pub fn convert_to_payment_method_update(
self,
storage_scheme: MerchantStorageScheme,
) -> PaymentMethodUpdateInternal {
let mut update_internal: PaymentMethodUpdateInternal = self.into();
update_internal.updated_by = Some(storage_scheme.to_string());
update_internal
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethodUpdate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "convert_to_payment_method_update",
"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_diesel_models_PaymentMethodUpdateInternal_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/payment_method.rs
// impl for PaymentMethodUpdateInternal
pub fn apply_changeset(self, source: PaymentMethod) -> PaymentMethod {
let Self {
metadata,
payment_method_data,
last_used_at,
network_transaction_id,
status,
locker_id,
network_token_requestor_reference_id,
payment_method,
connector_mandate_details,
updated_by,
payment_method_type,
payment_method_issuer,
last_modified,
network_token_locker_id,
network_token_payment_method_data,
scheme,
} = self;
PaymentMethod {
customer_id: source.customer_id,
merchant_id: source.merchant_id,
payment_method_id: source.payment_method_id,
accepted_currency: source.accepted_currency,
scheme: scheme.or(source.scheme),
token: source.token,
cardholder_name: source.cardholder_name,
issuer_name: source.issuer_name,
issuer_country: source.issuer_country,
payer_country: source.payer_country,
is_stored: source.is_stored,
swift_code: source.swift_code,
direct_debit_token: source.direct_debit_token,
created_at: source.created_at,
last_modified,
payment_method: payment_method.or(source.payment_method),
payment_method_type: payment_method_type.or(source.payment_method_type),
payment_method_issuer: payment_method_issuer.or(source.payment_method_issuer),
payment_method_issuer_code: source.payment_method_issuer_code,
metadata: metadata.map_or(source.metadata, |v| Some(v.into())),
payment_method_data: payment_method_data.or(source.payment_method_data),
locker_id: locker_id.or(source.locker_id),
last_used_at: last_used_at.unwrap_or(source.last_used_at),
connector_mandate_details: connector_mandate_details
.or(source.connector_mandate_details),
customer_acceptance: source.customer_acceptance,
status: status.unwrap_or(source.status),
network_transaction_id: network_transaction_id.or(source.network_transaction_id),
client_secret: source.client_secret,
payment_method_billing_address: source.payment_method_billing_address,
updated_by: updated_by.or(source.updated_by),
version: source.version,
network_token_requestor_reference_id: network_token_requestor_reference_id
.or(source.network_token_requestor_reference_id),
network_token_locker_id: network_token_locker_id.or(source.network_token_locker_id),
network_token_payment_method_data: network_token_payment_method_data
.or(source.network_token_payment_method_data),
external_vault_source: source.external_vault_source,
vault_type: source.vault_type,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethodUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_PaymentMethodUpdateInternal_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/payment_method.rs
// impl for PaymentMethodUpdateInternal
pub fn apply_changeset(self, source: PaymentMethod) -> PaymentMethod {
let Self {
metadata,
payment_method_data,
last_used_at,
network_transaction_id,
status,
locker_id,
network_token_requestor_reference_id,
payment_method,
connector_mandate_details,
updated_by,
payment_method_type,
payment_method_issuer,
last_modified,
network_token_locker_id,
network_token_payment_method_data,
scheme,
} = self;
PaymentMethod {
customer_id: source.customer_id,
merchant_id: source.merchant_id,
payment_method_id: source.payment_method_id,
accepted_currency: source.accepted_currency,
scheme: scheme.or(source.scheme),
token: source.token,
cardholder_name: source.cardholder_name,
issuer_name: source.issuer_name,
issuer_country: source.issuer_country,
payer_country: source.payer_country,
is_stored: source.is_stored,
swift_code: source.swift_code,
direct_debit_token: source.direct_debit_token,
created_at: source.created_at,
last_modified,
payment_method: payment_method.or(source.payment_method),
payment_method_type: payment_method_type.or(source.payment_method_type),
payment_method_issuer: payment_method_issuer.or(source.payment_method_issuer),
payment_method_issuer_code: source.payment_method_issuer_code,
metadata: metadata.map_or(source.metadata, |v| Some(v.into())),
payment_method_data: payment_method_data.or(source.payment_method_data),
locker_id: locker_id.or(source.locker_id),
last_used_at: last_used_at.unwrap_or(source.last_used_at),
connector_mandate_details: connector_mandate_details
.or(source.connector_mandate_details),
customer_acceptance: source.customer_acceptance,
status: status.unwrap_or(source.status),
network_transaction_id: network_transaction_id.or(source.network_transaction_id),
client_secret: source.client_secret,
payment_method_billing_address: source.payment_method_billing_address,
updated_by: updated_by.or(source.updated_by),
version: source.version,
network_token_requestor_reference_id: network_token_requestor_reference_id
.or(source.network_token_requestor_reference_id),
network_token_locker_id: network_token_locker_id.or(source.network_token_locker_id),
network_token_payment_method_data: network_token_payment_method_data
.or(source.network_token_payment_method_data),
external_vault_source: source.external_vault_source,
vault_type: source.vault_type,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethodUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_MerchantConnectorAccount_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.id.clone()
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_diesel_models_MerchantConnectorAccount_get_id | clm | method | // hyperswitch/crates/diesel_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.id.clone()
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_diesel_models_MerchantConnectorAccount_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.id.clone()
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_diesel_models_MerchantConnectorAccount_get_id | clm | method | // hyperswitch/crates/diesel_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.id.clone()
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_diesel_models_MerchantConnectorAccountUpdateInternal_create_merchant_connector_account | clm | method | // hyperswitch/crates/diesel_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccountUpdateInternal
pub fn create_merchant_connector_account(
self,
source: MerchantConnectorAccount,
) -> MerchantConnectorAccount {
MerchantConnectorAccount {
connector_type: self.connector_type.unwrap_or(source.connector_type),
connector_account_details: self
.connector_account_details
.unwrap_or(source.connector_account_details),
disabled: self.disabled,
payment_methods_enabled: self.payment_methods_enabled,
frm_config: self.frm_config,
modified_at: self.modified_at.unwrap_or(source.modified_at),
pm_auth_config: self.pm_auth_config,
status: self.status.unwrap_or(source.status),
feature_metadata: self.feature_metadata,
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccountUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_merchant_connector_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_diesel_models_MerchantConnectorAccountUpdateInternal_create_merchant_connector_account | clm | method | // hyperswitch/crates/diesel_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccountUpdateInternal
pub fn create_merchant_connector_account(
self,
source: MerchantConnectorAccount,
) -> MerchantConnectorAccount {
MerchantConnectorAccount {
connector_type: self.connector_type.unwrap_or(source.connector_type),
connector_account_details: self
.connector_account_details
.unwrap_or(source.connector_account_details),
disabled: self.disabled,
payment_methods_enabled: self.payment_methods_enabled,
frm_config: self.frm_config,
modified_at: self.modified_at.unwrap_or(source.modified_at),
pm_auth_config: self.pm_auth_config,
status: self.status.unwrap_or(source.status),
feature_metadata: self.feature_metadata,
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccountUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_merchant_connector_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_diesel_models_ConfigUpdateInternal_create_config | clm | method | // hyperswitch/crates/diesel_models/src/configs.rs
// impl for ConfigUpdateInternal
pub fn create_config(self, source: Config) -> Config {
Config { ..source }
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ConfigUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_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_diesel_models_RequiredFromNullableWithDefault<T>_into_inner | clm | method | // hyperswitch/crates/diesel_models/src/lib.rs
// impl for RequiredFromNullableWithDefault<T>
pub fn into_inner(self) -> T {
self.0
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "RequiredFromNullableWithDefault<T>",
"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_diesel_models_RoutingProfileMetadata_metadata_is_advanced_rule_for_payments | clm | method | // hyperswitch/crates/diesel_models/src/routing_algorithm.rs
// impl for RoutingProfileMetadata
pub fn metadata_is_advanced_rule_for_payments(&self) -> bool {
matches!(self.kind, enums::RoutingAlgorithmKind::Advanced)
&& matches!(self.algorithm_for, enums::TransactionType::Payment)
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "RoutingProfileMetadata",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "metadata_is_advanced_rule_for_payments",
"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_diesel_models_SubscriptionNew_generate_and_set_client_secret | clm | method | // hyperswitch/crates/diesel_models/src/subscription.rs
// impl for SubscriptionNew
pub fn generate_and_set_client_secret(&mut self) -> Secret<String> {
let client_secret =
generate_id_with_default_len(&format!("{}_secret", self.id.get_string_repr()));
self.client_secret = Some(client_secret.clone());
Secret::new(client_secret)
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "SubscriptionNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate_and_set_client_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_diesel_models_SubscriptionUpdate_new | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/subscription.rs
// impl for SubscriptionUpdate
pub fn new(
connector_subscription_id: Option<String>,
payment_method_id: Option<Secret<String>>,
status: Option<String>,
plan_id: Option<String>,
item_price_id: Option<String>,
) -> Self {
Self {
connector_subscription_id,
payment_method_id: payment_method_id.map(|pmid| pmid.peek().clone()),
status,
modified_at: common_utils::date_time::now(),
plan_id,
item_price_id,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "SubscriptionUpdate",
"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_diesel_models_SubscriptionUpdate_new | clm | method | // hyperswitch/crates/diesel_models/src/subscription.rs
// impl for SubscriptionUpdate
pub fn new(
connector_subscription_id: Option<String>,
payment_method_id: Option<Secret<String>>,
status: Option<String>,
plan_id: Option<String>,
item_price_id: Option<String>,
) -> Self {
Self {
connector_subscription_id,
payment_method_id: payment_method_id.map(|pmid| pmid.peek().clone()),
status,
modified_at: common_utils::date_time::now(),
plan_id,
item_price_id,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "SubscriptionUpdate",
"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_diesel_models_AddressUpdateInternal_create_address | clm | method | // hyperswitch/crates/diesel_models/src/address.rs
// impl for AddressUpdateInternal
pub fn create_address(self, source: Address) -> Address {
Address {
city: self.city,
country: self.country,
line1: self.line1,
line2: self.line2,
line3: self.line3,
state: self.state,
zip: self.zip,
first_name: self.first_name,
last_name: self.last_name,
phone_number: self.phone_number,
country_code: self.country_code,
modified_at: self.modified_at,
updated_by: self.updated_by,
origin_zip: self.origin_zip,
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "AddressUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_address",
"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_diesel_models_UserRole_get_entity_id_and_type | clm | method | // hyperswitch/crates/diesel_models/src/user_role.rs
// impl for UserRole
pub fn get_entity_id_and_type(&self) -> Option<(String, EntityType)> {
match (self.version, self.entity_type, self.role_id.as_str()) {
(enums::UserRoleVersion::V1, None, consts::ROLE_ID_ORGANIZATION_ADMIN) => {
let org_id = self.org_id.clone()?.get_string_repr().to_string();
Some((org_id, EntityType::Organization))
}
(enums::UserRoleVersion::V1, None, _) => {
let merchant_id = self.merchant_id.clone()?.get_string_repr().to_string();
Some((merchant_id, EntityType::Merchant))
}
(enums::UserRoleVersion::V1, Some(_), _) => {
self.entity_id.clone().zip(self.entity_type)
}
(enums::UserRoleVersion::V2, _, _) => self.entity_id.clone().zip(self.entity_type),
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "UserRole",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_entity_id_and_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_diesel_models_RefundUpdateInternal_create_refund | clm | method | // hyperswitch/crates/diesel_models/src/refund.rs
// impl for RefundUpdateInternal
pub fn create_refund(self, source: Refund) -> Refund {
Refund {
connector_refund_id: self.connector_refund_id,
refund_status: self.refund_status.unwrap_or_default(),
sent_to_gateway: self.sent_to_gateway.unwrap_or_default(),
refund_error_message: self.refund_error_message,
refund_arn: self.refund_arn,
metadata: self.metadata,
refund_reason: self.refund_reason,
refund_error_code: self.refund_error_code,
updated_by: self.updated_by,
modified_at: self.modified_at,
processor_refund_data: self.processor_refund_data,
unified_code: self.unified_code,
unified_message: self.unified_message,
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "RefundUpdateInternal",
"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_diesel_models_RefundUpdateInternal_create_refund | clm | method | // hyperswitch/crates/diesel_models/src/refund.rs
// impl for RefundUpdateInternal
pub fn create_refund(self, source: Refund) -> Refund {
Refund {
connector_refund_id: self.connector_refund_id,
refund_status: self.refund_status.unwrap_or_default(),
sent_to_gateway: self.sent_to_gateway.unwrap_or_default(),
refund_error_message: self.refund_error_message,
refund_arn: self.refund_arn,
metadata: self.metadata,
refund_reason: self.refund_reason,
refund_error_code: self.refund_error_code,
updated_by: self.updated_by,
modified_at: self.modified_at,
processor_refund_data: self.processor_refund_data,
unified_code: self.unified_code,
unified_message: self.unified_message,
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "RefundUpdateInternal",
"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_diesel_models_RefundUpdate_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/refund.rs
// impl for RefundUpdate
pub fn apply_changeset(self, source: Refund) -> Refund {
let RefundUpdateInternal {
connector_refund_id,
refund_status,
sent_to_gateway,
refund_error_message,
refund_arn,
metadata,
refund_reason,
refund_error_code,
updated_by,
modified_at: _,
processor_refund_data,
unified_code,
unified_message,
} = self.into();
Refund {
connector_refund_id: connector_refund_id.or(source.connector_refund_id),
refund_status: refund_status.unwrap_or(source.refund_status),
sent_to_gateway: sent_to_gateway.unwrap_or(source.sent_to_gateway),
refund_error_message: refund_error_message.or(source.refund_error_message),
refund_error_code: refund_error_code.or(source.refund_error_code),
refund_arn: refund_arn.or(source.refund_arn),
metadata: metadata.or(source.metadata),
refund_reason: refund_reason.or(source.refund_reason),
updated_by,
modified_at: common_utils::date_time::now(),
processor_refund_data: processor_refund_data.or(source.processor_refund_data),
unified_code: unified_code.or(source.unified_code),
unified_message: unified_message.or(source.unified_message),
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "RefundUpdate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_ProcessTracker_is_valid_business_status | clm | method | // hyperswitch/crates/diesel_models/src/process_tracker.rs
// impl for ProcessTracker
pub fn is_valid_business_status(&self, valid_statuses: &[&str]) -> bool {
valid_statuses.iter().any(|&x| x == self.business_status)
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ProcessTracker",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_valid_business_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_diesel_models_ProcessTrackerNew_new | clm | method | // hyperswitch/crates/diesel_models/src/process_tracker.rs
// impl for ProcessTrackerNew
pub fn new<T>(
process_tracker_id: impl Into<String>,
task: impl Into<String>,
runner: ProcessTrackerRunner,
tag: impl IntoIterator<Item = impl Into<String>>,
tracking_data: T,
retry_count: Option<i32>,
schedule_time: PrimitiveDateTime,
api_version: ApiVersion,
) -> StorageResult<Self>
where
T: Serialize + std::fmt::Debug,
{
let current_time = common_utils::date_time::now();
Ok(Self {
id: process_tracker_id.into(),
name: Some(task.into()),
tag: tag.into_iter().map(Into::into).collect(),
runner: Some(runner.to_string()),
retry_count: retry_count.unwrap_or(0),
schedule_time: Some(schedule_time),
rule: String::new(),
tracking_data: tracking_data
.encode_to_value()
.change_context(errors::DatabaseError::Others)
.attach_printable("Failed to serialize process tracker tracking data")?,
business_status: String::from(business_status::PENDING),
status: storage_enums::ProcessTrackerStatus::New,
event: vec![],
created_at: current_time,
updated_at: current_time,
version: api_version,
})
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ProcessTrackerNew",
"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_diesel_models_ProfileUpdateInternal_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/business_profile.rs
// impl for ProfileUpdateInternal
pub fn apply_changeset(self, source: Profile) -> Profile {
let Self {
profile_name,
modified_at,
return_url,
enable_payment_response_hash,
payment_response_hash_key,
redirect_to_merchant_with_http_post,
webhook_details,
metadata,
is_recon_enabled,
applepay_verified_domains,
payment_link_config,
session_expiry,
authentication_connector_details,
payout_link_config,
is_extended_card_info_enabled,
extended_card_info_config,
is_connector_agnostic_mit_enabled,
use_billing_as_payment_method_billing,
collect_shipping_details_from_wallet_connector,
collect_billing_details_from_wallet_connector,
outgoing_webhook_custom_http_headers,
always_collect_billing_details_from_wallet_connector,
always_collect_shipping_details_from_wallet_connector,
tax_connector_id,
is_tax_connector_enabled,
billing_processor_id,
routing_algorithm_id,
order_fulfillment_time,
order_fulfillment_time_origin,
frm_routing_algorithm_id,
payout_routing_algorithm_id,
default_fallback_routing,
should_collect_cvv_during_payment,
is_network_tokenization_enabled,
is_auto_retries_enabled,
max_auto_retries_enabled,
is_click_to_pay_enabled,
authentication_product_ids,
three_ds_decision_manager_config,
card_testing_guard_config,
card_testing_secret_key,
is_clear_pan_retries_enabled,
is_debit_routing_enabled,
merchant_business_country,
revenue_recovery_retry_algorithm_type,
revenue_recovery_retry_algorithm_data,
is_iframe_redirection_enabled,
is_external_vault_enabled,
external_vault_connector_details,
merchant_category_code,
merchant_country_code,
split_txns_enabled,
is_l2_l3_enabled,
} = self;
Profile {
id: source.id,
merchant_id: source.merchant_id,
profile_name: profile_name.unwrap_or(source.profile_name),
created_at: source.created_at,
modified_at,
return_url: return_url.or(source.return_url),
enable_payment_response_hash: enable_payment_response_hash
.unwrap_or(source.enable_payment_response_hash),
payment_response_hash_key: payment_response_hash_key
.or(source.payment_response_hash_key),
redirect_to_merchant_with_http_post: redirect_to_merchant_with_http_post
.unwrap_or(source.redirect_to_merchant_with_http_post),
webhook_details: webhook_details.or(source.webhook_details),
metadata: metadata.or(source.metadata),
is_recon_enabled: is_recon_enabled.unwrap_or(source.is_recon_enabled),
applepay_verified_domains: applepay_verified_domains
.or(source.applepay_verified_domains),
payment_link_config: payment_link_config.or(source.payment_link_config),
session_expiry: session_expiry.or(source.session_expiry),
authentication_connector_details: authentication_connector_details
.or(source.authentication_connector_details),
payout_link_config: payout_link_config.or(source.payout_link_config),
is_extended_card_info_enabled: is_extended_card_info_enabled
.or(source.is_extended_card_info_enabled),
is_connector_agnostic_mit_enabled: is_connector_agnostic_mit_enabled
.or(source.is_connector_agnostic_mit_enabled),
extended_card_info_config: extended_card_info_config
.or(source.extended_card_info_config),
use_billing_as_payment_method_billing: use_billing_as_payment_method_billing
.or(source.use_billing_as_payment_method_billing),
collect_shipping_details_from_wallet_connector:
collect_shipping_details_from_wallet_connector
.or(source.collect_shipping_details_from_wallet_connector),
collect_billing_details_from_wallet_connector:
collect_billing_details_from_wallet_connector
.or(source.collect_billing_details_from_wallet_connector),
outgoing_webhook_custom_http_headers: outgoing_webhook_custom_http_headers
.or(source.outgoing_webhook_custom_http_headers),
always_collect_billing_details_from_wallet_connector:
always_collect_billing_details_from_wallet_connector
.or(always_collect_billing_details_from_wallet_connector),
always_collect_shipping_details_from_wallet_connector:
always_collect_shipping_details_from_wallet_connector
.or(always_collect_shipping_details_from_wallet_connector),
tax_connector_id: tax_connector_id.or(source.tax_connector_id),
is_tax_connector_enabled: is_tax_connector_enabled.or(source.is_tax_connector_enabled),
routing_algorithm_id: routing_algorithm_id.or(source.routing_algorithm_id),
order_fulfillment_time: order_fulfillment_time.or(source.order_fulfillment_time),
order_fulfillment_time_origin: order_fulfillment_time_origin
.or(source.order_fulfillment_time_origin),
frm_routing_algorithm_id: frm_routing_algorithm_id.or(source.frm_routing_algorithm_id),
payout_routing_algorithm_id: payout_routing_algorithm_id
.or(source.payout_routing_algorithm_id),
default_fallback_routing: default_fallback_routing.or(source.default_fallback_routing),
should_collect_cvv_during_payment: should_collect_cvv_during_payment
.or(source.should_collect_cvv_during_payment),
version: source.version,
dynamic_routing_algorithm: None,
is_network_tokenization_enabled: is_network_tokenization_enabled
.unwrap_or(source.is_network_tokenization_enabled),
is_auto_retries_enabled: is_auto_retries_enabled.or(source.is_auto_retries_enabled),
max_auto_retries_enabled: max_auto_retries_enabled.or(source.max_auto_retries_enabled),
always_request_extended_authorization: None,
is_click_to_pay_enabled: is_click_to_pay_enabled
.unwrap_or(source.is_click_to_pay_enabled),
authentication_product_ids: authentication_product_ids
.or(source.authentication_product_ids),
three_ds_decision_manager_config: three_ds_decision_manager_config
.or(source.three_ds_decision_manager_config),
card_testing_guard_config: card_testing_guard_config
.or(source.card_testing_guard_config),
card_testing_secret_key: card_testing_secret_key.or(source.card_testing_secret_key),
is_clear_pan_retries_enabled: is_clear_pan_retries_enabled
.unwrap_or(source.is_clear_pan_retries_enabled),
force_3ds_challenge: None,
is_debit_routing_enabled: is_debit_routing_enabled
.unwrap_or(source.is_debit_routing_enabled),
merchant_business_country: merchant_business_country
.or(source.merchant_business_country),
revenue_recovery_retry_algorithm_type: revenue_recovery_retry_algorithm_type
.or(source.revenue_recovery_retry_algorithm_type),
revenue_recovery_retry_algorithm_data: revenue_recovery_retry_algorithm_data
.or(source.revenue_recovery_retry_algorithm_data),
is_iframe_redirection_enabled: is_iframe_redirection_enabled
.or(source.is_iframe_redirection_enabled),
is_external_vault_enabled: is_external_vault_enabled
.or(source.is_external_vault_enabled),
external_vault_connector_details: external_vault_connector_details
.or(source.external_vault_connector_details),
three_ds_decision_rule_algorithm: None,
acquirer_config_map: None,
merchant_category_code: merchant_category_code.or(source.merchant_category_code),
merchant_country_code: merchant_country_code.or(source.merchant_country_code),
dispute_polling_interval: None,
split_txns_enabled: split_txns_enabled.or(source.split_txns_enabled),
is_manual_retry_enabled: None,
always_enable_overcapture: None,
is_l2_l3_enabled: None,
billing_processor_id: billing_processor_id.or(source.billing_processor_id),
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ProfileUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_Profile_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/business_profile.rs
// impl for Profile
pub fn get_id(&self) -> &common_utils::id_type::ProfileId {
&self.id
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Profile",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_diesel_models_Profile_get_id | clm | method | // hyperswitch/crates/diesel_models/src/business_profile.rs
// impl for Profile
pub fn get_id(&self) -> &common_utils::id_type::ProfileId {
&self.id
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Profile",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_diesel_models_ProfileUpdateInternal_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/business_profile.rs
// impl for ProfileUpdateInternal
pub fn apply_changeset(self, source: Profile) -> Profile {
let Self {
profile_name,
modified_at,
return_url,
enable_payment_response_hash,
payment_response_hash_key,
redirect_to_merchant_with_http_post,
webhook_details,
metadata,
is_recon_enabled,
applepay_verified_domains,
payment_link_config,
session_expiry,
authentication_connector_details,
payout_link_config,
is_extended_card_info_enabled,
extended_card_info_config,
is_connector_agnostic_mit_enabled,
use_billing_as_payment_method_billing,
collect_shipping_details_from_wallet_connector,
collect_billing_details_from_wallet_connector,
outgoing_webhook_custom_http_headers,
always_collect_billing_details_from_wallet_connector,
always_collect_shipping_details_from_wallet_connector,
tax_connector_id,
is_tax_connector_enabled,
billing_processor_id,
routing_algorithm_id,
order_fulfillment_time,
order_fulfillment_time_origin,
frm_routing_algorithm_id,
payout_routing_algorithm_id,
default_fallback_routing,
should_collect_cvv_during_payment,
is_network_tokenization_enabled,
is_auto_retries_enabled,
max_auto_retries_enabled,
is_click_to_pay_enabled,
authentication_product_ids,
three_ds_decision_manager_config,
card_testing_guard_config,
card_testing_secret_key,
is_clear_pan_retries_enabled,
is_debit_routing_enabled,
merchant_business_country,
revenue_recovery_retry_algorithm_type,
revenue_recovery_retry_algorithm_data,
is_iframe_redirection_enabled,
is_external_vault_enabled,
external_vault_connector_details,
merchant_category_code,
merchant_country_code,
split_txns_enabled,
is_l2_l3_enabled,
} = self;
Profile {
id: source.id,
merchant_id: source.merchant_id,
profile_name: profile_name.unwrap_or(source.profile_name),
created_at: source.created_at,
modified_at,
return_url: return_url.or(source.return_url),
enable_payment_response_hash: enable_payment_response_hash
.unwrap_or(source.enable_payment_response_hash),
payment_response_hash_key: payment_response_hash_key
.or(source.payment_response_hash_key),
redirect_to_merchant_with_http_post: redirect_to_merchant_with_http_post
.unwrap_or(source.redirect_to_merchant_with_http_post),
webhook_details: webhook_details.or(source.webhook_details),
metadata: metadata.or(source.metadata),
is_recon_enabled: is_recon_enabled.unwrap_or(source.is_recon_enabled),
applepay_verified_domains: applepay_verified_domains
.or(source.applepay_verified_domains),
payment_link_config: payment_link_config.or(source.payment_link_config),
session_expiry: session_expiry.or(source.session_expiry),
authentication_connector_details: authentication_connector_details
.or(source.authentication_connector_details),
payout_link_config: payout_link_config.or(source.payout_link_config),
is_extended_card_info_enabled: is_extended_card_info_enabled
.or(source.is_extended_card_info_enabled),
is_connector_agnostic_mit_enabled: is_connector_agnostic_mit_enabled
.or(source.is_connector_agnostic_mit_enabled),
extended_card_info_config: extended_card_info_config
.or(source.extended_card_info_config),
use_billing_as_payment_method_billing: use_billing_as_payment_method_billing
.or(source.use_billing_as_payment_method_billing),
collect_shipping_details_from_wallet_connector:
collect_shipping_details_from_wallet_connector
.or(source.collect_shipping_details_from_wallet_connector),
collect_billing_details_from_wallet_connector:
collect_billing_details_from_wallet_connector
.or(source.collect_billing_details_from_wallet_connector),
outgoing_webhook_custom_http_headers: outgoing_webhook_custom_http_headers
.or(source.outgoing_webhook_custom_http_headers),
always_collect_billing_details_from_wallet_connector:
always_collect_billing_details_from_wallet_connector
.or(always_collect_billing_details_from_wallet_connector),
always_collect_shipping_details_from_wallet_connector:
always_collect_shipping_details_from_wallet_connector
.or(always_collect_shipping_details_from_wallet_connector),
tax_connector_id: tax_connector_id.or(source.tax_connector_id),
is_tax_connector_enabled: is_tax_connector_enabled.or(source.is_tax_connector_enabled),
routing_algorithm_id: routing_algorithm_id.or(source.routing_algorithm_id),
order_fulfillment_time: order_fulfillment_time.or(source.order_fulfillment_time),
order_fulfillment_time_origin: order_fulfillment_time_origin
.or(source.order_fulfillment_time_origin),
frm_routing_algorithm_id: frm_routing_algorithm_id.or(source.frm_routing_algorithm_id),
payout_routing_algorithm_id: payout_routing_algorithm_id
.or(source.payout_routing_algorithm_id),
default_fallback_routing: default_fallback_routing.or(source.default_fallback_routing),
should_collect_cvv_during_payment: should_collect_cvv_during_payment
.or(source.should_collect_cvv_during_payment),
version: source.version,
dynamic_routing_algorithm: None,
is_network_tokenization_enabled: is_network_tokenization_enabled
.unwrap_or(source.is_network_tokenization_enabled),
is_auto_retries_enabled: is_auto_retries_enabled.or(source.is_auto_retries_enabled),
max_auto_retries_enabled: max_auto_retries_enabled.or(source.max_auto_retries_enabled),
always_request_extended_authorization: None,
is_click_to_pay_enabled: is_click_to_pay_enabled
.unwrap_or(source.is_click_to_pay_enabled),
authentication_product_ids: authentication_product_ids
.or(source.authentication_product_ids),
three_ds_decision_manager_config: three_ds_decision_manager_config
.or(source.three_ds_decision_manager_config),
card_testing_guard_config: card_testing_guard_config
.or(source.card_testing_guard_config),
card_testing_secret_key: card_testing_secret_key.or(source.card_testing_secret_key),
is_clear_pan_retries_enabled: is_clear_pan_retries_enabled
.unwrap_or(source.is_clear_pan_retries_enabled),
force_3ds_challenge: None,
is_debit_routing_enabled: is_debit_routing_enabled
.unwrap_or(source.is_debit_routing_enabled),
merchant_business_country: merchant_business_country
.or(source.merchant_business_country),
revenue_recovery_retry_algorithm_type: revenue_recovery_retry_algorithm_type
.or(source.revenue_recovery_retry_algorithm_type),
revenue_recovery_retry_algorithm_data: revenue_recovery_retry_algorithm_data
.or(source.revenue_recovery_retry_algorithm_data),
is_iframe_redirection_enabled: is_iframe_redirection_enabled
.or(source.is_iframe_redirection_enabled),
is_external_vault_enabled: is_external_vault_enabled
.or(source.is_external_vault_enabled),
external_vault_connector_details: external_vault_connector_details
.or(source.external_vault_connector_details),
three_ds_decision_rule_algorithm: None,
acquirer_config_map: None,
merchant_category_code: merchant_category_code.or(source.merchant_category_code),
merchant_country_code: merchant_country_code.or(source.merchant_country_code),
dispute_polling_interval: None,
split_txns_enabled: split_txns_enabled.or(source.split_txns_enabled),
is_manual_retry_enabled: None,
always_enable_overcapture: None,
is_l2_l3_enabled: None,
billing_processor_id: billing_processor_id.or(source.billing_processor_id),
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "ProfileUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_RevenueRecoveryAlgorithmData_has_exceeded_monitoring_threshold | clm | method | // hyperswitch/crates/diesel_models/src/business_profile.rs
// impl for RevenueRecoveryAlgorithmData
pub fn has_exceeded_monitoring_threshold(&self, monitoring_threshold_in_seconds: i64) -> bool {
let total_threshold_time = self.monitoring_configured_timestamp
+ Duration::seconds(monitoring_threshold_in_seconds);
common_utils::date_time::now() >= total_threshold_time
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "RevenueRecoveryAlgorithmData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "has_exceeded_monitoring_threshold",
"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_diesel_models_InvoiceUpdate_new | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs
// impl for InvoiceUpdate
pub fn new(
payment_method_id: Option<String>,
status: Option<common_enums::connector_enums::InvoiceStatus>,
connector_invoice_id: Option<common_utils::id_type::InvoiceId>,
payment_intent_id: Option<common_utils::id_type::PaymentId>,
amount: Option<MinorUnit>,
currency: Option<String>,
) -> Self {
Self {
status,
payment_method_id,
connector_invoice_id,
modified_at: common_utils::date_time::now(),
payment_intent_id,
amount,
currency,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "InvoiceUpdate",
"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_diesel_models_InvoiceUpdate_new | clm | method | // hyperswitch/crates/diesel_models/src/invoice.rs
// impl for InvoiceUpdate
pub fn new(
amount: Option<MinorUnit>,
currency: Option<String>,
payment_method_id: Option<String>,
status: Option<InvoiceStatus>,
connector_invoice_id: Option<common_utils::id_type::InvoiceId>,
payment_intent_id: Option<common_utils::id_type::PaymentId>,
) -> Self {
Self {
status,
payment_method_id,
connector_invoice_id,
modified_at: common_utils::date_time::now(),
payment_intent_id,
amount,
currency,
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "InvoiceUpdate",
"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_diesel_models_HashedApiKey_into_inner | clm | method | // hyperswitch/crates/diesel_models/src/api_keys.rs
// impl for HashedApiKey
pub fn into_inner(self) -> String {
self.0
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "HashedApiKey",
"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_diesel_models_CustomerNew_update_storage_scheme | clm | method | // hyperswitch/crates/diesel_models/src/customers.rs
// impl for CustomerNew
pub fn update_storage_scheme(&mut self, storage_scheme: common_enums::MerchantStorageScheme) {
self.updated_by = Some(storage_scheme.to_string());
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "CustomerNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_storage_scheme",
"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_diesel_models_CustomerNew_update_storage_scheme | clm | method | // hyperswitch/crates/diesel_models/src/customers.rs
// impl for CustomerNew
pub fn update_storage_scheme(&mut self, storage_scheme: common_enums::MerchantStorageScheme) {
self.updated_by = Some(storage_scheme.to_string());
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "CustomerNew",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_storage_scheme",
"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_diesel_models_CustomerUpdateInternal_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/customers.rs
// impl for CustomerUpdateInternal
pub fn apply_changeset(self, source: Customer) -> Customer {
let Self {
name,
email,
phone,
description,
phone_country_code,
metadata,
connector_customer,
default_payment_method_id,
default_billing_address,
default_shipping_address,
status,
tax_registration_id,
..
} = self;
Customer {
name: name.map_or(source.name, Some),
email: email.map_or(source.email, Some),
phone: phone.map_or(source.phone, Some),
description: description.map_or(source.description, Some),
phone_country_code: phone_country_code.map_or(source.phone_country_code, Some),
metadata: metadata.map_or(source.metadata, Some),
modified_at: common_utils::date_time::now(),
connector_customer: connector_customer.map_or(source.connector_customer, Some),
default_payment_method_id: default_payment_method_id
.flatten()
.map_or(source.default_payment_method_id, Some),
default_billing_address: default_billing_address
.map_or(source.default_billing_address, Some),
default_shipping_address: default_shipping_address
.map_or(source.default_shipping_address, Some),
status: status.unwrap_or(source.status),
tax_registration_id: tax_registration_id.map_or(source.tax_registration_id, Some),
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "CustomerUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_CustomerUpdateInternal_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/customers.rs
// impl for CustomerUpdateInternal
pub fn apply_changeset(self, source: Customer) -> Customer {
let Self {
name,
email,
phone,
description,
phone_country_code,
metadata,
connector_customer,
default_payment_method_id,
default_billing_address,
default_shipping_address,
status,
tax_registration_id,
..
} = self;
Customer {
name: name.map_or(source.name, Some),
email: email.map_or(source.email, Some),
phone: phone.map_or(source.phone, Some),
description: description.map_or(source.description, Some),
phone_country_code: phone_country_code.map_or(source.phone_country_code, Some),
metadata: metadata.map_or(source.metadata, Some),
modified_at: common_utils::date_time::now(),
connector_customer: connector_customer.map_or(source.connector_customer, Some),
default_payment_method_id: default_payment_method_id
.flatten()
.map_or(source.default_payment_method_id, Some),
default_billing_address: default_billing_address
.map_or(source.default_billing_address, Some),
default_shipping_address: default_shipping_address
.map_or(source.default_shipping_address, Some),
status: status.unwrap_or(source.status),
tax_registration_id: tax_registration_id.map_or(source.tax_registration_id, Some),
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "CustomerUpdateInternal",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_PayoutAttemptUpdate_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/payout_attempt.rs
// impl for PayoutAttemptUpdate
pub fn apply_changeset(self, source: PayoutAttempt) -> PayoutAttempt {
let PayoutAttemptUpdateInternal {
payout_token,
connector_payout_id,
status,
error_message,
error_code,
is_eligible,
business_country,
business_label,
connector,
routing_info,
last_modified_at,
address_id,
customer_id,
merchant_connector_id,
unified_code,
unified_message,
additional_payout_method_data,
merchant_order_reference_id,
payout_connector_metadata,
} = self.into();
PayoutAttempt {
payout_token: payout_token.or(source.payout_token),
connector_payout_id: connector_payout_id.or(source.connector_payout_id),
status: status.unwrap_or(source.status),
error_message: error_message.or(source.error_message),
error_code: error_code.or(source.error_code),
is_eligible: is_eligible.or(source.is_eligible),
business_country: business_country.or(source.business_country),
business_label: business_label.or(source.business_label),
connector: connector.or(source.connector),
routing_info: routing_info.or(source.routing_info),
last_modified_at,
address_id: address_id.or(source.address_id),
customer_id: customer_id.or(source.customer_id),
merchant_connector_id: merchant_connector_id.or(source.merchant_connector_id),
unified_code: unified_code.or(source.unified_code),
unified_message: unified_message.or(source.unified_message),
additional_payout_method_data: additional_payout_method_data
.or(source.additional_payout_method_data),
merchant_order_reference_id: merchant_order_reference_id
.or(source.merchant_order_reference_id),
payout_connector_metadata: payout_connector_metadata
.or(source.payout_connector_metadata),
..source
}
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "PayoutAttemptUpdate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"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_diesel_models_Authentication_is_separate_authn_required | clm | method | // hyperswitch/crates/diesel_models/src/authentication.rs
// impl for Authentication
pub fn is_separate_authn_required(&self) -> bool {
self.maximum_supported_version
.as_ref()
.is_some_and(|version| version.get_major() == 2)
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Authentication",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_separate_authn_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_diesel_models_Authentication_is_jwt_flow | clm | method | // hyperswitch/crates/diesel_models/src/authentication.rs
// impl for Authentication
pub fn is_jwt_flow(&self) -> CustomResult<bool, ValidationError> {
Ok(self
.authentication_connector
.clone()
.map(|connector| {
common_enums::AuthenticationConnectors::from_str(&connector)
.change_context(ValidationError::InvalidValue {
message: "failed to parse authentication_connector".to_string(),
})
.map(|connector_enum| connector_enum.is_jwt_flow())
})
.transpose()?
.unwrap_or(false))
}
| {
"chunk": null,
"crate": "diesel_models",
"enum_name": null,
"file_size": null,
"for_type": "Authentication",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_jwt_flow",
"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.