fix(SPG-762) BE - integrasi dengan API Midtrans - untuk update status pembayaran
parent
4fcd852d8d
commit
2e4d5df17a
|
@ -18,7 +18,20 @@ export class MidtransController {
|
|||
|
||||
@Get(':id/status')
|
||||
async getStatus(@Param('id') id: string) {
|
||||
return await this.dataService.getStatus(id);
|
||||
try {
|
||||
const data = await this.dataService.getStatus(id);
|
||||
this.eventBus.publishAll([
|
||||
new MidtransCallbackEvent({
|
||||
id: id,
|
||||
data: data,
|
||||
}),
|
||||
]);
|
||||
|
||||
return 'Berhasil update status transaksi';
|
||||
} catch (error) {
|
||||
console.log(error.message);
|
||||
throw new Error('Gagal update status transaksi');
|
||||
}
|
||||
}
|
||||
|
||||
@Post('callback')
|
||||
|
|
Loading…
Reference in New Issue