Skip to content

[WEB - SDK] - Centralize V2 Endpoint - Fetch Method Payments List #9315

@aritro2002

Description

@aritro2002

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

Type
refactor

Context
Currently, the Fetch Payment Method List 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 Fetch Payment Method List 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-refactorCategory: RefactorE-mediumEffort: Requires a fair amount of workhacktoberfestIssues that are up for grabs for Hacktoberfest participantsrescript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions