china union pay push trader and query order by nodejs. complete push,query and async pay notice;
var appInfo = {
merId: "xxx",
secret_key: "xxx",
tradeAdd: "xxx",
queryAdd: "xxx",
backEndUrl: "xx"
};
var unionPay = new UnionPay(appInfo);
var now = new Date();
var orderNo = '1234567890';
var orderAmount = 100;
unionPay.pushTrade(orderNo, orderAmount, now, 'test').then(function (data) {
xxxx
}).catch(function (err) {
xxx
}).finally(function () {
xxx
})
unionPay.queryTrade(orderNo, now).then(function (data) {
xxx
}).catch(function (err) {
xxx
}).finally(function () {
xxx
})
//server pay notice key,value object
unionPay.payNotice({key: value}).then(function (data) {
xxx
}).catch(function (err) {
xxx
}).finally(function () {
xxx
})
MIT