fix: fix internal server errors on merchant connector account creation (#1026)

This commit is contained in:
Hrithikesh
2023-05-03 02:32:20 +05:30
committed by GitHub
parent 4728d946e2
commit c31b4b41c2
2 changed files with 8 additions and 4 deletions

View File

@ -414,6 +414,8 @@ pub async fn create_payment_connector(
business_country, business_country,
business_label, business_label,
business_sub_label: req.business_sub_label, business_sub_label: req.business_sub_label,
created_at: common_utils::date_time::now(),
modified_at: common_utils::date_time::now(),
}; };
let mca = store let mca = store

View File

@ -37,7 +37,7 @@ pub struct MerchantConnectorAccount {
pub modified_at: time::PrimitiveDateTime, pub modified_at: time::PrimitiveDateTime,
} }
#[derive(Clone, Debug, Default, Insertable, router_derive::DebugAsDisplay)] #[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
#[diesel(table_name = merchant_connector_account)] #[diesel(table_name = merchant_connector_account)]
pub struct MerchantConnectorAccountNew { pub struct MerchantConnectorAccountNew {
pub merchant_id: Option<String>, pub merchant_id: Option<String>,
@ -54,6 +54,8 @@ pub struct MerchantConnectorAccountNew {
pub business_country: storage_enums::CountryCode, pub business_country: storage_enums::CountryCode,
pub business_label: String, pub business_label: String,
pub business_sub_label: Option<String>, pub business_sub_label: Option<String>,
pub created_at: time::PrimitiveDateTime,
pub modified_at: time::PrimitiveDateTime,
} }
#[derive(Debug)] #[derive(Debug)]
@ -70,7 +72,7 @@ pub enum MerchantConnectorAccountUpdate {
frm_configs: Option<Secret<serde_json::Value>>, frm_configs: Option<Secret<serde_json::Value>>,
}, },
} }
#[derive(Clone, Debug, Default, AsChangeset, router_derive::DebugAsDisplay)] #[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
#[diesel(table_name = merchant_connector_account)] #[diesel(table_name = merchant_connector_account)]
pub struct MerchantConnectorAccountUpdateInternal { pub struct MerchantConnectorAccountUpdateInternal {
merchant_id: Option<String>, merchant_id: Option<String>,
@ -82,7 +84,7 @@ pub struct MerchantConnectorAccountUpdateInternal {
payment_methods_enabled: Option<Vec<serde_json::Value>>, payment_methods_enabled: Option<Vec<serde_json::Value>>,
metadata: Option<pii::SecretSerdeValue>, metadata: Option<pii::SecretSerdeValue>,
frm_configs: Option<Secret<serde_json::Value>>, frm_configs: Option<Secret<serde_json::Value>>,
modified_at: Option<time::PrimitiveDateTime>, modified_at: time::PrimitiveDateTime,
} }
impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInternal { impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInternal {
@ -108,7 +110,7 @@ impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInte
payment_methods_enabled, payment_methods_enabled,
metadata, metadata,
frm_configs, frm_configs,
modified_at: Some(common_utils::date_time::now()), modified_at: common_utils::date_time::now(),
}, },
} }
} }