[FEATURE] Payment void endpoint for v2

### Feature Description

Add  support for Payment Cancel in V2.


### Possible Implementation

Add V2 payments_cancel flow by completing GetTracker, UpdateTracker, and Domain traits for payment cancel endpoint.

### 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!
<think>
PR Context:
- Title: feat(router): Add v2 payment cancellation flow
- Merged: 2025-09-22T18:39:33Z
- Files changed: 17 files
- Commits: 14 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

## Description
<!-- Describe your changes in detail -->
Add V2 payments_cancel flow by endpoint `{{baseUrl}}/v2/payments/:payment_id/cancel`.A payment can be cancelled when the status is RequiresCapture, PartiallyAuthorizedAndRequiresCapture, or PartiallyCapturedAndCapturable.

### Additional Cha
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(router): Add v2 payment cancellation flow (#9083)
Co-authored-by: hyperswitch-bot[bot] <1485255
Files to modify:


**crates/api_models/src/events/payment.rs**
  Add:
    - function: private::get_api_event_type
    - function: private::get_api_event_type
    - impl: impl ApiEventMetric for payments::PaymentsCancelRequest
    - impl: impl ApiEventMetric for payments::PaymentsCancelResponse

**crates/api_models/src/payments.rs**
  Add:
    - struct: pub::PaymentsCancelRequest
    - struct: pub::PaymentsCancelResponse

**crates/diesel_models/src/payment_attempt.rs**
  Modify existing code

**crates/hyperswitch_domain_models/src/payments.rs**
  Add:
    - struct: pub::PaymentCancelData

**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
  Modify existing code

**crates/hyperswitch_domain_models/src/payments/payment_intent.rs**
  Modify existing code

**crates/hyperswitch_domain_models/src/router_data.rs**
  Add:
    - function: private::get_payment_intent_update
    - function: private::get_payment_attempt_update
    - function: private::get_amount_capturable
    - function: private::get_captured_amount
    - function: private::get_attempt_status_for_db_update
    - impl: impl TrackerPostUpdateObjects<
        router_flow_types::Void,
        router_request_types::PaymentsCancelData,
        payments::PaymentCancelData<router_flow_types::Void>,
    > for RouterData<
        router_flow_types::Void,
        router_request_types::PaymentsCancelData,
        router_response_types::PaymentsResponseData,
    >

**crates/hyperswitch_interfaces/src/conversion_impls.rs**
  Modify existing code

**crates/router/src/core/payments.rs**
  Add:
    - function: private::set_cancellation_reason
    - function: private::set_cancellation_reason
    - function: private::set_cancellation_reason
    - function: private::set_cancellation_reason
    - function: private::get_payment_attempt
    - function: private::list_payments_attempts
    - function: private::get_client_secret
    - function: private::get_payment_intent
    - function: private::get_merchant_connector_details
    - function: private::get_payment_method_info
    - function: private::get_payment_method_token
    - function: private::get_mandate_id
    - function: private::get_address
    - function: private::get_creds_identifier
    - function: private::get_token
    - function: private::get_multiple_capture_data
    - function: private::get_payment_link_data
    - function: private::get_ephemeral_key
    - function: private::get_setup_mandate
    - function: private::get_poll_config
    - function: private::get_authentication
    - function: private::get_frm_message
    - function: private::get_refunds
    - function: private::get_disputes
    - function: private::get_authorizations
    - function: private::get_attempts
    - function: private::get_recurring_details
    - function: private::get_payment_intent_profile_id
    - function: private::get_currency
    - function: private::get_amount
    - function: private::get_payment_attempt_connector
    - function: private::get_merchant_connector_id_in_attempt
    - function: private::get_connector_customer_id
    - function: private::get_billing_address
    - function: private::get_payment_method_data
    - function: private::get_sessions_token
    - function: private::get_token_data
    - function: private::get_mandate_connector
    - function: private::get_force_sync
    - function: private::get_capture_method
    - function: private::get_optional_payment_attempt
    - function: private::get_pre_routing_result
    - function: private::get_optional_external_vault_session_details
    - function: private::set_payment_intent
    - function: private::set_client_secret
    - function: private::set_payment_attempt
    - function: private::set_payment_method_data
    - function: private::set_payment_method_token
    - function: private::set_email_if_not_present
    - function: private::set_payment_method_id_in_attempt
    - function: private::set_pm_token
    - function: private::set_connector_customer_id
    - function: private::push_sessions_token
    - function: private::set_surcharge_details
    - function: private::set_merchant_connector_id_in_attempt
    - function: private::set_card_network
    - function: private::set_co_badged_card_data
    - function: private::set_frm_message
    - function: private::set_payment_intent_status
    - function: private::set_authentication_type_in_attempt
    - function: private::set_recurring_mandate_payment_data
    - function: private::set_mandate_id
    - function: private::set_setup_future_usage_in_payment_intent
    - function: private::set_prerouting_algorithm_in_payment_intent
    - function: private::set_connector_in_payment_attempt
    - function: private::set_connector_request_reference_id
    - function: private::set_connector_response_reference_id
    - function: private::set_vault_session_details
    - function: private::set_routing_approach_in_attempt
    - function: private::set_connector_request_reference_id_in_payment_attempt
    - function: private::set_cancellation_reason
    - impl: impl OperationSessionGetters<F> for PaymentCancelData<F>
    - impl: impl OperationSessionSetters<F> for PaymentCancelData<F>

**crates/router/src/core/payments/flows/cancel_flow.rs**
  Remove:
    - function: private::construct_router_data
  Add:
    - function: private::construct_router_data
    - impl: impl ConstructFlowSpecificData<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for hyperswitch_domain_models::payments::PaymentCancelData<api::Void>

**crates/router/src/core/payments/operations.rs**
  Add:
    - mod: pub::payment_cancel_v2

**crates/router/src/core/payments/operations/payment_cancel_v2.rs**
  Add:
    - function: private::to_validate_request
    - function: private::to_get_tracker
    - function: private::to_domain
    - function: private::to_update_tracker
    - function: private::to_validate_request
    - function: private::to_get_tracker
    - function: private::to_domain
    - function: private::to_update_tracker
    - function: private::validate_request
    - function: private::get_trackers
    - function: private::update_trackers
    - function: private::get_customer_details
    - function: private::make_pm_data
    - function: private::perform_routing
    - function: private::validate_status_for_operation
    - struct: pub::PaymentsCancel
    - impl: impl Operation<F, api::PaymentsCancelRequest> for &PaymentsCancel
    - impl: impl Operation<F, api::PaymentsCancelRequest> for PaymentsCancel
    - impl: impl ValidateRequest<
        F,
        api::PaymentsCancelRequest,
        hyperswitch_domain_models::payments::PaymentCancelData<F>,
    > for PaymentsCancel
    - impl: impl GetTracker<
        F,
        hyperswitch_domain_models::payments::PaymentCancelData<F>,
        api::PaymentsCancelRequest,
    > for PaymentsCancel
    - impl: impl UpdateTracker<
        F,
        hyperswitch_domain_models::payments::PaymentCancelData<F>,
        api::PaymentsCancelRequest,
    > for PaymentsCancel
    - impl: impl Domain<F, api::PaymentsCancelRequest, hyperswitch_domain_models::payments::PaymentCancelData<F>> for PaymentsCancel
    - impl: impl ValidateStatusForOperation for PaymentsCancel

**crates/router/src/core/payments/operations/payment_response.rs**
  Add:
    - function: private::to_post_update_tracker
    - function: private::update_tracker
    - impl: impl Operation<F, types::PaymentsCancelData> for PaymentResponse
    - impl: impl PostUpdateTracker<
        F,
        hyperswitch_domain_models::payments::PaymentCancelData<F>,
        types::PaymentsCancelData,
    > for PaymentResponse

**crates/router/src/core/payments/transformers.rs**
  Add:
    - function: pub::construct_cancel_router_data_v2
    - function: pub::construct_router_data_for_cancel
    - function: private::generate_response
    - impl: impl GenerateResponse<api_models::payments::PaymentsCancelResponse> for hyperswitch_domain_models::payments::PaymentCancelData<F>

**crates/router/src/routes/app.rs**
  Modify existing code

**crates/router/src/routes/payments.rs**
  Add:
    - function: pub::payments_cancel
{"issue_number": 9082, "pr_number": 9083, "commits_count": 1, "files_changed": 17, "response_length": 9004, "file_count": 18, "needs_breakdown": true}