@adyen/api-library
Version:
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
43 lines (42 loc) • 2.58 kB
TypeScript
import Service from "../../service";
import Client from "../../client";
import { IRequest } from "../../typings/requestOptions";
import { CloudDeviceApiRequest } from "../../typings/clouddevice/cloudDeviceApiRequest";
import { CloudDeviceApiResponse } from "../../typings/clouddevice/cloudDeviceApiResponse";
import { CloudDeviceApiAsyncResponse } from "../../typings/clouddevice/cloudDeviceApiAsyncResponse";
import { EncryptionCredentialDetails } from "../../security/clouddevice/encryptionCredentialDetails";
/**
* Cloud Device API service with encrypted payloads.
*/
export declare class EncryptedCloudDeviceApi extends Service {
private readonly API_BASEPATH;
private baseUrl;
private readonly nexoSecurityManager;
constructor(client: Client, encryptionCredentialDetails: EncryptionCredentialDetails);
/**
* @summary Send a Terminal API request with encryption and receive a synchronous decrypted response
* @param merchantAccount {@link string } The unique identifier of the merchant account. (required)
* @param deviceId {@link string } The unique identifier of the payment device. Must match POIID in the MessageHeader. (required)
* @param cloudDeviceApiRequest {@link CloudDeviceApiRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link CloudDeviceApiResponse }
*/
sync(merchantAccount: string, deviceId: string, cloudDeviceApiRequest: CloudDeviceApiRequest, requestOptions?: IRequest.Options): Promise<CloudDeviceApiResponse>;
/**
* @summary Send a Terminal API request with encryption and receive an asynchronous response
* @param merchantAccount {@link string } The unique identifier of the merchant account. (required)
* @param deviceId {@link string } The unique identifier of the payment device. Must match POIID in the MessageHeader. (required)
* @param cloudDeviceApiRequest {@link CloudDeviceApiRequest }
* @param requestOptions {@link IRequest.Options }
* @return {@link CloudDeviceApiAsyncResponse }
*/
async(merchantAccount: string, deviceId: string, cloudDeviceApiRequest: CloudDeviceApiRequest, requestOptions?: IRequest.Options): Promise<CloudDeviceApiAsyncResponse>;
/**
* Decrypt an event notification payload.
*
* @param payload JSON string containing either a SaleToPOIResponse or SaleToPOIRequest envelope.
* @return the decrypted payload as a JSON string
* @throws NexoSecurityException when decryption fails or the payload is invalid
*/
decryptNotification(payload: string): string;
}