-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pm_auth): pm_auth service migration (#3047)
Co-authored-by: Sarthak Soni <[email protected]> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Sarthak Soni <[email protected]>
- Loading branch information
1 parent
294b04b
commit 9c1c44a
Showing
40 changed files
with
2,492 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
use common_enums::{PaymentMethod, PaymentMethodType}; | ||
use common_utils::{ | ||
events::{ApiEventMetric, ApiEventsType}, | ||
impl_misc_api_event_type, | ||
}; | ||
|
||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub struct LinkTokenCreateRequest { | ||
pub language: Option<String>, // optional language field to be passed | ||
pub client_secret: Option<String>, // client secret to be passed in req body | ||
pub payment_id: String, // payment_id to be passed in req body for redis pm_auth connector name fetch | ||
pub payment_method: PaymentMethod, // payment_method to be used for filtering pm_auth connector | ||
pub payment_method_type: PaymentMethodType, // payment_method_type to be used for filtering pm_auth connector | ||
} | ||
|
||
#[derive(Debug, Clone, serde::Serialize)] | ||
pub struct LinkTokenCreateResponse { | ||
pub link_token: String, // link_token received in response | ||
pub connector: String, // pm_auth connector name in response | ||
} | ||
|
||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)] | ||
#[serde(rename_all = "snake_case")] | ||
|
||
pub struct ExchangeTokenCreateRequest { | ||
pub public_token: String, | ||
pub client_secret: Option<String>, | ||
pub payment_id: String, | ||
pub payment_method: PaymentMethod, | ||
pub payment_method_type: PaymentMethodType, | ||
} | ||
|
||
#[derive(Debug, Clone, serde::Serialize)] | ||
pub struct ExchangeTokenCreateResponse { | ||
pub access_token: String, | ||
} | ||
|
||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] | ||
pub struct PaymentMethodAuthConfig { | ||
pub enabled_payment_methods: Vec<PaymentMethodAuthConnectorChoice>, | ||
} | ||
|
||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] | ||
pub struct PaymentMethodAuthConnectorChoice { | ||
pub payment_method: PaymentMethod, | ||
pub payment_method_type: PaymentMethodType, | ||
pub connector_name: String, | ||
pub mca_id: String, | ||
} | ||
|
||
impl_misc_api_event_type!( | ||
LinkTokenCreateRequest, | ||
LinkTokenCreateResponse, | ||
ExchangeTokenCreateRequest, | ||
ExchangeTokenCreateResponse | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "pm_auth" | ||
description = "Open banking services" | ||
version = "0.1.0" | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
readme = "README.md" | ||
|
||
[dependencies] | ||
# First party crates | ||
api_models = { version = "0.1.0", path = "../api_models" } | ||
common_enums = { version = "0.1.0", path = "../common_enums" } | ||
common_utils = { version = "0.1.0", path = "../common_utils" } | ||
masking = { version = "0.1.0", path = "../masking" } | ||
router_derive = { version = "0.1.0", path = "../router_derive" } | ||
router_env = { version = "0.1.0", path = "../router_env", features = ["log_extra_implicit_fields", "log_custom_entries_to_extra"] } | ||
|
||
# Third party crates | ||
async-trait = "0.1.66" | ||
bytes = "1.4.0" | ||
error-stack = "0.3.1" | ||
http = "0.2.9" | ||
mime = "0.3.17" | ||
serde = "1.0.159" | ||
serde_json = "1.0.91" | ||
strum = { version = "0.24.1", features = ["derive"] } | ||
thiserror = "1.0.43" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Payment Method Auth Services | ||
|
||
An open banking services for payment method auth validation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pub mod plaid; | ||
|
||
pub use self::plaid::Plaid; |
Oops, something went wrong.