Skip to content

docs(payment): fix method signature mismatches in payment.md - #351

Open
Sreejith088 wants to merge 1 commit into
razorpay:masterfrom
Sreejith088:fix/payment-capture-docs
Open

Sreejith088 wants to merge 1 commit into
razorpay:masterfrom
Sreejith088:fix/payment-capture-docs

Conversation

@Sreejith088

Copy link
Copy Markdown

Summary

Closes #79

Two mismatches found between documents/payment.md and the actual implementation in razorpay/resources/payment.py:

1. capture() — wrong call signature in docs

The docs showed:

client.payment.capture(paymentId, {"amount": 1000, "currency": "INR"})

But the actual implementation signature is:

def capture(self, payment_id, amount, data={}, **kwargs):

amount is a required positional integer, not a key inside the dict. Calling the docs version would pass the dict as amount, then data would be the empty default — sending a POST with no body.

Corrected to:

client.payment.capture(paymentId, amount, {"currency": "INR"})

2. fetchDownTimeById() — wrong method name in docs

The docs referred to fetchPaymentDowntimeById(), which does not exist on the Payment class. The actual method is fetchDownTimeById(). Corrected.

Test plan

  • Documentation-only change; all 157 existing tests pass (no code changed)

Closes razorpay#79

Two mismatches between documents/payment.md and the actual
implementation in razorpay/resources/payment.py:

1. capture() — docs showed:
     client.payment.capture(paymentId, {"amount": 1000, "currency": "INR"})
   but the implementation signature is capture(payment_id, amount, data={}),
   where amount is a required positional integer, not a key inside the dict.
   Corrected to:
     client.payment.capture(paymentId, amount, {"currency": "INR"})

2. fetchDownTimeById() — docs referred to the method as
   fetchPaymentDowntimeById, which does not exist. Corrected to match
   the actual method name fetchDownTimeById.
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.

Mismatch in Documentation and implementation

1 participant