Skip to content

Commit

Permalink
Merge branch 'main' into nexixpay-card-mandates
Browse files Browse the repository at this point in the history
  • Loading branch information
mrudulvajpayee4935 authored Dec 4, 2024
2 parents 176d2aa + fa21ef8 commit a216702
Show file tree
Hide file tree
Showing 20 changed files with 462 additions and 172 deletions.
17 changes: 17 additions & 0 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,3 +446,20 @@ pub enum StripeChargeType {
pub fn convert_frm_connector(connector_name: &str) -> Option<FrmConnectors> {
FrmConnectors::from_str(connector_name).ok()
}

#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, serde::Serialize, Hash)]
pub enum ReconPermissionScope {
#[serde(rename = "R")]
Read = 0,
#[serde(rename = "RW")]
Write = 1,
}

impl From<PermissionScope> for ReconPermissionScope {
fn from(scope: PermissionScope) -> Self {
match scope {
PermissionScope::Read => Self::Read,
PermissionScope::Write => Self::Write,
}
}
}
13 changes: 12 additions & 1 deletion crates/api_models/src/events/recon.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};
use masking::PeekInterface;

use crate::recon::{ReconStatusResponse, ReconTokenResponse, ReconUpdateMerchantRequest};
use crate::recon::{
ReconStatusResponse, ReconTokenResponse, ReconUpdateMerchantRequest, VerifyTokenResponse,
};

impl ApiEventMetric for ReconUpdateMerchantRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Expand All @@ -19,3 +22,11 @@ impl ApiEventMetric for ReconStatusResponse {
Some(ApiEventsType::Recon)
}
}

impl ApiEventMetric for VerifyTokenResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::User {
user_id: self.user_email.peek().to_string(),
})
}
}
13 changes: 0 additions & 13 deletions crates/api_models/src/events/user.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};
#[cfg(feature = "recon")]
use masking::PeekInterface;

#[cfg(feature = "dummy_connector")]
use crate::user::sample_data::SampleDataRequest;
#[cfg(feature = "recon")]
use crate::user::VerifyTokenResponse;
use crate::user::{
dashboard_metadata::{
GetMetaDataRequest, GetMetaDataResponse, GetMultipleMetaDataPayload, SetMetaDataRequest,
Expand All @@ -23,15 +19,6 @@ use crate::user::{
VerifyTotpRequest,
};

#[cfg(feature = "recon")]
impl ApiEventMetric for VerifyTokenResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::User {
user_id: self.user_email.peek().to_string(),
})
}
}

common_utils::impl_api_event_type!(
Miscellaneous,
(
Expand Down
10 changes: 9 additions & 1 deletion crates/api_models/src/recon.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use common_utils::pii;
use common_utils::{id_type, pii};
use masking::Secret;

use crate::enums;
Expand All @@ -18,3 +18,11 @@ pub struct ReconTokenResponse {
pub struct ReconStatusResponse {
pub recon_status: enums::ReconStatus,
}

#[derive(serde::Serialize, Debug)]
pub struct VerifyTokenResponse {
pub merchant_id: id_type::MerchantId,
pub user_email: pii::Email,
#[serde(skip_serializing_if = "Option::is_none")]
pub acl: Option<String>,
}
7 changes: 0 additions & 7 deletions crates/api_models/src/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@ pub struct SendVerifyEmailRequest {
pub email: pii::Email,
}

#[cfg(feature = "recon")]
#[derive(serde::Serialize, Debug)]
pub struct VerifyTokenResponse {
pub merchant_id: id_type::MerchantId,
pub user_email: pii::Email,
}

#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct UpdateUserAccountDetailsRequest {
pub name: Option<Secret<String>>,
Expand Down
19 changes: 16 additions & 3 deletions crates/common_enums/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2819,9 +2819,15 @@ pub enum PermissionGroup {
MerchantDetailsManage,
// TODO: To be deprecated, make sure DB is migrated before removing
OrganizationManage,
ReconOps,
AccountView,
AccountManage,
ReconReportsView,
ReconReportsManage,
ReconOpsView,
// Alias is added for backward compatibility with database
// TODO: Remove alias post migration
#[serde(alias = "recon_ops")]
ReconOpsManage,
}

#[derive(Clone, Debug, serde::Serialize, PartialEq, Eq, Hash, strum::EnumIter)]
Expand All @@ -2831,7 +2837,8 @@ pub enum ParentGroup {
Workflows,
Analytics,
Users,
Recon,
ReconOps,
ReconReports,
Account,
}

Expand All @@ -2854,7 +2861,13 @@ pub enum Resource {
WebhookEvent,
Payout,
Report,
Recon,
ReconToken,
ReconFiles,
ReconAndSettlementAnalytics,
ReconUpload,
ReconReports,
RunRecon,
ReconConfig,
}

#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, serde::Serialize, Hash)]
Expand Down
1 change: 1 addition & 0 deletions crates/connector_configs/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ pub struct ConfigMetadata {
#[derive(Debug, Deserialize, serde::Serialize, Clone)]
pub struct ConnectorWalletDetailsConfig {
pub samsung_pay: Option<Vec<InputData>>,
pub paze: Option<Vec<InputData>>,
}

#[serde_with::skip_serializing_none]
Expand Down
19 changes: 19 additions & 0 deletions crates/connector_configs/toml/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,25 @@ required=true
type="MultiSelect"
options=["visa","masterCard","amex","discover"]

[[cybersource.connector_wallets_details.paze]]
name="client_id"
label="Client Id"
placeholder="Enter paze Client Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.paze]]
name="client_profile_id"
label="Client Profile Id"
placeholder="Enter Client Profile Id"
required=true
type="Text"
[[cybersource.connector_wallets_details.paze]]
name="client_name"
label="Display Name"
placeholder="Enter Display Name"
required=true
type="Text"

[cybersource.metadata.acquirer_bin]
name="acquirer_bin"
label="Acquirer Bin"
Expand Down
Loading

0 comments on commit a216702

Please sign in to comment.