fix: callback metro

This commit is contained in:
ilham 2022-04-28 17:46:45 +07:00
parent 06f12b0140
commit 4685797ad4

View File

@ -44,12 +44,18 @@ export class PpobCallbackController {
statusCode: HttpStatus.OK, statusCode: HttpStatus.OK,
message: 'success', message: 'success',
}; };
}
@Public()
@Get('/metro')
async getMetro(@Req() request: FastifyRequest) {
const response = request.query;
if (response['status'] != 20) { if (response['status'] != 20) {
//TODO: UPDATE GAGAL //TODO: UPDATE GAGAL
const updateTransaction = const updateTransaction =
await this.transactionService.callbackOrderFailed( await this.transactionService.callbackOrderFailed(
response['clientid'], response['refid'],
response, response,
); );
@ -58,21 +64,21 @@ export class PpobCallbackController {
statusCode: HttpStatus.BAD_REQUEST, statusCode: HttpStatus.BAD_REQUEST,
message: 'failed to proccess', message: 'failed to proccess',
}; };
} else {
//TODO: UPDATE BERHASIL
const updateTransaction =
await this.transactionService.callbackOrderSuccess(
response['clientid'],
response,
);
return {
updateTransaction,
statusCode: HttpStatus.OK,
message: 'success',
};
} }
//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,
}); });