diff --git a/services/121-service/src/payments/fsp-integration/intersolve-visa/intersolve-visa.api.service.ts b/services/121-service/src/payments/fsp-integration/intersolve-visa/intersolve-visa.api.service.ts index bb73d20904..cca169efc8 100644 --- a/services/121-service/src/payments/fsp-integration/intersolve-visa/intersolve-visa.api.service.ts +++ b/services/121-service/src/payments/fsp-integration/intersolve-visa/intersolve-visa.api.service.ts @@ -447,7 +447,7 @@ export class IntersolveVisaApiService { reference: string; }): Promise { const uuid = generateUUIDFromSeed(reference); - const amountInCent = amountInMajorUnit * 100; + const amountInCent = Math.round(amountInMajorUnit * 100); // Math round is needed to prevent floating point errors const transferRequestDto: TransferRequestIntersolveApiDto = { quantity: { diff --git a/services/mock-service/src/fsp-integration/intersolve-visa/intersolve-visa.mock.service.ts b/services/mock-service/src/fsp-integration/intersolve-visa/intersolve-visa.mock.service.ts index 937e8c2d6a..20a2ea04fc 100644 --- a/services/mock-service/src/fsp-integration/intersolve-visa/intersolve-visa.mock.service.ts +++ b/services/mock-service/src/fsp-integration/intersolve-visa/intersolve-visa.mock.service.ts @@ -664,6 +664,24 @@ export class IntersolveVisaMockService { }, }; } + // Return error if the amount is not an integer + // If we post a non integer to the real API, it will return a similar error + if (!Number.isInteger(amount)) { + return { + status: HttpStatus.BAD_REQUEST, + statusText: 'Bad Request', + data: { + success: false, + errors: [ + { + code: 'INVALID_PARAMETERS', + description: + 'The JSON value could not be converted to System.Int32', + }, + ], + }, + }; + } return { status: HttpStatus.OK,