hotfix for [PR](https://github.com/juspay/hyperswitch/pull/6202)
1. Add support for a new endpoint post_session_tokens which can be called before the confirm call.

Use Case
- In PayPal, after the session call, when we click the PayPal button, we need to create an order. Previously, this was done in the `/confirm` call, and in response, we received the `order_id` / `connector_transaction_id`. We would then send this information to the HS SDK, which forwarded it to PayPal. PayPal used this data to render their SDK, allowing the user to log in and modify the shipping address. The user would then click "Complete Purchase," triggering the OnApprove callback, which was handled by the /complete_authorize call.
- The /confirm call happens at the point of order creation, but we receive the shipping address after that. At that stage, we make a call to TaxJar, and the order's tax amount is added. However, since the /confirm call has already happened, we can't change/update the amount at that point. This was the reason for creating the new flow, where the order creation happens in the /post_session_tokens call, and the /confirm call occurs after tax calculation.
- After this refactoring, the CreateOrder step will be handled in the /post_session_tokens call, and the OnApprove action will be handled in the /confirm call.

2. Populate Dynamic Fields for Paypal
To implement this **search_filter** feature, you'll need to modify these architectural layers:


**1. API Request/Response Models**
   - `crates/api_models/src/events/payment.rs`
   - `crates/api_models/src/payments.rs`

**2. Database Layer (Queries & Schema)**
   - `crates/diesel_models/src/payment_attempt.rs`

**3. Domain Models (Business Logic Types)**
   - `crates/hyperswitch_domain_models/src/payments/payment_attempt.rs`
   - `crates/hyperswitch_domain_models/src/router_flow_types/payments.rs`
   - `crates/hyperswitch_domain_models/src/router_request_types.rs`
   - ... and 1 more files

**4. Core Business Logic**
   - `crates/router/src/core/payments.rs`
   - `crates/router/src/core/payments/connector_integration_v2_impls.rs`
   - `crates/router/src/core/payments/flows.rs`
   - ... and 6 more files

**5. External Connector Integration**
   - `crates/hyperswitch_connectors/src/default_implementations.rs`
   - `crates/hyperswitch_connectors/src/default_implementations_v2.rs`
   - `crates/router/src/connector/paypal.rs`
   - ... and 2 more files

**6. Type Definitions**
   - `crates/hyperswitch_interfaces/src/types.rs`
   - `crates/router/src/types.rs`
   - `crates/router/src/types/api/payments.rs`
   - ... and 2 more files

**7. Utils**
   - `crates/router/src/routes/lock_utils.rs`

**8. Configuration Files**
   - `crates/router/src/configs/defaults.rs`

**9. Other**
   - `api-reference-v2/openapi_spec.json`
   - `api-reference/api-reference/payments/payments--post-session-tokens.mdx`
   - `api-reference/mint.json`
   - ... and 10 more files

**Code Patterns Applied:**
- Define new data structures (5 changes)
- Implement new functions (38 changes)
- Extend existing types with new fields (308 changes)

**Detailed Identifier Changes:**


Commit f55aa78f:
Files to modify:


**crates/api_models/src/events/payment.rs**
  Modify existing code

**crates/api_models/src/payments.rs**
  Modify existing code

**crates/diesel_models/src/payment_attempt.rs**
  Modify existing code

**crates/hyperswitch_connectors/src/default_implementations.rs**
  Modify existing code

**crates/hyperswitch_connectors/src/default_implementations_v2.rs**
  Modify existing code

**crates/hyperswitch_domain_models/src/payments/payment_attempt.rs**
  Modify existing code

**crates/hyperswitch_domain_models/src/router_flow_types/payments.rs**
  Modify existing code

**crates/hyperswitch_domain_models/src/router_request_types.rs**
  Modify existing code

**crates/hyperswitch_domain_models/src/types.rs**
  Modify existing code

**crates/hyperswitch_interfaces/src/api/payments.rs**
  Modify existing code

**crates/hyperswitch_interfaces/src/api/payments_v2.rs**
  Modify existing code

**crates/hyperswitch_interfaces/src/types.rs**
  Modify existing code

**crates/openapi/src/openapi.rs**
  Modify existing code

**crates/openapi/src/routes/payments.rs**
  Modify existing code

**crates/router/src/configs/defaults.rs**
  Modify existing code

**crates/router/src/connector/paypal.rs**
  Modify existing code

**crates/router/src/connector/paypal/transformers.rs**
  Modify existing code

**crates/router/src/connector/utils.rs**
  Modify existing code

**crates/router/src/core/payments.rs**
  Modify existing code

**crates/router/src/core/payments/connector_integration_v2_impls.rs**
  Modify existing code

**crates/router/src/core/payments/flows.rs**
  Modify existing code

**crates/router/src/core/payments/flows/post_session_tokens_flow.rs**
  Modify existing code

**crates/router/src/core/payments/flows/session_flow.rs**
  Modify existing code

**crates/router/src/core/payments/operations.rs**
  Modify existing code

**crates/router/src/core/payments/operations/payment_post_session_tokens.rs**
  Modify existing code

**crates/router/src/core/payments/operations/payment_response.rs**
  Modify existing code

**crates/router/src/core/payments/transformers.rs**
  Modify existing code

**crates/router/src/routes/app.rs**
  Modify existing code

**crates/router/src/routes/lock_utils.rs**
  Modify existing code

**crates/router/src/routes/payments.rs**
  Modify existing code

**crates/router/src/services/api.rs**
  Modify existing code

**crates/router/src/services/authentication.rs**
  Modify existing code

**crates/router/src/types.rs**
  Modify existing code

**crates/router/src/types/api/payments.rs**
  Modify existing code

**crates/router/src/types/api/payments_v2.rs**
  Modify existing code

**crates/router_derive/src/macros/operation.rs**
  Modify existing code

**crates/router_env/src/logger/types.rs**
  Modify existing code
{"pr_number": 6326, "pr_title": "feat(core): add payments post_session_tokens flow", "merged_at": "2024-10-15T18:25:27Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/events/payment.rs", "crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/payment_attempt.rs"], "domain": ["crates/hyperswitch_domain_models/src/payments/payment_attempt.rs", "crates/hyperswitch_domain_models/src/router_flow_types/payments.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs", "crates/hyperswitch_domain_models/src/types.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/connector_integration_v2_impls.rs", "crates/router/src/core/payments/flows.rs", "crates/router/src/core/payments/flows/post_session_tokens_flow.rs", "crates/router/src/core/payments/flows/session_flow.rs", "crates/router/src/core/payments/operations.rs", "crates/router/src/core/payments/operations/payment_post_session_tokens.rs", "crates/router/src/core/payments/operations/payment_response.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/src/default_implementations.rs", "crates/hyperswitch_connectors/src/default_implementations_v2.rs", "crates/router/src/connector/paypal.rs", "crates/router/src/connector/paypal/transformers.rs", "crates/router/src/connector/utils.rs"], "types": ["crates/hyperswitch_interfaces/src/types.rs", "crates/router/src/types.rs", "crates/router/src/types/api/payments.rs", "crates/router/src/types/api/payments_v2.rs", "crates/router_env/src/logger/types.rs"], "utils": ["crates/router/src/routes/lock_utils.rs"], "config": ["crates/router/src/configs/defaults.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/api-reference/payments/payments--post-session-tokens.mdx", "api-reference/mint.json", "api-reference/openapi_spec.json", "crates/hyperswitch_interfaces/src/api/payments.rs", "crates/hyperswitch_interfaces/src/api/payments_v2.rs", "crates/openapi/src/openapi.rs", "crates/openapi/src/routes/payments.rs", "crates/router/src/routes/app.rs", "crates/router/src/routes/payments.rs", "crates/router/src/services/api.rs", "crates/router/src/services/authentication.rs", "crates/router_derive/src/macros/operation.rs"]}, "change_types": {"structs_added": 5, "functions_added": 38, "fields_added": 308, "imports_added": 15}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}