From 7dcb7d30f6107ee9cc1ed3498bc76c79218d738e Mon Sep 17 00:00:00 2001 From: Fadli Date: Wed, 19 Oct 2022 16:53:12 +0700 Subject: [PATCH] - fix trx id test for hemat --- src/helper/irs-api.ts | 3 ++- src/transaction/transaction.service.ts | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/helper/irs-api.ts b/src/helper/irs-api.ts index 0e5fa6e..063c9e6 100644 --- a/src/helper/irs-api.ts +++ b/src/helper/irs-api.ts @@ -10,6 +10,7 @@ export const doTransaction = async ( productCode, destination, idtrx, + idtrxhemat, supplier, authorization, typePaid, @@ -35,7 +36,7 @@ export const doTransaction = async ( 'Authorization': 'Bearer ' + authorization} }; const data = { - idtransaction: idtrx, + idtransaction: idtrxhemat, destination: `${destination}`, code: `${productCode}`, type: `${typePaid}`, diff --git a/src/transaction/transaction.service.ts b/src/transaction/transaction.service.ts index 59f38d8..cdb7815 100644 --- a/src/transaction/transaction.service.ts +++ b/src/transaction/transaction.service.ts @@ -605,6 +605,8 @@ export class TransactionService { }) .join(''); + const trxIdHemat = orderTransactionDto.trx_id; + let hitLoginHemat; if (supplier.code == 'Hemat') { @@ -616,6 +618,7 @@ export class TransactionService { orderTransactionDto.productCode, orderTransactionDto.destination, trxId, + trxIdHemat, supplier, hitLoginHemat.data, product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT', @@ -623,6 +626,7 @@ export class TransactionService { orderTransactionDto.productCode, orderTransactionDto.destination, trxId, + trxIdHemat, supplier, "", product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT', @@ -852,6 +856,7 @@ export class TransactionService { }) .join(''); + const trxIdHemat = orderTransactionDto.trx_id; let hitLoginHemat; if (supplier.code == 'Hemat') { @@ -863,6 +868,7 @@ export class TransactionService { orderTransactionDto.productCode, orderTransactionDto.destination, trxId, + trxIdHemat, supplier, hitLoginHemat.data, product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT', @@ -870,6 +876,7 @@ export class TransactionService { orderTransactionDto.productCode, orderTransactionDto.destination, trxId, + trxIdHemat, supplier, "", product.type == 'prepaid' ? 'PURCHASE' : 'PAYMENT', @@ -1003,7 +1010,7 @@ export class TransactionService { return Math.round(Math.random() * 16).toString(16); }) .join(''); - + const trxIdHemat = orderTransactionDto.trx_id; let status; try { @@ -1018,6 +1025,7 @@ export class TransactionService { orderTransactionDto.productCode, orderTransactionDto.destination, trxId, + trxIdHemat, supplier, hitLoginHemat.data, 'INQUIRY' @@ -1025,6 +1033,7 @@ export class TransactionService { `CEK${orderTransactionDto.productCode.slice(3)}`, orderTransactionDto.destination, trxId, + trxIdHemat, supplier, "", 'INQUIRY'