fix: callback transaction
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
import { TransactionService } from './transaction.service';
|
||||
import { DistributeTransactionDto } from './dto/distribute-transaction.dto';
|
||||
import { FastifyRequest } from 'fastify';
|
||||
import { Public } from '../auth/public.decorator';
|
||||
|
||||
@Controller({
|
||||
path: 'ppob_callback',
|
||||
@@ -23,6 +24,7 @@ export class PpobCallbackController {
|
||||
|
||||
constructor(private readonly transactionService: TransactionService) {}
|
||||
|
||||
@Public()
|
||||
@Get()
|
||||
async get(@Req() request: FastifyRequest) {
|
||||
const response = request.query;
|
||||
@@ -30,12 +32,16 @@ export class PpobCallbackController {
|
||||
if (response['statuscode'] == 2) {
|
||||
//TODO: UPDATE GAGAL
|
||||
const updateTransaction =
|
||||
await this.transactionService.callbackOrderFailed(response['clientid']);
|
||||
await this.transactionService.callbackOrderFailed(
|
||||
response['clientid'],
|
||||
response,
|
||||
);
|
||||
} else {
|
||||
//TODO: UPDATE BERHASIL
|
||||
const updateTransaction =
|
||||
await this.transactionService.callbackOrderSuccess(
|
||||
response['clientid'],
|
||||
response,
|
||||
);
|
||||
}
|
||||
this.logger.log({
|
||||
|
||||
Reference in New Issue
Block a user