mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +08:00
refactor(router): remove metadata, additional_merchant_data and connector_wallets_details from connector list api (#6583)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -10020,11 +10020,6 @@
|
|||||||
],
|
],
|
||||||
"nullable": true
|
"nullable": true
|
||||||
},
|
},
|
||||||
"metadata": {
|
|
||||||
"type": "object",
|
|
||||||
"description": "Metadata is useful for storing additional, unstructured information on an object.",
|
|
||||||
"nullable": true
|
|
||||||
},
|
|
||||||
"disabled": {
|
"disabled": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "A boolean value to indicate if the connector is disabled. By default, its value is false.",
|
"description": "A boolean value to indicate if the connector is disabled. By default, its value is false.",
|
||||||
@ -10055,22 +10050,6 @@
|
|||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"$ref": "#/components/schemas/ConnectorStatus"
|
"$ref": "#/components/schemas/ConnectorStatus"
|
||||||
},
|
|
||||||
"additional_merchant_data": {
|
|
||||||
"allOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/AdditionalMerchantData"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"nullable": true
|
|
||||||
},
|
|
||||||
"connector_wallets_details": {
|
|
||||||
"allOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/ConnectorWalletDetails"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"nullable": true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|||||||
@ -13159,11 +13159,6 @@
|
|||||||
],
|
],
|
||||||
"nullable": true
|
"nullable": true
|
||||||
},
|
},
|
||||||
"metadata": {
|
|
||||||
"type": "object",
|
|
||||||
"description": "Metadata is useful for storing additional, unstructured information on an object.",
|
|
||||||
"nullable": true
|
|
||||||
},
|
|
||||||
"test_mode": {
|
"test_mode": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "A boolean value to indicate if the connector is in Test mode. By default, its value is false.",
|
"description": "A boolean value to indicate if the connector is in Test mode. By default, its value is false.",
|
||||||
@ -13221,22 +13216,6 @@
|
|||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
"$ref": "#/components/schemas/ConnectorStatus"
|
"$ref": "#/components/schemas/ConnectorStatus"
|
||||||
},
|
|
||||||
"additional_merchant_data": {
|
|
||||||
"allOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/AdditionalMerchantData"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"nullable": true
|
|
||||||
},
|
|
||||||
"connector_wallets_details": {
|
|
||||||
"allOf": [
|
|
||||||
{
|
|
||||||
"$ref": "#/components/schemas/ConnectorWalletDetails"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"nullable": true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
|||||||
@ -1313,10 +1313,6 @@ pub struct MerchantConnectorListResponse {
|
|||||||
]))]
|
]))]
|
||||||
pub payment_methods_enabled: Option<Vec<PaymentMethodsEnabled>>,
|
pub payment_methods_enabled: Option<Vec<PaymentMethodsEnabled>>,
|
||||||
|
|
||||||
/// Metadata is useful for storing additional, unstructured information on an object.
|
|
||||||
#[schema(value_type = Option<Object>,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))]
|
|
||||||
pub metadata: Option<pii::SecretSerdeValue>,
|
|
||||||
|
|
||||||
/// A boolean value to indicate if the connector is in Test mode. By default, its value is false.
|
/// A boolean value to indicate if the connector is in Test mode. By default, its value is false.
|
||||||
#[schema(default = false, example = false)]
|
#[schema(default = false, example = false)]
|
||||||
pub test_mode: Option<bool>,
|
pub test_mode: Option<bool>,
|
||||||
@ -1349,13 +1345,6 @@ pub struct MerchantConnectorListResponse {
|
|||||||
|
|
||||||
#[schema(value_type = ConnectorStatus, example = "inactive")]
|
#[schema(value_type = ConnectorStatus, example = "inactive")]
|
||||||
pub status: api_enums::ConnectorStatus,
|
pub status: api_enums::ConnectorStatus,
|
||||||
|
|
||||||
#[schema(value_type = Option<AdditionalMerchantData>)]
|
|
||||||
pub additional_merchant_data: Option<AdditionalMerchantData>,
|
|
||||||
|
|
||||||
/// The connector_wallets_details is used to store wallet details such as certificates and wallet credentials
|
|
||||||
#[schema(value_type = Option<ConnectorWalletDetails>)]
|
|
||||||
pub connector_wallets_details: Option<ConnectorWalletDetails>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "v1")]
|
#[cfg(feature = "v1")]
|
||||||
@ -1423,10 +1412,6 @@ pub struct MerchantConnectorListResponse {
|
|||||||
]))]
|
]))]
|
||||||
pub payment_methods_enabled: Option<Vec<PaymentMethodsEnabled>>,
|
pub payment_methods_enabled: Option<Vec<PaymentMethodsEnabled>>,
|
||||||
|
|
||||||
/// Metadata is useful for storing additional, unstructured information on an object.
|
|
||||||
#[schema(value_type = Option<Object>,max_length = 255,example = json!({ "city": "NY", "unit": "245" }))]
|
|
||||||
pub metadata: Option<pii::SecretSerdeValue>,
|
|
||||||
|
|
||||||
/// A boolean value to indicate if the connector is disabled. By default, its value is false.
|
/// A boolean value to indicate if the connector is disabled. By default, its value is false.
|
||||||
#[schema(default = false, example = false)]
|
#[schema(default = false, example = false)]
|
||||||
pub disabled: Option<bool>,
|
pub disabled: Option<bool>,
|
||||||
@ -1443,13 +1428,6 @@ pub struct MerchantConnectorListResponse {
|
|||||||
|
|
||||||
#[schema(value_type = ConnectorStatus, example = "inactive")]
|
#[schema(value_type = ConnectorStatus, example = "inactive")]
|
||||||
pub status: api_enums::ConnectorStatus,
|
pub status: api_enums::ConnectorStatus,
|
||||||
|
|
||||||
#[schema(value_type = Option<AdditionalMerchantData>)]
|
|
||||||
pub additional_merchant_data: Option<AdditionalMerchantData>,
|
|
||||||
|
|
||||||
/// The connector_wallets_details is used to store wallet details such as certificates and wallet credentials
|
|
||||||
#[schema(value_type = Option<ConnectorWalletDetails>)]
|
|
||||||
pub connector_wallets_details: Option<ConnectorWalletDetails>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "v2")]
|
#[cfg(feature = "v2")]
|
||||||
|
|||||||
@ -1028,7 +1028,6 @@ impl ForeignTryFrom<domain::MerchantConnectorAccount>
|
|||||||
test_mode: item.test_mode,
|
test_mode: item.test_mode,
|
||||||
disabled: item.disabled,
|
disabled: item.disabled,
|
||||||
payment_methods_enabled,
|
payment_methods_enabled,
|
||||||
metadata: item.metadata,
|
|
||||||
business_country: item.business_country,
|
business_country: item.business_country,
|
||||||
business_label: item.business_label,
|
business_label: item.business_label,
|
||||||
business_sub_label: item.business_sub_label,
|
business_sub_label: item.business_sub_label,
|
||||||
@ -1037,31 +1036,6 @@ impl ForeignTryFrom<domain::MerchantConnectorAccount>
|
|||||||
applepay_verified_domains: item.applepay_verified_domains,
|
applepay_verified_domains: item.applepay_verified_domains,
|
||||||
pm_auth_config: item.pm_auth_config,
|
pm_auth_config: item.pm_auth_config,
|
||||||
status: item.status,
|
status: item.status,
|
||||||
additional_merchant_data: item
|
|
||||||
.additional_merchant_data
|
|
||||||
.map(|data| {
|
|
||||||
let data = data.into_inner();
|
|
||||||
serde_json::Value::parse_value::<router_types::AdditionalMerchantData>(
|
|
||||||
data.expose(),
|
|
||||||
"AdditionalMerchantData",
|
|
||||||
)
|
|
||||||
.attach_printable("Unable to deserialize additional_merchant_data")
|
|
||||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
|
||||||
})
|
|
||||||
.transpose()?
|
|
||||||
.map(api_models::admin::AdditionalMerchantData::foreign_from),
|
|
||||||
connector_wallets_details: item
|
|
||||||
.connector_wallets_details
|
|
||||||
.map(|data| {
|
|
||||||
data.into_inner()
|
|
||||||
.expose()
|
|
||||||
.parse_value::<api_models::admin::ConnectorWalletDetails>(
|
|
||||||
"ConnectorWalletDetails",
|
|
||||||
)
|
|
||||||
.attach_printable("Unable to deserialize connector_wallets_details")
|
|
||||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
|
||||||
})
|
|
||||||
.transpose()?,
|
|
||||||
};
|
};
|
||||||
#[cfg(feature = "v2")]
|
#[cfg(feature = "v2")]
|
||||||
let response = Self {
|
let response = Self {
|
||||||
@ -1071,37 +1045,11 @@ impl ForeignTryFrom<domain::MerchantConnectorAccount>
|
|||||||
connector_label: item.connector_label,
|
connector_label: item.connector_label,
|
||||||
disabled: item.disabled,
|
disabled: item.disabled,
|
||||||
payment_methods_enabled,
|
payment_methods_enabled,
|
||||||
metadata: item.metadata,
|
|
||||||
frm_configs,
|
frm_configs,
|
||||||
profile_id: item.profile_id,
|
profile_id: item.profile_id,
|
||||||
applepay_verified_domains: item.applepay_verified_domains,
|
applepay_verified_domains: item.applepay_verified_domains,
|
||||||
pm_auth_config: item.pm_auth_config,
|
pm_auth_config: item.pm_auth_config,
|
||||||
status: item.status,
|
status: item.status,
|
||||||
additional_merchant_data: item
|
|
||||||
.additional_merchant_data
|
|
||||||
.map(|data| {
|
|
||||||
let data = data.into_inner();
|
|
||||||
serde_json::Value::parse_value::<router_types::AdditionalMerchantData>(
|
|
||||||
data.expose(),
|
|
||||||
"AdditionalMerchantData",
|
|
||||||
)
|
|
||||||
.attach_printable("Unable to deserialize additional_merchant_data")
|
|
||||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
|
||||||
})
|
|
||||||
.transpose()?
|
|
||||||
.map(api_models::admin::AdditionalMerchantData::foreign_from),
|
|
||||||
connector_wallets_details: item
|
|
||||||
.connector_wallets_details
|
|
||||||
.map(|data| {
|
|
||||||
data.into_inner()
|
|
||||||
.expose()
|
|
||||||
.parse_value::<api_models::admin::ConnectorWalletDetails>(
|
|
||||||
"ConnectorWalletDetails",
|
|
||||||
)
|
|
||||||
.attach_printable("Unable to deserialize connector_wallets_details")
|
|
||||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
|
||||||
})
|
|
||||||
.transpose()?,
|
|
||||||
};
|
};
|
||||||
Ok(response)
|
Ok(response)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -631,6 +631,11 @@ Cypress.Commands.add("connectorListByMid", (globalState) => {
|
|||||||
logRequestId(response.headers["x-request-id"]);
|
logRequestId(response.headers["x-request-id"]);
|
||||||
expect(response.headers["content-type"]).to.include("application/json");
|
expect(response.headers["content-type"]).to.include("application/json");
|
||||||
expect(response.body).to.be.an("array").and.not.empty;
|
expect(response.body).to.be.an("array").and.not.empty;
|
||||||
|
response.body.forEach((item) => {
|
||||||
|
expect(item).to.not.have.property("metadata");
|
||||||
|
expect(item).to.not.have.property("additional_merchant_data");
|
||||||
|
expect(item).to.not.have.property("connector_wallets_details");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user