Fix double slash in customer eligibility URLs (customers//eligibility)#418
Open
vku2018 wants to merge 1 commit into
Open
Fix double slash in customer eligibility URLs (customers//eligibility)#418vku2018 wants to merge 1 commit into
vku2018 wants to merge 1 commit into
Conversation
`getEntityUrl()` returns `customers/` (with a trailing slash), but
`requestEligibilityCheck()` and `fetchEligibility()` append `/eligibility`,
producing `customers//eligibility` and `customers//eligibility/{id}`.
Every other method builds sub-resource paths as
`getEntityUrl() . $this->id . '/...'` (no leading slash), and the sibling
SDKs all target the single-slash path:
- razorpay-node: `/customers/eligibility`
- razorpay-python: `customers/eligibility`
- razorpay-go: `/v1/customers/eligibility`
Drop the leading slash so the URLs match: `customers/eligibility` and
`customers/eligibility/{id}`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Customer::getEntityUrl()returnscustomers/(trailing slash), but the two eligibility methods append/eligibilitywith a leading slash, producing a double slash:Every other method in the SDK builds sub-resource paths without a leading slash (e.g.
getEntityUrl() . $this->id . '/bank_account'), and all sibling SDKs target the single-slash path:/customers/eligibilitycustomers/eligibility/v1/customers/eligibilityOnly razorpay-php emits
customers//eligibility, which URL routers may treat as a distinct (invalid) path.Fix
Drop the leading slash so the URLs become
customers/eligibilityandcustomers/eligibility/{id}, matching the other methods and SDKs.Verification
The change is a deterministic string concatenation (
customers/+eligibility=customers/eligibility) and is cross-checked against the node/python/go SDKs above. Note: this repo's test suite makes live Razorpay API calls (requires real keys), so I was unable to run it locally — happy to adjust if you'd like it validated differently.