Skip to content

Commit ab933d2

Browse files
authored
Merge branch 'main' into support-308-redirect
2 parents 948be7e + 3eb2d5c commit ab933d2

File tree

88 files changed

+991
-150
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+991
-150
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
schedule:
55
- cron: '0 21 * * 4'
66

7+
permissions:
8+
contents: read
9+
security-events: write
10+
711
jobs:
812
CodeQL-Build:
913

.github/workflows/label_new_issues.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
issues:
44
types: [opened]
55

6+
permissions:
7+
issues: write
8+
69
jobs:
710
add-label:
811
runs-on: ubuntu-latest

.github/workflows/npm-debug.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
release:
77
types: [published]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
publish-npm:
1114
runs-on: ubuntu-latest

.github/workflows/npmpublish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
release:
88
types: [published]
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
publish-npm:
1215
runs-on: ubuntu-latest

.github/workflows/stale.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ on:
33
schedule:
44
- cron: '30 8 * * *'
55

6+
permissions:
7+
issues: write
8+
pull-requests: write
9+
610
jobs:
711
stale:
812
runs-on: ubuntu-latest

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/services/checkout/modificationsApi.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class ModificationsApi extends Service {
6363

6464
/**
6565
* @summary Cancel an authorised payment
66-
* @param paymentPspReference {@link string } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to cancel.
66+
* @param paymentPspReference {@link string } The [`pspReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-pspReference) of the payment that you want to cancel.
6767
* @param paymentCancelRequest {@link PaymentCancelRequest }
6868
* @param requestOptions {@link IRequest.Options }
6969
* @return {@link PaymentCancelResponse }
@@ -85,7 +85,7 @@ export class ModificationsApi extends Service {
8585

8686
/**
8787
* @summary Capture an authorised payment
88-
* @param paymentPspReference {@link string } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to capture.
88+
* @param paymentPspReference {@link string } The [`pspReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-pspReference) of the payment that you want to capture.
8989
* @param paymentCaptureRequest {@link PaymentCaptureRequest }
9090
* @param requestOptions {@link IRequest.Options }
9191
* @return {@link PaymentCaptureResponse }
@@ -107,7 +107,7 @@ export class ModificationsApi extends Service {
107107

108108
/**
109109
* @summary Refund a captured payment
110-
* @param paymentPspReference {@link string } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to refund.
110+
* @param paymentPspReference {@link string } The [`pspReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-pspReference) of the payment that you want to refund.
111111
* @param paymentRefundRequest {@link PaymentRefundRequest }
112112
* @param requestOptions {@link IRequest.Options }
113113
* @return {@link PaymentRefundResponse }
@@ -129,7 +129,7 @@ export class ModificationsApi extends Service {
129129

130130
/**
131131
* @summary Refund or cancel a payment
132-
* @param paymentPspReference {@link string } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment that you want to reverse.
132+
* @param paymentPspReference {@link string } The [`pspReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-pspReference) of the payment that you want to reverse.
133133
* @param paymentReversalRequest {@link PaymentReversalRequest }
134134
* @param requestOptions {@link IRequest.Options }
135135
* @return {@link PaymentReversalResponse }
@@ -151,7 +151,7 @@ export class ModificationsApi extends Service {
151151

152152
/**
153153
* @summary Update an authorised amount
154-
* @param paymentPspReference {@link string } The [`pspReference`](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/post/payments__resParam_pspReference) of the payment.
154+
* @param paymentPspReference {@link string } The [`pspReference`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#responses-200-pspReference) of the payment.
155155
* @param paymentAmountUpdateRequest {@link PaymentAmountUpdateRequest }
156156
* @param requestOptions {@link IRequest.Options }
157157
* @return {@link PaymentAmountUpdateResponse }

src/services/checkout/utilityApi.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import { PaypalUpdateOrderRequest } from "../../typings/checkout/models";
2121
import { PaypalUpdateOrderResponse } from "../../typings/checkout/models";
2222
import { UtilityRequest } from "../../typings/checkout/models";
2323
import { UtilityResponse } from "../../typings/checkout/models";
24+
import { ValidateShopperIdRequest } from "../../typings/checkout/models";
25+
import { ValidateShopperIdResponse } from "../../typings/checkout/models";
2426

2527
/**
2628
* API handler for UtilityApi
@@ -97,4 +99,24 @@ export class UtilityApi extends Service {
9799
return ObjectSerializer.deserialize(response, "PaypalUpdateOrderResponse");
98100
}
99101

102+
/**
103+
* @summary Validates shopper Id
104+
* @param validateShopperIdRequest {@link ValidateShopperIdRequest }
105+
* @param requestOptions {@link IRequest.Options }
106+
* @return {@link ValidateShopperIdResponse }
107+
*/
108+
public async validateShopperId(validateShopperIdRequest: ValidateShopperIdRequest, requestOptions?: IRequest.Options): Promise<ValidateShopperIdResponse> {
109+
const endpoint = `${this.baseUrl}/validateShopperId`;
110+
const resource = new Resource(this, endpoint);
111+
112+
const request: ValidateShopperIdRequest = ObjectSerializer.serialize(validateShopperIdRequest, "ValidateShopperIdRequest");
113+
const response = await getJsonResponse<ValidateShopperIdRequest, ValidateShopperIdResponse>(
114+
resource,
115+
request,
116+
{ ...requestOptions, method: "POST" }
117+
);
118+
119+
return ObjectSerializer.deserialize(response, "ValidateShopperIdResponse");
120+
}
121+
100122
}

0 commit comments

Comments
 (0)