chore(merchant_account): remove api_key field (#713)

This commit is contained in:
Sanchith Hegde
2023-03-13 14:31:20 +05:30
committed by GitHub
parent 16bc886c77
commit 230fcdd4e1
14 changed files with 22 additions and 110 deletions

View File

@ -1,6 +1,5 @@
use common_utils::pii;
use diesel::{AsChangeset, Identifiable, Insertable, Queryable};
use masking::StrongSecret;
use crate::{enums as storage_enums, schema::merchant_account};
@ -19,7 +18,6 @@ use crate::{enums as storage_enums, schema::merchant_account};
pub struct MerchantAccount {
pub id: i32,
pub merchant_id: String,
pub api_key: Option<StrongSecret<String>>,
pub return_url: Option<String>,
pub enable_payment_response_hash: bool,
pub payment_response_hash_key: Option<String>,
@ -41,7 +39,6 @@ pub struct MerchantAccount {
pub struct MerchantAccountNew {
pub merchant_id: String,
pub merchant_name: Option<String>,
pub api_key: Option<StrongSecret<String>>,
pub merchant_details: Option<serde_json::Value>,
pub return_url: Option<String>,
pub webhook_details: Option<serde_json::Value>,
@ -60,7 +57,6 @@ pub struct MerchantAccountNew {
pub enum MerchantAccountUpdate {
Update {
merchant_name: Option<String>,
api_key: Option<StrongSecret<String>>,
merchant_details: Option<serde_json::Value>,
return_url: Option<String>,
webhook_details: Option<serde_json::Value>,
@ -83,7 +79,6 @@ pub enum MerchantAccountUpdate {
#[diesel(table_name = merchant_account)]
pub struct MerchantAccountUpdateInternal {
merchant_name: Option<String>,
api_key: Option<StrongSecret<String>>,
merchant_details: Option<serde_json::Value>,
return_url: Option<String>,
webhook_details: Option<serde_json::Value>,
@ -104,7 +99,6 @@ impl From<MerchantAccountUpdate> for MerchantAccountUpdateInternal {
match merchant_account_update {
MerchantAccountUpdate::Update {
merchant_name,
api_key,
merchant_details,
return_url,
webhook_details,
@ -119,7 +113,6 @@ impl From<MerchantAccountUpdate> for MerchantAccountUpdateInternal {
metadata,
} => Self {
merchant_name,
api_key,
merchant_details,
return_url,
webhook_details,

View File

@ -81,15 +81,6 @@ impl MerchantAccount {
.await
}
#[instrument(skip(conn))]
pub async fn find_by_api_key(conn: &PgPooledConn, api_key: &str) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::api_key.eq(api_key.to_owned()),
)
.await
}
#[instrument(skip_all)]
pub async fn find_by_publishable_key(
conn: &PgPooledConn,

View File

@ -162,7 +162,6 @@ diesel::table! {
merchant_account (id) {
id -> Int4,
merchant_id -> Varchar,
api_key -> Nullable<Varchar>,
return_url -> Nullable<Varchar>,
enable_payment_response_hash -> Bool,
payment_response_hash_key -> Nullable<Varchar>,