From b33fa4c9c60837f7de7fb1f19237b8e41d4d1e08 Mon Sep 17 00:00:00 2001 From: ilham Date: Sat, 21 May 2022 18:32:56 +0700 Subject: [PATCH] fixing: callback transaction --- src/transaction/ppob_callback.controller.ts | 7 +++---- src/transaction/transaction.service.ts | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/transaction/ppob_callback.controller.ts b/src/transaction/ppob_callback.controller.ts index 70b1969..8d0fedf 100644 --- a/src/transaction/ppob_callback.controller.ts +++ b/src/transaction/ppob_callback.controller.ts @@ -67,13 +67,12 @@ export class PpobCallbackController { }; } - const splitMessage = response['message'].split('","'); - + const splitMessage = response['message'].split('"'); //TODO: UPDATE BERHASIL await this.transactionService.updateBill( response['refid'], - splitMessage[3].replace(/^\D+/g, ''), - splitMessage[4].replace(/^\D+/g, ''), + Number(splitMessage[9].replace(/^\D+/g, '')), + Number(splitMessage[11].replace(/^\D+/g, '')), true ); // diff --git a/src/transaction/transaction.service.ts b/src/transaction/transaction.service.ts index 3bcd63e..42e7a4e 100644 --- a/src/transaction/transaction.service.ts +++ b/src/transaction/transaction.service.ts @@ -1815,7 +1815,7 @@ export class TransactionService { status: boolean, ) { const billData = await this.findOneBillById(trxId); - + console.log(billData,"ini dia") const userData = await this.userService.findExist(billData.user); const product_price = await this.productHistoryPriceService.findById( @@ -1855,6 +1855,7 @@ export class TransactionService { async findOneBillById(trxId: string) { try { return await this.checkBillHistoryRepository.findOneOrFail({ + relations: ['product_price'], where: { trx_id: trxId, },