feat(core): add support for confirmation flow for click to pay (#6982)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: sai-harsha-vardhan <harsha111hero@gmail.com>
Co-authored-by: Sai Harsha Vardhan <56996463+sai-harsha-vardhan@users.noreply.github.com>
This commit is contained in:
Sahkal Poddar
2025-02-20 12:47:29 +05:30
committed by GitHub
parent eea4d6ff8d
commit 74bbf4bf27
25 changed files with 910 additions and 291 deletions

View File

@ -14,12 +14,14 @@ pub mod setup_mandate_flow;
use async_trait::async_trait;
use hyperswitch_domain_models::{
mandates::CustomerAcceptance,
router_flow_types::{Authenticate, PostAuthenticate, PreAuthenticate},
router_flow_types::{
Authenticate, AuthenticationConfirmation, PostAuthenticate, PreAuthenticate,
},
router_request_types::PaymentsCaptureData,
};
use hyperswitch_interfaces::api::{
payouts::Payouts, UasAuthentication, UasPostAuthentication, UasPreAuthentication,
UnifiedAuthenticationService,
payouts::Payouts, UasAuthentication, UasAuthenticationConfirmation, UasPostAuthentication,
UasPreAuthentication, UnifiedAuthenticationService,
};
#[cfg(feature = "frm")]
@ -2276,6 +2278,57 @@ default_imp_for_uas_post_authentication!(
connector::Wise
);
macro_rules! default_imp_for_uas_authentication_confirmation {
($($path:ident::$connector:ident),*) => {
$( impl UasAuthenticationConfirmation for $path::$connector {}
impl
services::ConnectorIntegration<
AuthenticationConfirmation,
types::UasConfirmationRequestData,
types::UasAuthenticationResponseData
> for $path::$connector
{}
)*
};
}
default_imp_for_uas_authentication_confirmation!(
connector::Adyenplatform,
connector::Adyen,
connector::Authorizedotnet,
connector::Checkout,
connector::Ebanx,
connector::Gpayments,
connector::Netcetera,
connector::Nmi,
connector::Noon,
connector::Opayo,
connector::Opennode,
connector::Payme,
connector::Payone,
connector::Paypal,
connector::Plaid,
connector::Riskified,
connector::Signifyd,
connector::Stripe,
connector::Threedsecureio,
connector::Trustpay,
connector::Wellsfargopayout,
connector::Wise
);
#[cfg(feature = "dummy_connector")]
impl<const T: u8> UasAuthenticationConfirmation for connector::DummyConnector<T> {}
#[cfg(feature = "dummy_connector")]
impl<const T: u8>
services::ConnectorIntegration<
AuthenticationConfirmation,
types::UasConfirmationRequestData,
types::UasAuthenticationResponseData,
> for connector::DummyConnector<T>
{
}
macro_rules! default_imp_for_uas_authentication {
($($path:ident::$connector:ident),*) => {
$( impl UasAuthentication for $path::$connector {}
@ -2289,6 +2342,7 @@ macro_rules! default_imp_for_uas_authentication {
)*
};
}
#[cfg(feature = "dummy_connector")]
impl<const T: u8> UasAuthentication for connector::DummyConnector<T> {}
#[cfg(feature = "dummy_connector")]
@ -2325,6 +2379,7 @@ default_imp_for_uas_authentication!(
connector::Wellsfargopayout,
connector::Wise
);
/// Determines whether a capture API call should be made for a payment attempt
/// This function evaluates whether an authorized payment should proceed with a capture API call
/// based on various payment parameters. It's primarily used in two-step (auth + capture) payment flows for CaptureMethod SequentialAutomatic