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

fix(connector): [paypal] avoide non zero setup mandates (#13879)

Nithin Nae919b547fdb
diff --git a/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs b/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
index 8e8722f81c..4dc0d47652 100644
--- a/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
@@ -720,6 +720,13 @@ impl<F, T> TryFrom<ResponseRouterData<F, PaypalSetupMandatesResponse, T, Payment
impl TryFrom<&SetupMandateRouterData> for PaypalZeroMandateRequest {
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(item: &SetupMandateRouterData) -> Result<Self, Self::Error> {
+ if item.request.amount > 0 {
+ return Err(errors::ConnectorError::FlowNotSupported {
+ flow: "Setup Mandate with non zero amount".to_string(),
+ connector: "Paypal".to_string(),
+ }
+ .into());
+ }
let payment_source = match item.request.payment_method_data.clone() {
PaymentMethodData::Card(ccard) => ZeroMandateSourceItem::Card(CardMandateRequest {
billing_address: get_address_info(item.get_optional_billing()),