add: callback transaction
This commit is contained in:
@@ -24,7 +24,20 @@ export class PpobCallbackController {
|
||||
constructor(private readonly transactionService: TransactionService) {}
|
||||
|
||||
@Get()
|
||||
get(@Req() request: FastifyRequest) {
|
||||
async get(@Req() request: FastifyRequest) {
|
||||
const response = request.query;
|
||||
|
||||
if (response['statuscode'] == 2) {
|
||||
//TODO: UPDATE GAGAL
|
||||
const updateTransaction =
|
||||
await this.transactionService.callbackOrderFailed(response['clientid']);
|
||||
} else {
|
||||
//TODO: UPDATE BERHASIL
|
||||
const updateTransaction =
|
||||
await this.transactionService.callbackOrderSuccess(
|
||||
response['clientid'],
|
||||
);
|
||||
}
|
||||
this.logger.log({
|
||||
requestQuery: request.query,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user