Issue:
feat(core): Implement UCS based upi for paytm and phonepe

## Feature Request: Implement UPI Intent and QR Code Payment Flows for UCS Integration

### Description
Add support for UPI Intent and QR code payment methods through the Unified Connector Service (UCS) for Paytm and PhonePe payment gateways.

### Background
UPI is a critical payment method in India. Currently, Hyperswitch lacks support for UPI Intent (for mobile apps) and QR code flows through the UCS integration. This limits merchants' ability to accept UPI payments through these popular payment gateways.

### Requirements
- Add default implementations for Paytm and PhonePe connectors
- Support UPI Intent payment method for mobile app integrations
- Support QR code generation and payment flow for UPI
- Route payment requests through UCS (actual payment processing handled by UCS)
- Add necessary configuration entries for both connectors

### Technical Details
- The implementation should follow the existing UCS architecture pattern
- No direct API integration with Paytm/PhonePe required (handled by UCS)
- Need to add routing logic and connector definitions
- Should support standard payment operations: create, sync, refund

### Acceptance Criteria
- Successfully create UPI Intent payments through Paytm and PhonePe via UCS
- QR code generation works for UPI payments
- Payment status sync operations function correctly
- Configuration properly set up across all environments

Resolution:
<think>
PR Context:
- Title: feat(core): Implement UCS based  upi for  paytm and phonepe
- Merged: 2025-07-31T14:18:08Z
- Files changed: 30 files
- Commits: 22 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [x] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Fixed #8734

## Description
<!-- Describe your changes in detail -->

This PR implements UPI Intent and QR code payment flows for the Unified Connector Service (UCS) integration, adding default implementations for Paytm and PhonePe connectors.

### Key Changes:
- **Default Connector Implem
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(core): Implement UCS based  upi for  paytm and phonepe (#8732)
Co-authored-by: hyperswitch-bot[
Files to modify:


**crates/common_enums/src/connector_enums.rs**
  Modify existing code

**crates/connector_configs/src/connector.rs**
  Modify existing code

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

**crates/hyperswitch_connectors/src/connectors.rs**
  Add:
    - mod: pub::paytm
    - mod: pub::phonepe

**crates/hyperswitch_connectors/src/connectors/paytm.rs**
  Add:
    - function: pub::new
    - function: private::build_headers
    - function: private::id
    - function: private::get_currency_unit
    - function: private::common_get_content_type
    - function: private::base_url
    - function: private::get_auth_header
    - function: private::build_error_response
    - function: private::validate_mandate_payment
    - function: private::validate_psync_reference_id
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::get_request_body
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::get_request_body
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::get_request_body
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_webhook_object_reference_id
    - function: private::get_webhook_event_type
    - function: private::get_webhook_resource_object
    - function: private::get_connector_about
    - function: private::get_supported_payment_methods
    - function: private::get_supported_webhook_flows
    - struct: pub::Paytm
    - impl: impl Paytm
    - impl: impl api::Payment for Paytm
    - impl: impl api::PaymentSession for Paytm
    - impl: impl api::ConnectorAccessToken for Paytm
    - impl: impl api::MandateSetup for Paytm
    - impl: impl api::PaymentAuthorize for Paytm
    - impl: impl api::PaymentSync for Paytm
    - impl: impl api::PaymentCapture for Paytm
    - impl: impl api::PaymentVoid for Paytm
    - impl: impl api::Refund for Paytm
    - impl: impl api::RefundExecute for Paytm
    - impl: impl api::RefundSync for Paytm
    - impl: impl api::PaymentToken for Paytm
    - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Paytm
    - impl: impl ConnectorCommonExt<Flow, Request, Response> for Paytm
    - impl: impl ConnectorCommon for Paytm
    - impl: impl ConnectorValidation for Paytm
    - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Paytm
    - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Paytm
    - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Paytm
    - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Paytm
    - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Paytm
    - impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Paytm
    - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Paytm
    - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Paytm
    - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Paytm
    - impl: impl webhooks::IncomingWebhook for Paytm
    - impl: impl ConnectorSpecifications for Paytm
    - mod: pub::transformers

**crates/hyperswitch_connectors/src/connectors/paytm/transformers.rs**
  Add:
    - function: private::from
    - function: private::try_from
    - function: private::try_from
    - function: private::from
    - function: private::try_from
    - function: private::try_from
    - function: private::from
    - function: private::try_from
    - function: private::try_from
    - struct: pub::PaytmRouterData
    - struct: pub::PaytmPaymentsRequest
    - struct: pub::PaytmCard
    - struct: pub::PaytmAuthType
    - struct: pub::PaytmPaymentsResponse
    - struct: pub::PaytmRefundRequest
    - struct: pub::RefundResponse
    - struct: pub::PaytmErrorResponse
    - enum: pub::PaytmPaymentStatus
    - enum: pub::RefundStatus
    - impl: impl From<(StringMinorUnit, T)> for PaytmRouterData<T>
    - impl: impl TryFrom<&PaytmRouterData<&PaymentsAuthorizeRouterData>> for PaytmPaymentsRequest
    - impl: impl TryFrom<&ConnectorAuthType> for PaytmAuthType
    - impl: impl From<PaytmPaymentStatus> for common_enums::AttemptStatus
    - impl: impl TryFrom<ResponseRouterData<F, PaytmPaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
    - impl: impl TryFrom<&PaytmRouterData<&RefundsRouterData<F>>> for PaytmRefundRequest
    - impl: impl From<RefundStatus> for enums::RefundStatus
    - impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
    - impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>

**crates/hyperswitch_connectors/src/connectors/phonepe.rs**
  Add:
    - function: pub::new
    - function: private::build_headers
    - function: private::id
    - function: private::get_currency_unit
    - function: private::common_get_content_type
    - function: private::base_url
    - function: private::get_auth_header
    - function: private::build_error_response
    - function: private::validate_mandate_payment
    - function: private::validate_psync_reference_id
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::get_request_body
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::get_request_body
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::get_request_body
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_headers
    - function: private::get_content_type
    - function: private::get_url
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_webhook_object_reference_id
    - function: private::get_webhook_event_type
    - function: private::get_webhook_resource_object
    - function: private::get_connector_about
    - function: private::get_supported_payment_methods
    - function: private::get_supported_webhook_flows
    - struct: pub::Phonepe
    - impl: impl Phonepe
    - impl: impl api::Payment for Phonepe
    - impl: impl api::PaymentSession for Phonepe
    - impl: impl api::ConnectorAccessToken for Phonepe
    - impl: impl api::MandateSetup for Phonepe
    - impl: impl api::PaymentAuthorize for Phonepe
    - impl: impl api::PaymentSync for Phonepe
    - impl: impl api::PaymentCapture for Phonepe
    - impl: impl api::PaymentVoid for Phonepe
    - impl: impl api::Refund for Phonepe
    - impl: impl api::RefundExecute for Phonepe
    - impl: impl api::RefundSync for Phonepe
    - impl: impl api::PaymentToken for Phonepe
    - impl: impl ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData> for Phonepe
    - impl: impl ConnectorCommonExt<Flow, Request, Response> for Phonepe
    - impl: impl ConnectorCommon for Phonepe
    - impl: impl ConnectorValidation for Phonepe
    - impl: impl ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData> for Phonepe
    - impl: impl ConnectorIntegration<AccessTokenAuth, AccessTokenRequestData, AccessToken> for Phonepe
    - impl: impl ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData> for Phonepe
    - impl: impl ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> for Phonepe
    - impl: impl ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData> for Phonepe
    - impl: impl ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> for Phonepe
    - impl: impl ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> for Phonepe
    - impl: impl ConnectorIntegration<Execute, RefundsData, RefundsResponseData> for Phonepe
    - impl: impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Phonepe
    - impl: impl webhooks::IncomingWebhook for Phonepe
    - impl: impl ConnectorSpecifications for Phonepe
    - mod: pub::transformers

**crates/hyperswitch_connectors/src/connectors/phonepe/transformers.rs**
  Add:
    - function: private::from
    - function: private::try_from
    - function: private::try_from
    - function: private::from
    - function: private::try_from
    - function: private::try_from
    - function: private::from
    - function: private::try_from
    - function: private::try_from
    - struct: pub::PhonepeRouterData
    - struct: pub::PhonepePaymentsRequest
    - struct: pub::PhonepeCard
    - struct: pub::PhonepeAuthType
    - struct: pub::PhonepePaymentsResponse
    - struct: pub::PhonepeRefundRequest
    - struct: pub::RefundResponse
    - struct: pub::PhonepeErrorResponse
    - enum: pub::PhonepePaymentStatus
    - enum: pub::RefundStatus
    - impl: impl From<(StringMinorUnit, T)> for PhonepeRouterData<T>
    - impl: impl TryFrom<&PhonepeRouterData<&PaymentsAuthorizeRouterData>> for PhonepePaymentsRequest
    - impl: impl TryFrom<&ConnectorAuthType> for PhonepeAuthType
    - impl: impl From<PhonepePaymentStatus> for common_enums::AttemptStatus
    - impl: impl TryFrom<ResponseRouterData<F, PhonepePaymentsResponse, T, PaymentsResponseData>> for RouterData<F, T, PaymentsResponseData>
    - impl: impl TryFrom<&PhonepeRouterData<&RefundsRouterData<F>>> for PhonepeRefundRequest
    - impl: impl From<RefundStatus> for enums::RefundStatus
    - impl: impl TryFrom<RefundsResponseRouterData<Execute, RefundResponse>> for RefundsRouterData<Execute>
    - impl: impl TryFrom<RefundsResponseRouterData<RSync, RefundResponse>> for RefundsRouterData<RSync>

**crates/hyperswitch_connectors/src/default_implementations.rs**
  Modify existing code

**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
  Modify existing code

**crates/hyperswitch_domain_models/src/connector_endpoints.rs**
  Modify existing code

**crates/payment_methods/src/configs/payment_connector_required_fields.rs**
  Modify existing code

**crates/router/src/connector.rs**
  Modify existing code

**crates/router/src/core/connector_validation.rs**
  Modify existing code

**crates/router/src/core/unified_connector_service.rs**
  Modify existing code

**crates/router/src/core/unified_connector_service/transformers.rs**
  Modify existing code

**crates/router/src/types/api/connector_mapping.rs**
  Modify existing code

**crates/router/src/types/connector_transformers.rs**
  Modify existing code

**crates/router/tests/connectors/main.rs**
  Add:
    - mod: private::paytm
    - mod: private::phonepe

**crates/router/tests/connectors/paytm.rs**
  Add:
    - function: private::get_data
    - function: private::get_auth_token
    - function: private::get_name
    - function: private::get_default_payment_info
    - function: private::payment_method_details
    - function: private::should_only_authorize_payment
    - function: private::should_capture_authorized_payment
    - function: private::should_partially_capture_authorized_payment
    - function: private::should_sync_authorized_payment
    - function: private::should_void_authorized_payment
    - function: private::should_refund_manually_captured_payment
    - function: private::should_partially_refund_manually_captured_payment
    - function: private::should_sync_manually_captured_refund
    - function: private::should_make_payment
    - function: private::should_sync_auto_captured_payment
    - function: private::should_refund_auto_captured_payment
    - function: private::should_partially_refund_succeeded_payment
    - function: private::should_refund_succeeded_payment_multiple_times
    - function: private::should_sync_refund
    - function: private::should_fail_payment_for_incorrect_cvc
    - function: private::should_fail_payment_for_invalid_exp_month
    - function: private::should_fail_payment_for_incorrect_expiry_year
    - function: private::should_fail_void_payment_for_auto_capture
    - function: private::should_fail_capture_for_invalid_payment
    - function: private::should_fail_for_refund_amount_higher_than_payment_amount
    - struct: private::PaytmTest
    - impl: impl ConnectorActions for PaytmTest
    - impl: impl utils::Connector for PaytmTest

**crates/router/tests/connectors/phonepe.rs**
  Add:
    - function: private::get_data
    - function: private::get_auth_token
    - function: private::get_name
    - function: private::get_default_payment_info
    - function: private::payment_method_details
    - function: private::should_only_authorize_payment
    - function: private::should_capture_authorized_payment
    - function: private::should_partially_capture_authorized_payment
    - function: private::should_sync_authorized_payment
    - function: private::should_void_authorized_payment
    - function: private::should_refund_manually_captured_payment
    - function: private::should_partially_refund_manually_captured_payment
    - function: private::should_sync_manually_captured_refund
    - function: private::should_make_payment
    - function: private::should_sync_auto_captured_payment
    - function: private::should_refund_auto_captured_payment
    - function: private::should_partially_refund_succeeded_payment
    - function: private::should_refund_succeeded_payment_multiple_times
    - function: private::should_sync_refund
    - function: private::should_fail_payment_for_incorrect_cvc
    - function: private::should_fail_payment_for_invalid_exp_month
    - function: private::should_fail_payment_for_incorrect_expiry_year
    - function: private::should_fail_void_payment_for_auto_capture
    - function: private::should_fail_capture_for_invalid_payment
    - function: private::should_fail_for_refund_amount_higher_than_payment_amount
    - struct: private::PhonepeTest
    - impl: impl ConnectorActions for PhonepeTest
    - impl: impl utils::Connector for PhonepeTest

**crates/test_utils/src/connector_auth.rs**
  Modify existing code