razorpay / razorpay/razorpay-node
Getting error while initiating refund in test mode
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 243
- Forks
- 128
- PR merge metrics
- No merged PRs in 30d
Description
{
statusCode: 400,
error: {
code: 'BAD_REQUEST_ERROR',
description: 'invalid request sent',
metadata: {},
reason: 'NA',
source: 'NA',
step: 'NA'
}
}
This is the error I am getting. I have made sure the payment was captured for the paymentId also. I made 2 payment. One was made with card and other with upi and in both case I am getting the same error when trying to initiate the refund
const refund = await razorpay.payments.refund(paymentId, {
amount: refundAmount * 100,
notes: {
refundReason: "user cancelled the service",
},
receipt: "rec_1234",
});
this is refund initiation method i am using
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the test-mode call to payments.refund with the captured card and UPI payment IDs, using the request parameters shown in the issue. Check the refund API response and related repository entry points; done means identifying the cause of the BAD_REQUEST_ERROR and confirming a valid refund request or documenting the required correction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100