From ab9b0c190797429fcc53781fcef3dcd4a8b9205a Mon Sep 17 00:00:00 2001 From: Fadli Date: Thu, 2 Mar 2023 13:29:46 +0700 Subject: [PATCH 1/3] - fix elang callback --- src/transaction/ppob_callback.controller.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/transaction/ppob_callback.controller.ts b/src/transaction/ppob_callback.controller.ts index 3a91318..e9e2889 100644 --- a/src/transaction/ppob_callback.controller.ts +++ b/src/transaction/ppob_callback.controller.ts @@ -40,6 +40,26 @@ export class PpobCallbackController { } } + @Public() + @Get('/elang') + async getElang(@Req() request: FastifyRequest) { + const response = request.query; + + if (response['statuscode'] == 2) { + //TODO: UPDATE GAGAL + await this.transactionService.checkCallbackOrderFailed( + response['clientid'], + response, + ); + } else { + //TODO: UPDATE BERHASIL + await this.transactionService.checkCallbackOrderSuccess( + response['clientid'], + response, + ); + } + } + @Public() @Get('/metro') async getMetro(@Req() request: FastifyRequest) { From cfc13d60afaab25f5e80ac44d385288a13219274 Mon Sep 17 00:00:00 2001 From: Fadli Date: Thu, 2 Mar 2023 13:32:30 +0700 Subject: [PATCH 2/3] - fix elang callback --- src/transaction/ppob_callback.controller.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/transaction/ppob_callback.controller.ts b/src/transaction/ppob_callback.controller.ts index e9e2889..3a91318 100644 --- a/src/transaction/ppob_callback.controller.ts +++ b/src/transaction/ppob_callback.controller.ts @@ -40,26 +40,6 @@ export class PpobCallbackController { } } - @Public() - @Get('/elang') - async getElang(@Req() request: FastifyRequest) { - const response = request.query; - - if (response['statuscode'] == 2) { - //TODO: UPDATE GAGAL - await this.transactionService.checkCallbackOrderFailed( - response['clientid'], - response, - ); - } else { - //TODO: UPDATE BERHASIL - await this.transactionService.checkCallbackOrderSuccess( - response['clientid'], - response, - ); - } - } - @Public() @Get('/metro') async getMetro(@Req() request: FastifyRequest) { From b657df70a8c789f1486791ea612f128b357ede98 Mon Sep 17 00:00:00 2001 From: Fadli Date: Thu, 9 Mar 2023 10:57:54 +0700 Subject: [PATCH 3/3] - fix error respon when balance is not enough --- src/helper/irs-api.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/helper/irs-api.ts b/src/helper/irs-api.ts index b875f10..9f09267 100644 --- a/src/helper/irs-api.ts +++ b/src/helper/irs-api.ts @@ -132,11 +132,6 @@ export const doTransaction = async ( } catch (err) { console.log('errtransaction', err); console.log('errtransaction2', err.response.data); - - if (err.includes('Maaf Saldo anda tidak mencukupi')) { throw 'maaf saat ini transaksi sedang tidak bisa diproses, silahkan hubungi WND Solutions untuk bisa di proses kembali'; - } else { - throw err; - } } };