id
stringlengths
20
153
type
stringclasses
1 value
granularity
stringclasses
14 values
content
stringlengths
16
84.3k
metadata
dict
hyperswitch_method_hyperswitch_domain_models_AddressDetails_get_optional_full_name
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/address.rs // impl for AddressDetails pub fn get_optional_full_name(&self) -> Option<Secret<String>> { match (self.first_name.as_ref(), self.last_name.as_ref()) { (Some(first_name), Some(last_name)) => Some(Secret::new(format!( "{} {}", first_name.peek(), last_name.peek() ))), (Some(name), None) | (None, Some(name)) => Some(name.to_owned()), _ => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "AddressDetails", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_optional_full_name", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_AddressDetails_unify_address_details
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/address.rs // impl for AddressDetails pub fn unify_address_details(&self, other: Option<&Self>) -> Self { if let Some(other) = other { let (first_name, last_name) = if self .first_name .as_ref() .is_some_and(|first_name| !first_name.peek().trim().is_empty()) { (self.first_name.clone(), self.last_name.clone()) } else { (other.first_name.clone(), other.last_name.clone()) }; Self { first_name, last_name, city: self.city.clone().or(other.city.clone()), country: self.country.or(other.country), line1: self.line1.clone().or(other.line1.clone()), line2: self.line2.clone().or(other.line2.clone()), line3: self.line3.clone().or(other.line3.clone()), zip: self.zip.clone().or(other.zip.clone()), state: self.state.clone().or(other.state.clone()), origin_zip: self.origin_zip.clone().or(other.origin_zip.clone()), } } else { self.clone() } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "AddressDetails", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "unify_address_details", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_EncryptedJsonType<T>_serialize_json_bytes
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/type_encryption.rs // impl for EncryptedJsonType<T> fn serialize_json_bytes(&self) -> CustomResult<Secret<Vec<u8>>, errors::CryptoError> { common_utils::ext_traits::Encode::encode_to_vec(self.inner()) .change_context(errors::CryptoError::EncodingFailed) .attach_printable("Failed to JSON serialize data before encryption") .map(Secret::new) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "EncryptedJsonType<T>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "serialize_json_bytes", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_EncryptedJsonType<T>_deserialize_json_bytes
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/type_encryption.rs // impl for EncryptedJsonType<T> fn deserialize_json_bytes<S>( bytes: Secret<Vec<u8>>, ) -> CustomResult<Secret<Self, S>, errors::ParsingError> where S: masking::Strategy<Self>, { bytes .peek() .as_slice() .parse_struct::<T>(std::any::type_name::<T>()) .map(|result| Secret::new(Self::from(result))) .attach_printable("Failed to JSON deserialize data after decryption") }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "EncryptedJsonType<T>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "deserialize_json_bytes", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_EncryptedJsonType<T>_inner
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/type_encryption.rs // impl for EncryptedJsonType<T> pub fn inner(&self) -> &T { &self.0 }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "EncryptedJsonType<T>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "inner", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_EncryptedJsonType<T>_into_inner
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/type_encryption.rs // impl for EncryptedJsonType<T> pub fn into_inner(self) -> T { self.0 }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "EncryptedJsonType<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_hyperswitch_domain_models_L2L3Data_get_shipping_country
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for L2L3Data pub fn get_shipping_country(&self) -> Option<common_enums::enums::CountryAlpha2> { self.shipping_details .as_ref() .and_then(|address| address.country) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "L2L3Data", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_shipping_country", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_L2L3Data_get_shipping_city
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for L2L3Data pub fn get_shipping_city(&self) -> Option<String> { self.shipping_details .as_ref() .and_then(|address| address.city.clone()) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "L2L3Data", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_shipping_city", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_L2L3Data_get_shipping_state
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for L2L3Data pub fn get_shipping_state(&self) -> Option<Secret<String>> { self.shipping_details .as_ref() .and_then(|address| address.state.clone()) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "L2L3Data", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_shipping_state", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_L2L3Data_get_shipping_origin_zip
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for L2L3Data pub fn get_shipping_origin_zip(&self) -> Option<Secret<String>> { self.shipping_details .as_ref() .and_then(|address| address.origin_zip.clone()) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "L2L3Data", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_shipping_origin_zip", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_L2L3Data_get_shipping_zip
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for L2L3Data pub fn get_shipping_zip(&self) -> Option<Secret<String>> { self.shipping_details .as_ref() .and_then(|address| address.zip.clone()) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "L2L3Data", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_shipping_zip", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_L2L3Data_get_shipping_address_line1
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for L2L3Data pub fn get_shipping_address_line1(&self) -> Option<Secret<String>> { self.shipping_details .as_ref() .and_then(|address| address.line1.clone()) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "L2L3Data", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_shipping_address_line1", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_L2L3Data_get_shipping_address_line2
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for L2L3Data pub fn get_shipping_address_line2(&self) -> Option<Secret<String>> { self.shipping_details .as_ref() .and_then(|address| address.line2.clone()) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "L2L3Data", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_shipping_address_line2", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_ApplePayPredecryptDataInternal_get_four_digit_expiry_year
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for ApplePayPredecryptDataInternal fn get_four_digit_expiry_year( &self, ) -> Result<Secret<String>, common_utils::errors::ValidationError> { Ok(Secret::new(format!( "20{}", self.application_expiration_date.get(0..2).ok_or( common_utils::errors::ValidationError::InvalidValue { message: "Invalid two-digit year".to_string(), } )? ))) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ApplePayPredecryptDataInternal", "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_hyperswitch_domain_models_ApplePayPredecryptDataInternal_get_expiry_month
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for ApplePayPredecryptDataInternal fn get_expiry_month(&self) -> Result<Secret<String>, common_utils::errors::ValidationError> { Ok(Secret::new( self.application_expiration_date .get(2..4) .ok_or(common_utils::errors::ValidationError::InvalidValue { message: "Invalid two-digit month".to_string(), })? .to_owned(), )) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ApplePayPredecryptDataInternal", "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_hyperswitch_domain_models_ConnectorResponseData_with_additional_payment_method_data
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for ConnectorResponseData pub fn with_additional_payment_method_data( additional_payment_method_data: AdditionalPaymentMethodConnectorResponse, ) -> Self { Self { additional_payment_method_data: Some(additional_payment_method_data), extended_authorization_response_data: None, is_overcapture_enabled: None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ConnectorResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "with_additional_payment_method_data", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_ConnectorResponseData_new
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for ConnectorResponseData pub fn new( additional_payment_method_data: Option<AdditionalPaymentMethodConnectorResponse>, is_overcapture_enabled: Option<primitive_wrappers::OvercaptureEnabledBool>, extended_authorization_response_data: Option<ExtendedAuthorizationResponseData>, ) -> Self { Self { additional_payment_method_data, extended_authorization_response_data, is_overcapture_enabled, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ConnectorResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_ConnectorResponseData_get_extended_authorization_response_data
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for ConnectorResponseData pub fn get_extended_authorization_response_data( &self, ) -> Option<&ExtendedAuthorizationResponseData> { self.extended_authorization_response_data.as_ref() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ConnectorResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_extended_authorization_response_data", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_ConnectorResponseData_is_overcapture_enabled
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for ConnectorResponseData pub fn is_overcapture_enabled(&self) -> Option<primitive_wrappers::OvercaptureEnabledBool> { self.is_overcapture_enabled }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ConnectorResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "is_overcapture_enabled", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_ErrorResponse_get_not_implemented
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_data.rs // impl for ErrorResponse pub fn get_not_implemented() -> Self { Self { code: "IR_00".to_string(), message: "This API is under development and will be made available soon.".to_string(), reason: None, status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(), attempt_status: None, connector_transaction_id: None, network_decline_code: None, network_advice_code: None, network_error_message: None, connector_metadata: None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ErrorResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_not_implemented", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_ErrorResponse_get_not_implemented
clm
method
// hyperswitch/crates/pm_auth/src/types.rs // impl for ErrorResponse fn get_not_implemented() -> Self { Self { code: "IR_00".to_string(), message: "This API is under development and will be made available soon.".to_string(), reason: None, status_code: http::StatusCode::INTERNAL_SERVER_ERROR.as_u16(), } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ErrorResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_not_implemented", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_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": "hyperswitch_domain_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_hyperswitch_domain_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": "hyperswitch_domain_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_hyperswitch_domain_models_Invoice_to_invoice
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs // impl for Invoice pub fn to_invoice( subscription_id: common_utils::id_type::SubscriptionId, merchant_id: common_utils::id_type::MerchantId, profile_id: common_utils::id_type::ProfileId, merchant_connector_id: common_utils::id_type::MerchantConnectorAccountId, payment_intent_id: Option<common_utils::id_type::PaymentId>, payment_method_id: Option<String>, customer_id: common_utils::id_type::CustomerId, amount: MinorUnit, currency: String, status: common_enums::connector_enums::InvoiceStatus, provider_name: common_enums::connector_enums::Connector, metadata: Option<SecretSerdeValue>, connector_invoice_id: Option<common_utils::id_type::InvoiceId>, ) -> Self { Self { id: common_utils::id_type::InvoiceId::generate(), subscription_id, merchant_id, profile_id, merchant_connector_id, payment_intent_id, payment_method_id, customer_id, amount, currency: currency.to_string(), status, provider_name, metadata, connector_invoice_id, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "Invoice", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "to_invoice", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_InvoiceUpdateRequest_update_amount_and_currency
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs // impl for InvoiceUpdateRequest pub fn update_amount_and_currency(amount: MinorUnit, currency: String) -> Self { Self::Amount(AmountAndCurrencyUpdate { amount, currency }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "InvoiceUpdateRequest", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "update_amount_and_currency", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_InvoiceUpdateRequest_update_connector_and_status
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs // impl for InvoiceUpdateRequest pub fn update_connector_and_status( connector_invoice_id: common_utils::id_type::InvoiceId, status: common_enums::connector_enums::InvoiceStatus, ) -> Self { Self::Connector(ConnectorAndStatusUpdate { connector_invoice_id, status, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "InvoiceUpdateRequest", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "update_connector_and_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_hyperswitch_domain_models_InvoiceUpdateRequest_update_payment_and_status
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/invoice.rs // impl for InvoiceUpdateRequest pub fn update_payment_and_status( payment_method_id: Option<Secret<String>>, payment_intent_id: Option<common_utils::id_type::PaymentId>, status: common_enums::connector_enums::InvoiceStatus, connector_invoice_id: Option<common_utils::id_type::InvoiceId>, ) -> Self { Self::PaymentStatus(PaymentAndStatusUpdate { payment_method_id, payment_intent_id, status, connector_invoice_id, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "InvoiceUpdateRequest", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "update_payment_and_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_hyperswitch_domain_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": "hyperswitch_domain_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_hyperswitch_domain_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": "hyperswitch_domain_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_hyperswitch_domain_models_ConnectorCustomerResponseData_new_with_customer_id
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs // impl for ConnectorCustomerResponseData pub fn new_with_customer_id(connector_customer_id: String) -> Self { Self::new(connector_customer_id, None, None, None) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ConnectorCustomerResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new_with_customer_id", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_ConnectorCustomerResponseData_new
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs // impl for ConnectorCustomerResponseData pub fn new( connector_customer_id: String, name: Option<String>, email: Option<String>, billing_address: Option<AddressDetails>, ) -> Self { Self { connector_customer_id, name, email, billing_address, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ConnectorCustomerResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_CaptureSyncResponse_get_amount_captured
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs // impl for CaptureSyncResponse pub fn get_amount_captured(&self) -> Option<MinorUnit> { match self { Self::Success { amount, .. } | Self::Error { amount, .. } => *amount, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "CaptureSyncResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_amount_captured", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_CaptureSyncResponse_get_connector_response_reference_id
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs // impl for CaptureSyncResponse pub fn get_connector_response_reference_id(&self) -> Option<String> { match self { Self::Success { connector_response_reference_id, .. } => connector_response_reference_id.clone(), Self::Error { .. } => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "CaptureSyncResponse", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_connector_response_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_hyperswitch_domain_models_PaymentsResponseData_get_connector_metadata
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs // impl for PaymentsResponseData pub fn get_connector_metadata(&self) -> Option<masking::Secret<serde_json::Value>> { match self { Self::TransactionResponse { connector_metadata, .. } | Self::PreProcessingResponse { connector_metadata, .. } => connector_metadata.clone().map(masking::Secret::new), _ => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentsResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_connector_metadata", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentsResponseData_get_network_transaction_id
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs // impl for PaymentsResponseData pub fn get_network_transaction_id(&self) -> Option<String> { match self { Self::TransactionResponse { network_txn_id, .. } => network_txn_id.clone(), _ => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentsResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_network_transaction_id", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentsResponseData_get_connector_transaction_id
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs // impl for PaymentsResponseData pub fn get_connector_transaction_id( &self, ) -> Result<String, error_stack::Report<ApiErrorResponse>> { match self { Self::TransactionResponse { resource_id: ResponseId::ConnectorTransactionId(txn_id), .. } => Ok(txn_id.to_string()), _ => Err(ApiErrorResponse::MissingRequiredField { field_name: "ConnectorTransactionId", } .into()), } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentsResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_connector_transaction_id", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentsResponseData_merge_transaction_responses
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs // impl for PaymentsResponseData pub fn merge_transaction_responses( auth_response: &Self, capture_response: &Self, ) -> Result<Self, error_stack::Report<ApiErrorResponse>> { match (auth_response, capture_response) { ( Self::TransactionResponse { resource_id: _, redirection_data: auth_redirection_data, mandate_reference: auth_mandate_reference, connector_metadata: auth_connector_metadata, network_txn_id: auth_network_txn_id, connector_response_reference_id: auth_connector_response_reference_id, incremental_authorization_allowed: auth_incremental_auth_allowed, charges: auth_charges, }, Self::TransactionResponse { resource_id: capture_resource_id, redirection_data: capture_redirection_data, mandate_reference: capture_mandate_reference, connector_metadata: capture_connector_metadata, network_txn_id: capture_network_txn_id, connector_response_reference_id: capture_connector_response_reference_id, incremental_authorization_allowed: capture_incremental_auth_allowed, charges: capture_charges, }, ) => Ok(Self::TransactionResponse { resource_id: capture_resource_id.clone(), redirection_data: Box::new( capture_redirection_data .clone() .or_else(|| *auth_redirection_data.clone()), ), mandate_reference: Box::new( auth_mandate_reference .clone() .or_else(|| *capture_mandate_reference.clone()), ), connector_metadata: capture_connector_metadata .clone() .or(auth_connector_metadata.clone()), network_txn_id: capture_network_txn_id .clone() .or(auth_network_txn_id.clone()), connector_response_reference_id: capture_connector_response_reference_id .clone() .or(auth_connector_response_reference_id.clone()), incremental_authorization_allowed: (*capture_incremental_auth_allowed) .or(*auth_incremental_auth_allowed), charges: auth_charges.clone().or(capture_charges.clone()), }), _ => Err(ApiErrorResponse::NotSupported { message: "Invalid Flow ".to_owned(), } .into()), } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentsResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "merge_transaction_responses", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentsResponseData_get_updated_connector_token_details
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_response_types.rs // impl for PaymentsResponseData pub fn get_updated_connector_token_details( &self, original_connector_mandate_request_reference_id: Option<String>, ) -> Option<diesel_models::ConnectorTokenDetails> { if let Self::TransactionResponse { mandate_reference, .. } = self { mandate_reference.clone().map(|mandate_ref| { let connector_mandate_id = mandate_ref.connector_mandate_id; let connector_mandate_request_reference_id = mandate_ref .connector_mandate_request_reference_id .or(original_connector_mandate_request_reference_id); diesel_models::ConnectorTokenDetails { connector_mandate_id, connector_token_request_reference_id: connector_mandate_request_reference_id, } }) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentsResponseData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_updated_connector_token_details", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_RecoveryPaymentAttempt_get_attempt_triggered_by
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/revenue_recovery.rs // impl for RecoveryPaymentAttempt pub fn get_attempt_triggered_by(&self) -> Option<common_enums::TriggeredBy> { self.feature_metadata.as_ref().and_then(|metadata| { metadata .revenue_recovery .as_ref() .map(|recovery| recovery.attempt_triggered_by) }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "RecoveryPaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_attempt_triggered_by", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentMethodData_get_payment_method
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for PaymentMethodData pub fn get_payment_method(&self) -> Option<common_enums::PaymentMethod> { match self { Self::Card(_) | Self::NetworkToken(_) | Self::CardDetailsForNetworkTransactionId(_) => { Some(common_enums::PaymentMethod::Card) } Self::CardRedirect(_) => Some(common_enums::PaymentMethod::CardRedirect), Self::Wallet(_) => Some(common_enums::PaymentMethod::Wallet), Self::PayLater(_) => Some(common_enums::PaymentMethod::PayLater), Self::BankRedirect(_) => Some(common_enums::PaymentMethod::BankRedirect), Self::BankDebit(_) => Some(common_enums::PaymentMethod::BankDebit), Self::BankTransfer(_) => Some(common_enums::PaymentMethod::BankTransfer), Self::Crypto(_) => Some(common_enums::PaymentMethod::Crypto), Self::Reward => Some(common_enums::PaymentMethod::Reward), Self::RealTimePayment(_) => Some(common_enums::PaymentMethod::RealTimePayment), Self::Upi(_) => Some(common_enums::PaymentMethod::Upi), Self::Voucher(_) => Some(common_enums::PaymentMethod::Voucher), Self::GiftCard(_) => Some(common_enums::PaymentMethod::GiftCard), Self::OpenBanking(_) => Some(common_enums::PaymentMethod::OpenBanking), Self::MobilePayment(_) => Some(common_enums::PaymentMethod::MobilePayment), Self::CardToken(_) | Self::MandatePayment => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentMethodData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_payment_method", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentMethodData_get_wallet_data
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for PaymentMethodData pub fn get_wallet_data(&self) -> Option<&WalletData> { if let Self::Wallet(wallet_data) = self { Some(wallet_data) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentMethodData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_wallet_data", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentMethodData_is_network_token_payment_method_data
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for PaymentMethodData pub fn is_network_token_payment_method_data(&self) -> bool { matches!(self, Self::NetworkToken(_)) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentMethodData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "is_network_token_payment_method_data", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentMethodData_get_card_data
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for PaymentMethodData pub fn get_card_data(&self) -> Option<&Card> { if let Self::Card(card) = self { Some(card) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentMethodData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_card_data", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentMethodData_extract_debit_routing_saving_percentage
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for PaymentMethodData pub fn extract_debit_routing_saving_percentage( &self, network: &common_enums::CardNetwork, ) -> Option<f64> { self.get_co_badged_card_data()? .co_badged_card_networks_info .0 .iter() .find(|info| &info.network == network) .map(|info| info.saving_percentage) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentMethodData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "extract_debit_routing_saving_percentage", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_CardDetailsForNetworkTransactionId_get_nti_and_card_details_for_mit_flow
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for CardDetailsForNetworkTransactionId pub fn get_nti_and_card_details_for_mit_flow( recurring_details: mandates::RecurringDetails, ) -> Option<(api_models::payments::MandateReferenceId, Self)> { let network_transaction_id_and_card_details = match recurring_details { mandates::RecurringDetails::NetworkTransactionIdAndCardDetails( network_transaction_id_and_card_details, ) => Some(network_transaction_id_and_card_details), mandates::RecurringDetails::MandateId(_) | mandates::RecurringDetails::PaymentMethodId(_) | mandates::RecurringDetails::ProcessorPaymentToken(_) => None, }?; let mandate_reference_id = api_models::payments::MandateReferenceId::NetworkMandateId( network_transaction_id_and_card_details .network_transaction_id .peek() .to_string(), ); Some(( mandate_reference_id, network_transaction_id_and_card_details.clone().into(), )) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "CardDetailsForNetworkTransactionId", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_nti_and_card_details_for_mit_flow", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_WalletData_get_paze_wallet_data
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for WalletData pub fn get_paze_wallet_data(&self) -> Option<&PazeWalletData> { if let Self::Paze(paze_wallet_data) = self { Some(paze_wallet_data) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "WalletData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_paze_wallet_data", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_WalletData_get_apple_pay_wallet_data
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for WalletData pub fn get_apple_pay_wallet_data(&self) -> Option<&ApplePayWalletData> { if let Self::ApplePay(apple_pay_wallet_data) = self { Some(apple_pay_wallet_data) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "WalletData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_apple_pay_wallet_data", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_WalletData_get_google_pay_wallet_data
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for WalletData pub fn get_google_pay_wallet_data(&self) -> Option<&GooglePayWalletData> { if let Self::GooglePay(google_pay_wallet_data) = self { Some(google_pay_wallet_data) } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "WalletData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_google_pay_wallet_data", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_CardDetailsPaymentMethod_to_card_details_from_locker
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for CardDetailsPaymentMethod pub fn to_card_details_from_locker(self) -> payment_methods::CardDetailFromLocker { payment_methods::CardDetailFromLocker { card_number: None, card_holder_name: self.card_holder_name.clone(), card_issuer: self.card_issuer.clone(), card_network: self.card_network.clone(), card_type: self.card_type.clone(), issuer_country: self.clone().get_issuer_country_alpha2(), last4_digits: self.last4_digits, expiry_month: self.expiry_month, expiry_year: self.expiry_year, card_fingerprint: None, nick_name: self.nick_name, card_isin: self.card_isin, saved_to_locker: self.saved_to_locker, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "CardDetailsPaymentMethod", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "to_card_details_from_locker", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_CardDetailsPaymentMethod_get_issuer_country_alpha2
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for CardDetailsPaymentMethod pub fn get_issuer_country_alpha2(self) -> Option<common_enums::CountryAlpha2> { self.issuer_country .as_ref() .map(|c| api_enums::CountryAlpha2::from_str(c)) .transpose() .ok() .flatten() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "CardDetailsPaymentMethod", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_issuer_country_alpha2", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_SingleUsePaymentMethodToken_get_single_use_token_from_payment_method_token
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for SingleUsePaymentMethodToken pub fn get_single_use_token_from_payment_method_token( token: Secret<String>, mca_id: id_type::MerchantConnectorAccountId, ) -> Self { Self { token, merchant_connector_id: mca_id, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "SingleUsePaymentMethodToken", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_single_use_token_from_payment_method_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_hyperswitch_domain_models_SingleUseTokenKey_store_key
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for SingleUseTokenKey pub fn store_key(payment_method_id: &id_type::GlobalPaymentMethodId) -> Self { let new_token = format!("single_use_token_{}", payment_method_id.get_string_repr()); Self(new_token) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "SingleUseTokenKey", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "store_key", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_SingleUseTokenKey_get_store_key
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payment_method_data.rs // impl for SingleUseTokenKey pub fn get_store_key(&self) -> &str { &self.0 }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "SingleUseTokenKey", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_store_key", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_MandateAmountData_get_end_date
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs // impl for MandateAmountData pub fn get_end_date( &self, format: date_time::DateFormat, ) -> error_stack::Result<Option<String>, ParsingError> { self.end_date .map(|date| { date_time::format_date(date, format) .change_context(ParsingError::DateTimeParsingError) }) .transpose() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "MandateAmountData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_end_date", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_MandateAmountData_get_metadata
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/mandates.rs // impl for MandateAmountData pub fn get_metadata(&self) -> Option<pii::SecretSerdeValue> { self.metadata.clone() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "MandateAmountData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_metadata", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_ApplicationResponse<R>_get_json_body
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/api.rs // impl for ApplicationResponse<R> pub fn get_json_body( self, ) -> common_utils::errors::CustomResult<R, common_utils::errors::ValidationError> { match self { Self::Json(body) | Self::JsonWithHeaders((body, _)) => Ok(body), Self::TextPlain(_) | Self::JsonForRedirection(_) | Self::Form(_) | Self::PaymentLinkForm(_) | Self::FileData(_) | Self::GenericLinkForm(_) | Self::StatusOk => Err(common_utils::errors::ValidationError::InvalidValue { message: "expected either Json or JsonWithHeaders Response".to_string(), } .into()), } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "ApplicationResponse<R>", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_json_body", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_Relay_new
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/relay.rs // impl for Relay pub fn new( relay_request: &api_models::relay::RelayRequest, merchant_id: &id_type::MerchantId, profile_id: &id_type::ProfileId, ) -> Self { let relay_id = id_type::RelayId::generate(); Self { id: relay_id.clone(), connector_resource_id: relay_request.connector_resource_id.clone(), connector_id: relay_request.connector_id.clone(), profile_id: profile_id.clone(), merchant_id: merchant_id.clone(), relay_type: common_enums::RelayType::Refund, request_data: relay_request.data.clone().map(From::from), status: common_enums::RelayStatus::Created, connector_reference_id: None, error_code: None, error_message: None, created_at: common_utils::date_time::now(), modified_at: common_utils::date_time::now(), response_data: None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "Relay", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentMethodVaultingData_get_card
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/vault.rs // impl for PaymentMethodVaultingData pub fn get_card(&self) -> Option<&payment_methods::CardDetail> { match self { Self::Card(card) => Some(card), #[cfg(feature = "v2")] Self::NetworkToken(_) => None, Self::CardNumber(_) => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentMethodVaultingData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_card", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentMethodVaultingData_get_payment_methods_data
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/vault.rs // impl for PaymentMethodVaultingData pub fn get_payment_methods_data(&self) -> payment_method_data::PaymentMethodsData { match self { Self::Card(card) => payment_method_data::PaymentMethodsData::Card( payment_method_data::CardDetailsPaymentMethod::from(card.clone()), ), #[cfg(feature = "v2")] Self::NetworkToken(network_token) => { payment_method_data::PaymentMethodsData::NetworkToken( payment_method_data::NetworkTokenDetailsPaymentMethod::from( network_token.clone(), ), ) } Self::CardNumber(_card_number) => payment_method_data::PaymentMethodsData::Card( payment_method_data::CardDetailsPaymentMethod { last4_digits: None, issuer_country: None, expiry_month: None, expiry_year: None, nick_name: None, card_holder_name: None, card_isin: None, card_issuer: None, card_network: None, card_type: None, saved_to_locker: false, #[cfg(feature = "v1")] co_badged_card_data: None, }, ), } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentMethodVaultingData", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_payment_methods_data", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_AttemptAmountDetails_get_net_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for AttemptAmountDetails pub fn get_net_amount(&self) -> MinorUnit { self.net_amount }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "AttemptAmountDetails", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_net_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_AttemptAmountDetails_get_amount_to_capture
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for AttemptAmountDetails pub fn get_amount_to_capture(&self) -> Option<MinorUnit> { self.amount_to_capture }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "AttemptAmountDetails", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_amount_to_capture", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_AttemptAmountDetails_get_amount_capturable
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for AttemptAmountDetails pub fn get_amount_capturable(&self) -> MinorUnit { self.amount_capturable }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "AttemptAmountDetails", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_amount_capturable", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_AttemptAmountDetails_set_amount_to_capture
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for AttemptAmountDetails pub fn set_amount_to_capture(&mut self, amount_to_capture: MinorUnit) { self.amount_to_capture = Some(amount_to_capture); }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "AttemptAmountDetails", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "set_amount_to_capture", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_AttemptAmountDetails_validate_amount_to_capture
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for AttemptAmountDetails pub fn validate_amount_to_capture( &self, request_amount_to_capture: MinorUnit, ) -> Result<(), ValidationError> { common_utils::fp_utils::when(request_amount_to_capture > self.get_net_amount(), || { Err(ValidationError::IncorrectValueProvided { field_name: "amount_to_capture", }) }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "AttemptAmountDetails", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "validate_amount_to_capture", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_get_payment_method
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn get_payment_method(&self) -> Option<storage_enums::PaymentMethod> { // TODO: check if we can fix this Some(self.payment_method_type) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_payment_method", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_get_payment_method_type
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn get_payment_method_type(&self) -> Option<storage_enums::PaymentMethodType> { // TODO: check if we can fix this Some(self.payment_method_subtype) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_payment_method_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_hyperswitch_domain_models_PaymentAttempt_get_id
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn get_id(&self) -> &id_type::GlobalAttemptId { &self.id }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "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_hyperswitch_domain_models_PaymentAttempt_get_connector_payment_id
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn get_connector_payment_id(&self) -> Option<&str> { self.connector_payment_id.as_deref() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_connector_payment_id", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_create_domain_model
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub async fn create_domain_model( payment_intent: &super::PaymentIntent, cell_id: id_type::CellId, storage_scheme: storage_enums::MerchantStorageScheme, request: &api_models::payments::PaymentsConfirmIntentRequest, encrypted_data: DecryptedPaymentAttempt, ) -> CustomResult<Self, errors::api_error_response::ApiErrorResponse> { let id = id_type::GlobalAttemptId::generate(&cell_id); let intent_amount_details = payment_intent.amount_details.clone(); let attempt_amount_details = intent_amount_details.create_attempt_amount_details(request); let now = common_utils::date_time::now(); let payment_method_billing_address = encrypted_data .payment_method_billing_address .as_ref() .map(|data| { data.clone() .deserialize_inner_value(|value| value.parse_value("Address")) }) .transpose() .change_context(errors::api_error_response::ApiErrorResponse::InternalServerError) .attach_printable("Unable to decode billing address")?; let connector_token = Some(diesel_models::ConnectorTokenDetails { connector_mandate_id: None, connector_token_request_reference_id: Some(common_utils::generate_id_with_len( consts::CONNECTOR_MANDATE_REQUEST_REFERENCE_ID_LENGTH, )), }); let authentication_type = payment_intent.authentication_type.unwrap_or_default(); Ok(Self { payment_id: payment_intent.id.clone(), merchant_id: payment_intent.merchant_id.clone(), attempts_group_id: None, amount_details: attempt_amount_details, status: common_enums::AttemptStatus::Started, // This will be decided by the routing algorithm and updated in update trackers // right before calling the connector connector: None, authentication_type, created_at: now, modified_at: now, last_synced: None, cancellation_reason: None, browser_info: request.browser_info.clone(), payment_token: request.payment_token.clone(), connector_metadata: None, payment_experience: None, payment_method_data: None, routing_result: None, preprocessing_step_id: None, multiple_capture_count: None, connector_response_reference_id: None, updated_by: storage_scheme.to_string(), redirection_data: None, encoded_data: None, merchant_connector_id: None, external_three_ds_authentication_attempted: None, authentication_connector: None, authentication_id: None, fingerprint_id: None, charges: None, client_source: None, client_version: None, customer_acceptance: request.customer_acceptance.clone().map(Secret::new), profile_id: payment_intent.profile_id.clone(), organization_id: payment_intent.organization_id.clone(), payment_method_type: request.payment_method_type, payment_method_id: request.payment_method_id.clone(), connector_payment_id: None, payment_method_subtype: request.payment_method_subtype, authentication_applied: None, external_reference_id: None, payment_method_billing_address, error: None, connector_token_details: connector_token, id, card_discovery: None, feature_metadata: None, processor_merchant_id: payment_intent.merchant_id.clone(), created_by: None, connector_request_reference_id: None, network_transaction_id: None, authorized_amount: None, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "create_domain_model", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_proxy_create_domain_model
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub async fn proxy_create_domain_model( payment_intent: &super::PaymentIntent, cell_id: id_type::CellId, storage_scheme: storage_enums::MerchantStorageScheme, request: &api_models::payments::ProxyPaymentsRequest, encrypted_data: DecryptedPaymentAttempt, ) -> CustomResult<Self, errors::api_error_response::ApiErrorResponse> { let id = id_type::GlobalAttemptId::generate(&cell_id); let intent_amount_details = payment_intent.amount_details.clone(); let attempt_amount_details = intent_amount_details.proxy_create_attempt_amount_details(request); let now = common_utils::date_time::now(); let payment_method_billing_address = encrypted_data .payment_method_billing_address .as_ref() .map(|data| { data.clone() .deserialize_inner_value(|value| value.parse_value("Address")) }) .transpose() .change_context(errors::api_error_response::ApiErrorResponse::InternalServerError) .attach_printable("Unable to decode billing address")?; let connector_token = Some(diesel_models::ConnectorTokenDetails { connector_mandate_id: None, connector_token_request_reference_id: Some(common_utils::generate_id_with_len( consts::CONNECTOR_MANDATE_REQUEST_REFERENCE_ID_LENGTH, )), }); let payment_method_type_data = payment_intent.get_payment_method_type(); let payment_method_subtype_data = payment_intent.get_payment_method_sub_type(); let authentication_type = payment_intent.authentication_type.unwrap_or_default(); Ok(Self { payment_id: payment_intent.id.clone(), merchant_id: payment_intent.merchant_id.clone(), attempts_group_id: None, amount_details: attempt_amount_details, status: common_enums::AttemptStatus::Started, connector: Some(request.connector.clone()), authentication_type, created_at: now, modified_at: now, last_synced: None, cancellation_reason: None, browser_info: request.browser_info.clone(), payment_token: None, connector_metadata: None, payment_experience: None, payment_method_data: None, routing_result: None, preprocessing_step_id: None, multiple_capture_count: None, connector_response_reference_id: None, updated_by: storage_scheme.to_string(), redirection_data: None, encoded_data: None, merchant_connector_id: Some(request.merchant_connector_id.clone()), external_three_ds_authentication_attempted: None, authentication_connector: None, authentication_id: None, fingerprint_id: None, charges: None, client_source: None, client_version: None, customer_acceptance: None, profile_id: payment_intent.profile_id.clone(), organization_id: payment_intent.organization_id.clone(), payment_method_type: payment_method_type_data .unwrap_or(common_enums::PaymentMethod::Card), payment_method_id: None, connector_payment_id: None, payment_method_subtype: payment_method_subtype_data .unwrap_or(common_enums::PaymentMethodType::Credit), authentication_applied: None, external_reference_id: None, payment_method_billing_address, error: None, connector_token_details: connector_token, feature_metadata: None, id, card_discovery: None, processor_merchant_id: payment_intent.merchant_id.clone(), created_by: None, connector_request_reference_id: None, network_transaction_id: None, authorized_amount: None, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "proxy_create_domain_model", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_external_vault_proxy_create_domain_model
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub async fn external_vault_proxy_create_domain_model( payment_intent: &super::PaymentIntent, cell_id: id_type::CellId, storage_scheme: storage_enums::MerchantStorageScheme, request: &api_models::payments::ExternalVaultProxyPaymentsRequest, encrypted_data: DecryptedPaymentAttempt, ) -> CustomResult<Self, errors::api_error_response::ApiErrorResponse> { let id = id_type::GlobalAttemptId::generate(&cell_id); let intent_amount_details = payment_intent.amount_details.clone(); let attempt_amount_details = AttemptAmountDetails { net_amount: intent_amount_details.order_amount, amount_to_capture: None, surcharge_amount: None, tax_on_surcharge: None, amount_capturable: intent_amount_details.order_amount, shipping_cost: None, order_tax_amount: None, }; let now = common_utils::date_time::now(); let payment_method_billing_address = encrypted_data .payment_method_billing_address .as_ref() .map(|data| { data.clone() .deserialize_inner_value(|value| value.parse_value("Address")) }) .transpose() .change_context(errors::api_error_response::ApiErrorResponse::InternalServerError) .attach_printable("Unable to decode billing address")?; let connector_token = Some(diesel_models::ConnectorTokenDetails { connector_mandate_id: None, connector_token_request_reference_id: Some(common_utils::generate_id_with_len( consts::CONNECTOR_MANDATE_REQUEST_REFERENCE_ID_LENGTH, )), }); let payment_method_type_data = payment_intent.get_payment_method_type(); let payment_method_subtype_data = payment_intent.get_payment_method_sub_type(); let authentication_type = payment_intent.authentication_type.unwrap_or_default(); Ok(Self { payment_id: payment_intent.id.clone(), merchant_id: payment_intent.merchant_id.clone(), attempts_group_id: None, amount_details: attempt_amount_details, status: common_enums::AttemptStatus::Started, connector: None, authentication_type, created_at: now, modified_at: now, last_synced: None, cancellation_reason: None, browser_info: request.browser_info.clone(), payment_token: request.payment_token.clone(), connector_metadata: None, payment_experience: None, payment_method_data: None, routing_result: None, preprocessing_step_id: None, multiple_capture_count: None, connector_response_reference_id: None, updated_by: storage_scheme.to_string(), redirection_data: None, encoded_data: None, merchant_connector_id: None, external_three_ds_authentication_attempted: None, authentication_connector: None, authentication_id: None, fingerprint_id: None, charges: None, client_source: None, client_version: None, customer_acceptance: request.customer_acceptance.clone().map(Secret::new), profile_id: payment_intent.profile_id.clone(), organization_id: payment_intent.organization_id.clone(), payment_method_type: payment_method_type_data .unwrap_or(common_enums::PaymentMethod::Card), payment_method_id: request.payment_method_id.clone(), connector_payment_id: None, payment_method_subtype: payment_method_subtype_data .unwrap_or(common_enums::PaymentMethodType::Credit), authentication_applied: None, external_reference_id: None, payment_method_billing_address, error: None, connector_token_details: connector_token, feature_metadata: None, id, card_discovery: None, processor_merchant_id: payment_intent.merchant_id.clone(), created_by: None, connector_request_reference_id: None, network_transaction_id: None, authorized_amount: None, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "external_vault_proxy_create_domain_model", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_create_domain_model_using_record_request
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub async fn create_domain_model_using_record_request( payment_intent: &super::PaymentIntent, cell_id: id_type::CellId, storage_scheme: storage_enums::MerchantStorageScheme, request: &api_models::payments::PaymentsAttemptRecordRequest, encrypted_data: DecryptedPaymentAttempt, ) -> CustomResult<Self, errors::api_error_response::ApiErrorResponse> { let id = id_type::GlobalAttemptId::generate(&cell_id); let amount_details = AttemptAmountDetailsSetter::from(&request.amount_details); let now = common_utils::date_time::now(); // we consume transaction_created_at from webhook request, if it is not present we take store current time as transaction_created_at. let transaction_created_at = request .transaction_created_at .unwrap_or(common_utils::date_time::now()); // This function is called in the record attempt flow, which tells us that this is a payment attempt created by an external system. let feature_metadata = PaymentAttemptFeatureMetadata { revenue_recovery: Some({ PaymentAttemptRevenueRecoveryData { attempt_triggered_by: request.triggered_by, charge_id: request.feature_metadata.as_ref().and_then(|metadata| { metadata .revenue_recovery .as_ref() .and_then(|data| data.charge_id.clone()) }), } }), }; let payment_method_data = request .payment_method_data .as_ref() .map(|data| data.payment_method_data.clone().encode_to_value()) .transpose() .change_context(errors::api_error_response::ApiErrorResponse::InternalServerError) .attach_printable("Unable to decode additional payment method data")? .map(pii::SecretSerdeValue::new); let payment_method_billing_address = encrypted_data .payment_method_billing_address .as_ref() .map(|data| { data.clone() .deserialize_inner_value(|value| value.parse_value("Address")) }) .transpose() .change_context(errors::api_error_response::ApiErrorResponse::InternalServerError) .attach_printable("Unable to decode billing address")?; let error = request.error.as_ref().map(ErrorDetails::from); let connector_payment_id = request .connector_transaction_id .as_ref() .map(|txn_id| txn_id.get_id().clone()); let connector = request.connector.map(|connector| connector.to_string()); let connector_request_reference_id = payment_intent .merchant_reference_id .as_ref() .map(|id| id.get_string_repr().to_owned()); Ok(Self { payment_id: payment_intent.id.clone(), merchant_id: payment_intent.merchant_id.clone(), attempts_group_id: None, amount_details: AttemptAmountDetails::from(amount_details), status: request.status, connector, authentication_type: storage_enums::AuthenticationType::NoThreeDs, created_at: transaction_created_at, modified_at: now, last_synced: None, cancellation_reason: None, browser_info: None, payment_token: None, connector_metadata: None, payment_experience: None, payment_method_data, routing_result: None, preprocessing_step_id: None, multiple_capture_count: None, connector_response_reference_id: None, updated_by: storage_scheme.to_string(), redirection_data: None, encoded_data: None, merchant_connector_id: request.payment_merchant_connector_id.clone(), external_three_ds_authentication_attempted: None, authentication_connector: None, authentication_id: None, fingerprint_id: None, client_source: None, client_version: None, customer_acceptance: None, profile_id: payment_intent.profile_id.clone(), organization_id: payment_intent.organization_id.clone(), payment_method_type: request.payment_method_type, payment_method_id: None, connector_payment_id, payment_method_subtype: request.payment_method_subtype, authentication_applied: None, external_reference_id: None, payment_method_billing_address, error, feature_metadata: Some(feature_metadata), id, connector_token_details: Some(diesel_models::ConnectorTokenDetails { connector_mandate_id: Some(request.processor_payment_method_token.clone()), connector_token_request_reference_id: None, }), card_discovery: None, charges: None, processor_merchant_id: payment_intent.merchant_id.clone(), created_by: None, connector_request_reference_id, network_transaction_id: None, authorized_amount: None, }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "create_domain_model_using_record_request", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_get_attempt_merchant_connector_account_id
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn get_attempt_merchant_connector_account_id( &self, ) -> CustomResult< id_type::MerchantConnectorAccountId, errors::api_error_response::ApiErrorResponse, > { let merchant_connector_id = self .merchant_connector_id .clone() .get_required_value("merchant_connector_id") .change_context(errors::api_error_response::ApiErrorResponse::InternalServerError) .attach_printable("Merchant connector id is None")?; Ok(merchant_connector_id) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_attempt_merchant_connector_account_id", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_get_surcharge_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn get_surcharge_amount(&self) -> Option<MinorUnit> { self.surcharge_amount }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_surcharge_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_get_tax_on_surcharge
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn get_tax_on_surcharge(&self) -> Option<MinorUnit> { self.tax_on_surcharge }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_tax_on_surcharge", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_get_shipping_cost
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn get_shipping_cost(&self) -> Option<MinorUnit> { self.shipping_cost }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_shipping_cost", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_get_order_tax_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn get_order_tax_amount(&self) -> Option<MinorUnit> { self.order_tax_amount }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_order_tax_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_new
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn new( order_amount: MinorUnit, shipping_cost: Option<MinorUnit>, order_tax_amount: Option<MinorUnit>, surcharge_amount: Option<MinorUnit>, tax_on_surcharge: Option<MinorUnit>, ) -> Self { Self { order_amount, shipping_cost, order_tax_amount, surcharge_amount, tax_on_surcharge, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "new", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_get_order_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn get_order_amount(&self) -> MinorUnit { self.order_amount }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_order_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_get_additional_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn get_additional_amount(&self) -> MinorUnit { self.get_total_amount() - self.get_order_amount() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_additional_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_set_order_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn set_order_amount(&mut self, order_amount: MinorUnit) { self.order_amount = order_amount; }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "set_order_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_set_order_tax_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn set_order_tax_amount(&mut self, order_tax_amount: Option<MinorUnit>) { self.order_tax_amount = order_tax_amount; }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "set_order_tax_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_set_surcharge_details
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn set_surcharge_details( &mut self, surcharge_details: Option<router_request_types::SurchargeDetails>, ) { self.surcharge_amount = surcharge_details .clone() .map(|details| details.surcharge_amount); self.tax_on_surcharge = surcharge_details.map(|details| details.tax_on_surcharge_amount); }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "set_surcharge_details", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_from_payments_request
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn from_payments_request( payments_request: &api_models::payments::PaymentsRequest, order_amount: MinorUnit, ) -> Self { let surcharge_amount = payments_request .surcharge_details .map(|surcharge_details| surcharge_details.surcharge_amount); let tax_on_surcharge = payments_request .surcharge_details .and_then(|surcharge_details| surcharge_details.tax_amount); Self { order_amount, shipping_cost: payments_request.shipping_cost, order_tax_amount: payments_request.order_tax_amount, surcharge_amount, tax_on_surcharge, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "from_payments_request", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_NetAmount_from_payments_request_and_payment_attempt
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for NetAmount pub fn from_payments_request_and_payment_attempt( payments_request: &api_models::payments::PaymentsRequest, payment_attempt: Option<&PaymentAttempt>, ) -> Option<Self> { let option_order_amount = payments_request .amount .map(MinorUnit::from) .or(payment_attempt .map(|payment_attempt| payment_attempt.net_amount.get_order_amount())); option_order_amount.map(|order_amount| { let shipping_cost = payments_request.shipping_cost.or(payment_attempt .and_then(|payment_attempt| payment_attempt.net_amount.get_shipping_cost())); let order_tax_amount = payment_attempt .and_then(|payment_attempt| payment_attempt.net_amount.get_order_tax_amount()); let surcharge_amount = payments_request .surcharge_details .map(|surcharge_details| surcharge_details.get_surcharge_amount()) .or_else(|| { payment_attempt.and_then(|payment_attempt| { payment_attempt.net_amount.get_surcharge_amount() }) }); let tax_on_surcharge = payments_request .surcharge_details .and_then(|surcharge_details| surcharge_details.get_tax_amount()) .or_else(|| { payment_attempt.and_then(|payment_attempt| { payment_attempt.net_amount.get_tax_on_surcharge() }) }); Self { order_amount, shipping_cost, order_tax_amount, surcharge_amount, tax_on_surcharge, } }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "NetAmount", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "from_payments_request_and_payment_attempt", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_get_total_surcharge_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn get_total_surcharge_amount(&self) -> Option<MinorUnit> { self.net_amount.get_total_surcharge_amount() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_total_surcharge_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_get_total_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn get_total_amount(&self) -> MinorUnit { self.net_amount.get_total_amount() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_total_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_extract_card_network
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn extract_card_network(&self) -> Option<common_enums::CardNetwork> { self.payment_method_data .as_ref() .and_then(|value| { value .clone() .parse_value::<api_models::payments::AdditionalPaymentData>( "AdditionalPaymentData", ) .ok() }) .and_then(|data| data.get_additional_card_info()) .and_then(|card_info| card_info.card_network) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "extract_card_network", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_get_total_surcharge_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn get_total_surcharge_amount(&self) -> Option<MinorUnit> { self.net_amount.get_total_surcharge_amount() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_total_surcharge_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_get_total_amount
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn get_total_amount(&self) -> MinorUnit { self.net_amount.get_total_amount() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_total_amount", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_extract_card_network
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn extract_card_network(&self) -> Option<common_enums::CardNetwork> { self.payment_method_data .as_ref() .and_then(|value| { value .clone() .parse_value::<api_models::payments::AdditionalPaymentData>( "AdditionalPaymentData", ) .ok() }) .and_then(|data| data.get_additional_card_info()) .and_then(|card_info| card_info.card_network) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "extract_card_network", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_set_debit_routing_savings
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn set_debit_routing_savings(&mut self, debit_routing_savings: Option<&MinorUnit>) { self.debit_routing_savings = debit_routing_savings.copied(); }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "set_debit_routing_savings", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttempt_get_payment_method_data
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttempt pub fn get_payment_method_data(&self) -> Option<api_models::payments::AdditionalPaymentData> { self.payment_method_data .clone() .and_then(|data| match data { serde_json::Value::Null => None, _ => Some(data.parse_value("AdditionalPaymentData")), }) .transpose() .map_err(|err| logger::error!("Failed to parse AdditionalPaymentData {err:?}")) .ok() .flatten() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttempt", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_payment_method_data", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttemptUpdate_to_storage_model
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttemptUpdate pub fn to_storage_model(self) -> diesel_models::PaymentAttemptUpdate { match self { Self::Update { net_amount, currency, status, authentication_type, payment_method, payment_token, payment_method_data, payment_method_type, payment_experience, business_sub_label, amount_to_capture, capture_method, fingerprint_id, network_transaction_id, payment_method_billing_address_id, updated_by, } => DieselPaymentAttemptUpdate::Update { amount: net_amount.get_order_amount(), currency, status, authentication_type, payment_method, payment_token, payment_method_data, payment_method_type, payment_experience, business_sub_label, amount_to_capture, capture_method, surcharge_amount: net_amount.get_surcharge_amount(), tax_amount: net_amount.get_tax_on_surcharge(), fingerprint_id, payment_method_billing_address_id, network_transaction_id, updated_by, }, Self::UpdateTrackers { payment_token, connector, straight_through_algorithm, amount_capturable, updated_by, surcharge_amount, tax_amount, merchant_connector_id, routing_approach, is_stored_credential, } => DieselPaymentAttemptUpdate::UpdateTrackers { payment_token, connector, straight_through_algorithm, amount_capturable, surcharge_amount, tax_amount, updated_by, merchant_connector_id, routing_approach: routing_approach.map(|approach| match approach { storage_enums::RoutingApproach::Other(_) => { // we need to make sure Other variant is not stored in DB, in the rare case // where we attempt to store an unknown value, we default to the default value storage_enums::RoutingApproach::default() } _ => approach, }), is_stored_credential, }, Self::AuthenticationTypeUpdate { authentication_type, updated_by, } => DieselPaymentAttemptUpdate::AuthenticationTypeUpdate { authentication_type, updated_by, }, Self::BlocklistUpdate { status, error_code, error_message, updated_by, } => DieselPaymentAttemptUpdate::BlocklistUpdate { status, error_code, error_message, updated_by, }, Self::ConnectorMandateDetailUpdate { connector_mandate_detail, updated_by, } => DieselPaymentAttemptUpdate::ConnectorMandateDetailUpdate { connector_mandate_detail, updated_by, }, Self::PaymentMethodDetailsUpdate { payment_method_id, updated_by, } => DieselPaymentAttemptUpdate::PaymentMethodDetailsUpdate { payment_method_id, updated_by, }, Self::ConfirmUpdate { net_amount, currency, status, authentication_type, capture_method, payment_method, browser_info, connector, payment_token, payment_method_data, payment_method_type, payment_experience, business_sub_label, straight_through_algorithm, error_code, error_message, fingerprint_id, updated_by, merchant_connector_id: connector_id, payment_method_id, external_three_ds_authentication_attempted, authentication_connector, authentication_id, payment_method_billing_address_id, client_source, client_version, customer_acceptance, connector_mandate_detail, card_discovery, routing_approach, connector_request_reference_id, network_transaction_id, is_stored_credential, request_extended_authorization, } => DieselPaymentAttemptUpdate::ConfirmUpdate { amount: net_amount.get_order_amount(), currency, status, authentication_type, capture_method, payment_method, browser_info, connector, payment_token, payment_method_data, payment_method_type, payment_experience, business_sub_label, straight_through_algorithm, error_code, error_message, surcharge_amount: net_amount.get_surcharge_amount(), tax_amount: net_amount.get_tax_on_surcharge(), fingerprint_id, updated_by, merchant_connector_id: connector_id, payment_method_id, external_three_ds_authentication_attempted, authentication_connector, authentication_id, payment_method_billing_address_id, client_source, client_version, customer_acceptance, shipping_cost: net_amount.get_shipping_cost(), order_tax_amount: net_amount.get_order_tax_amount(), connector_mandate_detail, card_discovery, routing_approach: routing_approach.map(|approach| match approach { // we need to make sure Other variant is not stored in DB, in the rare case // where we attempt to store an unknown value, we default to the default value storage_enums::RoutingApproach::Other(_) => { storage_enums::RoutingApproach::default() } _ => approach, }), connector_request_reference_id, network_transaction_id, is_stored_credential, request_extended_authorization, }, Self::VoidUpdate { status, cancellation_reason, updated_by, } => DieselPaymentAttemptUpdate::VoidUpdate { status, cancellation_reason, updated_by, }, Self::ResponseUpdate { status, connector, connector_transaction_id, authentication_type, payment_method_id, mandate_id, connector_metadata, payment_token, error_code, error_message, error_reason, connector_response_reference_id, amount_capturable, updated_by, authentication_data, encoded_data, unified_code, unified_message, capture_before, extended_authorization_applied, payment_method_data, connector_mandate_detail, charges, setup_future_usage_applied, network_transaction_id, debit_routing_savings: _, is_overcapture_enabled, authorized_amount, } => DieselPaymentAttemptUpdate::ResponseUpdate { status, connector, connector_transaction_id, authentication_type, payment_method_id, mandate_id, connector_metadata, payment_token, error_code, error_message, error_reason, connector_response_reference_id, amount_capturable, updated_by, authentication_data, encoded_data, unified_code, unified_message, capture_before, extended_authorization_applied, payment_method_data, connector_mandate_detail, charges, setup_future_usage_applied, network_transaction_id, is_overcapture_enabled, authorized_amount, }, Self::UnresolvedResponseUpdate { status, connector, connector_transaction_id, payment_method_id, error_code, error_message, error_reason, connector_response_reference_id, updated_by, } => DieselPaymentAttemptUpdate::UnresolvedResponseUpdate { status, connector, connector_transaction_id, payment_method_id, error_code, error_message, error_reason, connector_response_reference_id, updated_by, }, Self::StatusUpdate { status, updated_by } => { DieselPaymentAttemptUpdate::StatusUpdate { status, updated_by } } Self::ErrorUpdate { connector, status, error_code, error_message, error_reason, amount_capturable, updated_by, unified_code, unified_message, connector_transaction_id, payment_method_data, authentication_type, issuer_error_code, issuer_error_message, network_details, } => DieselPaymentAttemptUpdate::ErrorUpdate { connector, status, error_code, error_message, error_reason, amount_capturable, updated_by, unified_code, unified_message, connector_transaction_id, payment_method_data, authentication_type, issuer_error_code, issuer_error_message, network_details, }, Self::CaptureUpdate { multiple_capture_count, updated_by, amount_to_capture, } => DieselPaymentAttemptUpdate::CaptureUpdate { multiple_capture_count, updated_by, amount_to_capture, }, Self::PreprocessingUpdate { status, payment_method_id, connector_metadata, preprocessing_step_id, connector_transaction_id, connector_response_reference_id, updated_by, } => DieselPaymentAttemptUpdate::PreprocessingUpdate { status, payment_method_id, connector_metadata, preprocessing_step_id, connector_transaction_id, connector_response_reference_id, updated_by, }, Self::RejectUpdate { status, error_code, error_message, updated_by, } => DieselPaymentAttemptUpdate::RejectUpdate { status, error_code, error_message, updated_by, }, Self::AmountToCaptureUpdate { status, amount_capturable, updated_by, } => DieselPaymentAttemptUpdate::AmountToCaptureUpdate { status, amount_capturable, updated_by, }, Self::ConnectorResponse { authentication_data, encoded_data, connector_transaction_id, connector, charges, updated_by, } => DieselPaymentAttemptUpdate::ConnectorResponse { authentication_data, encoded_data, connector_transaction_id, charges, connector, updated_by, }, Self::IncrementalAuthorizationAmountUpdate { net_amount, amount_capturable, } => DieselPaymentAttemptUpdate::IncrementalAuthorizationAmountUpdate { amount: net_amount.get_order_amount(), amount_capturable, }, Self::AuthenticationUpdate { status, external_three_ds_authentication_attempted, authentication_connector, authentication_id, updated_by, } => DieselPaymentAttemptUpdate::AuthenticationUpdate { status, external_three_ds_authentication_attempted, authentication_connector, authentication_id, updated_by, }, Self::ManualUpdate { status, error_code, error_message, error_reason, updated_by, unified_code, unified_message, connector_transaction_id, } => DieselPaymentAttemptUpdate::ManualUpdate { status, error_code, error_message, error_reason, updated_by, unified_code, unified_message, connector_transaction_id, }, Self::PostSessionTokensUpdate { updated_by, connector_metadata, } => DieselPaymentAttemptUpdate::PostSessionTokensUpdate { updated_by, connector_metadata, }, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttemptUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "to_storage_model", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentAttemptUpdate_get_debit_routing_savings
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs // impl for PaymentAttemptUpdate pub fn get_debit_routing_savings(&self) -> Option<&MinorUnit> { match self { Self::ResponseUpdate { debit_routing_savings, .. } => debit_routing_savings.as_ref(), Self::Update { .. } | Self::UpdateTrackers { .. } | Self::AuthenticationTypeUpdate { .. } | Self::ConfirmUpdate { .. } | Self::RejectUpdate { .. } | Self::BlocklistUpdate { .. } | Self::PaymentMethodDetailsUpdate { .. } | Self::ConnectorMandateDetailUpdate { .. } | Self::VoidUpdate { .. } | Self::UnresolvedResponseUpdate { .. } | Self::StatusUpdate { .. } | Self::ErrorUpdate { .. } | Self::CaptureUpdate { .. } | Self::AmountToCaptureUpdate { .. } | Self::PreprocessingUpdate { .. } | Self::ConnectorResponse { .. } | Self::IncrementalAuthorizationAmountUpdate { .. } | Self::AuthenticationUpdate { .. } | Self::ManualUpdate { .. } | Self::PostSessionTokensUpdate { .. } => None, } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentAttemptUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_debit_routing_savings", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentIntentUpdate_is_confirm_operation
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_intent.rs // impl for PaymentIntentUpdate pub fn is_confirm_operation(&self) -> bool { matches!(self, Self::ConfirmIntent { .. }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentIntentUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "is_confirm_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_hyperswitch_domain_models_PaymentIntentUpdate_is_confirm_operation
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_intent.rs // impl for PaymentIntentUpdate pub fn is_confirm_operation(&self) -> bool { matches!(self, Self::ConfirmIntent { .. }) }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentIntentUpdate", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "is_confirm_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_hyperswitch_domain_models_PaymentIntentFetchConstraints_get_profile_id_list
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_intent.rs // impl for PaymentIntentFetchConstraints pub fn get_profile_id_list(&self) -> Option<Vec<id_type::ProfileId>> { if let Self::List(pi_list_params) = self { pi_list_params.profile_id.clone() } else { None } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentIntentFetchConstraints", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_profile_id_list", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_PaymentIntentFetchConstraints_get_profile_id
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/payments/payment_intent.rs // impl for PaymentIntentFetchConstraints pub fn get_profile_id(&self) -> Option<id_type::ProfileId> { let Self::List(pi_list_params) = self; pi_list_params.profile_id.clone() }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "PaymentIntentFetchConstraints", "function_name": null, "is_async": null, "is_pub": null, "lines": null, "method_name": "get_profile_id", "num_enums": null, "num_items": null, "num_structs": null, "repo": "hyperswitch", "start_line": null, "struct_name": null, "total_crates": null, "trait_name": null }
hyperswitch_method_hyperswitch_domain_models_GetSubscriptionPlansRequest_new
clm
method
// hyperswitch/crates/hyperswitch_domain_models/src/router_request_types/subscriptions.rs // impl for GetSubscriptionPlansRequest pub fn new(limit: Option<u32>, offset: Option<u32>) -> Self { Self { limit, offset } }
{ "chunk": null, "crate": "hyperswitch_domain_models", "enum_name": null, "file_size": null, "for_type": "GetSubscriptionPlansRequest", "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 }