Package com.adyen.service.clouddevice
Class EncryptedCloudDeviceApi
- java.lang.Object
-
- com.adyen.Service
-
- com.adyen.service.clouddevice.EncryptedCloudDeviceApi
-
public class EncryptedCloudDeviceApi extends Service
Service of the Cloud Device API with encrypted payloads
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPI_VERSIONprotected StringbaseURL
-
Constructor Summary
Constructors Constructor Description EncryptedCloudDeviceApi(Client client, EncryptionCredentialDetails encryptionCredentialDetails)EncryptedCloudDeviceApi constructor.EncryptedCloudDeviceApi(Client client, String baseURL, EncryptionCredentialDetails encryptionCredentialDetails)EncryptedCloudDeviceApi constructor with a custom base URL for routing or testing purposes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CloudDeviceApiAsyncResponseasync(String merchantAccount, String deviceId, CloudDeviceApiRequest cloudDeviceApiRequest)Send an asynchronous encrypted request.StringdecryptNotification(String payload)Decrypt an event notification.CloudDeviceApiResponsesync(String merchantAccount, String deviceId, CloudDeviceApiRequest cloudDeviceApiRequest)Send a synchronous encrypted request.-
Methods inherited from class com.adyen.Service
createBaseURL, getClient, isApiKeyRequired, setApiKeyRequired, setClient
-
-
-
-
Field Detail
-
API_VERSION
public static final String API_VERSION
- See Also:
- Constant Field Values
-
baseURL
protected String baseURL
-
-
Constructor Detail
-
EncryptedCloudDeviceApi
public EncryptedCloudDeviceApi(Client client, EncryptionCredentialDetails encryptionCredentialDetails) throws NexoSecurityException
EncryptedCloudDeviceApi constructor.- Parameters:
client-Client(required)encryptionCredentialDetails-EncryptionCredentialDetails(required)- Throws:
NexoSecurityException- if the encryption credentials are invalid
-
EncryptedCloudDeviceApi
public EncryptedCloudDeviceApi(Client client, String baseURL, EncryptionCredentialDetails encryptionCredentialDetails) throws NexoSecurityException
EncryptedCloudDeviceApi constructor with a custom base URL for routing or testing purposes.- Parameters:
client-Client(required)baseURL-String(required)encryptionCredentialDetails-EncryptionCredentialDetails(required)- Throws:
NexoSecurityException- if the encryption credentials are invalid
-
-
Method Detail
-
sync
public CloudDeviceApiResponse sync(String merchantAccount, String deviceId, CloudDeviceApiRequest cloudDeviceApiRequest) throws ApiException, IOException, NexoSecurityException
Send a synchronous encrypted request.- Parameters:
merchantAccount- The unique identifier of the merchant accountdeviceId- The unique identifier of the device that you send this request to (must match POIID in the MessageHeader).cloudDeviceApiRequest- The request to send.- Returns:
- instance of CloudDeviceApiResponse
- Throws:
ApiException- when an error occursIOException- when an I/O error occursNexoSecurityException- when encryption or decryption fails
-
async
public CloudDeviceApiAsyncResponse async(String merchantAccount, String deviceId, CloudDeviceApiRequest cloudDeviceApiRequest) throws ApiException, IOException, NexoSecurityException
Send an asynchronous encrypted request.- Parameters:
merchantAccount- The unique identifier of the merchant accountdeviceId- The unique identifier of the device that you send this request to (must match POIID in the MessageHeader).cloudDeviceApiRequest- The request to send.- Returns:
CloudDeviceApiAsyncResponsewith result "ok" on success, or the decrypted EventNotification details on failure- Throws:
ApiException- when an error occursIOException- when an I/O error occursNexoSecurityException- when encryption or decryption fails
-
decryptNotification
public String decryptNotification(String payload) throws NexoSecurityException
Decrypt an event notification.- Parameters:
payload- Event notification in JSON string format: it can be SaleToPOIResponse (async response) or SaleToPOIRequest (event notification)- Returns:
- the decrypted payload
- Throws:
NexoSecurityException- when decryption fails
-
-