Skip to content

Fix double slash in customer eligibility URLs (customers//eligibility)#418

Open
vku2018 wants to merge 1 commit into
razorpay:masterfrom
vku2018:fix/eligibility-double-slash-url
Open

Fix double slash in customer eligibility URLs (customers//eligibility)#418
vku2018 wants to merge 1 commit into
razorpay:masterfrom
vku2018:fix/eligibility-double-slash-url

Conversation

@vku2018

@vku2018 vku2018 commented Jul 3, 2026

Copy link
Copy Markdown

Summary

Customer::getEntityUrl() returns customers/ (trailing slash), but the two eligibility methods append /eligibility with a leading slash, producing a double slash:

$this->getEntityUrl() . '/eligibility'       // => customers//eligibility
$this->getEntityUrl() . '/eligibility/' . $id // => customers//eligibility/{id}

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:

SDK URL
razorpay-node /customers/eligibility
razorpay-python customers/eligibility
razorpay-go /v1/customers/eligibility

Only 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/eligibility and customers/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.

`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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant