id stringlengths 20 153 | type stringclasses 1
value | granularity stringclasses 14
values | content stringlengths 16 84.3k | metadata dict |
|---|---|---|---|---|
hyperswitch_method_common_utils_GlobalPaymentMethodId_generate | clm | method | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
// impl for GlobalPaymentMethodId
pub fn generate(cell_id: &CellId) -> error_stack::Result<Self, GlobalPaymentMethodIdError> {
let global_id = GlobalId::generate(cell_id, GlobalEntity::PaymentMethod);
Ok(Self(global_id))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": "GlobalPaymentMethodId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_common_utils_GlobalPaymentMethodId_get_string_repr | clm | method | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
// impl for GlobalPaymentMethodId
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": "GlobalPaymentMethodId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_string_repr",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_common_utils_GlobalPaymentMethodId_generate_from_string | clm | method | // hyperswitch/crates/common_utils/src/id_type/global_id/payment_methods.rs
// impl for GlobalPaymentMethodId
pub fn generate_from_string(value: String) -> CustomResult<Self, GlobalPaymentMethodIdError> {
let id = GlobalId::from_string(value.into())
.change_context(GlobalPaymentMethodIdError::ConstructionError)?;
Ok(Self(id))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": "GlobalPaymentMethodId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate_from_string",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_common_utils_GlobalRefundId_get_string_repr | clm | method | // hyperswitch/crates/common_utils/src/id_type/global_id/refunds.rs
// impl for GlobalRefundId
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": "GlobalRefundId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_string_repr",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_common_utils_GlobalRefundId_generate | clm | method | // hyperswitch/crates/common_utils/src/id_type/global_id/refunds.rs
// impl for GlobalRefundId
pub fn generate(cell_id: &crate::id_type::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Refund);
Self(global_id)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": "GlobalRefundId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_common_utils_GlobalTokenId_get_string_repr | clm | method | // hyperswitch/crates/common_utils/src/id_type/global_id/token.rs
// impl for GlobalTokenId
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": "GlobalTokenId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_string_repr",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_common_utils_GlobalTokenId_from_string | clm | method | // hyperswitch/crates/common_utils/src/id_type/global_id/token.rs
// impl for GlobalTokenId
pub fn from_string(token_string: &str) -> CustomResult<Self, ValidationError> {
let token = super::GlobalId::from_string(Cow::Owned(token_string.to_string()))
.change_context(ValidationError::IncorrectValueProvided {
field_name: "GlobalTokenId",
})?;
Ok(Self(token))
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": "GlobalTokenId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "from_string",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_common_utils_GlobalTokenId_generate | clm | method | // hyperswitch/crates/common_utils/src/id_type/global_id/token.rs
// impl for GlobalTokenId
pub fn generate(cell_id: &crate::id_type::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Token);
Self(global_id)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": "GlobalTokenId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_common_utils_GlobalCustomerId_get_string_repr | clm | method | // hyperswitch/crates/common_utils/src/id_type/global_id/customer.rs
// impl for GlobalCustomerId
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": "GlobalCustomerId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_string_repr",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_common_utils_GlobalCustomerId_generate | clm | method | // hyperswitch/crates/common_utils/src/id_type/global_id/customer.rs
// impl for GlobalCustomerId
pub fn generate(cell_id: &crate::id_type::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Customer);
Self(global_id)
}
| {
"chunk": null,
"crate": "common_utils",
"enum_name": null,
"file_size": null,
"for_type": "GlobalCustomerId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate",
"num_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_Tokenization_is_disabled | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/tokenization.rs
// impl for Tokenization
pub fn is_disabled(&self) -> bool {
self.flag == common_enums::TokenizationFlag::Disabled
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "Tokenization",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_disabled",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_ResponseId_get_connector_transaction_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/router_request_types.rs
// impl for ResponseId
pub fn get_connector_transaction_id(
&self,
) -> errors::CustomResult<String, errors::ValidationError> {
match self {
Self::ConnectorTransactionId(txn_id) => Ok(txn_id.to_string()),
_ => Err(errors::ValidationError::IncorrectValueProvided {
field_name: "connector_transaction_id",
})
.attach_printable("Expected connector transaction ID not found"),
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "ResponseId",
"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_SurchargeDetails_get_total_surcharge_amount | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/router_request_types.rs
// impl for SurchargeDetails
pub fn get_total_surcharge_amount(&self) -> MinorUnit {
self.surcharge_amount + self.tax_on_surcharge_amount
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "SurchargeDetails",
"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_CallbackMapper_new | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/callback_mapper.rs
// impl for CallbackMapper
pub fn new(
id: String,
callback_mapper_id_type: common_enums::CallbackMapperIdType,
data: CallbackMapperData,
created_at: time::PrimitiveDateTime,
last_modified_at: time::PrimitiveDateTime,
) -> Self {
Self {
id,
callback_mapper_id_type,
data,
created_at,
last_modified_at,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "CallbackMapper",
"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_VaultId_get_string_repr | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for VaultId
pub fn get_string_repr(&self) -> &String {
&self.0
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "VaultId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_string_repr",
"num_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_VaultId_generate | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for VaultId
pub fn generate(id: String) -> Self {
Self(id)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "VaultId",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate",
"num_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_PaymentMethod_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for PaymentMethod
pub fn get_id(&self) -> &id_type::GlobalPaymentMethodId {
&self.id
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_PaymentMethod_get_payment_methods_data | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for PaymentMethod
pub fn get_payment_methods_data(
&self,
) -> Option<domain_payment_method_data::PaymentMethodsData> {
self.payment_method_data
.clone()
.map(|value| value.into_inner().expose())
.and_then(|value| {
serde_json::from_value::<domain_payment_method_data::PaymentMethodsData>(value)
.map_err(|error| {
logger::warn!(
?error,
"Failed to parse payment method data in payment method info"
);
})
.ok()
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethod",
"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_PaymentMethod_get_payment_method_type | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for PaymentMethod
pub fn get_payment_method_type(&self) -> Option<storage_enums::PaymentMethod> {
self.payment_method_type
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethod",
"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_PaymentMethod_get_payment_method_subtype | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for PaymentMethod
pub fn get_payment_method_subtype(&self) -> Option<storage_enums::PaymentMethodType> {
self.payment_method_subtype
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_method_subtype",
"num_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_PaymentMethod_get_common_mandate_reference | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for PaymentMethod
pub fn get_common_mandate_reference(&self) -> Result<CommonMandateReference, ParsingError> {
if let Some(value) = &self.connector_mandate_details {
Ok(value.clone())
} else {
Ok(CommonMandateReference {
payments: None,
payouts: None,
})
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_common_mandate_reference",
"num_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_PaymentMethod_set_payment_method_type | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for PaymentMethod
pub fn set_payment_method_type(&mut self, payment_method_type: common_enums::PaymentMethod) {
self.payment_method_type = Some(payment_method_type);
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_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_PaymentMethod_set_payment_method_subtype | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for PaymentMethod
pub fn set_payment_method_subtype(
&mut self,
payment_method_subtype: common_enums::PaymentMethodType,
) {
self.payment_method_subtype = Some(payment_method_subtype);
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_payment_method_subtype",
"num_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_PaymentMethodSession_apply_changeset | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_methods.rs
// impl for PaymentMethodSession
pub fn apply_changeset(self, update_session: PaymentMethodsSessionUpdateInternal) -> Self {
let Self {
id,
customer_id,
billing,
psp_tokenization,
network_tokenization,
tokenization_data,
expires_at,
return_url,
associated_payment_methods,
associated_payment,
associated_token_id,
} = self;
Self {
id,
customer_id,
billing: update_session.billing.or(billing),
psp_tokenization: update_session.psp_tokenization.or(psp_tokenization),
network_tokenization: update_session.network_tokenization.or(network_tokenization),
tokenization_data: update_session.tokenization_data.or(tokenization_data),
expires_at,
return_url,
associated_payment_methods: update_session
.associated_payment_methods
.or(associated_payment_methods),
associated_payment,
associated_token_id,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethodSession",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_PaymentMethodSession_apply_changeset | clm | method | // hyperswitch/crates/diesel_models/src/payment_methods_session.rs
// impl for PaymentMethodSession
pub fn apply_changeset(self, update_session: PaymentMethodsSessionUpdateInternal) -> Self {
let Self {
id,
customer_id,
billing,
psp_tokenization,
network_tokenization,
tokenization_data,
expires_at,
return_url,
associated_payment_methods,
associated_payment,
associated_token_id,
} = self;
Self {
id,
customer_id,
billing: update_session.billing.or(billing),
psp_tokenization: update_session.psp_tokenization.or(psp_tokenization),
network_tokenization: update_session.network_tokenization.or(network_tokenization),
tokenization_data: update_session.tokenzation_data.or(tokenization_data),
expires_at,
return_url,
associated_payment_methods,
associated_payment,
associated_token_id,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentMethodSession",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "apply_changeset",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_PaymentAddress_new | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
// impl for PaymentAddress
pub fn new(
shipping: Option<Address>,
billing: Option<Address>,
payment_method_billing: Option<Address>,
should_unify_address: Option<bool>,
) -> Self {
// billing -> .billing, this is the billing details passed in the root of payments request
// payment_method_billing -> .payment_method_data.billing
let unified_payment_method_billing = if should_unify_address.unwrap_or(true) {
// Merge the billing details field from both `payment.billing` and `payment.payment_method_data.billing`
// The unified payment_method_billing will be used as billing address and passed to the connector module
// This unification is required in order to provide backwards compatibility
// so that if `payment.billing` is passed it should be sent to the connector module
// Unify the billing details with `payment_method_data.billing`
payment_method_billing
.as_ref()
.map(|payment_method_billing| {
payment_method_billing
.clone()
.unify_address(billing.as_ref())
})
.or(billing.clone())
} else {
payment_method_billing.clone()
};
Self {
shipping,
billing,
unified_payment_method_billing,
payment_method_billing,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAddress",
"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_PaymentAddress_get_shipping | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
// impl for PaymentAddress
pub fn get_shipping(&self) -> Option<&Address> {
self.shipping.as_ref()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAddress",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_shipping",
"num_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_PaymentAddress_get_payment_method_billing | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
// impl for PaymentAddress
pub fn get_payment_method_billing(&self) -> Option<&Address> {
self.unified_payment_method_billing.as_ref()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAddress",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_method_billing",
"num_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_PaymentAddress_unify_with_payment_method_data_billing | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
// impl for PaymentAddress
pub fn unify_with_payment_method_data_billing(
self,
payment_method_data_billing: Option<Address>,
) -> Self {
// Unify the billing details with `payment_method_data.billing_details`
let unified_payment_method_billing = payment_method_data_billing
.map(|payment_method_data_billing| {
payment_method_data_billing.unify_address(self.get_payment_method_billing())
})
.or(self.get_payment_method_billing().cloned());
Self {
shipping: self.shipping,
billing: self.billing,
unified_payment_method_billing,
payment_method_billing: self.payment_method_billing,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAddress",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "unify_with_payment_method_data_billing",
"num_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_PaymentAddress_unify_with_payment_data_billing | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
// impl for PaymentAddress
pub fn unify_with_payment_data_billing(
self,
other_payment_method_billing: Option<Address>,
) -> Self {
let unified_payment_method_billing = self
.get_payment_method_billing()
.map(|payment_method_billing| {
payment_method_billing
.clone()
.unify_address(other_payment_method_billing.as_ref())
})
.or(other_payment_method_billing);
Self {
shipping: self.shipping,
billing: self.billing,
unified_payment_method_billing,
payment_method_billing: self.payment_method_billing,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAddress",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "unify_with_payment_data_billing",
"num_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_PaymentAddress_get_request_payment_method_billing | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
// impl for PaymentAddress
pub fn get_request_payment_method_billing(&self) -> Option<&Address> {
self.payment_method_billing.as_ref()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAddress",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_request_payment_method_billing",
"num_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_PaymentAddress_get_payment_billing | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payment_address.rs
// impl for PaymentAddress
pub fn get_payment_billing(&self) -> Option<&Address> {
self.billing.as_ref()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAddress",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_billing",
"num_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_MerchantAccount_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
// impl for MerchantAccount
pub fn get_id(&self) -> &common_utils::id_type::MerchantId {
&self.id
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantAccount_get_org_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
// impl for MerchantAccount
pub fn get_org_id(&self) -> &common_utils::id_type::OrganizationId {
&self.organization_id
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_org_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_MerchantAccount_get_merchant_details | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
// impl for MerchantAccount
pub fn get_merchant_details(&self) -> &OptionalEncryptableValue {
&self.merchant_details
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_merchant_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_MerchantAccount_get_merchant_tax_registration_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
// impl for MerchantAccount
pub fn get_merchant_tax_registration_id(&self) -> Option<Secret<String>> {
self.merchant_details.as_ref().and_then(|details| {
details
.get_inner()
.peek()
.get("merchant_tax_registration_id")
.and_then(|id| id.as_str().map(|s| Secret::new(s.to_string())))
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_merchant_tax_registration_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_MerchantAccount_is_platform_account | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
// impl for MerchantAccount
pub fn is_platform_account(&self) -> bool {
matches!(
self.merchant_account_type,
common_enums::MerchantAccountType::Platform
)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_platform_account",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantAccount_get_id | clm | method | // hyperswitch/crates/diesel_models/src/merchant_account.rs
// impl for MerchantAccount
pub fn get_id(&self) -> &common_utils::id_type::MerchantId {
&self.id
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantAccount_get_compatible_connector | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_account.rs
// impl for MerchantAccount
pub fn get_compatible_connector(&self) -> Option<api_models::enums::Connector> {
let metadata: Option<api_models::admin::MerchantAccountMetadata> =
self.metadata.as_ref().and_then(|meta| {
meta.clone()
.parse_value("MerchantAccountMetadata")
.map_err(|err| logger::error!("Failed to deserialize {:?}", err))
.ok()
});
metadata.and_then(|a| a.compatible_connector)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_compatible_connector",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantConnectorAccount_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.id.clone()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantConnectorAccount_get_connector_account_details | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_connector_account_details(
&self,
) -> error_stack::Result<router_data::ConnectorAuthType, common_utils::errors::ParsingError>
{
use common_utils::ext_traits::ValueExt;
self.connector_account_details
.get_inner()
.clone()
.parse_value("ConnectorAuthType")
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_account_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_MerchantConnectorAccount_get_connector_wallets_details | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_connector_wallets_details(&self) -> Option<Secret<Value>> {
self.connector_wallets_details.as_deref().cloned()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_wallets_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_MerchantConnectorAccount_get_connector_test_mode | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_connector_test_mode(&self) -> Option<bool> {
todo!()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_test_mode",
"num_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_MerchantConnectorAccount_get_connector_name_as_string | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_connector_name_as_string(&self) -> String {
self.connector_name.clone().to_string()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_name_as_string",
"num_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_MerchantConnectorAccount_get_metadata | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
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": "MerchantConnectorAccount",
"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_MerchantConnectorAccount_get_id | clm | method | // hyperswitch/crates/diesel_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.id.clone()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantConnectorAccountTypeDetails_get_mca_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccountTypeDetails
pub fn get_mca_id(&self) -> Option<id_type::MerchantConnectorAccountId> {
match self {
Self::MerchantConnectorAccount(merchant_connector_account) => {
Some(merchant_connector_account.get_id())
}
Self::MerchantConnectorDetails(_) => None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccountTypeDetails",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_mca_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantConnectorAccountTypeDetails_get_inner_db_merchant_connector_account | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccountTypeDetails
pub fn get_inner_db_merchant_connector_account(&self) -> Option<&MerchantConnectorAccount> {
match self {
Self::MerchantConnectorAccount(merchant_connector_account) => {
Some(merchant_connector_account)
}
Self::MerchantConnectorDetails(_) => None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccountTypeDetails",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_inner_db_merchant_connector_account",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantConnectorAccount_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.id.clone()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantConnectorAccount_get_connector_account_details | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_connector_account_details(
&self,
) -> error_stack::Result<router_data::ConnectorAuthType, common_utils::errors::ParsingError>
{
use common_utils::ext_traits::ValueExt;
self.connector_account_details
.get_inner()
.clone()
.parse_value("ConnectorAuthType")
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_account_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_MerchantConnectorAccount_get_connector_wallets_details | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_connector_wallets_details(&self) -> Option<Secret<Value>> {
self.connector_wallets_details.as_deref().cloned()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_wallets_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_MerchantConnectorAccount_get_connector_test_mode | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_connector_test_mode(&self) -> Option<bool> {
todo!()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_test_mode",
"num_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_MerchantConnectorAccount_get_connector_name_as_string | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_connector_name_as_string(&self) -> String {
self.connector_name.clone().to_string()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_name_as_string",
"num_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_MerchantConnectorAccount_get_metadata | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
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": "MerchantConnectorAccount",
"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_MerchantConnectorAccount_is_disabled | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn is_disabled(&self) -> bool {
self.disabled.unwrap_or(false)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_disabled",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantConnectorAccount_get_connector_name | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_connector_name(&self) -> common_enums::connector_enums::Connector {
self.connector_name
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_name",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantConnectorAccount_get_retry_threshold | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_retry_threshold(&self) -> Option<u16> {
self.feature_metadata
.as_ref()
.and_then(|metadata| metadata.revenue_recovery.as_ref())
.map(|recovery| recovery.billing_connector_retry_threshold)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_retry_threshold",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantConnectorAccount_get_payment_merchant_connector_account_id_using_account_reference_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_payment_merchant_connector_account_id_using_account_reference_id(
&self,
account_reference_id: String,
) -> Option<id_type::MerchantConnectorAccountId> {
self.feature_metadata.as_ref().and_then(|metadata| {
metadata.revenue_recovery.as_ref().and_then(|recovery| {
recovery
.mca_reference
.billing_to_recovery
.get(&account_reference_id)
.cloned()
})
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_merchant_connector_account_id_using_account_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_MerchantConnectorAccount_get_account_reference_id_using_payment_merchant_connector_account_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_account_reference_id_using_payment_merchant_connector_account_id(
&self,
payment_merchant_connector_account_id: id_type::MerchantConnectorAccountId,
) -> Option<String> {
self.feature_metadata.as_ref().and_then(|metadata| {
metadata.revenue_recovery.as_ref().and_then(|recovery| {
recovery
.mca_reference
.recovery_to_billing
.get(&payment_merchant_connector_account_id)
.cloned()
})
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_account_reference_id_using_payment_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_MerchantConnectorAccount_get_id | clm | method | // hyperswitch/crates/diesel_models/src/merchant_connector_account.rs
// impl for MerchantConnectorAccount
pub fn get_id(&self) -> id_type::MerchantConnectorAccountId {
self.id.clone()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantConnectorAccount",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_FlattenedPaymentMethodsEnabled_from_payment_connectors_list | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_connector_account.rs
// impl for FlattenedPaymentMethodsEnabled
pub fn from_payment_connectors_list(payment_connectors: Vec<MerchantConnectorAccount>) -> Self {
let payment_methods_enabled_flattened_with_connector = payment_connectors
.into_iter()
.map(|connector| {
(
connector
.payment_methods_enabled
.clone()
.unwrap_or_default(),
connector.connector_name,
connector.get_id(),
)
})
.flat_map(
|(payment_method_enabled, connector, merchant_connector_id)| {
payment_method_enabled
.into_iter()
.flat_map(move |payment_method| {
let request_payment_methods_enabled =
payment_method.payment_method_subtypes.unwrap_or_default();
let length = request_payment_methods_enabled.len();
request_payment_methods_enabled
.into_iter()
.zip(std::iter::repeat_n(
(
connector,
merchant_connector_id.clone(),
payment_method.payment_method_type,
),
length,
))
})
},
)
.map(
|(request_payment_methods, (connector, merchant_connector_id, payment_method))| {
PaymentMethodsEnabledForConnector {
payment_methods_enabled: request_payment_methods,
connector,
payment_method,
merchant_connector_id,
}
},
)
.collect();
Self {
payment_methods_enabled: payment_methods_enabled_flattened_with_connector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "FlattenedPaymentMethodsEnabled",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "from_payment_connectors_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_PaymentIntent_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn get_id(&self) -> &id_type::GlobalPaymentId {
&self.id
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"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_PaymentIntent_create_start_redirection_url | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn create_start_redirection_url(
&self,
base_url: &str,
publishable_key: String,
) -> CustomResult<url::Url, errors::api_error_response::ApiErrorResponse> {
let start_redirection_url = &format!(
"{}/v2/payments/{}/start-redirection?publishable_key={}&profile_id={}",
base_url,
self.get_id().get_string_repr(),
publishable_key,
self.profile_id.get_string_repr()
);
url::Url::parse(start_redirection_url)
.change_context(errors::api_error_response::ApiErrorResponse::InternalServerError)
.attach_printable("Error creating start redirection url")
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_start_redirection_url",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_PaymentIntent_get_request_extended_authorization_bool_if_connector_supports | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn get_request_extended_authorization_bool_if_connector_supports(
&self,
connector: common_enums::connector_enums::Connector,
always_request_extended_authorization_optional: Option<AlwaysRequestExtendedAuthorization>,
payment_method_optional: Option<common_enums::PaymentMethod>,
payment_method_type_optional: Option<common_enums::PaymentMethodType>,
) -> Option<RequestExtendedAuthorizationBool> {
use router_env::logger;
let is_extended_authorization_supported_by_connector = || {
let supported_pms = connector.get_payment_methods_supporting_extended_authorization();
let supported_pmts =
connector.get_payment_method_types_supporting_extended_authorization();
// check if payment method or payment method type is supported by the connector
logger::info!(
"Extended Authentication Connector:{:?}, Supported payment methods: {:?}, Supported payment method types: {:?}, Payment method Selected: {:?}, Payment method type Selected: {:?}",
connector,
supported_pms,
supported_pmts,
payment_method_optional,
payment_method_type_optional
);
match (payment_method_optional, payment_method_type_optional) {
(Some(payment_method), Some(payment_method_type)) => {
supported_pms.contains(&payment_method)
&& supported_pmts.contains(&payment_method_type)
}
(Some(payment_method), None) => supported_pms.contains(&payment_method),
(None, Some(payment_method_type)) => supported_pmts.contains(&payment_method_type),
(None, None) => false,
}
};
let intent_request_extended_authorization_optional = self.request_extended_authorization;
let is_extended_authorization_requested = intent_request_extended_authorization_optional
.map(|should_request_extended_authorization| *should_request_extended_authorization)
.or(always_request_extended_authorization_optional.map(
|should_always_request_extended_authorization| {
*should_always_request_extended_authorization
},
));
is_extended_authorization_requested
.map(|requested| {
if requested {
is_extended_authorization_supported_by_connector()
} else {
false
}
})
.map(RequestExtendedAuthorizationBool::from)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_request_extended_authorization_bool_if_connector_supports",
"num_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_PaymentIntent_get_enable_overcapture_bool_if_connector_supports | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn get_enable_overcapture_bool_if_connector_supports(
&self,
connector: common_enums::connector_enums::Connector,
always_enable_overcapture: Option<primitive_wrappers::AlwaysEnableOvercaptureBool>,
capture_method: &Option<common_enums::CaptureMethod>,
) -> Option<EnableOvercaptureBool> {
let is_overcapture_supported_by_connector =
connector.is_overcapture_supported_by_connector();
if matches!(capture_method, Some(common_enums::CaptureMethod::Manual))
&& is_overcapture_supported_by_connector
{
self.enable_overcapture
.or_else(|| always_enable_overcapture.map(EnableOvercaptureBool::from))
} else {
None
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_enable_overcapture_bool_if_connector_supports",
"num_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_PaymentIntent_create_finish_redirection_url | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn create_finish_redirection_url(
&self,
base_url: &str,
publishable_key: &str,
) -> CustomResult<url::Url, errors::api_error_response::ApiErrorResponse> {
let finish_redirection_url = format!(
"{base_url}/v2/payments/{}/finish-redirection/{publishable_key}/{}",
self.id.get_string_repr(),
self.profile_id.get_string_repr()
);
url::Url::parse(&finish_redirection_url)
.change_context(errors::api_error_response::ApiErrorResponse::InternalServerError)
.attach_printable("Error creating finish redirection url")
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_finish_redirection_url",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_PaymentIntent_parse_and_get_metadata | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn parse_and_get_metadata<T>(
&self,
type_name: &'static str,
) -> CustomResult<Option<T>, common_utils::errors::ParsingError>
where
T: for<'de> masking::Deserialize<'de>,
{
self.metadata
.clone()
.map(|metadata| metadata.parse_value(type_name))
.transpose()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "parse_and_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_PaymentIntent_merge_metadata | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn merge_metadata(
&self,
request_metadata: Value,
) -> Result<Value, common_utils::errors::ParsingError> {
if !request_metadata.is_null() {
match (&self.metadata, &request_metadata) {
(Some(Value::Object(existing_map)), Value::Object(req_map)) => {
let mut merged = existing_map.clone();
merged.extend(req_map.clone());
Ok(Value::Object(merged))
}
(None, Value::Object(_)) => Ok(request_metadata),
_ => {
router_env::logger::error!(
"Expected metadata to be an object, got: {:?}",
request_metadata
);
Err(common_utils::errors::ParsingError::UnknownError)
}
}
} else {
router_env::logger::error!("Metadata does not contain any key");
Err(common_utils::errors::ParsingError::UnknownError)
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "merge_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_PaymentIntent_extract_connector_customer_id_from_payment_intent | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn extract_connector_customer_id_from_payment_intent(
&self,
) -> Result<String, common_utils::errors::ValidationError> {
self.feature_metadata
.as_ref()
.and_then(|metadata| metadata.payment_revenue_recovery_metadata.as_ref())
.map(|recovery| {
recovery
.billing_connector_payment_details
.connector_customer_id
.clone()
})
.ok_or(
common_utils::errors::ValidationError::MissingRequiredField {
field_name: "connector_customer_id".to_string(),
},
)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "extract_connector_customer_id_from_payment_intent",
"num_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_PaymentIntent_get_payment_method_sub_type | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
fn get_payment_method_sub_type(&self) -> Option<common_enums::PaymentMethodType> {
self.feature_metadata
.as_ref()
.and_then(|metadata| metadata.get_payment_method_sub_type())
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_method_sub_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_PaymentIntent_get_payment_method_type | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
fn get_payment_method_type(&self) -> Option<common_enums::PaymentMethod> {
self.feature_metadata
.as_ref()
.and_then(|metadata| metadata.get_payment_method_type())
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"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_PaymentIntent_get_connector_customer_id_from_feature_metadata | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn get_connector_customer_id_from_feature_metadata(&self) -> Option<String> {
self.feature_metadata
.as_ref()
.and_then(|metadata| metadata.payment_revenue_recovery_metadata.as_ref())
.map(|recovery_metadata| {
recovery_metadata
.billing_connector_payment_details
.connector_customer_id
.clone()
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_customer_id_from_feature_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_PaymentIntent_get_billing_merchant_connector_account_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn get_billing_merchant_connector_account_id(
&self,
) -> Option<id_type::MerchantConnectorAccountId> {
self.feature_metadata.as_ref().and_then(|feature_metadata| {
feature_metadata.get_billing_merchant_connector_account_id()
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_billing_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_PaymentIntent_get_request_incremental_authorization_value | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
fn get_request_incremental_authorization_value(
request: &api_models::payments::PaymentsCreateIntentRequest,
) -> CustomResult<
common_enums::RequestIncrementalAuthorization,
errors::api_error_response::ApiErrorResponse,
> {
request.request_incremental_authorization
.map(|request_incremental_authorization| {
if request_incremental_authorization == common_enums::RequestIncrementalAuthorization::True {
if request.capture_method == Some(common_enums::CaptureMethod::Automatic) {
Err(errors::api_error_response::ApiErrorResponse::InvalidRequestData { message: "incremental authorization is not supported when capture_method is automatic".to_owned() })?
}
Ok(common_enums::RequestIncrementalAuthorization::True)
} else {
Ok(common_enums::RequestIncrementalAuthorization::False)
}
})
.unwrap_or(Ok(common_enums::RequestIncrementalAuthorization::default()))
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_request_incremental_authorization_value",
"num_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_PaymentIntent_create_domain_model_from_request | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub async fn create_domain_model_from_request(
payment_id: &id_type::GlobalPaymentId,
merchant_context: &merchant_context::MerchantContext,
profile: &business_profile::Profile,
request: api_models::payments::PaymentsCreateIntentRequest,
decrypted_payment_intent: DecryptedPaymentIntent,
) -> CustomResult<Self, errors::api_error_response::ApiErrorResponse> {
let request_incremental_authorization =
Self::get_request_incremental_authorization_value(&request)?;
let allowed_payment_method_types = request.allowed_payment_method_types;
let session_expiry =
common_utils::date_time::now().saturating_add(time::Duration::seconds(
request.session_expiry.map(i64::from).unwrap_or(
profile
.session_expiry
.unwrap_or(common_utils::consts::DEFAULT_SESSION_EXPIRY),
),
));
let order_details = request.order_details.map(|order_details| {
order_details
.into_iter()
.map(|order_detail| Secret::new(OrderDetailsWithAmount::convert_from(order_detail)))
.collect()
});
Ok(Self {
id: payment_id.clone(),
merchant_id: merchant_context.get_merchant_account().get_id().clone(),
// Intent status would be RequiresPaymentMethod because we are creating a new payment intent
status: common_enums::IntentStatus::RequiresPaymentMethod,
amount_details: AmountDetails::from(request.amount_details),
amount_captured: None,
customer_id: request.customer_id,
description: request.description,
return_url: request.return_url,
metadata: request.metadata,
statement_descriptor: request.statement_descriptor,
created_at: common_utils::date_time::now(),
modified_at: common_utils::date_time::now(),
last_synced: None,
setup_future_usage: request.setup_future_usage.unwrap_or_default(),
active_attempt_id: None,
active_attempt_id_type: common_enums::ActiveAttemptIDType::AttemptID,
active_attempts_group_id: None,
order_details,
allowed_payment_method_types,
connector_metadata: request.connector_metadata,
feature_metadata: request.feature_metadata.map(FeatureMetadata::convert_from),
// Attempt count is 0 in create intent as no attempt is made yet
attempt_count: 0,
profile_id: profile.get_id().clone(),
payment_link_id: None,
frm_merchant_decision: None,
updated_by: merchant_context
.get_merchant_account()
.storage_scheme
.to_string(),
request_incremental_authorization,
// Authorization count is 0 in create intent as no authorization is made yet
authorization_count: Some(0),
session_expiry,
request_external_three_ds_authentication: request
.request_external_three_ds_authentication
.unwrap_or_default(),
split_txns_enabled: profile.split_txns_enabled,
frm_metadata: request.frm_metadata,
customer_details: None,
merchant_reference_id: request.merchant_reference_id,
billing_address: decrypted_payment_intent
.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")?,
shipping_address: decrypted_payment_intent
.shipping_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 shipping address")?,
capture_method: request.capture_method.unwrap_or_default(),
authentication_type: request.authentication_type,
prerouting_algorithm: None,
organization_id: merchant_context
.get_merchant_account()
.organization_id
.clone(),
enable_payment_link: request.payment_link_enabled.unwrap_or_default(),
apply_mit_exemption: request.apply_mit_exemption.unwrap_or_default(),
customer_present: request.customer_present.unwrap_or_default(),
payment_link_config: request
.payment_link_config
.map(ApiModelToDieselModelConvertor::convert_from),
routing_algorithm_id: request.routing_algorithm_id,
split_payments: None,
force_3ds_challenge: None,
force_3ds_challenge_trigger: None,
processor_merchant_id: merchant_context.get_merchant_account().get_id().clone(),
created_by: None,
is_iframe_redirection_enabled: None,
is_payment_id_from_merchant: None,
enable_partial_authorization: request.enable_partial_authorization,
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_domain_model_from_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_PaymentIntent_get_revenue_recovery_metadata | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn get_revenue_recovery_metadata(
&self,
) -> Option<diesel_models::types::PaymentRevenueRecoveryMetadata> {
self.feature_metadata
.as_ref()
.and_then(|feature_metadata| feature_metadata.payment_revenue_recovery_metadata.clone())
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_revenue_recovery_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_PaymentIntent_get_feature_metadata | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn get_feature_metadata(&self) -> Option<FeatureMetadata> {
self.feature_metadata.clone()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_feature_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_PaymentIntent_create_revenue_recovery_attempt_data | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn create_revenue_recovery_attempt_data(
&self,
revenue_recovery_metadata: api_models::payments::PaymentRevenueRecoveryMetadata,
billing_connector_account: &merchant_connector_account::MerchantConnectorAccount,
card_info: api_models::payments::AdditionalCardInfo,
payment_processor_token: &str,
) -> CustomResult<
revenue_recovery::RevenueRecoveryAttemptData,
errors::api_error_response::ApiErrorResponse,
> {
let merchant_reference_id = self.merchant_reference_id.clone().ok_or_else(|| {
error_stack::report!(
errors::api_error_response::ApiErrorResponse::GenericNotFoundError {
message: "mandate reference id not found".to_string()
}
)
})?;
let connector_account_reference_id = billing_connector_account
.get_account_reference_id_using_payment_merchant_connector_account_id(
revenue_recovery_metadata.active_attempt_payment_connector_id,
)
.ok_or_else(|| {
error_stack::report!(
errors::api_error_response::ApiErrorResponse::GenericNotFoundError {
message: "connector account reference id not found".to_string()
}
)
})?;
Ok(revenue_recovery::RevenueRecoveryAttemptData {
amount: self.amount_details.order_amount,
currency: self.amount_details.currency,
merchant_reference_id,
connector_transaction_id: None, // No connector id
error_code: None,
error_message: None,
processor_payment_method_token: payment_processor_token.to_string(),
connector_customer_id: revenue_recovery_metadata
.billing_connector_payment_details
.connector_customer_id,
connector_account_reference_id,
transaction_created_at: None, // would unwrap_or as now
status: common_enums::AttemptStatus::Started,
payment_method_type: self
.get_payment_method_type()
.unwrap_or(revenue_recovery_metadata.payment_method_type),
payment_method_sub_type: self
.get_payment_method_sub_type()
.unwrap_or(revenue_recovery_metadata.payment_method_subtype),
network_advice_code: None,
network_decline_code: None,
network_error_message: None,
retry_count: None,
invoice_next_billing_time: None,
invoice_billing_started_at_time: None,
// No charge id is present here since it is an internal payment and we didn't call connector yet.
charge_id: None,
card_info: card_info.clone(),
})
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "create_revenue_recovery_attempt_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_PaymentIntent_get_optional_customer_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn get_optional_customer_id(
&self,
) -> CustomResult<Option<id_type::CustomerId>, common_utils::errors::ValidationError> {
self.customer_id
.as_ref()
.map(|customer_id| id_type::CustomerId::try_from(customer_id.clone()))
.transpose()
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_optional_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_PaymentIntent_get_currency | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentIntent
pub fn get_currency(&self) -> storage_enums::Currency {
self.amount_details.currency
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentIntent",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_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_HeaderPayload_with_source | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for HeaderPayload
pub fn with_source(payment_confirm_source: common_enums::PaymentSource) -> Self {
Self {
payment_confirm_source: Some(payment_confirm_source),
..Default::default()
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "HeaderPayload",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "with_source",
"num_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_PaymentConfirmData<F>_get_connector_customer_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentConfirmData<F>
pub fn get_connector_customer_id(
&self,
customer: Option<&customer::Customer>,
merchant_connector_account: &MerchantConnectorAccountTypeDetails,
) -> Option<String> {
match merchant_connector_account {
MerchantConnectorAccountTypeDetails::MerchantConnectorAccount(_) => customer
.and_then(|customer| customer.get_connector_customer_id(merchant_connector_account))
.map(|id| id.to_string())
.or_else(|| {
self.payment_intent
.get_connector_customer_id_from_feature_metadata()
}),
MerchantConnectorAccountTypeDetails::MerchantConnectorDetails(_) => None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentConfirmData<F>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_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_PaymentConfirmData<F>_update_payment_method_data | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentConfirmData<F>
pub fn update_payment_method_data(
&mut self,
payment_method_data: payment_method_data::PaymentMethodData,
) {
self.payment_method_data = Some(payment_method_data);
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentConfirmData<F>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_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_PaymentConfirmData<F>_update_payment_method_and_pm_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentConfirmData<F>
pub fn update_payment_method_and_pm_id(
&mut self,
payment_method_id: id_type::GlobalPaymentMethodId,
payment_method: payment_methods::PaymentMethod,
) {
self.payment_attempt.payment_method_id = Some(payment_method_id);
self.payment_method = Some(payment_method);
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentConfirmData<F>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "update_payment_method_and_pm_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_PaymentStatusData<F>_get_payment_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentStatusData<F>
pub fn get_payment_id(&self) -> &id_type::GlobalPaymentId {
&self.payment_intent.id
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentStatusData<F>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_PaymentAttemptRecordData<F>_get_updated_feature_metadata | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for PaymentAttemptRecordData<F>
pub fn get_updated_feature_metadata(
&self,
) -> CustomResult<Option<FeatureMetadata>, errors::api_error_response::ApiErrorResponse> {
let payment_intent_feature_metadata = self.payment_intent.get_feature_metadata();
let revenue_recovery = self.payment_intent.get_revenue_recovery_metadata();
let payment_attempt_connector = self.payment_attempt.connector.clone();
let feature_metadata_first_pg_error_code = revenue_recovery
.as_ref()
.and_then(|data| data.first_payment_attempt_pg_error_code.clone());
let (first_pg_error_code, first_network_advice_code, first_network_decline_code) =
feature_metadata_first_pg_error_code.map_or_else(
|| {
let first_pg_error_code = self
.payment_attempt
.error
.as_ref()
.map(|error| error.code.clone());
let first_network_advice_code = self
.payment_attempt
.error
.as_ref()
.and_then(|error| error.network_advice_code.clone());
let first_network_decline_code = self
.payment_attempt
.error
.as_ref()
.and_then(|error| error.network_decline_code.clone());
(
first_pg_error_code,
first_network_advice_code,
first_network_decline_code,
)
},
|pg_code| {
let advice_code = revenue_recovery
.as_ref()
.and_then(|data| data.first_payment_attempt_network_advice_code.clone());
let decline_code = revenue_recovery
.as_ref()
.and_then(|data| data.first_payment_attempt_network_decline_code.clone());
(Some(pg_code), advice_code, decline_code)
},
);
let billing_connector_payment_method_details = Some(
diesel_models::types::BillingConnectorPaymentMethodDetails::Card(
diesel_models::types::BillingConnectorAdditionalCardInfo {
card_network: self.revenue_recovery_data.card_network.clone(),
card_issuer: self.revenue_recovery_data.card_issuer.clone(),
},
),
);
let payment_revenue_recovery_metadata = match payment_attempt_connector {
Some(connector) => Some(diesel_models::types::PaymentRevenueRecoveryMetadata {
// Update retry count by one.
total_retry_count: revenue_recovery.as_ref().map_or(
self.revenue_recovery_data
.retry_count
.map_or_else(|| 1, |retry_count| retry_count),
|data| (data.total_retry_count + 1),
),
// Since this is an external system call, marking this payment_connector_transmission to ConnectorCallSucceeded.
payment_connector_transmission:
common_enums::PaymentConnectorTransmission::ConnectorCallUnsuccessful,
billing_connector_id: self.revenue_recovery_data.billing_connector_id.clone(),
active_attempt_payment_connector_id: self
.payment_attempt
.get_attempt_merchant_connector_account_id()?,
billing_connector_payment_details:
diesel_models::types::BillingConnectorPaymentDetails {
payment_processor_token: self
.revenue_recovery_data
.processor_payment_method_token
.clone(),
connector_customer_id: self
.revenue_recovery_data
.connector_customer_id
.clone(),
},
payment_method_type: self.payment_attempt.payment_method_type,
payment_method_subtype: self.payment_attempt.payment_method_subtype,
connector: connector.parse().map_err(|err| {
router_env::logger::error!(?err, "Failed to parse connector string to enum");
errors::api_error_response::ApiErrorResponse::InternalServerError
})?,
invoice_next_billing_time: self.revenue_recovery_data.invoice_next_billing_time,
invoice_billing_started_at_time: self
.revenue_recovery_data
.invoice_next_billing_time,
billing_connector_payment_method_details,
first_payment_attempt_network_advice_code: first_network_advice_code,
first_payment_attempt_network_decline_code: first_network_decline_code,
first_payment_attempt_pg_error_code: first_pg_error_code,
}),
None => Err(errors::api_error_response::ApiErrorResponse::InternalServerError)
.attach_printable("Connector not found in payment attempt")?,
};
Ok(Some(FeatureMetadata {
redirect_response: payment_intent_feature_metadata
.as_ref()
.and_then(|data| data.redirect_response.clone()),
search_tags: payment_intent_feature_metadata
.as_ref()
.and_then(|data| data.search_tags.clone()),
apple_pay_recurring_details: payment_intent_feature_metadata
.as_ref()
.and_then(|data| data.apple_pay_recurring_details.clone()),
payment_revenue_recovery_metadata,
}))
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "PaymentAttemptRecordData<F>",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_updated_feature_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_VaultOperation_get_updated_vault_data | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for VaultOperation
pub fn get_updated_vault_data(
existing_vault_data: Option<&Self>,
payment_method_data: &payment_method_data::PaymentMethodData,
) -> Option<Self> {
match (existing_vault_data, payment_method_data) {
(None, payment_method_data::PaymentMethodData::Card(card)) => {
Some(Self::ExistingVaultData(VaultData::Card(card.clone())))
}
(None, payment_method_data::PaymentMethodData::NetworkToken(nt_data)) => Some(
Self::ExistingVaultData(VaultData::NetworkToken(nt_data.clone())),
),
(Some(Self::ExistingVaultData(vault_data)), payment_method_data) => {
match (vault_data, payment_method_data) {
(
VaultData::Card(card),
payment_method_data::PaymentMethodData::NetworkToken(nt_data),
) => Some(Self::ExistingVaultData(VaultData::CardAndNetworkToken(
Box::new(CardAndNetworkTokenData {
card_data: card.clone(),
network_token_data: nt_data.clone(),
}),
))),
(
VaultData::NetworkToken(nt_data),
payment_method_data::PaymentMethodData::Card(card),
) => Some(Self::ExistingVaultData(VaultData::CardAndNetworkToken(
Box::new(CardAndNetworkTokenData {
card_data: card.clone(),
network_token_data: nt_data.clone(),
}),
))),
_ => Some(Self::ExistingVaultData(vault_data.clone())),
}
}
//payment_method_data is not card or network token
_ => None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "VaultOperation",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_updated_vault_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_VaultData_get_card_vault_data | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for VaultData
pub fn get_card_vault_data(&self) -> Option<payment_method_data::Card> {
match self {
Self::Card(card_data) => Some(card_data.clone()),
Self::NetworkToken(_network_token_data) => None,
Self::CardAndNetworkToken(vault_data) => Some(vault_data.card_data.clone()),
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "VaultData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_card_vault_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_VaultData_get_network_token_data | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/payments.rs
// impl for VaultData
pub fn get_network_token_data(&self) -> Option<payment_method_data::NetworkTokenData> {
match self {
Self::Card(_card_data) => None,
Self::NetworkToken(network_token_data) => Some(network_token_data.clone()),
Self::CardAndNetworkToken(vault_data) => Some(vault_data.network_token_data.clone()),
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "VaultData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_network_token_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantContext_get_merchant_account | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_context.rs
// impl for MerchantContext
pub fn get_merchant_account(&self) -> &MerchantAccount {
match self {
Self::NormalMerchant(merchant_account) => &merchant_account.0,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantContext",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_merchant_account",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_MerchantContext_get_merchant_key_store | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/merchant_context.rs
// impl for MerchantContext
pub fn get_merchant_key_store(&self) -> &MerchantKeyStore {
match self {
Self::NormalMerchant(merchant_account) => &merchant_account.1,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "MerchantContext",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_merchant_key_store",
"num_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_RemoteStorageObject<T>_get_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/lib.rs
// impl for RemoteStorageObject<T>
pub fn get_id(&self) -> String {
match self {
Self::ForeignID(id) => id.clone(),
Self::Object(i) => i.foreign_id(),
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "RemoteStorageObject<T>",
"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_Connectors_get_connector_params | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/connector_endpoints.rs
// impl for Connectors
pub fn get_connector_params(
&self,
connector: connector_enums::Connector,
) -> CustomResult<ConnectorParams, api_error_response::ApiErrorResponse> {
match connector {
connector_enums::Connector::Recurly => Ok(self.recurly.clone()),
connector_enums::Connector::Stripebilling => Ok(self.stripebilling.clone()),
connector_enums::Connector::Chargebee => Ok(self.chargebee.clone()),
_ => Err(api_error_response::ApiErrorResponse::IncorrectConnectorNameGiven.into()),
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "Connectors",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_connector_params",
"num_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_NoParams_validate | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/connector_endpoints.rs
// impl for NoParams
pub fn validate(&self, _parent_field: &str) -> Result<(), ApplicationError> {
Ok(())
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "NoParams",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "validate",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_ClientSecret_get_subscription_id | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/subscription.rs
// impl for ClientSecret
pub fn get_subscription_id(&self) -> error_stack::Result<String, ApiErrorResponse> {
let sub_id = self
.0
.split(SECRET_SPLIT)
.next()
.ok_or(ApiErrorResponse::MissingRequiredField {
field_name: "client_secret",
})
.attach_printable("Failed to extract subscription_id from client_secret")?;
Ok(sub_id.to_string())
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "ClientSecret",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_subscription_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_ClientSecret_new | clm | method | // hyperswitch/crates/api_models/src/subscription.rs
// impl for ClientSecret
pub fn new(secret: String) -> Self {
Self(secret)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "ClientSecret",
"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_Subscription_generate_and_set_client_secret | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/subscription.rs
// impl for Subscription
pub fn generate_and_set_client_secret(&mut self) -> Secret<String> {
let client_secret =
generate_id_with_default_len(&format!("{}_secret", self.id.get_string_repr()));
self.client_secret = Some(client_secret.clone());
Secret::new(client_secret)
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "Subscription",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate_and_set_client_secret",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_SubscriptionUpdate_new | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/subscription.rs
// impl for SubscriptionUpdate
pub fn new(
connector_subscription_id: Option<String>,
payment_method_id: Option<Secret<String>>,
status: Option<String>,
plan_id: Option<String>,
item_price_id: Option<String>,
) -> Self {
Self {
connector_subscription_id,
payment_method_id: payment_method_id.map(|pmid| pmid.peek().clone()),
status,
modified_at: common_utils::date_time::now(),
plan_id,
item_price_id,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "SubscriptionUpdate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_SubscriptionUpdate_new | clm | method | // hyperswitch/crates/diesel_models/src/subscription.rs
// impl for SubscriptionUpdate
pub fn new(
connector_subscription_id: Option<String>,
payment_method_id: Option<Secret<String>>,
status: Option<String>,
plan_id: Option<String>,
item_price_id: Option<String>,
) -> Self {
Self {
connector_subscription_id,
payment_method_id: payment_method_id.map(|pmid| pmid.peek().clone()),
status,
modified_at: common_utils::date_time::now(),
plan_id,
item_price_id,
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "SubscriptionUpdate",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_domain_models_Address_unify_address | clm | method | // hyperswitch/crates/hyperswitch_domain_models/src/address.rs
// impl for Address
pub fn unify_address(&self, other: Option<&Self>) -> Self {
let other_address_details = other.and_then(|address| address.address.as_ref());
Self {
address: self
.address
.as_ref()
.map(|address| address.unify_address_details(other_address_details))
.or(other_address_details.cloned()),
email: self
.email
.clone()
.or(other.and_then(|other| other.email.clone())),
phone: {
self.phone
.clone()
.and_then(|phone_details| {
if phone_details.number.is_some() {
Some(phone_details)
} else {
None
}
})
.or_else(|| other.and_then(|other| other.phone.clone()))
},
}
}
| {
"chunk": null,
"crate": "hyperswitch_domain_models",
"enum_name": null,
"file_size": null,
"for_type": "Address",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "unify_address",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.