Issue:
Bug: [FEATURE] Automatic connector_payment_id hashing in v2 if length > 128 in v2



### Feature Description

Automatically hash connector_payment_id longer than 128 chars and store the original in connector_payment_data.

### Possible Implementation

Implement hashing in PaymentAttemptUpdate conversion by using ConnectorTransactionId::form_id_and_data, setting connector_payment_id to the hash and preserving the original in connector_payment_data.

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

Pull request description:
## 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 -->
Implement hashing in PaymentAttemptUpdate conversion by using ConnectorTransactionId::form_id_and_data, setting connector_payment_id to the hash and preserving the original in connector_payment_data.For worldpay connector_payment_id should be less then 128 so after this original payment_id will be stored in connector_payment_data and hased id will be stored in connector_payment_id that is less than 128.

### 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).
-->
If connector transaction id is more than 128 then payment intents are failing.


## 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)?
-->
Request:
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0198ccb7376f74a38cad615be26fa5a8/confirm-intent' \
--header 'x-profile-id: pro_ODIfdcDxqoiMbqheIsJk' \
--header 'x-client-secret: cs_0198ccb737837d90b70939489421999b' \
--header 'Authorization: api-key=dev_uf0UlpOafwdX9RSG1PcLVpW7X2QBwM9h3XQ0dYplnSaUxz19t18ylXpa7KcLMZK5' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_1c90c0f7679f4edd8544c8dfe39fc46d' \
--data '{
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "01",
            "card_exp_year": "26",
            "card_holder_name": "John Doe",
            "card_cvc": "100"
        }
    },
    "payment_method_type": "card",
    "payment_method_subtype": "credit",
     "browser_info": {
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
        "accept_header": "text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,*\\/*;q=0.8",
        "language": "en-GB",
        "color_depth": 24,
        "screen_height": 1440,
        "screen_width": 2560,
        "time_zone": -330,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "0.0.0.0"
    }
}'
```
Response:
```
{
    "id": "12345_pay_0198ccb7376f74a38cad615be26fa5a8",
    "status": "succeeded",
    "amount": {
        "order_amount": 100,
        "currency": "USD",
        "shipping_cost": null,
        "order_tax_amount": null,
        "external_tax_calculation": "skip",
        "surcharge_calculation": "skip",
        "surcharge_amount": null,
        "tax_on_surcharge": null,
        "net_amount": 100,
        "amount_to_capture": null,
        "amount_capturable": 0,
        "amount_captured": 100
    },
    "customer_id": null,
    "connector": "worldpay",
    "created": "2025-08-21T13:00:16.122Z",
    "payment_method_data": {
        "billing": null
    },
    "payment_method_type": "card",
    "payment_method_subtype": "credit",
    "connector_transaction_id": "eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT9TAfq0WMxFYyAoD6mMf6Crhf7XoNg6BSaRfnbGX:1Ranv7RKyexxN4UZGNvq4ZuRjjszRbCOMdf1GwWUwp05qAqWWPHGXgnjILdaJfxgAakBurvk:7t7Hx793s0jicYqEU4sbE4TxIcxVuGWepjm49witK5xZ3XDNLML2TKoEMEhI+bQbMnX8zOFyl9tDujZnveoWvbcKsU0kCH69a7ZfVd6u38N8OTvVGU+L0IvQTMgnGh5Fkg:0WwlgnJokKmtPBi4oU3Cnnm+nW8BSObf1OW7W1blA9xV3jt84HBWb3g==",
    "connector_reference_id": "6632a554-bf74-46cb-be9c-c03c0f6e597d",
    "merchant_connector_id": "mca_fRb8a8ohINpIeEdELcwq",
    "browser_info": null,
    "error": null,
    "shipping": null,
    "billing": null,
    "attempts": null,
    "connector_token_details": null,
    "payment_method_id": null,
    "next_action": null,
    "return_url": "https://google.com/success",
    "authentication_type": "no_three_ds",
    "authentication_type_applied": "no_three_ds",
    "is_iframe_redirection_enabled": null,
    "merchant_reference_id": null,
    "raw_connector_response": null,
    "feature_metadata": null
}
```
<img width="1325" height="1039" alt="image" src="https://github.com/user-attachments/assets/a4d6841d-2819-4605-b2ac-f848ecaa468a" />

<img width="1721" height="205" alt="image" src="https://github.com/user-attachments/assets/850533c8-a55f-49fb-b1a4-acc3b88d692c" />



closes #9016 


## 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


Testing:

Request:
```
curl --location 'http://localhost:8080/v2/payments/12345_pay_0198ccb7376f74a38cad615be26fa5a8/confirm-intent' \
--header 'x-profile-id: pro_ODIfdcDxqoiMbqheIsJk' \
--header 'x-client-secret: cs_0198ccb737837d90b70939489421999b' \
--header 'Authorization: api-key=dev_uf0UlpOafwdX9RSG1PcLVpW7X2QBwM9h3XQ0dYplnSaUxz19t18ylXpa7KcLMZK5' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_1c90c0f7679f4edd8544c8dfe39fc46d' \
--data '{
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "01",
            "card_exp_year": "26",
            "card_holder_name": "John Doe",
            "card_cvc": "100"
        }
    },
    "payment_method_type": "card",
    "payment_method_subtype": "credit",
     "browser_info": {
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
        "accept_header": "text\\/html,application\\/xhtml+xml,application\\/xml;q=0.9,image\\/webp,image\\/apng,*\\/*;q=0.8",
        "language": "en-GB",
        "color_depth": 24,
        "screen_height": 1440,
        "screen_width": 2560,
        "time_zone": -330,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "0.0.0.0"
    }
}'
```
Response:
```
{
    "id": "12345_pay_0198ccb7376f74a38cad615be26fa5a8",
    "status": "succeeded",
    "amount": {
        "order_amount": 100,
        "currency": "USD",
        "shipping_cost": null,
        "order_tax_amount": null,
        "external_tax_calculation": "skip",
        "surcharge_calculation": "skip",
        "surcharge_amount": null,
        "tax_on_surcharge": null,
        "net_amount": 100,
        "amount_to_capture": null,
        "amount_capturable": 0,
        "amount_captured": 100
    },
    "customer_id": null,
    "connector": "worldpay",
    "created": "2025-08-21T13:00:16.122Z",
    "payment_method_data": {
        "billing": null
    },
    "payment_method_type": "card",
    "payment_method_subtype": "credit",
    "connector_transaction_id": "eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT9TAfq0WMxFYyAoD6mMf6Crhf7XoNg6BSaRfnbGX:1Ranv7RKyexxN4UZGNvq4ZuRjjszRbCOMdf1GwWUwp05qAqWWPHGXgnjILdaJfxgAakBurvk:7t7Hx793s0jicYqEU4sbE4TxIcxVuGWepjm49witK5xZ3XDNLML2TKoEMEhI+bQbMnX8zOFyl9tDujZnveoWvbcKsU0kCH69a7ZfVd6u38N8OTvVGU+L0IvQTMgnGh5Fkg:0WwlgnJokKmtPBi4oU3Cnnm+nW8BSObf1OW7W1blA9xV3jt84HBWb3g==",
    "connector_reference_id": "6632a554-bf74-46cb-be9c-c03c0f6e597d",
    "merchant_connector_id": "mca_fRb8a8ohINpIeEdELcwq",
    "browser_info": null,
    "error": null,
    "shipping": null,
    "billing": null,
    "attempts": null,
    "connector_token_details": null,
    "payment_method_id": null,
    "next_action": null,
    "return_url": "https://google.com/success",
    "authentication_type": "no_three_ds",
    "authentication_type_applied": "no_three_ds",
    "is_iframe_redirection_enabled": null,
    "merchant_reference_id": null,
    "raw_connector_response": null,
    "feature_metadata": null
}
```
<img width="1325" height="1039" alt="image" src="https://github.com/user-attachments/assets/a4d6841d-2819-4605-b2ac-f848ecaa468a" />

<img width="1721" height="205" alt="image" src="https://github.com/user-attachments/assets/850533c8-a55f-49fb-b1a4-acc3b88d692c" />



closes #9016 

Patch:
diff --git a/crates/diesel_models/src/payment_attempt.rs b/crates/diesel_models/src/payment_attempt.rs
index 0a085991815..7a1494ea923 100644
--- a/crates/diesel_models/src/payment_attempt.rs
+++ b/crates/diesel_models/src/payment_attempt.rs
@@ -743,57 +743,51 @@ pub enum PaymentAttemptUpdate {
     //     error_message: Option<Option<String>>,
     //     updated_by: String,
     // },
-    // ResponseUpdate {
-    //     status: storage_enums::AttemptStatus,
-    //     connector: Option<String>,
-    //     connector_transaction_id: Option<String>,
-    //     authentication_type: Option<storage_enums::AuthenticationType>,
-    //     payment_method_id: Option<String>,
-    //     mandate_id: Option<String>,
-    //     connector_metadata: Option<serde_json::Value>,
-    //     payment_token: Option<String>,
-    //     error_code: Option<Option<String>>,
-    //     error_message: Option<Option<String>>,
-    //     error_reason: Option<Option<String>>,
-    //     connector_response_reference_id: Option<String>,
-    //     amount_capturable: Option<MinorUnit>,
-    //     updated_by: String,
-    //     authentication_data: Option<serde_json::Value>,
-    //     encoded_data: Option<String>,
-    //     unified_code: Option<Option<String>>,
-    //     unified_message: Option<Option<String>>,
-    //     payment_method_data: Option<serde_json::Value>,
-    //     charge_id: Option<String>,
-    // },
-    // UnresolvedResponseUpdate {
-    //     status: storage_enums::AttemptStatus,
-    //     connector: Option<String>,
-    //     connector_transaction_id: Option<String>,
-    //     payment_method_id: Option<String>,
-    //     error_code: Option<Option<String>>,
-    //     error_message: Option<Option<String>>,
-    //     error_reason: Option<Option<String>>,
-    //     connector_response_reference_id: Option<String>,
-    //     updated_by: String,
-    // },
+    ResponseUpdate {
+        status: storage_enums::AttemptStatus,
+        connector: Option<String>,
+        connector_payment_id: Option<String>,
+        authentication_type: Option<storage_enums::AuthenticationType>,
+        payment_method_id: Option<id_type::GlobalPaymentMethodId>,
+        connector_metadata: Option<pii::SecretSerdeValue>,
+        payment_token: Option<String>,
+        error_code: Option<Option<String>>,
+        error_message: Option<Option<String>>,
+        error_reason: Option<Option<String>>,
+        connector_response_reference_id: Option<String>,
+        amount_capturable: Option<MinorUnit>,
+        updated_by: String,
+        unified_code: Option<Option<String>>,
+        unified_message: Option<Option<String>>,
+    },
+    UnresolvedResponseUpdate {
+        status: storage_enums::AttemptStatus,
+        connector: Option<String>,
+        connector_payment_id: Option<String>,
+        payment_method_id: Option<id_type::GlobalPaymentMethodId>,
+        error_code: Option<Option<String>>,
+        error_message: Option<Option<String>>,
+        error_reason: Option<Option<String>>,
+        connector_response_reference_id: Option<String>,
+        updated_by: String,
+    },
     // StatusUpdate {
     //     status: storage_enums::AttemptStatus,
     //     updated_by: String,
     // },
-    // ErrorUpdate {
-    //     connector: Option<String>,
-    //     status: storage_enums::AttemptStatus,
-    //     error_code: Option<Option<String>>,
-    //     error_message: Option<Option<String>>,
-    //     error_reason: Option<Option<String>>,
-    //     amount_capturable: Option<MinorUnit>,
-    //     updated_by: String,
-    //     unified_code: Option<Option<String>>,
-    //     unified_message: Option<Option<String>>,
-    //     connector_transaction_id: Option<String>,
-    //     payment_method_data: Option<serde_json::Value>,
-    //     authentication_type: Option<storage_enums::AuthenticationType>,
-    // },
+    ErrorUpdate {
+        connector: Option<String>,
+        status: storage_enums::AttemptStatus,
+        error_code: Option<Option<String>>,
+        error_message: Option<Option<String>>,
+        error_reason: Option<Option<String>>,
+        amount_capturable: Option<MinorUnit>,
+        updated_by: String,
+        unified_code: Option<Option<String>>,
+        unified_message: Option<Option<String>>,
+        connector_payment_id: Option<String>,
+        authentication_type: Option<storage_enums::AuthenticationType>,
+    },
     // CaptureUpdate {
     //     amount_to_capture: Option<MinorUnit>,
     //     multiple_capture_count: Option<MinorUnit>,
@@ -804,23 +798,20 @@ pub enum PaymentAttemptUpdate {
     //     amount_capturable: MinorUnit,
     //     updated_by: String,
     // },
-    // PreprocessingUpdate {
-    //     status: storage_enums::AttemptStatus,
-    //     payment_method_id: Option<String>,
-    //     connector_metadata: Option<serde_json::Value>,
-    //     preprocessing_step_id: Option<String>,
-    //     connector_transaction_id: Option<String>,
-    //     connector_response_reference_id: Option<String>,
-    //     updated_by: String,
-    // },
-    // ConnectorResponse {
-    //     authentication_data: Option<serde_json::Value>,
-    //     encoded_data: Option<String>,
-    //     connector_transaction_id: Option<String>,
-    //     connector: Option<String>,
-    //     charge_id: Option<String>,
-    //     updated_by: String,
-    // },
+    PreprocessingUpdate {
+        status: storage_enums::AttemptStatus,
+        payment_method_id: Option<id_type::GlobalPaymentMethodId>,
+        connector_metadata: Option<pii::SecretSerdeValue>,
+        preprocessing_step_id: Option<String>,
+        connector_payment_id: Option<String>,
+        connector_response_reference_id: Option<String>,
+        updated_by: String,
+    },
+    ConnectorResponse {
+        connector_payment_id: Option<String>,
+        connector: Option<String>,
+        updated_by: String,
+    },
     // IncrementalAuthorizationAmountUpdate {
     //     amount: MinorUnit,
     //     amount_capturable: MinorUnit,
@@ -832,16 +823,16 @@ pub enum PaymentAttemptUpdate {
     //     authentication_id: Option<String>,
     //     updated_by: String,
     // },
-    // ManualUpdate {
-    //     status: Option<storage_enums::AttemptStatus>,
-    //     error_code: Option<String>,
-    //     error_message: Option<String>,
-    //     error_reason: Option<String>,
-    //     updated_by: String,
-    //     unified_code: Option<String>,
-    //     unified_message: Option<String>,
-    //     connector_transaction_id: Option<String>,
-    // },
+    ManualUpdate {
+        status: Option<storage_enums::AttemptStatus>,
+        error_code: Option<String>,
+        error_message: Option<String>,
+        error_reason: Option<String>,
+        updated_by: String,
+        unified_code: Option<String>,
+        unified_message: Option<String>,
+        connector_payment_id: Option<String>,
+    },
 }
 
 // TODO: uncomment fields as and when required
@@ -852,7 +843,8 @@ pub struct PaymentAttemptUpdateInternal {
     pub status: Option<storage_enums::AttemptStatus>,
     pub authentication_type: Option<storage_enums::AuthenticationType>,
     pub error_message: Option<String>,
-    pub connector_payment_id: Option<String>,
+    pub connector_payment_id: Option<ConnectorTransactionId>,
+    pub connector_payment_data: Option<String>,
     pub payment_method_id: Option<id_type::GlobalPaymentMethodId>,
     // cancellation_reason: Option<String>,
     pub modified_at: PrimitiveDateTime,
@@ -875,8 +867,8 @@ pub struct PaymentAttemptUpdateInternal {
     pub connector: Option<String>,
     pub redirection_data: Option<RedirectForm>,
     // encoded_data: Option<String>,
-    pub unified_code: Option<Option<String>>,
-    pub unified_message: Option<Option<String>>,
+    pub unified_code: Option<String>,
+    pub unified_message: Option<String>,
     // external_three_ds_authentication_attempted: Option<bool>,
     // authentication_connector: Option<String>,
     // authentication_id: Option<String>,
@@ -902,6 +894,7 @@ impl PaymentAttemptUpdateInternal {
             authentication_type,
             error_message,
             connector_payment_id,
+            connector_payment_data,
             modified_at,
             browser_info,
             error_code,
@@ -958,8 +951,8 @@ impl PaymentAttemptUpdateInternal {
             updated_by,
             merchant_connector_id: merchant_connector_id.or(source.merchant_connector_id),
             encoded_data: source.encoded_data,
-            unified_code: unified_code.flatten().or(source.unified_code),
-            unified_message: unified_message.flatten().or(source.unified_message),
+            unified_code: unified_code.or(source.unified_code),
+            unified_message: unified_message.or(source.unified_message),
             net_amount: source.net_amount,
             external_three_ds_authentication_attempted: source
                 .external_three_ds_authentication_attempted,
@@ -983,7 +976,7 @@ impl PaymentAttemptUpdateInternal {
             created_by: source.created_by,
             payment_method_type_v2: source.payment_method_type_v2,
             network_transaction_id: source.network_transaction_id,
-            connector_payment_id: source.connector_payment_id,
+            connector_payment_id: connector_payment_id.or(source.connector_payment_id),
             payment_method_subtype: source.payment_method_subtype,
             routing_result: source.routing_result,
             authentication_applied: source.authentication_applied,
@@ -991,7 +984,7 @@ impl PaymentAttemptUpdateInternal {
             tax_on_surcharge: source.tax_on_surcharge,
             payment_method_billing_address: source.payment_method_billing_address,
             redirection_data: redirection_data.or(source.redirection_data),
-            connector_payment_data: source.connector_payment_data,
+            connector_payment_data: connector_payment_data.or(source.connector_payment_data),
             connector_token_details: connector_token_details.or(source.connector_token_details),
             id: source.id,
             feature_metadata: feature_metadata.or(source.feature_metadata),
@@ -1336,8 +1329,278 @@ impl PaymentAttemptUpdate {
 
 #[cfg(feature = "v2")]
 impl From<PaymentAttemptUpdate> for PaymentAttemptUpdateInternal {
-    fn from(_payment_attempt_update: PaymentAttemptUpdate) -> Self {
-        todo!()
+    fn from(payment_attempt_update: PaymentAttemptUpdate) -> Self {
+        match payment_attempt_update {
+            PaymentAttemptUpdate::ResponseUpdate {
+                status,
+                connector,
+                connector_payment_id,
+                authentication_type,
+                payment_method_id,
+                connector_metadata,
+                payment_token,
+                error_code,
+                error_message,
+                error_reason,
+                connector_response_reference_id,
+                amount_capturable,
+                updated_by,
+                unified_code,
+                unified_message,
+            } => {
+                let (connector_payment_id, connector_payment_data) = connector_payment_id
+                    .map(ConnectorTransactionId::form_id_and_data)
+                    .map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
+                    .unwrap_or((None, None));
+
+                Self {
+                    status: Some(status),
+                    connector,
+                    connector_payment_id,
+                    connector_payment_data,
+                    authentication_type,
+                    payment_method_id,
+                    connector_metadata,
+                    error_code: error_code.flatten(),
+                    error_message: error_message.flatten(),
+                    error_reason: error_reason.flatten(),
+                    connector_response_reference_id,
+                    amount_capturable,
+                    updated_by,
+                    unified_code: unified_code.flatten(),
+                    unified_message: unified_message.flatten(),
+                    modified_at: common_utils::date_time::now(),
+                    browser_info: None,
+                    amount_to_capture: None,
+                    merchant_connector_id: None,
+                    redirection_data: None,
+                    connector_token_details: None,
+                    feature_metadata: None,
+                    network_decline_code: None,
+                    network_advice_code: None,
+                    network_error_message: None,
+                    connector_request_reference_id: None,
+                }
+            }
+            PaymentAttemptUpdate::ErrorUpdate {
+                connector,
+                status,
+                error_code,
+                error_message,
+                error_reason,
+                amount_capturable,
+                updated_by,
+                unified_code,
+                unified_message,
+                connector_payment_id,
+                authentication_type,
+            } => {
+                let (connector_payment_id, connector_payment_data) = connector_payment_id
+                    .map(ConnectorTransactionId::form_id_and_data)
+                    .map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
+                    .unwrap_or((None, None));
+
+                Self {
+                    connector,
+                    status: Some(status),
+                    error_code: error_code.flatten(),
+                    error_message: error_message.flatten(),
+                    error_reason: error_reason.flatten(),
+                    amount_capturable,
+                    updated_by,
+                    unified_code: unified_code.flatten(),
+                    unified_message: unified_message.flatten(),
+                    connector_payment_id,
+                    connector_payment_data,
+                    authentication_type,
+                    modified_at: common_utils::date_time::now(),
+                    payment_method_id: None,
+                    browser_info: None,
+                    connector_metadata: None,
+                    amount_to_capture: None,
+                    merchant_connector_id: None,
+                    redirection_data: None,
+                    connector_token_details: None,
+                    feature_metadata: None,
+                    network_decline_code: None,
+                    network_advice_code: None,
+                    network_error_message: None,
+                    connector_request_reference_id: None,
+                    connector_response_reference_id: None,
+                }
+            }
+            PaymentAttemptUpdate::UnresolvedResponseUpdate {
+                status,
+                connector,
+                connector_payment_id,
+                payment_method_id,
+                error_code,
+                error_message,
+                error_reason,
+                connector_response_reference_id,
+                updated_by,
+            } => {
+                let (connector_payment_id, connector_payment_data) = connector_payment_id
+                    .map(ConnectorTransactionId::form_id_and_data)
+                    .map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
+                    .unwrap_or((None, None));
+
+                Self {
+                    status: Some(status),
+                    connector,
+                    connector_payment_id,
+                    connector_payment_data,
+                    payment_method_id,
+                    error_code: error_code.flatten(),
+                    error_message: error_message.flatten(),
+                    error_reason: error_reason.flatten(),
+                    connector_response_reference_id,
+                    updated_by,
+                    modified_at: common_utils::date_time::now(),
+                    authentication_type: None,
+                    browser_info: None,
+                    connector_metadata: None,
+                    amount_capturable: None,
+                    amount_to_capture: None,
+                    merchant_connector_id: None,
+                    redirection_data: None,
+                    unified_code: None,
+                    unified_message: None,
+                    connector_token_details: None,
+                    feature_metadata: None,
+                    network_decline_code: None,
+                    network_advice_code: None,
+                    network_error_message: None,
+                    connector_request_reference_id: None,
+                }
+            }
+            PaymentAttemptUpdate::PreprocessingUpdate {
+                status,
+                payment_method_id,
+                connector_metadata,
+                preprocessing_step_id,
+                connector_payment_id,
+                connector_response_reference_id,
+                updated_by,
+            } => {
+                let (connector_payment_id, connector_payment_data) = connector_payment_id
+                    .map(ConnectorTransactionId::form_id_and_data)
+                    .map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
+                    .unwrap_or((None, None));
+
+                Self {
+                    status: Some(status),
+                    payment_method_id,
+                    connector_metadata,
+                    connector_payment_id,
+                    connector_payment_data,
+                    connector_response_reference_id,
+                    updated_by,
+                    modified_at: common_utils::date_time::now(),
+                    authentication_type: None,
+                    error_message: None,
+                    browser_info: None,
+                    error_code: None,
+                    error_reason: None,
+                    amount_capturable: None,
+                    amount_to_capture: None,
+                    merchant_connector_id: None,
+                    connector: None,
+                    redirection_data: None,
+                    unified_code: None,
+                    unified_message: None,
+                    connector_token_details: None,
+                    feature_metadata: None,
+                    network_decline_code: None,
+                    network_advice_code: None,
+                    network_error_message: None,
+                    connector_request_reference_id: None,
+                }
+            }
+            PaymentAttemptUpdate::ConnectorResponse {
+                connector_payment_id,
+                connector,
+                updated_by,
+            } => {
+                let (connector_payment_id, connector_payment_data) = connector_payment_id
+                    .map(ConnectorTransactionId::form_id_and_data)
+                    .map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
+                    .unwrap_or((None, None));
+
+                Self {
+                    connector_payment_id,
+                    connector_payment_data,
+                    connector,
+                    updated_by,
+                    modified_at: common_utils::date_time::now(),
+                    status: None,
+                    authentication_type: None,
+                    error_message: None,
+                    payment_method_id: None,
+                    browser_info: None,
+                    error_code: None,
+                    connector_metadata: None,
+                    error_reason: None,
+                    amount_capturable: None,
+                    amount_to_capture: None,
+                    merchant_connector_id: None,
+                    redirection_data: None,
+                    unified_code: None,
+                    unified_message: None,
+                    connector_token_details: None,
+                    feature_metadata: None,
+                    network_decline_code: None,
+                    network_advice_code: None,
+                    network_error_message: None,
+                    connector_request_reference_id: None,
+                    connector_response_reference_id: None,
+                }
+            }
+            PaymentAttemptUpdate::ManualUpdate {
+                status,
+                error_code,
+                error_message,
+                error_reason,
+                updated_by,
+                unified_code,
+                unified_message,
+                connector_payment_id,
+            } => {
+                let (connector_payment_id, connector_payment_data) = connector_payment_id
+                    .map(ConnectorTransactionId::form_id_and_data)
+                    .map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
+                    .unwrap_or((None, None));
+
+                Self {
+                    status,
+                    error_code,
+                    error_message,
+                    error_reason,
+                    updated_by,
+                    unified_code,
+                    unified_message,
+                    connector_payment_id,
+                    connector_payment_data,
+                    modified_at: common_utils::date_time::now(),
+                    authentication_type: None,
+                    payment_method_id: None,
+                    browser_info: None,
+                    connector_metadata: None,
+                    amount_capturable: None,
+                    amount_to_capture: None,
+                    merchant_connector_id: None,
+                    connector: None,
+                    redirection_data: None,
+                    connector_token_details: None,
+                    feature_metadata: None,
+                    network_decline_code: None,
+                    network_advice_code: None,
+                    network_error_message: None,
+                    connector_request_reference_id: None,
+                    connector_response_reference_id: None,
+                }
+            }
+        }
         // match payment_attempt_update {
         //     PaymentAttemptUpdate::Update {
         //         amount,
diff --git a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
index 4d1ae8bb920..ef33e561b4e 100644
--- a/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
+++ b/crates/hyperswitch_domain_models/src/payments/payment_attempt.rs
@@ -2805,6 +2805,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
                 unified_code: None,
                 unified_message: None,
                 connector_payment_id: None,
+                connector_payment_data: None,
                 connector: Some(connector),
                 redirection_data: None,
                 connector_metadata: None,
@@ -2825,33 +2826,42 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
                 connector_payment_id,
                 amount_capturable,
                 updated_by,
-            } => Self {
-                status: Some(status),
-                payment_method_id: None,
-                error_message: Some(error.message),
-                error_code: Some(error.code),
-                modified_at: common_utils::date_time::now(),
-                browser_info: None,
-                error_reason: error.reason,
-                updated_by,
-                merchant_connector_id: None,
-                unified_code: None,
-                unified_message: None,
-                connector_payment_id,
-                connector: None,
-                redirection_data: None,
-                connector_metadata: None,
-                amount_capturable,
-                amount_to_capture: None,
-                connector_token_details: None,
-                authentication_type: None,
-                feature_metadata: None,
-                network_advice_code: error.network_advice_code,
-                network_decline_code: error.network_decline_code,
-                network_error_message: error.network_error_message,
-                connector_request_reference_id: None,
-                connector_response_reference_id: None,
-            },
+            } => {
+                // Apply automatic hashing for long connector payment IDs
+                let (connector_payment_id, connector_payment_data) = connector_payment_id
+                    .map(ConnectorTransactionId::form_id_and_data)
+                    .map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
+                    .unwrap_or((None, None));
+
+                Self {
+                    status: Some(status),
+                    payment_method_id: None,
+                    error_message: Some(error.message),
+                    error_code: Some(error.code),
+                    modified_at: common_utils::date_time::now(),
+                    browser_info: None,
+                    error_reason: error.reason,
+                    updated_by,
+                    merchant_connector_id: None,
+                    unified_code: None,
+                    unified_message: None,
+                    connector_payment_id,
+                    connector_payment_data,
+                    connector: None,
+                    redirection_data: None,
+                    connector_metadata: None,
+                    amount_capturable,
+                    amount_to_capture: None,
+                    connector_token_details: None,
+                    authentication_type: None,
+                    feature_metadata: None,
+                    network_advice_code: error.network_advice_code,
+                    network_decline_code: error.network_decline_code,
+                    network_error_message: error.network_error_message,
+                    connector_request_reference_id: None,
+                    connector_response_reference_id: None,
+                }
+            }
             PaymentAttemptUpdate::ConfirmIntentResponse(confirm_intent_response_update) => {
                 let ConfirmIntentResponseUpdate {
                     status,
@@ -2863,6 +2873,12 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
                     connector_token_details,
                     connector_response_reference_id,
                 } = *confirm_intent_response_update;
+
+                // Apply automatic hashing for long connector payment IDs
+                let (connector_payment_id, connector_payment_data) = connector_payment_id
+                    .map(ConnectorTransactionId::form_id_and_data)
+                    .map(|(txn_id, txn_data)| (Some(txn_id), txn_data))
+                    .unwrap_or((None, None));
                 Self {
                     status: Some(status),
                     payment_method_id: None,
@@ -2877,6 +2893,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
                     unified_code: None,
                     unified_message: None,
                     connector_payment_id,
+                    connector_payment_data,
                     connector: None,
                     redirection_data: redirection_data
                         .map(diesel_models::payment_attempt::RedirectForm::from),
@@ -2910,6 +2927,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
                 unified_code: None,
                 unified_message: None,
                 connector_payment_id: None,
+                connector_payment_data: None,
                 connector: None,
                 redirection_data: None,
                 connector_metadata: None,
@@ -2942,6 +2960,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
                 unified_code: None,
                 unified_message: None,
                 connector_payment_id: None,
+                connector_payment_data: None,
                 connector: None,
                 redirection_data: None,
                 connector_metadata: None,
@@ -2970,6 +2989,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
                 unified_code: None,
                 unified_message: None,
                 connector_payment_id: None,
+                connector_payment_data: None,
                 connector: None,
                 redirection_data: None,
                 status: None,
@@ -3004,6 +3024,7 @@ impl From<PaymentAttemptUpdate> for diesel_models::PaymentAttemptUpdateInternal
                 unified_code: None,
                 unified_message: None,
                 connector_payment_id: None,
+                connector_payment_data: None,
                 connector: Some(connector),
                 redirection_data: None,
                 connector_metadata: None,