mirror of
https://github.com/jlengrand/adyen-node-api-library.git
synced 2026-03-17 23:51:21 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d800ac8bcc | ||
|
|
63c8357bad | ||
|
|
bb983fe4b7 | ||
|
|
c6c3c97327 | ||
|
|
d64dbaaf32 | ||
|
|
7e45720ae8 | ||
|
|
2a7ceee216 | ||
|
|
e20a426703 | ||
|
|
a4314a9e31 | ||
|
|
818574f222 | ||
|
|
b500101c02 |
2
Makefile
2
Makefile
@@ -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 \
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
"hmacSignature": "OzDjCMZIsdtDqrZ+cl\/FWC+WdESrorctXTzAzW33dXI=",
|
||||
"NAME2": " VALUE2 ",
|
||||
"fraudCheck-6-ShopperIpUsage": "10",
|
||||
"paymentLinkId": "ABCDEFG"
|
||||
"paymentLinkId": "ABCDEFG",
|
||||
"realtimeAccountUpdaterStatus": "status"
|
||||
},
|
||||
"amount": {
|
||||
"currency": "EUR",
|
||||
|
||||
@@ -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]
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user