diff --git a/src/modules/payments/services/make-payment-to-processor.service.ts b/src/modules/payments/services/make-payment-to-processor.service.ts index cd5f341..6d77296 100644 --- a/src/modules/payments/services/make-payment-to-processor.service.ts +++ b/src/modules/payments/services/make-payment-to-processor.service.ts @@ -22,10 +22,13 @@ export class MakePaymentToProcessorService { const response = await firstValueFrom( this.httpService.post(`${url}/payments`, paymentData, { - timeout: 2000, // 30 segundos + timeout: 2000, }), ); - + if (response.status !== 200) { + this.logger.error(response); + throw new Error(response.data.message || 'Payment processor error'); + } return response.status === 200; } }