juspay/hyperswitch

[WEB - SDK] - Add validation for empty clientSecret in completeUpdateIntent

Open

#9.355 aberto em 11 de set. de 2025

Ver no GitHub
 (10 comments) (0 reactions) (1 assignee)Rust (4.676 forks)batch import
C-bugE-easyhacktoberfestrescript

Métricas do repositório

Stars
 (42.690 stars)
Métricas de merge de PR
 (Mesclagem média 6d 22h) (213 fundiu PRs em 30d)

Description

Summary
Update completeUpdateIntent in Hyper.res so that it does not call sessionUpdate when the provided clientSecret is empty.

Type
bug

Context
completeUpdateIntent is exposed to merchants. Sometimes merchants pass an empty clientSecret. Currently, this still calls sessionUpdate, which expects a valid secret and causes issues downstream.

The expected behavior is to simply skip calling sessionUpdate when clientSecret is empty.

Starter tasks

  1. Open Hyper.res.
  2. Add a guard in completeUpdateIntent to check for empty clientSecret.
  3. If empty, exit early and do nothing.
  4. Otherwise, continue with the existing sessionUpdate(clientSecret) flow.

Implementation hints

  • check the length of client secret or if it's equal to "".

Keep code style consistent with the rest of Hyper.res

Acceptance criteria

  • sessionUpdate is not invoked when clientSecret is empty.
  • Existing flows with a valid clientSecret are unaffected.

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

Guia do colaborador