feat(recon): add recon APIs (#3345)

Co-authored-by: Kashif <mohammed.kashif@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Kashif
2024-01-16 16:37:44 +05:30
committed by GitHub
parent 5ad3f8939a
commit 8678f8d144
22 changed files with 639 additions and 7 deletions

View File

@ -5,6 +5,8 @@ mod locker_migration;
pub mod payment;
#[cfg(feature = "payouts")]
pub mod payouts;
#[cfg(feature = "recon")]
pub mod recon;
pub mod refund;
pub mod routing;
pub mod user;

View File

@ -0,0 +1,21 @@
use common_utils::events::{ApiEventMetric, ApiEventsType};
use crate::recon::{ReconStatusResponse, ReconTokenResponse, ReconUpdateMerchantRequest};
impl ApiEventMetric for ReconUpdateMerchantRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Recon)
}
}
impl ApiEventMetric for ReconTokenResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Recon)
}
}
impl ApiEventMetric for ReconStatusResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::Recon)
}
}

View File

@ -1,7 +1,11 @@
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,
@ -21,6 +25,16 @@ impl ApiEventMetric for DashboardEntryResponse {
}
}
#[cfg(feature = "recon")]
impl ApiEventMetric for VerifyTokenResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
Some(ApiEventsType::User {
merchant_id: self.merchant_id.clone(),
user_id: self.user_email.peek().to_string(),
})
}
}
common_utils::impl_misc_api_event_type!(
SignUpRequest,
SignUpWithMerchantIdRequest,

View File

@ -26,6 +26,8 @@ pub mod payments;
#[cfg(feature = "payouts")]
pub mod payouts;
pub mod pm_auth;
#[cfg(feature = "recon")]
pub mod recon;
pub mod refunds;
pub mod routing;
pub mod surcharge_decision_configs;

View File

@ -0,0 +1,21 @@
use common_utils::pii;
use masking::Secret;
use crate::enums;
#[derive(serde::Deserialize, Debug, serde::Serialize)]
pub struct ReconUpdateMerchantRequest {
pub merchant_id: String,
pub recon_status: enums::ReconStatus,
pub user_email: pii::Email,
}
#[derive(Debug, serde::Serialize)]
pub struct ReconTokenResponse {
pub token: Secret<String>,
}
#[derive(Debug, serde::Serialize)]
pub struct ReconStatusResponse {
pub recon_status: enums::ReconStatus,
}

View File

@ -140,3 +140,10 @@ pub struct UserMerchantAccount {
pub merchant_id: String,
pub merchant_name: OptionalEncryptableName,
}
#[cfg(feature = "recon")]
#[derive(serde::Serialize, Debug)]
pub struct VerifyTokenResponse {
pub merchant_id: String,
pub user_email: pii::Email,
}