Open profabhishekjha opened 9 months ago
We are also facing the same issue. Is anyone working on this? @projectashik
I am facing the same issue. Can anyone in Razorpay help us with this? or @profabhishekjha have you figured out any solution for this?
You can use validatePaymentVerification
function to verify payment signature. Refer to this doc
Hi @kakdeykaushik,
I have also used validatePaymentVerification
, but I could not verify the signature in the webhook response.
In the docs they have mentioned using raw requestbody (req.body) as the message to create the hash signature. In your case, you're using payload of the body
const generatedSignature = crypto
.createHmac("sha256", razorpayKeySecret)
.update(JSON.stringify(req.body)) // raw requestBody
.digest("hex");
However, even that is not working for me
Could you let me know if you managed to resolve it? @dhwaj1902 @profabhishekjha ?
Steps to reproduce the behavior
import crypto from "crypto"; import prisma from "@/utils/connect"; import { NextResponse } from "next/server";
export const POST = async (req) => { try { const body = await req.json(); const { event, payload } = body;
};
Expected behavior
it should verify signature but no , its not, please help me if anyone can
Actual behavior
its not matching both the values
Code snippets
Node version
latest
Library version
latest
Additional Information
No response