-fix bugs in add condition for ppob_callback can't hit 2 times if the transaction is already success or failed (only pending)
This commit is contained in:
		| @@ -23,14 +23,14 @@ export class PpobCallbackController { | ||||
|               response['clientid'], | ||||
|               response, | ||||
|           ); | ||||
|     } else { | ||||
|  | ||||
|       //TODO: UPDATE BERHASIL | ||||
|       await this.transactionService.checkCallbackOrderSuccess( | ||||
|           response['clientid'], | ||||
|           response, | ||||
|       ); | ||||
|     } | ||||
|  | ||||
|     //TODO: UPDATE BERHASIL | ||||
|         await this.transactionService.checkCallbackOrderSuccess( | ||||
|             response['clientid'], | ||||
|             response, | ||||
|         ); | ||||
|  | ||||
|   } | ||||
|  | ||||
|   @Public() | ||||
|   | ||||
| @@ -1077,18 +1077,19 @@ export class TransactionService { | ||||
|           HttpStatus.BAD_REQUEST, | ||||
|       ); | ||||
|     } else { | ||||
|  | ||||
|       const updateTransaction = | ||||
|           await this.callbackOrderFailed( | ||||
|       const updateTransaction = await this.callbackOrderFailed( | ||||
|               supplier_trx_id, | ||||
|               callback, | ||||
|           ); | ||||
|  | ||||
|       return { | ||||
|         updateTransaction, | ||||
|         statusCode: HttpStatus.BAD_REQUEST, | ||||
|         message: 'failed to proccess', | ||||
|       }; | ||||
|       throw new HttpException( | ||||
|           { | ||||
|             updateTransaction, | ||||
|             statusCode: HttpStatus.BAD_REQUEST, | ||||
|             error: 'updated transaction to failed', | ||||
|           }, | ||||
|           HttpStatus.BAD_REQUEST, | ||||
|       ); | ||||
|  | ||||
|     } | ||||
|  | ||||
| @@ -1124,11 +1125,14 @@ export class TransactionService { | ||||
|               callback, | ||||
|           ); | ||||
|  | ||||
|       return { | ||||
|         updateTransaction, | ||||
|         statusCode: HttpStatus.OK, | ||||
|         message: 'success', | ||||
|       }; | ||||
|       throw new HttpException( | ||||
|           { | ||||
|             updateTransaction, | ||||
|             statusCode: HttpStatus.OK, | ||||
|             error: 'success', | ||||
|           }, | ||||
|           HttpStatus.OK, | ||||
|       ); | ||||
|  | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user