refactor(router): refactor merchant_connector_account retrieve and delete v2 apis (#5528)

This commit is contained in:
Sai Harsha Vardhan
2024-08-07 17:10:27 +05:30
committed by GitHub
parent 7e545e36eb
commit 253f1be3e1
10 changed files with 345 additions and 69 deletions

View File

@ -663,12 +663,21 @@ pub struct MerchantId {
pub merchant_id: id_type::MerchantId,
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "merchant_connector_account_v2")
))]
#[derive(Default, Debug, Deserialize, ToSchema, Serialize)]
pub struct MerchantConnectorId {
#[schema(value_type = String)]
pub merchant_id: id_type::MerchantId,
pub merchant_connector_id: String,
}
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
#[derive(Default, Debug, Deserialize, ToSchema, Serialize)]
pub struct MerchantConnectorId {
pub id: String,
}
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
/// 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."
@ -1728,6 +1737,10 @@ pub enum AcceptedCountries {
AllAccepted,
}
#[cfg(all(
any(feature = "v1", feature = "v2"),
not(feature = "merchant_connector_account_v2")
))]
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct MerchantConnectorDeleteResponse {
/// The identifier for the Merchant Account
@ -1741,6 +1754,20 @@ pub struct MerchantConnectorDeleteResponse {
pub deleted: bool,
}
#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct MerchantConnectorDeleteResponse {
/// The identifier for the Merchant Account
#[schema(max_length = 255, example = "y3oqhf46pyzuxjbcn2giaqnb44", value_type = String)]
pub merchant_id: id_type::MerchantId,
/// Unique ID of the connector
#[schema(example = "mca_5apGeP94tMts6rg3U3kR")]
pub id: String,
/// If the connector is deleted or not
#[schema(example = false)]
pub deleted: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct ToggleKVResponse {
/// The identifier for the Merchant Account