NextJs on Response
/api/payment/response
app.post("/callback", paytm.CallBack, (req, res) => {
console.log(req.body);
// write your own code
res.end();
});
Output
Output, if transaction is Unsuccessful
body: {
resultInfo: {
resultStatus: "TXN_SUCCESS";
resultCode: "01";
resultMsg: "Txn is successful";
};
txnId: string;
bankTxnId: string;
orderId: string;
txnAmount: string;
txnType: string;
gatewayName: string;
bankName: string;
mid: string;
paymentMode: string;
txnDate: string;
};
Output, if transaction is successful
body: {
resultInfo: {
resultStatus: "TXN_FAIL";
resultCode: "Failed Code";
resultMsg: "Message";
};
txnId: string;
orderId: string;
txnAmount: string;
mid: string;
txnDate: string;
};