mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	feat(documentation): add polymorphic generate_schema macro (#1183)
				
					
				
			Co-authored-by: pixincreate@work <69745008+pixincreate@users.noreply.github.com>
This commit is contained in:
		| @ -321,7 +321,9 @@ impl From<StraightThroughAlgorithm> for StraightThroughAlgorithmSerde { | ||||
| #[derive(Clone, Debug, Deserialize, ToSchema, Serialize)] | ||||
| #[serde(deny_unknown_fields)] | ||||
| pub struct PrimaryBusinessDetails { | ||||
|     #[schema(value_type = CountryAlpha2)] | ||||
|     pub country: api_enums::CountryAlpha2, | ||||
|     #[schema(example = "food")] | ||||
|     pub business: String, | ||||
| } | ||||
|  | ||||
| @ -452,10 +454,12 @@ pub struct MerchantConnectorCreate { | ||||
|     pub frm_configs: Option<FrmConfigs>, | ||||
|  | ||||
|     /// Business Country of the connector | ||||
|     #[schema(value_type = CountryAlpha2, example = "US")] | ||||
|     #[cfg(feature = "multiple_mca")] | ||||
|     #[schema(value_type = CountryAlpha2, example = "US")] | ||||
|     pub business_country: api_enums::CountryAlpha2, | ||||
|  | ||||
|     #[cfg(not(feature = "multiple_mca"))] | ||||
|     #[schema(value_type = Option<CountryAlpha2>, example = "US")] | ||||
|     pub business_country: Option<api_enums::CountryAlpha2>, | ||||
|  | ||||
|     ///Business Type of the merchant | ||||
| @ -633,7 +637,11 @@ pub struct FrmConfigs { | ||||
|     pub frm_enabled_pms: Option<Vec<String>>, | ||||
|     pub frm_enabled_pm_types: Option<Vec<String>>, | ||||
|     pub frm_enabled_gateways: Option<Vec<String>>, | ||||
|     pub frm_action: api_enums::FrmAction, //What should be the action if FRM declines the txn (autorefund/cancel txn/manual review) | ||||
|     /// What should be the action if FRM declines the txn (autorefund/cancel txn/manual review) | ||||
|     #[schema(value_type = FrmAction)] | ||||
|     pub frm_action: api_enums::FrmAction, | ||||
|     /// Whether to make a call to the FRM before or after the payment | ||||
|     #[schema(value_type = FrmPreferredFlowTypes)] | ||||
|     pub frm_preferred_flow_type: api_enums::FrmPreferredFlowTypes, | ||||
| } | ||||
| /// Details of all the payment methods enabled for the connector for the given merchant account | ||||
| @ -657,7 +665,9 @@ pub struct PaymentMethodsEnabled { | ||||
|     rename_all = "snake_case" | ||||
| )] | ||||
| pub enum AcceptedCurrencies { | ||||
|     #[schema(value_type = Vec<Currency>)] | ||||
|     EnableOnly(Vec<api_enums::Currency>), | ||||
|     #[schema(value_type = Vec<Currency>)] | ||||
|     DisableOnly(Vec<api_enums::Currency>), | ||||
|     AllAccepted, | ||||
| } | ||||
| @ -670,7 +680,9 @@ pub enum AcceptedCurrencies { | ||||
|     rename_all = "snake_case" | ||||
| )] | ||||
| pub enum AcceptedCountries { | ||||
|     #[schema(value_type = Vec<CountryAlpha2>)] | ||||
|     EnableOnly(Vec<api_enums::CountryAlpha2>), | ||||
|     #[schema(value_type = Vec<CountryAlpha2>)] | ||||
|     DisableOnly(Vec<api_enums::CountryAlpha2>), | ||||
|     AllAccepted, | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Narayan Bhat
					Narayan Bhat