fix(router): use Connector enum for connector_name field in MerchantConnectorCreate (#1637)

This commit is contained in:
DEEPANSHU BANSAL
2023-07-07 18:31:21 +05:30
committed by GitHub
parent 36a9f0e8b1
commit e750a73323
3 changed files with 5 additions and 7 deletions

View File

@ -391,8 +391,8 @@ pub struct MerchantConnectorCreate {
#[schema(value_type = ConnectorType, example = "payment_processor")]
pub connector_type: api_enums::ConnectorType,
/// Name of the Connector
#[schema(example = "stripe")]
pub connector_name: String,
#[schema(value_type = Connector, example = "stripe")]
pub connector_name: api_enums::Connector,
// /// Connector label for specific country and Business
#[serde(skip_deserializing)]
#[schema(example = "stripe_US_travel")]

View File

@ -462,7 +462,7 @@ pub async fn create_payment_connector(
business_country,
&business_label,
req.business_sub_label.as_ref(),
&req.connector_name,
&req.connector_name.to_string(),
);
let mut vec = Vec::new();
@ -504,7 +504,7 @@ pub async fn create_payment_connector(
let merchant_connector_account = domain::MerchantConnectorAccount {
merchant_id: merchant_id.to_string(),
connector_type: req.connector_type.foreign_into(),
connector_name: req.connector_name.clone(),
connector_name: req.connector_name.to_string(),
merchant_connector_id: utils::generate_id(consts::ID_LENGTH, "mca"),
connector_account_details: domain_types::encrypt(
req.connector_account_details.ok_or(

View File

@ -4986,9 +4986,7 @@
"$ref": "#/components/schemas/ConnectorType"
},
"connector_name": {
"type": "string",
"description": "Name of the Connector",
"example": "stripe"
"$ref": "#/components/schemas/Connector"
},
"connector_label": {
"type": "string",