- fix product price auto update getting from calback in metro
- revert logs in ppob callback metro
This commit is contained in:
parent
576336661a
commit
eec61277c2
|
@ -79,37 +79,33 @@ export class PpobCallbackController {
|
||||||
console.log('statusapani2', response.toString());
|
console.log('statusapani2', response.toString());
|
||||||
|
|
||||||
if (response['status'].toString() != '20') {
|
if (response['status'].toString() != '20') {
|
||||||
console.log('masukkesiniga', 'msk');
|
|
||||||
|
|
||||||
//TODO: UPDATE GAGAL
|
//TODO: UPDATE GAGAL
|
||||||
console.log('gagal')
|
|
||||||
const updateTransaction =
|
const updateTransaction =
|
||||||
console.log('transaction failed')
|
await this.transactionService.callbackOrderFailed(
|
||||||
await this.transactionService.callbackOrderFailed(
|
response['refid'],
|
||||||
response['refid'],
|
response,
|
||||||
response,
|
);
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
updateTransaction,
|
updateTransaction,
|
||||||
statusCode: HttpStatus.BAD_REQUEST,
|
statusCode: HttpStatus.BAD_REQUEST,
|
||||||
message: 'failed to proccess',
|
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({
|
this.logger.log({
|
||||||
|
|
|
@ -1204,14 +1204,6 @@ export class TransactionService {
|
||||||
relations: ['product_price'],
|
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 dataMsg = callback.msg;
|
||||||
// const failedReason = dataMsg.split('.');
|
// const failedReason = dataMsg.split('.');
|
||||||
|
|
||||||
|
@ -1239,7 +1231,7 @@ export class TransactionService {
|
||||||
if (callback['message'].includes('METRO')) {
|
if (callback['message'].includes('METRO')) {
|
||||||
if (callback['price'] != dataTransaction.product_price.price) {
|
if (callback['price'] != dataTransaction.product_price.price) {
|
||||||
console.log("mskupdt", "msk")
|
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']) {
|
||||||
if (callback['message'].includes('METRO')) {
|
if (callback['message'].includes('METRO')) {
|
||||||
if (callback['price'] != dataTransaction.product_price.price) {
|
if (callback['price'] != dataTransaction.product_price.price) {
|
||||||
dataTransaction.product_price.price = callback['price']
|
dataTransaction.product_price.price = callback['price'].toInt()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user