mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(router): add payment method-specific features to connector feature list (#6963)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
use utoipa::ToSchema;
|
||||
|
||||
use crate::enums::{
|
||||
CaptureMethod, Connector, CountryAlpha2, Currency, EventClass, FeatureStatus,
|
||||
CaptureMethod, CardNetwork, Connector, CountryAlpha2, Currency, EventClass, FeatureStatus,
|
||||
PaymentConnectorCategory, PaymentMethod, PaymentMethodType,
|
||||
};
|
||||
|
||||
@ -14,6 +14,23 @@ pub struct FeatureMatrixRequest {
|
||||
pub connectors: Option<Vec<Connector>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, ToSchema, Serialize)]
|
||||
pub struct CardSpecificFeatures {
|
||||
/// Indicates whether three_ds card payments are supported.
|
||||
pub three_ds: FeatureStatus,
|
||||
/// Indicates whether non three_ds card payments are supported.
|
||||
pub non_three_ds: FeatureStatus,
|
||||
/// List of supported card networks
|
||||
pub supported_card_networks: Vec<CardNetwork>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, ToSchema, Serialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum PaymentMethodSpecificFeatures {
|
||||
/// Card specific features
|
||||
Card(CardSpecificFeatures),
|
||||
}
|
||||
|
||||
#[derive(Debug, ToSchema, Serialize)]
|
||||
pub struct SupportedPaymentMethod {
|
||||
pub payment_method: PaymentMethod,
|
||||
@ -21,6 +38,8 @@ pub struct SupportedPaymentMethod {
|
||||
pub mandates: FeatureStatus,
|
||||
pub refunds: FeatureStatus,
|
||||
pub supported_capture_methods: Vec<CaptureMethod>,
|
||||
#[serde(flatten)]
|
||||
pub payment_method_specific_features: Option<PaymentMethodSpecificFeatures>,
|
||||
pub supported_countries: Option<HashSet<CountryAlpha2>>,
|
||||
pub supported_currencies: Option<HashSet<Currency>>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user