Skip to content

Commit

Permalink
refactor : change not supported to not implemented error for Adyen
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar2d2 committed Nov 11, 2023
1 parent b3d5062 commit 452bafe
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions crates/router/src/connector/adyen/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1381,10 +1381,9 @@ impl<'a> TryFrom<&AdyenRouterData<&types::PaymentsAuthorizeRouterData>>
| payments::PaymentMethodData::MandatePayment
| payments::PaymentMethodData::Reward
| payments::PaymentMethodData::Upi(_) => {
Err(errors::ConnectorError::NotSupported {
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
connector: "Adyen",
})?
Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Adyen"),
))?
}
},
}
Expand Down Expand Up @@ -1677,10 +1676,9 @@ impl<'a> TryFrom<&api_models::payments::BankDebitData> for AdyenPaymentMethod<'a
},
))),
payments::BankDebitData::BecsBankDebit { .. } => {
Err(errors::ConnectorError::NotSupported {
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
connector: "Adyen",
}
Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Adyen"),
)
.into())
}
}
Expand Down Expand Up @@ -1728,10 +1726,9 @@ impl<'a> TryFrom<&api_models::payments::VoucherData> for AdyenPaymentMethod<'a>
payments::VoucherData::Efecty
| payments::VoucherData::PagoEfectivo
| payments::VoucherData::RedCompra
| payments::VoucherData::RedPagos => Err(errors::ConnectorError::NotSupported {
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
connector: "Adyen",
}
| payments::VoucherData::RedPagos => Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Adyen"),
)
.into()),
}
}
Expand Down Expand Up @@ -1915,10 +1912,9 @@ impl<'a> TryFrom<&api::WalletData> for AdyenPaymentMethod<'a> {
| payments::WalletData::GooglePayThirdPartySdk(_)
| payments::WalletData::PaypalSdk(_)
| payments::WalletData::WeChatPayQr(_)
| payments::WalletData::CashappQr(_) => Err(errors::ConnectorError::NotSupported {
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
connector: "Adyen",
}
| payments::WalletData::CashappQr(_) => Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Adyen"),
)
.into()),
}
}
Expand Down Expand Up @@ -1975,11 +1971,12 @@ impl<'a> TryFrom<(&api::PayLaterData, Option<api_enums::CountryAlpha2>)>
api_models::payments::PayLaterData::AtomeRedirect { .. } => {
Ok(AdyenPaymentMethod::Atome)
}
payments::PayLaterData::KlarnaSdk { .. } => Err(errors::ConnectorError::NotSupported {
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
connector: "Adyen",
payments::PayLaterData::KlarnaSdk { .. } => {
Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Adyen"),
)
.into())
}
.into()),
}
}
}
Expand Down Expand Up @@ -2110,10 +2107,9 @@ impl<'a> TryFrom<&api_models::payments::BankRedirectData> for AdyenPaymentMethod
}
payments::BankRedirectData::Interac { .. }
| payments::BankRedirectData::Przelewy24 { .. } => {
Err(errors::ConnectorError::NotSupported {
message: utils::SELECTED_PAYMENT_METHOD.to_string(),
connector: "Adyen",
}
Err(errors::ConnectorError::NotImplemented(
utils::get_unimplemented_payment_method_error_message("Adyen"),
)
.into())
}
}
Expand Down

0 comments on commit 452bafe

Please sign in to comment.