Commit f6677b87 authored by 何娜's avatar 何娜

taxh5 通知优化

parent 22dec9f0
Pipeline #6360 passed with stage
in 6 seconds
......@@ -125,28 +125,33 @@ class PartnerService extends Service {
async notice(order) {
const { ctx } = this;
ctx.logger.info(`【Partner】 notice into`);
const { orderId, notifyUrl, userId, notice } = order;
if (notifyUrl && notice !== '1') {
const ret = await ctx.curl(notifyUrl, {
charset: 'utf-8',
timeout: ['30s', '30s'],
contentType: 'json',
method: 'POST',
data: {
orderId,
userId,
status: 'success'
},
}
);
ctx.logger.info(`【Partner】 notice ${notifyUrl}`, 'orderId:', orderId, 'result:', ret.status, JSON.stringify(ret.data));
if (ret.status == 200) {
await order.update({ notice: 1 });
}else{
await order.update({ notice: ret.status });
}
const { orderId, notifyUrl, userId } = order;
if (notifyUrl) {
try{
const ret = await ctx.curl(notifyUrl, {
charset: 'utf-8',
timeout: ['30s', '30s'],
contentType: 'json',
method: 'POST',
data: {
orderId,
userId,
status: 'success'
},
}
);
ctx.logger.info(`【Partner】 notice ${notifyUrl}`, 'orderId:', orderId, 'result:', ret.status, JSON.stringify(ret.data));
if (ret.status == 200) {
await order.update({ notice: 1 });
}else{
await order.update({ notice: ret.status });
}
}catch (e) {
ctx.logger.info(`【Partner】 notice err ${e}`)
}finally {
return
}
}
return
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment