Bug: [REFACTOR] : remove deprecated PMTs from Adyen (Giropay and Sofort)



Remove deprecated PMTs from Adyen (Giropay and Sofort)
diff --git a/config/config.example.toml b/config/config.example.toml
index e982a01eb11..7a810414b4d 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -458,11 +458,11 @@ bank_debit.becs = { connector_list = "gocardless" }
 bank_debit.bacs = { connector_list = "adyen" }                                        # Mandate supported payment method type and connector for bank_debit
 bank_debit.sepa = { connector_list = "gocardless,adyen" }                             # Mandate supported payment method type and connector for bank_debit
 bank_redirect.ideal = { connector_list = "stripe,adyen,globalpay" }                   # Mandate supported payment method type and connector for bank_redirect
-bank_redirect.sofort = { connector_list = "stripe,adyen,globalpay" }
+bank_redirect.sofort = { connector_list = "stripe,globalpay" }
 wallet.apple_pay = { connector_list = "stripe,adyen,cybersource,noon,bankofamerica" }
 wallet.samsung_pay = { connector_list = "cybersource" }
 wallet.google_pay = { connector_list = "bankofamerica" }
-bank_redirect.giropay = { connector_list = "adyen,globalpay" }
+bank_redirect.giropay = { connector_list = "globalpay" }
 
 
 [mandates.update_mandate_supported]
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index 5791c6aa83e..04cec1da4d9 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -181,8 +181,8 @@ wallet.twint.connector_list = "adyen"
 wallet.vipps.connector_list = "adyen"
 
 bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay,nexinets"   
-bank_redirect.sofort.connector_list = "stripe,adyen,globalpay"  
-bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay,nexinets"        
+bank_redirect.sofort.connector_list = "stripe,globalpay"  
+bank_redirect.giropay.connector_list = "globalpay,multisafepay,nexinets"        
 bank_redirect.bancontact_card.connector_list="adyen,stripe"
 bank_redirect.trustly.connector_list="adyen"
 bank_redirect.open_banking_uk.connector_list="adyen"
diff --git a/config/deployments/production.toml b/config/deployments/production.toml
index 78590f05f1b..3c63825da87 100644
--- a/config/deployments/production.toml
+++ b/config/deployments/production.toml
@@ -181,8 +181,8 @@ wallet.twint.connector_list = "adyen"
 wallet.vipps.connector_list = "adyen"
 
 bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay,nexinets"   
-bank_redirect.sofort.connector_list = "stripe,adyen,globalpay"  
-bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay,nexinets"        
+bank_redirect.sofort.connector_list = "stripe,globalpay"  
+bank_redirect.giropay.connector_list = "globalpay,multisafepay,nexinets"        
 bank_redirect.bancontact_card.connector_list="adyen,stripe"
 bank_redirect.trustly.connector_list="adyen"
 bank_redirect.open_banking_uk.connector_list="adyen"
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index 4127a694fcb..f5782fc563b 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -181,8 +181,8 @@ wallet.twint.connector_list = "adyen"
 wallet.vipps.connector_list = "adyen"
 
 bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay,nexinets"   
-bank_redirect.sofort.connector_list = "stripe,adyen,globalpay"  
-bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay,nexinets"        
+bank_redirect.sofort.connector_list = "stripe,globalpay"  
+bank_redirect.giropay.connector_list = "globalpay,multisafepay,nexinets"        
 bank_redirect.bancontact_card.connector_list="adyen,stripe"
 bank_redirect.trustly.connector_list="adyen"
 bank_redirect.open_banking_uk.connector_list="adyen"
diff --git a/config/development.toml b/config/development.toml
index 473c453d1c8..40d55207584 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -643,8 +643,8 @@ wallet.twint.connector_list = "adyen"
 wallet.vipps.connector_list = "adyen"
 
 bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay,nexinets"
-bank_redirect.sofort.connector_list = "stripe,adyen,globalpay"
-bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay,nexinets"
+bank_redirect.sofort.connector_list = "stripe,globalpay"
+bank_redirect.giropay.connector_list = "globalpay,multisafepay,nexinets"
 bank_redirect.bancontact_card.connector_list = "adyen,stripe"
 bank_redirect.trustly.connector_list = "adyen"
 bank_redirect.open_banking_uk.connector_list = "adyen"
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 12b8df6683c..15fb3ec4423 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -534,8 +534,8 @@ bank_debit.becs = { connector_list = "gocardless" }
 bank_debit.bacs = { connector_list = "adyen" }
 bank_debit.sepa = { connector_list = "gocardless,adyen" }
 bank_redirect.ideal = { connector_list = "stripe,adyen,globalpay" }
-bank_redirect.sofort = { connector_list = "stripe,adyen,globalpay" }
-bank_redirect.giropay = { connector_list = "adyen,globalpay" }
+bank_redirect.sofort = { connector_list = "stripe,globalpay" }
+bank_redirect.giropay = { connector_list = "globalpay" }
 
 [mandates.update_mandate_supported]
 card.credit = { connector_list = "cybersource" }
diff --git a/crates/connector_configs/toml/development.toml b/crates/connector_configs/toml/development.toml
index 2b04ea8d1c2..d8e5a0651ee 100644
--- a/crates/connector_configs/toml/development.toml
+++ b/crates/connector_configs/toml/development.toml
@@ -119,10 +119,6 @@ merchant_secret="Source verification key"
   payment_method_type = "sepa"
 [[adyen.bank_redirect]]
   payment_method_type = "ideal"
-[[adyen.bank_redirect]]
-  payment_method_type = "giropay"
-[[adyen.bank_redirect]]
-  payment_method_type = "sofort"
 [[adyen.bank_redirect]]
   payment_method_type = "eps"
 [[adyen.bank_redirect]]
diff --git a/crates/connector_configs/toml/production.toml b/crates/connector_configs/toml/production.toml
index b7108c63477..4dceada37d9 100644
--- a/crates/connector_configs/toml/production.toml
+++ b/crates/connector_configs/toml/production.toml
@@ -106,10 +106,6 @@ merchant_secret="Source verification key"
   payment_method_type = "bacs"
 [[adyen.bank_redirect]]
   payment_method_type = "ideal"
-[[adyen.bank_redirect]]
-  payment_method_type = "giropay"
-[[adyen.bank_redirect]]
-  payment_method_type = "sofort"
 [[adyen.bank_redirect]]
   payment_method_type = "eps"
 [[adyen.wallet]]
diff --git a/crates/connector_configs/toml/sandbox.toml b/crates/connector_configs/toml/sandbox.toml
index b886e7410a9..489fd858350 100644
--- a/crates/connector_configs/toml/sandbox.toml
+++ b/crates/connector_configs/toml/sandbox.toml
@@ -119,10 +119,6 @@ merchant_secret="Source verification key"
   payment_method_type = "sepa"
 [[adyen.bank_redirect]]
   payment_method_type = "ideal"
-[[adyen.bank_redirect]]
-  payment_method_type = "giropay"
-[[adyen.bank_redirect]]
-  payment_method_type = "sofort"
 [[adyen.bank_redirect]]
   payment_method_type = "eps"
 [[adyen.bank_redirect]]
diff --git a/crates/router/src/connector/adyen.rs b/crates/router/src/connector/adyen.rs
index 91e65759573..7067592771f 100644
--- a/crates/router/src/connector/adyen.rs
+++ b/crates/router/src/connector/adyen.rs
@@ -192,8 +192,6 @@ impl ConnectorValidation for Adyen {
                 | PaymentMethodType::Alfamart
                 | PaymentMethodType::Indomaret
                 | PaymentMethodType::FamilyMart
-                | PaymentMethodType::Sofort
-                | PaymentMethodType::Giropay
                 | PaymentMethodType::Seicomart
                 | PaymentMethodType::PayEasy
                 | PaymentMethodType::MiniStop
@@ -228,10 +226,12 @@ impl ConnectorValidation for Adyen {
                 | PaymentMethodType::Pse
                 | PaymentMethodType::LocalBankTransfer
                 | PaymentMethodType::Efecty
+                | PaymentMethodType::Giropay
                 | PaymentMethodType::PagoEfectivo
                 | PaymentMethodType::PromptPay
                 | PaymentMethodType::RedCompra
                 | PaymentMethodType::RedPagos
+                | PaymentMethodType::Sofort
                 | PaymentMethodType::CryptoCurrency
                 | PaymentMethodType::Evoucher
                 | PaymentMethodType::Cashapp
@@ -274,9 +274,7 @@ impl ConnectorValidation for Adyen {
             PaymentMethodDataType::VippsRedirect,
             PaymentMethodDataType::KlarnaRedirect,
             PaymentMethodDataType::Ideal,
-            PaymentMethodDataType::Sofort,
             PaymentMethodDataType::OpenBankingUk,
-            PaymentMethodDataType::Giropay,
             PaymentMethodDataType::Trustly,
             PaymentMethodDataType::BancontactCard,
             PaymentMethodDataType::AchBankDebit,
diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs
index adb1a795f70..a20891d0c16 100644
--- a/crates/router/src/connector/adyen/transformers.rs
+++ b/crates/router/src/connector/adyen/transformers.rs
@@ -530,7 +530,6 @@ pub enum AdyenPaymentMethod<'a> {
     Eps(Box<BankRedirectionWithIssuer<'a>>),
     #[serde(rename = "gcash")]
     Gcash(Box<GcashData>),
-    Giropay(Box<PmdForPaymentType>),
     Gpay(Box<AdyenGPay>),
     #[serde(rename = "gopay_wallet")]
     GoPay(Box<GoPayData>),
@@ -564,8 +563,6 @@ pub enum AdyenPaymentMethod<'a> {
     PayBright,
     #[serde(rename = "doku_permata_lite_atm")]
     PermataBankTransfer(Box<DokuBankData>),
-    #[serde(rename = "directEbanking")]
-    Sofort,
     #[serde(rename = "trustly")]
     Trustly,
     #[serde(rename = "walley")]
@@ -1287,7 +1284,6 @@ pub enum PaymentType {
     Dana,
     Eps,
     Gcash,
-    Giropay,
     Googlepay,
     #[serde(rename = "gopay_wallet")]
     GoPay,
@@ -1323,8 +1319,6 @@ pub enum PaymentType {
     PayBright,
     Paypal,
     Scheme,
-    #[serde(rename = "directEbanking")]
-    Sofort,
     #[serde(rename = "networkToken")]
     NetworkToken,
     Trustly,
@@ -2052,13 +2046,11 @@ impl TryFrom<&storage_enums::PaymentMethodType> for PaymentType {
             | storage_enums::PaymentMethodType::BancontactCard
             | storage_enums::PaymentMethodType::Blik
             | storage_enums::PaymentMethodType::Eps
-            | storage_enums::PaymentMethodType::Giropay
             | storage_enums::PaymentMethodType::Ideal
             | storage_enums::PaymentMethodType::OnlineBankingCzechRepublic
             | storage_enums::PaymentMethodType::OnlineBankingFinland
             | storage_enums::PaymentMethodType::OnlineBankingPoland
             | storage_enums::PaymentMethodType::OnlineBankingSlovakia
-            | storage_enums::PaymentMethodType::Sofort
             | storage_enums::PaymentMethodType::Trustly
             | storage_enums::PaymentMethodType::GooglePay
             | storage_enums::PaymentMethodType::AliPay
@@ -2436,11 +2428,6 @@ impl
                     ),
                 }),
             )),
-            domain::BankRedirectData::Giropay { .. } => {
-                Ok(AdyenPaymentMethod::Giropay(Box::new(PmdForPaymentType {
-                    payment_type: PaymentType::Giropay,
-                })))
-            }
             domain::BankRedirectData::Ideal { bank_name, .. } => {
                 let issuer = if test_mode.unwrap_or(true) {
                     Some(
@@ -2511,11 +2498,12 @@ impl
                     },
                 })),
             ),
-            domain::BankRedirectData::Sofort { .. } => Ok(AdyenPaymentMethod::Sofort),
             domain::BankRedirectData::Trustly { .. } => Ok(AdyenPaymentMethod::Trustly),
-            domain::BankRedirectData::Interac { .. }
+            domain::BankRedirectData::Giropay { .. }
+            | domain::BankRedirectData::Interac { .. }
             | domain::BankRedirectData::LocalBankRedirect {}
-            | domain::BankRedirectData::Przelewy24 { .. } => {
+            | domain::BankRedirectData::Przelewy24 { .. }
+            | domain::BankRedirectData::Sofort { .. } => {
                 Err(errors::ConnectorError::NotImplemented(
                     utils::get_unimplemented_payment_method_error_message("Adyen"),
                 )
@@ -3139,20 +3127,13 @@ fn get_redirect_extra_details(
 ) -> errors::CustomResult<(Option<String>, Option<api_enums::CountryAlpha2>), errors::ConnectorError>
 {
     match item.request.payment_method_data {
-        domain::PaymentMethodData::BankRedirect(ref redirect_data) => match redirect_data {
-            domain::BankRedirectData::Sofort {
-                preferred_language, ..
-            } => {
-                let country = item.get_optional_billing_country();
-                Ok((preferred_language.clone(), country))
-            }
+        domain::PaymentMethodData::BankRedirect(
             domain::BankRedirectData::Trustly { .. }
-            | domain::BankRedirectData::OpenBankingUk { .. } => {
-                let country = item.get_optional_billing_country();
-                Ok((None, country))
-            }
-            _ => Ok((None, None)),
-        },
+            | domain::BankRedirectData::OpenBankingUk { .. },
+        ) => {
+            let country = item.get_optional_billing_country();
+            Ok((None, country))
+        }
         _ => Ok((None, None)),
     }
 }
@@ -3920,7 +3901,6 @@ pub fn get_wait_screen_metadata(
         | PaymentType::Dana
         | PaymentType::Eps
         | PaymentType::Gcash
-        | PaymentType::Giropay
         | PaymentType::Googlepay
         | PaymentType::GoPay
         | PaymentType::Ideal
@@ -3940,7 +3920,6 @@ pub fn get_wait_screen_metadata(
         | PaymentType::PayBright
         | PaymentType::Paypal
         | PaymentType::Scheme
-        | PaymentType::Sofort
         | PaymentType::NetworkToken
         | PaymentType::Trustly
         | PaymentType::TouchNGo
@@ -4037,7 +4016,6 @@ pub fn get_present_to_shopper_metadata(
         | PaymentType::Dana
         | PaymentType::Eps
         | PaymentType::Gcash
-        | PaymentType::Giropay
         | PaymentType::Googlepay
         | PaymentType::GoPay
         | PaymentType::Ideal
@@ -4059,7 +4037,6 @@ pub fn get_present_to_shopper_metadata(
         | PaymentType::PayBright
         | PaymentType::Paypal
         | PaymentType::Scheme
-        | PaymentType::Sofort
         | PaymentType::NetworkToken
         | PaymentType::Trustly
         | PaymentType::TouchNGo
diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml
index 4d9c686f23b..8a0c18152fc 100644
--- a/loadtest/config/development.toml
+++ b/loadtest/config/development.toml
@@ -350,8 +350,8 @@ wallet.twint.connector_list = "adyen"
 wallet.vipps.connector_list = "adyen"
 
 bank_redirect.ideal.connector_list = "stripe,adyen,globalpay,multisafepay,nexinets"   
-bank_redirect.sofort.connector_list = "stripe,adyen,globalpay"  
-bank_redirect.giropay.connector_list = "adyen,globalpay,multisafepay,nexinets"        
+bank_redirect.sofort.connector_list = "stripe,globalpay"  
+bank_redirect.giropay.connector_list = "globalpay,multisafepay,nexinets"        
 bank_redirect.bancontact_card.connector_list="adyen,stripe"
 bank_redirect.trustly.connector_list="adyen"
 bank_redirect.open_banking_uk.connector_list="adyen"

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

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

## Description
<!-- Describe your changes in detail -->
Removed deprecated PMTs from Ayden: https://www.adyen.com/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).
-->
https://github.com/juspay/hyperswitch-cloud/issues/8202


## 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)?
-->
Removed the deprecated payment methods, so no testing required. 
Reference that the payment methods are actually no longer available: https://www.adyen.com/payment-methods

No-3DS auto capture
<img width="1720" alt="Screenshot 2025-02-10 at 5 25 26 PM" src="https://github.com/user-attachments/assets/0ca86a25-1c0c-41cf-9348-9676b1254cf7" />

3DS auto capture
<img width="1715" alt="Screenshot 2025-02-10 at 5 25 46 PM" src="https://github.com/user-attachments/assets/fb4f99ae-2d89-4833-8e1c-f918c303020d" />

No-3DS manual capture
<img width="1724" alt="Screenshot 2025-02-10 at 5 26 06 PM" src="https://github.com/user-attachments/assets/407799ef-67de-4f26-b458-a5a4329303f4" />

3DS manual capture
<img width="1727" alt="Screenshot 2025-02-10 at 5 26 54 PM" src="https://github.com/user-attachments/assets/6dcf53b9-4c2e-45c9-a521-8985090032f8" />


Bank Redirect -- All test cases in bank redirect is passed, other than `ideal`. Ideal's payment is failing currently and I will be fixing that in other PR.

<img width="1722" alt="Screenshot 2025-02-10 at 5 36 47 PM" src="https://github.com/user-attachments/assets/a823e7cb-744a-455f-b004-63b6834fb63c" />

<img width="1725" alt="Screenshot 2025-02-10 at 5 36 56 PM" src="https://github.com/user-attachments/assets/ab0369c1-d49c-4606-9830-63992c701040" />


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