I am adding a payment gateway on my Strapi and Next.JS website using Razorpay. I have successfully added the payment procedure and everything is working. Now I want to check if payment is successfully done or not using Razorpay webhook. I am trying like this:-
async verification(ctx) {
try {
ctx.send(200);
console.log(ctx.request.body);
} catch {
error;
}
},
The function is in strapi's createCoreController. My custom.js file in routes foelder is:-
module.exports = {
routes: [
{
method: "POST",
path: "/orders/verification",
handler: "custom.verification",
},
],
};
Because we can't use Razorpay's webhook in localhost, I have tunneled my localhost using ngrok and put the URL of ngrok in webhook. I am getting no request by webhook and even I can't make a request on the URL of ngrok, although I can on my localhost. Please help.