Bug: add apple pay decrypt support for Adyen



add apple pay decrypt support for Adyen
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml
index cdf94d6e439..77fb8141c0f 100644
--- a/crates/connector_configs/toml/development.toml
+++ b/crates/connector_configs/toml/development.toml
@@ -286,7 +286,7 @@ label="Payment Processing Details At"
 placeholder="Enter Payment Processing Details At"
 required=true
 type="Radio"
-options=["Connector"]
+options=["Connector", "Hyperswitch"]
 
 [[adyen.metadata.google_pay]]
 name="merchant_name"
diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml
index b9a98f5aedd..cf9c19fcaba 100644
--- a/crates/connector_configs/toml/production.toml
+++ b/crates/connector_configs/toml/production.toml
@@ -192,7 +192,7 @@ label="Payment Processing Details At"
 placeholder="Enter Payment Processing Details At"
 required=true
 type="Radio"
-options=["Connector"]
+options=["Connector", "Hyperswitch"]
 
 [[adyen.metadata.google_pay]]
 name="merchant_name"
diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml
index 21801d380b5..28aca80b17b 100644
--- a/crates/connector_configs/toml/sandbox.toml
+++ b/crates/connector_configs/toml/sandbox.toml
@@ -284,7 +284,7 @@ label="Payment Processing Details At"
 placeholder="Enter Payment Processing Details At"
 required=true
 type="Radio"
-options=["Connector"]
+options=["Connector", "Hyperswitch"]
 
 [[adyen.metadata.google_pay]]
 name="merchant_name"
diff --git a/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs b/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs
index 8f4d667711b..f435338f22f 100644
--- a/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs
@@ -57,9 +57,10 @@ use crate::{
         SubmitEvidenceRouterData,
     },
     utils::{
-        self, is_manual_capture, missing_field_err, AddressDetailsData, BrowserInformationData,
-        CardData, ForeignTryFrom, NetworkTokenData as UtilsNetworkTokenData,
-        PaymentsAuthorizeRequestData, PhoneDetailsData, RouterData as OtherRouterData,
+        self, is_manual_capture, missing_field_err, AddressDetailsData, ApplePayDecrypt,
+        BrowserInformationData, CardData, ForeignTryFrom,
+        NetworkTokenData as UtilsNetworkTokenData, PaymentsAuthorizeRequestData, PhoneDetailsData,
+        RouterData as OtherRouterData,
     },
 };
 
@@ -309,7 +310,8 @@ struct AdyenSplitData {
 struct AdyenMpiData {
     directory_response: String,
     authentication_response: String,
-    token_authentication_verification_value: Secret<String>,
+    cavv: Option<Secret<String>>,
+    token_authentication_verification_value: Option<Secret<String>>,
     eci: Option<String>,
 }
 
@@ -675,6 +677,7 @@ pub enum AdyenPaymentMethod<'a> {
     #[serde(rename = "alipay_hk")]
     AliPayHk,
     ApplePay(Box<AdyenApplePay>),
+    ApplePayDecrypt(Box<AdyenApplePayDecryptData>),
     Atome,
     #[serde(rename = "scheme")]
     BancontactCard(Box<AdyenCard>),
@@ -1253,6 +1256,18 @@ pub struct AdyenPazeData {
     network_payment_reference: Option<Secret<String>>,
 }
 
+#[serde_with::skip_serializing_none]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct AdyenApplePayDecryptData {
+    number: Secret<String>,
+    expiry_month: Secret<String>,
+    expiry_year: Secret<String>,
+    brand: String,
+    #[serde(rename = "type")]
+    payment_type: PaymentType,
+}
+
 #[derive(Debug, Clone, Serialize, Deserialize)]
 #[serde(rename_all = "lowercase")]
 pub enum CardBrand {
@@ -2194,11 +2209,27 @@ impl TryFrom<(&WalletData, &PaymentsAuthorizeRouterData)> for AdyenPaymentMethod
                 Ok(AdyenPaymentMethod::Gpay(Box::new(gpay_data)))
             }
             WalletData::ApplePay(data) => {
-                let apple_pay_data = AdyenApplePay {
-                    apple_pay_token: Secret::new(data.payment_data.to_string()),
-                };
-
-                Ok(AdyenPaymentMethod::ApplePay(Box::new(apple_pay_data)))
+                if let Some(PaymentMethodToken::ApplePayDecrypt(apple_pay_decrypte)) =
+                    item.payment_method_token.clone()
+                {
+                    let expiry_year_4_digit = apple_pay_decrypte.get_four_digit_expiry_year()?;
+                    let exp_month = apple_pay_decrypte.get_expiry_month()?;
+                    let apple_pay_decrypted_data = AdyenApplePayDecryptData {
+                        number: apple_pay_decrypte.application_primary_account_number,
+                        expiry_month: exp_month,
+                        expiry_year: expiry_year_4_digit,
+                        brand: "applepay".to_string(),
+                        payment_type: PaymentType::Scheme,
+                    };
+                    Ok(AdyenPaymentMethod::ApplePayDecrypt(Box::new(
+                        apple_pay_decrypted_data,
+                    )))
+                } else {
+                    let apple_pay_data = AdyenApplePay {
+                        apple_pay_token: Secret::new(data.payment_data.to_string()),
+                    };
+                    Ok(AdyenPaymentMethod::ApplePay(Box::new(apple_pay_data)))
+                }
             }
             WalletData::PaypalRedirect(_) => Ok(AdyenPaymentMethod::AdyenPaypal),
             WalletData::AliPayRedirect(_) => Ok(AdyenPaymentMethod::AliPay),
@@ -3426,15 +3457,23 @@ impl TryFrom<(&AdyenRouterData<&PaymentsAuthorizeRouterData>, &WalletData)>
         let shopper_email = get_shopper_email(item.router_data, store_payment_method.is_some())?;
         let billing_address =
             get_address_info(item.router_data.get_optional_billing()).and_then(Result::ok);
-        let mpi_data = if let WalletData::Paze(_) = wallet_data {
+        let mpi_data = if matches!(wallet_data, WalletData::Paze(_) | WalletData::ApplePay(_)) {
             match item.router_data.payment_method_token.clone() {
-                Some(PaymentMethodToken::PazeDecrypt(paze_decrypted_data)) => Some(AdyenMpiData {
+                Some(PaymentMethodToken::PazeDecrypt(paze_data)) => Some(AdyenMpiData {
                     directory_response: "Y".to_string(),
                     authentication_response: "Y".to_string(),
-                    token_authentication_verification_value: paze_decrypted_data
-                        .token
-                        .payment_account_reference,
-                    eci: paze_decrypted_data.eci,
+                    cavv: None,
+                    token_authentication_verification_value: Some(
+                        paze_data.token.payment_account_reference,
+                    ),
+                    eci: paze_data.eci,
+                }),
+                Some(PaymentMethodToken::ApplePayDecrypt(apple_data)) => Some(AdyenMpiData {
+                    directory_response: "Y".to_string(),
+                    authentication_response: "Y".to_string(),
+                    cavv: Some(apple_data.payment_data.online_payment_cryptogram),
+                    token_authentication_verification_value: None,
+                    eci: apple_data.payment_data.eci_indicator,
                 }),
                 _ => None,
             }
@@ -5852,10 +5891,10 @@ impl
         let mpi_data = AdyenMpiData {
             directory_response: "Y".to_string(),
             authentication_response: "Y".to_string(),
-            token_authentication_verification_value: token_data
-                .get_cryptogram()
-                .clone()
-                .unwrap_or_default(),
+            cavv: None,
+            token_authentication_verification_value: Some(
+                token_data.get_cryptogram().clone().unwrap_or_default(),
+            ),
             eci: Some("02".to_string()),
         };
         let (store, splits) = match item.router_data.request.split_payments.as_ref() {

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

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

## Description
<!-- Describe your changes in detail -->
This pull request introduces support for decrypting Apple Pay payment data in the Adyen connector. It includes updates to the `AdyenPaymentMethod` enum, new structures for handling decrypted Apple Pay data, and modifications to existing logic for processing payment tokens. The changes enhance functionality and improve flexibility in handling payment methods.

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


## 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)?
-->
-> Create a merchant connector account for adyen and enable apple pay
```
"apple_pay_combined": {
            "manual": {
                "session_token_data": {
                    "initiative": "web",
                    "certificate": "",
                    "display_name": "apple pay",
                    "certificate_keys": "",
                    "initiative_context": "debuglab.basilisk-char.ts.net",
                    "merchant_identifier": "",
                    "merchant_business_country": "AU",
                    "payment_processing_details_at": "",
                    "payment_processing_certificate": "",
                    "payment_processing_certificate_key": ""
                },
                "payment_request_data": {
                    "label": "applepay",
                    "supported_networks": [
                        "visa",
                        "masterCard",
                        "amex",
                        "discover"
                    ],
                    "merchant_capabilities": [
                        "supports3DS"
                    ]
                }
            }
        },
```
-> Make a apple pay payment
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api-key' \
--data-raw '{
    "amount": 650,
    "currency": "USD",
    "confirm": true,
    "business_country": "US",
    "business_label": "default",
    "amount_to_capture": 650,
    "customer_id": "cu_1752147534",
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "setup_future_usage": "off_session",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "email": "something@gmail.com",
    "name": "Joseph Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "payment_method": "wallet",
    "payment_method_type": "apple_pay",
    "billing": {
        "address": {
            "line1": "1467",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "payment_data": "==",
                "payment_method": {
                    "display_name": "Discover 9319",
                    "network": "Discover",
                    "type": "credit"
                },
                "transaction_identifier": "c635c5b3af900d7bd81fecd7028f1262f9d030754ee65ec7afd988a678194751"
            }
        }
    }
}'
```
```
{
    "payment_id": "pay_dJrJVGuuuMcTx3ZMr3sn",
    "merchant_id": "merchant_1752143545",
    "status": "succeeded",
    "amount": 650,
    "net_amount": 650,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 650,
    "connector": "adyen",
    "client_secret": "pay_dJrJVGuuuMcTx3ZMr3sn_secret_uJD9kz6I3hUvC0333wj0",
    "created": "2025-07-10T11:38:51.845Z",
    "currency": "USD",
    "customer_id": "cu_1752147532",
    "customer": {
        "id": "cu_1752147532",
        "name": "Joseph Doe",
        "email": "something@gmail.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "description": "Its my first payment request",
    "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": "wallet",
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "last4": "9319",
                "card_network": "Discover",
                "type": "credit"
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": null,
            "line3": null,
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "something@gmail.com",
    "name": "Joseph Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "apple_pay",
    "connector_label": "adyen_US_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cu_1752147532",
        "created_at": 1752147531,
        "expires": 1752151131,
        "secret": "epk_29209a3a0b8744e78745fc53120e2606"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "FFRWLKGL9GMTT475",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_dJrJVGuuuMcTx3ZMr3sn_1",
    "payment_link": null,
    "profile_id": "pro_J2FnaaW4M2zfdqhM1pGa",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_r2IwjAwwrKATInMfX2Ga",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-10T11:53:51.845Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_GNhWI2uXCdrKCcNiZ9Cg",
    "payment_method_status": "active",
    "updated": "2025-07-10T11:38:53.596Z",
    "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": "QSJDL57GX6C68775",
    "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
}
```

-> connector request
```
{
  "amount": {
    "currency": "USD",
    "value": 650
  },
  "merchantAccount": "*** alloc::string::String ***",
  "paymentMethod": {
    "type": "scheme",
    "number": "*** alloc::string::String ***",
    "expiryMonth": "*** alloc::string::String ***",
    "expiryYear": "*** alloc::string::String ***",
    "brand": "applepay"
  },
  "mpiData": {
    "directoryResponse": "Y",
    "authenticationResponse": "Y",
    "cavv": "*** alloc::string::String ***",
    "eci": "7"
  },
  "reference": "pay_dJrJVGuuuMcTx3ZMr3sn_1",
  "returnUrl": "http://localhost:8080/payments/pay_dJrJVGuuuMcTx3ZMr3sn/merchant_1752143545/redirect/response/adyen",
  "shopperInteraction": "Ecommerce",
  "recurringProcessingModel": "UnscheduledCardOnFile",
  "shopperReference": "merchant_1752143545_cu_1752147532",
  "storePaymentMethod": true,
  "shopperStatement": "Juspay",
  "telephoneNumber": "*** alloc::string::String ***",
  "billingAddress": {
    "city": "San Fransico",
    "country": "US",
    "houseNumberOrName": "*** alloc::string::String ***",
    "postalCode": "*** alloc::string::String ***",
    "stateOrProvince": "*** alloc::string::String ***"
  }
}

```
<img width="1426" height="973" alt="image" src="https://github.com/user-attachments/assets/544ca966-7267-46ae-869a-d6e5cdbe96b1" />

### testing existing connector decryption flow
```
{
    "amount": 1,
    "currency": "EUR",
    "confirm": true,
    "business_country": "US",
    "business_label": "default",
    "amount_to_capture": 1,
    "customer_id": "cu_{{$timestamp}}",
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "setup_future_usage": "off_session",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "email": "something@gmail.com",
    "name": "Joseph Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "payment_method": "wallet",
    "payment_method_type": "apple_pay",
    "billing": {
        "address": {
            "line1": "1467",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "payment_data": "eyJkYXRhIjoiK3NLL0trRWMvRXlFb203N2FJenFYMkNyNG1ldFlranRla1h3eEIyQTJYRzA4ekMwMFJwdFowU0xlSExabnRvZTZpeVNnbzFNVmUyWWVCRVk2b2VteUpwU053TE5PQVU0K3M2eU9zSXNJQ0VITTlMa3FjZGoyc0IwU2RzUHAyUklHVGp3TWozVGtsTFhQV295NlJ0NlZyVVFQemxldlRobE9OZ3piR2psd0I1OVlxN3J0VHFHN0h5eFd3WTJLaDBzcytySWpDbHdnQkRzSzNXMVJ2bzB2NVlDVEdFYW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yIjp7InB1YmxpY0tleUhhc2giOiJFYzRPbEFveXRpNFpyZ1lCclRMZzZMQ1NVSzdCdHBQekozblpQeC9Sd3RBPSIsImVwaGVtZXJhbFB1YmxpY0tleSI6Ik1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMERBUWNEUWdBRXZ0QlVudThhS244alBNQzM4SFdnQ00zeVRTT3ZiaDFsakRtWFVsZzJUUExtYWhwTS9RcEtqRkdYeVEyY2JKWW5aeU1HVjRzR2w1T0NWcFR2eld0cjBBPT0iLCJ0cmFuc2FjdGlvbklkIjoiNzI5NWY3NTc4ZGM4ODI2OWE5ZGY0MWU0YzgxZjQ2ODE2NWYzMmE3NjFjMTA5MGIzNDhlMjAxYzk1YmI0ZmUxMyJ9LCJ2ZXJzaW9uIjoiRUNfdjEifQ==",
                "payment_method": {
                    "display_name": "Discover 9319",
                    "network": "Discover",
                    "type": "credit"
                },
                "transaction_identifier": "c635c5b3af900d7bd81fecd7028f1262f9d030754ee65ec7afd988a678194751"
            }
        }
    }
}
```
```
{
    "payment_id": "pay_kM6NBnxuHTlzY5ybGLqx",
    "merchant_id": "merchant_1752565724",
    "status": "succeeded",
    "amount": 1,
    "net_amount": 1,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 1,
    "connector": "adyen",
    "client_secret": "pay_kM6NBnxuHTlzY5ybGLqx_secret_5mV0RX2Rs2mOQ4X67Yjs",
    "created": "2025-07-15T07:53:29.564Z",
    "currency": "EUR",
    "customer_id": "cu_1752566010",
    "customer": {
        "id": "cu_1752566010",
        "name": "Joseph Doe",
        "email": "something@gmail.com",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "description": "Its my first payment request",
    "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": "wallet",
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "last4": "9319",
                "card_network": "Discover",
                "type": "credit"
            }
        },
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": null,
            "line3": null,
            "zip": "94122",
            "state": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "something@gmail.com",
    "name": "Joseph Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "apple_pay",
    "connector_label": "adyen_US_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cu_1752566010",
        "created_at": 1752566009,
        "expires": 1752569609,
        "secret": "epk_dd5dd4d6b20d4c18a9db60922145f7b6"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "SHKNSMTDM6STT475",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_kM6NBnxuHTlzY5ybGLqx_1",
    "payment_link": null,
    "profile_id": "pro_BECixFE1QlimjLqJalgs",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_7SBGsmaaqWT9TrbNL747",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-07-15T08:08:29.564Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": "pm_oGV7tOINPnAnIWUo0w9U",
    "payment_method_status": "active",
    "updated": "2025-07-15T07:53:31.250Z",
    "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": "SQGB2PFPQLSMC375",
    "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
}
```

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