Skip to content

Commit

Permalink
Remove nedbank voucher params
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben <[email protected]>
  • Loading branch information
Ruben committed Feb 5, 2025
1 parent 802fa32 commit 968bcbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -33,7 +32,12 @@ export class NedbankService
phoneNumber,
orderCreateReference,
paymentReference,
}: NedbankCreateVoucherParams): Promise<NedbankVoucherStatus> {
}: {
transferAmount: number;
phoneNumber: string;
orderCreateReference: string;
paymentReference: string;
}): Promise<NedbankVoucherStatus> {
const isAmountMultipleOf10 = transferAmount % 10 === 0;
if (!isAmountMultipleOf10) {
throw new NedbankError(
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 968bcbe

Please sign in to comment.