我正在使用 nodejs 进行 payu API 集成。在我得到如下响应的测试环境中:
{"status":-1,"rows":0,"message":"Something went Wrong guid 3hnlpif04nu9nbascn1mom27le sessionId null","result":null,"guid":"3hnlpif04nu9nbascn1mom27le","sessionId":"null","errorCode":null}
这是我的代码
let url = `https://test.payumoney.com/treasury/merchant/refundPayment`;
url = `${url}?paymentId=${paymentID}&refundAmount=${transaction["amount"]}&merchantKey=${config['PAYU_MONEY'].merchantKey}`;
logger.debug("PayuService: initiateRefund: Refund attempt url: ", { url } );
let res = await request.post(url, {
headers: {
'authorization': config['PAYU_MONEY'].authHeader,
'cache-control': 'no-cache',
'Content-Type': 'application/json'
}
})
其中,paymentID 来自 payu 交易响应“payuMoneyId”。