Bug: [BUG] [DATATRANS] Add new payment status



### Bug Description

For connector Datatrans new payment status need to be added: ChallengeOngoing and ChallengeRequired

### Expected Behavior

ChallengeOngoing and ChallengeRequired status should be handled

### Actual Behavior

ChallengeOngoing and ChallengeRequired not being handled

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

For connector Datatrans new payment status need to be added: ChallengeOngoing and ChallengeRequired

### 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/hyperswitch_connectors/src/connectors/datatrans/transformers.rs b/crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs
index 68daa3743bf..9297f783d3e 100644
--- a/crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/datatrans/transformers.rs
@@ -129,7 +129,7 @@ pub struct SyncResponse {
 #[derive(Serialize, Deserialize, Clone, Debug)]
 #[serde(rename_all = "camelCase")]
 pub struct SyncCardDetails {
-    pub alias: String,
+    pub alias: Option<String>,
 }
 
 #[derive(Serialize, Deserialize, Clone, Debug)]
@@ -787,9 +787,12 @@ impl TryFrom<PaymentsSyncResponseRouterData<DatatransSyncResponse>>
                         connector_transaction_id: None,
                     })
                 } else {
-                    let mandate_reference =
-                        sync_response.card.as_ref().map(|card| MandateReference {
-                            connector_mandate_id: Some(card.alias.clone()),
+                    let mandate_reference = sync_response
+                        .card
+                        .as_ref()
+                        .and_then(|card| card.alias.as_ref())
+                        .map(|alias| MandateReference {
+                            connector_mandate_id: Some(alias.clone()),
                             payment_method_id: None,
                             mandate_metadata: None,
                             connector_mandate_request_reference_id: None,

## 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 -->
For connector Datatrans add new payment status: ChallengeOngoing and ChallengeRequired
Fix Deseralization Issue on Force Sync Flow

### Additional Changes

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

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

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


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

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

## 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)?
-->
Payments Create:
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_pzCQPy1Bguc8j2kV8DQeqQJHIqJQJCjF5kLyDVep1qhmsjAPfl6GUbb10RId0cr8' \
--data-raw '{
    "amount": 1000,
    "currency": "GBP",
    "amount_to_capture": 1000,
    "confirm": true,
    "capture_method": "manual",
    "authentication_type": "no_three_ds",
    "payment_method": "card",
    "payment_method_type": "credit",
    "email": "guest@example.com",
    "payment_method_data": {
        "card": {
            "card_number": "5404000000000001",
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        },
        "billing": {
            "email": "guest@example.com"
        }
    }
}'
```

Response:
```
{
    "payment_id": "pay_o5DC6PfvFD102tR0jAkC",
    "merchant_id": "merchant_1740052235",
    "status": "requires_capture",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 1000,
    "amount_received": null,
    "connector": "datatrans",
    "client_secret": "pay_o5DC6PfvFD102tR0jAkC_secret_aIwxbFdYcRA5QEzSwRH0",
    "created": "2025-02-20T12:54:31.835Z",
    "currency": "GBP",
    "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": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0001",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "540400",
            "card_extended_bin": null,
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": null,
            "phone": null,
            "email": "guest@example.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "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": null,
    "payment_method_type": "credit",
    "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": "250220135432771618",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_u7haQkBn6S4w6TXz8EJH",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_2NXjPxtjXhySNn9Ui8bD",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-20T13:09:31.834Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-20T12:54:33.029Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual"
}
```

Payments Intent:
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_pzCQPy1Bguc8j2kV8DQeqQJHIqJQJCjF5kLyDVep1qhmsjAPfl6GUbb10RId0cr8' \
--data '{
    "amount": 0,
    "currency": "GBP",
    "confirm": false,
    "setup_future_usage": "off_session",
    "customer_id": "tester1799"
}'
```
Response:
```
{
    "payment_id": "pay_mLh13MuvuHd60YDrzoRJ",
    "merchant_id": "merchant_1740052235",
    "status": "requires_payment_method",
    "amount": 0,
    "net_amount": 0,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_mLh13MuvuHd60YDrzoRJ_secret_vG7S4ysL0mc0jQunux4v",
    "created": "2025-02-20T12:55:01.990Z",
    "currency": "GBP",
    "customer_id": "tester1799",
    "customer": {
        "id": "tester1799",
        "name": null,
        "email": null,
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": null,
    "payment_method": null,
    "payment_method_data": null,
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": null,
    "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": null,
    "payment_method_type": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "tester1799",
        "created_at": 1740056101,
        "expires": 1740059701,
        "secret": "epk_5f5f55938a5e4d4aa926cf0ebdfaac0a"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_u7haQkBn6S4w6TXz8EJH",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-20T13:10:01.990Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-20T12:55:02.018Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null
}
```

Payments Confirm(Creating Mandate):
Request:
```
curl --location 'http://localhost:8080/payments/pay_FW8L70XM5ECVgz0V0M4U/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_pzCQPy1Bguc8j2kV8DQeqQJHIqJQJCjF5kLyDVep1qhmsjAPfl6GUbb10RId0cr8' \
--data-raw '{
    "payment_method": "card",
    "payment_method_type": "credit",
    "customer_acceptance": {
        "acceptance_type": "offline"
    },
    "capture_method": "automatic",
    "authentication_type": "no_three_ds",
    "payment_method_data": {
        "card": {
            "card_number": "5404000000000001",
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        },
        "billing": {
            "email": "guest2@example.com"
        }
    }
}'
```

Response:
```
{
    "payment_id": "pay_mLh13MuvuHd60YDrzoRJ",
    "merchant_id": "merchant_1740052235",
    "status": "requires_customer_action",
    "amount": 0,
    "net_amount": 0,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "datatrans",
    "client_secret": "pay_mLh13MuvuHd60YDrzoRJ_secret_vG7S4ysL0mc0jQunux4v",
    "created": "2025-02-20T12:55:01.990Z",
    "currency": "GBP",
    "customer_id": "tester1799",
    "customer": {
        "id": "tester1799",
        "name": null,
        "email": null,
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0001",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "540400",
            "card_extended_bin": null,
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": null,
            "phone": null,
            "email": "guest2@example.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "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_mLh13MuvuHd60YDrzoRJ/merchant_1740052235/pay_mLh13MuvuHd60YDrzoRJ_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "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": "250220135517601774",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_u7haQkBn6S4w6TXz8EJH",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_2NXjPxtjXhySNn9Ui8bD",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-20T13:10:01.990Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": null,
        "language": null,
        "time_zone": null,
        "ip_address": "::1",
        "os_version": null,
        "user_agent": null,
        "color_depth": null,
        "device_model": null,
        "java_enabled": null,
        "screen_width": null,
        "accept_header": null,
        "screen_height": null,
        "accept_language": "en",
        "java_script_enabled": null
    },
    "payment_method_id": "pm_wnpldY3cjI1hNd9eCdvV",
    "payment_method_status": "inactive",
    "updated": "2025-02-20T12:55:17.804Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual"
}
```
Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_GSXcUmpO1O7kDsua577iUQXDZWOCT4dIMglCcbXzVpPrvujyDkm59ourkW6oOXbS' \
--data-raw '{
    "amount": 1000,
    "currency": "GBP",
    "amount_to_capture": 1000,
    "confirm": true,
    "capture_method": "manual",
    "customer_id":"blajsh",
    "authentication_type": "no_three_ds",
    "setup_future_usage":"on_session",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "127.0.0.1",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method": "card",
    "payment_method_type": "credit",
    "email": "guest@example.com",
    "payment_method_data": {
        "card": {
            "card_number": "5404000000000001",
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        },
        "billing":{
            "email":"guest@example.com"
        }
    }
}'
```
Response
```
{
    "payment_id": "pay_guOgcn7GmWiPeGXkZucP",
    "merchant_id": "postman_merchant_GHAction_ab9fae91-aff0-4a08-baae-194e61092bf6",
    "status": "requires_capture",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 1000,
    "amount_received": null,
    "connector": "datatrans",
    "client_secret": "pay_guOgcn7GmWiPeGXkZucP_secret_PUdAYdnPcNUscVt1NYqt",
    "created": "2025-02-20T15:12:52.832Z",
    "currency": "GBP",
    "customer_id": "blajsh",
    "customer": {
        "id": "blajsh",
        "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": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0001",
            "card_type": "DEBIT",
            "card_network": "Visa",
            "card_issuer": "MASTERCARD INTERNATIONAL",
            "card_issuing_country": "UNITEDSTATES",
            "card_isin": "540400",
            "card_extended_bin": null,
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": null,
            "phone": null,
            "email": "guest@example.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "guest@example.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": null,
    "payment_method_type": "debit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "blajsh",
        "created_at": 1740064372,
        "expires": 1740067972,
        "secret": "epk_dd3a6c0d4ead4f78bdec9a0b2b9ec12e"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "250220161253992987",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_HKMwd5SucLDtv5qWMf47",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_EZEmKXkvmX9nowH9gsty",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-20T15:27:52.832Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-20T15:12:54.206Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual"
}
```
Force Sync (Request)
```
curl --location 'http://localhost:8080/payments/pay_guOgcn7GmWiPeGXkZucP?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_GSXcUmpO1O7kDsua577iUQXDZWOCT4dIMglCcbXzVpPrvujyDkm59ourkW6oOXbS' \
--data ''
```
Force Sync Response
```
{
    "payment_id": "pay_guOgcn7GmWiPeGXkZucP",
    "merchant_id": "postman_merchant_GHAction_ab9fae91-aff0-4a08-baae-194e61092bf6",
    "status": "requires_capture",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 1000,
    "amount_received": null,
    "connector": "datatrans",
    "client_secret": "pay_guOgcn7GmWiPeGXkZucP_secret_PUdAYdnPcNUscVt1NYqt",
    "created": "2025-02-20T15:12:52.832Z",
    "currency": "GBP",
    "customer_id": "blajsh",
    "customer": {
        "id": "blajsh",
        "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": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0001",
            "card_type": "DEBIT",
            "card_network": "Visa",
            "card_issuer": "MASTERCARD INTERNATIONAL",
            "card_issuing_country": "UNITEDSTATES",
            "card_isin": "540400",
            "card_extended_bin": null,
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": null,
            "phone": null,
            "email": "guest@example.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "guest@example.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": null,
    "payment_method_type": "debit",
    "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": "250220161253992987",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_HKMwd5SucLDtv5qWMf47",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_EZEmKXkvmX9nowH9gsty",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-20T15:27:52.832Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_T4qWIKfShRUpJp0J6n3o",
    "payment_method_status": "active",
    "updated": "2025-02-20T15:14:43.581Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual"
}
```
Note: Non-3DS transaction will redirect if we pass off_session https://docs.datatrans.ch/docs/tokenization

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


Payments Create:
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_pzCQPy1Bguc8j2kV8DQeqQJHIqJQJCjF5kLyDVep1qhmsjAPfl6GUbb10RId0cr8' \
--data-raw '{
    "amount": 1000,
    "currency": "GBP",
    "amount_to_capture": 1000,
    "confirm": true,
    "capture_method": "manual",
    "authentication_type": "no_three_ds",
    "payment_method": "card",
    "payment_method_type": "credit",
    "email": "guest@example.com",
    "payment_method_data": {
        "card": {
            "card_number": "5404000000000001",
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        },
        "billing": {
            "email": "guest@example.com"
        }
    }
}'
```

Response:
```
{
    "payment_id": "pay_o5DC6PfvFD102tR0jAkC",
    "merchant_id": "merchant_1740052235",
    "status": "requires_capture",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 1000,
    "amount_received": null,
    "connector": "datatrans",
    "client_secret": "pay_o5DC6PfvFD102tR0jAkC_secret_aIwxbFdYcRA5QEzSwRH0",
    "created": "2025-02-20T12:54:31.835Z",
    "currency": "GBP",
    "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": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0001",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "540400",
            "card_extended_bin": null,
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": null,
            "phone": null,
            "email": "guest@example.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "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": null,
    "payment_method_type": "credit",
    "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": "250220135432771618",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_u7haQkBn6S4w6TXz8EJH",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_2NXjPxtjXhySNn9Ui8bD",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-20T13:09:31.834Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-20T12:54:33.029Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual"
}
```

Payments Intent:
Request:
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_pzCQPy1Bguc8j2kV8DQeqQJHIqJQJCjF5kLyDVep1qhmsjAPfl6GUbb10RId0cr8' \
--data '{
    "amount": 0,
    "currency": "GBP",
    "confirm": false,
    "setup_future_usage": "off_session",
    "customer_id": "tester1799"
}'
```
Response:
```
{
    "payment_id": "pay_mLh13MuvuHd60YDrzoRJ",
    "merchant_id": "merchant_1740052235",
    "status": "requires_payment_method",
    "amount": 0,
    "net_amount": 0,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_mLh13MuvuHd60YDrzoRJ_secret_vG7S4ysL0mc0jQunux4v",
    "created": "2025-02-20T12:55:01.990Z",
    "currency": "GBP",
    "customer_id": "tester1799",
    "customer": {
        "id": "tester1799",
        "name": null,
        "email": null,
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": null,
    "payment_method": null,
    "payment_method_data": null,
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": null,
    "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": null,
    "payment_method_type": null,
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "tester1799",
        "created_at": 1740056101,
        "expires": 1740059701,
        "secret": "epk_5f5f55938a5e4d4aa926cf0ebdfaac0a"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_u7haQkBn6S4w6TXz8EJH",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": null,
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-20T13:10:01.990Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-20T12:55:02.018Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": null
}
```

Payments Confirm(Creating Mandate):
Request:
```
curl --location 'http://localhost:8080/payments/pay_FW8L70XM5ECVgz0V0M4U/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_pzCQPy1Bguc8j2kV8DQeqQJHIqJQJCjF5kLyDVep1qhmsjAPfl6GUbb10RId0cr8' \
--data-raw '{
    "payment_method": "card",
    "payment_method_type": "credit",
    "customer_acceptance": {
        "acceptance_type": "offline"
    },
    "capture_method": "automatic",
    "authentication_type": "no_three_ds",
    "payment_method_data": {
        "card": {
            "card_number": "5404000000000001",
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        },
        "billing": {
            "email": "guest2@example.com"
        }
    }
}'
```

Response:
```
{
    "payment_id": "pay_mLh13MuvuHd60YDrzoRJ",
    "merchant_id": "merchant_1740052235",
    "status": "requires_customer_action",
    "amount": 0,
    "net_amount": 0,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "datatrans",
    "client_secret": "pay_mLh13MuvuHd60YDrzoRJ_secret_vG7S4ysL0mc0jQunux4v",
    "created": "2025-02-20T12:55:01.990Z",
    "currency": "GBP",
    "customer_id": "tester1799",
    "customer": {
        "id": "tester1799",
        "name": null,
        "email": null,
        "phone": null,
        "phone_country_code": null
    },
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0001",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "540400",
            "card_extended_bin": null,
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": null,
            "phone": null,
            "email": "guest2@example.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": null,
    "name": null,
    "phone": null,
    "return_url": null,
    "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_mLh13MuvuHd60YDrzoRJ/merchant_1740052235/pay_mLh13MuvuHd60YDrzoRJ_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "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": "250220135517601774",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_u7haQkBn6S4w6TXz8EJH",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_2NXjPxtjXhySNn9Ui8bD",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-20T13:10:01.990Z",
    "fingerprint": null,
    "browser_info": {
        "os_type": null,
        "language": null,
        "time_zone": null,
        "ip_address": "::1",
        "os_version": null,
        "user_agent": null,
        "color_depth": null,
        "device_model": null,
        "java_enabled": null,
        "screen_width": null,
        "accept_header": null,
        "screen_height": null,
        "accept_language": "en",
        "java_script_enabled": null
    },
    "payment_method_id": "pm_wnpldY3cjI1hNd9eCdvV",
    "payment_method_status": "inactive",
    "updated": "2025-02-20T12:55:17.804Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual"
}
```
Request
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_GSXcUmpO1O7kDsua577iUQXDZWOCT4dIMglCcbXzVpPrvujyDkm59ourkW6oOXbS' \
--data-raw '{
    "amount": 1000,
    "currency": "GBP",
    "amount_to_capture": 1000,
    "confirm": true,
    "capture_method": "manual",
    "customer_id":"blajsh",
    "authentication_type": "no_three_ds",
    "setup_future_usage":"on_session",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "127.0.0.1",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method": "card",
    "payment_method_type": "credit",
    "email": "guest@example.com",
    "payment_method_data": {
        "card": {
            "card_number": "5404000000000001",
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        },
        "billing":{
            "email":"guest@example.com"
        }
    }
}'
```
Response
```
{
    "payment_id": "pay_guOgcn7GmWiPeGXkZucP",
    "merchant_id": "postman_merchant_GHAction_ab9fae91-aff0-4a08-baae-194e61092bf6",
    "status": "requires_capture",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 1000,
    "amount_received": null,
    "connector": "datatrans",
    "client_secret": "pay_guOgcn7GmWiPeGXkZucP_secret_PUdAYdnPcNUscVt1NYqt",
    "created": "2025-02-20T15:12:52.832Z",
    "currency": "GBP",
    "customer_id": "blajsh",
    "customer": {
        "id": "blajsh",
        "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": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0001",
            "card_type": "DEBIT",
            "card_network": "Visa",
            "card_issuer": "MASTERCARD INTERNATIONAL",
            "card_issuing_country": "UNITEDSTATES",
            "card_isin": "540400",
            "card_extended_bin": null,
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": null,
            "phone": null,
            "email": "guest@example.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "guest@example.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": null,
    "payment_method_type": "debit",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "blajsh",
        "created_at": 1740064372,
        "expires": 1740067972,
        "secret": "epk_dd3a6c0d4ead4f78bdec9a0b2b9ec12e"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "250220161253992987",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_HKMwd5SucLDtv5qWMf47",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_EZEmKXkvmX9nowH9gsty",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-20T15:27:52.832Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-20T15:12:54.206Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual"
}
```
Force Sync (Request)
```
curl --location 'http://localhost:8080/payments/pay_guOgcn7GmWiPeGXkZucP?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_GSXcUmpO1O7kDsua577iUQXDZWOCT4dIMglCcbXzVpPrvujyDkm59ourkW6oOXbS' \
--data ''
```
Force Sync Response
```
{
    "payment_id": "pay_guOgcn7GmWiPeGXkZucP",
    "merchant_id": "postman_merchant_GHAction_ab9fae91-aff0-4a08-baae-194e61092bf6",
    "status": "requires_capture",
    "amount": 1000,
    "net_amount": 1000,
    "shipping_cost": null,
    "amount_capturable": 1000,
    "amount_received": null,
    "connector": "datatrans",
    "client_secret": "pay_guOgcn7GmWiPeGXkZucP_secret_PUdAYdnPcNUscVt1NYqt",
    "created": "2025-02-20T15:12:52.832Z",
    "currency": "GBP",
    "customer_id": "blajsh",
    "customer": {
        "id": "blajsh",
        "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": "on_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "manual",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "0001",
            "card_type": "DEBIT",
            "card_network": "Visa",
            "card_issuer": "MASTERCARD INTERNATIONAL",
            "card_issuing_country": "UNITEDSTATES",
            "card_isin": "540400",
            "card_extended_bin": null,
            "card_exp_month": "06",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": {
            "address": null,
            "phone": null,
            "email": "guest@example.com"
        }
    },
    "payment_token": null,
    "shipping": null,
    "billing": null,
    "order_details": null,
    "email": "guest@example.com",
    "name": null,
    "phone": null,
    "return_url": null,
    "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": null,
    "payment_method_type": "debit",
    "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": "250220161253992987",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_HKMwd5SucLDtv5qWMf47",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_EZEmKXkvmX9nowH9gsty",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-20T15:27:52.832Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_T4qWIKfShRUpJp0J6n3o",
    "payment_method_status": "active",
    "updated": "2025-02-20T15:14:43.581Z",
    "split_payments": null,
    "frm_metadata": null,
    "extended_authorization_applied": null,
    "capture_before": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null,
    "card_discovery": "manual"
}
```
Note: Non-3DS transaction will redirect if we pass off_session https://docs.datatrans.ch/docs/tokenization
