Bug: [BUG] : [razorpay] wrong refund webhook reference id



### Bug Description

Because of wrong refund webhook reference id, refund webhooks are failing while received by hyperswitch

### Expected Behavior

Hyperswitch should identify the refund and trigger a Rsync to update the status.

### Actual Behavior

Hyperswitch does not  identify the refund and refund remain in pending status

### 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

_No response_

### Environment

Are you using hyperswitch hosted version? Yes/No
If yes, please provide the value of the `x-request-id` response header to help us debug your issue.

If not (or if building/running locally), please provide the following details:
1. Operating System or Linux distribution:
2. Rust version (output of `rustc --version`): ``
3. App version (output of `cargo r --features vergen -- --version`): ``


### 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/razorpay.rs b/crates/router/src/connector/razorpay.rs
index 15fac492120..737ead477c3 100644
--- a/crates/router/src/connector/razorpay.rs
+++ b/crates/router/src/connector/razorpay.rs
@@ -630,7 +630,7 @@ impl api::IncomingWebhook for Razorpay {
         let webhook_resource_object = get_webhook_object_from_body(request.body)?;
         match webhook_resource_object.refund {
             Some(refund_data) => Ok(api_models::webhooks::ObjectReferenceId::RefundId(
-                api_models::webhooks::RefundIdType::RefundId(refund_data.entity.id),
+                api_models::webhooks::RefundIdType::ConnectorRefundId(refund_data.entity.id),
             )),
             None => Ok(api_models::webhooks::ObjectReferenceId::PaymentId(
                 api_models::payments::PaymentIdType::ConnectorTransactionId(

## 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 -->
Currently we are passing a wrong refund webhook reference id, hence refund webhooks are failing while received by hyperswitch.
 
After this PR
Hyperswitch should identify refund webhook and trigger a Rsync to update the status


## 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. Create a payment with Razorpay UPI Collect
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_UlJFXb4LACytmSXSI3i9J9N6aFzJELAUCypIwcylOhr5nhhGr6wOioIxQ52KGuDb' \
--data-raw '{
  "amount": 5000,
  "currency": "INR",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 5000,
  "customer_id": "IatapayCustomer",
  "email": "guest@example.com",
  "name": "John Doe",
  "phone": "999999999",
  "phone_country_code": "+1",
  "description": "Its my first payment request",
  "authentication_type": "no_three_ds",
  "return_url": "https://google.com",
  "payment_method": "upi",
  "payment_method_type": "upi_collect",
  "payment_method_data": {
    "upi": {
      "upi_collect": {
      "vpa_id": "9490419802@ybl"
      }
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "IN",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }
}'
```
Response
```
{
    "payment_id": "pay_3mp411CRviQIHXlLmjJY",
    "merchant_id": "merchant_1720626789",
    "status": "processing",
    "amount": 5000,
    "net_amount": 5000,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "razorpay",
    "client_secret": "pay_3mp411CRviQIHXlLmjJY_secret_cjQr2JxXyhYbKgOHZouw",
    "created": "2024-07-11T12:16:11.242Z",
    "currency": "INR",
    "customer_id": "IatapayCustomer",
    "customer": {
        "id": "IatapayCustomer",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "upi",
    "payment_method_data": {
        "upi": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "IN",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "upi_collect",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "IatapayCustomer",
        "created_at": 1720700171,
        "expires": 1720703771,
        "secret": "epk_163c8836572b47cba27465fe8b7a622e"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "pay_OXK0gn9yX2qv0N",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_3mp411CRviQIHXlLmjJY_1",
    "payment_link": null,
    "profile_id": "pro_onmiv6JSZNIGR84hhQ05",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_LP7o6Xf3hAyiIpcIQA8C",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-07-11T12:31:11.242Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-07-11T12:16:13.722Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}
```
2. Do a force Psync
```
curl --location 'localhost:8080/payments/pay_3mp411CRviQIHXlLmjJY?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key:'
```
Response
```
{
    "payment_id": "pay_3mp411CRviQIHXlLmjJY",
    "merchant_id": "merchant_1720626789",
    "status": "succeeded",
    "amount": 5000,
    "net_amount": 5000,
    "amount_capturable": 0,
    "amount_received": 5000,
    "connector": "razorpay",
    "client_secret": "pay_3mp411CRviQIHXlLmjJY_secret_cjQr2JxXyhYbKgOHZouw",
    "created": "2024-07-11T12:16:11.242Z",
    "currency": "INR",
    "customer_id": "IatapayCustomer",
    "customer": {
        "id": "IatapayCustomer",
        "name": "John Doe",
        "email": "guest@example.com",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "upi",
    "payment_method_data": {
        "upi": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "IN",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "upi_collect",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "pay_OXK0gn9yX2qv0N",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_3mp411CRviQIHXlLmjJY_1",
    "payment_link": null,
    "profile_id": "pro_onmiv6JSZNIGR84hhQ05",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_LP7o6Xf3hAyiIpcIQA8C",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-07-11T12:31:11.242Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-07-11T12:16:30.610Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null
}
```
3. Create a refund 
```
curl --location 'localhost:8080/refunds' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_UlJFXb4LACytmSXSI3i9J9N6aFzJELAUCypIwcylOhr5nhhGr6wOioIxQ52KGuDb' \
--data '{
    "payment_id": "pay_3mp411CRviQIHXlLmjJY",
    "amount": 5000,
    "reason": "Customer returned product",
  "refund_type": "instant",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }

}'
```
Response
```
{
    "refund_id": "ref_tgRu9lJFmOlsx52KiWL9",
    "payment_id": "pay_3mp411CRviQIHXlLmjJY",
    "amount": 5000,
    "currency": "INR",
    "status": "pending",
    "reason": "Customer returned product",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "error_message": null,
    "error_code": null,
    "created_at": "2024-07-11T12:16:36.811Z",
    "updated_at": "2024-07-11T12:16:36.811Z",
    "connector": "razorpay",
    "profile_id": "pro_onmiv6JSZNIGR84hhQ05",
    "merchant_connector_id": "mca_LP7o6Xf3hAyiIpcIQA8C",
    "charges": null
}
```
4. Wait untill the refund gets succeeded at Razorpay. Before refund sync, check the refund table in the DB for refund status
<img width="1642" alt="Screenshot 2024-07-11 at 5 49 02 PM" src="https://github.com/juspay/hyperswitch/assets/131388445/a91e03b3-1e2a-4bfb-828e-f2834181d3be">

 
## 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
