mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
refactor: move merchant_key_store table to accounts schema (#7746)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -3946,7 +3946,7 @@ impl ProfileCreateBridge for api::ProfileCreate {
|
||||
.or(Some(common_utils::consts::DEFAULT_ORDER_FULFILLMENT_TIME)),
|
||||
order_fulfillment_time_origin: self.order_fulfillment_time_origin,
|
||||
default_fallback_routing: None,
|
||||
should_collect_cvv_during_payment: false,
|
||||
should_collect_cvv_during_payment: None,
|
||||
tax_connector_id: self.tax_connector_id,
|
||||
is_tax_connector_enabled: self.is_tax_connector_enabled,
|
||||
is_network_tokenization_enabled: self.is_network_tokenization_enabled,
|
||||
|
||||
@ -168,6 +168,7 @@ pub trait AccountsStorageInterface:
|
||||
+ merchant_account::MerchantAccountInterface
|
||||
+ business_profile::ProfileInterface
|
||||
+ merchant_connector_account::MerchantConnectorAccountInterface
|
||||
+ merchant_key_store::MerchantKeyStoreInterface
|
||||
+ 'static
|
||||
{
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ impl MerchantKeyStoreInterface for Store {
|
||||
merchant_key_store: domain::MerchantKeyStore,
|
||||
key: &Secret<Vec<u8>>,
|
||||
) -> CustomResult<domain::MerchantKeyStore, errors::StorageError> {
|
||||
let conn = connection::pg_connection_write(self).await?;
|
||||
let conn = connection::pg_accounts_connection_write(self).await?;
|
||||
let merchant_id = merchant_key_store.merchant_id.clone();
|
||||
merchant_key_store
|
||||
.construct_new()
|
||||
@ -85,7 +85,7 @@ impl MerchantKeyStoreInterface for Store {
|
||||
key: &Secret<Vec<u8>>,
|
||||
) -> CustomResult<domain::MerchantKeyStore, errors::StorageError> {
|
||||
let fetch_func = || async {
|
||||
let conn = connection::pg_connection_read(self).await?;
|
||||
let conn = connection::pg_accounts_connection_read(self).await?;
|
||||
|
||||
diesel_models::merchant_key_store::MerchantKeyStore::find_by_merchant_id(
|
||||
&conn,
|
||||
@ -127,7 +127,7 @@ impl MerchantKeyStoreInterface for Store {
|
||||
merchant_id: &common_utils::id_type::MerchantId,
|
||||
) -> CustomResult<bool, errors::StorageError> {
|
||||
let delete_func = || async {
|
||||
let conn = connection::pg_connection_write(self).await?;
|
||||
let conn = connection::pg_accounts_connection_write(self).await?;
|
||||
diesel_models::merchant_key_store::MerchantKeyStore::delete_by_merchant_id(
|
||||
&conn,
|
||||
merchant_id,
|
||||
@ -163,7 +163,7 @@ impl MerchantKeyStoreInterface for Store {
|
||||
key: &Secret<Vec<u8>>,
|
||||
) -> CustomResult<Vec<domain::MerchantKeyStore>, errors::StorageError> {
|
||||
let fetch_func = || async {
|
||||
let conn = connection::pg_connection_read(self).await?;
|
||||
let conn = connection::pg_accounts_connection_read(self).await?;
|
||||
|
||||
diesel_models::merchant_key_store::MerchantKeyStore::list_multiple_key_stores(
|
||||
&conn,
|
||||
@ -190,7 +190,7 @@ impl MerchantKeyStoreInterface for Store {
|
||||
from: u32,
|
||||
to: u32,
|
||||
) -> CustomResult<Vec<domain::MerchantKeyStore>, errors::StorageError> {
|
||||
let conn = connection::pg_connection_read(self).await?;
|
||||
let conn = connection::pg_accounts_connection_read(self).await?;
|
||||
let stores = diesel_models::merchant_key_store::MerchantKeyStore::list_all_key_stores(
|
||||
&conn, from, to,
|
||||
)
|
||||
|
||||
@ -9,6 +9,8 @@ use cards::CardNumber;
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
use cards::{CardNumber, NetworkToken};
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
use common_types::primitive_wrappers;
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
use common_utils::generate_id;
|
||||
use common_utils::id_type;
|
||||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))]
|
||||
@ -123,7 +125,7 @@ impl VaultingInterface for VaultDelete {
|
||||
pub struct SavedPMLPaymentsInfo {
|
||||
pub payment_intent: storage::PaymentIntent,
|
||||
pub profile: domain::Profile,
|
||||
pub collect_cvv_during_payment: bool,
|
||||
pub collect_cvv_during_payment: Option<primitive_wrappers::ShouldCollectCvvDuringPayment>,
|
||||
pub off_session_payment_flag: bool,
|
||||
pub is_connector_agnostic_mit_enabled: bool,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user