[WEB - SDK] - Add validation for empty clientSecret in completeUpdateIntent
#9,355 opened on Sep 11, 2025
Repository metrics
- Stars
- (42,690 stars)
- PR merge metrics
- (Avg merge 6d 22h) (213 merged PRs in 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
- Open
Hyper.res. - Add a guard in
completeUpdateIntentto check for emptyclientSecret. - If empty, exit early and do nothing.
- 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:
- Link to WebSDK documentation: WebSDK Docs
- Link to the API endpoint specifications: API Docs
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