Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

refactor(connector): [Paypal] Change error message from NotSupported to NotImplemented (#2877)

Paris Osuch7251f6474fda
diff --git a/crates/router/src/connector/paypal/transformers.rs b/crates/router/src/connector/paypal/transformers.rs
index baf8f48279..88595585fe 100644
--- a/crates/router/src/connector/paypal/transformers.rs
+++ b/crates/router/src/connector/paypal/transformers.rs
@@ -396,11 +396,9 @@ fn get_payment_source(
| BankRedirectData::Trustly { .. }
| BankRedirectData::OnlineBankingFpx { .. }
| BankRedirectData::OnlineBankingThailand { .. } => {
- Err(errors::ConnectorError::NotSupported {
- message: utils::SELECTED_PAYMENT_METHOD.to_string(),
- connector: "Paypal",
- }
- .into())
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("Paypal"),
+ ))?
}
}
}
@@ -544,10 +542,9 @@ impl TryFrom<&PaypalRouterData<&types::PaymentsAuthorizeRouterData>> for PaypalP
| api_models::payments::WalletData::WeChatPayQr(_)
| api_models::payments::WalletData::CashappQr(_)
| api_models::payments::WalletData::SwishQr(_) => {
- Err(errors::ConnectorError::NotSupported {
- message: utils::SELECTED_PAYMENT_METHOD.to_string(),
- connector: "Paypal",
- })?
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("Paypal"),
+ ))?
}
},
api::PaymentMethodData::BankRedirect(ref bank_redirection_data) => {
@@ -611,10 +608,9 @@ impl TryFrom<&PaypalRouterData<&types::PaymentsAuthorizeRouterData>> for PaypalP
| api_models::payments::PaymentMethodData::Crypto(_)
| api_models::payments::PaymentMethodData::Upi(_)
| api_models::payments::PaymentMethodData::CardToken(_) => {
- Err(errors::ConnectorError::NotSupported {
- message: utils::SELECTED_PAYMENT_METHOD.to_string(),
- connector: "Paypal",
- }
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("Paypal"),
+ )
.into())
}
}
@@ -629,10 +625,9 @@ impl TryFrom<&api_models::payments::CardRedirectData> for PaypalPaymentsRequest
| api_models::payments::CardRedirectData::Benefit {}
| api_models::payments::CardRedirectData::MomoAtm {}
| api_models::payments::CardRedirectData::CardRedirect {} => {
- Err(errors::ConnectorError::NotSupported {
- message: utils::SELECTED_PAYMENT_METHOD.to_string(),
- connector: "Paypal",
- }
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("Paypal"),
+ )
.into())
}
}
@@ -651,10 +646,9 @@ impl TryFrom<&api_models::payments::PayLaterData> for PaypalPaymentsRequest {
| api_models::payments::PayLaterData::WalleyRedirect {}
| api_models::payments::PayLaterData::AlmaRedirect {}
| api_models::payments::PayLaterData::AtomeRedirect {} => {
- Err(errors::ConnectorError::NotSupported {
- message: utils::SELECTED_PAYMENT_METHOD.to_string(),
- connector: "Paypal",
- }
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("Paypal"),
+ )
.into())
}
}
@@ -669,10 +663,9 @@ impl TryFrom<&api_models::payments::BankDebitData> for PaypalPaymentsRequest {
| api_models::payments::BankDebitData::SepaBankDebit { .. }
| api_models::payments::BankDebitData::BecsBankDebit { .. }
| api_models::payments::BankDebitData::BacsBankDebit { .. } => {
- Err(errors::ConnectorError::NotSupported {
- message: utils::SELECTED_PAYMENT_METHOD.to_string(),
- connector: "Paypal",
- }
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("Paypal"),
+ )
.into())
}
}
@@ -696,10 +689,9 @@ impl TryFrom<&api_models::payments::BankTransferData> for PaypalPaymentsRequest
| api_models::payments::BankTransferData::MandiriVaBankTransfer { .. }
| api_models::payments::BankTransferData::Pix {}
| api_models::payments::BankTransferData::Pse {} => {
- Err(errors::ConnectorError::NotSupported {
- message: utils::SELECTED_PAYMENT_METHOD.to_string(),
- connector: "Paypal",
- }
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("Paypal"),
+ )
.into())
}
}
@@ -724,10 +716,9 @@ impl TryFrom<&api_models::payments::VoucherData> for PaypalPaymentsRequest {
| api_models::payments::VoucherData::FamilyMart(_)
| api_models::payments::VoucherData::Seicomart(_)
| api_models::payments::VoucherData::PayEasy(_) => {
- Err(errors::ConnectorError::NotSupported {
- message: utils::SELECTED_PAYMENT_METHOD.to_string(),
- connector: "Paypal",
- }
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("Paypal"),
+ )
.into())
}
}
@@ -740,10 +731,9 @@ impl TryFrom<&api_models::payments::GiftCardData> for PaypalPaymentsRequest {
match value {
api_models::payments::GiftCardData::Givex(_)
| api_models::payments::GiftCardData::PaySafeCard {} => {
- Err(errors::ConnectorError::NotSupported {
- message: utils::SELECTED_PAYMENT_METHOD.to_string(),
- connector: "Paypal",
- }
+ Err(errors::ConnectorError::NotImplemented(
+ utils::get_unimplemented_payment_method_error_message("Paypal"),
+ )
.into())
}
}