<!-- Describe your changes in detail -->
Whenever a customer makes an Applepay payment a unique network token called a DPAN (Device Primary Account Number) is created and stored securely on the customer’s Apple device. This token acts as the payment information for all purchases and keeps the raw card number safe from bad actors.

However, Apple Pay’s DPAN (Device Primary Account Number) may not be ideal for all subscription businesses, because it can result in involuntary churn.

Visa is making enhancements to network tokens to ensure their continued compatibility with follow-on transactions. Due to these changes, there is impact to a few use cases for Apple Pay recurring transactions. [Beginning July 30th, 2025, the current device generated Apple Pay network tokens will no longer be applicable for Standing Instruction transactions](https://support.visaacceptance.com/knowledgebase/knowledgearticle/?code=KA-04318). Standing Instruction use cases constitute recurring, installments, or unscheduled credential on file token usages.

In order to add support apple pay MPAN recurring object needs to be passed to apple pay in the /sessions call.

This adds supports to accept the `ApplePayRecurringPaymentRequest` in the `FeatureMetadata` for the payment request. Based the request details passed the appropriate recurring details will be displayed in the apple pay modal during the customer authentication.
To implement this **search_filter** feature, you'll need to modify these architectural layers:


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

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

**3. Domain Models (Business Logic Types)**
   - `crates/hyperswitch_domain_models/src/lib.rs`
   - `crates/hyperswitch_domain_models/src/router_request_types.rs`

**4. Core Business Logic**
   - `crates/router/src/core/payments.rs`
   - `crates/router/src/core/payments/flows/session_flow.rs`
   - `crates/router/src/core/payments/transformers.rs`

**5. External Connector Integration**
   - `crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs`
   - `crates/router/src/connector/payme/transformers.rs`
   - `crates/router/src/connector/trustpay/transformers.rs`

**6. Other**
   - `api-reference-v2/openapi_spec.json`
   - `api-reference/openapi_spec.json`
   - `crates/openapi/src/openapi.rs`
   - ... and 1 more files

**Code Patterns Applied:**
- Define new data structures (6 changes)
- Implement new functions (10 changes)
- Extend existing types with new fields (85 changes)

**Detailed Identifier Changes:**


Commit 60742499:
Files to modify:


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

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

**crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs**
  Modify existing code

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

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

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

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

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

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

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

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

**crates/router/src/core/payments/transformers.rs**
  Modify existing code
{"pr_number": 6770, "pr_title": "feat(payment_methods): add support to pass apple pay recurring details to obtain apple pay merchant token", "merged_at": "2024-12-19T13:32:20Z", "intent": {"feature_type": "search_filter", "action": "add_feature", "entities": ["customer", "payment", "merchant"]}, "hierarchy": {"api_models": ["crates/api_models/src/payments.rs"], "database": ["crates/diesel_models/src/types.rs"], "domain": ["crates/hyperswitch_domain_models/src/lib.rs", "crates/hyperswitch_domain_models/src/router_request_types.rs"], "core_business": ["crates/router/src/core/payments.rs", "crates/router/src/core/payments/flows/session_flow.rs", "crates/router/src/core/payments/transformers.rs"], "connectors": ["crates/hyperswitch_connectors/src/connectors/bluesnap/transformers.rs", "crates/router/src/connector/payme/transformers.rs", "crates/router/src/connector/trustpay/transformers.rs"], "other": ["api-reference-v2/openapi_spec.json", "api-reference/openapi_spec.json", "crates/openapi/src/openapi.rs", "crates/openapi/src/openapi_v2.rs"]}, "change_types": {"structs_added": 6, "functions_added": 10, "enums_added": 3, "fields_added": 85, "imports_added": 1}, "has_identifier_data": true, "commits_matched": 1, "match_method": "pr_number"}