Bug: [REFACTOR] use REQUEST_TIME_OUT for outgoing webhooks instead of hardcoded 5-second timeout



**Problem Statement**
The current outgoing webhook timeout is hardcoded to 5 seconds, which is too restrictive and causes delivery failures for legacy systems which might take over 5 seconds to respond back. We should use the existing `REQUEST_TIME_OUT` constant (30s) for consistency with other external API calls.

**Current Implementation**
`const OUTGOING_WEBHOOK_TIMEOUT_SECS: u64 = 5;`

**Proposed Solution**
Remove `OUTGOING_WEBHOOK_TIMEOUT_SECS` and use the existing `REQUEST_TIME_OUT` constant (30s) for outgoing webhook requests. This keeps the timeout behavior of any outgoing APIs consistent.
diff --git a/crates/router/src/core/webhooks/outgoing.rs b/crates/router/src/core/webhooks/outgoing.rs
index cf7cbb8a2d8..baa5b4af583 100644
--- a/crates/router/src/core/webhooks/outgoing.rs
+++ b/crates/router/src/core/webhooks/outgoing.rs
@@ -45,8 +45,6 @@ use crate::{
     workflows::outgoing_webhook_retry,
 };
 
-const OUTGOING_WEBHOOK_TIMEOUT_SECS: u64 = 5;
-
 #[allow(clippy::too_many_arguments)]
 #[instrument(skip_all)]
 pub(crate) async fn create_event_and_trigger_outgoing_webhook(
@@ -338,7 +336,7 @@ async fn trigger_webhook_to_merchant(
 
     let response = state
         .api_client
-        .send_request(&state, request, Some(OUTGOING_WEBHOOK_TIMEOUT_SECS), false)
+        .send_request(&state, request, None, false)
         .await;
 
     metrics::WEBHOOK_OUTGOING_COUNT.add(
diff --git a/crates/router/src/core/webhooks/outgoing_v2.rs b/crates/router/src/core/webhooks/outgoing_v2.rs
index 0650bd2e8d9..07758817e68 100644
--- a/crates/router/src/core/webhooks/outgoing_v2.rs
+++ b/crates/router/src/core/webhooks/outgoing_v2.rs
@@ -396,12 +396,7 @@ async fn build_and_send_request(
 
     state
         .api_client
-        .send_request(
-            state,
-            request,
-            Some(types::OUTGOING_WEBHOOK_TIMEOUT_SECS),
-            false,
-        )
+        .send_request(state, request, None, false)
         .await
 }
 
diff --git a/crates/router/src/core/webhooks/types.rs b/crates/router/src/core/webhooks/types.rs
index 90d637d894e..dcea7f9c16b 100644
--- a/crates/router/src/core/webhooks/types.rs
+++ b/crates/router/src/core/webhooks/types.rs
@@ -11,8 +11,6 @@ use crate::{
     types::storage::{self, enums},
 };
 
-pub const OUTGOING_WEBHOOK_TIMEOUT_SECS: u64 = 5;
-
 #[derive(Debug)]
 pub enum ScheduleWebhookRetry {
     WithProcessTracker(Box<storage::ProcessTracker>),

## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description

Increased outgoing webhook timeout from 5 seconds to 30 seconds by replacing hardcoded `OUTGOING_WEBHOOK_TIMEOUT_SECS` with existing `REQUEST_TIME_OUT` constant for consistency.

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless it is an obvious bug or documentation fix
that will have little conversation).
-->

5-second hardcoded timeout causes webhook delivery failures for legacy systems that need more time to respond. Using 30-second timeout maintains consistency with other external API calls.

## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->

<details>
    <summary>1. Create a simple server for delaying the response for 29seconds</summary>

package.json

    {
        "name": "webhook-test-server",
        "version": "1.0.0",
        "description": "Test server for webhook timeout behavior - waits 30 seconds before responding",
        "main": "server.js",
        "scripts": {
            "start": "node server.js",
            "dev": "node server.js"
        },
        "dependencies": {
            "express": "^4.18.2"
        },
        "keywords": ["webhook", "test", "timeout"],
        "author": "",
        "license": "MIT"
    }

server.js

    const express = require('express');
    const app = express();

    app.use(express.json());

    app.post('/webhook', (req, res) => {
    console.log(`[${new Date().toISOString()}] Webhook received, waiting 29 seconds...`);
    
    setTimeout(() => {
        console.log(`[${new Date().toISOString()}] Responding after 29s delay`);
        res.json({ message: 'Success after 29s delay' });
    }, 29000);
    });

    app.listen(3000, () => {
    console.log('Webhook test server running on http://localhost:3000');
    console.log('POST to /webhook - will wait 29 seconds before responding');
    });

Run node server.js

</details>

<details>
    <summary>2. Set outgoing webhook endpoint during merchant account creation</summary>

http://localhost:3000/webhook (use ngrok to expose this for testing in cloud env)

</details>

<details>
    <summary>3. Process a payment</summary>

cURL

    curl --location --request POST 'http://localhost:8080/payments' \
        --header 'Content-Type: application/json' \
        --header 'Accept: application/json' \
        --header 'api-key: dev_9QPrburqsfeS7j2qoybLlIYt5oFfcrFHNxQqUDnlTOYe9s9dkC5cPVOyZaINnWX8' \
        --data-raw '{"amount":4500,"currency":"EUR","confirm":true,"profile_id":"pro_jY5jJD5THGIwfuIqH3Nx","capture_method":"automatic","authentication_type":"three_ds","setup_future_usage":"on_session","customer_id":"cus_HXi1vEcMXQ74qsaNq57p","email":"abc@example.com","return_url":"https://google.com","payment_method":"card","payment_method_type":"debit","payment_method_data":{"card":{"card_number":"4000000000002503","card_exp_month":"12","card_exp_year":"49","card_cvc":"123"}},"billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","zip":"94122","country":"SG","first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"browser_info":{"user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","language":"en-US","color_depth":32,"screen_height":1117,"screen_width":1728,"time_zone":-330,"java_enabled":true,"java_script_enabled":true,"ip_address":"127.0.0.1"},"customer_acceptance":{"acceptance_type":"online","accepted_at":"1963-05-03T04:07:52.723Z","online":{"ip_address":"127.0.0.1","user_agent":"amet irure esse"}},"session_expiry":60}'

Response

    {"payment_id":"pay_2Fqjbw3vYGAX1TTGJHWB","merchant_id":"merchant_1753252820","status":"failed","amount":4500,"net_amount":4500,"shipping_cost":null,"amount_capturable":0,"amount_received":null,"connector":"adyen","client_secret":"pay_2Fqjbw3vYGAX1TTGJHWB_secret_b50rZahoz0n6ee4Zm3nr","created":"2025-07-23T06:44:10.822Z","currency":"EUR","customer_id":"cus_HXi1vEcMXQ74qsaNq57p","customer":{"id":"cus_HXi1vEcMXQ74qsaNq57p","name":null,"email":"abc@example.com","phone":null,"phone_country_code":null},"description":null,"refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":"on_session","off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"2503","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"400000","card_extended_bin":null,"card_exp_month":"12","card_exp_year":"49","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"SG","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":null,"first_name":"joseph","last_name":"Doe"},"phone":{"number":"8056594427","country_code":"+91"},"email":"guest@example.com"},"order_details":null,"email":"abc@example.com","name":null,"phone":null,"return_url":"https://google.com/","authentication_type":"three_ds","statement_descriptor_name":null,"statement_descriptor_suffix":null,"next_action":null,"cancellation_reason":null,"error_code":"2","error_message":"Refused","unified_code":"UE_9000","unified_message":"Something went wrong","payment_experience":null,"payment_method_type":"debit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"cus_HXi1vEcMXQ74qsaNq57p","created_at":1753253050,"expires":1753256650,"secret":"epk_63945dac0445483b80731065804a2d75"},"manual_retry_allowed":true,"connector_transaction_id":"F59RPCDCMR9X2F75","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":null,"payment_link":null,"profile_id":"pro_jY5jJD5THGIwfuIqH3Nx","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_vZ79u4WZFBzDP1O0fSLc","incremental_authorization_allowed":false,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2025-07-23T06:45:10.822Z","fingerprint":null,"browser_info":{"language":"en-US","time_zone":-330,"ip_address":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36","color_depth":32,"java_enabled":true,"screen_width":1728,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":1117,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2025-07-23T06:44:13.414Z","split_payments":null,"frm_metadata":null,"extended_authorization_applied":null,"capture_before":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null,"card_discovery":"manual","force_3ds_challenge":false,"force_3ds_challenge_trigger":false,"issuer_error_code":null,"issuer_error_message":"This is not a testCard","is_iframe_redirection_enabled":null,"whole_connector_response":null}

Observations
- Outgoing webhook triggered from application
- A response is triggered after 29seconds and the connection from HS is not dropped

(Status received: 200)
<img width="865" height="811" alt="Screenshot 2025-07-23 at 12 21 36 PM" src="https://github.com/user-attachments/assets/8c053b7e-4e39-464a-bfe6-62c5c3b2504a" />


</details>

## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible