Issue:
[FEATURE] Create a dummy connector for internal and external testing of payments and refunds flows

### Feature Description

A dummy test connector needs to be created with the ability to process all the payment methods available on Hyperswitch. This dummy connector will be useful for internal and external testing and it will be used extensively by those trying to test or integrate Hyperswitch without setting up any active accounts with any of the processors. 

The dummy test connector will be able to simulate most basic scenarios (success/failure/pending) for all the available payment methods by having separate test payment method data for each of these flows. Payment failure can include further breakdown in scenarios according to the payment methods. 

For example, there should be separate test card numbers for simulating success, failure, pending statuses of 3DS and Non 3DS flows. Under failure, different test card numbers should enable simulating errors like invalid card info, insufficient funds, declined by gateway, declined by issuing bank, declines due to bad fraud score, etc. 

### Possible Implementation

We would need to create a dummy connector to test all the payment flows, refund flows, webhooks, etc.

The two major tasks are:
1. Server implementation for dummy connector for the following endpoints
a. payments #980
b. refunds #1071 
c. webhooks 

2. Integrating Hyperswitch with the dummy connector for the following endpoints
a. payments #1084 
b. refunds #1084 
c. webhooks 

3. Enable Dummy Connector and make it default

**Cards:**
Non- 3DS payments flow https://github.com/juspay/hyperswitch/issues/727


### 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/docs/CONTRIBUTING.md)

### Are you willing to submit a PR?

No, but I'm happy to collaborate on a PR with someone else

Resolution:
<think>
PR Context:
- Title: feat(connector): add dummy connector template code
- Merged: 2023-05-04T14:34:42Z
- Files changed: 18 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
- [ ] Documentation
- [ ] CI/CD

## Description
Add template code for dummy connector and feature flags to enable and disable it.

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!-- 
Provide 
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** feat(connector): add dummy connector template code (#970)
Files to modify:


**crates/api_models/src/enums.rs**
  Modify existing code

**crates/router/src/configs/settings.rs**
  Modify existing code

**crates/router/src/connector.rs**
  Add:
    - mod: pub::dummyconnector

**crates/router/src/connector/dummyconnector.rs**
  Add:
    - function: private::build_headers
    - function: private::id
    - function: private::common_get_content_type
    - function: private::base_url
    - function: private::get_auth_header
    - function: private::build_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_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
    - struct: pub::DummyConnector
    - impl: impl api::Payment for DummyConnector
    - impl: impl api::PaymentSession for DummyConnector
    - impl: impl api::ConnectorAccessToken for DummyConnector
    - impl: impl api::PreVerify for DummyConnector
    - impl: impl api::PaymentAuthorize for DummyConnector
    - impl: impl api::PaymentSync for DummyConnector
    - impl: impl api::PaymentCapture for DummyConnector
    - impl: impl api::PaymentVoid for DummyConnector
    - impl: impl api::Refund for DummyConnector
    - impl: impl api::RefundExecute for DummyConnector
    - impl: impl api::RefundSync for DummyConnector
    - impl: impl api::PaymentToken for DummyConnector
    - impl: impl ConnectorIntegration<
        api::PaymentMethodToken,
        types::PaymentMethodTokenizationData,
        types::PaymentsResponseData,
    > for DummyConnector
    - impl: impl ConnectorCommonExt<Flow, Request, Response> for DummyConnector
    - impl: impl ConnectorCommon for DummyConnector
    - impl: impl ConnectorIntegration<api::Session, types::PaymentsSessionData, types::PaymentsResponseData> for DummyConnector
    - impl: impl ConnectorIntegration<api::AccessTokenAuth, types::AccessTokenRequestData, types::AccessToken> for DummyConnector
    - impl: impl ConnectorIntegration<api::Verify, types::VerifyRequestData, types::PaymentsResponseData> for DummyConnector
    - impl: impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::PaymentsResponseData> for DummyConnector
    - impl: impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsResponseData> for DummyConnector
    - impl: impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData> for DummyConnector
    - impl: impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsResponseData> for DummyConnector
    - impl: impl ConnectorIntegration<api::Execute, types::RefundsData, types::RefundsResponseData> for DummyConnector
    - impl: impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponseData> for DummyConnector
    - impl: impl api::IncomingWebhook for DummyConnector
    - mod: private::transformers

**crates/router/src/connector/dummyconnector/transformers.rs**
  Add:
    - 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::DummyConnectorPaymentsRequest
    - struct: pub::DummyConnectorCard
    - struct: pub::DummyConnectorAuthType
    - struct: pub::DummyConnectorPaymentsResponse
    - struct: pub::DummyConnectorRefundRequest
    - struct: pub::RefundResponse
    - struct: pub::DummyConnectorErrorResponse
    - enum: pub::DummyConnectorPaymentStatus
    - enum: pub::RefundStatus
    - impl: impl TryFrom<&types::PaymentsAuthorizeRouterData> for DummyConnectorPaymentsRequest
    - impl: impl TryFrom<&types::ConnectorAuthType> for DummyConnectorAuthType
    - impl: impl From<DummyConnectorPaymentStatus> for enums::AttemptStatus
    - impl: impl TryFrom<
        types::ResponseRouterData<
            F,
            DummyConnectorPaymentsResponse,
            T,
            types::PaymentsResponseData,
        >,
    > for types::RouterData<F, T, types::PaymentsResponseData>
    - impl: impl TryFrom<&types::RefundsRouterData<F>> for DummyConnectorRefundRequest
    - impl: impl From<RefundStatus> for enums::RefundStatus
    - impl: impl TryFrom<types::RefundsResponseRouterData<api::Execute, RefundResponse>> for types::RefundsRouterData<api::Execute>
    - impl: impl TryFrom<types::RefundsResponseRouterData<api::RSync, RefundResponse>> for types::RefundsRouterData<api::RSync>

**crates/router/src/core/payments/flows.rs**
  Modify existing code

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

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

**crates/router/tests/connectors/dummyconnector.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_card_number
    - function: private::should_fail_payment_for_empty_card_number
    - 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::DummyConnectorTest
    - impl: impl ConnectorActions for DummyConnectorTest
    - impl: impl utils::Connector for DummyConnectorTest

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