mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat(router): Add v2 endpoint to retrieve payment filters at merchant and profile level (#7171)
Co-authored-by: Aniket Burman <aniket.burman@Aniket-Burman-JDXHW2PH34.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1360,6 +1360,9 @@ impl MerchantConnectorListResponse {
|
||||
merchant_connector_id: self.merchant_connector_id.clone(),
|
||||
}
|
||||
}
|
||||
pub fn get_connector_name(&self) -> String {
|
||||
self.connector_name.clone()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
@ -1416,6 +1419,9 @@ impl MerchantConnectorListResponse {
|
||||
merchant_connector_id: self.id.clone(),
|
||||
}
|
||||
}
|
||||
pub fn get_connector_name(&self) -> common_enums::connector_enums::Connector {
|
||||
self.connector_name
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new Merchant Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc."
|
||||
@ -1667,6 +1673,20 @@ pub struct PaymentMethodsEnabled {
|
||||
#[schema(value_type = Option<Vec<RequestPaymentMethodTypes>>,example = json!(["credit"]))]
|
||||
pub payment_method_types: Option<Vec<payment_methods::RequestPaymentMethodTypes>>,
|
||||
}
|
||||
impl PaymentMethodsEnabled {
|
||||
/// Get payment_method
|
||||
#[cfg(feature = "v1")]
|
||||
pub fn get_payment_method(&self) -> Option<common_enums::PaymentMethod> {
|
||||
Some(self.payment_method)
|
||||
}
|
||||
/// Get payment_method_types
|
||||
#[cfg(feature = "v1")]
|
||||
pub fn get_payment_method_type(
|
||||
&self,
|
||||
) -> Option<&Vec<payment_methods::RequestPaymentMethodTypes>> {
|
||||
self.payment_method_types.as_ref()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Hash, Debug, Clone, serde::Serialize, Deserialize, ToSchema)]
|
||||
#[serde(
|
||||
|
||||
@ -1513,6 +1513,13 @@ pub struct RequestPaymentMethodTypes {
|
||||
#[schema(default = true, example = false)]
|
||||
pub installment_payment_enabled: bool,
|
||||
}
|
||||
impl RequestPaymentMethodTypes {
|
||||
/// Get payment_method_type
|
||||
#[cfg(feature = "v1")]
|
||||
pub fn get_payment_method_type(&self) -> Option<api_enums::PaymentMethodType> {
|
||||
Some(self.payment_method_type)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(
|
||||
any(feature = "v1", feature = "v2"),
|
||||
|
||||
Reference in New Issue
Block a user