Command: grep -n -A 20 "struct.*MerchantAccount"…
- User
Command: grep -n -A 20 "struct.*MerchantAccount" /workspace/archit/trace_generation/repos/hyperswitch_pool_6/crates/api_models/src/admin.rs | head -100 Output: 29:pub struct MerchantAccountListRequest { 30- pub organization_id: id_type::OrganizationId, 31-} 32- 33-#[cfg(feature = "v1")] 34-#[derive(Clone, Debug, Deserialize, ToSchema, Serialize)] 35-#[serde(deny_unknown_fields)] 36:pub struct MerchantAccountCreate { 37- /// The identifier for the Merchant Account 38- #[schema(value_type = String, max_length = 64, min_length = 1, example = "y3oqhf46pyzuxjbcn2giaqnb44")] 39- pub merchant_id: id_type::MerchantId, 40- 41- /// Name of the Merchant Account 42- #[schema(value_type= Option,example = "NewAge Retailer")] 43- pub merchant_name: Option<Secret>, 44- 45- /// Details about the merchant, can contain phone and emails of primary and secondary contact person 46- pub merchant_details: Option, 47- 48- /// The URL to redirect after the completion of the operation 49- #[schema(value_type = Option, max_length = 255, example = "https://www.example.com/success")] 50- pub return_url: Optionurl::Url, 51- 52- /// Webhook related details 53- pub webhook_details: Option, 54- 55- /// The routing algorithm to be used for routing payments to desired connectors 56- #[serde(skip)]
187:pub struct MerchantAccountCreateWithoutOrgId { 188- /// Name of the Merchant Account, This will be used as a prefix to generate the id 189- #[schema(value_type= String, max_length = 64, example = "NewAge Retailer")] 190- pub merchant_name: Secret<common_utils::new_type::MerchantName>, 191- 192- /// Details about the merchant, contains phone and emails of primary and secondary contact person. 193- pub merchant_details: Option, 194- 195- /// Metadata is useful for storing additional, unstructured information about the merchant account. 196- #[schema(value_type = Option, example = r#"{ "city": "NY", "unit": "245" }"#)] 197- pub metadata: Optionpii::SecretSerdeValue, 198- 199- #[schema(value_type = Option)] 200- pub product_type: Option<api_enums::MerchantProductType>, 201-} 202- 203:// In v2 the struct used in the API is MerchantAccountCreateWithoutOrgId 204-// The following struct is only used internally, so we can reuse the common 205-// part of
create_merchant_accountwithout duplicating its code for v2 206-#[cfg(feature = "v2")] 207-#[derive(Clone, Debug, Serialize, ToSchema)] 208:pub struct MerchantAccountCreate { 209- pub merchant_name: Secret<common_utils::new_type::MerchantName>, 210- pub merchant_details: Option, 211- pub metadata: Optionpii::SecretSerdeValue, 212- pub organization_id: id_type::OrganizationId, 213- /// Product Type of this merchant account 214- #[schema(value_type = Option)] 215- pub product_type: Option<api_enums::MerchantProductType>, 216-} 217- 218-#[cfg(feature = "v2")] 219-impl MerchantAccountCreate { 220- pub fn get_merchant_reference_id(&self) -> id_type::MerchantId { 221- id_type::MerchantId::from_merchant_name(self.merchant_name.clone().expose()) 222- } 223- 224- pub fn get_merchant_details_as_secret( 225- &self, 226- ) -> CustomResult<Option, errors::ParsingError> { 227- self.merchant_details 228- .as_ref() Assistant
<is_displaying_contents> true </is_displaying_contents>