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_3 (already cloned)
- Base commit: 06c5215c0edf0ed47cc55fd5216c4642cc515f37
- Task ID: juspay__hyperswitch-8216
- Version: v1.114.0
TASK DESCRIPTION: Bug: chore: Update apple pay currency filter configs
Update apple pay currency filter configs as a temporary fix for failing PR #7921
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
Apple pay payments for noon were failing due to PR#7921. Adding AED to the currency list for apple pay is a temporary fix for this failure.
Additional Changes
- This PR modifies the API contract
- This PR modifies the database schema
- This PR modifies application configuration/environment variables
Motivation and Context
Closes #8216
How did you test it?
Checklist
- I formatted the code
cargo +nightly fmt --all - I addressed lints thrown by
cargo clippy - I reviewed the submitted code
- I added unit tests for my changes where possible
CRITICAL INSTRUCTIONS - WORK FAST AND EFFICIENTLY:
-
Create DENSE, ACTION-FOCUSED todos IMMEDIATELY
Assistant
I'll help you implement the fix for the Apple Pay currency filter configurations. Let me start by creating a clear plan and then examine the relevant files to understand the issue.
Assistant
I'll start by exploring the codebase to find Apple Pay related configurations and understand the issue with PR #7921. Let me search for Apple Pay related files first.
Assistant
Let me also search for currency filter configurations:
Assistant
Let me search more specifically for Apple Pay currency configurations:
Assistant
Let me search for configuration files that might contain Apple Pay settings:
Assistant
Now let me look at the router configs directory specifically:
Assistant
Let me examine the payment method filters configuration to understand the Apple Pay currency filter structure:
Assistant
Let me check for any references to AED in the codebase as mentioned in the task:
Assistant
Let me look at the issue referenced in the task. Since we need to understand what PR #7921 changed, let's search for any references to that PR or recent changes related to Apple Pay and Noon connector:
Assistant
Let me check the current git status and examine what files we need to work on:
Assistant
Let me examine the gsm.rs file that's currently modified to understand what might have changed:
Assistant
Let me look at the git log to better understand what changed recently in relation to Apple Pay and Noon:
Assistant
Let me search for payment method filters configurations more specifically and also search for noon-related code:
Assistant
Now let's check what configuration files might contain the payment method filters:
Assistant
Let's examine the config files to look for payment method filters:
Assistant
(no content)
Assistant
Let me examine the payment required fields file as that might contain relevant configuration:
Assistant
Let me look at what's already in the current file to understand the structure, and then focus on finding the Apple Pay filter configurations:
Assistant
Let me search for any config file that might contain currency filter definitions for Apple Pay:
Assistant
Let me search for any configuration that has a section containing payment method filters or connector filters:
Assistant
Let me search more broadly for any config sections that may contain currency filters:
Assistant
Let me look at the structure of how payment methods are defined in the router code to better understand where Apple Pay configurations might be stored:
Assistant
Based on the code I've reviewed, I understand that the Apple Pay currency filter configurations are likely defined in the TOML config files. Let me approach this differently - looking at the actual connector configurations and how Apple Pay is implemented.
Looking at the task description again, I need to understand where Apple Pay currency filters are defined. From what I can see in the settings.rs file, the configuration structure supports payment method filters through the
ConnectorFiltersstruct which is aHashMap<String, PaymentMethodFilters>.Let me check what PR #7921 was about and make educated guesses about where the configuration might be located. Let me now proceed to actually implement the fix by looking at a couple more areas and making an educated fix.
Assistant
Looking at the structure in
settings.rs, I can see thatConnectorFiltersis defined asHashMap<String, PaymentMethodFilters>. Let me now look at how this might be configured in practice, focusing on Apple Pay specifically.Based on the structure of the configuration, I believe the issue is likely in the configuration files, specifically looking for where
applepayor similar keys might define currency filters. Rather than searching endlessly, let me examine the most likely location where such configurations are defined in the config files and add the fix directly.Since I can see the configuration structure is quite complex and I've identified the core elements, I'm going to make the fix based on understanding that the Apple Pay filters are likely defined somewhere in the config files. Let me proceed to create a fix that adds AED to the Apple Pay currency filter.
First, let me look for a simpler way to identify where the Apple Pay filters are likely defined by examining how other payment methods have their filters defined in the sample config:
Assistant
Perfect! Now I can see the configuration structure. I found the Apple Pay currency filter configuration on line 302 in the
[pm_filters.default]section. This is exactly what I need to modify to add AED (United Arab Emirates Dirham) to the list of supported currencies for Apple Pay.Let me also look at line 500 which shows the Apple Pay connector list. Let me continue with the task now that I've found the relevant configuration.
Assistant
Now I need to edit the configuration file to add AED to the Apple Pay currency list. Let me do that:
Assistant
It seems like I need to make the actual change - I see that AED is already in the list. Let me look more closely at the exact line to make sure I understand what's happening.
Looking at the line:
apple_pay = { country = "AU,CN,HK,JP,MO,MY,NZ,SG,TW,AM,AT,AZ,BY,BE,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GR,GL,GG,HU,IS,IE,IM,IT,KZ,JE,LV,LI,LT,LU,MT,MD,MC,ME,NL,NO,PL,PT,RO,SM,RS,SK,SI,ES,SE,CH,UA,GB,AR,CO,CR,BR,MX,PE,BH,IL,JO,KW,PS,QA,SA,AE,CA,UM,US,KR,VN,MA,ZA,VA,CL,SV,GT,HN,PA", currency = "AED,AUD,CHF,CAD,EUR,GBP,HKD,SGD,USD" }AED is already in the currency list. However, the task states that this is a temporary fix for failing PR #7921 where Apple Pay payments for Noon were failing. It's possible that the configuration should be more explicit or there's a specific issue with the Noon connector.
Let me search more specifically for how the connector filters are used and how this might affect the Noon connector:
Assistant
Wait, let me carefully look at the problem statement again. The issue mentions "Apple pay payments for noon were failing due to PR#7921". Let me look more carefully at the Noon connector settings in the config to understand how the filters might interact:
Assistant
I notice that the task says to update the Apple Pay currency filter configs "as a temporary fix for failing PR #7921" and mentions "Apple pay payments for noon were failing".
However, in the current configuration, AED is already included in the Apple Pay currency list. Let me examine this differently. Perhaps the issue is more subtle - let me see if there are other places where the filter might be defined that we need to update.
Looking at the structure, I see there are specific connector-level filters defined for Stripe and others. The issue may be that while AED is included in the default filters, maybe there's a more specific filter that overrides it for certain connectors.
However, since I've already confirmed that AED is present in the default apple_pay currency list and I cannot find a more specific issue, I'm going to proceed with a targeted fix. Let me just double-check and make a note about my findings in the configuration.
Let me try another approach - I'll also examine the current working file that has been modified (gsm.rs) to see if I can better understand the context:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.