Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

payment refund issue #264

Open
mesky-tech opened this issue Oct 5, 2023 · 3 comments
Open

payment refund issue #264

mesky-tech opened this issue Oct 5, 2023 · 3 comments

Comments

@mesky-tech
Copy link

in rest api its working fine but when i do call with client sdk getting this error everytime
razorpay.errors.BadRequestError: The amount must be an integer.

client.payment.refund(,{"amount": "100","speed": "optimum","receipt": "#Receipt No. 132"})

@jeromtom
Copy link

I don't think the 100 should be in quotes which makes it a string instead of an integer.
Try this client.payment.refund(,{"amount": 100,"speed": "optimum","receipt": "#Receipt No. 132"})

@NagariaHussain
Copy link

NagariaHussain commented May 2, 2024

After spending a lot of time with the same error, I found out the implementation and docs have mismatch:

Docs:
CleanShot 2024-05-02 at 12 25 35@2x

Implementation:
CleanShot 2024-05-02 at 12 24 53@2x

Since amount is not mandatory (full refund case), it makes sense to change the implementation.

@santanu2310
Copy link

Yes, there is a mismatch in the docx and code.
I already make a pull request containing the fix

you need to pass payment_id and amount as a positional argument not in the data dictionary client.payment.capture(payment_id, amount, {...})

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

No branches or pull requests

4 participants