diff --git a/src/__tests__/management.spec.ts b/src/__tests__/management.spec.ts index 0f1533d..0e2ef20 100644 --- a/src/__tests__/management.spec.ts +++ b/src/__tests__/management.spec.ts @@ -132,7 +132,7 @@ describe("Management", (): void => { describe("MerchantAccount", (): void => { it("should support GET /merchants", async (): Promise => { - scope.get(`/merchants?pageNumber=1&pageSize=1`) + scope.get("/merchants?pageNumber=1&pageSize=1") .reply(200, responses.listMerchantResponse); const response: models.ListMerchantResponse = await management.MerchantAccount.list({ @@ -146,7 +146,7 @@ describe("Management", (): void => { }); it("should support POST /merchants", async (): Promise => { - scope.post(`/merchants`) + scope.post("/merchants") .reply(200, responses.createMerchantResponse); const response: models.CreateMerchantResponse = await management.MerchantAccount.create(requests.createMerchantRequest); @@ -641,10 +641,10 @@ describe("Management", (): void => { }); it("should support POST /merchants/{merchantId}/webhooks/{webhookId}/test", async (): Promise => { - scope.post(`/merchants/${merchantId}/webhooks/${webhookId}/test`, /2022-07-15T00:00:00.000Z/) + scope.post(`/merchants/${merchantId}/webhooks/${webhookId}/test`) .reply(200, responses.testWebhookResponse); - let testWebhookRequest = { + const testWebhookRequest: models.TestWebhookRequest = { "notification": { "amount": { "currency": "string", diff --git a/src/__tests__/terminalCloudAPI.spec.ts b/src/__tests__/terminalCloudAPI.spec.ts index c51f166..30b2a44 100644 --- a/src/__tests__/terminalCloudAPI.spec.ts +++ b/src/__tests__/terminalCloudAPI.spec.ts @@ -23,7 +23,7 @@ import { asyncRes } from "../__mocks__/terminalApi/async"; import { syncRefund, syncRes, syncResEventNotification } from "../__mocks__/terminalApi/sync"; import Client from "../client"; import TerminalCloudAPI from "../services/terminalCloudAPI"; -import { TerminalApiResponse } from "../typings/terminal/models"; +import { SaleToAcquirerData, TerminalApiResponse } from "../typings/terminal/models"; let client: Client; let terminalCloudAPI: TerminalCloudAPI; @@ -94,7 +94,9 @@ describe("Terminal Cloud API", (): void => { const terminalAPIRefundRequest = createTerminalAPIRefundRequest(pOITransactionId); const id = Math.floor(Math.random() * Math.floor(10000000)).toString(); terminalAPIRefundRequest.SaleToPOIRequest.MessageHeader.ServiceID = id; - terminalAPIRefundRequest.SaleToPOIRequest.ReversalRequest!.SaleData!.SaleToAcquirerData!.currency = "EUR"; + const saleToAcquirerData: SaleToAcquirerData = new SaleToAcquirerData(); + saleToAcquirerData.currency = "EUR"; + terminalAPIRefundRequest.SaleToPOIRequest.ReversalRequest!.SaleData!.SaleToAcquirerData = saleToAcquirerData; const terminalAPIRefundResponse = await terminalCloudAPI.sync(terminalAPIRefundRequest); expect(terminalAPIRefundResponse.SaleToPOIResponse?.ReversalResponse?.Response.Result).toBe("Success");