feat(core): Hyperswitch <|> UCS integration v2 (#8439)

Co-authored-by: debarshi.gupta <debarshi.gupta@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Aishwariyaa Anand <aishwariyaa.anand@Aishwariyaa-Anand-C3PGW02T6Y.local>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kashif <kashif.dev@protonmail.com>
Co-authored-by: likhinbopanna <131246334+likhinbopanna@users.noreply.github.com>
This commit is contained in:
Uzair Khan
2025-07-11 19:41:13 +05:30
committed by GitHub
parent 2fe3132da8
commit ae9feca82c
13 changed files with 1050 additions and 377 deletions

View File

@ -84,6 +84,10 @@ pub enum UnifiedConnectorServiceError {
/// Failed to perform Payment Authorize from gRPC Server
#[error("Failed to perform Payment Authorize from gRPC Server")]
PaymentAuthorizeFailure,
/// Failed to perform Payment Get from gRPC Server
#[error("Failed to perform Payment Get from gRPC Server")]
PaymentGetFailure,
}
/// Result type for Dynamic Routing
@ -191,6 +195,28 @@ impl UnifiedConnectorServiceClient {
.change_context(UnifiedConnectorServiceError::PaymentAuthorizeFailure)
.inspect_err(|error| logger::error!(?error))
}
/// Performs Payment Sync/Get
pub async fn payment_get(
&self,
payment_get_request: payments_grpc::PaymentServiceGetRequest,
connector_auth_metadata: ConnectorAuthMetadata,
grpc_headers: GrpcHeaders,
) -> UnifiedConnectorServiceResult<tonic::Response<payments_grpc::PaymentServiceGetResponse>>
{
let mut request = tonic::Request::new(payment_get_request);
let metadata =
build_unified_connector_service_grpc_headers(connector_auth_metadata, grpc_headers)?;
*request.metadata_mut() = metadata;
self.client
.clone()
.get(request)
.await
.change_context(UnifiedConnectorServiceError::PaymentGetFailure)
.inspect_err(|error| logger::error!(?error))
}
}
/// Build the gRPC Headers for Unified Connector Service Request