mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 09:38:33 +08:00
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:
@ -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;
|
||||
|
||||
21
crates/api_models/src/events/recon.rs
Normal file
21
crates/api_models/src/events/recon.rs
Normal 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)
|
||||
}
|
||||
}
|
||||
@ -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,
|
||||
|
||||
@ -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;
|
||||
|
||||
21
crates/api_models/src/recon.rs
Normal file
21
crates/api_models/src/recon.rs
Normal 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,
|
||||
}
|
||||
@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user