fix: callback
This commit is contained in:
		| @@ -51,34 +51,32 @@ export class PpobCallbackController { | |||||||
|   async getMetro(@Req() request: FastifyRequest) { |   async getMetro(@Req() request: FastifyRequest) { | ||||||
|     const response = request.query; |     const response = request.query; | ||||||
|  |  | ||||||
|     if (response['status'] != 20) { |     if (response['message'].include('CEK TAGIHAN')) { | ||||||
|       //TODO: UPDATE GAGAL |       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 = |       const updateTransaction = | ||||||
|         await this.transactionService.callbackOrderFailed( |         await this.transactionService.callbackOrderSuccess( | ||||||
|           response['refid'], |           response['refid'], | ||||||
|           response, |           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({ |     this.logger.log({ | ||||||
|       requestQuery: request.query, |       requestQuery: request.query, | ||||||
|     }); |     }); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user