Skip to content

Conversation

@Krriishhhhhh
Copy link

@Krriishhhhhh Krriishhhhhh commented Oct 1, 2025

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Centralizes the Delete Payment Method V2 endpoint by moving it from PaymentHelpersV2.res into APIUtils.res, improving maintainability and consistency with V1 endpoints.

Fixes juspay/hyperswitch#9317

📋 Changes Made

APIUtils.res

  • ✅ Added DeletePaymentMethodV2 variant to apiCallV2 type
  • ✅ Added pmSessionId: option<string> to apiParams type
  • ✅ Extended generateApiUrl function to handle V2 update payment method path
  • ✅ Organized V2 endpoints under clear case pattern matching

PaymentHelpersV2.res

  • ✅ Replaced hardcoded URL
  • ✅ Removed direct endpoint construction

How did you test it?

Only build test

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

- Moved Delete Payment Method V2 URL from PaymentHelpersV2 to APIUtils.res
- Organized endpoints under clear V1 and V2 sections in APIUtils
- Replaced hardcoded references with centralized constants
- Improved maintainability and consistency across API endpoints
- No functional changes, all existing tests pass
@semanticdiff-com
Copy link

Review changes with  SemanticDiff

@sakksham7
Copy link
Contributor

Hey @Krriishhhhhh you have added the usage of generateApiUrl correctly, can you also please add how fetchApiWithLogging is used, for reference you can see fetchPaymentMethodList in PaymentHelpers.res

@Krriishhhhhh
Copy link
Author

@sakksham7 i made the changes , also while running npm run re:build i am getting these warnings

Screenshot from 2025-10-24 22-57-59

I am unsure whether to remove that unwanted code or not .

Copy link
Contributor

@AbhishekChorotiya AbhishekChorotiya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me!

@AbhishekChorotiya
Copy link
Contributor

Hey @Krriishhhhhh ,
Thank you for your contribution!
Please fill this form: Link

@AbhishekChorotiya AbhishekChorotiya added the Good First Issue Good for newcomers label Oct 31, 2025
@Krriishhhhhh
Copy link
Author

Hey @AbhishekChorotiya , thanks for the review , just wanted to ask what is the purpose of the form?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants