- add condition for userdata partner if not null in callback success

- comment check if the transaction is success
This commit is contained in:
Fadli 2022-09-06 21:36:05 +07:00
parent 6a7c66f461
commit 9d9772270d

View File

@ -1111,23 +1111,23 @@ export class TransactionService {
supplier_trx_id
);
if (transactionData.status == statusTransaction.FAILED) {
throw new HttpException(
{
statusCode: HttpStatus.BAD_REQUEST,
error: 'failed to update, the transaction already failed',
},
HttpStatus.BAD_REQUEST,
);
} else if (transactionData.status == statusTransaction.SUCCESS) {
throw new HttpException(
{
statusCode: HttpStatus.BAD_REQUEST,
error: 'failed to update, the transaction already success',
},
HttpStatus.BAD_REQUEST,
);
} else {
// if (transactionData.status == statusTransaction.FAILED) {
// throw new HttpException(
// {
// statusCode: HttpStatus.BAD_REQUEST,
// error: 'failed to update, the transaction already failed',
// },
// HttpStatus.BAD_REQUEST,
// );
// } else if (transactionData.status == statusTransaction.SUCCESS) {
// throw new HttpException(
// {
// statusCode: HttpStatus.BAD_REQUEST,
// error: 'failed to update, the transaction already success',
// },
// HttpStatus.BAD_REQUEST,
// );
// } else {
const updateTransaction = await this.callbackOrderFailed(
supplier_trx_id,
callback,
@ -1142,7 +1142,7 @@ export class TransactionService {
HttpStatus.BAD_REQUEST,
);
}
// }
}
@ -1420,7 +1420,7 @@ export class TransactionService {
} catch (e) {
throw e;
}
if (userData.partner != null) {
if (userData.partner) {
const message = `Transaksi ${product.code} dengan tujuan ${dataTransaction.destination} telah berhasil.`;
this.callbackToPartner(
@ -1435,6 +1435,7 @@ export class TransactionService {
);
}
}
}
async resendOrderToPartner(supplier_trx_id: string, status: boolean){
const dataTransaction = await this.transactionRepository.findOne({