- fix product price auto update getting from calback in metro

- revert logs in ppob callback metro
This commit is contained in:
Fadli 2022-08-10 22:30:17 +07:00
parent 576336661a
commit eec61277c2
2 changed files with 20 additions and 32 deletions

View File

@ -79,37 +79,33 @@ export class PpobCallbackController {
console.log('statusapani2', response.toString());
if (response['status'].toString() != '20') {
console.log('masukkesiniga', 'msk');
//TODO: UPDATE GAGAL
console.log('gagal')
const updateTransaction =
console.log('transaction failed')
await this.transactionService.callbackOrderFailed(
response['refid'],
response,
);
await this.transactionService.callbackOrderFailed(
response['refid'],
response,
);
return {
updateTransaction,
statusCode: HttpStatus.BAD_REQUEST,
message: 'failed to proccess',
};
} else {
//TODO: UPDATE BERHASIL
const updateTransaction =
await this.transactionService.callbackOrderSuccess(
response['refid'],
response,
);
return {
updateTransaction,
statusCode: HttpStatus.OK,
message: 'success',
};
}
//TODO: UPDATE BERHASIL
console.log('berhasil')
const updateTransaction =
await this.transactionService.callbackOrderSuccess(
response['refid'],
response,
);
return {
updateTransaction,
statusCode: HttpStatus.OK,
message: 'success',
};
}
this.logger.log({

View File

@ -1204,14 +1204,6 @@ export class TransactionService {
relations: ['product_price'],
});
console.log(dataTransaction.product_price, 'productPrice')
const dataProductPrice = await this.productPriceRepository.findOne({
where: {
id: dataTransaction.product_price,
}
});
// const dataMsg = callback.msg;
// const failedReason = dataMsg.split('.');
@ -1239,7 +1231,7 @@ export class TransactionService {
if (callback['message'].includes('METRO')) {
if (callback['price'] != dataTransaction.product_price.price) {
console.log("mskupdt", "msk")
dataProductPrice.price = callback['price']
dataTransaction.product_price.price = callback['price'].toInt()
}
}
}
@ -1338,7 +1330,7 @@ export class TransactionService {
if(callback['message']) {
if (callback['message'].includes('METRO')) {
if (callback['price'] != dataTransaction.product_price.price) {
dataTransaction.product_price.price = callback['price']
dataTransaction.product_price.price = callback['price'].toInt()
}
}
}