Issue:
[FEATURE] complete the refund and void for capture specific transaction for cybersource connector

### Feature Description

**Note:** refund and void can be done in two different ways. below flows for refund and void are yet to be implemented
- [Refund Capture](https://developer.cybersource.com/api-reference-assets/index.html#payments_refund_refund-a-capture)
- [Void Capture](https://developer.cybersource.com/api-reference-assets/index.html#payments_void_void-a-capture)


### Possible Implementation

Complete the above mentioned flows based on the payment `capture_method` value in payment_attempt. right now this value is not provided directly. 

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

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

### Have you read the Contributing Guidelines?

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

### Are you willing to submit a PR?

None

Resolution:
<think>
PR Context:
- Title: feat(connector): add support for capture, void, psync, refund and rsync for cybersource
- Merged: 2023-01-17T08:25:52Z
- Files changed: 9 files
- Commits: 7 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [X] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates

## Description
<!-- Describe your changes in detail -->
Updating support for [cybersource](https://developer.cybersource.com) payment gateway
**Payment Method:** card
**Supported payment flows**
- [Authorize](https://developer.cybersource.com/api-reference-assets/index.html#payments_payments_process-a-payment)
- [Capture](https
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(connector): add support for capture, void, psync, refund and rsync for cybersource (#381)
Files to modify:


**crates/router/src/connector/cybersource.rs**
  Remove:
    - impl: impl api::ConnectorCommon for Cybersource
    - impl: impl services::ConnectorIntegration<
        api::Verify,
        types::VerifyRequestData,
        types::PaymentsResponseData,
    > for Cybersource
    - impl: impl services::ConnectorIntegration<
        api::Session,
        types::PaymentsSessionData,
        types::PaymentsResponseData,
    > for Cybersource
    - impl: impl services::ConnectorIntegration<
        api::Capture,
        types::PaymentsCaptureData,
        types::PaymentsResponseData,
    > for Cybersource
    - impl: impl services::ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData>
    - impl: impl services::ConnectorIntegration<
        api::Authorize,
        types::PaymentsAuthorizeData,
        types::PaymentsResponseData,
    > for vec![
            (
                headers::CONTENT_TYPE.to_string(),
                types::PaymentsAuthorizeType::get_content_type(self).to_string(),
            ),
            (
                headers::ACCEPT.to_string(),
                "application/hal+json;charset=utf-8".to_string(),
            ),
        ]
    - impl: impl services::ConnectorIntegration<
        api::Void,
        types::PaymentsCancelData,
        types::PaymentsResponseData,
    > for Cybersource
    - impl: impl services::ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData>
    - impl: impl services::ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData>
  Add:
    - function: private::build_error_response
    - function: private::build_headers
    - 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_http_method
    - function: private::get_url
    - function: private::get_content_type
    - function: private::get_request_body
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - function: private::get_request_body
    - function: private::get_headers
    - function: private::get_url
    - function: private::get_content_type
    - 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_http_method
    - function: private::get_url
    - function: private::build_request
    - function: private::handle_response
    - function: private::get_error_response
    - impl: impl ConnectorCommon for Cybersource
    - impl: impl ConnectorCommonExt<Flow, Request, Response> for Cybersource
    - impl: impl ConnectorIntegration<api::Verify, types::VerifyRequestData, types::PaymentsResponseData> for Cybersource
    - impl: impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for Cybersource
    - impl: impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for Cybersource
    - impl: impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData>
    - impl: impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for common_get_content_type()
    - impl: impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for Cybersource
    - impl: impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData>
    - impl: impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData>

**crates/router/src/connector/cybersource/transformers.rs**
  Remove:
    - struct: pub::CybersourceRefundResponse
    - enum: pub::RefundStatus

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

**crates/router/src/connector/utils.rs**
  Add:
    - function: private::get_attempt_id
    - function: private::get_billing_country
    - function: private::get_card
    - function: private::get_billing_phone
    - function: private::get_billing
    - function: private::get_number
    - function: private::get_first_name
    - function: private::get_last_name
    - function: private::get_line1
    - function: private::get_city
    - function: private::get_line2
    - function: private::get_zip
    - trait: pub::PhoneDetailsData
    - trait: pub::AddressDetailsData
    - impl: impl PaymentsRequestData for types::PaymentsAuthorizeRouterData

**crates/router/src/services/api.rs**
  Add:
    - function: private::get_http_method

**crates/router/tests/connectors/connector_auth.rs**
  Modify existing code

**crates/router/tests/connectors/cybersource.rs**
  Add:
    - function: private::get_data
    - function: private::get_auth_token
    - function: private::get_name
    - function: private::get_default_payment_info
    - function: private::get_default_payment_authorize_data
    - function: private::should_only_authorize_payment
    - function: private::should_authorize_and_capture_payment
    - function: private::should_sync_capture_payment
    - function: private::should_capture_already_authorized_payment
    - function: private::should_void_already_authorized_payment
    - function: private::should_refund_succeeded_payment
    - function: private::should_sync_refund
    - function: private::should_fail_payment_for_incorrect_card_number
    - function: private::should_fail_payment_for_incorrect_exp_month
    - struct: private::Cybersource
    - impl: impl ConnectorActions for Cybersource
    - impl: impl utils::Connector for Cybersource

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