Skip to content

Commit 1cf0bba

Browse files
authored
Merge branch 'main' into workflow-permissions
2 parents f150d6d + 6b76dac commit 1cf0bba

File tree

6 files changed

+31
-4
lines changed

6 files changed

+31
-4
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
28.1.0
1+
29.0.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adyen/api-library",
3-
"version": "28.1.0",
3+
"version": "29.0.0",
44
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
55
"main": "lib/src/index.js",
66
"types": "lib/src/index.d.ts",

src/__tests__/webhooks/notification.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,29 @@ describe("Notification Tests", function (): void {
141141
expect(notificationRequestItem.additionalData["metadata.anotherKey"]).toEqual("anotherValue");
142142

143143
});
144+
145+
});
146+
147+
describe("NotificationRequestItem.additionalData", () => {
148+
149+
it("handles undefined keys", () => {
150+
const item = new NotificationRequestItem();
151+
item.additionalData = {
152+
existingKey: "abc",
153+
undefinedKey: undefined
154+
};
155+
item.amount = { currency: "EUR", value: 1000 };
156+
item.pspReference = "";
157+
item.eventCode = NotificationRequestItem.EventCodeEnum.Authorisation;
158+
item.eventDate = "";
159+
item.merchantAccountCode = "";
160+
item.merchantReference = "";
161+
item.success = NotificationRequestItem.SuccessEnum.True;
162+
163+
expect(item.additionalData).toBeDefined();
164+
expect(item.additionalData).toHaveProperty("existingKey", "abc");
165+
expect(item.additionalData).toHaveProperty("undefinedKey", undefined);
166+
expect(item.additionalData).not.toHaveProperty("nonExistingKey");
167+
});
168+
144169
});

src/typings/notification/notificationRequestItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import { Amount } from './amount';
3333

3434
export class NotificationRequestItem {
35-
'additionalData'?: { [key: string]: string; };
35+
'additionalData'?: { [key: string]: string | undefined; };
3636
'amount': Amount;
3737
/**
3838
* Adyen\'s 16-character unique reference associated with the transaction/the request. This value is globally unique; quote it when communicating with us about this request.

src/typings/sessionAuthentication/objectSerializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ let primitives = [
2929
let enumsMap: Set<string> = new Set<string>([
3030
ProductType.Onboarding,
3131
ProductType.Platform,
32+
ProductType.Bank,
3233
ResourceType.LegalEntity,
3334
ResourceType.BalanceAccount,
3435
ResourceType.AccountHolder,

src/typings/sessionAuthentication/productType.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99

1010
export enum ProductType {
1111
Onboarding = 'onboarding',
12-
Platform = 'platform'
12+
Platform = 'platform',
13+
Bank = 'bank'
1314
}

0 commit comments

Comments
 (0)