use common_utils::pii; use masking::{Secret, StrongSecret}; use serde::{Deserialize, Serialize}; pub use self::CreateMerchantAccount as MerchantAccountResponse; use super::payments::AddressDetails; use crate::{enums as api_enums, payment_methods}; #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct CreateMerchantAccount { pub merchant_id: String, pub merchant_name: Option, pub api_key: Option>, pub merchant_details: Option, pub return_url: Option, pub webhook_details: Option, pub routing_algorithm: Option, pub custom_routing_rules: Option>, pub sub_merchants_enabled: Option, pub parent_merchant_id: Option, pub enable_payment_response_hash: Option, pub payment_response_hash_key: Option, pub redirect_to_merchant_with_http_post: Option, pub metadata: Option, pub publishable_key: Option, pub locker_id: Option, } #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct MerchantDetails { pub primary_contact_person: Option>, pub primary_phone: Option>, pub primary_email: Option>, pub secondary_contact_person: Option>, pub secondary_phone: Option>, pub secondary_email: Option>, pub website: Option, pub about_business: Option, pub address: Option, } #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct WebhookDetails { pub webhook_version: Option, pub webhook_username: Option, pub webhook_password: Option>, pub webhook_url: Option>, pub payment_created_enabled: Option, pub payment_succeeded_enabled: Option, pub payment_failed_enabled: Option, } #[derive(Default, Clone, Debug, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct CustomRoutingRules { pub payment_methods_incl: Option>, pub payment_methods_excl: Option>, pub payment_method_types_incl: Option>, pub payment_method_types_excl: Option>, pub payment_method_issuers_incl: Option>, pub payment_method_issuers_excl: Option>, pub countries_incl: Option>, pub countries_excl: Option>, pub currencies_incl: Option>, pub currencies_excl: Option>, pub metadata_filters_keys: Option>, pub metadata_filters_values: Option>, pub connectors_pecking_order: Option>, pub connectors_traffic_weightage_key: Option>, pub connectors_traffic_weightage_value: Option>, } #[derive(Debug, Serialize)] pub struct DeleteResponse { pub merchant_id: String, pub deleted: bool, } #[derive(Default, Debug, Deserialize, Serialize)] pub struct MerchantId { pub merchant_id: String, } #[derive(Default, Debug, Deserialize, Serialize)] pub struct MerchantConnectorId { pub merchant_id: String, pub merchant_connector_id: i32, } //Merchant Connector Account CRUD #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct PaymentConnectorCreate { pub connector_type: api_enums::ConnectorType, pub connector_name: String, pub merchant_connector_id: Option, pub connector_account_details: Option>, pub test_mode: Option, pub disabled: Option, pub payment_methods_enabled: Option>, pub metadata: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct PaymentMethods { pub payment_method: api_enums::PaymentMethodType, pub payment_method_types: Option>, pub payment_method_issuers: Option>, pub payment_schemes: Option>, pub accepted_currencies: Option>, pub accepted_countries: Option>, pub minimum_amount: Option, pub maximum_amount: Option, pub recurring_enabled: bool, pub installment_payment_enabled: bool, pub payment_experience: Option>, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct DeleteMcaResponse { pub merchant_id: String, pub merchant_connector_id: i32, pub deleted: bool, }