Bug: [BUG] amount_captured population logic in Cryptopay connector



### Bug Description

`amount_captured` is being set from the `price_amount` field for all payment statuses, including incomplete payments like `requires_customer_action`.

Cryptopay allows customers to overpay, but the integrity check was throwing errors when `captured_amount > total_capturable_amount` and `is_overcapture_enabled` was false



### Expected Behavior

amount_captured should be populated for succeded payments.
should not throw errors for overpaid payments

### Actual Behavior

`amount_captured` is being set from the `price_amount` field for all payment statuses, including incomplete payments like `requires_customer_action`.

overpaid payments response handling throwing integrity check error

### Steps To Reproduce

make a overpaid payment & do a psync.


### Context For The Bug

_No response_

### Environment

rustc 1.90.0
macos 15.6.1

### 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/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs b/crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs
index a9bc6f27f97..27ccbbf75b6 100644
--- a/crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs
@@ -201,8 +201,8 @@ impl<F, T>
                 charges: None,
             })
         };
-        match amount_captured_in_minor_units {
-            Some(minor_amount) => {
+        match (amount_captured_in_minor_units, status) {
+            (Some(minor_amount), enums::AttemptStatus::Charged) => {
                 let amount_captured = Some(minor_amount.get_amount_as_i64());
                 Ok(Self {
                     status,
@@ -212,7 +212,7 @@ impl<F, T>
                     ..item.data
                 })
             }
-            None => Ok(Self {
+            _ => Ok(Self {
                 status,
                 response,
                 ..item.data
diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs
index 8c33ce1044a..3a3a4b6fb78 100644
--- a/crates/router/src/connector/utils.rs
+++ b/crates/router/src/connector/utils.rs
@@ -180,31 +180,13 @@ where
                     payment_data,
                 );
                 let total_capturable_amount = payment_data.payment_attempt.get_total_amount();
-                let is_overcapture_enabled = *payment_data
-                    .payment_attempt
-                    .is_overcapture_enabled
-                    .as_deref()
-                    .unwrap_or(&false);
 
                 if Some(total_capturable_amount) == captured_amount.map(MinorUnit::new)
-                    || (is_overcapture_enabled
-                        && captured_amount.is_some_and(|captured_amount| {
-                            MinorUnit::new(captured_amount) > total_capturable_amount
-                        }))
+                    || (captured_amount.is_some_and(|captured_amount| {
+                        MinorUnit::new(captured_amount) > total_capturable_amount
+                    }))
                 {
                     Ok(enums::AttemptStatus::Charged)
-                } else if captured_amount.is_some_and(|captured_amount| {
-                    MinorUnit::new(captured_amount) > total_capturable_amount
-                }) {
-                    Err(ApiErrorResponse::IntegrityCheckFailed {
-                        reason: "captured_amount is greater than the total_capturable_amount"
-                            .to_string(),
-                        field_names: "captured_amount".to_string(),
-                        connector_transaction_id: payment_data
-                            .payment_attempt
-                            .connector_transaction_id
-                            .clone(),
-                    })?
                 } else if captured_amount.is_some_and(|captured_amount| {
                     MinorUnit::new(captured_amount) < total_capturable_amount
                 }) {
diff --git a/crates/router/src/types.rs b/crates/router/src/types.rs
index a2958d7508b..7320a2a4f03 100644
--- a/crates/router/src/types.rs
+++ b/crates/router/src/types.rs
@@ -581,7 +581,7 @@ impl Capturable for PaymentsSyncData {
     #[cfg(feature = "v1")]
     fn get_captured_amount<F>(
         &self,
-        _amount_captured: Option<i64>,
+        amount_captured: Option<i64>,
         payment_data: &PaymentData<F>,
     ) -> Option<i64>
     where
@@ -591,6 +591,7 @@ impl Capturable for PaymentsSyncData {
             .payment_attempt
             .amount_to_capture
             .or(payment_data.payment_intent.amount_captured)
+            .or(amount_captured.map(MinorUnit::new))
             .or_else(|| Some(payment_data.payment_attempt.get_total_amount()))
             .map(|amt| amt.get_amount_as_i64())
     }

## 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 -->
- Modified response handling logic to only populate `amount_captured` in router_data when payment status is `Charged`.
- Removed the integrity check error that was preventing overpaid payments from being processed correctly.
- The `PaymentsSyncData::get_captured_amount` method was ignoring the `amount_captured` parameter  and only consulting stored payment data and getting total_amount. To fix this added `.or(amount_captured.map(MinorUnit::new))` to the chain in `PaymentsSyncData::get_captured_amount`, ensuring the method prioritizes amount_captured from router_data similar to PaymentsAuthorizeData before consulting payment_data for total_amount.

### 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
- Previously, `amount_captured` was being set from the `price_amount` field for all payment statuses, including incomplete payments like `requires_customer_action`
- Cryptopay allows customers to overpay, but the integrity check was throwing errors when `captured_amount > total_capturable_amount` and `is_overcapture_enabled` was false

 


<!--
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).
-->


## 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)?
-->
<details>
<summary>Create Payment</summary>

```json
{
    "amount": 15,
    "currency": "USD",
    "confirm": true,
    "email": "guest@example.com",
    "return_url": "https://google.com",
    "payment_method": "crypto",
    "payment_method_type": "crypto_currency",
    "payment_experience": "redirect_to_url",
    "capture_method": "automatic",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC"
        }
    }
}
```

Response

```json
{
    "payment_id": "pay_nmtnfFNgKIwgtmwwwfeZ",
    "merchant_id": "merchant_1759732916",
    "status": "requires_customer_action",
    "amount": 15,
    "net_amount": 15,
    "shipping_cost": null,
    "amount_capturable": 15,
    "amount_received": null,
    "connector": "cryptopay",
    "client_secret": "pay_nmtnfFNgKIwgtmwwwfeZ_secret_6Ga6ekLlDTUcJVKLE9xd",
    "created": "2025-10-06T06:46:16.209Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "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": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC",
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_nmtnfFNgKIwgtmwwwfeZ/merchant_1759732916/pay_nmtnfFNgKIwgtmwwwfeZ_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "782f2938-c41d-4be2-b93e-c22709654054",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_nmtnfFNgKIwgtmwwwfeZ_1",
    "payment_link": null,
    "profile_id": "pro_idiFBCtfW7ACI2qZSLdk",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_LB9MXkHZW8HRFzhiyJvY",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-10-06T07:01:16.209Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-10-06T06:46:16.598Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}
```
</details>

<details>
<summary>Underpaid Payment Sync</summary>

Response

```json
{
    "payment_id": "pay_AQ3kBO4NEV65g4nzsI5H",
    "merchant_id": "merchant_1759732916",
    "status": "partially_captured",
    "amount": 15,
    "net_amount": 15,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 12,
    "connector": "cryptopay",
    "client_secret": "pay_AQ3kBO4NEV65g4nzsI5H_secret_ogakUxfaNRXMgwTm2Cx2",
    "created": "2025-10-06T10:31:46.564Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_AQ3kBO4NEV65g4nzsI5H_1",
            "status": "partial_charged",
            "amount": 15,
            "order_tax_amount": null,
            "currency": "USD",
            "connector": "cryptopay",
            "error_message": null,
            "payment_method": "crypto",
            "connector_transaction_id": "8157c59c-7ef1-4520-adc0-ff505d67c4c2",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-10-06T10:31:46.567Z",
            "modified_at": "2025-10-06T10:41:51.594Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": "redirect_to_url",
            "payment_method_type": "crypto_currency",
            "reference_id": "pay_AQ3kBO4NEV65g4nzsI5H_1",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC",
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "8157c59c-7ef1-4520-adc0-ff505d67c4c2",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_AQ3kBO4NEV65g4nzsI5H_1",
    "payment_link": null,
    "profile_id": "pro_idiFBCtfW7ACI2qZSLdk",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_LB9MXkHZW8HRFzhiyJvY",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-10-06T10:46:46.564Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-10-06T10:41:51.594Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}
```
</details>

<details>
<summary>Overpaid Payment sync</summary>

Response

```json
{
    "payment_id": "pay_GDtiguqwSEiybP9S2Pgc",
    "merchant_id": "merchant_1759732916",
    "status": "succeeded",
    "amount": 15,
    "net_amount": 15,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 17,
    "connector": "cryptopay",
    "client_secret": "pay_GDtiguqwSEiybP9S2Pgc_secret_yVeHrITuZPa434ZYDMN4",
    "created": "2025-10-06T06:42:08.937Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_GDtiguqwSEiybP9S2Pgc_1",
            "status": "charged",
            "amount": 15,
            "order_tax_amount": null,
            "currency": "USD",
            "connector": "cryptopay",
            "error_message": null,
            "payment_method": "crypto",
            "connector_transaction_id": "98c30587-0544-4c2f-949e-923965773a87",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-10-06T06:42:08.940Z",
            "modified_at": "2025-10-06T06:45:42.581Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": "redirect_to_url",
            "payment_method_type": "crypto_currency",
            "reference_id": "pay_GDtiguqwSEiybP9S2Pgc_1",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC",
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "98c30587-0544-4c2f-949e-923965773a87",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_GDtiguqwSEiybP9S2Pgc_1",
    "payment_link": null,
    "profile_id": "pro_idiFBCtfW7ACI2qZSLdk",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_LB9MXkHZW8HRFzhiyJvY",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-10-06T06:57:08.936Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-10-06T06:45:42.581Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}
```
</details>

<details>
<summary>Exact amount paid Payment Sync</summary>

Response

```json
{
    "payment_id": "pay_0yVxECTGSurN7u9hMe1j",
    "merchant_id": "merchant_1759732916",
    "status": "succeeded",
    "amount": 15,
    "net_amount": 15,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 15,
    "connector": "cryptopay",
    "client_secret": "pay_0yVxECTGSurN7u9hMe1j_secret_i3GfK1Km0iitrQx66IgF",
    "created": "2025-10-10T07:49:43.268Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_0yVxECTGSurN7u9hMe1j_1",
            "status": "charged",
            "amount": 15,
            "order_tax_amount": null,
            "currency": "USD",
            "connector": "cryptopay",
            "error_message": null,
            "payment_method": "crypto",
            "connector_transaction_id": "af24ef5c-f51c-43de-9c73-732ac3c4857d",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-10-10T07:49:43.275Z",
            "modified_at": "2025-10-10T07:55:00.411Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": "redirect_to_url",
            "payment_method_type": "crypto_currency",
            "reference_id": "pay_0yVxECTGSurN7u9hMe1j_1",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC",
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "af24ef5c-f51c-43de-9c73-732ac3c4857d",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_0yVxECTGSurN7u9hMe1j_1",
    "payment_link": null,
    "profile_id": "pro_idiFBCtfW7ACI2qZSLdk",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_LB9MXkHZW8HRFzhiyJvY",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-10-10T08:04:43.267Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-10-10T07:55:00.412Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}
```
</details>

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


<details>
<summary>Create Payment</summary>

```json
{
    "amount": 15,
    "currency": "USD",
    "confirm": true,
    "email": "guest@example.com",
    "return_url": "https://google.com",
    "payment_method": "crypto",
    "payment_method_type": "crypto_currency",
    "payment_experience": "redirect_to_url",
    "capture_method": "automatic",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC"
        }
    }
}
```

Response

```json
{
    "payment_id": "pay_nmtnfFNgKIwgtmwwwfeZ",
    "merchant_id": "merchant_1759732916",
    "status": "requires_customer_action",
    "amount": 15,
    "net_amount": 15,
    "shipping_cost": null,
    "amount_capturable": 15,
    "amount_received": null,
    "connector": "cryptopay",
    "client_secret": "pay_nmtnfFNgKIwgtmwwwfeZ_secret_6Ga6ekLlDTUcJVKLE9xd",
    "created": "2025-10-06T06:46:16.209Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "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": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC",
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_nmtnfFNgKIwgtmwwwfeZ/merchant_1759732916/pay_nmtnfFNgKIwgtmwwwfeZ_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "782f2938-c41d-4be2-b93e-c22709654054",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_nmtnfFNgKIwgtmwwwfeZ_1",
    "payment_link": null,
    "profile_id": "pro_idiFBCtfW7ACI2qZSLdk",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_LB9MXkHZW8HRFzhiyJvY",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-10-06T07:01:16.209Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-10-06T06:46:16.598Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}
```
</details>

<details>
<summary>Underpaid Payment Sync</summary>

Response

```json
{
    "payment_id": "pay_AQ3kBO4NEV65g4nzsI5H",
    "merchant_id": "merchant_1759732916",
    "status": "partially_captured",
    "amount": 15,
    "net_amount": 15,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 12,
    "connector": "cryptopay",
    "client_secret": "pay_AQ3kBO4NEV65g4nzsI5H_secret_ogakUxfaNRXMgwTm2Cx2",
    "created": "2025-10-06T10:31:46.564Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_AQ3kBO4NEV65g4nzsI5H_1",
            "status": "partial_charged",
            "amount": 15,
            "order_tax_amount": null,
            "currency": "USD",
            "connector": "cryptopay",
            "error_message": null,
            "payment_method": "crypto",
            "connector_transaction_id": "8157c59c-7ef1-4520-adc0-ff505d67c4c2",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-10-06T10:31:46.567Z",
            "modified_at": "2025-10-06T10:41:51.594Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": "redirect_to_url",
            "payment_method_type": "crypto_currency",
            "reference_id": "pay_AQ3kBO4NEV65g4nzsI5H_1",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC",
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "8157c59c-7ef1-4520-adc0-ff505d67c4c2",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_AQ3kBO4NEV65g4nzsI5H_1",
    "payment_link": null,
    "profile_id": "pro_idiFBCtfW7ACI2qZSLdk",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_LB9MXkHZW8HRFzhiyJvY",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-10-06T10:46:46.564Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-10-06T10:41:51.594Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}
```
</details>

<details>
<summary>Overpaid Payment sync</summary>

Response

```json
{
    "payment_id": "pay_GDtiguqwSEiybP9S2Pgc",
    "merchant_id": "merchant_1759732916",
    "status": "succeeded",
    "amount": 15,
    "net_amount": 15,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 17,
    "connector": "cryptopay",
    "client_secret": "pay_GDtiguqwSEiybP9S2Pgc_secret_yVeHrITuZPa434ZYDMN4",
    "created": "2025-10-06T06:42:08.937Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_GDtiguqwSEiybP9S2Pgc_1",
            "status": "charged",
            "amount": 15,
            "order_tax_amount": null,
            "currency": "USD",
            "connector": "cryptopay",
            "error_message": null,
            "payment_method": "crypto",
            "connector_transaction_id": "98c30587-0544-4c2f-949e-923965773a87",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-10-06T06:42:08.940Z",
            "modified_at": "2025-10-06T06:45:42.581Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": "redirect_to_url",
            "payment_method_type": "crypto_currency",
            "reference_id": "pay_GDtiguqwSEiybP9S2Pgc_1",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC",
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "98c30587-0544-4c2f-949e-923965773a87",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_GDtiguqwSEiybP9S2Pgc_1",
    "payment_link": null,
    "profile_id": "pro_idiFBCtfW7ACI2qZSLdk",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_LB9MXkHZW8HRFzhiyJvY",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-10-06T06:57:08.936Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-10-06T06:45:42.581Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}
```
</details>

<details>
<summary>Exact amount paid Payment Sync</summary>

Response

```json
{
    "payment_id": "pay_0yVxECTGSurN7u9hMe1j",
    "merchant_id": "merchant_1759732916",
    "status": "succeeded",
    "amount": 15,
    "net_amount": 15,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 15,
    "connector": "cryptopay",
    "client_secret": "pay_0yVxECTGSurN7u9hMe1j_secret_i3GfK1Km0iitrQx66IgF",
    "created": "2025-10-10T07:49:43.268Z",
    "currency": "USD",
    "customer_id": null,
    "customer": {
        "id": null,
        "name": null,
        "email": "guest@example.com",
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "attempts": [
        {
            "attempt_id": "pay_0yVxECTGSurN7u9hMe1j_1",
            "status": "charged",
            "amount": 15,
            "order_tax_amount": null,
            "currency": "USD",
            "connector": "cryptopay",
            "error_message": null,
            "payment_method": "crypto",
            "connector_transaction_id": "af24ef5c-f51c-43de-9c73-732ac3c4857d",
            "capture_method": "automatic",
            "authentication_type": "no_three_ds",
            "created_at": "2025-10-10T07:49:43.275Z",
            "modified_at": "2025-10-10T07:55:00.411Z",
            "cancellation_reason": null,
            "mandate_id": null,
            "error_code": null,
            "payment_token": null,
            "connector_metadata": null,
            "payment_experience": "redirect_to_url",
            "payment_method_type": "crypto_currency",
            "reference_id": "pay_0yVxECTGSurN7u9hMe1j_1",
            "unified_code": null,
            "unified_message": null,
            "client_source": null,
            "client_version": null
        }
    ],
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "crypto",
    "payment_method_data": {
        "crypto": {
            "pay_currency": "LTC",
            "network": null
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": "redirect_to_url",
    "payment_method_type": "crypto_currency",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": null,
    "connector_transaction_id": "af24ef5c-f51c-43de-9c73-732ac3c4857d",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": null,
        "gateway_system": "direct"
    },
    "reference_id": "pay_0yVxECTGSurN7u9hMe1j_1",
    "payment_link": null,
    "profile_id": "pro_idiFBCtfW7ACI2qZSLdk",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_LB9MXkHZW8HRFzhiyJvY",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-10-10T08:04:43.267Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_channel": null,
    "payment_method_id": null,
    "network_transaction_id": null,
    "payment_method_status": null,
    "updated": "2025-10-10T07:55:00.412Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "request_extended_authorization": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null,
    "force_3ds_challenge": false,
    "force_3ds_challenge_trigger": false,
    "issuer_error_code": null,
    "issuer_error_message": null,
    "is_iframe_redirection_enabled": null,
    "whole_connector_response": null,
    "enable_partial_authorization": null,
    "enable_overcapture": null,
    "is_overcapture_enabled": null,
    "network_details": null,
    "is_stored_credential": null,
    "mit_category": null
}
```
</details>
