Merge pull request 'feat: fixed midtrans' (#72) from fix/bug-firman into development
continuous-integration/drone/tag Build is passing Details

Reviewed-on: #72
fix/bug-firman 20.1.38-alpha.1
firmanr 2024-08-12 12:51:36 +00:00
commit 3678353f34
1 changed files with 0 additions and 10 deletions

View File

@ -11,7 +11,6 @@ import { TransactionChangeStatusEvent } from '../../entities/event/transaction-c
import * as _ from 'lodash'; import * as _ from 'lodash';
import { TABLE_NAME } from 'src/core/strings/constants/table.constants'; import { TABLE_NAME } from 'src/core/strings/constants/table.constants';
import { generateInvoiceCodeHelper } from '../managers/helpers/generate-invoice-code.helper'; import { generateInvoiceCodeHelper } from '../managers/helpers/generate-invoice-code.helper';
import { apm } from 'src/core/apm';
@EventsHandler(MidtransCallbackEvent) @EventsHandler(MidtransCallbackEvent)
export class MidtransCallbackHandler export class MidtransCallbackHandler
@ -23,11 +22,6 @@ export class MidtransCallbackHandler
) {} ) {}
async handle(event: MidtransCallbackEvent) { async handle(event: MidtransCallbackEvent) {
const apmTransactions = apm.startTransaction(
`callback-midtrans`,
'handler',
);
const data_id = event.data.id; const data_id = event.data.id;
const data = event.data.data; const data = event.data.data;
let old_data = undefined; let old_data = undefined;
@ -39,8 +33,6 @@ export class MidtransCallbackHandler
}); });
old_data = _.cloneDeep(transaction); old_data = _.cloneDeep(transaction);
apmTransactions.setLabel('status', data.transaction_status);
if (['capture', 'settlement'].includes(data.transaction_status)) { if (['capture', 'settlement'].includes(data.transaction_status)) {
Object.assign(transaction, { Object.assign(transaction, {
status: STATUS.SETTLED, status: STATUS.SETTLED,
@ -91,7 +83,5 @@ export class MidtransCallbackHandler
op: OPERATION.UPDATE, op: OPERATION.UPDATE,
}), }),
); );
apmTransactions.end();
} }
} }