juspay/hyperswitch

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

Open

#9,355 创建于 2025年9月11日

在 GitHub 查看
 (10 评论) (0 反应) (1 负责人)Rust (4,676 fork)batch import
C-bugE-easyhacktoberfestrescript

仓库指标

Star
 (42,690 star)
PR 合并指标
 (平均合并 6天 22小时) (30 天内合并 213 个 PR)

描述

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

贡献者指南