Issue:
[FEATURE]: Add support for Webhooks through UCS

### Feature Description

the Webhooks should go to Unified connector service and should be handled there

### Possible Implementation

add webhook integration in hyperswitch

### Have you spent some time checking if this feature request has been raised before?

- [x] I checked and didn't find a similar issue

### Have you read the Contributing Guidelines?

- [x] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)

### Are you willing to submit a PR?

Yes, I am willing to submit a PR!

Resolution:
<think>
PR Context:
- Title: feat(core): Adding integration for webhooks through UCS
- Merged: 2025-08-08T14:35:40Z
- Files changed: 5 files
- Commits: 20 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
Added webhooks integration support in hyperswitch so that for webhooks hyperswitch can call UCS and get the response.

Closes #8880  


### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies applicatio
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(core): Adding integration for webhooks through UCS (#8814)
Files to modify:


**crates/external_services/src/grpc_client/unified_connector_service.rs**
  Modify existing code

**crates/router/src/core/payments/helpers.rs**
  Add:
    - function: pub::get_webhook_details

**crates/router/src/core/unified_connector_service.rs**
  Remove:
    - mod: private::transformers
  Add:
    - function: pub::should_call_unified_connector_service_for_webhooks
    - function: pub::build_webhook_secrets_from_merchant_connector_account
    - function: pub::call_unified_connector_service_for_webhook
    - function: pub::extract_webhook_content_from_ucs_response
    - mod: pub::transformers

**crates/router/src/core/unified_connector_service/transformers.rs**
  Add:
    - function: private::foreign_try_from
    - function: pub::transform_ucs_webhook_response
    - function: pub::build_webhook_transform_request
    - struct: pub::WebhookTransformData
    - impl: impl ForeignTryFrom<&hyperswitch_interfaces::webhooks::IncomingWebhookRequestDetails<'_>> for payments_grpc::RequestDetails

**crates/router/src/core/webhooks/incoming.rs**
  Add:
    - function: private::process_ucs_webhook_transform
    - function: private::extract_webhook_event_object
    - struct: pub::WebhookProcessingResult

**Commit 2:** feat(core): Adding integration for webhooks through UCS (#8814)
Files to modify:


**crates/external_services/src/grpc_client/unified_connector_service.rs**
  Modify existing code

**crates/router/src/core/payments/helpers.rs**
  Add:
    - function: pub::get_webhook_details

**crates/router/src/core/unified_connector_service.rs**
  Remove:
    - mod: private::transformers
  Add:
    - function: pub::should_call_unified_connector_service_for_webhooks
    - function: pub::build_webhook_secrets_from_merchant_connector_account
    - function: pub::call_unified_connector_service_for_webhook
    - function: pub::extract_webhook_content_from_ucs_response
    - mod: pub::transformers

**crates/router/src/core/unified_connector_service/transformers.rs**
  Add:
    - function: private::foreign_try_from
    - function: pub::transform_ucs_webhook_response
    - function: pub::build_webhook_transform_request
    - struct: pub::WebhookTransformData
    - impl: impl ForeignTryFrom<&hyperswitch_interfaces::webhooks::IncomingWebhookRequestDetails<'_>> for payments_grpc::RequestDetails

**crates/router/src/core/webhooks/incoming.rs**
  Add:
    - function: private::process_ucs_webhook_transform
    - function: private::extract_webhook_event_object
    - struct: pub::WebhookProcessingResult