This is my backend code build using nestJs framework.
transferOrder = async (amount: number): Promise<any> => {
const razorpayInstance = new Razorpay({ key_id: process.env.LIVE_PAYMENT_KEY_ID, key_secret: process.env.LIVE_PAYMENT_KEY_SECRET });
try {
return await razorpayInstance.payments.fetch({
id: "pay_IWasxxxxxNeRmo",
transfers: {
id: "pay_IWasWEFzoNeRmo",
account: "acc_HjRGxxxxxI0jI",
amount: amount,
currency: "INR",
notes: {
name: "Gaurav Kumar",
roll_no: "IEC2011025"
},
linked_account_notes: [
"branch"
],
on_hold: 0,
}
})
} catch (error) {
if (error) {
console.log(error);
throw error;
}
}
When I excecute this code am getting an error. I am not sure if am passing the payment_id correctly or not but I tried everthing possible but still getting the same error.
The error I am getting
{
statusCode: 400,
error: {
code: 'BAD_REQUEST_ERROR',
description: 'The id provided does not exist',
source: 'business',
step: 'payment_initiation',
reason: 'input_validation_failed',
metadata: {}
}
}
Please help me to fix the issue