Compare commits

...

11 Commits

Author SHA1 Message Date
jillingk
d800ac8bcc Merge branch 'develop' into PW-7518 2023-01-19 15:47:20 +01:00
jillingk
63c8357bad Merge branch 'develop' into PW-7518 2023-01-19 11:41:47 +01:00
jillingk
bb983fe4b7 Merge branch 'develop' into PW-7518 2023-01-13 09:54:14 +01:00
jillingk
c6c3c97327 Merge branch 'develop' into PW-7518 2022-12-14 11:21:53 +01:00
Wouter Boereboom
d64dbaaf32 Merge branch 'develop' into PW-7518 2022-12-05 16:10:26 +01:00
jillingk
7e45720ae8 Merge branch 'develop' into PW-7518 2022-12-04 12:41:10 +01:00
jillingk
2a7ceee216 Update Makefile
Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com>
2022-12-04 12:41:04 +01:00
jillingk
e20a426703 Update src/__tests__/hmacValidator.spec.ts
Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com>
2022-12-04 12:40:56 +01:00
jillingk
a4314a9e31 Merge branch 'develop' into PW-7518 2022-12-01 11:07:28 +01:00
jillingk
818574f222 remove additionalData class at all and replace with key-value pair 2022-12-01 11:03:53 +01:00
jillingk
b500101c02 created script to update additional data file and small check new parameter works 2022-11-28 17:44:07 +01:00
7 changed files with 12 additions and 140 deletions

View File

@@ -22,7 +22,7 @@ platformsNotificationConfiguration: spec=NotificationConfigurationService-v6
platformsHostedOnboardingPage: spec=HopService-v6
transfer: spec=TransferService-v3
$(services): build/spec
$(services): build/spec
rm -rf src/typings/$@ build/model
$(openapi-generator-cli) generate \
-i build/spec/json/$(spec).json \

View File

@@ -12,7 +12,8 @@
"hmacSignature": "OzDjCMZIsdtDqrZ+cl\/FWC+WdESrorctXTzAzW33dXI=",
"NAME2": " VALUE2 ",
"fraudCheck-6-ShopperIpUsage": "10",
"paymentLinkId": "ABCDEFG"
"paymentLinkId": "ABCDEFG",
"realtimeAccountUpdaterStatus": "status"
},
"amount": {
"currency": "EUR",

View File

@@ -1,7 +1,7 @@
import HmacValidator from "../utils/hmacValidator";
import { AdditionalData, NotificationItem, NotificationRequestItem } from "../typings/notification/models";
import {NotificationItem, NotificationRequestItem } from "../typings/notification/models";
import { ApiConstants } from "../constants/apiConstants";
import NotificationRequest from "../notification/notificationRequest";
import NotificationRequestService from "../notification/notificationRequest";
const key = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00";
const expectedSign = "ZNBPtI+oDyyRrLyD1XirkKnQgIAlFc07Vj27TeHsDRE=";
@@ -21,7 +21,7 @@ const notificationRequestItem: { NotificationRequestItem: NotificationRequestIte
additionalData: { [ApiConstants.HMAC_SIGNATURE]: expectedSign },
}
};
const notification = new NotificationRequest({
const notification = new NotificationRequestService({
live: "false",
notificationItems: [notificationRequestItem as unknown as NotificationItem]
});
@@ -59,7 +59,7 @@ describe("HMAC Validator", function (): void {
it("should have invalid hmac", function (): void {
const invalidNotification = {
...notification.notificationItems![0],
additionalData: { [ApiConstants.HMAC_SIGNATURE as keyof AdditionalData]: "notValidSign" }
additionalData: { [ApiConstants.HMAC_SIGNATURE]: "notValidSign" }
};
const result = hmacValidator.validateHMAC(invalidNotification, key);
expect(result).toBeFalsy();
@@ -115,7 +115,7 @@ describe("HMAC Validator", function (): void {
success: "true",
additionalData: { [ApiConstants.HMAC_SIGNATURE]: expectedSign }
}} as unknown as NotificationItem;
const notification = new NotificationRequest({
const notification = new NotificationRequestService({
live: "false",
notificationItems: [notificationRequestItem]
});

View File

@@ -19,6 +19,8 @@ describe("Notification Test", function (): void {
expect(notificationRequestItem.success === SuccessEnum.True).toBeTruthy();
expect(notificationRequestItem.pspReference).toEqual("123456789");
expect(notificationRequestItem.additionalData!.paymentLinkId).toEqual("ABCDEFG");
expect(notificationRequestItem.additionalData!.realtimeAccountUpdaterStatus).toEqual("status");
} else {
fail();
}

View File

@@ -1,127 +0,0 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2021 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
/**
* Notification API
* Definition of Notification API Schema
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* The additionalData object is a generic container that can hold extra fields. For more information, refer to NotificationRequestItem.additionalData .
*/
export class AdditionalData {
/**
* The ID that uniquely identifies the shopper. This shopperReference is the same as the shopperReference used in the initial payment.
*/
'shopperReference'?: string;
/**
* The shopper\'s email address.
*/
'shopperEmail'?: string;
/**
* Authorisation code: When the payment is authorised successfully, this field holds the authorisation code for the payment. When the payment is not authorised, this field is empty.
*/
'authCode'?: string;
/**
* Returns the last 4 digits of the credit card.
*/
'cardSummary'?: string;
/**
* Returns the card expiry date.
*/
'expiryDate'?: string;
/**
* Value of the amount authorised.
*/
'authorisedAmountValue'?: string;
/**
* Currency of the authorised amount.
*/
'authorisedAmountCurrency'?: string;
/**
* HMAC Key from customer area
*/
'hmacSignature'?: string;
/**
* A unique identifier for the payment link
*/
'paymentLinkId'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "shopperReference",
"baseName": "shopperReference",
"type": "string"
},
{
"name": "shopperEmail",
"baseName": "shopperEmail",
"type": "string"
},
{
"name": "authCode",
"baseName": "authCode",
"type": "string"
},
{
"name": "cardSummary",
"baseName": "cardSummary",
"type": "string"
},
{
"name": "expiryDate",
"baseName": "expiryDate",
"type": "string"
},
{
"name": "authorisedAmountValue",
"baseName": "authorisedAmountValue",
"type": "string"
},
{
"name": "authorisedAmountCurrency",
"baseName": "authorisedAmountCurrency",
"type": "string"
},
{
"name": "hmacSignature",
"baseName": "hmacSignature",
"type": "string"
},
{
"name": "paymentLinkId",
"baseName": "paymentLinkId",
"type": "string"
}
];
static getAttributeTypeMap() {
return AdditionalData.attributeTypeMap;
}
}

View File

@@ -16,8 +16,7 @@
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
export * from './additionalData';
export * from './amount';
export * from './notification';
export * from './notificationItem';
@@ -36,7 +35,6 @@ export interface RequestDetailedFile {
export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;
import { AdditionalData } from './additionalData';
import { Amount } from './amount';
import { Notification } from './notification';
import { NotificationItem } from './notificationItem';
@@ -61,7 +59,6 @@ let enumsMap: {[index: string]: any} = {
}
let typeMap: {[index: string]: any} = {
"AdditionalData": AdditionalData,
"Amount": Amount,
"Notification": Notification,
"NotificationItem": NotificationItem,

View File

@@ -29,11 +29,10 @@
* Do not edit the class manually.
*/
import { AdditionalData } from './additionalData';
import { Amount } from './amount';
export class NotificationRequestItem {
'additionalData'?: AdditionalData;
'additionalData'?: { [key: string]: string; };
'amount': Amount;
/**
* 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.