Skip to content

Commit c31b4b4

Browse files
fix: fix internal server errors on merchant connector account creation (#1026)
1 parent 4728d94 commit c31b4b4

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

crates/router/src/core/admin.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ pub async fn create_payment_connector(
414414
business_country,
415415
business_label,
416416
business_sub_label: req.business_sub_label,
417+
created_at: common_utils::date_time::now(),
418+
modified_at: common_utils::date_time::now(),
417419
};
418420

419421
let mca = store

crates/storage_models/src/merchant_connector_account.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct MerchantConnectorAccount {
3737
pub modified_at: time::PrimitiveDateTime,
3838
}
3939

40-
#[derive(Clone, Debug, Default, Insertable, router_derive::DebugAsDisplay)]
40+
#[derive(Clone, Debug, Insertable, router_derive::DebugAsDisplay)]
4141
#[diesel(table_name = merchant_connector_account)]
4242
pub struct MerchantConnectorAccountNew {
4343
pub merchant_id: Option<String>,
@@ -54,6 +54,8 @@ pub struct MerchantConnectorAccountNew {
5454
pub business_country: storage_enums::CountryCode,
5555
pub business_label: String,
5656
pub business_sub_label: Option<String>,
57+
pub created_at: time::PrimitiveDateTime,
58+
pub modified_at: time::PrimitiveDateTime,
5759
}
5860

5961
#[derive(Debug)]
@@ -70,7 +72,7 @@ pub enum MerchantConnectorAccountUpdate {
7072
frm_configs: Option<Secret<serde_json::Value>>,
7173
},
7274
}
73-
#[derive(Clone, Debug, Default, AsChangeset, router_derive::DebugAsDisplay)]
75+
#[derive(Clone, Debug, AsChangeset, router_derive::DebugAsDisplay)]
7476
#[diesel(table_name = merchant_connector_account)]
7577
pub struct MerchantConnectorAccountUpdateInternal {
7678
merchant_id: Option<String>,
@@ -82,7 +84,7 @@ pub struct MerchantConnectorAccountUpdateInternal {
8284
payment_methods_enabled: Option<Vec<serde_json::Value>>,
8385
metadata: Option<pii::SecretSerdeValue>,
8486
frm_configs: Option<Secret<serde_json::Value>>,
85-
modified_at: Option<time::PrimitiveDateTime>,
87+
modified_at: time::PrimitiveDateTime,
8688
}
8789

8890
impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInternal {
@@ -108,7 +110,7 @@ impl From<MerchantConnectorAccountUpdate> for MerchantConnectorAccountUpdateInte
108110
payment_methods_enabled,
109111
metadata,
110112
frm_configs,
111-
modified_at: Some(common_utils::date_time::now()),
113+
modified_at: common_utils::date_time::now(),
112114
},
113115
}
114116
}

0 commit comments

Comments
 (0)