Bug: [BUG] [HELCIM] 5XX Error Happening If Wrong Api Key Is Passed



### Bug Description

If wrong `api_key` is passed during `Payment Connector - Create` for connector Helcim then the server throws 5XX error  when you create a payment.

### Expected Behavior

The connector should handle the error thrown during `Payments - Create` if wrong `api_key` is passed during `Payment Connector - Create`

### Actual Behavior

The connector throws 5XX Error during `Payments - Create` if wrong `api_key` is passed during `Payment Connector - Create`

### Steps To Reproduce

Provide an unambiguous set of steps to reproduce this bug. Include code or configuration to reproduce, if relevant.
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'


### Context For The Bug

If wrong `api_key` is passed during `Payment Connector - Create` for connector Helcim then the server throws 5XX error  when you create a payment.

### Environment
SANDBOX

### Have you spent some time checking if this bug 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!
diff --git a/crates/router/src/connector/helcim.rs b/crates/router/src/connector/helcim.rs
index c3a6c5e9f50..0b2cac5d766 100644
--- a/crates/router/src/connector/helcim.rs
+++ b/crates/router/src/connector/helcim.rs
@@ -128,9 +128,12 @@ impl ConnectorCommon for Helcim {
             .response
             .parse_struct("HelcimErrorResponse")
             .change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
-        let error_string = match response.errors {
-            transformers::HelcimErrorTypes::StringType(error) => error,
-            transformers::HelcimErrorTypes::JsonType(error) => error.to_string(),
+        let error_string = match response {
+            transformers::HelcimErrorResponse::Payment(response) => match response.errors {
+                transformers::HelcimErrorTypes::StringType(error) => error,
+                transformers::HelcimErrorTypes::JsonType(error) => error.to_string(),
+            },
+            transformers::HelcimErrorResponse::General(error_string) => error_string,
         };
 
         Ok(ErrorResponse {
diff --git a/crates/router/src/connector/helcim/transformers.rs b/crates/router/src/connector/helcim/transformers.rs
index 599054163c3..5e076be651f 100644
--- a/crates/router/src/connector/helcim/transformers.rs
+++ b/crates/router/src/connector/helcim/transformers.rs
@@ -756,6 +756,13 @@ pub enum HelcimErrorTypes {
 }
 
 #[derive(Debug, Deserialize)]
-pub struct HelcimErrorResponse {
+pub struct HelcimPaymentsErrorResponse {
     pub errors: HelcimErrorTypes,
 }
+
+#[derive(Debug, Deserialize)]
+#[serde(untagged)]
+pub enum HelcimErrorResponse {
+    Payment(HelcimPaymentsErrorResponse),
+    General(String),
+}

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [x] Bugfix
- [ ] New feature
- [ ] Enhancement
- [ ] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
Earlier if wrong api_key is passed during Payment Connector - Create for connector Helcim then the server throws 5XX error when you create a payment.

The connector will now handle the error thrown during Payments - Create if wrong api_key is passed during Payment Connector - Create.

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->
https://github.com/juspay/hyperswitch/issues/3457

## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->

1. Testing can be done by creating a payment with wrong api credentials. You should get the following error.
![Screenshot 2024-01-25 at 3 05 57 PM](https://github.com/juspay/hyperswitch/assets/41580413/a285179a-82b6-463d-8966-1e6ae58b8c5a)
```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: API_KEY_HERE' \
--data '{
  "amount": 210,
  "currency": "USD",
  "confirm": true,
  "capture_method": "automatic",
  "description": "Its my first payment request",
  "authentication_type": "no_three_ds",
  "payment_method": "card",
  "payment_method_type": "credit",
  "setup_future_usage": "on_session",
  "payment_method_data": {
    "card": {
      "card_number": "5413330089099130",
      "card_exp_month": "01",
      "card_exp_year": "27",
      "card_cvc": "123",
      "card_holder_name": "John Doe"
    }
  },
  "browser_info": {
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
    "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "language": "nl-NL",
    "color_depth": 24,
    "screen_height": 723,
    "screen_width": 1536,
    "time_zone": 0,
    "java_enabled": true,
    "java_script_enabled": true,
    "ip_address": "127.0.0.1"
  },
  "billing": {
    "address": {
      "line1": "1467",
      "zip": "94122",
      "first_name": "John",
      "last_name": "Doe"
    }
  },
  "customer_id": "chethan"
}'
```

2. Testing for other error case like missing field error should also be done. You will get the following error:
![Screenshot 2024-01-25 at 3 28 13 PM](https://github.com/juspay/hyperswitch/assets/41580413/07d623ac-82af-4377-be43-a1e5420c55b1)
```curl
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: API_KEY_HERE' \
--data '{
  "amount": 210,
  "currency": "USD",
  "confirm": true,
  "capture_method": "automatic",
  "description": "Its my first payment request",
  "authentication_type": "no_three_ds",
  "payment_method": "card",
  "payment_method_type": "credit",
  "setup_future_usage": "on_session",
  "payment_method_data": {
    "card": {
      "card_number": "5413330089099130",
      "card_exp_month": "01",
      "card_exp_year": "27",
      "card_cvc": "123",
      "card_holder_name": "John Doe"
    }
  },
  "browser_info": {
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
    "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "language": "nl-NL",
    "color_depth": 24,
    "screen_height": 723,
    "screen_width": 1536,
    "time_zone": 0,
    "java_enabled": true,
    "java_script_enabled": true,
    "ip_address": "127.0.0.1"
  },
  "billing": {
    "address": {
      "line1": "",
      "zip": "94122",
      "first_name": "John",
      "last_name": "Doe"
    }
  },
  "customer_id": "chethan"
}'
``` 

## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
