From 6428d07f983026245159de4147b62bc0fc018165 Mon Sep 17 00:00:00 2001 From: ashutuptiwari <106370097+ashutuptiwari@users.noreply.github.com> Date: Wed, 25 Oct 2023 12:59:45 +0530 Subject: [PATCH] refactor(connector): [CryptoPay] Remove Default Case Handling (#2643) Co-authored-by: Prasunna Soppa <70575890+prasunna09@users.noreply.github.com> --- .../src/connector/cryptopay/transformers.rs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/crates/router/src/connector/cryptopay/transformers.rs b/crates/router/src/connector/cryptopay/transformers.rs index a49380cb3656..8d9f277dd0f8 100644 --- a/crates/router/src/connector/cryptopay/transformers.rs +++ b/crates/router/src/connector/cryptopay/transformers.rs @@ -69,9 +69,23 @@ impl TryFrom<&CryptopayRouterData<&types::PaymentsAuthorizeRouterData>> custom_id: item.router_data.connector_request_reference_id.clone(), }) } - _ => Err(errors::ConnectorError::NotImplemented( - "payment method".to_string(), - )), + api_models::payments::PaymentMethodData::Card(_) + | api_models::payments::PaymentMethodData::CardRedirect(_) + | api_models::payments::PaymentMethodData::Wallet(_) + | api_models::payments::PaymentMethodData::PayLater(_) + | api_models::payments::PaymentMethodData::BankRedirect(_) + | api_models::payments::PaymentMethodData::BankDebit(_) + | api_models::payments::PaymentMethodData::BankTransfer(_) + | api_models::payments::PaymentMethodData::MandatePayment {} + | api_models::payments::PaymentMethodData::Reward {} + | api_models::payments::PaymentMethodData::Upi(_) + | api_models::payments::PaymentMethodData::Voucher(_) + | api_models::payments::PaymentMethodData::GiftCard(_) => { + Err(errors::ConnectorError::NotSupported { + message: utils::SELECTED_PAYMENT_METHOD.to_string(), + connector: "CryptoPay", + }) + } }?; Ok(cryptopay_request) }