Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Constraint Graph for Payment Methods List #5081

Merged
merged 24 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e951a74
feat(core): Constraint Graph for Payment Methods List
prajjwalkumar17 Jun 22, 2024
03dbc0e
chore: run formatter
hyperswitch-bot[bot] Jun 22, 2024
1e6132f
chore: refactor for cgraph
prajjwalkumar17 Jun 26, 2024
a413d38
Merge branch 'main' into cgi/pml
prajjwalkumar17 Jun 26, 2024
5d5921b
chore: merge main
prajjwalkumar17 Jun 28, 2024
9f03b0a
chore: run formatter
hyperswitch-bot[bot] Jun 28, 2024
8adccdb
chore: merge conflicts
prajjwalkumar17 Jun 28, 2024
3da0d05
Merge branch 'cgi/pml' of https://github.com/juspay/hyperswitch into …
prajjwalkumar17 Jun 28, 2024
cbf1ec5
chore: cypress tests with bug fix for not reading the default payment…
prajjwalkumar17 Jul 3, 2024
825e50d
Merge branch 'main' into cgi/pml
prajjwalkumar17 Jul 3, 2024
2586be1
chore: run formatter
hyperswitch-bot[bot] Jul 3, 2024
01f9f73
chore: code beautification
prajjwalkumar17 Jul 3, 2024
841d49e
Merge branch 'cgi/pml' of https://github.com/juspay/hyperswitch into …
prajjwalkumar17 Jul 3, 2024
1b4a434
chore: code beautification
prajjwalkumar17 Jul 3, 2024
4182fe6
chore: addition of cypress tests
prajjwalkumar17 Jul 4, 2024
504d8ca
Merge branch 'main' into cgi/pml
prajjwalkumar17 Jul 6, 2024
eafbbb2
chore: addressed comments
prajjwalkumar17 Jul 6, 2024
60c1934
Merge branch 'main' into cgi/pml
prajjwalkumar17 Jul 6, 2024
446a52b
chore: code beautification
prajjwalkumar17 Jul 6, 2024
bada22d
Merge branch 'cgi/pml' of https://github.com/juspay/hyperswitch into …
prajjwalkumar17 Jul 6, 2024
bb4d712
chore: comments addressal
prajjwalkumar17 Jul 6, 2024
172520c
chore: naming conventions
prajjwalkumar17 Jul 8, 2024
5cf436c
chore: naming conventions
prajjwalkumar17 Jul 8, 2024
a8fd427
Merge branch 'main' into cgi/pml
prajjwalkumar17 Jul 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/euclid/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ pub enum MandateAcceptanceType {
pub enum PaymentType {
SetupMandate,
NonMandate,
NewMandate,
UpdateMandate,
}

#[derive(
Expand Down
20 changes: 4 additions & 16 deletions crates/hyperswitch_constraint_graph/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ where
nodes: &[(NodeId, Relation, Strength)],
info: Option<&'static str>,
metadata: Option<M>,
domain: Option<String>,
domain_id: Option<DomainId>,
) -> Result<NodeId, GraphError<V>> {
nodes
.iter()
Expand All @@ -208,13 +208,7 @@ where
.push(metadata.map(|meta| -> Arc<dyn Metadata> { Arc::new(meta) }));

for (node_id, relation, strength) in nodes {
self.make_edge(
*node_id,
aggregator_id,
*strength,
*relation,
domain.clone(),
)?;
self.make_edge(*node_id, aggregator_id, *strength, *relation, domain_id)?;
}

Ok(aggregator_id)
Expand All @@ -225,7 +219,7 @@ where
nodes: &[(NodeId, Relation, Strength)],
info: Option<&'static str>,
metadata: Option<M>,
domain: Option<String>,
domain_id: Option<DomainId>,
) -> Result<NodeId, GraphError<V>> {
nodes
.iter()
Expand All @@ -239,13 +233,7 @@ where
.push(metadata.map(|meta| -> Arc<dyn Metadata> { Arc::new(meta) }));

for (node_id, relation, strength) in nodes {
self.make_edge(
*node_id,
aggregator_id,
*strength,
*relation,
domain.clone(),
)?;
self.make_edge(*node_id, aggregator_id, *strength, *relation, domain_id)?;
}

Ok(aggregator_id)
Expand Down
8 changes: 0 additions & 8 deletions crates/hyperswitch_constraint_graph/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,6 @@ impl From<String> for DomainIdentifier {
}
}

// impl Deref for DomainIdentifier {
// type Target = &String;
//
// fn deref(&self) -> Self::Target {
// self.0
// }
// }

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DomainInfo {
pub domain_identifier: DomainIdentifier,
Expand Down
2 changes: 2 additions & 0 deletions crates/kgraph_utils/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use euclid::{dssa::types::AnalysisErrorType, frontend::dir};
pub enum KgraphError {
#[error("Invalid connector name encountered: '{0}'")]
InvalidConnectorName(String),
#[error("Error in domain creation")]
DomainCreationError,
#[error("There was an error constructing the graph: {0}")]
GraphConstructionError(hyperswitch_constraint_graph::GraphError<dir::DirValue>),
#[error("There was an error constructing the context")]
Expand Down
1 change: 1 addition & 0 deletions crates/router/src/core/payment_methods.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pub mod cards;
pub mod surcharge_decision_configs;
pub mod transformers;
pub mod utils;
pub mod vault;
pub use api_models::enums::Connector;
#[cfg(feature = "payouts")]
Expand Down
Loading
Loading