From d7ce15b366f3207d43a606dd58a4569f14c134cf Mon Sep 17 00:00:00 2001 From: hrithikesh026 Date: Thu, 23 Oct 2025 17:55:52 +0530 Subject: [PATCH] chore: address comments --- .../src/router_request_types.rs | 27 ------------------- ...urrently in hyperswitch, under authoriz.md | 23 ---------------- 2 files changed, 50 deletions(-) delete mode 100644 crates/router/src/core/payments/Currently in hyperswitch, under authoriz.md diff --git a/crates/hyperswitch_domain_models/src/router_request_types.rs b/crates/hyperswitch_domain_models/src/router_request_types.rs index 75c0721a7c..063868b034 100644 --- a/crates/hyperswitch_domain_models/src/router_request_types.rs +++ b/crates/hyperswitch_domain_models/src/router_request_types.rs @@ -655,39 +655,12 @@ pub struct PaymentsAuthenticateData { pub amount: Option, pub email: Option, pub currency: Option, - // pub payment_method_type: Option, - // pub router_return_url: Option, pub complete_authorize_url: Option, pub browser_info: Option, - // pub connector_transaction_id: Option, - // pub enrolled_for_3ds: bool, pub redirect_response: Option, - - // New amount for amount frame work pub minor_amount: Option, } -impl TryFrom for PaymentsAuthenticateData { - type Error = error_stack::Report; - - fn try_from(data: PaymentsAuthorizeData) -> Result { - Ok(Self { - payment_method_data: Some(data.payment_method_data), - amount: Some(data.amount), - minor_amount: Some(data.minor_amount), - email: data.email, - currency: Some(data.currency), - // payment_method_type: data.payment_method_type, - // router_return_url: data.router_return_url, - complete_authorize_url: data.complete_authorize_url, - browser_info: data.browser_info, - // connector_transaction_id: None, - redirect_response: None, - // enrolled_for_3ds: data.enrolled_for_3ds, - }) - } -} - impl TryFrom for PaymentsAuthenticateData { type Error = error_stack::Report; diff --git a/crates/router/src/core/payments/Currently in hyperswitch, under authoriz.md b/crates/router/src/core/payments/Currently in hyperswitch, under authoriz.md deleted file mode 100644 index 8e216ca08d..0000000000 --- a/crates/router/src/core/payments/Currently in hyperswitch, under authoriz.md +++ /dev/null @@ -1,23 +0,0 @@ -Currently in hyperswitch, under authorize flow, there can be a lot of flows that must be called before actually calling the authorize. Like session/access token, customer create, order create etc. -Currently these are scattered all across the handler function 'pub async fn payments_operation_core(' . -I want to standardize the flows like this. - -PrimaryFlows and Secondary Flows. -PrimaryFlows: The actual flow. -SecondaryFlow: These flows might come as prerequisites before the Primary Flows. There can be multiple Secondary Flows for a PrimaryFlow. - -PrimaryFlows can be defined as: - 1. A flow where the response is returned to the client. - Eg: Authorize, Capture - Authorize can have SessionToken, OrderCreate etc. - -If Authorize is a PrimaryFlow, Then SessionTokena and OrderCreate will be SecondaryFlow. -The order will be like SessionToken(2ndary) -> OrderCreate(2ndary) -> Authorize(Primary). -Similarly, -* SessionToken(2ndary) -> PreAuthN(Primary). -* SessionToken(2ndary) -> AuthN(Primary). -* PostAuthN(2ndary) -> Authorization(Primary) - -Lets have marker trait for Primary and Secondary Flows. Feel free to come up with a better nomenclature for things. - -Execution order must be known at compile time. \ No newline at end of file