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(router): Handle encoded_data in PSync [V2] (#8177)

Anurag Thakura19e12c09562
diff --git a/crates/router/src/core/payments/operations/payment_get.rs b/crates/router/src/core/payments/operations/payment_get.rs
index ebf8205ea9..716030c8f4 100644
--- a/crates/router/src/core/payments/operations/payment_get.rs
+++ b/crates/router/src/core/payments/operations/payment_get.rs
@@ -177,7 +177,7 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentStatusData<F>, PaymentsRetriev
}
})?;
- let payment_attempt = db
+ let mut payment_attempt = db
.find_payment_attempt_by_id(
key_manager_state,
merchant_context.get_merchant_key_store(),
@@ -188,6 +188,11 @@ impl<F: Send + Clone + Sync> GetTracker<F, PaymentStatusData<F>, PaymentsRetriev
.change_context(errors::ApiErrorResponse::InternalServerError)
.attach_printable("Could not find payment attempt given the attempt id")?;
+ payment_attempt.encoded_data = request
+ .param
+ .as_ref()
+ .map(|val| masking::Secret::new(val.clone()));
+
let should_sync_with_connector =
request.force_sync && payment_intent.status.should_force_sync_with_connector();