Bug: Setup-future-usage to be defaulted to on-session




diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index 76893659e03..2bcd317bafc 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -3865,7 +3865,10 @@ pub fn validate_mandate_data_and_future_usage(
     setup_future_usages: Option<api_enums::FutureUsage>,
     mandate_details_present: bool,
 ) -> Result<(), errors::ApiErrorResponse> {
-    if Some(api_enums::FutureUsage::OnSession) == setup_future_usages && mandate_details_present {
+    if mandate_details_present
+        && (Some(api_enums::FutureUsage::OnSession) == setup_future_usages
+            || setup_future_usages.is_none())
+    {
         Err(errors::ApiErrorResponse::PreconditionFailed {
             message: "`setup_future_usage` must be `off_session` for mandates".into(),
         })
diff --git a/crates/router/src/core/payments/tokenization.rs b/crates/router/src/core/payments/tokenization.rs
index 3a7ab7d9abe..c085382232b 100644
--- a/crates/router/src/core/payments/tokenization.rs
+++ b/crates/router/src/core/payments/tokenization.rs
@@ -102,9 +102,7 @@ where
             .change_context(errors::ApiErrorResponse::InternalServerError)
             .attach_printable("Unable to serialize customer acceptance to value")?;
 
-            let pm_id = if resp.request.get_setup_future_usage().is_some()
-                && customer_acceptance.is_some()
-            {
+            let pm_id = if customer_acceptance.is_some() {
                 let customer = maybe_customer.to_owned().get_required_value("customer")?;
                 let payment_method_create_request = helpers::get_payment_method_create_request(
                     Some(&resp.request.get_payment_method_data()),

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

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

## Description
 accept customer_acceptance to save the card

### Additional Changes

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

<!--
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## 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).
-->


## How did you test it?
- Create an MA and an MCA 
- Do a save card payment only by passing customer_acceptance
-> Create 
```
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_lb8obpTBmS60ZtaXLd4xVGkE69qnZKdEDfCyzM6UDJKVHyg5tEu6WkKHdukYug1F' \
--data-raw ' {"amount": 7000,
    "currency": "USD",
    "confirm": false,
    "capture_method": "automatic",
    "authentication_type": "no_three_ds",
     "customer_id": "77cc",
    "email": "something@gmail.com",
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "metadata": {
        "order_details": {
            "product_name": "Apple iphone 15",
            "quantity": 1
        }
    },
    "business_country": "US",
    "business_label": "default",

            "payment_method": "card",

    
    "payment_method_data": {
        "card": {
              "card_number": "4242424242424242",
    
            "card_exp_month": "12",
            "card_exp_year": "2040",
            "card_holder_name": "AKA",
            "card_cvc": "123",
            "nick_name": "HELO"
        }
    }
    
    
}'
```
-> Confirm
```
curl --location 'http://localhost:8080/payments/pay_ir21sZA1B2FN8Vn1zYT8/confirm' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_lb8obpTBmS60ZtaXLd4xVGkE69qnZKdEDfCyzM6UDJKVHyg5tEu6WkKHdukYug1F' \
--data '{
    "confirm": true,
    
      "customer_acceptance": {
            "acceptance_type": "offline",
            "accepted_at": "1963-05-03T04:07:52.723Z",
            "online": {
                "ip_address": "in sit",
                "user_agent": "amet irure esse"
            }}

}'
```
- the card will be saved , irrespective of the setup_future_usage
<img width="2170" alt="Screenshot 2024-03-07 at 5 19 41 PM" src="https://github.com/juspay/hyperswitch/assets/55580080/7907b2a1-2442-4986-b01f-9040dee2be1f">



## 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`
- [ ] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable
