Skip to content

Conversation

@susrithasabbini
Copy link
Contributor

@susrithasabbini susrithasabbini commented Jan 22, 2026

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Fix validation logic for multi-currency auth key configuration.

Each currency configuration contains:

  • api_key (required)
  • processing_account_id (optional)

Previously, the Proceed button was enabled even when the request payload was invalid.
For example, if api_key was filled in one currency and only processing_account_id
(optional field) was filled in another currency, the button was enabled, which should
not be allowed.

The Proceed button should be enabled only when the request dictionary is valid.

Validation rules

  • If any optional field is filled for a currency, all required fields for that
    currency must also be filled
  • The request is considered valid only if at least one required field is filled
    across all currencies
  • If nothing is filled for any currency, the request is invalid

Scenarios

Scenario Result
Nothing filled anywhere false
Required filled in any country true
Optional filled but required missing false
Required + optional true

Motivation and Context

Fixes: https://github.com/juspay/hyperswitch-cloud/issues/14135

This change ensures that invalid payloads are not allowed to proceed and that
currency-wise validation is enforced correctly.


How did you test it?

Tested locally by validating different combinations of required and optional
fields across multiple currencies.

Screen.Recording.2026-01-22.at.3.50.24.PM.mov

Where to test it?

  • INTEG
  • SANDBOX
  • PROD

Checklist

  • I ran npm run re:build
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@susrithasabbini susrithasabbini self-assigned this Jan 22, 2026
@susrithasabbini susrithasabbini requested a review from a team as a code owner January 22, 2026 10:22
@susrithasabbini susrithasabbini added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed C-bug Category: Bug labels Jan 22, 2026
@semanticdiff-com
Copy link

Review changes with  SemanticDiff

VenuMadhav2541
VenuMadhav2541 previously approved these changes Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants