Skip to content

feat(payments): forward additional params in payments.all() [closes #456] - #496

Open
gopi-701 wants to merge 1 commit into
razorpay:masterfrom
gopi-701:feat/payments-all-additional-params
Open

gopi-701 wants to merge 1 commit into
razorpay:masterfrom
gopi-701:feat/payments-all-additional-params

Conversation

@gopi-701

Copy link
Copy Markdown

Fixes #456

Problem

payments.all() does not forward additional params (like order_id, customer_id) to the underlying GET request, unlike paymentLinks.all() which already spreads ...params.

Root Cause

In lib/resources/payments.js, the data object only includes from, to, count, skip, and expand — any additional params passed by the user are silently dropped.

Solution

Spread ...params into the data object, matching the pattern already used in paymentLink.js:

data: {
  ...params,
  from,
  to,
  count,
  skip,
  expand
}

Testing

  • All 380 tests pass
  • Added new test: verifies order_id and customer_id are forwarded as query params

Notes

  • No breaking changes — existing behavior preserved, additional params now forwarded
  • Matches the pattern already established in paymentLink.js

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.

[Feature]: Allow passing additional params to payments.all method

1 participant