1
This commit is contained in:
parent
c494e2fa64
commit
7ea7e6154b
@ -118,7 +118,11 @@ class BoxOrder {
|
||||
const doSync = async () => {
|
||||
let result = null;
|
||||
try {
|
||||
dblog.addLog('order.sync', 'prepare', this.getOrderId(), utils.jsonEncode(this.getOrderDb()));
|
||||
dblog.addLog(
|
||||
'order.sync',
|
||||
'prepare',
|
||||
this.getOrderId(),
|
||||
utils.jsonEncode(this.getOrderDb()));
|
||||
result = await bc.mallInstance.methods.payForBoxWithSignature(
|
||||
this.orderDb['order_id'],
|
||||
this.orderDb['type'],
|
||||
@ -127,12 +131,19 @@ class BoxOrder {
|
||||
this.orderDb['payment_token_address'],
|
||||
this.orderDb['nonce'],
|
||||
this.orderDb['signature']).send({gas: 1000000});
|
||||
dblog.addLog('order.sync', 'success',
|
||||
this.getOrderId(),
|
||||
utils.jsonEncode(this.getOrderDb()),
|
||||
utils.jsonEncode(result));
|
||||
dblog.addLog(
|
||||
'order.sync',
|
||||
'success',
|
||||
this.getOrderId(),
|
||||
utils.jsonEncode(this.getOrderDb()),
|
||||
utils.jsonEncode(result));
|
||||
} catch (err) {
|
||||
dblog.addLog('order.sync', 'failed', this.getOrderId(), utils.jsonEncode(this.getOrderDb()), err);
|
||||
dblog.addLog(
|
||||
'order.sync',
|
||||
'failed',
|
||||
this.getOrderId(),
|
||||
utils.jsonEncode(this.getOrderDb()),
|
||||
err);
|
||||
await this.updateDbMustBeSuccess(
|
||||
logClass,
|
||||
[
|
||||
|
@ -57,7 +57,7 @@ function execQuery(sql, params) {
|
||||
});
|
||||
}
|
||||
|
||||
async function execOneQuery(sql, params) {
|
||||
async function execQueryOne(sql, params) {
|
||||
const {err, rows} = await execQuery(sql, params);
|
||||
return {
|
||||
'err': err,
|
||||
@ -71,5 +71,5 @@ async function execScript(sql, params) {
|
||||
}
|
||||
|
||||
exports.execQuery = execQuery;
|
||||
exports.execOneQuery = execOneQuery;
|
||||
exports.execQueryOne = execQueryOne;
|
||||
exports.execScript = execScript;
|
||||
|
@ -24,7 +24,7 @@ class OrderMgr {
|
||||
}
|
||||
|
||||
async start() {
|
||||
const {err, row} = await db.execOneQuery(
|
||||
const {err, row} = await db.execQueryOne(
|
||||
'SELECT max(idx) max_idx FROM t_box_order', []);
|
||||
if (err) {
|
||||
throw err;
|
||||
|
Loading…
x
Reference in New Issue
Block a user