feat(core): Confirm true mandatory when using stored payment method id in payouts (#9424)

Co-authored-by: Sayak Bhattacharya <sayak.b@Sayak-Bhattacharya-G092THXJ34.local>
This commit is contained in:
Sayak Bhattacharya
2025-09-25 12:07:45 +05:30
committed by GitHub
parent 68de6ba4e3
commit fd2f85706c

View File

@ -84,6 +84,11 @@ pub async fn validate_create_request(
Option<domain::Customer>, Option<domain::Customer>,
Option<PaymentMethod>, 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(); let merchant_id = merchant_context.get_merchant_account().get_id();
if let Some(payout_link) = &req.payout_link { if let Some(payout_link) = &req.payout_link {