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] fix amount to its currency base unit for Paypal Bank redirects (#2002)

Prasunna Soppa4accb41ef4ff
diff --git a/crates/router/src/connector/paypal/transformers.rs b/crates/router/src/connector/paypal/transformers.rs
index 4852016bfe..b440eed24b 100644
--- a/crates/router/src/connector/paypal/transformers.rs
+++ b/crates/router/src/connector/paypal/transformers.rs
@@ -244,7 +244,10 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for PaypalPaymentsRequest {
};
let amount = OrderAmount {
currency_code: item.request.currency,
- value: item.request.amount.to_string(),
+ value: utils::to_currency_base_unit_with_zero_decimal_check(
+ item.request.amount,
+ item.request.currency,
+ )?,
};
let reference_id = item.attempt_id.clone();
let purchase_units = vec![PurchaseUnitRequest {