You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_9 (already cloned)
- Base commit: c5c0e677f2a2d43170a66330c98e0ebc4d771717
- Task ID: juspay__hyperswitch-8389
- Version: v1.114.0
TASK DESCRIPTION: Bug: [FEATURE] Kv Redis feature for V2 models
Feature Description
Extend kv support for v2 models
Possible Implementation
Use existing construct to extend to v2 models
Have you spent some time checking if this feature request has been raised before?
- I checked and didn't find a similar issue
Have you read the Contributing Guidelines?
- I have read the Contributing Guidelines
Are you willing to submit a PR?
Yes, I am willing to submit a PR!
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
#8389
- Added Kv Redis support to - payment_intent V2, payment_attempt V2 models
- Added enable Kv route for v2 merchant-account
added enable kv api for v2 merchant account
curl --location 'https://<host>/v2/merchant-accounts/:mid/kv' \ --header 'Authorization: admin-api-key=***' \ --header 'x-organization-id:***' \ --header 'Content-Type: application/json' \ --data '{"kv_enabled" : true}'Additional Changes
- This PR modifies the API contract
Assistant
I'll help you implement KV Redis support for V2 models in the hyperswitch repository. Let me start by exploring the codebase to understand the current implementation and identify what needs to be extended.
First, I'll create a plan of action for implementing this feature.
Assistant
Let me start by exploring the existing KV Redis implementation to understand how it's currently structured for V1 models.
Assistant
Now let me look for V2 model files to understand their structure:
Assistant
Let me search more broadly for V2 models:
Assistant
Let me search more specifically for V2-related files and directories:
Assistant
Let me search for API v2 directories and files:
Assistant
Let me search for merchant accounts in the codebase to understand the structure better:
Assistant
Let me examine the existing KV implementation to understand how it works:
Assistant
(no content)
Assistant
Let me check the storage implementation for KV redis:
Assistant
Now let me search for the API routes to understand how merchant accounts are handled:
Assistant
Let me check the API structure:
Assistant
Let me check for merchant account V2 API files specifically:
Assistant
Let me examine the main router to understand how the routes are organized:
Assistant
Let me check for routes that might handle merchant accounts:
Assistant
Let me look for the merchant account routes specifically:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.