Merge branch 'development' into 'devops-staging'
Development See merge request empatnusabangsa/ppob/ppob-backend!199
This commit is contained in:
commit
648c0eac1c
|
@ -22,7 +22,7 @@ import {ProductHistoryPrice} from "../product/entities/product-history-price.ent
|
|||
Transactions,
|
||||
CheckBillHistory,
|
||||
CallbackPartner,
|
||||
// ProductHistoryPrice,
|
||||
ProductHistoryPrice,
|
||||
]),
|
||||
ProductModule,
|
||||
ConfigurableModule,
|
||||
|
|
|
@ -35,8 +35,8 @@ export class TransactionService {
|
|||
private transactionRepository: Repository<Transactions>,
|
||||
@InjectRepository(TransactionJournal)
|
||||
private transactionJournalRepository: Repository<TransactionJournal>,
|
||||
// @InjectRepository(ProductHistoryPrice)
|
||||
// private productPriceRepository: Repository<ProductHistoryPrice>,
|
||||
@InjectRepository(ProductHistoryPrice)
|
||||
private productPriceRepository: Repository<ProductHistoryPrice>,
|
||||
@InjectRepository(COA)
|
||||
private coaRepository: Repository<COA>,
|
||||
@InjectRepository(CheckBillHistory)
|
||||
|
@ -1204,11 +1204,13 @@ export class TransactionService {
|
|||
relations: ['product_price'],
|
||||
});
|
||||
|
||||
// const dataProductPrice = await this.productPriceRepository.findOne({
|
||||
// where: {
|
||||
// id:dataTransaction.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('.');
|
||||
|
@ -1231,15 +1233,13 @@ export class TransactionService {
|
|||
dataTransaction.callback_json = callback;
|
||||
dataTransaction.failed_reason = `Trx ${product.code} ke ${dataTransaction.destination} gagal`;
|
||||
|
||||
// console.log("inipricetable", dataTransaction.product_price.price)
|
||||
// console.log("inipricecallback", callback['price'])
|
||||
console.log("inipricetable", dataTransaction.product_price.price)
|
||||
console.log("inipricecallback", callback['price'])
|
||||
if(callback['message']) {
|
||||
if (callback['message'].includes('METRO')) {
|
||||
if (callback['price'] != dataTransaction.product_price.price) {
|
||||
console.log("inipricetable", dataTransaction.product_price.price)
|
||||
console.log("inipricecallback", callback['price'])
|
||||
console.log("mskupdt", "msk")
|
||||
dataTransaction.product_price.price = callback['price']
|
||||
dataProductPrice.price = callback['price']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1481,14 +1481,26 @@ export class TransactionService {
|
|||
coaType.WALLET,
|
||||
);
|
||||
|
||||
if (!partnerData.callback_url) {
|
||||
this.logger.error(`Call to partner failed, reason: no callback url`);
|
||||
return false;
|
||||
}
|
||||
|
||||
const url = `${partnerData.callback_url}?status=${status}&memberID=${partnerData.code}&trxid=${trxId}&harga=${harga}&product=${productCode}&dest=${destination}&seriNumber=${seriNumber}&message=${message}&saldo=${coaAccount.amount}`;
|
||||
const result = await this.callbackPartnerRepository.insert({
|
||||
partner_trx_id: partnerId,
|
||||
trx_id: trxId,
|
||||
url: url,
|
||||
});
|
||||
const res = await axios.get(url);
|
||||
return res;
|
||||
|
||||
try {
|
||||
const res = await axios.get(url);
|
||||
|
||||
return res;
|
||||
} catch (e) {
|
||||
this.logger.error(`Call to partner failed, reason: ${e.message}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
async rollbackJurnal(trxId: string[]) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user