mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 02:57:02 +08:00
feat(connector_onboarding): Add Connector onboarding APIs (#3050)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
54
crates/api_models/src/connector_onboarding.rs
Normal file
54
crates/api_models/src/connector_onboarding.rs
Normal file
@ -0,0 +1,54 @@
|
||||
use super::{admin, enums};
|
||||
|
||||
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
|
||||
pub struct ActionUrlRequest {
|
||||
pub connector: enums::Connector,
|
||||
pub connector_id: String,
|
||||
pub return_url: String,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum ActionUrlResponse {
|
||||
PayPal(PayPalActionUrlResponse),
|
||||
}
|
||||
|
||||
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
|
||||
pub struct OnboardingSyncRequest {
|
||||
pub profile_id: String,
|
||||
pub connector_id: String,
|
||||
pub connector: enums::Connector,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
pub struct PayPalActionUrlResponse {
|
||||
pub action_url: String,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum OnboardingStatus {
|
||||
PayPal(PayPalOnboardingStatus),
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PayPalOnboardingStatus {
|
||||
AccountNotFound,
|
||||
PaymentsNotReceivable,
|
||||
PpcpCustomDenied,
|
||||
MorePermissionsNeeded,
|
||||
EmailNotVerified,
|
||||
Success(PayPalOnboardingDone),
|
||||
ConnectorIntegrated(admin::MerchantConnectorResponse),
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
pub struct PayPalOnboardingDone {
|
||||
pub payer_id: String,
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, Debug, Clone)]
|
||||
pub struct PayPalIntegrationDone {
|
||||
pub connector_id: String,
|
||||
}
|
||||
@ -1,3 +1,4 @@
|
||||
pub mod connector_onboarding;
|
||||
pub mod customer;
|
||||
pub mod gsm;
|
||||
mod locker_migration;
|
||||
|
||||
12
crates/api_models/src/events/connector_onboarding.rs
Normal file
12
crates/api_models/src/events/connector_onboarding.rs
Normal file
@ -0,0 +1,12 @@
|
||||
use common_utils::events::{ApiEventMetric, ApiEventsType};
|
||||
|
||||
use crate::connector_onboarding::{
|
||||
ActionUrlRequest, ActionUrlResponse, OnboardingStatus, OnboardingSyncRequest,
|
||||
};
|
||||
|
||||
common_utils::impl_misc_api_event_type!(
|
||||
ActionUrlRequest,
|
||||
ActionUrlResponse,
|
||||
OnboardingSyncRequest,
|
||||
OnboardingStatus
|
||||
);
|
||||
@ -5,6 +5,7 @@ pub mod api_keys;
|
||||
pub mod bank_accounts;
|
||||
pub mod cards_info;
|
||||
pub mod conditional_configs;
|
||||
pub mod connector_onboarding;
|
||||
pub mod currency;
|
||||
pub mod customers;
|
||||
pub mod disputes;
|
||||
|
||||
Reference in New Issue
Block a user