Skip to content

Commit

Permalink
style(fmt): code formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
AdyenAutomationBot authored and AdyenAutomationBot committed Dec 15, 2023
1 parent a6a312a commit 900ade8
Show file tree
Hide file tree
Showing 77 changed files with 41 additions and 108 deletions.
2 changes: 1 addition & 1 deletion src/__mocks__/management/invalidUserCreated422.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export const invalidUserCreated422 = {
}
],
"errorCode": "31_007"
}
};
2 changes: 1 addition & 1 deletion src/__tests__/balanceControl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ describe("Balance Control", (): void => {
}
}
});
})
});
4 changes: 2 additions & 2 deletions src/__tests__/checkout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ describe("Checkout", (): void => {
originDomains: ["https://www.your-domain.com"],
};

nock(`https://checkout-test.adyen.com`)
.post(`/v71/originKeys`)
nock("https://checkout-test.adyen.com")
.post("/v71/originKeys")
.reply(200, originKeysSuccess);

const originKeysResponse = await checkoutUtility.UtilityApi.originKeys(originKeysRequest);
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/disputes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,4 @@ describe("Disputes", (): void => {
const response: SupplyDefenseDocumentResponse = await disputesService.supplyDefenseDocument(request);
expect(response.disputeServiceResult.success).toEqual(true);
});
})
});
10 changes: 5 additions & 5 deletions src/__tests__/legalEntityManagement.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ afterEach(() => {

describe("Legal Entity Management", (): void => {

const id = "123456789"
const id = "123456789";

describe("LegalEntities", (): void => {
it("should support POST /legalEntities", async (): Promise<void> => {
Expand Down Expand Up @@ -251,7 +251,7 @@ describe("Legal Entity Management", (): void => {

expect(response.id).toBe(id);
expect(response.type).toBe(Document.TypeEnum.DriversLicense);
expect(response.owner).toEqual({id : "123456789", type : "passport" })
expect(response.owner).toEqual({id : "123456789", type : "passport" });
});

it("should support GET /documents/{id}", async (): Promise<void> => {
Expand All @@ -262,7 +262,7 @@ describe("Legal Entity Management", (): void => {

expect(response.id).toBe(id);
expect(response.type).toBe(Document.TypeEnum.DriversLicense);
expect(response.owner).toEqual({id : "123456789", type : "passport" })
expect(response.owner).toEqual({id : "123456789", type : "passport" });
});

it("should support PATCH /documents/{id}", async (): Promise<void> => {
Expand All @@ -289,7 +289,7 @@ describe("Legal Entity Management", (): void => {

expect(response.id).toBe(id);
expect(response.type).toBe(Document.TypeEnum.DriversLicense);
expect(response.owner).toEqual({id : "123456789", type : "passport" })
expect(response.owner).toEqual({id : "123456789", type : "passport" });
});

it("should support DELETE /documents/{id}", async (): Promise<void> => {
Expand All @@ -314,7 +314,7 @@ describe("Legal Entity Management", (): void => {
});

it("should support GET /themes", async (): Promise<void> => {
scope.get(`/themes`)
scope.get("/themes")
.reply(200, onboardingThemes);

const response: models.OnboardingThemes = await legalEntityManagement.HostedOnboardingApi.listHostedOnboardingPageThemes();
Expand Down
42 changes: 21 additions & 21 deletions src/__tests__/notification.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ describe("Notification Test", function (): void {
}, "environment": "test", "type": "balancePlatform.accountHolder.created"
};
const jsonString = JSON.stringify(json);
let bankingWebhookHandler = new BankingWebhookHandler(jsonString);
const bankingWebhookHandler = new BankingWebhookHandler(jsonString);
const accountHolderNotificationRequest: AccountHolderNotificationRequest = bankingWebhookHandler.getAccountHolderNotificationRequest();
const genericWebhook = bankingWebhookHandler.getGenericWebhook();
expect(genericWebhook instanceof AccountHolderNotificationRequest).toBe(true)
expect(accountHolderNotificationRequest.environment).toEqual("test")
expect(genericWebhook instanceof AccountHolderNotificationRequest).toBe(true);
expect(accountHolderNotificationRequest.environment).toEqual("test");
});

it("should verify the banking hmac", function (): void {
const jsonString = "{\"data\":{\"balancePlatform\":\"Integration_tools_test\",\"accountId\":\"BA32272223222H5HVKTBK4MLB\",\"sweep\":{\"id\":\"SWPC42272223222H5HVKV6H8C64DP5\",\"schedule\":{\"type\":\"balance\"},\"status\":\"active\",\"targetAmount\":{\"currency\":\"EUR\",\"value\":0},\"triggerAmount\":{\"currency\":\"EUR\",\"value\":0},\"type\":\"pull\",\"counterparty\":{\"balanceAccountId\":\"BA3227C223222H5HVKT3H9WLC\"},\"currency\":\"EUR\"}},\"environment\":\"test\",\"type\":\"balancePlatform.balanceAccountSweep.updated\"}";
const isValid = hmacValidator.validateBankingHMAC("9Qz9S/0xpar1klkniKdshxpAhRKbiSAewPpWoxKefQA=", "D7DD5BA6146493707BF0BE7496F6404EC7A63616B7158EC927B9F54BB436765F", jsonString)
expect(isValid).toBe(true)
const isValid = hmacValidator.validateBankingHMAC("9Qz9S/0xpar1klkniKdshxpAhRKbiSAewPpWoxKefQA=", "D7DD5BA6146493707BF0BE7496F6404EC7A63616B7158EC927B9F54BB436765F", jsonString);
expect(isValid).toBe(true);
});

it("should deserialize Management Webhooks", function (): void {
Expand All @@ -151,12 +151,12 @@ describe("Notification Test", function (): void {
"type": "paymentMethod.created"
};
const jsonString = JSON.stringify(json);
let managementWebhookHandler = new ManagementWebhookHandler(jsonString);
const managementWebhookHandler = new ManagementWebhookHandler(jsonString);
const paymentMethodCreatedNotificationRequest: PaymentMethodCreatedNotificationRequest = managementWebhookHandler.getPaymentMethodCreatedNotificationRequest();
const genericWebhook = managementWebhookHandler.getGenericWebhook();
expect(genericWebhook instanceof PaymentMethodCreatedNotificationRequest).toBe(true)
expect(genericWebhook instanceof MerchantUpdatedNotificationRequest).toBe(false)
expect(paymentMethodCreatedNotificationRequest.type).toEqual(PaymentMethodCreatedNotificationRequest.TypeEnum.PaymentMethodCreated)
expect(genericWebhook instanceof PaymentMethodCreatedNotificationRequest).toBe(true);
expect(genericWebhook instanceof MerchantUpdatedNotificationRequest).toBe(false);
expect(paymentMethodCreatedNotificationRequest.type).toEqual(PaymentMethodCreatedNotificationRequest.TypeEnum.PaymentMethodCreated);
});

it("should deserialize Banking Authentication Webhook", function (): void {
Expand Down Expand Up @@ -202,12 +202,12 @@ describe("Notification Test", function (): void {
"type": "balancePlatform.authentication.created"
};
const jsonString = JSON.stringify(json);
let bankingWebhookHandler = new BankingWebhookHandler(jsonString);
const bankingWebhookHandler = new BankingWebhookHandler(jsonString);
const accountHolderNotificationRequest: TransferNotificationRequest = bankingWebhookHandler.getTransferNotificationRequest();
const genericWebhook = bankingWebhookHandler.getGenericWebhook();
expect(accountHolderNotificationRequest.type).toEqual(AuthenticationNotificationRequest.TypeEnum.BalancePlatformAuthenticationCreated)
expect(genericWebhook instanceof AccountHolderNotificationRequest).toBe(false)
expect(genericWebhook instanceof AuthenticationNotificationRequest).toBe(true)
expect(accountHolderNotificationRequest.type).toEqual(AuthenticationNotificationRequest.TypeEnum.BalancePlatformAuthenticationCreated);
expect(genericWebhook instanceof AccountHolderNotificationRequest).toBe(false);
expect(genericWebhook instanceof AuthenticationNotificationRequest).toBe(true);
});

it("should deserialize Management v3 Webhooks", function (): void {
Expand All @@ -225,12 +225,12 @@ describe("Notification Test", function (): void {
}
};
const jsonString = JSON.stringify(json);
let managementWebhookHandler = new ManagementWebhookHandler(jsonString);
const managementWebhookHandler = new ManagementWebhookHandler(jsonString);
const paymentMethodRequestRemoved: PaymentMethodRequestRemovedNotificationRequest = managementWebhookHandler.getPaymentMethodRequestRemovedNotificationRequest();
const genericWebhook = managementWebhookHandler.getGenericWebhook();
expect(genericWebhook instanceof PaymentMethodRequestRemovedNotificationRequest).toBe(true)
expect(genericWebhook instanceof PaymentMethodScheduledForRemovalNotificationRequest).toBe(false)
expect(paymentMethodRequestRemoved.type).toEqual(PaymentMethodRequestRemovedNotificationRequest.TypeEnum.PaymentMethodRequestRemoved)
expect(genericWebhook instanceof PaymentMethodRequestRemovedNotificationRequest).toBe(true);
expect(genericWebhook instanceof PaymentMethodScheduledForRemovalNotificationRequest).toBe(false);
expect(paymentMethodRequestRemoved.type).toEqual(PaymentMethodRequestRemovedNotificationRequest.TypeEnum.PaymentMethodRequestRemoved);
});

it("should deserialize Transaction v4 Webhooks", function (): void {
Expand Down Expand Up @@ -265,11 +265,11 @@ describe("Notification Test", function (): void {
"environment": "test"
};
const jsonString = JSON.stringify(json);
let bankingWebhookHandler = new BankingWebhookHandler(jsonString);
const bankingWebhookHandler = new BankingWebhookHandler(jsonString);
const transactionCreated: TransactionNotificationRequestV4 = bankingWebhookHandler.getTransactionNotificationRequest();
const genericWebhook = bankingWebhookHandler.getGenericWebhook();
expect(genericWebhook instanceof TransactionNotificationRequestV4).toBe(true)
expect(genericWebhook instanceof PaymentMethodScheduledForRemovalNotificationRequest).toBe(false)
expect(transactionCreated.type).toEqual(TransactionNotificationRequestV4.TypeEnum.BalancePlatformTransactionCreated)
expect(genericWebhook instanceof TransactionNotificationRequestV4).toBe(true);
expect(genericWebhook instanceof PaymentMethodScheduledForRemovalNotificationRequest).toBe(false);
expect(transactionCreated.type).toEqual(TransactionNotificationRequestV4.TypeEnum.BalancePlatformTransactionCreated);
});
});
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Client {
} else {
this.config = new Config();
}
this.liveEndpointUrlPrefix = options.liveEndpointUrlPrefix ?? '';
this.liveEndpointUrlPrefix = options.liveEndpointUrlPrefix ?? "";

const environment = options.environment ?? this.config.environment;
if (environment) {
Expand Down
2 changes: 1 addition & 1 deletion src/httpClient/httpURLConnectionClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class HttpURLConnectionClient implements ClientInterface {
if (terminalCertificatePath == "unencrypted"){
this.agentOptions = {
rejectUnauthorized: false
}
};
} else {
const certificateInput = fs.readFileSync(terminalCertificatePath);
this.agentOptions = {
Expand Down
6 changes: 3 additions & 3 deletions src/notification/bankingWebhookHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class BankingWebhookHandler {
private readonly payload: string;

public constructor(jsonPayload: string) {
this.payload = JSON.parse(jsonPayload)
this.payload = JSON.parse(jsonPayload);
}

// Return generic webhook type
Expand All @@ -23,7 +23,7 @@ class BankingWebhookHandler {
| reportWebhooks.ReportNotificationRequest
| transferWebhooks.TransferNotificationRequest
| transactionWebhooks.TransactionNotificationRequestV4 {
const type = this.payload['type'];
const type = this.payload["type"];

if(Object.values(acsWebhooks.AuthenticationNotificationRequest.TypeEnum).includes(type)){
return this.getAuthenticationNotificationRequest();
Expand Down Expand Up @@ -61,7 +61,7 @@ class BankingWebhookHandler {
return this.getTransactionNotificationRequest();
}

throw new Error("Could not parse the json payload: " + this.payload)
throw new Error("Could not parse the json payload: " + this.payload);
}

public getAuthenticationNotificationRequest(): acsWebhooks.AuthenticationNotificationRequest {
Expand Down
6 changes: 3 additions & 3 deletions src/notification/managementWebhookHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ManagementWebhookHandler {
private readonly payload: string;

public constructor(jsonPayload: string) {
this.payload = JSON.parse(jsonPayload)
this.payload = JSON.parse(jsonPayload);
}

// Return generic webhook type
Expand All @@ -19,7 +19,7 @@ class ManagementWebhookHandler {
| managementWebhooks.PaymentMethodCreatedNotificationRequest
| managementWebhooks.PaymentMethodRequestRemovedNotificationRequest
| managementWebhooks.PaymentMethodScheduledForRemovalNotificationRequest {
const type = this.payload['type'];
const type = this.payload["type"];
if(Object.values(managementWebhooks.MerchantCreatedNotificationRequest.TypeEnum).includes(type)){
return this.getMerchantCreatedNotificationRequest();
}
Expand All @@ -40,7 +40,7 @@ class ManagementWebhookHandler {
return this.getPaymentMethodScheduledForRemovalNotificationRequest();
}

throw new Error("Could not parse the json payload: " + this.payload)
throw new Error("Could not parse the json payload: " + this.payload);
}

public getMerchantCreatedNotificationRequest(): managementWebhooks.MerchantCreatedNotificationRequest {
Expand Down
4 changes: 2 additions & 2 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Service {
if (url.includes("pal-")) {
if (this.client.liveEndpointUrlPrefix === "")
{
throw new Error("Please provide your unique live url prefix on the setEnvironment() call on the Client.")
throw new Error("Please provide your unique live url prefix on the setEnvironment() call on the Client.");
}
return url.replace("https://pal-test.adyen.com/pal/servlet/",
`https://${this.client.liveEndpointUrlPrefix}-pal-live.adyenpayments.com/pal/servlet/`);
Expand All @@ -48,7 +48,7 @@ class Service {
if (url.includes("checkout-")) {
if (this.client.liveEndpointUrlPrefix === "")
{
throw new Error("Please provide your unique live url prefix on the setEnvironment() call on the Client.")
throw new Error("Please provide your unique live url prefix on the setEnvironment() call on the Client.");
}
return url.replace("https://checkout-test.adyen.com/",
`https://${this.client.liveEndpointUrlPrefix}-checkout-live.adyenpayments.com/checkout/`);
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/accountHoldersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { AccountHolderInfo } from "../../typings/balancePlatform/models";
import { AccountHolderUpdateRequest } from "../../typings/balancePlatform/models";
import { GetTaxFormResponse } from "../../typings/balancePlatform/models";
import { PaginatedBalanceAccountsResponse } from "../../typings/balancePlatform/models";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
import { ObjectSerializer } from "../../typings/balancePlatform/models";
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/balanceAccountsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { BalanceAccountUpdateRequest } from "../../typings/balancePlatform/model
import { BalanceSweepConfigurationsResponse } from "../../typings/balancePlatform/models";
import { CreateSweepConfigurationV2 } from "../../typings/balancePlatform/models";
import { PaginatedPaymentInstrumentsResponse } from "../../typings/balancePlatform/models";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { SweepConfigurationV2 } from "../../typings/balancePlatform/models";
import { UpdateSweepConfigurationV2 } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/bankAccountValidationApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import Client from "../../client";
import { BankAccountIdentificationValidationRequest } from "../../typings/balancePlatform/models";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
import { ObjectSerializer } from "../../typings/balancePlatform/models";
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/grantAccountsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import Client from "../../client";
import { CapitalGrantAccount } from "../../typings/balancePlatform/models";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
import { ObjectSerializer } from "../../typings/balancePlatform/models";
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/grantOffersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Service from "../../service";
import Client from "../../client";
import { GrantOffer } from "../../typings/balancePlatform/models";
import { GrantOffers } from "../../typings/balancePlatform/models";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
import { ObjectSerializer } from "../../typings/balancePlatform/models";
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/networkTokensApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import Client from "../../client";
import { GetNetworkTokenResponse } from "../../typings/balancePlatform/models";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { UpdateNetworkTokenRequest } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/paymentInstrumentGroupsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Service from "../../service";
import Client from "../../client";
import { PaymentInstrumentGroup } from "../../typings/balancePlatform/models";
import { PaymentInstrumentGroupInfo } from "../../typings/balancePlatform/models";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { TransactionRulesResponse } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/paymentInstrumentsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { PaymentInstrument } from "../../typings/balancePlatform/models";
import { PaymentInstrumentInfo } from "../../typings/balancePlatform/models";
import { PaymentInstrumentRevealInfo } from "../../typings/balancePlatform/models";
import { PaymentInstrumentUpdateRequest } from "../../typings/balancePlatform/models";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { TransactionRulesResponse } from "../../typings/balancePlatform/models";
import { UpdatePaymentInstrument } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/platformApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import Service from "../../service";
import Client from "../../client";
import { BalancePlatform } from "../../typings/balancePlatform/models";
import { PaginatedAccountHoldersResponse } from "../../typings/balancePlatform/models";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
import Resource from "../resource";
import { ObjectSerializer } from "../../typings/balancePlatform/models";
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/transactionRulesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import Client from "../../client";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { TransactionRule } from "../../typings/balancePlatform/models";
import { TransactionRuleInfo } from "../../typings/balancePlatform/models";
import { TransactionRuleResponse } from "../../typings/balancePlatform/models";
Expand Down
1 change: 0 additions & 1 deletion src/services/balancePlatform/transferRoutesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import getJsonResponse from "../../helpers/getJsonResponse";
import Service from "../../service";
import Client from "../../client";
import { RestServiceError } from "../../typings/balancePlatform/models";
import { TransferRouteRequest } from "../../typings/balancePlatform/models";
import { TransferRouteResponse } from "../../typings/balancePlatform/models";
import { IRequest } from "../../typings/requestOptions";
Expand Down
Loading

0 comments on commit 900ade8

Please sign in to comment.