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

feat(connector): add surcharge support in paypal connector (#2568)

Sai Harsha Vardhan92ee1db107ac
diff --git a/crates/router/src/connector/paypal.rs b/crates/router/src/connector/paypal.rs
index fd104ac4aa..a0a787269e 100644
--- a/crates/router/src/connector/paypal.rs
+++ b/crates/router/src/connector/paypal.rs
@@ -370,7 +370,10 @@ impl ConnectorIntegration<api::Authorize, types::PaymentsAuthorizeData, types::P
let connector_router_data = paypal::PaypalRouterData::try_from((
&self.get_currency_unit(),
req.request.currency,
- req.request.amount,
+ req.request
+ .surcharge_details
+ .as_ref()
+ .map_or(req.request.amount, |surcharge| surcharge.final_amount),
req,
))?;
let req_obj = paypal::PaypalPaymentsRequest::try_from(&connector_router_data)?;