diff --git a/services/121-service/src/payments/fsp-integration/nedbank/interfaces/nedbank-create-voucher-params.ts b/services/121-service/src/payments/fsp-integration/nedbank/interfaces/nedbank-create-voucher-params.ts deleted file mode 100644 index e369a19efb..0000000000 --- a/services/121-service/src/payments/fsp-integration/nedbank/interfaces/nedbank-create-voucher-params.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface NedbankCreateVoucherParams { - transferAmount: number; - phoneNumber: string; - orderCreateReference: string; - paymentReference: string; -} diff --git a/services/121-service/src/payments/fsp-integration/nedbank/nedbank.service.ts b/services/121-service/src/payments/fsp-integration/nedbank/nedbank.service.ts index e938eda858..9421b18955 100644 --- a/services/121-service/src/payments/fsp-integration/nedbank/nedbank.service.ts +++ b/services/121-service/src/payments/fsp-integration/nedbank/nedbank.service.ts @@ -7,7 +7,6 @@ import { NedbankErrorCode } from '@121-service/src/payments/fsp-integration/nedb import { NedbankVoucherStatus } from '@121-service/src/payments/fsp-integration/nedbank/enums/nedbank-voucher-status.enum'; import { NedbankError } from '@121-service/src/payments/fsp-integration/nedbank/errors/nedbank.error'; import { NedbankApiError } from '@121-service/src/payments/fsp-integration/nedbank/errors/nedbank-api.error'; -import { NedbankCreateVoucherParams } from '@121-service/src/payments/fsp-integration/nedbank/interfaces/nedbank-create-voucher-params'; import { NedbankApiService } from '@121-service/src/payments/fsp-integration/nedbank/services/nedbank-api.service'; @Injectable() @@ -33,7 +32,12 @@ export class NedbankService phoneNumber, orderCreateReference, paymentReference, - }: NedbankCreateVoucherParams): Promise { + }: { + transferAmount: number; + phoneNumber: string; + orderCreateReference: string; + paymentReference: string; + }): Promise { const isAmountMultipleOf10 = transferAmount % 10 === 0; if (!isAmountMultipleOf10) { throw new NedbankError( @@ -67,7 +71,7 @@ export class NedbankService throw error; } } -// TODO: REFACTOR: This method should not return an errorCode and errorMessage, but instead throw this error. However, this is not so straight-forward in handling business logic and probably requires introducing a NedbankOrderEntity besides NedbankVoucherEntity to keep track of orderCreateReference for orders that failed to create a voucher. + // TODO: REFACTOR: This method should not return an errorCode and errorMessage, but instead throw this error. However, this is not so straight-forward in handling business logic and probably requires introducing a NedbankOrderEntity besides NedbankVoucherEntity to keep track of orderCreateReference for orders that failed to create a voucher. public async retrieveVoucherInfo(orderCreateReference: string): Promise<{ status?: NedbankVoucherStatus; errorMessage?: string;