fix: callback
This commit is contained in:
		| @@ -51,34 +51,32 @@ export class PpobCallbackController { | ||||
|   async getMetro(@Req() request: FastifyRequest) { | ||||
|     const response = request.query; | ||||
|  | ||||
|     if (response['status'] != 20) { | ||||
|       //TODO: UPDATE GAGAL | ||||
|     if (response['message'].include('CEK TAGIHAN')) { | ||||
|       console.log("messagenya tuh",response['message']) | ||||
|     } else { | ||||
|       if (response['status'] != 20) { | ||||
|         //TODO: UPDATE GAGAL | ||||
|         const updateTransaction = | ||||
|           await this.transactionService.callbackOrderFailed( | ||||
|             response['refid'], | ||||
|             response, | ||||
|           ); | ||||
|  | ||||
|         return { | ||||
|           updateTransaction, | ||||
|           statusCode: HttpStatus.BAD_REQUEST, | ||||
|           message: 'failed to proccess', | ||||
|         }; | ||||
|       } | ||||
|  | ||||
|       //TODO: UPDATE BERHASIL | ||||
|       const updateTransaction = | ||||
|         await this.transactionService.callbackOrderFailed( | ||||
|         await this.transactionService.callbackOrderSuccess( | ||||
|           response['refid'], | ||||
|           response, | ||||
|         ); | ||||
|  | ||||
|       return { | ||||
|         updateTransaction, | ||||
|         statusCode: HttpStatus.BAD_REQUEST, | ||||
|         message: 'failed to proccess', | ||||
|       }; | ||||
|     } | ||||
|  | ||||
|     //TODO: UPDATE BERHASIL | ||||
|     const updateTransaction = | ||||
|       await this.transactionService.callbackOrderSuccess( | ||||
|         response['refid'], | ||||
|         response, | ||||
|       ); | ||||
|  | ||||
|     return { | ||||
|       updateTransaction, | ||||
|       statusCode: HttpStatus.OK, | ||||
|       message: 'success', | ||||
|     }; | ||||
|  | ||||
|     this.logger.log({ | ||||
|       requestQuery: request.query, | ||||
|     }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user