juspay/hyperswitch

[WEB - SDK] - Centralize V2 Endpoint - Update Payment Method

Open

#9,319 opened on Sep 9, 2025

View on GitHub
 (4 comments) (0 reactions) (1 assignee)Rust (4,676 forks)batch import
C-refactorE-mediumhacktoberfestrescript

Repository metrics

Stars
 (42,690 stars)
PR merge metrics
 (Avg merge 6d 22h) (213 merged PRs in 30d)

Description

Summary
Centralize the Update Payment Method V2 endpoint by moving it from PaymentHelpersV2 into APIUtils.res under the V2 section.

Type
refactor

Context
Currently, the Update Payment Method V2 URL is hardcoded inside PaymentHelpersV2.res. To keep consistency with V1 endpoints and improve maintainability, we should move it into APIUtils.res as a centralized constant.

Starter tasks

  1. Identify the Update Payment Method V2 endpoint in PaymentHelpersV2.res.
  2. Move these URLs into APIUtils.res.
  3. Organize them under clear sections for V1 and V2 endpoints.
  4. Replace references in the original files to use the centralized constants.

Implementation hints

  • refer to generateApiUrl in APIUtils.res, follow the same logic, how it is implemented for some of the api calls.

Acceptance criteria

  • All hardcoded paths in generateApiUrl replaced by constants defined at the top of APIUtils.res.
  • Constants grouped into V1 and V2 sections for clarity.
  • No change in functionality (existing tests pass).
  • Code is cleaner and easier to extend for future endpoints.

Contribution Guidelines:

  • Fork the repository and create a new branch for your work.
  • Ensure the WebSDK follows best practices for API integration and field rendering.
  • Write clean, well-documented code with clear commit messages.
  • Add unit tests to ensure the dynamic field rendering works as expected.
  • Make sure to follow our coding standards and contribution guidelines.

Resources:

Submission Process:

  • Ask the maintainers for assignment of the issue, you can request for assignment by commenting on the issue itself.
  • Once assigned, submit a pull request (PR).
  • Maintainers will review and provide feedback, if any.
  • Maintainers can unassign issues due to inactivity, read more here.
  • For this issue, please submit a PR on @juspay/hyperswitch-web repo, and link it to the issue.

Refer here for Terms and conditions for the contest.

If you have any questions or need help getting started, feel free to ask in the comments!

Mentor contact @aritro2002 , @AbhishekChorotiya , @sakksham7

Pre-flight

  • I read the Contributing Guide and setup
  • I searched existing issues and PRs

Contributor guide