Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions crates/diesel_models/src/business_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub struct BusinessProfile {
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<String>,
pub is_tax_connector_enabled: Option<bool>,
pub api_version: common_enums::ApiVersion,
pub version: common_enums::ApiVersion,
}

#[cfg(all(
Expand Down Expand Up @@ -101,7 +101,7 @@ pub struct BusinessProfileNew {
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<String>,
pub is_tax_connector_enabled: Option<bool>,
pub api_version: common_enums::ApiVersion,
pub version: common_enums::ApiVersion,
}

#[cfg(all(
Expand Down Expand Up @@ -231,7 +231,7 @@ impl BusinessProfileUpdateInternal {
.or(source.always_collect_shipping_details_from_wallet_connector),
tax_connector_id: tax_connector_id.or(source.tax_connector_id),
is_tax_connector_enabled: is_tax_connector_enabled.or(source.is_tax_connector_enabled),
api_version: source.api_version,
version: source.version,
}
}
}
Expand Down Expand Up @@ -271,16 +271,16 @@ pub struct BusinessProfile {
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<String>,
pub is_tax_connector_enabled: Option<bool>,
pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub order_fulfillment_time: Option<i64>,
pub order_fulfillment_time_origin: Option<common_enums::OrderFulfillmentTimeOrigin>,
pub frm_routing_algorithm_id: Option<String>,
pub payout_routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub default_fallback_routing: Option<pii::SecretSerdeValue>,
pub id: common_utils::id_type::ProfileId,
pub tax_connector_id: Option<String>,
pub is_tax_connector_enabled: Option<bool>,
pub api_version: common_enums::ApiVersion,
pub version: common_enums::ApiVersion,
}

impl BusinessProfile {
Expand Down Expand Up @@ -328,16 +328,16 @@ pub struct BusinessProfileNew {
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<String>,
pub is_tax_connector_enabled: Option<bool>,
pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub order_fulfillment_time: Option<i64>,
pub order_fulfillment_time_origin: Option<common_enums::OrderFulfillmentTimeOrigin>,
pub frm_routing_algorithm_id: Option<String>,
pub payout_routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub default_fallback_routing: Option<pii::SecretSerdeValue>,
pub id: common_utils::id_type::ProfileId,
pub tax_connector_id: Option<String>,
pub is_tax_connector_enabled: Option<bool>,
pub api_version: common_enums::ApiVersion,
pub version: common_enums::ApiVersion,
}

#[cfg(all(feature = "v2", feature = "business_profile_v2"))]
Expand Down Expand Up @@ -368,14 +368,14 @@ pub struct BusinessProfileUpdateInternal {
pub outgoing_webhook_custom_http_headers: Option<Encryption>,
pub always_collect_billing_details_from_wallet_connector: Option<bool>,
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<String>,
pub is_tax_connector_enabled: Option<bool>,
pub routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub order_fulfillment_time: Option<i64>,
pub order_fulfillment_time_origin: Option<common_enums::OrderFulfillmentTimeOrigin>,
pub frm_routing_algorithm_id: Option<String>,
pub payout_routing_algorithm_id: Option<common_utils::id_type::RoutingId>,
pub default_fallback_routing: Option<pii::SecretSerdeValue>,
pub tax_connector_id: Option<String>,
pub is_tax_connector_enabled: Option<bool>,
}

#[cfg(all(feature = "v2", feature = "business_profile_v2"))]
Expand Down Expand Up @@ -405,14 +405,14 @@ impl BusinessProfileUpdateInternal {
outgoing_webhook_custom_http_headers,
always_collect_billing_details_from_wallet_connector,
always_collect_shipping_details_from_wallet_connector,
tax_connector_id,
is_tax_connector_enabled,
routing_algorithm_id,
order_fulfillment_time,
order_fulfillment_time_origin,
frm_routing_algorithm_id,
payout_routing_algorithm_id,
default_fallback_routing,
tax_connector_id,
is_tax_connector_enabled,
} = self;
BusinessProfile {
id: source.id,
Expand Down Expand Up @@ -459,6 +459,8 @@ impl BusinessProfileUpdateInternal {
always_collect_shipping_details_from_wallet_connector:
always_collect_shipping_details_from_wallet_connector
.or(always_collect_shipping_details_from_wallet_connector),
tax_connector_id: tax_connector_id.or(source.tax_connector_id),
is_tax_connector_enabled: is_tax_connector_enabled.or(source.is_tax_connector_enabled),
routing_algorithm_id: routing_algorithm_id.or(source.routing_algorithm_id),
order_fulfillment_time: order_fulfillment_time.or(source.order_fulfillment_time),
order_fulfillment_time_origin: order_fulfillment_time_origin
Expand All @@ -467,9 +469,7 @@ impl BusinessProfileUpdateInternal {
payout_routing_algorithm_id: payout_routing_algorithm_id
.or(source.payout_routing_algorithm_id),
default_fallback_routing: default_fallback_routing.or(source.default_fallback_routing),
tax_connector_id: tax_connector_id.or(source.tax_connector_id),
is_tax_connector_enabled: is_tax_connector_enabled.or(source.is_tax_connector_enabled),
api_version: source.api_version,
version: source.version,
}
}
}
Expand Down Expand Up @@ -507,6 +507,8 @@ impl From<BusinessProfileNew> for BusinessProfile {
collect_billing_details_from_wallet_connector: new
.collect_billing_details_from_wallet_connector,
outgoing_webhook_custom_http_headers: new.outgoing_webhook_custom_http_headers,
tax_connector_id: new.tax_connector_id,
is_tax_connector_enabled: new.is_tax_connector_enabled,
routing_algorithm_id: new.routing_algorithm_id,
always_collect_billing_details_from_wallet_connector: new
.always_collect_billing_details_from_wallet_connector,
Expand All @@ -517,9 +519,7 @@ impl From<BusinessProfileNew> for BusinessProfile {
frm_routing_algorithm_id: new.frm_routing_algorithm_id,
payout_routing_algorithm_id: new.payout_routing_algorithm_id,
default_fallback_routing: new.default_fallback_routing,
tax_connector_id: new.tax_connector_id,
is_tax_connector_enabled: new.is_tax_connector_enabled,
api_version: new.api_version,
version: new.version,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/diesel_models/src/merchant_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ pub struct MerchantAccount {
pub modified_at: time::PrimitiveDateTime,
pub organization_id: common_utils::id_type::OrganizationId,
pub recon_status: storage_enums::ReconStatus,
pub id: common_utils::id_type::MerchantId,
pub version: common_enums::ApiVersion,
pub id: common_utils::id_type::MerchantId,
}

#[cfg(all(feature = "v2", feature = "merchant_account_v2"))]
Expand Down
2 changes: 1 addition & 1 deletion crates/diesel_models/src/merchant_connector_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ pub struct MerchantConnectorAccount {
pub status: storage_enums::ConnectorStatus,
pub additional_merchant_data: Option<Encryption>,
pub connector_wallets_details: Option<Encryption>,
pub id: id_type::MerchantConnectorAccountId,
pub version: common_enums::ApiVersion,
pub id: id_type::MerchantConnectorAccountId,
}

#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
Expand Down
2 changes: 1 addition & 1 deletion crates/diesel_models/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ diesel::table! {
#[max_length = 64]
tax_connector_id -> Nullable<Varchar>,
is_tax_connector_enabled -> Nullable<Bool>,
api_version -> ApiVersion,
version -> ApiVersion,
}
}

Expand Down
12 changes: 6 additions & 6 deletions crates/diesel_models/src/schema_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ diesel::table! {
always_collect_billing_details_from_wallet_connector -> Nullable<Bool>,
always_collect_shipping_details_from_wallet_connector -> Nullable<Bool>,
#[max_length = 64]
tax_connector_id -> Nullable<Varchar>,
is_tax_connector_enabled -> Nullable<Bool>,
#[max_length = 64]
routing_algorithm_id -> Nullable<Varchar>,
order_fulfillment_time -> Nullable<Int8>,
order_fulfillment_time_origin -> Nullable<OrderFulfillmentTimeOrigin>,
Expand All @@ -212,10 +215,7 @@ diesel::table! {
default_fallback_routing -> Nullable<Jsonb>,
#[max_length = 64]
id -> Varchar,
#[max_length = 64]
tax_connector_id -> Nullable<Varchar>,
is_tax_connector_enabled -> Nullable<Bool>,
api_version -> ApiVersion,
version -> ApiVersion,
}
}

Expand Down Expand Up @@ -660,9 +660,9 @@ diesel::table! {
#[max_length = 32]
organization_id -> Varchar,
recon_status -> ReconStatus,
version -> ApiVersion,
#[max_length = 64]
id -> Varchar,
version -> ApiVersion,
}
}

Expand Down Expand Up @@ -693,9 +693,9 @@ diesel::table! {
status -> ConnectorStatus,
additional_merchant_data -> Nullable<Bytea>,
connector_wallets_details -> Nullable<Bytea>,
version -> ApiVersion,
#[max_length = 64]
id -> Varchar,
version -> ApiVersion,
}
}

Expand Down
20 changes: 10 additions & 10 deletions crates/hyperswitch_domain_models/src/business_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub struct BusinessProfile {
pub always_collect_shipping_details_from_wallet_connector: Option<bool>,
pub tax_connector_id: Option<String>,
pub is_tax_connector_enabled: bool,
pub api_version: common_enums::ApiVersion,
pub version: common_enums::ApiVersion,
}

#[cfg(all(
Expand Down Expand Up @@ -141,7 +141,7 @@ impl From<BusinessProfileSetter> for BusinessProfile {
.always_collect_shipping_details_from_wallet_connector,
tax_connector_id: value.tax_connector_id,
is_tax_connector_enabled: value.is_tax_connector_enabled,
api_version: consts::API_VERSION,
version: consts::API_VERSION,
}
}
}
Expand Down Expand Up @@ -439,7 +439,7 @@ impl super::behaviour::Conversion for BusinessProfile {
.always_collect_shipping_details_from_wallet_connector,
tax_connector_id: self.tax_connector_id,
is_tax_connector_enabled: Some(self.is_tax_connector_enabled),
api_version: self.api_version,
version: self.version,
})
}

Expand Down Expand Up @@ -503,7 +503,7 @@ impl super::behaviour::Conversion for BusinessProfile {
.await?,
tax_connector_id: item.tax_connector_id,
is_tax_connector_enabled: item.is_tax_connector_enabled.unwrap_or(false),
api_version: item.api_version,
version: item.version,
})
}
.await
Expand Down Expand Up @@ -552,7 +552,7 @@ impl super::behaviour::Conversion for BusinessProfile {
.always_collect_shipping_details_from_wallet_connector,
tax_connector_id: self.tax_connector_id,
is_tax_connector_enabled: Some(self.is_tax_connector_enabled),
api_version: self.api_version,
version: self.version,
})
}
}
Expand Down Expand Up @@ -594,7 +594,7 @@ pub struct BusinessProfile {
pub default_fallback_routing: Option<pii::SecretSerdeValue>,
pub tax_connector_id: Option<String>,
pub is_tax_connector_enabled: bool,
pub api_version: common_enums::ApiVersion,
pub version: common_enums::ApiVersion,
}

#[cfg(all(feature = "v2", feature = "business_profile_v2"))]
Expand Down Expand Up @@ -677,7 +677,7 @@ impl From<BusinessProfileSetter> for BusinessProfile {
default_fallback_routing: value.default_fallback_routing,
tax_connector_id: value.tax_connector_id,
is_tax_connector_enabled: value.is_tax_connector_enabled,
api_version: consts::API_VERSION,
version: consts::API_VERSION,
}
}
}
Expand Down Expand Up @@ -1002,7 +1002,7 @@ impl super::behaviour::Conversion for BusinessProfile {
default_fallback_routing: self.default_fallback_routing,
tax_connector_id: self.tax_connector_id,
is_tax_connector_enabled: Some(self.is_tax_connector_enabled),
api_version: self.api_version,
version: self.version,
})
}

Expand Down Expand Up @@ -1068,7 +1068,7 @@ impl super::behaviour::Conversion for BusinessProfile {
default_fallback_routing: item.default_fallback_routing,
tax_connector_id: item.tax_connector_id,
is_tax_connector_enabled: item.is_tax_connector_enabled.unwrap_or(false),
api_version: item.api_version,
version: item.version,
})
}
.await
Expand Down Expand Up @@ -1119,7 +1119,7 @@ impl super::behaviour::Conversion for BusinessProfile {
default_fallback_routing: self.default_fallback_routing,
tax_connector_id: self.tax_connector_id,
is_tax_connector_enabled: Some(self.is_tax_connector_enabled),
api_version: self.api_version,
version: self.version,
})
}
}
4 changes: 2 additions & 2 deletions crates/router/src/core/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@ impl<'a> MerchantDefaultConfigUpdate<'a> {
))]
struct DefaultFallbackRoutingConfigUpdate<'a> {
routable_connector: &'a Option<api_enums::RoutableConnectors>,
merchant_connector_id: &'a common_utils::id_type::MerchantConnectorAccountId,
merchant_connector_id: &'a id_type::MerchantConnectorAccountId,
store: &'a dyn StorageInterface,
business_profile: domain::BusinessProfile,
key_store: hyperswitch_domain_models::merchant_key_store::MerchantKeyStore,
Expand Down Expand Up @@ -4077,7 +4077,7 @@ impl BusinessProfileWrapper {
db: &dyn StorageInterface,
key_manager_state: &KeyManagerState,
merchant_key_store: &domain::MerchantKeyStore,
algorithm_id: common_utils::id_type::RoutingId,
algorithm_id: id_type::RoutingId,
transaction_type: &storage::enums::TransactionType,
) -> RouterResult<()> {
let routing_cache_key = self.clone().get_routing_config_cache_key();
Expand Down
2 changes: 1 addition & 1 deletion crates/router/src/core/payment_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ pub(crate) async fn get_payment_method_create_request(
.flatten(),
};
let payment_method_request = payment_methods::PaymentMethodCreate {
payment_method: payment_method,
payment_method,
payment_method_type: payment_method_type
.get_required_value("Payment_method_type")
.change_context(errors::ApiErrorResponse::MissingRequiredField {
Expand Down
2 changes: 1 addition & 1 deletion crates/router/src/core/payment_methods/cards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3975,7 +3975,7 @@ pub async fn filter_payment_methods(
_mca_id: String,
_payment_methods: &[Secret<serde_json::Value>],
_req: &mut api::PaymentMethodListRequest,
_resp: &mut Vec<ResponsePaymentMethodIntermediate>,
_resp: &mut [ResponsePaymentMethodIntermediate],
_payment_intent: Option<&storage::PaymentIntent>,
_payment_attempt: Option<&storage::PaymentAttempt>,
_address: Option<&domain::Address>,
Expand Down
2 changes: 1 addition & 1 deletion crates/router/src/core/payments/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ pub async fn get_token_pm_type_mandate_details(

#[cfg(all(feature = "v2", feature = "merchant_connector_account_v2"))]
let connector_name = db
.find_merchant_connector_account_by_id(key_manager_state, &mca_id, &merchant_key_store)
.find_merchant_connector_account_by_id(key_manager_state, mca_id, merchant_key_store)
.await
.to_not_found_response(errors::ApiErrorResponse::MerchantConnectorAccountNotFound {
id: mca_id.clone().get_string_repr().to_string(),
Expand Down
2 changes: 1 addition & 1 deletion crates/router/src/core/payments/tokenization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ where
pub async fn save_payment_method<FData>(
_state: &SessionState,
_connector_name: String,
_merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
_merchant_connector_id: Option<id_type::MerchantConnectorAccountId>,
_save_payment_method_data: SavePaymentMethodData<FData>,
_customer_id: Option<id_type::CustomerId>,
_merchant_account: &domain::MerchantAccount,
Expand Down
Loading
Loading