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(core): populate surcharge_details in payment list api (#12956)

Swangi Kumari3086caecc9c6
diff --git a/crates/router/src/core/payments/transformers.rs b/crates/router/src/core/payments/transformers.rs
index f311189274..c87eb4ae9f 100644
--- a/crates/router/src/core/payments/transformers.rs
+++ b/crates/router/src/core/payments/transformers.rs
@@ -4740,7 +4740,12 @@ impl ForeignFrom<(storage::PaymentIntent, storage::PaymentAttempt)> for api::Pay
feature_metadata: None,
reference_id: None,
payment_link: None,
- surcharge_details: None,
+ surcharge_details: pa.net_amount.get_surcharge_amount().map(|surcharge_amount| {
+ RequestSurchargeDetails {
+ surcharge_amount,
+ tax_amount: pa.net_amount.get_tax_on_surcharge(),
+ }
+ }),
merchant_decision: None,
incremental_authorization_allowed: None,
authorization_count: None,