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_6 (already cloned)
- Base commit: 5730ddfc8893017f40a5f5a8c1b7f099cc0d22a9
- Task ID: juspay__hyperswitch-7748
- Version: v1.113.0
TASK DESCRIPTION: Bug: Add checks around Cypress mandates payments
Just verifying the payment method status isn't enough. We also need to verify the existence of connector mandate id. this can be done by updating the
mitusingpmidcommand.DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
This PR adds a check to verify if the
payment_statusis not any ofsucceeded,partially_capturedorrequires_captureand if so, then theconnector_mandate_idshould benull.Additional Changes
- This PR modifies the API contract
- This PR modifies the database schema
- This PR modifies application configuration/environment variables
Motivation and Context
Verifying PM status isn't enough. We also need to check the existence of connector mandate id.
Closes #7748
How did you test it?
CI should pass.
Also:
CIT confirm, we should get
connector_mandate_idMIT confirm, in NTID flow,
connector_mandate_idwill benullChecklist
- I formatted the code
Assistant
I'll work on adding checks around Cypress mandates payments to verify the existence of connector mandate ID. Let me start by understanding the current implementation and locating the relevant files.
Assistant
I'll start by searching for files related to the
mitusingpmidcommand and mandate handling to understand the current implementation.Assistant
Let me search more broadly for mandate-related code and payment method status checking:
Assistant
Let me search for files related to mandate handling and payment methods:
Assistant
Let me look specifically at mandate-related files and payment confirmation logic:
Assistant
Let me also look at the payment confirm logic where the issue likely resides:
Assistant
Now let me check the helpers file to understand how mandate verification currently works:
Assistant
Let me continue reading the helpers file to find mandate-related functions:
Assistant
(no content)
Assistant
Let me look for the specific function
validate_payment_status_against_not_allowed_statusesto understand how payment status is checked:Assistant
(no content)
Assistant
Let me search for this function more broadly:
Assistant
Let me look in the payment confirm file to find the relevant validation logic:
Assistant
Let me check the actual implementation of
validate_payment_status_against_not_allowed_statusesfunction:Assistant
Let me look in the helpers file directly to see if I can find the validation function:
Assistant
Let me look for the exact validation function in the file using grep with the full function signature:
Assistant
Now let me read that function:
Assistant
Let me now examine what the problem is with the current implementation by checking the issue description again and looking at what happens with payment statuses and connector_mandate_id:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.