diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json index fa4dd68ede..ecaf867c97 100644 --- a/api-reference-v2/openapi_spec.json +++ b/api-reference-v2/openapi_spec.json @@ -8710,9 +8710,6 @@ }, "CtpServiceDetails": { "type": "object", - "required": [ - "provider" - ], "properties": { "merchant_transaction_id": { "type": "string", @@ -8730,7 +8727,12 @@ "nullable": true }, "provider": { - "$ref": "#/components/schemas/CtpServiceProvider" + "allOf": [ + { + "$ref": "#/components/schemas/CtpServiceProvider" + } + ], + "nullable": true }, "encypted_payload": { "type": "string", diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json index 7d364fa972..233f44930e 100644 --- a/api-reference/openapi_spec.json +++ b/api-reference/openapi_spec.json @@ -10821,9 +10821,6 @@ }, "CtpServiceDetails": { "type": "object", - "required": [ - "provider" - ], "properties": { "merchant_transaction_id": { "type": "string", @@ -10841,7 +10838,12 @@ "nullable": true }, "provider": { - "$ref": "#/components/schemas/CtpServiceProvider" + "allOf": [ + { + "$ref": "#/components/schemas/CtpServiceProvider" + } + ], + "nullable": true }, "encypted_payload": { "type": "string", diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 817c5404da..779490205d 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -1162,8 +1162,8 @@ pub struct CtpServiceDetails { /// session transaction flow id pub x_src_flow_id: Option, /// provider Eg: Visa, Mastercard - #[schema(value_type = CtpServiceProvider)] - pub provider: api_enums::CtpServiceProvider, + #[schema(value_type = Option)] + pub provider: Option, /// Encrypted payload #[schema(value_type = Option)] pub encypted_payload: Option>, @@ -1171,7 +1171,7 @@ pub struct CtpServiceDetails { impl CtpServiceDetails { pub fn is_network_confirmation_call_required(&self) -> bool { - self.provider == api_enums::CtpServiceProvider::Mastercard + self.provider == Some(api_enums::CtpServiceProvider::Mastercard) } } diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs index 5583dcba1e..5e63f78956 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -6817,7 +6817,13 @@ pub async fn decide_action_for_unified_authentication_service( && business_profile.is_click_to_pay_enabled && payment_data.service_details.is_some() { - if *do_authorisation_confirmation { + let should_do_uas_confirmation_call = payment_data + .service_details + .as_ref() + .map(|details| details.is_network_confirmation_call_required()) + .unwrap_or(true); + + if *do_authorisation_confirmation && should_do_uas_confirmation_call { Some(UnifiedAuthenticationServiceFlow::ClickToPayConfirmation) } else { Some(UnifiedAuthenticationServiceFlow::ClickToPayInitiate) diff --git a/crates/router/src/core/unified_authentication_service.rs b/crates/router/src/core/unified_authentication_service.rs index 2116c98d12..45d0ed9251 100644 --- a/crates/router/src/core/unified_authentication_service.rs +++ b/crates/router/src/core/unified_authentication_service.rs @@ -233,7 +233,8 @@ impl UnifiedAuthenticationService for ClickToPay { UNIFIED_AUTHENTICATION_SERVICE.to_string(), authentication_confirmation_router_data, ) - .await?; + .await + .ok(); // marking this as .ok() since this is not a required step at our end for completing the transaction Ok(()) }