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(core): Confirm true mandatory when using stored payment method id in payouts (#9424)

Sayak Bhattacharyafd2f85706cbf
diff --git a/crates/router/src/core/payouts/validator.rs b/crates/router/src/core/payouts/validator.rs
index 87a0748e5f..8c70308454 100644
--- a/crates/router/src/core/payouts/validator.rs
+++ b/crates/router/src/core/payouts/validator.rs
@@ -84,6 +84,11 @@ pub async fn validate_create_request(
Option<domain::Customer>,
Option<PaymentMethod>,
)> {
+ if req.payout_method_id.is_some() && req.confirm != Some(true) {
+ return Err(report!(errors::ApiErrorResponse::InvalidRequestData {
+ message: "Confirm must be true for recurring payouts".to_string(),
+ }));
+ }
let merchant_id = merchant_context.get_merchant_account().get_id();
if let Some(payout_link) = &req.payout_link {