diff --git a/.gitignore b/.gitignore index f17b03d2e..2b6869c34 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ **/target/** .DS_Store .vscode + +# test configuration +src/test/resources/config.properties \ No newline at end of file diff --git a/README.md b/README.md index 82a201592..798d2b8ec 100644 --- a/README.md +++ b/README.md @@ -15,26 +15,26 @@ The Library supports all APIs under the following services: | [BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | BinLookup | **v54** | | [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | Our latest integration for accepting online payments. | Checkout | **v71** | | [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | balanceplatform package subclasses | **v2** | +| [Cloud device API](https://docs.adyen.com/api-explorer/cloud-device-api/1/overview) | Cloud Device point-of-sale integration. | clouddevice package subclasses | **v1** | | [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | DataProtection | **v1** | +| [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview) | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes. | DisputesApi | **v30** | | [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | Manage legal entities that contain information required for verification. | legalentitymanagement package subclasses | **v3** | | [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference) | Our point-of-sale integration. | TerminalLocalAPI or TerminalCloudAPI | **v1** | | [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | management package subclasses | **v3** | | [Open Banking API](https://docs.adyen.com/api-explorer/open-banking/1/overview) | The Open Banking API provides secure endpoints to share financial data and services with third parties. | openbanking package subclasses | **v1** | | [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | Our classic integration for online payments. | Payment | **v68** | +| [Payments App API](https://docs.adyen.com/api-explorer/payments-app/1/overview) | The Payments App API is used to Board and manage the Adyen Payments App on your Android mobile devices. | PaymentsAppApi | **v1** | | [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | Endpoints for sending funds to your customers. | Payout | **v68** | +| [POS Mobile API](https://docs.adyen.com/api-explorer/possdk/68/overview) | The POS Mobile API is used in the mutual authentication flow between an Adyen Android or iOS [POS Mobile SDK](https://docs.adyen.com/point-of-sale/ipp-mobile/) and the Adyen payments platform. The POS Mobile SDK for Android or iOS devices enables businesses to accept in-person payments using a commercial off-the-shelf (COTS) device like a phone. For example, Tap to Pay transactions, or transactions on a mobile device in combination with a card reader | POS Mobile | **v68** | | [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | ~~Endpoints for managing your point-of-sale payment terminals.~~ ‼️ **Deprecated**: use instead the [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview) for the management of your terminal fleet. | ~~TerminalManagement~~ | ~~**v1**~~ | | [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | Endpoints for managing saved payment details. | Recurring | **v68** | | [Session Authentication API](https://docs.adyen.com/api-explorer/sessionauthentication/1/overview) | Create and manage the JSON Web Tokens (JWT) required for integrating [Onboarding](https://docs.adyen.com/platforms/onboard-users/components) and [Platform Experience](https://docs.adyen.com/platforms/build-user-dashboards) components. | SessionAuthentication | **v1** | | [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | Manage both online and point-of-sale gift cards and other stored-value cards. | StoredValue | **v46** | | [Transfers API](https://docs.adyen.com/api-explorer/transfers/4/overview) | The Transfers API provides endpoints that can be used to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | Transfers | **v4** | -| [Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | Adyen uses webhooks to send notifications about payment status updates, newly available reports, and other events that can be subscribed to. For more information, refer to our [documentation](https://docs.adyen.com/development-resources/webhooks). | *Models only* | **v1** | | [Classic Platforms Account API](https://docs.adyen.com/api-explorer/Account/6/overview) | This API is used for the classic integration. If you are just starting your implementation, refer to our new integration guide instead. | ClassicPlatformAccountApi | **v6** | | [Classic Platforms Fund API](https://docs.adyen.com/api-explorer/Fund/6/overview) | This API is used for the classic integration. If you are just starting your implementation, refer to our new integration guide instead. | ClassicPlatformFundApi | **v6** | | [Classic Platforms Hosted Onboarding Page API](https://docs.adyen.com/api-explorer/Hop/6/overview) | This API is used for the classic integration. If you are just starting your implementation, refer to our new integration guide instead. | ClassicPlatformHopApi | **v6** | | [Classic Platforms Notification Configuration API](https://docs.adyen.com/api-explorer/NotificationConfiguration/6/overview) | This API is used for the classic integration. If you are just starting your implementation, refer to our new integration guide instead. | ClassicPlatformConfigurationApi | **v6** | -| [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview) | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes. | DisputesApi | **v30** | -| [POS Mobile API](https://docs.adyen.com/api-explorer/possdk/68/overview) | The POS Mobile API is used in the mutual authentication flow between an Adyen Android or iOS [POS Mobile SDK](https://docs.adyen.com/point-of-sale/ipp-mobile/) and the Adyen payments platform. The POS Mobile SDK for Android or iOS devices enables businesses to accept in-person payments using a commercial off-the-shelf (COTS) device like a phone. For example, Tap to Pay transactions, or transactions on a mobile device in combination with a card reader | POS Mobile | **v68** | -| [Payments App API](https://docs.adyen.com/api-explorer/payments-app/1/overview) | The Payments App API is used to Board and manage the Adyen Payments App on your Android mobile devices. | PaymentsAppApi | **v1** | ## Supported Webhook versions The library supports all webhooks under the following model directories: @@ -49,9 +49,9 @@ The library supports all webhooks under the following model directories: | [Negative Balance Warning Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | Adyen sends this webhook to inform you about a balance account whose balance has been negative for a given number of days. | [negativebalancewarningwebhooks](src/main/java/com/adyen/model/negativebalancewarningwebhooks) | **v1** | | [Notification Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | We use webhooks to send you updates about payment status updates, newly available reports, and other events that you can subscribe to. For more information, refer to our documentation | [notification](src/main/java/com/adyen/model/notification) | **v1** | | [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/3/overview) | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API | [managementwebhooks](src/main/java/com/adyen/model/managementwebhooks) | **v3** | -| [Classic Platform Webhooks](https://docs.adyen.com/api-explorer/Notification/6/overview#retry) | The Notification API sends notifications to the endpoints specified in a given subscription. Subscriptions are managed through the Notification Configuration API. The API specifications listed here detail the format of each notification. | [marketpaywebhooks](src/main/java/com/adyen/model/marketpaywebhooks) | **v6** | | [Transaction Webhooks](https://docs.adyen.com/api-explorer/transaction-webhooks/4/overview) | Adyen sends webhooks to inform your system about incoming and outgoing transfers in your platform. You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [transactionwebhooks](src/main/java/com/adyen/model/transactionwebhooks) | **v4** | | [Tokenization Webhooks](https://docs.adyen.com/api-explorer/Tokenization-webhooks/1/overview) | Adyen sends webhooks to inform you about the creation and changes to the recurring tokens. | [tokenizationwebhooks](src/main/java/com/adyen/model/tokenizationwebhooks) | **v1** | +| [Classic Platform Webhooks](https://docs.adyen.com/api-explorer/Notification/6/overview#retry) | The Notification API sends notifications to the endpoints specified in a given subscription. Subscriptions are managed through the Notification Configuration API. The API specifications listed here detail the format of each notification. | [marketpaywebhooks](src/main/java/com/adyen/model/marketpaywebhooks) | **v6** | For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/). @@ -313,260 +313,25 @@ try { System.out.println(error.getInvalidFields()); } ``` +## In-person payments integration -## Using the Cloud Terminal API Integration -In order to submit In-Person requests with [Terminal API over Cloud](https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/cloud/) you need to initialize the client in a similar way as the steps listed above for Ecommerce transactions, but make sure to include `TerminalCloudAPI`: -``` java -// Step 1: Import the required classes -import com.adyen.Client; -import com.adyen.enums.Environment; -import com.adyen.service.TerminalCloudAPI; -import com.adyen.model.nexo.*; -import com.adyen.model.terminal.*; +Build a feature-rich [in-person payments](https://docs.adyen.com/point-of-sale/) integrations that accept payments around the world, with global and local payment methods and create a unique shopping experience for your customers. -// Step 2: Initialize the client object -Client client = new Client("Your YOUR_API_KEY", Environment.TEST); +### Using the Cloud Device API -// for LIVE environment use -// Config config = new Config(); -// config.setEnvironment(Environment.LIVE); -// config.setTerminalApiRegion(Region.EU); -// Client client = new Client(config); - -// Step 3: Initialize the API object -TerminalCloudAPI terminalCloudApi = new TerminalCloudAPI(client); - -// Step 4: Create the request object -String serviceID = "123456789"; -String saleID = "POS-SystemID12345"; -String POIID = "Your Device Name(eg V400m-123456789)"; - -// Use a unique transaction for every other transaction you perform -String transactionID = "TransactionID"; -TerminalAPIRequest terminalAPIRequest = new TerminalAPIRequest(); -SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); - -MessageHeader messageHeader = new MessageHeader(); -messageHeader.setMessageClass(MessageClassType.SERVICE); -messageHeader.setMessageCategory(MessageCategoryType.PAYMENT); -messageHeader.setMessageType(MessageType.REQUEST); -messageHeader.setProtocolVersion("3.0"); -messageHeader.setServiceID(serviceID); -messageHeader.setSaleID(saleID); -messageHeader.setPOIID(POIID); - -saleToPOIRequest.setMessageHeader(messageHeader); - -com.adyen.model.nexo.PaymentRequest paymentRequest = new com.adyen.model.nexo.PaymentRequest(); -SaleData saleData = new SaleData(); -TransactionIdentification transactionIdentification = new TransactionIdentification(); -transactionIdentification.setTransactionID("001"); -XMLGregorianCalendar timestamp = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()); -transactionIdentification.setTimeStamp(timestamp); -saleData.setSaleTransactionID(transactionIdentification); - -SaleToAcquirerData saleToAcquirerData = new SaleToAcquirerData(); -ApplicationInfo applicationInfo = new ApplicationInfo(); -CommonField merchantApplication = new CommonField(); -merchantApplication.setVersion("1"); -merchantApplication.setName("Test"); -applicationInfo.setMerchantApplication(merchantApplication); -saleToAcquirerData.setApplicationInfo(applicationInfo); -saleData.setSaleToAcquirerData(saleToAcquirerData); - -PaymentTransaction paymentTransaction = new PaymentTransaction(); -AmountsReq amountsReq = new AmountsReq(); -amountsReq.setCurrency("EUR"); -amountsReq.setRequestedAmount(BigDecimal.valueOf(1000)); -paymentTransaction.setAmountsReq(amountsReq); - -paymentRequest.setPaymentTransaction(paymentTransaction); -paymentRequest.setSaleData(saleData); - -saleToPOIRequest.setPaymentRequest(paymentRequest); - -terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest); - -// Step 5: Make the request -TerminalAPIResponse terminalAPIResponse = terminalCloudApi.sync(terminalAPIRequest); -``` +For In-Person Payments integrations, the recommended solution is the [Cloud Device API](https://docs.adyen.com/api-explorer/cloud-device-api/1/overview). -### Optional: perform an abort request - -To perform an [abort request](https://docs.adyen.com/point-of-sale/basic-tapi-integration/cancel-a-transaction/) you can use the following example: -``` java -TerminalAPIRequest terminalAPIRequest = new TerminalAPIRequest(); -SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); - -MessageHeader messageHeader = new MessageHeader(); -messageHeader.setMessageClass(MessageClassType.SERVICE); -messageHeader.setMessageCategory(MessageCategoryType.ABORT); -messageHeader.setMessageType(MessageType.REQUEST); -messageHeader.setProtocolVersion("3.0"); -messageHeader.setServiceID("Different service ID"); -messageHeader.setSaleID(saleID); -messageHeader.setPOIID(POIID); - -AbortRequest abortRequest = new AbortRequest(); -abortRequest.setAbortReason("MerchantAbort"); -MessageReference messageReference = new MessageReference(); -messageReference.setMessageCategory(MessageCategoryType.PAYMENT); -messageReference.setSaleID(saleID); -messageReference.setPOIID(POIID); -// Service ID of the payment you're aborting -messageReference.setServiceID(serviceID); -abortRequest.setMessageReference(messageReference); - -saleToPOIRequest.setAbortRequest(abortRequest); -saleToPOIRequest.setMessageHeader(messageHeader); - -terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest); - -TerminalAPIResponse terminalAPIResponse = terminalCloudApi.sync(terminalAPIRequest); -``` +Check the [Cloud Device API README](doc/CloudDeviceApi.md). -### Optional: perform a status request +### Using the Terminal API -To perform a [status request](https://docs.adyen.com/point-of-sale/basic-tapi-integration/verify-transaction-status/) you can use the following example: -```java -TerminalAPIRequest terminalAPIRequest = new TerminalAPIRequest(); -SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); - -MessageHeader messageHeader = new MessageHeader(); -messageHeader.setMessageClass(MessageClassType.SERVICE); -messageHeader.setMessageCategory(MessageCategoryType.TRANSACTION_STATUS); -messageHeader.setMessageType(MessageType.REQUEST); -messageHeader.setProtocolVersion("3.0"); -messageHeader.setServiceID("Different service ID"); -messageHeader.setSaleID(saleID); -messageHeader.setPOIID(POIID); - -TransactionStatusRequest transactionStatusRequest = new TransactionStatusRequest(); -transactionStatusRequest.setReceiptReprintFlag(true); -transactionStatusRequest.getDocumentQualifier().add(DocumentQualifierType.CASHIER_RECEIPT); -transactionStatusRequest.getDocumentQualifier().add(DocumentQualifierType.CUSTOMER_RECEIPT); -MessageReference messageReference = new MessageReference(); -messageReference.setMessageCategory(MessageCategoryType.PAYMENT); -messageReference.setSaleID(saleID); -// serviceID of the transaction you want the status update from -messageReference.setServiceID(serviceID); -transactionStatusRequest.setMessageReference(messageReference); - -saleToPOIRequest.setTransactionStatusRequest(transactionStatusRequest); -saleToPOIRequest.setMessageHeader(messageHeader); - -terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest); - -TerminalAPIResponse terminalAPIResponse = terminalCloudApi.sync(terminalAPIRequest); -``` +With the [Terminal API](https://docs.adyen.com/api-explorer/terminal-api/1/overview) you can send and receive Terminal API messages in the following ways: -### Helper classes +* Local communications: using your local network, your POS system sends the request directly to the IP address of the terminal, and receives the result synchronously. +* Cloud communications: using the internet to access the cloud `/sync` and `/async` endpoints. You should consider adopting the [Cloud Device API](doc/CloudDeviceApi.md) instead. -Use `PredefinedContentHelper` to parse Display notification types which you find in `PredefinedContent->ReferenceID` -```java -PredefinedContentHelper helper = new PredefinedContentHelper(predefinedContent.getReferenceID()); - -// Safely extract and use the event type with Optional -helper.getEvent().ifPresent(event -> { - System.out.println("Received event: " + event); - if (event == PredefinedContentHelper.DisplayNotificationEvent.PIN_ENTERED) { - // Handle PIN entry event - System.out.println("The user has entered their PIN."); - } -}); -``` - -## Using the Local Terminal API Integration -The request and response payloads are identical to the Cloud Terminal API, however, additional encryption details are required to perform the requests. -### Local terminal API Using Keystore -~~~~ java -// Import the required classes -import com.adyen.Client; -import com.adyen.Config; -import com.adyen.enums.Environment; -import com.adyen.httpclient.TerminalLocalAPIHostnameVerifier; -import com.adyen.service.TerminalLocalAPI; -import com.adyen.model.terminal.security.*; -import com.adyen.model.terminal.*; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManagerFactory; -import java.security.KeyStore; -import java.security.SecureRandom; - -// Create a KeyStore for the terminal certificate -KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); -keyStore.load(null, null); -keyStore.setCertificateEntry("adyenRootCertificate", adyenRootCertificate); - -// Create a TrustManagerFactory that trusts the CAs in our KeyStore -TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); -trustManagerFactory.init(keyStore); - -// Create an SSLContext with the desired protocol that uses our TrustManagers -SSLContext sslContext = SSLContext.getInstance("SSL"); -sslContext.init(null, trustManagerFactory.getTrustManagers(), new SecureRandom()); - -// Configure a client for TerminalLocalAPI -Config config = new Config(); -config.setEnvironment(environment); -config.setTerminalApiLocalEndpoint("https://" + terminalIpAddress); -config.setSSLContext(sslContext); -config.setHostnameVerifier(new TerminalLocalAPIHostnameVerifier(environment)); -Client client = new Client(config); - -// Create your SecurityKey object used for encrypting the payload (keyIdentifier/passphrase you set up beforehand in CA) -SecurityKey securityKey = new SecurityKey(); -securityKey.setKeyVersion(1); -securityKey.setAdyenCryptoVersion(1); -securityKey.setKeyIdentifier("keyIdentifier"); -securityKey.setPassphrase("passphrase"); - -// Use TerminalLocalAPI -TerminalLocalAPI terminalLocalAPI = new TerminalLocalAPI(client, securityKey); -TerminalAPIResponse terminalAPIResponse = terminalLocalAPI.request(terminalAPIRequest); -~~~~ - -## Using Attachments in Document API -When using Attachments, ensure content is provided as a byte array. It's important to convert it to a [Base64-encoded string](https://docs.adyen.com/api-explorer/legalentity/3/post/documents#request-attachments) before initiating the request. - -## Using the Local Terminal API Integration without Encryption (Only on TEST) -If you wish to develop the Local Terminal API integration parallel to your encryption implementation, you can opt for the unencrypted version. Be sure to remove any encryption details from the CA terminal config page. Consider this ONLY for development and testing on localhost. -```java -// Step 1: Import the required classes -import com.adyen.service.TerminalLocalAPI; -import com.adyen.model.nexo.*; -import com.adyen.model.terminal.*; -import javax.net.ssl.SSLContext; - -// Step 2: Add your Certificate Path and Local Endpoint to the config path. -Client client = new Client(); -client.getConfig().setTerminalApiLocalEndpoint("The IP of your terminal (eg https://192.168.47.169)"); -client.getConfig().setEnvironment(Environment.TEST); -config.setSSLContext(createTrustSSLContext()); // Trust all certificates for testing only -client.setConfig(config); - -// Step 3: Create an SSL context that accepts all certificates (Use in TEST only). -SSLContext createTrustSSLContext() throws Exception { - TrustManager[] trustAllCerts = new TrustManager[]{ - new X509TrustManager() { - java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } - checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {} - checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {} - } - }; - SSLContext sc = SSLContext.getInstance("SSL"); - sc.init(null, trustAllCerts, new java.security.SecureRandom()); - return sc; -} - -// Step 4: Construct a TerminalAPIRequest object -Gson gson = new GsonBuilder().create(); -TerminalAPIRequest terminalAPIPaymentRequest = new TerminalAPIRequest(); - -// Step 5: Make the request -TerminalAPIResponse terminalAPIResponse = terminalLocalAPI.request(terminalAPIRequest); -``` +Check the [Terminal API README](doc/TerminalApi.md). ### Example integrations @@ -579,15 +344,12 @@ These include commented code, highlighting key features and concepts, and exampl ## Feedback We value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas. -## Contributing - +## Contributing We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. - Have a look at our [contributing guidelines](CONTRIBUTING.md) to find out how to raise a pull request. - ## Support If you have a feature request, or spotted a bug or a technical problem, [create an issue here](https://github.com/Adyen/adyen-java-api-library/issues/new/choose). @@ -596,8 +358,7 @@ For other questions, [contact our Support Team](https://www.adyen.help/hc/en-us/ ## Licence This repository is available under the [MIT license](https://github.com/Adyen/adyen-java-api-library/blob/main/LICENSE). - - + ## See also * Example integrations: diff --git a/doc/CloudDeviceApi.md b/doc/CloudDeviceApi.md new file mode 100644 index 000000000..adfcf5bdd --- /dev/null +++ b/doc/CloudDeviceApi.md @@ -0,0 +1,156 @@ +# Cloud Device API + +The [Cloud Device API](https://docs.adyen.com/api-explorer/cloud-device-api/1/overview) is our solution to create best-in-class in-person payments integrations. + +With the Cloud device API you can: + +- send Terminal API requests to a cloud endpoint. You can use this communication method when it is not an option to send Terminal API requests over your local network directly to a payment terminal. +- check the cloud connection of a payment terminal or of a device used in a Mobile solution for in-person payments. + +## Benefits of the Cloud Device API + +The Cloud Device API offers the following benefits: +- access to API logs in the Customer Area for troubleshooting errors +- using a version strategy for the API endpoints for controlled and safer rollouts +- improved reliability and security (OAuth support) + +New features and products will be released exclusively on the Cloud Device API + +## Use the Cloud Device API + +### Setup + +First you must initialise the Client **setting the closest** [Region](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/#cloud): +``` java +// Import the required classes +import com.adyen.Client; +import com.adyen.enums.Environment; +import com.adyen.service.checkout.PaymentsApi; +import com.adyen.model.checkout.*; + +// Setup Client and Service +Client client = new Client("Your X-API-KEY", Environment.TEST); +CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + +``` + +### Send a payment SYNC request + +```java + +SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); + +MessageHeader messageHeader = new MessageHeader(); + messageHeader.setProtocolVersion("3.0"); + messageHeader.setMessageClass(MessageClassType.SERVICE); + messageHeader.setMessageCategory(MessageCategoryType.PAYMENT); + messageHeader.setMessageType(MessageType.REQUEST); + messageHeader.setSaleID("001"); + messageHeader.setServiceID("001"); + messageHeader.setPOIID("P400Plus-123456789"); + + saleToPOIRequest.setMessageHeader(messageHeader); + +PaymentRequest paymentRequest = new PaymentRequest(); + +SaleData saleData = new SaleData(); +TransactionIdentification transactionIdentification = new TransactionIdentification(); + transactionIdentification.setTransactionID("001"); +OffsetDateTime timestamp = OffsetDateTime.now(ZoneOffset.UTC); + transactionIdentification.setTimeStamp(timestamp); + saleData.setSaleTransactionID(transactionIdentification); + +PaymentTransaction paymentTransaction = new PaymentTransaction(); +AmountsReq amountsReq = new AmountsReq(); + amountsReq.setCurrency("EUR"); + amountsReq.setRequestedAmount(BigDecimal.ONE); + paymentTransaction.setAmountsReq(amountsReq); + + paymentRequest.setSaleData(saleData); + paymentRequest.setPaymentTransaction(paymentTransaction); + + saleToPOIRequest.setPaymentRequest(paymentRequest); + +CloudDeviceApiRequest cloudDeviceApiRequest = new CloudDeviceApiRequest(); + cloudDeviceApiRequest.setSaleToPOIRequest(saleToPOIRequest); + +var response = cloudDeviceApi.sendSync("myMerchant", "P400Plus-123456789", cloudDeviceApiRequest); + +``` + + +### Send a payment ASYNC request + +If you choose to receive the response asynchronously, you only need to use a different method (`sendAsync`). +Don't forget to set up [event notifications](https://docs.adyen.com/point-of-sale/design-your-integration/notifications/event-notifications/) in the CA to be able to receive the Cloud Device API responses. + +```java + +... + +// define the request (same as per sendSync) +CloudDeviceApiRequest cloudDeviceApiRequest = new CloudDeviceApiRequest(); +cloudDeviceApiRequest.setSaleToPOIRequest(saleToPOIRequest); + +CloudDeviceApiAsyncResponse response = cloudDeviceApi.sendAsync("myMerchant", "P400Plus-123456789", cloudDeviceApiRequest); + +// +if("ok".equals(response.getResult())) { + + // success +} else { + // request failed: see details in the EventNotification object + EventNotification eventNotification = response.getSaleToPOIRequest().getEventNotification(); +} +``` + +### Verify the status of the terminals + + +The Cloud Device API allows your integration to check the status of the terminals. + +```java + +// list of payment terminals or SDK mobile installation IDs +ConnectedDevicesResponse response = cloudDeviceApi.getConnectedDevices("myMerchant"); +System.out.println(response.getUniqueDeviceIds()); + +// check the payment terminal or SDK mobile installation ID +DeviceStatusResponse response = cloudDeviceApi.getDeviceStatus("myMerchant", "AMS1-000168242800763"); +System.out.println(response.getStatus()); +``` + +### Protect cloud communication + +The Adyen Java library supports encrypting request and response payloads, allowing you to secure communication between your integration and the cloud. + +```java + +// Encryption credentials from the Terminal configuration on CA +EncryptionCredentialDetails encryptionCredentialDetails = + new EncryptionCredentialDetails() + .adyenCryptoVersion(0) + .keyIdentifier("CryptoKeyIdentifier12345") + .keyVersion(0) + .passphrase("p@ssw0rd123456"); + +var response = + cloudDeviceApi.sendEncryptedSync( + "TestMerchantAccount", + "V400m-123456789", + cloudDeviceApiRequest, + encryptionCredentialDetails); + +System.out.println(response); +``` + +In case of asynchronous integration, you can decrypt the payload of the event notifications using `decryptNotification()` method. + +```java +// JSON with encrypted SaleToPOIResponse (for async responses) or SaleToPOIRequest (for event notifications) +var payload = "..."; + +var response = cloudDeviceApi.decryptNotification(payload, encryptionCredentialDetails); +System.out.println(response); + +``` \ No newline at end of file diff --git a/doc/TerminalApi.md b/doc/TerminalApi.md new file mode 100644 index 000000000..e515166af --- /dev/null +++ b/doc/TerminalApi.md @@ -0,0 +1,249 @@ +### Using the Terminal API +For In-Person Payments integrations with the [Cloud Terminal API](https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/cloud/), you must initialise the Client **setting the closest** [Region](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/#cloud): +``` java +// Step 1: Import the required classes +import com.adyen.Client; +import com.adyen.enums.Environment; +import com.adyen.service.TerminalCloudAPI; +import com.adyen.model.nexo.*; +import com.adyen.model.terminal.*; + +// Step 2: Initialize the client object +Client client = new Client("Your YOUR_API_KEY", Environment.TEST); + +// for LIVE environment use +// Config config = new Config(); +// config.setEnvironment(Environment.LIVE); +// config.setTerminalApiRegion(Region.EU); +// Client client = new Client(config); + +// Step 3: Initialize the API object +TerminalCloudAPI terminalCloudApi = new TerminalCloudAPI(client); + +// Step 4: Create the request object +String serviceID = "123456789"; +String saleID = "POS-SystemID12345"; +String POIID = "Your Device Name(eg V400m-123456789)"; + +// Use a unique transaction for every other transaction you perform +String transactionID = "TransactionID"; +TerminalAPIRequest terminalAPIRequest = new TerminalAPIRequest(); +SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); + +MessageHeader messageHeader = new MessageHeader(); +messageHeader.setMessageClass(MessageClassType.SERVICE); +messageHeader.setMessageCategory(MessageCategoryType.PAYMENT); +messageHeader.setMessageType(MessageType.REQUEST); +messageHeader.setProtocolVersion("3.0"); +messageHeader.setServiceID(serviceID); +messageHeader.setSaleID(saleID); +messageHeader.setPOIID(POIID); + +saleToPOIRequest.setMessageHeader(messageHeader); + +com.adyen.model.nexo.PaymentRequest paymentRequest = new com.adyen.model.nexo.PaymentRequest(); +SaleData saleData = new SaleData(); +TransactionIdentification transactionIdentification = new TransactionIdentification(); +transactionIdentification.setTransactionID("001"); +XMLGregorianCalendar timestamp = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()); +transactionIdentification.setTimeStamp(timestamp); +saleData.setSaleTransactionID(transactionIdentification); + +SaleToAcquirerData saleToAcquirerData = new SaleToAcquirerData(); +ApplicationInfo applicationInfo = new ApplicationInfo(); +CommonField merchantApplication = new CommonField(); +merchantApplication.setVersion("1"); +merchantApplication.setName("Test"); +applicationInfo.setMerchantApplication(merchantApplication); +saleToAcquirerData.setApplicationInfo(applicationInfo); +saleData.setSaleToAcquirerData(saleToAcquirerData); + +PaymentTransaction paymentTransaction = new PaymentTransaction(); +AmountsReq amountsReq = new AmountsReq(); +amountsReq.setCurrency("EUR"); +amountsReq.setRequestedAmount(BigDecimal.valueOf(1000)); +paymentTransaction.setAmountsReq(amountsReq); + +paymentRequest.setPaymentTransaction(paymentTransaction); +paymentRequest.setSaleData(saleData); + +saleToPOIRequest.setPaymentRequest(paymentRequest); + +terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest); + +// Step 5: Make the request +TerminalAPIResponse terminalAPIResponse = terminalCloudApi.sync(terminalAPIRequest); +``` + +#### Optional: perform an abort request + +To perform an [abort request](https://docs.adyen.com/point-of-sale/basic-tapi-integration/cancel-a-transaction/) you can use the following example: +``` java +TerminalAPIRequest terminalAPIRequest = new TerminalAPIRequest(); +SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); + +MessageHeader messageHeader = new MessageHeader(); +messageHeader.setMessageClass(MessageClassType.SERVICE); +messageHeader.setMessageCategory(MessageCategoryType.ABORT); +messageHeader.setMessageType(MessageType.REQUEST); +messageHeader.setProtocolVersion("3.0"); +messageHeader.setServiceID("Different service ID"); +messageHeader.setSaleID(saleID); +messageHeader.setPOIID(POIID); + +AbortRequest abortRequest = new AbortRequest(); +abortRequest.setAbortReason("MerchantAbort"); +MessageReference messageReference = new MessageReference(); +messageReference.setMessageCategory(MessageCategoryType.PAYMENT); +messageReference.setSaleID(saleID); +messageReference.setPOIID(POIID); +// Service ID of the payment you're aborting +messageReference.setServiceID(serviceID); +abortRequest.setMessageReference(messageReference); + +saleToPOIRequest.setAbortRequest(abortRequest); +saleToPOIRequest.setMessageHeader(messageHeader); + +terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest); + +TerminalAPIResponse terminalAPIResponse = terminalCloudApi.sync(terminalAPIRequest); +``` + +#### Optional: perform a status request + +To perform a [status request](https://docs.adyen.com/point-of-sale/basic-tapi-integration/verify-transaction-status/) you can use the following example: +``` java +TerminalAPIRequest terminalAPIRequest = new TerminalAPIRequest(); +SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); + +MessageHeader messageHeader = new MessageHeader(); +messageHeader.setMessageClass(MessageClassType.SERVICE); +messageHeader.setMessageCategory(MessageCategoryType.TRANSACTION_STATUS); +messageHeader.setMessageType(MessageType.REQUEST); +messageHeader.setProtocolVersion("3.0"); +messageHeader.setServiceID("Different service ID"); +messageHeader.setSaleID(saleID); +messageHeader.setPOIID(POIID); + +TransactionStatusRequest transactionStatusRequest = new TransactionStatusRequest(); +transactionStatusRequest.setReceiptReprintFlag(true); +transactionStatusRequest.getDocumentQualifier().add(DocumentQualifierType.CASHIER_RECEIPT); +transactionStatusRequest.getDocumentQualifier().add(DocumentQualifierType.CUSTOMER_RECEIPT); +MessageReference messageReference = new MessageReference(); +messageReference.setMessageCategory(MessageCategoryType.PAYMENT); +messageReference.setSaleID(saleID); +// serviceID of the transaction you want the status update from +messageReference.setServiceID(serviceID); +transactionStatusRequest.setMessageReference(messageReference); + +saleToPOIRequest.setTransactionStatusRequest(transactionStatusRequest); +saleToPOIRequest.setMessageHeader(messageHeader); + +terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest); + +TerminalAPIResponse terminalAPIResponse = terminalCloudApi.sync(terminalAPIRequest); +``` +### Helper classes + +Use `PredefinedContentHelper` to parse Display notification types which you find in `PredefinedContent->ReferenceID` +```java +PredefinedContentHelper helper = new PredefinedContentHelper(predefinedContent.getReferenceID()); + +// Safely extract and use the event type with Optional +helper.getEvent().ifPresent(event -> { + System.out.println("Received event: " + event); + if (event == PredefinedContentHelper.DisplayNotificationEvent.PIN_ENTERED) { + // Handle PIN entry event + System.out.println("The user has entered their PIN."); + } +}); +``` + +### Using the Local Terminal API Integration +The procedure to send In-Person requests using [Terminal API over Local Connection](https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/local/) is similar to the Cloud Terminal API one, however, additional encryption details are required to perform the requests. Make sure to [install the certificate as described here](https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/local/#protect-communications) +#### Local terminal API Using Keystore +```java +// Import the required classes +import com.adyen.Client; +import com.adyen.Config; +import com.adyen.enums.Environment; +import com.adyen.httpclient.TerminalLocalAPIHostnameVerifier; +import com.adyen.service.TerminalLocalAPI; +import com.adyen.model.terminal.security.*; +import com.adyen.model.terminal.*; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManagerFactory; +import java.security.KeyStore; +import java.security.SecureRandom; + +// Create a KeyStore for the terminal certificate +KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); +keyStore.load(null, null); +keyStore.setCertificateEntry("adyenRootCertificate", adyenRootCertificate); + +// Create a TrustManagerFactory that trusts the CAs in our KeyStore +TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); +trustManagerFactory.init(keyStore); + +// Create an SSLContext with the desired protocol that uses our TrustManagers +SSLContext sslContext = SSLContext.getInstance("SSL"); +sslContext.init(null, trustManagerFactory.getTrustManagers(), new SecureRandom()); + +// Configure a client for TerminalLocalAPI +Config config = new Config(); +config.setEnvironment(environment); +config.setTerminalApiLocalEndpoint("https://" + terminalIpAddress); +config.setSSLContext(sslContext); +config.setHostnameVerifier(new TerminalLocalAPIHostnameVerifier(environment)); +Client client = new Client(config); + +// Create your SecurityKey object used for encrypting the payload (keyIdentifier/passphrase you set up beforehand in CA) +SecurityKey securityKey = new SecurityKey(); +securityKey.setKeyVersion(1); +securityKey.setAdyenCryptoVersion(1); +securityKey.setKeyIdentifier("keyIdentifier"); +securityKey.setPassphrase("passphrase"); + +// Use TerminalLocalAPI +TerminalLocalAPI terminalLocalAPI = new TerminalLocalAPI(client, securityKey); +TerminalAPIResponse terminalAPIResponse = terminalLocalAPI.request(terminalAPIRequest); +``` + +#### Using the Local Terminal API Integration without Encryption (Only on TEST) +If you wish to develop the Local Terminal API integration parallel to your encryption implementation, you can opt for the unencrypted version. Be sure to remove any encryption details from the CA terminal config page. Consider this ONLY for development and testing on localhost. + +```java +// Step 1: Import the required classes +import com.adyen.service.TerminalLocalAPI; +import com.adyen.model.nexo.*; +import com.adyen.model.terminal.*; +import javax.net.ssl.SSLContext; + +// Step 2: Add your Certificate Path and Local Endpoint to the config path. +Client client = new Client(); +client.getConfig().setTerminalApiLocalEndpoint("The IP of your terminal (eg https://192.168.47.169)"); +client.getConfig().setEnvironment(Environment.TEST); +config.setSSLContext(createTrustSSLContext()); // Trust all certificates for testing only +client.setConfig(config); + +// Step 3: Create an SSL context that accepts all certificates (Use in TEST only). +SSLContext createTrustSSLContext() throws Exception { + TrustManager[] trustAllCerts = new TrustManager[]{ + new X509TrustManager() { + java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } + checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {} + checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {} + } + }; + SSLContext sc = SSLContext.getInstance("SSL"); + sc.init(null, trustAllCerts, new java.security.SecureRandom()); + return sc; +} + +// Step 4: Construct a TerminalAPIRequest object +Gson gson = new GsonBuilder().create(); +TerminalAPIRequest terminalAPIPaymentRequest = new TerminalAPIRequest(); + +// Step 5: Make the request +TerminalAPIResponse terminalAPIResponse = terminalLocalAPI.request(terminalAPIRequest); +``` \ No newline at end of file diff --git a/src/main/java/com/adyen/model/clouddevice/AbortRequest.java b/src/main/java/com/adyen/model/clouddevice/AbortRequest.java new file mode 100644 index 000000000..80bddfa8d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AbortRequest.java @@ -0,0 +1,101 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Definition: Body of the Abort Request messageType. -- Usage: It conveys Information requested for + * identification of the messageType request carrying the transaction to abort. A messageType to + * display on the CustomerError Device could be sent by the Sale System (DisplayOutput). + */ +public class AbortRequest { + + @JsonProperty("MessageReference") + @Schema(description = "Identification of a previous POI transaction.") + protected MessageReference messageReference; + + @JsonProperty("AbortReason") + @Schema(description = "Reason of aborting a transaction") + protected String abortReason; + + @JsonProperty("DisplayOutput") + @Schema( + description = + "Information to display and the way to process the display. --Rule: To display an abort message to the Customer") + protected DisplayOutput displayOutput; + + /** + * Gets the message reference. + * + * @return the message reference + */ + public MessageReference getMessageReference() { + return messageReference; + } + + /** + * Sets the message reference. + * + * @param value the message reference + */ + public void setMessageReference(MessageReference value) { + this.messageReference = value; + } + + /** + * Gets the abort reason. + * + * @return the abort reason + */ + public String getAbortReason() { + return abortReason; + } + + /** + * Sets the abort reason. + * + * @param value the abort reason + */ + public void setAbortReason(String value) { + this.abortReason = value; + } + + /** + * Gets the display output. + * + * @return the display output + */ + public DisplayOutput getDisplayOutput() { + return displayOutput; + } + + /** + * Sets the display output. + * + * @param value the display output + */ + public void setDisplayOutput(DisplayOutput value) { + this.displayOutput = value; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AbortRequest {\n"); + sb.append(" messageReference: ").append(toIndentedString(messageReference)).append("\n"); + sb.append(" abortReason: ").append(toIndentedString(abortReason)).append("\n"); + sb.append(" displayOutput: ").append(toIndentedString(displayOutput)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AccountType.java b/src/main/java/com/adyen/model/clouddevice/AccountType.java new file mode 100644 index 000000000..3c08e01a5 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AccountType.java @@ -0,0 +1,69 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Account type. */ +public enum AccountType { + + /** Default account */ + @Schema(description = "Default account") + DEFAULT("Default"), + + /** Savings account */ + @Schema(description = "Savings account") + SAVINGS("Savings"), + + /** Checking account */ + @Schema(description = "Checking account") + CHECKING("Checking"), + + /** Credit card account */ + @Schema(description = "Credit card account") + CREDIT_CARD("CreditCard"), + + /** Universal account */ + @Schema(description = "Universal account") + UNIVERSAL("Universal"), + + /** Investment account */ + @Schema(description = "Investment account") + INVESTMENT("Investment"), + + /** Card totals */ + @Schema(description = "Card totals") + CARD_TOTALS("CardTotals"), + + /** e-Purse card account */ + @Schema(description = "e-Purse card account") + EPURSE_CARD("EpurseCard"); + + private final String value; + + AccountType(String v) { + value = v; + } + + /** + * Returns the string representation of the AccountType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates an AccountType from a string value. + * + * @param v the string value + * @return the corresponding AccountType + */ + @JsonCreator + public static AccountType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AdminRequest.java b/src/main/java/com/adyen/model/clouddevice/AdminRequest.java new file mode 100644 index 000000000..281f50456 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AdminRequest.java @@ -0,0 +1,49 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Definition: Content of the Custom Admin Request messageType. -- Usage: Empty + * + *

Java class for AdminRequest complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="AdminRequest">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="ServiceIdentification" type="{}ServiceIdentification" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +public class AdminRequest { + + /** The Service identification. */ + @JsonProperty("ServiceIdentification") + @Schema(description = "Identification of the administrative service to process.") + protected String serviceIdentification; + + /** + * Gets the value of the serviceIdentification property. + * + * @return possible object is {@link String } + */ + public String getServiceIdentification() { + return serviceIdentification; + } + + /** + * Sets the value of the serviceIdentification property. + * + * @param value allowed object is {@link String } + */ + public void setServiceIdentification(String value) { + this.serviceIdentification = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AdminResponse.java b/src/main/java/com/adyen/model/clouddevice/AdminResponse.java new file mode 100644 index 000000000..32a77e846 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AdminResponse.java @@ -0,0 +1,57 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Content of the Custom Admin Response message. -- Usage: It conveys the result of the Custom + * Admin. + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"Response"}) +public class AdminResponse { + + /** The Response. */ + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + /** + * Gets the value of the response property. + * + * @return possible object is {@link Response } + */ + public Response getResponse() { + return response; + } + + /** + * Sets the value of the response property. + * + * @param value allowed object is {@link Response } + */ + public void setResponse(Response value) { + this.response = value; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdminResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AlgorithmIdentifier.java b/src/main/java/com/adyen/model/clouddevice/AlgorithmIdentifier.java new file mode 100644 index 000000000..327220aa9 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AlgorithmIdentifier.java @@ -0,0 +1,53 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Definition: Identification of a cryptographic algorithm -- Reference: RFC 3880: Internet X.509 + * Public Key Infrastructure Certificate and Certificate -- Usage: This data structure contains: the + * algorithm identifier associated parameters + */ +public class AlgorithmIdentifier { + + @JsonProperty("Parameter") + protected Parameter parameter; + + @JsonProperty("Algorithm") + protected AlgorithmType algorithm; + + /** + * Gets the value of the parameter property. + * + * @return possible object is {@link Parameter } + */ + public Parameter getParameter() { + return parameter; + } + + /** + * Sets the value of the parameter property. + * + * @param value allowed object is {@link Parameter } + */ + public void setParameter(Parameter value) { + this.parameter = value; + } + + /** + * Gets the value of the algorithm property. + * + * @return possible object is {@link AlgorithmType } + */ + public AlgorithmType getAlgorithm() { + return algorithm; + } + + /** + * Sets the value of the algorithm property. + * + * @param value allowed object is {@link AlgorithmType } + */ + public void setAlgorithm(AlgorithmType value) { + this.algorithm = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AlgorithmType.java b/src/main/java/com/adyen/model/clouddevice/AlgorithmType.java new file mode 100644 index 000000000..9709f86b9 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AlgorithmType.java @@ -0,0 +1,87 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Type of cryptographic algorithm */ +public enum AlgorithmType { + + /** + * Retail CBC-MAC (cf. ISO 9807, ANSI X9.19) - (OID: iso(1) member-body(2) fr(250) type-org (1) + * gie-cb(79) algorithm(10) epas(1) 2) + */ + ID_RETAIL_CBC_MAC("id-retail-cbc-mac"), + + /** + * Retail-CBC-MAC with SHA-256 - (OID: iso(1) member-body(2) fr(250) type-org (1) gie-cb(79) + * algorithm(10) epas(1) 3) + */ + ID_RETAIL_CBC_MAC_SHA_256("id-retail-cbc-mac-sha-256"), + + /** + * The UKPT or Master Session Key key encryption - (OID: iso(1) member-body(2) fr(250) type-org + * (1) gie-cb(79) algorithm(10) epas(1) 4) + */ + ID_UKPT_WRAP("id-ukpt-wrap "), + + /** + * DUKPT is specified in ANS X9.24-2004, Annex A, and ISO/DIS 13492-2006. - (OID: iso(1) + * member-body(2) fr(250) type-org (1) gie-cb(79) algorithm(10) epas(1) 1) + */ + ID_DUKPT_WRAP("id-dukpt-wrap"), + + /** + * Triple DES ECB encryption with double length key (112 Bit) as defined in FIPS PUB 46-3 - (OID: + * iso(1) member-body(2) fr(250) type-org (1) gie-cb(79) + */ + DES_EDE_3_ECB("des-ede3-ecb"), + + /** + * Triple DES CBC encryption with double length key (112 Bit) as defined in FIPS PUB 46-3 - (OID: + * iso(1) member-body(2) us(840) rsadsi(113549) + */ + DES_EDE_3_CBC("des-ede3-cbc"), + + /** Message Digest Algorithm SHA-256 as defined in FIPS 180-1 and 2 - (ISO20022 Label: SHA256) */ + ID_SHA_256("id-sha256"), + + /** + * Signature Algorithms SHA-256 with RSA - (OID: iso(1) member-body(2) us(840) rsadsi(113549) + * pkcs(1) pkcs-1(1) 11) + */ + SHA_256_WITH_RSA_ENCRYPTION("sha256WithRSAEncryption"), + + /** + * Key Transport Algorithm RSA - (OID: iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) + * pkcs-1(1) 1) + */ + RSA_ENCRYPTION("rsaEncryption"); + + private final String value; + + AlgorithmType(String v) { + value = v; + } + + /** + * Returns the string representation of the AlgorithmType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates an AlgorithmType from a string value. + * + * @param v the string value + * @return the corresponding AlgorithmType + */ + @JsonCreator + public static AlgorithmType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AlignmentType.java b/src/main/java/com/adyen/model/clouddevice/AlignmentType.java new file mode 100644 index 000000000..857e41540 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AlignmentType.java @@ -0,0 +1,45 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Alignment of the text. */ +public enum AlignmentType { + + /** Left alignment type. */ + LEFT("Left"), + /** Right alignment type. */ + RIGHT("Right"), + /** Centred alignment type. */ + CENTRED("Centred"), + /** Justified alignment type. */ + JUSTIFIED("Justified"); + + private final String value; + + AlignmentType(String v) { + value = v; + } + + /** + * Returns the string representation of the AlignmentType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates an AlignmentType from a string value. + * + * @param v the string value + * @return the corresponding AlignmentType + */ + @JsonCreator + public static AlignmentType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AllowedProduct.java b/src/main/java/com/adyen/model/clouddevice/AllowedProduct.java new file mode 100644 index 000000000..a74ed21b8 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AllowedProduct.java @@ -0,0 +1,98 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Product that are payable by the payment card. */ +@JsonPropertyOrder({"ProductLabel", "AdditionalProductInfo", "ProductCode", "EanUpc"}) +public class AllowedProduct { + + @JsonProperty("ProductLabel") + @Schema(description = "Product name of an item purchased with the transaction.") + protected String productLabel; + + @JsonProperty("AdditionalProductInfo") + @Schema(description = "Additionl information related to the line item.") + protected String additionalProductInfo; + + @JsonProperty("ProductCode") + @Schema(description = "Product code of item purchased with the transaction.") + protected String productCode; + + @JsonProperty("EanUpc") + @Schema(description = "Standard product code of item purchased with the transaction.") + protected String eanUpc; + + /** + * Gets product label. + * + * @return the product label + */ + public String getProductLabel() { + return productLabel; + } + + /** + * Sets product label. + * + * @param productLabel the product label + */ + public void setProductLabel(String productLabel) { + this.productLabel = productLabel; + } + + /** + * Gets additional product info. + * + * @return the additional product info + */ + public String getAdditionalProductInfo() { + return additionalProductInfo; + } + + /** + * Sets additional product info. + * + * @param additionalProductInfo the additional product info + */ + public void setAdditionalProductInfo(String additionalProductInfo) { + this.additionalProductInfo = additionalProductInfo; + } + + /** + * Gets product code. + * + * @return the product code + */ + public String getProductCode() { + return productCode; + } + + /** + * Sets product code. + * + * @param productCode the product code + */ + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + /** + * Gets ean upc. + * + * @return the ean upc + */ + public String getEanUpc() { + return eanUpc; + } + + /** + * Sets ean upc. + * + * @param eanUpc the ean upc + */ + public void setEanUpc(String eanUpc) { + this.eanUpc = eanUpc; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/Amount.java b/src/main/java/com/adyen/model/clouddevice/Amount.java new file mode 100644 index 000000000..40df98dc4 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/Amount.java @@ -0,0 +1,52 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; + +/** Common amount definition with currency. */ +@JsonPropertyOrder({"AmountValue", "Currency"}) +public class Amount { + + @JsonProperty("AmountValue") + protected BigDecimal amountValue; + + @JsonProperty("Currency") + protected String currency; + + /** + * Gets amount value. + * + * @return the amount value + */ + public BigDecimal getAmountValue() { + return amountValue; + } + + /** + * Sets amount value. + * + * @param amountValue the amount value + */ + public void setAmountValue(BigDecimal amountValue) { + this.amountValue = amountValue; + } + + /** + * Gets currency. + * + * @return the currency + */ + public String getCurrency() { + return currency; + } + + /** + * Sets currency. + * + * @param currency the currency + */ + public void setCurrency(String currency) { + this.currency = currency; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AmountsReq.java b/src/main/java/com/adyen/model/clouddevice/AmountsReq.java new file mode 100644 index 000000000..15b25b5de --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AmountsReq.java @@ -0,0 +1,199 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +/** Various amounts related to the payment and loyalty request from the Sale System. */ +public class AmountsReq { + + @JsonProperty("Currency") + @Schema(description = "Currency of a monetary amount.") + protected String currency; + + @JsonProperty("RequestedAmount") + @Schema( + description = + "Amount requested by the Sale for the payment. --Rule: Absent if the maximum amount is unknown for a OneTimeReservationThe value has to be greater than 0.") + protected BigDecimal requestedAmount; + + @JsonProperty("CashBackAmount") + @Schema( + description = + "The cash-back part of the amount requested by the Sale for the payment. --Rule: if payment with cash back. This data has to be performed by the POI. If cash back is not allowed, the payment is") + protected BigDecimal cashBackAmount; + + @JsonProperty("TipAmount") + @Schema( + description = + "Amount paid for a tip. --Rule: If payment with tip requested by the Sale System.") + protected BigDecimal tipAmount; + + @JsonProperty("PaidAmount") + @Schema( + description = + "Amount already paid amount in case of split payment. --Rule: If SplitPaymentFlag is True (split amount of a split payment).") + protected BigDecimal paidAmount; + + @JsonProperty("MinimumAmountToDeliver") + @Schema( + description = + "Minimum amount the Sale System is allowed to deliver for this payment. --Rule: if unknown maximum amount for a OneTimeReservation or minimum amount requested by the Sale System") + protected BigDecimal minimumAmountToDeliver; + + @JsonProperty("MaximumCashBackAmount") + @Schema( + description = + "Maximum amount which could be requested for cash-back to the Sale System. --Rule: Maximum amount which could be requested for cash-back to the Sale System.") + protected BigDecimal maximumCashBackAmount; + + @JsonProperty("MinimumSplitAmount") + @Schema( + description = + "Minimum amount of a split, which could be requested by a Customer. --Rule: Minimum amount of a split, which could be requested.") + protected BigDecimal minimumSplitAmount; + + /** + * Gets currency. + * + * @return the currency + */ + public String getCurrency() { + return currency; + } + + /** + * Sets currency. + * + * @param currency the currency + */ + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * Gets requested amount. + * + * @return the requested amount + */ + public BigDecimal getRequestedAmount() { + return requestedAmount; + } + + /** + * Sets requested amount. + * + * @param requestedAmount the requested amount + */ + public void setRequestedAmount(BigDecimal requestedAmount) { + this.requestedAmount = requestedAmount; + } + + /** + * Gets cash back amount. + * + * @return the cash back amount + */ + public BigDecimal getCashBackAmount() { + return cashBackAmount; + } + + /** + * Sets cash back amount. + * + * @param cashBackAmount the cash back amount + */ + public void setCashBackAmount(BigDecimal cashBackAmount) { + this.cashBackAmount = cashBackAmount; + } + + /** + * Gets tip amount. + * + * @return the tip amount + */ + public BigDecimal getTipAmount() { + return tipAmount; + } + + /** + * Sets tip amount. + * + * @param tipAmount the tip amount + */ + public void setTipAmount(BigDecimal tipAmount) { + this.tipAmount = tipAmount; + } + + /** + * Gets paid amount. + * + * @return the paid amount + */ + public BigDecimal getPaidAmount() { + return paidAmount; + } + + /** + * Sets paid amount. + * + * @param paidAmount the paid amount + */ + public void setPaidAmount(BigDecimal paidAmount) { + this.paidAmount = paidAmount; + } + + /** + * Gets minimum amount to deliver. + * + * @return the minimum amount to deliver + */ + public BigDecimal getMinimumAmountToDeliver() { + return minimumAmountToDeliver; + } + + /** + * Sets minimum amount to deliver. + * + * @param minimumAmountToDeliver the minimum amount to deliver + */ + public void setMinimumAmountToDeliver(BigDecimal minimumAmountToDeliver) { + this.minimumAmountToDeliver = minimumAmountToDeliver; + } + + /** + * Gets maximum cash back amount. + * + * @return the maximum cash back amount + */ + public BigDecimal getMaximumCashBackAmount() { + return maximumCashBackAmount; + } + + /** + * Sets maximum cash back amount. + * + * @param maximumCashBackAmount the maximum cash back amount + */ + public void setMaximumCashBackAmount(BigDecimal maximumCashBackAmount) { + this.maximumCashBackAmount = maximumCashBackAmount; + } + + /** + * Gets minimum split amount. + * + * @return the minimum split amount + */ + public BigDecimal getMinimumSplitAmount() { + return minimumSplitAmount; + } + + /** + * Sets minimum split amount. + * + * @param minimumSplitAmount the minimum split amount + */ + public void setMinimumSplitAmount(BigDecimal minimumSplitAmount) { + this.minimumSplitAmount = minimumSplitAmount; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AmountsResp.java b/src/main/java/com/adyen/model/clouddevice/AmountsResp.java new file mode 100644 index 000000000..b0317968d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AmountsResp.java @@ -0,0 +1,147 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +/** Various amounts related to the payment response from the POI System. */ +public class AmountsResp { + + @JsonProperty("Currency") + @Schema(description = "Currency of a monetary amount. --Rule: Mandatory for currency conversion.") + protected String currency; + + @JsonProperty("AuthorizedAmount") + @Schema(description = "The amount authorized by the Acquirer for the payment transaction.") + protected BigDecimal authorizedAmount; + + @JsonProperty("TotalRebatesAmount") + @Schema( + description = + "Sum of rebates in amount (total amount or line item amount) for all the loyalty programs.") + protected BigDecimal totalRebatesAmount; + + @JsonProperty("TotalFeesAmount") + @Schema(description = "Total amount of financial fees.") + protected BigDecimal totalFeesAmount; + + @JsonProperty("CashBackAmount") + @Schema( + description = + "The cash-back part of the amount requested by the Sale for the payment. --Rule: if payment with cash back") + protected BigDecimal cashBackAmount; + + @JsonProperty("TipAmount") + @Schema( + description = + "Amount paid for a tip. --Rule: If payment with tip requested by the Sale System.") + protected BigDecimal tipAmount; + + /** + * Gets currency. + * + * @return the currency + */ + public String getCurrency() { + return currency; + } + + /** + * Sets currency. + * + * @param currency the currency + */ + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * Gets authorized amount. + * + * @return the authorized amount + */ + public BigDecimal getAuthorizedAmount() { + return authorizedAmount; + } + + /** + * Sets authorized amount. + * + * @param authorizedAmount the authorized amount + */ + public void setAuthorizedAmount(BigDecimal authorizedAmount) { + this.authorizedAmount = authorizedAmount; + } + + /** + * Gets total rebates amount. + * + * @return the total rebates amount + */ + public BigDecimal getTotalRebatesAmount() { + return totalRebatesAmount; + } + + /** + * Sets total rebates amount. + * + * @param totalRebatesAmount the total rebates amount + */ + public void setTotalRebatesAmount(BigDecimal totalRebatesAmount) { + this.totalRebatesAmount = totalRebatesAmount; + } + + /** + * Gets total fees amount. + * + * @return the total fees amount + */ + public BigDecimal getTotalFeesAmount() { + return totalFeesAmount; + } + + /** + * Sets total fees amount. + * + * @param totalFeesAmount the total fees amount + */ + public void setTotalFeesAmount(BigDecimal totalFeesAmount) { + this.totalFeesAmount = totalFeesAmount; + } + + /** + * Gets cash back amount. + * + * @return the cash back amount + */ + public BigDecimal getCashBackAmount() { + return cashBackAmount; + } + + /** + * Sets cash back amount. + * + * @param cashBackAmount the cash back amount + */ + public void setCashBackAmount(BigDecimal cashBackAmount) { + this.cashBackAmount = cashBackAmount; + } + + /** + * Gets tip amount. + * + * @return the tip amount + */ + public BigDecimal getTipAmount() { + return tipAmount; + } + + /** + * Sets tip amount. + * + * @param tipAmount the tip amount + */ + public void setTipAmount(BigDecimal tipAmount) { + this.tipAmount = tipAmount; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AreaSize.java b/src/main/java/com/adyen/model/clouddevice/AreaSize.java new file mode 100644 index 000000000..29b1e304a --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AreaSize.java @@ -0,0 +1,52 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Size of an area. */ +public class AreaSize { + + @JsonProperty("X") + @Schema(description = "Abscissa of a point coordinates.") + protected String x; + + @JsonProperty("Y") + @Schema(description = "Ordinate of a point coordinates.") + protected String y; + + /** + * Gets x. + * + * @return the x + */ + public String getX() { + return x; + } + + /** + * Sets x. + * + * @param x the x + */ + public void setX(String x) { + this.x = x; + } + + /** + * Gets y. + * + * @return the y + */ + public String getY() { + return y; + } + + /** + * Sets y. + * + * @param y the y + */ + public void setY(String y) { + this.y = y; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AttributeType.java b/src/main/java/com/adyen/model/clouddevice/AttributeType.java new file mode 100644 index 000000000..f7d10b708 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AttributeType.java @@ -0,0 +1,51 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Type of attribute of a distinguished name. */ +public enum AttributeType { + + /** Common Name - (OID: joint-iso-ccitt(2) ds(5) 4 3) */ + ID_AT_COMMON_NAME("id-at-commonName"), + + /** Locality - (OID: joint-iso-ccitt(2) ds(5) 4 7) */ + ID_AT_LOCALITY_NAME("id-at-localityName"), + + /** Organization Name - (OID: joint-iso-ccitt(2) ds(5) 4 10) */ + ID_AT_ORGANIZATION_NAME("id-at-organizationName"), + + /** Organization Unit Name - (OID: joint-iso-ccitt(2) ds(5) 4 11) */ + ID_AT_ORGANIZATIONAL_UNIT_NAME("id-at-organizationalUnitName"), + + /** Country Name - (OID: joint-iso-ccitt(2) ds(5) 4 6) */ + ID_AT_COUNTRY_NAME("id-at-countryName"); + + private final String value; + + AttributeType(String v) { + value = v; + } + + /** + * Returns the string representation of the AttributeType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates an AttributeType from a string value. + * + * @param v the string value + * @return the corresponding AttributeType + */ + @JsonCreator + public static AttributeType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AuthenticatedData.java b/src/main/java/com/adyen/model/clouddevice/AuthenticatedData.java new file mode 100644 index 000000000..a2f3974c1 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AuthenticatedData.java @@ -0,0 +1,128 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; + +/** Cryptographic Message Syntax (CMS) data structure containing MACed data with encryption key. */ +public class AuthenticatedData { + + @JsonProperty("KeyTransport") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + protected List keyTransport; + + @JsonProperty("KEK") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + protected List kek; + + @JsonProperty("MACAlgorithm") + protected AlgorithmIdentifier macAlgorithm; + + @JsonProperty("EncapsulatedContent") + protected EncapsulatedContent encapsulatedContent; + + @JsonProperty("Version") + protected VersionType version; + + @JsonProperty("MAC") + protected byte[] mac; + + public List getKeyTransport() { + if (keyTransport == null) { + keyTransport = new ArrayList<>(); + } + return keyTransport; + } + + public void setKeyTransport(List keyTransport) { + this.keyTransport = keyTransport; + } + + public List getKEK() { + if (kek == null) { + kek = new ArrayList<>(); + } + return kek; + } + + public void setKEK(List kek) { + this.kek = kek; + } + + /** + * Gets the value of the macAlgorithm property. + * + * @return possible object is {@link AlgorithmIdentifier } + */ + public AlgorithmIdentifier getMACAlgorithm() { + return macAlgorithm; + } + + /** + * Sets the value of the macAlgorithm property. + * + * @param value allowed object is {@link AlgorithmIdentifier } + */ + public void setMACAlgorithm(AlgorithmIdentifier value) { + this.macAlgorithm = value; + } + + /** + * Gets the value of the encapsulatedContent property. + * + * @return possible object is {@link EncapsulatedContent } + */ + public EncapsulatedContent getEncapsulatedContent() { + return encapsulatedContent; + } + + /** + * Sets the value of the encapsulatedContent property. + * + * @param value allowed object is {@link EncapsulatedContent } + */ + public void setEncapsulatedContent(EncapsulatedContent value) { + this.encapsulatedContent = value; + } + + /** + * Gets the value of the version property. + * + * @return possible object is {@link VersionType } + */ + public VersionType getVersion() { + if (version == null) { + return VersionType.V_0; + } else { + return version; + } + } + + /** + * Sets the value of the version property. + * + * @param value allowed object is {@link VersionType } + */ + public void setVersion(VersionType value) { + this.version = value; + } + + /** + * Gets the value of the mac property. + * + * @return possible object is byte[] + */ + public byte[] getMAC() { + return mac; + } + + /** + * Sets the value of the mac property. + * + * @param value allowed object is byte[] + */ + public void setMAC(byte[] value) { + this.mac = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/AuthenticationMethodType.java b/src/main/java/com/adyen/model/clouddevice/AuthenticationMethodType.java new file mode 100644 index 000000000..799ac7127 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/AuthenticationMethodType.java @@ -0,0 +1,84 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of authentication method. */ +public enum AuthenticationMethodType { + + /** Authentication bypassed by the merchant. */ + @Schema(description = "Authentication bypassed by the merchant.") + BYPASS("Bypass"), + + /** Manual verification, for example passport or drivers license. */ + @Schema(description = "Manual verification, for example passport or drivers license.") + MANUAL_VERIFICATION("ManualVerification"), + + /** Merchant-related authentication. */ + @Schema(description = "Merchant-related authentication.") + MERCHANT_AUTHENTICATION("MerchantAuthentication"), + + /** Off-line PIN authentication (Personal Identification Number). */ + @Schema(description = "Off-line PIN authentication (Personal Identification Number).") + OFFLINE_PIN("OfflinePIN"), + + /** On-line PIN authentication (Personal Identification Number). */ + @Schema(description = "On-line PIN authentication (Personal Identification Number).") + ON_LINE_PIN("OnLinePIN", "OnlinePIN"), + + /** Handwritten paper signature. */ + @Schema(description = "Handwritten paper signature.") + PAPER_SIGNATURE("PaperSignature"), + + /** Channel-encrypted transaction. */ + @Schema(description = "Channel-encrypted transaction.") + SECURED_CHANNEL("SecuredChannel"), + + /** Secure electronic transaction with cardholder X.509 certificate. */ + @Schema(description = "Secure electronic transaction with cardholder X.509 certificate.") + SECURE_CERTIFICATE("SecureCertificate"), + + /** Secure electronic transaction without cardholder certificate. */ + @Schema(description = "Secure electronic transaction without cardholder certificate.") + SECURE_NO_CERTIFICATE("SecureNoCertificate"), + + /** Electronic signature capture (handwritten signature). */ + @Schema(description = "Electronic signature capture (handwritten signature).") + SIGNATURE_CAPTURE("SignatureCapture"), + + /** Authentication method is performed unknown. */ + @Schema(description = "Authentication method is performed unknown.") + UNKNOWN_METHOD("UnknownMethod"); + + private final String[] value; + + AuthenticationMethodType(String... v) { + value = v; + } + + /** + * Returns the string representation of the AuthenticationMethodType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value[0]; + } + + /** + * Creates an AuthenticationMethodType from a string value. + * + * @param v the string value + * @return the corresponding AuthenticationMethodType + */ + @JsonCreator + public static AuthenticationMethodType fromValue(String v) { + return Arrays.stream(values()) + .filter(s -> Arrays.asList(s.value).contains(v)) + .findFirst() + .orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/BalanceInquiryRequest.java b/src/main/java/com/adyen/model/clouddevice/BalanceInquiryRequest.java new file mode 100644 index 000000000..e71001d01 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/BalanceInquiryRequest.java @@ -0,0 +1,54 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Balance Inquiry Request message. */ +@JsonPropertyOrder({"PaymentAccountReq", "LoyaltyAccountReq"}) +public class BalanceInquiryRequest { + + @JsonProperty("PaymentAccountReq") + @Schema(description = "Data related to the account pointed by the payment card") + protected PaymentAccountReq paymentAccountReq; + + @JsonProperty("LoyaltyAccountReq") + @Schema(description = "Data related to a requested Loyalty program or account.") + protected LoyaltyAccountReq loyaltyAccountReq; + + /** + * Gets payment account req. + * + * @return the payment account req + */ + public PaymentAccountReq getPaymentAccountReq() { + return paymentAccountReq; + } + + /** + * Sets payment account req. + * + * @param paymentAccountReq the payment account req + */ + public void setPaymentAccountReq(PaymentAccountReq paymentAccountReq) { + this.paymentAccountReq = paymentAccountReq; + } + + /** + * Gets loyalty account req. + * + * @return the loyalty account req + */ + public LoyaltyAccountReq getLoyaltyAccountReq() { + return loyaltyAccountReq; + } + + /** + * Sets loyalty account req. + * + * @param loyaltyAccountReq the loyalty account req + */ + public void setLoyaltyAccountReq(LoyaltyAccountReq loyaltyAccountReq) { + this.loyaltyAccountReq = loyaltyAccountReq; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/BalanceInquiryResponse.java b/src/main/java/com/adyen/model/clouddevice/BalanceInquiryResponse.java new file mode 100644 index 000000000..35d498521 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/BalanceInquiryResponse.java @@ -0,0 +1,80 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Balance Inquiry Response message. */ +@JsonPropertyOrder({"Response", "PaymentAccountStatus", "LoyaltyAccountStatus"}) +public class BalanceInquiryResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("PaymentAccountStatus") + @Schema( + description = + "Data related to the result of a Balance Inquiry request. --Rule: If BalanceInquiryRequest. PaymentAccount present") + protected PaymentAccountStatus paymentAccountStatus; + + @JsonProperty("LoyaltyAccountStatus") + @Schema( + description = + "Data related to the result of a loyalty Balance Inquiry. --Rule: If BalanceInquiryRequest. LoyaltyData present") + protected LoyaltyAccountStatus loyaltyAccountStatus; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets payment account status. + * + * @return the payment account status + */ + public PaymentAccountStatus getPaymentAccountStatus() { + return paymentAccountStatus; + } + + /** + * Sets payment account status. + * + * @param paymentAccountStatus the payment account status + */ + public void setPaymentAccountStatus(PaymentAccountStatus paymentAccountStatus) { + this.paymentAccountStatus = paymentAccountStatus; + } + + /** + * Gets loyalty account status. + * + * @return the loyalty account status + */ + public LoyaltyAccountStatus getLoyaltyAccountStatus() { + return loyaltyAccountStatus; + } + + /** + * Sets loyalty account status. + * + * @param loyaltyAccountStatus the loyalty account status + */ + public void setLoyaltyAccountStatus(LoyaltyAccountStatus loyaltyAccountStatus) { + this.loyaltyAccountStatus = loyaltyAccountStatus; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/BarcodeType.java b/src/main/java/com/adyen/model/clouddevice/BarcodeType.java new file mode 100644 index 000000000..90ef2b832 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/BarcodeType.java @@ -0,0 +1,51 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Type of barcode. */ +public enum BarcodeType { + + /** Ean 8 barcode type. */ + EAN_8("EAN8"), + /** Ean 13 barcode type. */ + EAN_13("EAN13"), + /** Upca barcode type. */ + UPCA("UPCA"), + /** Code 25 barcode type. */ + CODE_25("Code25"), + /** Code 128 barcode type. */ + CODE_128("Code128"), + /** Pdf 417 barcode type. */ + PDF_417("PDF417"), + /** Qrcode barcode type. */ + QRCODE("QRCode"); + + private final String value; + + BarcodeType(String v) { + value = v; + } + + /** + * Returns the string representation of the BarcodeType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a BarcodeType from a string value. + * + * @param v the string value + * @return the corresponding BarcodeType + */ + @JsonCreator + public static BarcodeType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/BatchRequest.java b/src/main/java/com/adyen/model/clouddevice/BatchRequest.java new file mode 100644 index 000000000..c86e5b06d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/BatchRequest.java @@ -0,0 +1,61 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Batch Request message. */ +@JsonPropertyOrder({"TransactionToPerform", "RemoveAllFlag"}) +public class BatchRequest { + + @JsonProperty("TransactionToPerform") + @Schema(description = "Content of the Batch Request message") + protected List transactionToPerform; + + @JsonProperty("RemoveAllFlag") + @Schema( + description = + "A flag requesting to remove the transactions stored and not yet performed. default False.") + protected Boolean removeAllFlag; + + /** + * Gets transaction to perform. + * + * @return the transaction to perform + */ + public List getTransactionToPerform() { + if (transactionToPerform == null) { + transactionToPerform = new ArrayList<>(); + } + return this.transactionToPerform; + } + + /** + * Sets transaction to perform. + * + * @param transactionToPerform the transaction to perform + */ + public void setTransactionToPerform(List transactionToPerform) { + this.transactionToPerform = transactionToPerform; + } + + /** + * Is remove all flag boolean. + * + * @return the boolean + */ + public Boolean isRemoveAllFlag() { + return removeAllFlag; + } + + /** + * Sets remove all flag. + * + * @param removeAllFlag the remove all flag + */ + public void setRemoveAllFlag(Boolean removeAllFlag) { + this.removeAllFlag = removeAllFlag; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/BatchResponse.java b/src/main/java/com/adyen/model/clouddevice/BatchResponse.java new file mode 100644 index 000000000..30b065129 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/BatchResponse.java @@ -0,0 +1,59 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Batch Response message. */ +@JsonPropertyOrder({"Response", "PerformedTransaction"}) +public class BatchResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("PerformedTransaction") + @Schema(description = "Result of performed transactions.") + protected List performedTransaction; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets performed transaction. + * + * @return the performed transaction + */ + public List getPerformedTransaction() { + if (performedTransaction == null) { + performedTransaction = new ArrayList<>(); + } + return this.performedTransaction; + } + + /** + * Sets performed transaction. + * + * @param performedTransaction the performed transaction + */ + public void setPerformedTransaction(List performedTransaction) { + this.performedTransaction = performedTransaction; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CapturedSignature.java b/src/main/java/com/adyen/model/clouddevice/CapturedSignature.java new file mode 100644 index 000000000..37d2ed8d9 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CapturedSignature.java @@ -0,0 +1,59 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Numeric value of a handwritten signature. */ +@JsonPropertyOrder({"AreaSize", "SignaturePoint"}) +public class CapturedSignature { + + @JsonProperty("AreaSize") + @Schema(description = "Size of an area") + protected AreaSize areaSize; + + @JsonProperty("SignaturePoint") + @Schema(description = "Coordinates of a point where the pen changes direction or lift.") + protected List signaturePoint; + + /** + * Gets area size. + * + * @return the area size + */ + public AreaSize getAreaSize() { + return areaSize; + } + + /** + * Sets area size. + * + * @param areaSize the area size + */ + public void setAreaSize(AreaSize areaSize) { + this.areaSize = areaSize; + } + + /** + * Gets signature point. + * + * @return the signature point + */ + public List getSignaturePoint() { + if (signaturePoint == null) { + signaturePoint = new ArrayList<>(); + } + return this.signaturePoint; + } + + /** + * Sets signature point. + * + * @param signaturePoint the signature point + */ + public void setSignaturePoint(List signaturePoint) { + this.signaturePoint = signaturePoint; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardAcquisitionRequest.java b/src/main/java/com/adyen/model/clouddevice/CardAcquisitionRequest.java new file mode 100644 index 000000000..20fb359a4 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardAcquisitionRequest.java @@ -0,0 +1,54 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Card Acquisition Request message. */ +@JsonPropertyOrder({"SaleData", "CardAcquisitionTransaction"}) +public class CardAcquisitionRequest { + + @JsonProperty("SaleData") + @Schema(description = "Data related to the Sale System.") + protected SaleData saleData; + + @JsonProperty("CardAcquisitionTransaction") + @Schema(description = "Data related to the payment and loyalty card acquisition.") + protected CardAcquisitionTransaction cardAcquisitionTransaction; + + /** + * Gets sale data. + * + * @return the sale data + */ + public SaleData getSaleData() { + return saleData; + } + + /** + * Sets sale data. + * + * @param saleData the sale data + */ + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + } + + /** + * Gets card acquisition transaction. + * + * @return the card acquisition transaction + */ + public CardAcquisitionTransaction getCardAcquisitionTransaction() { + return cardAcquisitionTransaction; + } + + /** + * Sets card acquisition transaction. + * + * @param cardAcquisitionTransaction the card acquisition transaction + */ + public void setCardAcquisitionTransaction(CardAcquisitionTransaction cardAcquisitionTransaction) { + this.cardAcquisitionTransaction = cardAcquisitionTransaction; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardAcquisitionResponse.java b/src/main/java/com/adyen/model/clouddevice/CardAcquisitionResponse.java new file mode 100644 index 000000000..885b776d8 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardAcquisitionResponse.java @@ -0,0 +1,218 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Card Acquisition Response message. */ +@JsonPropertyOrder({ + "Response", + "SaleData", + "POIData", + "PaymentBrand", + "PaymentInstrumentData", + "LoyaltyAccount", + "CustomerOrder" +}) +public class CardAcquisitionResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("SaleData") + @Schema(description = "Data related to the Sale System.") + protected SaleData saleData; + + @JsonProperty("POIData") + @Schema(description = "Data related to the POI System.") + protected POIData poiData; + + @JsonProperty("PaymentBrand") + @Schema( + description = + "Type of payment card --Rule: Brands available for payment by the card and not chosen by the Customer") + protected List paymentBrand; + + @JsonProperty("PaymentInstrumentData") + @Schema( + description = + "Data related to the instrument of payment for the transaction. --Rule: If this type of payment card is configured to send information if the CardAcquisition response") + protected PaymentInstrumentData paymentInstrumentData; + + @JsonProperty("LoyaltyAccount") + @Schema( + description = + "Data related to a loyalty account processed in the transaction. --Rule: If loyalty card selected by the customer") + protected List loyaltyAccount; + + @JsonProperty("CustomerOrder") + @Schema( + description = + "Customer order attached to a card, recorded in the POI system. --Rule: If the list of customer orders has been requested.") + protected List customerOrder; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets sale data. + * + * @return the sale data + */ + public SaleData getSaleData() { + return saleData; + } + + /** + * Sets sale data. + * + * @param saleData the sale data + */ + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + } + + /** + * Gets poi data. + * + * @return the poi data + */ + public POIData getPOIData() { + return poiData; + } + + /** + * Sets poi data. + * + * @param poiData the poi data + */ + public void setPOIData(POIData poiData) { + this.poiData = poiData; + } + + /** + * Gets payment brand. + * + * @return the payment brand + */ + public List getPaymentBrand() { + if (paymentBrand == null) { + paymentBrand = new ArrayList<>(); + } + return this.paymentBrand; + } + + /** + * Sets payment brand. + * + * @param paymentBrand the payment brand + */ + public void setPaymentBrand(List paymentBrand) { + this.paymentBrand = paymentBrand; + } + + /** + * Gets payment instrument data. + * + * @return the payment instrument data + */ + public PaymentInstrumentData getPaymentInstrumentData() { + return paymentInstrumentData; + } + + /** + * Sets payment instrument data. + * + * @param paymentInstrumentData the payment instrument data + */ + public void setPaymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + } + + /** + * Gets loyalty account. + * + * @return the loyalty account + */ + public List getLoyaltyAccount() { + if (loyaltyAccount == null) { + loyaltyAccount = new ArrayList<>(); + } + return this.loyaltyAccount; + } + + /** + * Sets loyalty account. + * + * @param loyaltyAccount the loyalty account + */ + public void setLoyaltyAccount(List loyaltyAccount) { + this.loyaltyAccount = loyaltyAccount; + } + + /** + * Gets customer order. + * + * @return the customer order + */ + public List getCustomerOrder() { + if (customerOrder == null) { + customerOrder = new ArrayList<>(); + } + return this.customerOrder; + } + + /** + * Sets customer order. + * + * @param customerOrder the customer order + */ + public void setCustomerOrder(List customerOrder) { + this.customerOrder = customerOrder; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardAcquisitionResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" poiData: ").append(toIndentedString(poiData)).append("\n"); + sb.append(" paymentBrand: ").append(toIndentedString(paymentBrand)).append("\n"); + sb.append(" paymentInstrumentData: ") + .append(toIndentedString(paymentInstrumentData)) + .append("\n"); + sb.append(" loyaltyAccount: ").append(toIndentedString(loyaltyAccount)).append("\n"); + sb.append(" customerOrder: ").append(toIndentedString(customerOrder)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardAcquisitionTransaction.java b/src/main/java/com/adyen/model/clouddevice/CardAcquisitionTransaction.java new file mode 100644 index 000000000..187261eb8 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardAcquisitionTransaction.java @@ -0,0 +1,249 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** Data related to the payment and loyalty card acquisition. */ +@JsonPropertyOrder({ + "AllowedPaymentBrand", + "AllowedLoyaltyBrand", + "ForceEntryMode", + "LoyaltyHandling", + "CustomerLanguage", + "ForceCustomerSelectionFlag", + "TotalAmount", + "PaymentType", + "CashBackFlag" +}) +public class CardAcquisitionTransaction { + + @JsonProperty("AllowedPaymentBrand") + @Schema( + description = "Card payment brands allowed by the Sale System for the payment transaction.") + protected List allowedPaymentBrand; + + @JsonProperty("AllowedLoyaltyBrand") + @Schema( + description = + "Loyalty brands or programs allowed by the Sale System for the loyalty transaction.") + protected List allowedLoyaltyBrand; + + @JsonProperty("ForceEntryMode") + @Schema(description = "Payment instrument entry mode requested by the Sale System.") + protected List forceEntryMode; + + @JsonProperty("LoyaltyHandling") + @Schema(description = "Type of Loyalty processing requested by the Sale System.") + protected LoyaltyHandlingType loyaltyHandling; + + @JsonProperty("CustomerLanguage") + @Schema( + description = + "Language of the Customer --Rule: If the language is selected by the Sale System before the request to the POI.") + protected String customerLanguage; + + @JsonProperty("ForceCustomerSelectionFlag") + @Schema(description = "Indicates if the Customer realises the selection of the card application.") + protected Boolean forceCustomerSelectionFlag; + + @JsonProperty("TotalAmount") + @Schema( + description = + "Amount of a transaction. --Rule: Mandatory for contactless card, otherwise absent") + protected BigDecimal totalAmount; + + @JsonProperty("PaymentType") + @Schema( + description = + "Type of payment transaction. --Rule: Mandatory for contactless card, otherwise absent") + protected PaymentType paymentType; + + @JsonProperty("CashBackFlag") + @Schema( + description = + "Cash back has been requested with the payment transaction. --Rule: For contactless, True if cash back has been requested, default False. Otherwise absent.") + protected Boolean cashBackFlag; + + /** + * Gets allowed payment brand. + * + * @return the allowed payment brand + */ + public List getAllowedPaymentBrand() { + if (allowedPaymentBrand == null) { + allowedPaymentBrand = new ArrayList<>(); + } + return this.allowedPaymentBrand; + } + + /** + * Sets allowed payment brand. + * + * @param allowedPaymentBrand the allowed payment brand + */ + public void setAllowedPaymentBrand(List allowedPaymentBrand) { + this.allowedPaymentBrand = allowedPaymentBrand; + } + + /** + * Gets allowed loyalty brand. + * + * @return the allowed loyalty brand + */ + public List getAllowedLoyaltyBrand() { + if (allowedLoyaltyBrand == null) { + allowedLoyaltyBrand = new ArrayList<>(); + } + return this.allowedLoyaltyBrand; + } + + /** + * Sets allowed loyalty brand. + * + * @param allowedLoyaltyBrand the allowed loyalty brand + */ + public void setAllowedLoyaltyBrand(List allowedLoyaltyBrand) { + this.allowedLoyaltyBrand = allowedLoyaltyBrand; + } + + /** + * Gets force entry mode. + * + * @return the force entry mode + */ + public List getForceEntryMode() { + if (forceEntryMode == null) { + forceEntryMode = new ArrayList<>(); + } + return this.forceEntryMode; + } + + /** + * Sets force entry mode. + * + * @param forceEntryMode the force entry mode + */ + public void setForceEntryMode(List forceEntryMode) { + this.forceEntryMode = forceEntryMode; + } + + /** + * Gets loyalty handling. + * + * @return the loyalty handling + */ + public LoyaltyHandlingType getLoyaltyHandling() { + if (loyaltyHandling == null) { + return LoyaltyHandlingType.ALLOWED; + } else { + return loyaltyHandling; + } + } + + /** + * Sets loyalty handling. + * + * @param loyaltyHandling the loyalty handling + */ + public void setLoyaltyHandling(LoyaltyHandlingType loyaltyHandling) { + this.loyaltyHandling = loyaltyHandling; + } + + /** + * Gets customer language. + * + * @return the customer language + */ + public String getCustomerLanguage() { + return customerLanguage; + } + + /** + * Sets customer language. + * + * @param customerLanguage the customer language + */ + public void setCustomerLanguage(String customerLanguage) { + this.customerLanguage = customerLanguage; + } + + /** + * Is force customer selection flag boolean. + * + * @return the boolean + */ + public boolean isForceCustomerSelectionFlag() { + if (forceCustomerSelectionFlag == null) { + return false; + } else { + return forceCustomerSelectionFlag; + } + } + + /** + * Sets force customer selection flag. + * + * @param forceCustomerSelectionFlag the force customer selection flag + */ + public void setForceCustomerSelectionFlag(Boolean forceCustomerSelectionFlag) { + this.forceCustomerSelectionFlag = forceCustomerSelectionFlag; + } + + /** + * Gets total amount. + * + * @return the total amount + */ + public BigDecimal getTotalAmount() { + return totalAmount; + } + + /** + * Sets total amount. + * + * @param totalAmount the total amount + */ + public void setTotalAmount(BigDecimal totalAmount) { + this.totalAmount = totalAmount; + } + + /** + * Gets payment type. + * + * @return the payment type + */ + public PaymentType getPaymentType() { + return paymentType; + } + + /** + * Sets payment type. + * + * @param paymentType the payment type + */ + public void setPaymentType(PaymentType paymentType) { + this.paymentType = paymentType; + } + + /** + * Is cash back flag boolean. + * + * @return the boolean + */ + public Boolean isCashBackFlag() { + return cashBackFlag; + } + + /** + * Sets cash back flag. + * + * @param cashBackFlag the cash back flag + */ + public void setCashBackFlag(Boolean cashBackFlag) { + this.cashBackFlag = cashBackFlag; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardData.java b/src/main/java/com/adyen/model/clouddevice/CardData.java new file mode 100644 index 000000000..9c2d3b6b6 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardData.java @@ -0,0 +1,299 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Information related to the payment card used for the transaction. */ +@JsonPropertyOrder({ + "ProtectedCardData", + "SensitiveCardData", + "AllowedProductCode", + "AllowedProduct", + "PaymentToken", + "CustomerOrder", + "PaymentBrand", + "MaskedPan", + "PaymentAccountRef", + "EntryMode", + "CardCountryCode" +}) +public class CardData { + + @JsonProperty("ProtectedCardData") + @Schema( + description = + "Sensitive information related to the payment card, protected by CMS. --Rule: SensitiveCardData protected by CMS EnvelopedData") + protected ContentInformation protectedCardData; + + @JsonProperty("SensitiveCardData") + @Schema( + description = + "Sensitive information related to the payment card, entered or read by the Sale System. --Rule: If structure non empty and unprotected") + protected SensitiveCardData sensitiveCardData; + + @JsonProperty("AllowedProductCode") + @Schema( + description = + "Product codes that are payable by the payment card. --Rule: If ErrorCondition is \"PaymentRestriction\", some products are not payable by the payment card (payment response).", + minLength = 1, + maxLength = 20) + protected List allowedProductCode; + + @JsonProperty("AllowedProduct") + @Schema( + description = + "Product that are payable by the payment card. --Rule: If the card has restrictions on product that can be purchased (card acquisition or balance inquiry response).") + protected List allowedProduct; + + @JsonProperty("PaymentToken") + @Schema( + description = + "Surrogate of the PAN (Primary Account Number) of the payment card to identify the payment mean of the customer. --Rule: Present in If requested in CardAcquisitionResponse or PaymentResponse if requested in the request or in the Login") + protected PaymentToken paymentToken; + + @JsonProperty("CustomerOrder") + @Schema( + description = + "Customer order attached to a card, recorded in the POI system. --Rule: If the list of customer orders has been requested.") + protected List customerOrder; + + @JsonProperty("PaymentBrand") + @Schema(description = "Type of payment card --Rule: If card PAN is readable ") + protected String paymentBrand; + + @JsonProperty("MaskedPan") + protected String maskedPAN; + + @JsonProperty("PaymentAccountRef") + @Schema( + description = + "Reference of the PAN, which identifies the PAN or the card uniquely, named also PAR (Payment Account Reference). This --Rule: Mandatory if available.") + protected String paymentAccountRef; + + @JsonProperty("EntryMode") + @Schema( + description = + "Entry mode of the payment instrument information --Rule: Mandatory in the request") + protected List entryMode; + + @JsonProperty("CardCountryCode") + @Schema( + description = + "Country Code attached to the card (3 numerics). --Rule: If available in the card", + minLength = 3, + maxLength = 3) + protected String cardCountryCode; + + /** + * Gets protected card data. + * + * @return the protected card data + */ + public ContentInformation getProtectedCardData() { + return protectedCardData; + } + + /** + * Sets protected card data. + * + * @param protectedCardData the protected card data + */ + public void setProtectedCardData(ContentInformation protectedCardData) { + this.protectedCardData = protectedCardData; + } + + /** + * Gets sensitive card data. + * + * @return the sensitive card data + */ + public SensitiveCardData getSensitiveCardData() { + return sensitiveCardData; + } + + /** + * Sets sensitive card data. + * + * @param sensitiveCardData the sensitive card data + */ + public void setSensitiveCardData(SensitiveCardData sensitiveCardData) { + this.sensitiveCardData = sensitiveCardData; + } + + /** + * Gets allowed product code. + * + * @return the allowed product code + */ + public List getAllowedProductCode() { + if (allowedProductCode == null) { + allowedProductCode = new ArrayList<>(); + } + return this.allowedProductCode; + } + + /** + * Sets allowed product code. + * + * @param allowedProductCode the allowed product code + */ + public void setAllowedProductCode(List allowedProductCode) { + this.allowedProductCode = allowedProductCode; + } + + /** + * Gets allowed product. + * + * @return the allowed product + */ + public List getAllowedProduct() { + if (allowedProduct == null) { + allowedProduct = new ArrayList<>(); + } + return this.allowedProduct; + } + + /** + * Sets allowed product. + * + * @param allowedProduct the allowed product + */ + public void setAllowedProduct(List allowedProduct) { + this.allowedProduct = allowedProduct; + } + + /** + * Gets payment token. + * + * @return the payment token + */ + public PaymentToken getPaymentToken() { + return paymentToken; + } + + /** + * Sets payment token. + * + * @param paymentToken the payment token + */ + public void setPaymentToken(PaymentToken paymentToken) { + this.paymentToken = paymentToken; + } + + /** + * Gets customer order. + * + * @return the customer order + */ + public List getCustomerOrder() { + if (customerOrder == null) { + customerOrder = new ArrayList<>(); + } + return this.customerOrder; + } + + /** + * Sets customer order. + * + * @param customerOrder the customer order + */ + public void setCustomerOrder(List customerOrder) { + this.customerOrder = customerOrder; + } + + /** + * Gets payment brand. + * + * @return the payment brand + */ + public String getPaymentBrand() { + return paymentBrand; + } + + /** + * Sets payment brand. + * + * @param paymentBrand the payment brand + */ + public void setPaymentBrand(String paymentBrand) { + this.paymentBrand = paymentBrand; + } + + /** + * Gets masked pan. + * + * @return the masked pan + */ + public String getMaskedPAN() { + return maskedPAN; + } + + /** + * Sets masked pan. + * + * @param maskedPAN the masked pan + */ + public void setMaskedPAN(String maskedPAN) { + this.maskedPAN = maskedPAN; + } + + /** + * Gets payment account ref. + * + * @return the payment account ref + */ + public String getPaymentAccountRef() { + return paymentAccountRef; + } + + /** + * Sets payment account ref. + * + * @param paymentAccountRef the payment account ref + */ + public void setPaymentAccountRef(String paymentAccountRef) { + this.paymentAccountRef = paymentAccountRef; + } + + /** + * Gets entry mode. + * + * @return the entry mode + */ + public List getEntryMode() { + if (entryMode == null) { + entryMode = new ArrayList<>(); + } + return this.entryMode; + } + + /** + * Sets entry mode. + * + * @param entryMode the entry mode + */ + public void setEntryMode(List entryMode) { + this.entryMode = entryMode; + } + + /** + * Gets card country code. + * + * @return the card country code + */ + public String getCardCountryCode() { + return cardCountryCode; + } + + /** + * Sets card country code. + * + * @param cardCountryCode the card country code + */ + public void setCardCountryCode(String cardCountryCode) { + this.cardCountryCode = cardCountryCode; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardReaderAPDURequest.java b/src/main/java/com/adyen/model/clouddevice/CardReaderAPDURequest.java new file mode 100644 index 000000000..3c331d2e7 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardReaderAPDURequest.java @@ -0,0 +1,152 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Card Reader APDU Request message. */ +@JsonPropertyOrder({ + "APDUData", + "APDUClass", + "APDUInstruction", + "APDUPar1", + "APDUPar2", + "APDUExpectedLength" +}) +public class CardReaderAPDURequest { + + @JsonProperty("APDUData") + @Schema(description = "Data field of the APDU command (Lc + Data)") + protected byte[] apduData; + + @JsonProperty("APDUClass") + @Schema(description = "Class field of the APDU command (CLA)", minLength = 1, maxLength = 1) + protected byte[] apduClass; + + @JsonProperty("APDUInstruction") + @Schema(description = "Instruction field of the APDU command (INS)", minLength = 1, maxLength = 1) + protected byte[] apduInstruction; + + @JsonProperty("APDUPar1") + @Schema(description = "Parameter 1 field of the APDU command (P1)", minLength = 1, maxLength = 1) + protected byte[] apduPar1; + + @JsonProperty("APDUPar2") + @Schema(description = "Parameter 2 field of the APDU command(P2)", minLength = 1, maxLength = 1) + protected byte[] apduPar2; + + @JsonProperty("APDUExpectedLength") + @Schema( + description = "Expected length of the data field of the APDU response to the command (Le)", + minLength = 1, + maxLength = 1) + protected byte[] apduExpectedLength; + + /** + * Gets apdu data. + * + * @return the apdu data + */ + public byte[] getAPDUData() { + return apduData; + } + + /** + * Sets apdu data. + * + * @param apduData the apdu data + */ + public void setAPDUData(byte[] apduData) { + this.apduData = apduData; + } + + /** + * Get apdu class. + * + * @return the byte [ ] + */ + public byte[] getAPDUClass() { + return apduClass; + } + + /** + * Sets apdu class. + * + * @param apduClass the apdu class + */ + public void setAPDUClass(byte[] apduClass) { + this.apduClass = apduClass; + } + + /** + * Get apdu instruction. + * + * @return the byte [ ] + */ + public byte[] getAPDUInstruction() { + return apduInstruction; + } + + /** + * Sets apdu instruction. + * + * @param apduInstruction the apdu instruction + */ + public void setAPDUInstruction(byte[] apduInstruction) { + this.apduInstruction = apduInstruction; + } + + /** + * Get apdu par 1. + * + * @return the byte [ ] + */ + public byte[] getAPDUPar1() { + return apduPar1; + } + + /** + * Sets apdu par 1. + * + * @param apduPar1 the apdu par 1 + */ + public void setAPDUPar1(byte[] apduPar1) { + this.apduPar1 = apduPar1; + } + + /** + * Get apdu par 2. + * + * @return the byte [ ] + */ + public byte[] getAPDUPar2() { + return apduPar2; + } + + /** + * Sets apdu par 2. + * + * @param apduPar2 the apdu par 2 + */ + public void setAPDUPar2(byte[] apduPar2) { + this.apduPar2 = apduPar2; + } + + /** + * Get apdu expected length. + * + * @return the byte [ ] + */ + public byte[] getAPDUExpectedLength() { + return apduExpectedLength; + } + + /** + * Sets apdu expected length. + * + * @param apduExpectedLength the apdu expected length + */ + public void setAPDUExpectedLength(byte[] apduExpectedLength) { + this.apduExpectedLength = apduExpectedLength; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardReaderAPDUResponse.java b/src/main/java/com/adyen/model/clouddevice/CardReaderAPDUResponse.java new file mode 100644 index 000000000..310982e7b --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardReaderAPDUResponse.java @@ -0,0 +1,76 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Card Reader APDU Response message. */ +@JsonPropertyOrder({"Response", "APDUData", "CardStatusWords"}) +public class CardReaderAPDUResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("APDUData") + @Schema(description = "Data field of the APDU command (Lc + Data)") + protected byte[] apduData; + + @JsonProperty("CardStatusWords") + @Schema(description = "Status of a smartcard response to a command (SW1-SW2)") + protected byte[] cardStatusWords; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Get apdu data. + * + * @return the byte [ ] + */ + public byte[] getAPDUData() { + return apduData; + } + + /** + * Sets apdu data. + * + * @param apduData the apdu data + */ + public void setAPDUData(byte[] apduData) { + this.apduData = apduData; + } + + /** + * Get card status words. + * + * @return the byte [ ] + */ + public byte[] getCardStatusWords() { + return cardStatusWords; + } + + /** + * Sets card status words. + * + * @param cardStatusWords the card status words + */ + public void setCardStatusWords(byte[] cardStatusWords) { + this.cardStatusWords = cardStatusWords; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardReaderInitRequest.java b/src/main/java/com/adyen/model/clouddevice/CardReaderInitRequest.java new file mode 100644 index 000000000..add69c8bc --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardReaderInitRequest.java @@ -0,0 +1,136 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Card Reader Init Request message. */ +@JsonPropertyOrder({ + "ForceEntryMode", + "DisplayOutput", + "WarmResetFlag", + "LeaveCardFlag", + "MaxWaitingTime" +}) +public class CardReaderInitRequest { + + @JsonProperty("ForceEntryMode") + @Schema(description = "Payment instrument entry mode requested by the Sale System.") + protected List forceEntryMode; + + @JsonProperty("DisplayOutput") + @Schema(description = "Information to display and the way to process the display.") + protected DisplayOutput displayOutput; + + @JsonProperty("WarmResetFlag") + @Schema(description = "Flag to request a warm reset on a chip.") + protected Boolean warmResetFlag; + + @JsonProperty("LeaveCardFlag") + @Schema(description = "Indicates if the POI has to keep the card in the reader for a smart card.") + protected Boolean leaveCardFlag; + + @JsonProperty("MaxWaitingTime") + @Schema(description = "Maximum time to wait for the request processing in seconds.") + protected BigInteger maxWaitingTime; + + /** + * Gets force entry mode. + * + * @return the force entry mode + */ + public List getForceEntryMode() { + if (forceEntryMode == null) { + forceEntryMode = new ArrayList<>(); + } + return this.forceEntryMode; + } + + /** + * Sets force entry mode. + * + * @param forceEntryMode the force entry mode + */ + public void setForceEntryMode(List forceEntryMode) { + this.forceEntryMode = forceEntryMode; + } + + /** + * Gets display output. + * + * @return the display output + */ + public DisplayOutput getDisplayOutput() { + return displayOutput; + } + + /** + * Sets display output. + * + * @param displayOutput the display output + */ + public void setDisplayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + } + + /** + * Is warm reset flag boolean. + * + * @return the boolean + */ + public Boolean isWarmResetFlag() { + return warmResetFlag; + } + + /** + * Sets warm reset flag. + * + * @param warmResetFlag the warm reset flag + */ + public void setWarmResetFlag(Boolean warmResetFlag) { + this.warmResetFlag = warmResetFlag; + } + + /** + * Is leave card flag boolean. + * + * @return the boolean + */ + public boolean isLeaveCardFlag() { + if (leaveCardFlag == null) { + return true; + } else { + return leaveCardFlag; + } + } + + /** + * Sets leave card flag. + * + * @param leaveCardFlag the leave card flag + */ + public void setLeaveCardFlag(Boolean leaveCardFlag) { + this.leaveCardFlag = leaveCardFlag; + } + + /** + * Gets max waiting time. + * + * @return the max waiting time + */ + public BigInteger getMaxWaitingTime() { + return maxWaitingTime; + } + + /** + * Sets max waiting time. + * + * @param maxWaitingTime the max waiting time + */ + public void setMaxWaitingTime(BigInteger maxWaitingTime) { + this.maxWaitingTime = maxWaitingTime; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardReaderInitResponse.java b/src/main/java/com/adyen/model/clouddevice/CardReaderInitResponse.java new file mode 100644 index 000000000..d847b5f40 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardReaderInitResponse.java @@ -0,0 +1,112 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Card Reader Init Response message. */ +@JsonPropertyOrder({"Response", "TrackData", "ICCResetData", "EntryMode"}) +public class CardReaderInitResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("TrackData") + @Schema( + description = + "Magnetic track or magnetic ink characters line. --Rule: if EntryMode is RFID or MagStripe") + protected List trackData; + + @JsonProperty("ICCResetData") + @Schema( + description = + "Data of a Chip Card related to the reset of the chip. --Rule: if EntryMode is ICC, EMVContactless or SynchronousICC") + protected ICCResetData iccResetData; + + @JsonProperty("EntryMode") + @Schema( + description = + "Entry mode of the payment instrument information --Rule: RFID, MagStripe, ICC, EMVContactless or SynchronousICC") + protected List entryMode; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets track data. + * + * @return the track data + */ + public List getTrackData() { + if (trackData == null) { + trackData = new ArrayList<>(); + } + return this.trackData; + } + + /** + * Sets track data. + * + * @param trackData the track data + */ + public void setTrackData(List trackData) { + this.trackData = trackData; + } + + /** + * Gets icc reset data. + * + * @return the icc reset data + */ + public ICCResetData getICCResetData() { + return iccResetData; + } + + /** + * Sets icc reset data. + * + * @param iccResetData the icc reset data + */ + public void setICCResetData(ICCResetData iccResetData) { + this.iccResetData = iccResetData; + } + + /** + * Gets entry mode. + * + * @return the entry mode + */ + public List getEntryMode() { + if (entryMode == null) { + entryMode = new ArrayList<>(); + } + return this.entryMode; + } + + /** + * Sets entry mode. + * + * @param entryMode the entry mode + */ + public void setEntryMode(List entryMode) { + this.entryMode = entryMode; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardReaderPowerOffRequest.java b/src/main/java/com/adyen/model/clouddevice/CardReaderPowerOffRequest.java new file mode 100644 index 000000000..4f1f8134b --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardReaderPowerOffRequest.java @@ -0,0 +1,55 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigInteger; + +/** Content of the Card Reader Power-Off Request message. */ +@JsonPropertyOrder({"DisplayOutput", "MaxWaitingTime"}) +public class CardReaderPowerOffRequest { + + @JsonProperty("DisplayOutput") + @Schema(description = "Information to display and the way to process the display.") + protected DisplayOutput displayOutput; + + @JsonProperty("MaxWaitingTime") + @Schema(description = "Maximum time to wait for the request processing in seconds.") + protected BigInteger maxWaitingTime; + + /** + * Gets display output. + * + * @return the display output + */ + public DisplayOutput getDisplayOutput() { + return displayOutput; + } + + /** + * Sets display output. + * + * @param displayOutput the display output + */ + public void setDisplayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + } + + /** + * Gets max waiting time. + * + * @return the max waiting time + */ + public BigInteger getMaxWaitingTime() { + return maxWaitingTime; + } + + /** + * Sets max waiting time. + * + * @param maxWaitingTime the max waiting time + */ + public void setMaxWaitingTime(BigInteger maxWaitingTime) { + this.maxWaitingTime = maxWaitingTime; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardReaderPowerOffResponse.java b/src/main/java/com/adyen/model/clouddevice/CardReaderPowerOffResponse.java new file mode 100644 index 000000000..ee08a28d4 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardReaderPowerOffResponse.java @@ -0,0 +1,32 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Card Reader Power-Off Response message. */ +@JsonPropertyOrder({"Response"}) +public class CardReaderPowerOffResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CardholderPIN.java b/src/main/java/com/adyen/model/clouddevice/CardholderPIN.java new file mode 100644 index 000000000..52aa5f411 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CardholderPIN.java @@ -0,0 +1,78 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Encrypted PIN and related information. */ +@JsonPropertyOrder({"EncrPINBlock", "PINFormat", "AdditionalInput"}) +public class CardholderPIN { + + @JsonProperty("EncrPINBlock") + @Schema(description = "Encrypted PIN") + protected ContentInformation encrPINBlock; + + @JsonProperty("PINFormat") + @Schema(description = "Identify the format of the PIN before encryption.") + protected PINFormatType pinFormat; + + @JsonProperty("AdditionalInput") + @Schema( + description = + "Additional information required to verify the PIN like part of the PAN, or driver ID.") + protected String additionalInput; + + /** + * Gets encr pin block. + * + * @return the encr pin block + */ + public ContentInformation getEncrPINBlock() { + return encrPINBlock; + } + + /** + * Sets encr pin block. + * + * @param encrPINBlock the encr pin block + */ + public void setEncrPINBlock(ContentInformation encrPINBlock) { + this.encrPINBlock = encrPINBlock; + } + + /** + * Gets pin format. + * + * @return the pin format + */ + public PINFormatType getPINFormat() { + return pinFormat; + } + + /** + * Sets pin format. + * + * @param pinFormat the pin format + */ + public void setPINFormat(PINFormatType pinFormat) { + this.pinFormat = pinFormat; + } + + /** + * Gets additional input. + * + * @return the additional input + */ + public String getAdditionalInput() { + return additionalInput; + } + + /** + * Sets additional input. + * + * @param additionalInput the additional input + */ + public void setAdditionalInput(String additionalInput) { + this.additionalInput = additionalInput; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CashHandlingDevice.java b/src/main/java/com/adyen/model/clouddevice/CashHandlingDevice.java new file mode 100644 index 000000000..8147c3af6 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CashHandlingDevice.java @@ -0,0 +1,81 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Status of cash handling device. */ +@JsonPropertyOrder({"CoinsOrBills", "CashHandlingOKFlag", "Currency"}) +public class CashHandlingDevice { + + @JsonProperty("CoinsOrBills") + @Schema(description = "Number of coins or bills of a given value.") + protected List coinsOrBills; + + @JsonProperty("CashHandlingOKFlag") + @Schema(description = "Indicates if the cash handling device is working and usable.") + protected boolean cashHandlingOKFlag; + + @JsonProperty("Currency") + @Schema(description = "Currency of a monetary amount.") + protected String currency; + + /** + * Gets coins or bills. + * + * @return the coins or bills + */ + public List getCoinsOrBills() { + if (coinsOrBills == null) { + coinsOrBills = new ArrayList<>(); + } + return this.coinsOrBills; + } + + /** + * Sets coins or bills. + * + * @param coinsOrBills the coins or bills + */ + public void setCoinsOrBills(List coinsOrBills) { + this.coinsOrBills = coinsOrBills; + } + + /** + * Is cash handling ok flag boolean. + * + * @return the boolean + */ + public boolean isCashHandlingOKFlag() { + return cashHandlingOKFlag; + } + + /** + * Sets cash handling ok flag. + * + * @param cashHandlingOKFlag the cash handling ok flag + */ + public void setCashHandlingOKFlag(boolean cashHandlingOKFlag) { + this.cashHandlingOKFlag = cashHandlingOKFlag; + } + + /** + * Gets currency. + * + * @return the currency + */ + public String getCurrency() { + return currency; + } + + /** + * Sets currency. + * + * @param currency the currency + */ + public void setCurrency(String currency) { + this.currency = currency; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CharacterHeightType.java b/src/main/java/com/adyen/model/clouddevice/CharacterHeightType.java new file mode 100644 index 000000000..8b04a64d7 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CharacterHeightType.java @@ -0,0 +1,43 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Height of the character. */ +public enum CharacterHeightType { + + /** Single height character height type. */ + SINGLE_HEIGHT("SingleHeight"), + /** Double height character height type. */ + DOUBLE_HEIGHT("DoubleHeight"), + /** Half height character height type. */ + HALF_HEIGHT("HalfHeight"); + + private final String value; + + CharacterHeightType(String v) { + value = v; + } + + /** + * Returns the string representation of the CharacterHeightType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a CharacterHeightType from a string value. + * + * @param v the string value + * @return the corresponding CharacterHeightType + */ + @JsonCreator + public static CharacterHeightType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CharacterStyleType.java b/src/main/java/com/adyen/model/clouddevice/CharacterStyleType.java new file mode 100644 index 000000000..4e184291c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CharacterStyleType.java @@ -0,0 +1,45 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Style of the character. */ +public enum CharacterStyleType { + + /** Normal character style type. */ + NORMAL("Normal"), + /** Bold character style type. */ + BOLD("Bold"), + /** Italic character style type. */ + ITALIC("Italic"), + /** Underlined character style type. */ + UNDERLINED("Underlined"); + + private final String value; + + CharacterStyleType(String v) { + value = v; + } + + /** + * Returns the string representation of the CharacterStyleType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a CharacterStyleType from a string value. + * + * @param v the string value + * @return the corresponding CharacterStyleType + */ + @JsonCreator + public static CharacterStyleType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CharacterWidthType.java b/src/main/java/com/adyen/model/clouddevice/CharacterWidthType.java new file mode 100644 index 000000000..1d3f597c5 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CharacterWidthType.java @@ -0,0 +1,41 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Width of the character. */ +public enum CharacterWidthType { + + /** Single width character width type. */ + SINGLE_WIDTH("SingleWidth"), + /** Double width character width type. */ + DOUBLE_WIDTH("DoubleWidth"); + + private final String value; + + CharacterWidthType(String v) { + value = v; + } + + /** + * Returns the string representation of the CharacterWidthType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a CharacterWidthType from a string value. + * + * @param v the string value + * @return the corresponding CharacterWidthType + */ + @JsonCreator + public static CharacterWidthType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CheckData.java b/src/main/java/com/adyen/model/clouddevice/CheckData.java new file mode 100644 index 000000000..8e3cd4081 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CheckData.java @@ -0,0 +1,179 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Information related to the paper check used for the transaction. */ +@JsonPropertyOrder({ + "BankID", + "AccountNumber", + "CheckNumber", + "TrackData", + "CheckCardNumber", + "TypeCode", + "Country" +}) +public class CheckData { + + @JsonProperty("BankID") + @Schema(description = "Identification of the bank. --Rule: Mandatory if TrackData absent") + protected String bankID; + + @JsonProperty("AccountNumber") + @Schema( + description = "Identification of the customer account. --Rule: Mandatory if TrackData absent") + protected String accountNumber; + + @JsonProperty("CheckNumber") + @Schema(description = "Identification of the bank check. --Rule: Mandatory if TrackData absent") + protected String checkNumber; + + @JsonProperty("TrackData") + @Schema( + description = + "Magnetic track or magnetic ink characters line. --Rule: Mandatory if CheckNumber absent") + protected TrackData trackData; + + @JsonProperty("CheckCardNumber") + @Schema(description = "Check guarantee card number. --Rule: If provided by the customer") + protected String checkCardNumber; + + @JsonProperty("TypeCode") + @Schema(description = "Type of bank check.") + protected CheckTypeCodeType typeCode; + + @JsonProperty("Country") + @Schema(description = "Country of the bank check. --Rule: Absent if country of the Sale system") + protected String country; + + /** + * Gets bank id. + * + * @return the bank id + */ + public String getBankID() { + return bankID; + } + + /** + * Sets bank id. + * + * @param bankID the bank id + */ + public void setBankID(String bankID) { + this.bankID = bankID; + } + + /** + * Gets account number. + * + * @return the account number + */ + public String getAccountNumber() { + return accountNumber; + } + + /** + * Sets account number. + * + * @param accountNumber the account number + */ + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + /** + * Gets check number. + * + * @return the check number + */ + public String getCheckNumber() { + return checkNumber; + } + + /** + * Sets check number. + * + * @param checkNumber the check number + */ + public void setCheckNumber(String checkNumber) { + this.checkNumber = checkNumber; + } + + /** + * Gets track data. + * + * @return the track data + */ + public TrackData getTrackData() { + return trackData; + } + + /** + * Sets track data. + * + * @param trackData the track data + */ + public void setTrackData(TrackData trackData) { + this.trackData = trackData; + } + + /** + * Gets check card number. + * + * @return the check card number + */ + public String getCheckCardNumber() { + return checkCardNumber; + } + + /** + * Sets check card number. + * + * @param checkCardNumber the check card number + */ + public void setCheckCardNumber(String checkCardNumber) { + this.checkCardNumber = checkCardNumber; + } + + /** + * Gets type code. + * + * @return the type code + */ + public CheckTypeCodeType getTypeCode() { + if (typeCode == null) { + return CheckTypeCodeType.PERSONAL; + } else { + return typeCode; + } + } + + /** + * Sets type code. + * + * @param typeCode the type code + */ + public void setTypeCode(CheckTypeCodeType typeCode) { + this.typeCode = typeCode; + } + + /** + * Gets country. + * + * @return the country + */ + public String getCountry() { + return country; + } + + /** + * Sets country. + * + * @param country the country + */ + public void setCountry(String country) { + this.country = country; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CheckTypeCodeType.java b/src/main/java/com/adyen/model/clouddevice/CheckTypeCodeType.java new file mode 100644 index 000000000..dab7b5e6a --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CheckTypeCodeType.java @@ -0,0 +1,41 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Type of check. */ +public enum CheckTypeCodeType { + + /** Personal check type code type. */ + PERSONAL("Personal"), + /** Company check type code type. */ + COMPANY("Company"); + + private final String value; + + CheckTypeCodeType(String v) { + value = v; + } + + /** + * Returns the string representation of the CheckTypeCodeType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a CheckTypeCodeType from a string value. + * + * @param v the string value + * @return the corresponding CheckTypeCodeType + */ + @JsonCreator + public static CheckTypeCodeType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java new file mode 100644 index 000000000..278cae840 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiAsyncResponse.java @@ -0,0 +1,88 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2025 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import java.util.Objects; + +/** + * Response of the /async endpoint. When successful the `results` contains `ok` In case of failure + * the `saleToPOIRequest` contains the EventNotification details + */ +public class CloudDeviceApiAsyncResponse { + + private String result; + + private SaleToPOIRequest saleToPOIRequest; + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } + + /** + * Gets sale to POI request. + * + * @return the sale to POI request + */ + public SaleToPOIRequest getSaleToPOIRequest() { + return saleToPOIRequest; + } + + /** + * Sets sale to POI request. + * + * @param saleToPOIRequest the sale to POI request + */ + public void setSaleToPOIRequest(SaleToPOIRequest saleToPOIRequest) { + this.saleToPOIRequest = saleToPOIRequest; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudDeviceApiAsyncResponse response = (CloudDeviceApiAsyncResponse) o; + return Objects.equals(result, response.result) + && Objects.equals(saleToPOIRequest, response.saleToPOIRequest); + } + + @Override + public int hashCode() { + return Objects.hash(result, saleToPOIRequest); + } + + @Override + public String toString() { + return "CloudDeviceApiResponse{" + + "result=" + + result + + ", saleToPOIRequest=" + + saleToPOIRequest + + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiRequest.java b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiRequest.java new file mode 100644 index 000000000..0bd7ceb91 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiRequest.java @@ -0,0 +1,93 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.Objects; + +/** CloudDeviceApiRequest */ +public class CloudDeviceApiRequest { + @JsonProperty("SaleToPOIRequest") + private SaleToPOIRequest saleToPOIRequest; + + /** + * Gets saleToPOIRequest. + * + * @return the sale to POI request + */ + @JsonProperty("SaleToPOIRequest") + public SaleToPOIRequest getSaleToPOIRequest() { + return saleToPOIRequest; + } + + /** + * Sets saleToPOIRequest. + * + * @param saleToPOIRequest the sale to POI request + */ + public void setSaleToPOIRequest(SaleToPOIRequest saleToPOIRequest) { + this.saleToPOIRequest = saleToPOIRequest; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudDeviceApiRequest that = (CloudDeviceApiRequest) o; + return saleToPOIRequest.equals(that.saleToPOIRequest); + } + + /** + * Create an instance of CloudDeviceApiRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CloudDeviceApiRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CloudDeviceApiRequest + */ + public static CloudDeviceApiRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CloudDeviceApiRequest.class); + } + + /** + * Convert an instance of CloudDeviceApiRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public int hashCode() { + return Objects.hash(saleToPOIRequest); + } + + @Override + public String toString() { + return "CloudDeviceApiRequest{" + "saleToPOIRequest=" + saleToPOIRequest + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiResponse.java b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiResponse.java new file mode 100644 index 000000000..85914c25f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiResponse.java @@ -0,0 +1,119 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.Objects; + +/** CloudDeviceApiResponse */ +public class CloudDeviceApiResponse { + @JsonProperty("SaleToPOIResponse") + private SaleToPOIResponse saleToPOIResponse; + + @JsonProperty("SaleToPOIRequest") + private SaleToPOIRequest saleToPOIRequest; + + /** + * Gets sale to POI request. + * + * @return the sale to POI request + */ + public SaleToPOIRequest getSaleToPOIRequest() { + return saleToPOIRequest; + } + + /** + * Sets sale to POI request. + * + * @param saleToPOIRequest the sale to POI request + */ + public void setSaleToPOIRequest(SaleToPOIRequest saleToPOIRequest) { + this.saleToPOIRequest = saleToPOIRequest; + } + + /** + * Gets sale to POI response. + * + * @return the sale to POI response + */ + public SaleToPOIResponse getSaleToPOIResponse() { + return saleToPOIResponse; + } + + /** + * Sets sale to POI response. + * + * @param saleToPOIResponse the sale to POI response + */ + public void setSaleToPOIResponse(SaleToPOIResponse saleToPOIResponse) { + this.saleToPOIResponse = saleToPOIResponse; + } + + /** + * Create an instance of CloudDeviceApiResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CloudDeviceApiResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CloudDeviceApiResponse + */ + public static CloudDeviceApiResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CloudDeviceApiResponse.class); + } + + /** + * Convert an instance of CloudDeviceApiResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudDeviceApiResponse response = (CloudDeviceApiResponse) o; + return Objects.equals(saleToPOIResponse, response.saleToPOIResponse) + && Objects.equals(saleToPOIRequest, response.saleToPOIRequest); + } + + @Override + public int hashCode() { + return Objects.hash(saleToPOIResponse, saleToPOIRequest); + } + + @Override + public String toString() { + return "CloudDeviceApiResponse{" + + "saleToPOIResponse=" + + saleToPOIResponse + + ", saleToPOIRequest=" + + saleToPOIRequest + + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiSecuredRequest.java b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiSecuredRequest.java new file mode 100644 index 000000000..6f8ad4b40 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiSecuredRequest.java @@ -0,0 +1,93 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.Objects; + +/** Terminal API Secured Request */ +public class CloudDeviceApiSecuredRequest { + @JsonProperty("SaleToPOIRequest") + private SaleToPOISecuredMessage saleToPOIRequest; + + /** + * Gets sale to POI request. + * + * @return the sale to POI request + */ + public SaleToPOISecuredMessage getSaleToPOIRequest() { + return saleToPOIRequest; + } + + /** + * Sets sale to POI request. + * + * @param saleToPOIRequest the sale to POI request + */ + public void setSaleToPOIRequest(SaleToPOISecuredMessage saleToPOIRequest) { + this.saleToPOIRequest = saleToPOIRequest; + } + + /** + * Create an instance of CloudDeviceApiSecuredRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CloudDeviceApiSecuredRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CloudDeviceApiSecuredRequest + */ + public static CloudDeviceApiSecuredRequest fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CloudDeviceApiSecuredRequest.class); + } + + /** + * Convert an instance of CloudDeviceApiSecuredRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudDeviceApiSecuredRequest that = (CloudDeviceApiSecuredRequest) o; + return saleToPOIRequest.equals(that.saleToPOIRequest); + } + + @Override + public int hashCode() { + return Objects.hash(saleToPOIRequest); + } + + @Override + public String toString() { + return "CloudDeviceApiSecuredRequest{" + "saleToPOIRequest=" + saleToPOIRequest + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiSecuredResponse.java b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiSecuredResponse.java new file mode 100644 index 000000000..9b80e7944 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CloudDeviceApiSecuredResponse.java @@ -0,0 +1,93 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.Objects; + +/** Terminal API Secured Response */ +public class CloudDeviceApiSecuredResponse { + @JsonProperty("SaleToPOIResponse") + private SaleToPOISecuredMessage saleToPOIResponse; + + /** + * Gets sale to POI response. + * + * @return the sale to POI response + */ + public SaleToPOISecuredMessage getSaleToPOIResponse() { + return saleToPOIResponse; + } + + /** + * Sets sale to POI response. + * + * @param saleToPOIResponse the sale to POI response + */ + public void setSaleToPOIResponse(SaleToPOISecuredMessage saleToPOIResponse) { + this.saleToPOIResponse = saleToPOIResponse; + } + + /** + * Create an instance of CloudDeviceApiSecuredResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CloudDeviceApiSecuredResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CloudDeviceApiSecuredResponse + */ + public static CloudDeviceApiSecuredResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CloudDeviceApiSecuredResponse.class); + } + + /** + * Convert an instance of CloudDeviceApiSecuredResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudDeviceApiSecuredResponse that = (CloudDeviceApiSecuredResponse) o; + return Objects.equals(saleToPOIResponse, that.saleToPOIResponse); + } + + @Override + public int hashCode() { + return Objects.hash(saleToPOIResponse); + } + + @Override + public String toString() { + return "CloudDeviceApiSecuredResponse{" + "saleToPOIResponse=" + saleToPOIResponse + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CoinsOrBills.java b/src/main/java/com/adyen/model/clouddevice/CoinsOrBills.java new file mode 100644 index 000000000..d876e31af --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CoinsOrBills.java @@ -0,0 +1,56 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** Number of coins or bills of a given value. */ +@JsonPropertyOrder({"UnitValue", "Number"}) +public class CoinsOrBills { + + @JsonProperty("UnitValue") + @Schema(description = "Value of a coin or bill.") + protected BigDecimal unitValue; + + @JsonProperty("Number") + @Schema(description = "Number of elements") + protected BigInteger number; + + /** + * Gets unit value. + * + * @return the unit value + */ + public BigDecimal getUnitValue() { + return unitValue; + } + + /** + * Sets unit value. + * + * @param unitValue the unit value + */ + public void setUnitValue(BigDecimal unitValue) { + this.unitValue = unitValue; + } + + /** + * Gets number. + * + * @return the number + */ + public BigInteger getNumber() { + return number; + } + + /** + * Sets number. + * + * @param number the number + */ + public void setNumber(BigInteger number) { + this.number = number; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ColorType.java b/src/main/java/com/adyen/model/clouddevice/ColorType.java new file mode 100644 index 000000000..b73e55b5b --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ColorType.java @@ -0,0 +1,53 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Color of the text. */ +public enum ColorType { + + /** White color type. */ + WHITE("White"), + /** Black color type. */ + BLACK("Black"), + /** Red color type. */ + RED("Red"), + /** Green color type. */ + GREEN("Green"), + /** Blue color type. */ + BLUE("Blue"), + /** Yellow color type. */ + YELLOW("Yellow"), + /** Magenta color type. */ + MAGENTA("Magenta"), + /** Cyan color type. */ + CYAN("Cyan"); + + private final String value; + + ColorType(String v) { + value = v; + } + + /** + * Returns the string representation of the ColorType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a ColorType from a string value. + * + * @param v the string value + * @return the corresponding ColorType + */ + @JsonCreator + public static ColorType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ConnectedDevicesResponse.java b/src/main/java/com/adyen/model/clouddevice/ConnectedDevicesResponse.java new file mode 100644 index 000000000..18362dacc --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ConnectedDevicesResponse.java @@ -0,0 +1,67 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.List; +import java.util.Objects; + +/** ConnectedDevicesResponse */ +public class ConnectedDevicesResponse { + + List uniqueDeviceIds = null; + + public List getUniqueDeviceIds() { + return uniqueDeviceIds; + } + + public void setUniqueDeviceIds(List uniqueDeviceIds) { + this.uniqueDeviceIds = uniqueDeviceIds; + } + + /** + * Create an instance of ConnectedDevicesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectedDevicesResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ConnectedDevicesResponse + */ + public static ConnectedDevicesResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ConnectedDevicesResponse.class); + } + + /** + * Convert an instance of ConnectedDevicesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectedDevicesResponse that = (ConnectedDevicesResponse) o; + return Objects.equals(uniqueDeviceIds, that.uniqueDeviceIds); + } + + @Override + public int hashCode() { + return Objects.hash(uniqueDeviceIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("ConnectedDevicesResponse{"); + sb.append("uniqueDeviceIds=").append(uniqueDeviceIds); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ConnectedTerminalsRequest.java b/src/main/java/com/adyen/model/clouddevice/ConnectedTerminalsRequest.java new file mode 100644 index 000000000..927e89b88 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ConnectedTerminalsRequest.java @@ -0,0 +1,95 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.google.gson.annotations.SerializedName; +import java.util.Objects; + +/** Connected Terminals Request */ +public class ConnectedTerminalsRequest { + + @SerializedName("merchantAccount") + private String merchantAccount; + + @SerializedName("store") + private String store; + + @SerializedName("uniqueTerminalId") + private String uniqueTerminalId; + + public String getMerchantAccount() { + return merchantAccount; + } + + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } + + public String getStore() { + return store; + } + + public void setStore(String store) { + this.store = store; + } + + public String getUniqueTerminalId() { + return uniqueTerminalId; + } + + public void setUniqueTerminalId(String uniqueTerminalId) { + this.uniqueTerminalId = uniqueTerminalId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectedTerminalsRequest that = (ConnectedTerminalsRequest) o; + return Objects.equals(merchantAccount, that.merchantAccount) + && Objects.equals(store, that.store) + && Objects.equals(uniqueTerminalId, that.uniqueTerminalId); + } + + @Override + public int hashCode() { + return Objects.hash(merchantAccount, store, uniqueTerminalId); + } + + @Override + public String toString() { + return "ConnectedTerminalsRequest{" + + "merchantAccount='" + + merchantAccount + + '\'' + + ", store='" + + store + + '\'' + + ", uniqueTerminalId='" + + uniqueTerminalId + + '\'' + + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ConnectedTerminalsResponse.java b/src/main/java/com/adyen/model/clouddevice/ConnectedTerminalsResponse.java new file mode 100644 index 000000000..98d106e58 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ConnectedTerminalsResponse.java @@ -0,0 +1,62 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.google.gson.annotations.SerializedName; +import java.util.List; +import java.util.Objects; + +/** Connected Terminals Response */ +public class ConnectedTerminalsResponse { + + @SerializedName("uniqueTerminalIds") + private List uniqueTerminalIds; + + public List getUniqueTerminalIds() { + return uniqueTerminalIds; + } + + public void setUniqueTerminalIds(List uniqueTerminalIds) { + this.uniqueTerminalIds = uniqueTerminalIds; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectedTerminalsResponse that = (ConnectedTerminalsResponse) o; + return Objects.equals(uniqueTerminalIds, that.uniqueTerminalIds); + } + + @Override + public int hashCode() { + return Objects.hash(uniqueTerminalIds); + } + + @Override + public String toString() { + return "ConnectedTerminalsResponse{" + "uniqueTerminalIds=" + uniqueTerminalIds + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ContentInformation.java b/src/main/java/com/adyen/model/clouddevice/ContentInformation.java new file mode 100644 index 000000000..3801e9cd8 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ContentInformation.java @@ -0,0 +1,139 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** General Cryptographic Message Syntax (CMS) data structure. */ +public class ContentInformation { + + @JsonProperty("EnvelopedData") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected EnvelopedData envelopedData; + + @JsonProperty("AuthenticatedData") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected AuthenticatedData authenticatedData; + + @JsonProperty("SignedData") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected SignedData signedData; + + @JsonProperty("DigestedData") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected DigestedData digestedData; + + @JsonProperty("NamedKeyEncryptedData") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected NamedKeyEncryptedData namedKeyEncryptedData; + + @JsonProperty("ContentType") + protected ContentType contentType; + + /** + * Gets enveloped data. + * + * @return the enveloped data + */ + public EnvelopedData getEnvelopedData() { + return envelopedData; + } + + /** + * Sets enveloped data. + * + * @param envelopedData the enveloped data + */ + public void setEnvelopedData(EnvelopedData envelopedData) { + this.envelopedData = envelopedData; + } + + /** + * Gets authenticated data. + * + * @return the authenticated data + */ + public AuthenticatedData getAuthenticatedData() { + return authenticatedData; + } + + /** + * Sets authenticated data. + * + * @param authenticatedData the authenticated data + */ + public void setAuthenticatedData(AuthenticatedData authenticatedData) { + this.authenticatedData = authenticatedData; + } + + /** + * Gets signed data. + * + * @return the signed data + */ + public SignedData getSignedData() { + return signedData; + } + + /** + * Sets signed data. + * + * @param signedData the signed data + */ + public void setSignedData(SignedData signedData) { + this.signedData = signedData; + } + + /** + * Gets digested data. + * + * @return the digested data + */ + public DigestedData getDigestedData() { + return digestedData; + } + + /** + * Sets digested data. + * + * @param digestedData the digested data + */ + public void setDigestedData(DigestedData digestedData) { + this.digestedData = digestedData; + } + + /** + * Gets named key encrypted data. + * + * @return the named key encrypted data + */ + public NamedKeyEncryptedData getNamedKeyEncryptedData() { + return namedKeyEncryptedData; + } + + /** + * Sets named key encrypted data. + * + * @param namedKeyEncryptedData the named key encrypted data + */ + public void setNamedKeyEncryptedData(NamedKeyEncryptedData namedKeyEncryptedData) { + this.namedKeyEncryptedData = namedKeyEncryptedData; + } + + /** + * Gets content type. + * + * @return the content type + */ + public ContentType getContentType() { + return contentType; + } + + /** + * Sets content type. + * + * @param contentType the content type + */ + public void setContentType(ContentType contentType) { + this.contentType = contentType; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ContentType.java b/src/main/java/com/adyen/model/clouddevice/ContentType.java new file mode 100644 index 000000000..17d982b6c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ContentType.java @@ -0,0 +1,72 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Type of content. */ +public enum ContentType { + + /** + * Generic, non cryptographic, or unqualified data content - (OID: iso(1) member-body(2) us(840) + * rsadsi(113549) pkcs(1) pkcs7(7) 1) + */ + ID_DATA("id-data"), + + /** + * Signature CMS data content - (OID: iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) + * pkcs7(7) 2) + */ + ID_SIGNED_DATA("id-signedData"), + + /** + * Encrypted CMS data content, with encryption key - (OID: iso(1) member-body(2) us(840) + * rsadsi(113549) pkcs(1) pkcs7(7) 3) + */ + ID_ENVELOPED_DATA("id-envelopedData"), + + /** + * Message digest CMS data content - (OID: iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) + * pkcs7(7) 5) + */ + ID_DIGESTED_DATA("id-digestedData"), + + /** + * Encrypted CMS data content - (OID: iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) + * pkcs7(7) 6) + */ + ID_ENCRYPTED_DATA("id-encryptedData"), + + /** + * MAC CMS data content, with encryption key - (OID: iso(1) member- body(2) us(840) rsadsi(113549) + * pkcs(1) pkcs9(9) smime(16) ct(1) 2) + */ + ID_CT_AUTH_DATA("id-ct-authData"); + + private final String value; + + ContentType(String v) { + value = v; + } + + /** + * Returns the string representation of the ContentType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a ContentType from a string value. + * + * @param v the string value + * @return the corresponding ContentType + */ + @JsonCreator + public static ContentType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CurrencyConversion.java b/src/main/java/com/adyen/model/clouddevice/CurrencyConversion.java new file mode 100644 index 000000000..8c1980a7c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CurrencyConversion.java @@ -0,0 +1,158 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +/** Information related to a currency conversion. */ +@JsonPropertyOrder({ + "ConvertedAmount", + "Commission", + "Declaration", + "CustomerApprovedFlag", + "Rate", + "Markup" +}) +public class CurrencyConversion { + + @JsonProperty("ConvertedAmount") + @Schema(description = "Amount after a currency conversion.") + protected Amount convertedAmount; + + @JsonProperty("Commission") + @Schema(description = "Commission for a service. --Rule: Commission of the conversion.") + protected BigDecimal commission; + + @JsonProperty("Declaration") + @Schema( + description = + "Declaration to present to the customer or the cashier for validation. --Rule: If a declaration has to be presented to the customer") + protected String declaration; + + @JsonProperty("CustomerApprovedFlag") + @Schema(description = "Notify if the customer has approved something.") + protected Boolean customerApprovedFlag; + + @JsonProperty("Rate") + @Schema( + description = + "Rate of currency conversion. --Rule: Conversion rate of the target currency against the source currency.") + protected BigDecimal rate; + + @JsonProperty("Markup") + @Schema(description = "Markup of an amount in percentage. --Rule: Markup of the conversion.") + protected BigDecimal markup; + + /** + * Gets converted amount. + * + * @return the converted amount + */ + public Amount getConvertedAmount() { + return convertedAmount; + } + + /** + * Sets converted amount. + * + * @param convertedAmount the converted amount + */ + public void setConvertedAmount(Amount convertedAmount) { + this.convertedAmount = convertedAmount; + } + + /** + * Gets commission. + * + * @return the commission + */ + public BigDecimal getCommission() { + return commission; + } + + /** + * Sets commission. + * + * @param commission the commission + */ + public void setCommission(BigDecimal commission) { + this.commission = commission; + } + + /** + * Gets declaration. + * + * @return the declaration + */ + public String getDeclaration() { + return declaration; + } + + /** + * Sets declaration. + * + * @param declaration the declaration + */ + public void setDeclaration(String declaration) { + this.declaration = declaration; + } + + /** + * Is customer approved flag boolean. + * + * @return the boolean + */ + public boolean isCustomerApprovedFlag() { + if (customerApprovedFlag == null) { + return true; + } else { + return customerApprovedFlag; + } + } + + /** + * Sets customer approved flag. + * + * @param customerApprovedFlag the customer approved flag + */ + public void setCustomerApprovedFlag(Boolean customerApprovedFlag) { + this.customerApprovedFlag = customerApprovedFlag; + } + + /** + * Gets rate. + * + * @return the rate + */ + public BigDecimal getRate() { + return rate; + } + + /** + * Sets rate. + * + * @param rate the rate + */ + public void setRate(BigDecimal rate) { + this.rate = rate; + } + + /** + * Gets markup. + * + * @return the markup + */ + public BigDecimal getMarkup() { + return markup; + } + + /** + * Sets markup. + * + * @param markup the markup + */ + public void setMarkup(BigDecimal markup) { + this.markup = markup; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CustomerOrder.java b/src/main/java/com/adyen/model/clouddevice/CustomerOrder.java new file mode 100644 index 000000000..1ce2b800d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CustomerOrder.java @@ -0,0 +1,255 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.time.OffsetDateTime; + +/** Customer order attached to a card, recorded in the POI system. */ +@JsonPropertyOrder({ + "AdditionalInformation", + "CustomerOrderID", + "SaleReferenceID", + "OpenOrderState", + "StartDate", + "EndDate", + "ForecastedAmount", + "CurrentAmount", + "Currency", + "AccessedBy" +}) +public class CustomerOrder { + + @JsonProperty("AdditionalInformation") + @Schema(description = "Unqualified information. --Rule: If order process in progress.") + protected String additionalInformation; + + @JsonProperty("CustomerOrderID") + @Schema(description = "Identification of a customer order.") + protected String customerOrderID; + + @JsonProperty("SaleReferenceID") + @Schema( + description = + "Identification of a Sale global transaction for a sequence of related POI transactions.") + protected String saleReferenceID; + + @JsonProperty("OpenOrderState") + @Schema(description = "State of a customer order.") + protected Boolean openOrderState; + + @JsonProperty("StartDate") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") + @Schema(description = "Date time of the beginning of an operation.") + protected OffsetDateTime startDate; + + @JsonProperty("EndDate") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") + @Schema( + description = "Date time of the end of an operation. --Rule: If ClosedOrderFlag = \"True\".") + protected OffsetDateTime endDate; + + @JsonProperty("ForecastedAmount") + @Schema(description = "Amount of a transaction.") + protected BigDecimal forecastedAmount; + + @JsonProperty("CurrentAmount") + @Schema(description = "Remaining amount to pay in a transaction.") + protected BigDecimal currentAmount; + + @JsonProperty("Currency") + @Schema(description = "Currency of a monetary amount.") + protected String currency; + + @JsonProperty("AccessedBy") + @Schema( + description = + "Identification of an entity accessing data to perform an operation. --Rule: If multiple currencies are allowed.") + protected String accessedBy; + + /** + * Gets additional information. + * + * @return the additional information + */ + public String getAdditionalInformation() { + return additionalInformation; + } + + /** + * Sets additional information. + * + * @param additionalInformation the additional information + */ + public void setAdditionalInformation(String additionalInformation) { + this.additionalInformation = additionalInformation; + } + + /** + * Gets customer order id. + * + * @return the customer order id + */ + public String getCustomerOrderID() { + return customerOrderID; + } + + /** + * Sets customer order id. + * + * @param customerOrderID the customer order id + */ + public void setCustomerOrderID(String customerOrderID) { + this.customerOrderID = customerOrderID; + } + + /** + * Gets sale reference id. + * + * @return the sale reference id + */ + public String getSaleReferenceID() { + return saleReferenceID; + } + + /** + * Sets sale reference id. + * + * @param saleReferenceID the sale reference id + */ + public void setSaleReferenceID(String saleReferenceID) { + this.saleReferenceID = saleReferenceID; + } + + /** + * Is open order state boolean. + * + * @return the boolean + */ + public boolean isOpenOrderState() { + if (openOrderState == null) { + return false; + } else { + return openOrderState; + } + } + + /** + * Sets open order state. + * + * @param openOrderState the open order state + */ + public void setOpenOrderState(Boolean openOrderState) { + this.openOrderState = openOrderState; + } + + /** + * Gets start date. + * + * @return the start date + */ + public OffsetDateTime getStartDate() { + return startDate; + } + + /** + * Sets start date. + * + * @param startDate the start date + */ + public void setStartDate(OffsetDateTime startDate) { + this.startDate = startDate; + } + + /** + * Gets end date. + * + * @return the end date + */ + public OffsetDateTime getEndDate() { + return endDate; + } + + /** + * Sets end date. + * + * @param endDate the end date + */ + public void setEndDate(OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * Gets forecasted amount. + * + * @return the forecasted amount + */ + public BigDecimal getForecastedAmount() { + return forecastedAmount; + } + + /** + * Sets forecasted amount. + * + * @param forecastedAmount the forecasted amount + */ + public void setForecastedAmount(BigDecimal forecastedAmount) { + this.forecastedAmount = forecastedAmount; + } + + /** + * Gets current amount. + * + * @return the current amount + */ + public BigDecimal getCurrentAmount() { + return currentAmount; + } + + /** + * Sets current amount. + * + * @param currentAmount the current amount + */ + public void setCurrentAmount(BigDecimal currentAmount) { + this.currentAmount = currentAmount; + } + + /** + * Gets currency. + * + * @return the currency + */ + public String getCurrency() { + return currency; + } + + /** + * Sets currency. + * + * @param currency the currency + */ + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * Gets accessed by. + * + * @return the accessed by + */ + public String getAccessedBy() { + return accessedBy; + } + + /** + * Sets accessed by. + * + * @param accessedBy the accessed by + */ + public void setAccessedBy(String accessedBy) { + this.accessedBy = accessedBy; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/CustomerOrderReqType.java b/src/main/java/com/adyen/model/clouddevice/CustomerOrderReqType.java new file mode 100644 index 000000000..caea58688 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/CustomerOrderReqType.java @@ -0,0 +1,49 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of customer order requests. */ +public enum CustomerOrderReqType { + + /** Customer order not completed. */ + @Schema(description = "Customer order not completed.") + OPEN("Open"), + + /** Completed customer orders. */ + @Schema(description = "Completed customer orders.") + CLOSED("Closed"), + + /** All type of CustomerOrder should be listed */ + @Schema(description = "All type of CustomerOrder should be listed") + BOTH("Both"); + + private final String value; + + CustomerOrderReqType(String v) { + value = v; + } + + /** + * Returns the string representation of the CustomerOrderReqType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a CustomerOrderReqType from a string value. + * + * @param v the string value + * @return the corresponding CustomerOrderReqType + */ + @JsonCreator + public static CustomerOrderReqType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DeviceStatus.java b/src/main/java/com/adyen/model/clouddevice/DeviceStatus.java new file mode 100644 index 000000000..397ea78ff --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DeviceStatus.java @@ -0,0 +1,38 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +/** Enum status of the device. */ +public enum DeviceStatus { + ONLINE("ONLINE"), + OFFLINE("OFFLINE"); + + private final String value; + + DeviceStatus(String v) { + value = v; + } + + /** + * Returns the string representation of the DeviceStatus. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates an DeviceStatus from a string value. + * + * @param v the string value + * @return the corresponding DeviceStatus + */ + @JsonCreator + public static DeviceStatus fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java b/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java new file mode 100644 index 000000000..5283bb377 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DeviceStatusResponse.java @@ -0,0 +1,69 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.Objects; + +/** Status of the device */ +public class DeviceStatusResponse { + + private String deviceId; + private DeviceStatus status; + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public DeviceStatus getStatus() { + return status; + } + + public void setStatus(DeviceStatus status) { + this.status = status; + } + + /** + * Create an instance of DeviceStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeviceStatus + * @throws JsonProcessingException if the JSON string is invalid with respect to DeviceStatus + */ + public static DeviceStatusResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DeviceStatusResponse.class); + } + + /** + * Convert an instance of DeviceStatus to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeviceStatusResponse that = (DeviceStatusResponse) o; + return Objects.equals(deviceId, that.deviceId) && status == that.status; + } + + @Override + public int hashCode() { + return Objects.hash(deviceId, status); + } + + @Override + public String toString() { + return "DeviceStatusResponse{" + "deviceId='" + deviceId + '\'' + ", status=" + status + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DeviceType.java b/src/main/java/com/adyen/model/clouddevice/DeviceType.java new file mode 100644 index 000000000..aaa160e8c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DeviceType.java @@ -0,0 +1,73 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of device. */ +public enum DeviceType { + + /** + * Used by the POI System (or the Sale System when the device is managed by the POI Terminal), to + * display some information to the Cashier. + */ + @Schema( + description = + "Used by the POI System (or the Sale System when the device is managed by the POI Terminal), to display some information to the Cashier.") + CASHIER_DISPLAY("CashierDisplay"), + + /** + * Used by the Sale System (or the POI System when the device is managed by the Sale Terminal), to + * display some information to the Customer. + */ + @Schema( + description = + "Used by the Sale System (or the POI System when the device is managed by the Sale Terminal), to display some information to the Customer.") + CUSTOMER_DISPLAY("CustomerDisplay"), + + /** + * Any kind of keyboard allowing all or part of the commands of the Input messageType request from + * the Sale System to the POI System (InputCommand data element). The + */ + @Schema( + description = + "Any kind of keyboard allowing all or part of the commands of the Input message request from the Sale System to the POI System (InputCommand data element). The") + CASHIER_INPUT("CashierInput"), + + /** + * Any kind of keyboard allowing all or part of the commands of the Input messageType request from + * the POI System to the Sale System (InputCommand data element). The + */ + @Schema( + description = + "Any kind of keyboard allowing all or part of the commands of the Input message request from the POI System to the Sale System (InputCommand data element). The") + CUSTOMER_INPUT("CustomerInput"); + + private final String value; + + DeviceType(String v) { + value = v; + } + + /** + * Returns the string representation of the DeviceType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a DeviceType from a string value. + * + * @param v the string value + * @return the corresponding DeviceType + */ + @JsonCreator + public static DeviceType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DiagnosisRequest.java b/src/main/java/com/adyen/model/clouddevice/DiagnosisRequest.java new file mode 100644 index 000000000..54f52738d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DiagnosisRequest.java @@ -0,0 +1,89 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Diagnosis Request message. */ +@JsonPropertyOrder({"AcquirerID", "POIID", "HostDiagnosisFlag"}) +public class DiagnosisRequest { + + @JsonProperty("AcquirerID") + @Schema( + description = + "Identification of the Acquirer --Rule: Present if requesting the diagnosis of these hosts only.") + protected List acquirerID; + + @JsonProperty("POIID") + @Schema( + description = + "Identification of a POI System or a POI Terminal for the Sale to POI protocol --Rule: MessageHeader.POIID") + protected String poiid; + + @JsonProperty("HostDiagnosisFlag") + @Schema(description = "Indicates if Host Diagnosis are required") + protected Boolean hostDiagnosisFlag; + + /** + * Gets acquirer id. + * + * @return the acquirer id + */ + public List getAcquirerID() { + if (acquirerID == null) { + acquirerID = new ArrayList<>(); + } + return this.acquirerID; + } + + /** + * Sets acquirer id. + * + * @param acquirerID the acquirer id + */ + public void setAcquirerID(List acquirerID) { + this.acquirerID = acquirerID; + } + + /** + * Gets poiid. + * + * @return the poiid + */ + public String getPOIID() { + return poiid; + } + + /** + * Sets poiid. + * + * @param poiid the poiid + */ + public void setPOIID(String poiid) { + this.poiid = poiid; + } + + /** + * Is host diagnosis flag boolean. + * + * @return the boolean + */ + public boolean isHostDiagnosisFlag() { + if (hostDiagnosisFlag == null) { + return false; + } else { + return hostDiagnosisFlag; + } + } + + /** + * Sets host diagnosis flag. + * + * @param hostDiagnosisFlag the host diagnosis flag + */ + public void setHostDiagnosisFlag(Boolean hostDiagnosisFlag) { + this.hostDiagnosisFlag = hostDiagnosisFlag; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DiagnosisResponse.java b/src/main/java/com/adyen/model/clouddevice/DiagnosisResponse.java new file mode 100644 index 000000000..0aea02776 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DiagnosisResponse.java @@ -0,0 +1,107 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Diagnosis Response message. */ +@JsonPropertyOrder({"Response", "LoggedSaleID", "POIStatus", "HostStatus"}) +public class DiagnosisResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("LoggedSaleID") + @Schema( + description = "Sale Terminal logged to. --Rule: If Sale Terminal logged to this POI Terminal") + protected List loggedSaleID; + + @JsonProperty("POIStatus") + @Schema(description = "State of a POI Terminal. --Rule: if Response.Result is Success") + protected POIStatus poiStatus; + + @JsonProperty("HostStatus") + @Schema(description = "State of a Host.") + protected List hostStatus; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets logged sale id. + * + * @return the logged sale id + */ + public List getLoggedSaleID() { + if (loggedSaleID == null) { + loggedSaleID = new ArrayList<>(); + } + return this.loggedSaleID; + } + + /** + * Sets logged sale id. + * + * @param loggedSaleID the logged sale id + */ + public void setLoggedSaleID(List loggedSaleID) { + this.loggedSaleID = loggedSaleID; + } + + /** + * Gets poi status. + * + * @return the poi status + */ + public POIStatus getPOIStatus() { + return poiStatus; + } + + /** + * Sets poi status. + * + * @param poiStatus the poi status + */ + public void setPOIStatus(POIStatus poiStatus) { + this.poiStatus = poiStatus; + } + + /** + * Gets host status. + * + * @return the host status + */ + public List getHostStatus() { + if (hostStatus == null) { + hostStatus = new ArrayList<>(); + } + return this.hostStatus; + } + + /** + * Sets host status. + * + * @param hostStatus the host status + */ + public void setHostStatus(List hostStatus) { + this.hostStatus = hostStatus; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DigestedData.java b/src/main/java/com/adyen/model/clouddevice/DigestedData.java new file mode 100644 index 000000000..a1e223d69 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DigestedData.java @@ -0,0 +1,93 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** Cryptographic Message Syntax (CMS) data structure containing digested data. */ +@JsonPropertyOrder({"DigestAlgorithm", "EncapsulatedContent", "Digest", "Version"}) +public class DigestedData { + + @JsonProperty("DigestAlgorithm") + protected AlgorithmIdentifier digestAlgorithm; + + @JsonProperty("EncapsulatedContent") + protected EncapsulatedContent encapsulatedContent; + + @JsonProperty("Digest") + protected byte[] digest; + + @JsonProperty("Version") + protected VersionType version; + + /** + * Gets digest algorithm. + * + * @return the digest algorithm + */ + public AlgorithmIdentifier getDigestAlgorithm() { + return digestAlgorithm; + } + + /** + * Sets digest algorithm. + * + * @param digestAlgorithm the digest algorithm + */ + public void setDigestAlgorithm(AlgorithmIdentifier digestAlgorithm) { + this.digestAlgorithm = digestAlgorithm; + } + + /** + * Gets encapsulated content. + * + * @return the encapsulated content + */ + public EncapsulatedContent getEncapsulatedContent() { + return encapsulatedContent; + } + + /** + * Sets encapsulated content. + * + * @param encapsulatedContent the encapsulated content + */ + public void setEncapsulatedContent(EncapsulatedContent encapsulatedContent) { + this.encapsulatedContent = encapsulatedContent; + } + + /** + * Get digest. + * + * @return the byte [ ] + */ + public byte[] getDigest() { + return digest; + } + + /** + * Sets digest. + * + * @param digest the digest + */ + public void setDigest(byte[] digest) { + this.digest = digest; + } + + /** + * Gets version. + * + * @return the version + */ + public VersionType getVersion() { + return version; + } + + /** + * Sets version. + * + * @param version the version + */ + public void setVersion(VersionType version) { + this.version = version; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DisplayOutput.java b/src/main/java/com/adyen/model/clouddevice/DisplayOutput.java new file mode 100644 index 000000000..0e245e718 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DisplayOutput.java @@ -0,0 +1,193 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Information to display and the way to process the display. */ +@JsonPropertyOrder({ + "OutputContent", + "MenuEntry", + "OutputSignature", + "ResponseRequiredFlag", + "MinimumDisplayTime", + "Device", + "InfoQualify" +}) +public class DisplayOutput { + + @JsonProperty("OutputContent") + @Schema(description = "Content to display or print.") + protected OutputContent outputContent; + + @JsonProperty("MenuEntry") + @Schema( + description = + "An entryof the menu to present to the Cashier --Rule: One instance of MenuEntry per item to display in the menu for the get menu input command.") + protected List menuEntry; + + @JsonProperty("OutputSignature") + @Schema( + description = + "Vendor specific signature of text message to display or print. --Rule: If protection has to be provided to the vendor on the text to display or print.") + protected byte[] outputSignature; + + @JsonProperty("ResponseRequiredFlag") + @Schema(description = "Request of a message response.") + protected Boolean responseRequiredFlag; + + @JsonProperty("MinimumDisplayTime") + @Schema(description = "Number of seconds the message has to be displayed") + protected Integer minimumDisplayTime; + + @JsonProperty("Device") + @Schema( + description = + "Logical device located on a Sale Terminal or a POI Terminal, in term of class of information to output (display, print --Rule: CashierDisplay, CustomerDisplay") + protected DeviceType device; + + @JsonProperty("InfoQualify") + @Schema( + description = + "Qualification of the information to sent to an output logical device, to display or print to the Cashier or the --Rule: Status, Error, Display, POIReplication") + protected InfoQualifyType infoQualify; + + /** + * Gets output content. + * + * @return the output content + */ + public OutputContent getOutputContent() { + return outputContent; + } + + /** + * Sets output content. + * + * @param outputContent the output content + */ + public void setOutputContent(OutputContent outputContent) { + this.outputContent = outputContent; + } + + /** + * Gets menu entry. + * + * @return the menu entry + */ + public List getMenuEntry() { + if (menuEntry == null) { + menuEntry = new ArrayList<>(); + } + return this.menuEntry; + } + + /** + * Sets menu entry. + * + * @param menuEntry the menu entry + */ + public void setMenuEntry(List menuEntry) { + this.menuEntry = menuEntry; + } + + /** + * Get output signature. + * + * @return the byte [ ] + */ + public byte[] getOutputSignature() { + return outputSignature; + } + + /** + * Sets output signature. + * + * @param outputSignature the output signature + */ + public void setOutputSignature(byte[] outputSignature) { + this.outputSignature = outputSignature; + } + + /** + * Is response required flag boolean. + * + * @return the boolean + */ + public boolean isResponseRequiredFlag() { + if (responseRequiredFlag == null) { + return true; + } else { + return responseRequiredFlag; + } + } + + /** + * Sets response required flag. + * + * @param responseRequiredFlag the response required flag + */ + public void setResponseRequiredFlag(Boolean responseRequiredFlag) { + this.responseRequiredFlag = responseRequiredFlag; + } + + /** + * Gets minimum display time. + * + * @return the minimum display time + */ + public int getMinimumDisplayTime() { + if (minimumDisplayTime == null) { + return 0; + } else { + return minimumDisplayTime; + } + } + + /** + * Sets minimum display time. + * + * @param minimumDisplayTime the minimum display time + */ + public void setMinimumDisplayTime(Integer minimumDisplayTime) { + this.minimumDisplayTime = minimumDisplayTime; + } + + /** + * Gets device. + * + * @return the device + */ + public DeviceType getDevice() { + return device; + } + + /** + * Sets device. + * + * @param device the device + */ + public void setDevice(DeviceType device) { + this.device = device; + } + + /** + * Gets info qualify. + * + * @return the info qualify + */ + public InfoQualifyType getInfoQualify() { + return infoQualify; + } + + /** + * Sets info qualify. + * + * @param infoQualify the info qualify + */ + public void setInfoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DisplayRequest.java b/src/main/java/com/adyen/model/clouddevice/DisplayRequest.java new file mode 100644 index 000000000..9ebd1b912 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DisplayRequest.java @@ -0,0 +1,39 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Display Request message. */ +@JsonPropertyOrder({"DisplayOutput"}) +public class DisplayRequest { + + @JsonProperty("DisplayOutput") + @Schema( + description = + "Information to display and the way to process the display. --Rule: Complete display content for output devices. At most one DisplayOutput per Device/ InfoQualify pair") + protected List displayOutput; + + /** + * Gets display output. + * + * @return the display output + */ + public List getDisplayOutput() { + if (displayOutput == null) { + displayOutput = new ArrayList<>(); + } + return this.displayOutput; + } + + /** + * Sets display output. + * + * @param displayOutput the display output + */ + public void setDisplayOutput(List displayOutput) { + this.displayOutput = displayOutput; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DisplayResponse.java b/src/main/java/com/adyen/model/clouddevice/DisplayResponse.java new file mode 100644 index 000000000..eb19e29b4 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DisplayResponse.java @@ -0,0 +1,39 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Display Response message. */ +@JsonPropertyOrder({"OutputResult"}) +public class DisplayResponse { + + @JsonProperty("OutputResult") + @Schema( + description = + "Information related to the result the output (display, print, input). --Rule: One per DisplayOutput item of the request, and in the same order.") + protected List outputResult; + + /** + * Gets output result. + * + * @return the output result + */ + public List getOutputResult() { + if (outputResult == null) { + outputResult = new ArrayList<>(); + } + return this.outputResult; + } + + /** + * Sets output result. + * + * @param outputResult the output result + */ + public void setOutputResult(List outputResult) { + this.outputResult = outputResult; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/DocumentQualifierType.java b/src/main/java/com/adyen/model/clouddevice/DocumentQualifierType.java new file mode 100644 index 000000000..8eb96e113 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/DocumentQualifierType.java @@ -0,0 +1,87 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of document qualifier. */ +public enum DocumentQualifierType { + + /** Where the POI system print the Sale receipt when requested by the Sale Terminal. */ + @Schema( + description = + "Where the POI system print the Sale receipt when requested by the Sale Terminal.") + SALE_RECEIPT("SaleReceipt"), + + /** + * Where the Sale system print the Cashier copy of the Payment receipt when requested by the POI + * Terminal. + */ + @Schema( + description = + "Where the Sale system print the Cashier copy of the Payment receipt when requested by the POI Terminal.") + CASHIER_RECEIPT("CashierReceipt"), + + /** + * Where you print the Customer Payment receipt that could be located on the Sale Terminal or in + * some cases a restricted Customer Sale ticket on the POI Terminal. + */ + @Schema( + description = + "Where you print the Customer Payment receipt that could be located on the Sale Terminal or in some cases a restricted Customer Sale ticket on the POI Terminal.") + CUSTOMER_RECEIPT("CustomerReceipt"), + + /** + * When the POI System wants to print specific document (check, dynamic currency conversion ...). + * Used by the Sale System when the printer is not located on the + */ + @Schema( + description = + "When the POI System wants to print specific document (check, dynamic currency conversion ...). Used by the Sale System when the printer is not located on the") + DOCUMENT("Document"), + + /** + * Coupons, voucher or special ticket generated by the POI or the Sale System and to be printed. + */ + @Schema( + description = + "Coupons, voucher or special ticket generated by the POI or the Sale System and to be printed.") + VOUCHER("Voucher"), + + /** + * When the POI or the Sale System wants to store a messageType on the journal printer or + * electronic journal of the Sale Terminal (it is sometimes a Sale + */ + @Schema( + description = + "When the POI or the Sale System wants to store a message on the journal printer or electronic journal of the Sale Terminal (it is sometimes a Sale") + JOURNAL("Journal"); + + private final String value; + + DocumentQualifierType(String v) { + value = v; + } + + /** + * Returns the string representation of the DocumentQualifierType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a DocumentQualifierType from a string value. + * + * @param v the string value + * @return the corresponding DocumentQualifierType + */ + @JsonCreator + public static DocumentQualifierType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/EnableServiceRequest.java b/src/main/java/com/adyen/model/clouddevice/EnableServiceRequest.java new file mode 100644 index 000000000..7522975c1 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/EnableServiceRequest.java @@ -0,0 +1,83 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Enable Service Request message. */ +@JsonPropertyOrder({"ServicesEnabled", "DisplayOutput", "TransactionAction"}) +public class EnableServiceRequest { + + @JsonProperty("ServicesEnabled") + @Schema( + description = + "Services which are enabled before the start-up of a transaction --Rule: Mandatory if TransactionAction is \"StartTransaction\", absent if not.") + protected List servicesEnabled; + + @JsonProperty("DisplayOutput") + @Schema(description = "Information to display and the way to process the display.") + protected DisplayOutput displayOutput; + + @JsonProperty("TransactionAction") + @Schema(description = "Action to realise on a transaction.") + protected TransactionActionType transactionAction; + + /** + * Gets services enabled. + * + * @return the services enabled + */ + public List getServicesEnabled() { + if (servicesEnabled == null) { + servicesEnabled = new ArrayList<>(); + } + return this.servicesEnabled; + } + + /** + * Sets services enabled. + * + * @param servicesEnabled the services enabled + */ + public void setServicesEnabled(List servicesEnabled) { + this.servicesEnabled = servicesEnabled; + } + + /** + * Gets display output. + * + * @return the display output + */ + public DisplayOutput getDisplayOutput() { + return displayOutput; + } + + /** + * Sets display output. + * + * @param displayOutput the display output + */ + public void setDisplayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + } + + /** + * Gets transaction action. + * + * @return the transaction action + */ + public TransactionActionType getTransactionAction() { + return transactionAction; + } + + /** + * Sets transaction action. + * + * @param transactionAction the transaction action + */ + public void setTransactionAction(TransactionActionType transactionAction) { + this.transactionAction = transactionAction; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/EnableServiceResponse.java b/src/main/java/com/adyen/model/clouddevice/EnableServiceResponse.java new file mode 100644 index 000000000..a98708a45 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/EnableServiceResponse.java @@ -0,0 +1,32 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Enable Service Response message. */ +@JsonPropertyOrder({"Response"}) +public class EnableServiceResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/EncapsulatedContent.java b/src/main/java/com/adyen/model/clouddevice/EncapsulatedContent.java new file mode 100644 index 000000000..d172da66a --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/EncapsulatedContent.java @@ -0,0 +1,51 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** Cryptographic Message Syntax (CMS) data structure containing content to authenticate. */ +@JsonPropertyOrder({"Content", "ContentType"}) +public class EncapsulatedContent { + + @JsonProperty("Content") + protected byte[] content; + + @JsonProperty("ContentType") + protected ContentType contentType; + + /** + * Get content. + * + * @return the byte [ ] + */ + public byte[] getContent() { + return content; + } + + /** + * Sets content. + * + * @param content the content + */ + public void setContent(byte[] content) { + this.content = content; + } + + /** + * Gets content type. + * + * @return the content type + */ + public ContentType getContentType() { + return contentType; + } + + /** + * Sets content type. + * + * @param contentType the content type + */ + public void setContentType(ContentType contentType) { + this.contentType = contentType; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/EncryptedContent.java b/src/main/java/com/adyen/model/clouddevice/EncryptedContent.java new file mode 100644 index 000000000..7adf5f04f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/EncryptedContent.java @@ -0,0 +1,74 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Cryptographic Message Syntax (CMS) data structure containing encrypted data with encryption key. + */ +@JsonPropertyOrder({"ContentEncryptionAlgorithm", "EncryptedData", "ContentType"}) +public class EncryptedContent { + + @JsonProperty("ContentEncryptionAlgorithm") + protected AlgorithmIdentifier contentEncryptionAlgorithm; + + @JsonProperty("EncryptedData") + protected byte[] encryptedData; + + @JsonProperty("ContentType") + protected ContentType contentType; + + /** + * Gets content encryption algorithm. + * + * @return the content encryption algorithm + */ + public AlgorithmIdentifier getContentEncryptionAlgorithm() { + return contentEncryptionAlgorithm; + } + + /** + * Sets content encryption algorithm. + * + * @param contentEncryptionAlgorithm the content encryption algorithm + */ + public void setContentEncryptionAlgorithm(AlgorithmIdentifier contentEncryptionAlgorithm) { + this.contentEncryptionAlgorithm = contentEncryptionAlgorithm; + } + + /** + * Get encrypted data. + * + * @return the byte [ ] + */ + public byte[] getEncryptedData() { + return encryptedData; + } + + /** + * Sets encrypted data. + * + * @param encryptedData the encrypted data + */ + public void setEncryptedData(byte[] encryptedData) { + this.encryptedData = encryptedData; + } + + /** + * Gets content type. + * + * @return the content type + */ + public ContentType getContentType() { + return contentType; + } + + /** + * Sets content type. + * + * @param contentType the content type + */ + public void setContentType(ContentType contentType) { + this.contentType = contentType; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/EntryModeType.java b/src/main/java/com/adyen/model/clouddevice/EntryModeType.java new file mode 100644 index 000000000..e70a66794 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/EntryModeType.java @@ -0,0 +1,83 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Entry mode of the payment instrument information. */ +public enum EntryModeType { + + /** Payment instrument information are taken from RFID */ + RFID("RFID"), + + /** Manual key entry */ + @Schema(description = "Manual key entry") + KEYED("Keyed"), + + /** + * Reading of embossing or OCR of printed data either at time of transaction or after the event. + */ + @Schema( + description = + "Reading of embossing or OCR of printed data either at time of transaction or after the event.") + MANUAL("Manual"), + + /** Account data on file */ + @Schema(description = "Account data on file") + FILE("File"), + + /** Scanned by a bar code reader. */ + @Schema(description = "Scanned by a bar code reader.") + SCANNED("Scanned"), + + /** Magnetic stripe card reader. */ + @Schema(description = "Magnetic stripe card reader.") + MAG_STRIPE("MagStripe"), + + /** Contact ICC (asynchronous) */ + ICC("ICC"), + + /** Contact ICC (synchronous) */ + @Schema(description = "Contact ICC (synchronous)") + SYNCHRONOUS_ICC("SynchronousICC"), + + /** Contactless card reader Magnetic Stripe */ + @Schema(description = "Contactless card reader Magnetic Stripe") + TAPPED("Tapped"), + + /** Contactless card reader conform to ISO 14443 */ + @Schema(description = "Contactless card reader conform to ISO 14443") + CONTACTLESS("Contactless"), + + /** Mobile phone. */ + @Schema(description = "Mobile phone.") + MOBILE("Mobile"); + + private final String value; + + EntryModeType(String v) { + value = v; + } + + /** + * Returns the string representation of the EntryModeType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a EntryModeType from a string value. + * + * @param v the string value + * @return the corresponding EntryModeType + */ + @JsonCreator + public static EntryModeType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/EnvelopedData.java b/src/main/java/com/adyen/model/clouddevice/EnvelopedData.java new file mode 100644 index 000000000..e8d7cb464 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/EnvelopedData.java @@ -0,0 +1,108 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; + +/** + * Cryptographic Message Syntax (CMS) data structure containing encrypted data with encryption key. + */ +public class EnvelopedData { + + @JsonProperty("KeyTransport") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + protected List keyTransport; + + @JsonProperty("KEK") + @JsonInclude(JsonInclude.Include.NON_EMPTY) + protected List kek; + + @JsonProperty("EncryptedContent") + protected EncryptedContent encryptedContent; + + @JsonProperty("Version") + protected VersionType version; + + /** + * Gets key transport. + * + * @return the key transport + */ + public List getKeyTransport() { + if (keyTransport == null) { + keyTransport = new ArrayList<>(); + } + return keyTransport; + } + + /** + * Sets key transport. + * + * @param keyTransport the key transport + */ + public void setKeyTransport(List keyTransport) { + this.keyTransport = keyTransport; + } + + /** + * Gets kek. + * + * @return the kek + */ + public List getKEK() { + if (kek == null) { + kek = new ArrayList<>(); + } + return kek; + } + + /** + * Sets kek. + * + * @param kek the kek + */ + public void setKEK(List kek) { + this.kek = kek; + } + + /** + * Gets encrypted content. + * + * @return the encrypted content + */ + public EncryptedContent getEncryptedContent() { + return encryptedContent; + } + + /** + * Sets encrypted content. + * + * @param encryptedContent the encrypted content + */ + public void setEncryptedContent(EncryptedContent encryptedContent) { + this.encryptedContent = encryptedContent; + } + + /** + * Gets version. + * + * @return the version + */ + public VersionType getVersion() { + if (version == null) { + return VersionType.V_0; + } else { + return version; + } + } + + /** + * Sets version. + * + * @param version the version + */ + public void setVersion(VersionType version) { + this.version = version; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ErrorConditionType.java b/src/main/java/com/adyen/model/clouddevice/ErrorConditionType.java new file mode 100644 index 000000000..9785cf99c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ErrorConditionType.java @@ -0,0 +1,146 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of error condition. */ +public enum ErrorConditionType { + + /** + * The Initiator of the request has sent an Abort messageType request, which was accepted and + * processed. + */ + @Schema( + description = + "The Initiator of the request has sent an Abort message request, which was accepted and processed.") + ABORTED("Aborted"), + + /** The system is busy, try later */ + @Schema(description = "The system is busy, try later") + BUSY("Busy"), + + /** The user has aborted the transaction on the PED keyboard, for instance during PIN entering. */ + @Schema( + description = + "The user has aborted the transaction on the PED keyboard, for instance during PIN entering.") + CANCEL("Cancel"), + + /** Device out of order */ + @Schema(description = "Device out of order") + DEVICE_OUT("DeviceOut"), + + /** + * If the Input Device request a NotifyCardInputFlag and the Customer enters a card in the card + * reader without answers to the Input command, the POI abort the + */ + @Schema( + description = + "If the Input Device request a NotifyCardInputFlag and the Customer enters a card in the card reader without answers to the Input command, the POI abort the") + INSERTED_CARD("InsertedCard"), + + /** The transaction is still in progress and then the command cannot be processed */ + @Schema( + description = "The transaction is still in progress and then the command cannot be processed") + IN_PROGRESS("InProgress"), + + /** Not logged in */ + @Schema(description = "Not logged in") + LOGGED_OUT("LoggedOut"), + + /** + * Error on the format of the messageType, AdditionalResponse shall contain the identification of + * the data, and the reason in clear text. + */ + @Schema( + description = + "Error on the format of the message, AdditionalResponse shall contain the identification of the data, and the reason in clear text.") + MESSAGE_FORMAT("MessageFormat"), + + /** + * A service request is sent during a Service dialogue. A combination of services not possible to + * provide. During the CardReaderInit messageType processing, the user + */ + @Schema( + description = + "A service request is sent during a Service dialogue. A combination of services not possible to provide. During the CardReaderInit message processing, the user") + NOT_ALLOWED("NotAllowed"), + + /** The transaction is not found (e.g. for a reversal or a repeat) */ + @Schema(description = "The transaction is not found (e.g. for a reversal or a repeat)") + NOT_FOUND("NotFound"), + + /** Some sale items are not payable by the card proposed by the Customer. */ + @Schema(description = "Some sale items are not payable by the card proposed by the Customer.") + PAYMENT_RESTRICTION("PaymentRestriction"), + + /** + * The transaction is refused by the host or the rules associated to the card, and cannot be + * repeated. + */ + @Schema( + description = + "The transaction is refused by the host or the rules associated to the card, and cannot be repeated.") + REFUSAL("Refusal"), + + /** The hardware is not available (absent, not configured...) */ + @Schema(description = "The hardware is not available (absent, not configured...)") + UNAVAILABLE_DEVICE("UnavailableDevice"), + + /** The service is not available (not implemented, not configured, protocol version too old...) */ + @Schema( + description = + "The service is not available (not implemented, not configured, protocol version too old...)") + UNAVAILABLE_SERVICE("UnavailableService"), + + /** + * The card entered by the Customer cannot be processed by the POI because this card is not + * configured in the system + */ + @Schema( + description = + "The card entered by the Customer cannot be processed by the POI because this card is not configured in the system") + INVALID_CARD("InvalidCard"), + + /** + * Acquirer or any host is unreachable or has not answered to an online request, so is considered + * as temporary unavailable. Depending on the Sale context, the + */ + @Schema( + description = + "Acquirer or any host is unreachable or has not answered to an online request, so is considered as temporary unavailable. Depending on the Sale context, the") + UNREACHABLE_HOST("UnreachableHost"), + + /** The user has entered the PIN on the PED keyboard and the verification fails. */ + @Schema( + description = "The user has entered the PIN on the PED keyboard and the verification fails.") + WRONG_PIN("WrongPIN"); + + private final String value; + + ErrorConditionType(String v) { + value = v; + } + + /** + * Returns the string representation of the ErrorConditionType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a ErrorConditionType from a string value. + * + * @param v the string value + * @return the corresponding ErrorConditionType + */ + @JsonCreator + public static ErrorConditionType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/EventNotification.java b/src/main/java/com/adyen/model/clouddevice/EventNotification.java new file mode 100644 index 000000000..4c9cc83f6 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/EventNotification.java @@ -0,0 +1,214 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.OffsetDateTime; + +/** Content of the EventNotification message. */ +@JsonPropertyOrder({ + "EventDetails", + "RejectedMessage", + "DisplayOutput", + "TimeStamp", + "EventToNotify", + "MaintenanceRequiredFlag", + "CustomerLanguage" +}) +public class EventNotification { + + @JsonProperty("EventDetails") + @Schema( + description = + "Information about the event the POI notifies to the Sale System. --Rule: EventToNotify") + protected String eventDetails; + + @JsonProperty("RejectedMessage") + @Schema( + description = + "Message request rejected by the receiver. --Rule: Mandatory if EventToNotify is \"Reject\", absent in other cases") + protected byte[] rejectedMessage; + + @JsonProperty("DisplayOutput") + @Schema( + description = + "Information to display and the way to process the display. --Rule: To display an event message") + protected DisplayOutput displayOutput; + + @JsonProperty("TimeStamp") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") + @Schema( + description = + "Date and time of a transaction for the Sale System, the POI System or the Acquirer.") + protected OffsetDateTime timeStamp; + + @JsonProperty("EventToNotify") + @Schema(description = "Event the POI notifies to the Sale System.") + protected EventToNotifyType eventToNotify; + + @JsonProperty("MaintenanceRequiredFlag") + @Schema(description = "Indicates if the occurred event requires maintenance call or action.") + protected Boolean maintenanceRequiredFlag; + + @JsonProperty("CustomerLanguage") + @Schema(description = "Language of the Customer --Rule: EventToNotify") + protected String customerLanguage; + + /** + * Gets event details. + * + * @return the event details + */ + public String getEventDetails() { + return eventDetails; + } + + /** + * Sets event details. + * + * @param eventDetails the event details + */ + public void setEventDetails(String eventDetails) { + this.eventDetails = eventDetails; + } + + /** + * Get rejected message. + * + * @return the byte [ ] + */ + public byte[] getRejectedMessage() { + return rejectedMessage; + } + + /** + * Sets rejected message. + * + * @param rejectedMessage the rejected message + */ + public void setRejectedMessage(byte[] rejectedMessage) { + this.rejectedMessage = rejectedMessage; + } + + /** + * Gets display output. + * + * @return the display output + */ + public DisplayOutput getDisplayOutput() { + return displayOutput; + } + + /** + * Sets display output. + * + * @param displayOutput the display output + */ + public void setDisplayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + } + + /** + * Gets time stamp. + * + * @return the time stamp + */ + public OffsetDateTime getTimeStamp() { + return timeStamp; + } + + /** + * Sets time stamp. + * + * @param timeStamp the time stamp + */ + public void setTimeStamp(OffsetDateTime timeStamp) { + this.timeStamp = timeStamp; + } + + /** + * Gets event to notify. + * + * @return the event to notify + */ + public EventToNotifyType getEventToNotify() { + return eventToNotify; + } + + /** + * Sets event to notify. + * + * @param eventToNotify the event to notify + */ + public void setEventToNotify(EventToNotifyType eventToNotify) { + this.eventToNotify = eventToNotify; + } + + /** + * Is maintenance required flag boolean. + * + * @return the boolean + */ + public boolean isMaintenanceRequiredFlag() { + if (maintenanceRequiredFlag == null) { + return false; + } else { + return maintenanceRequiredFlag; + } + } + + /** + * Sets maintenance required flag. + * + * @param maintenanceRequiredFlag the maintenance required flag + */ + public void setMaintenanceRequiredFlag(Boolean maintenanceRequiredFlag) { + this.maintenanceRequiredFlag = maintenanceRequiredFlag; + } + + /** + * Gets customer language. + * + * @return the customer language + */ + public String getCustomerLanguage() { + return customerLanguage; + } + + /** + * Sets customer language. + * + * @param customerLanguage the customer language + */ + public void setCustomerLanguage(String customerLanguage) { + this.customerLanguage = customerLanguage; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventNotification {\n"); + sb.append(" eventDetails: ").append(toIndentedString(eventDetails)).append("\n"); + sb.append(" rejectedMessage: ").append(toIndentedString(rejectedMessage)).append("\n"); + sb.append(" displayOutput: ").append(toIndentedString(displayOutput)).append("\n"); + sb.append(" timeStamp: ").append(toIndentedString(timeStamp)).append("\n"); + sb.append(" eventToNotify: ").append(toIndentedString(eventToNotify)).append("\n"); + sb.append(" maintenanceRequiredFlag: ") + .append(toIndentedString(maintenanceRequiredFlag)) + .append("\n"); + sb.append(" customerLanguage: ").append(toIndentedString(customerLanguage)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/EventToNotifyType.java b/src/main/java/com/adyen/model/clouddevice/EventToNotifyType.java new file mode 100644 index 000000000..dc85bf161 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/EventToNotifyType.java @@ -0,0 +1,138 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of event to notify. */ +public enum EventToNotifyType { + + /** Begin of POI Maintenance */ + @Schema(description = "Begin of POI Maintenance") + BEGIN_MAINTENANCE("BeginMaintenance"), + + /** End of POI Maintenance */ + @Schema(description = "End of POI Maintenance") + END_MAINTENANCE("EndMaintenance"), + + /** The POI Terminal or the POI System is shutting down */ + @Schema(description = "The POI Terminal or the POI System is shutting down") + SHUTDOWN("Shutdown"), + + /** The POI Terminal or the POI System is now ready to work */ + @Schema(description = "The POI Terminal or the POI System is now ready to work") + INITIALISED("Initialised"), + + /** The POI Terminal or the POI System cannot work */ + @Schema(description = "The POI Terminal or the POI System cannot work") + OUT_OF_ORDER("OutOfOrder"), + + /** An Abort request has been sent to abort a messageType which is already completed. */ + @Schema( + description = "An Abort request has been sent to abort a message which is already completed.") + COMPLETED("Completed"), + + /** + * One or several device request has been sent by the POI during the processing of a service + * requested by the Sale System. The processing is cancelled by the + */ + @Schema( + description = + "One or several device request has been sent by the POI during the processing of a service requested by the Sale System. The processing is cancelled by the") + ABORT("Abort"), + + /** + * A POI terminal requests the payment of the transaction identified by the content of + * EventDetails in the Event notification. + */ + @Schema( + description = + "A POI terminal requests the payment of the transaction identified by the content of EventDetails in the Event notification.") + SALE_WAKE_UP("SaleWakeUp"), + + /** + * The POI has performed, or want to perform an automatic administrative process, e.g. the reports + * at the end of day. + */ + @Schema( + description = + "The POI has performed, or want to perform an automatic administrative process, e.g. the reports at the end of day.") + SALE_ADMIN("SaleAdmin"), + + /** The customer has selected a different language on the POI. */ + @Schema(description = "The customer has selected a different language on the POI.") + CUSTOMER_LANGUAGE("CustomerLanguage"), + + /** The customer has pressed a specific key on the POI. */ + @Schema(description = "The customer has pressed a specific key on the POI.") + KEY_PRESSED("KeyPressed"), + + /** Problem of security */ + @Schema(description = "Problem of security") + SECURITY_ALARM("SecurityAlarm"), + + /** When the Customer assistance is stopped, because the Customer has completed its input. */ + @Schema( + description = + "When the Customer assistance is stopped, because the Customer has completed its input.") + STOP_ASSISTANCE("StopAssistance"), + + /** A card is inserted in the card reader (see Input request and NotifyCardInputFlag) */ + @Schema( + description = + "A card is inserted in the card reader (see Input request and NotifyCardInputFlag)") + CARD_INSERTED("CardInserted"), + + /** A card is removed from the card reader. */ + @Schema(description = "A card is removed from the card reader.") + CARD_REMOVED("CardRemoved"), + + /** + * A messageType request is rejected. An error explanation and the messageType in error have to be + * put in the EventDetails data element. + */ + @Schema( + description = + "A message request is rejected. An error explanation and the message in error have to be put in the EventDetails data element.") + REJECT("Reject"), + + /** The terminal has established a network connection to the POS and is online. */ + @Schema(description = "The terminal is connected to the POS over the Internet.") + NETWORK_CONNECTED("NetworkConnected"), + + /** The terminal has lost its network connection to the POS and is offline. */ + @Schema(description = "The terminal is disconnected from the POS.") + NETWORK_DISCONNECTED("NetworkDisconnected"), + + /** Delivers the result (or timeout failure) of the Barcode scan. */ + @Schema(description = "Delivers the result (or timeout failure) of the Barcode scan.") + SCAN_BARCODE_RESULT("ScanBarcodeResult"); + + private final String value; + + EventToNotifyType(String v) { + value = v; + } + + /** + * Returns the string representation of the EventToNotifyType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a EventToNotifyType from a string value. + * + * @param v the string value + * @return the corresponding EventToNotifyType + */ + @JsonCreator + public static EventToNotifyType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ForceEntryModeType.java b/src/main/java/com/adyen/model/clouddevice/ForceEntryModeType.java new file mode 100644 index 000000000..637f7f52e --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ForceEntryModeType.java @@ -0,0 +1,83 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of forced entry mode. */ +public enum ForceEntryModeType { + + /** Payment instrument information are taken from RFID */ + RFID("RFID"), + + /** Manual key entry */ + @Schema(description = "Manual key entry") + KEYED("Keyed"), + + /** + * Reading of embossing or OCR of printed data either at time of transaction or after the event. + */ + @Schema( + description = + "Reading of embossing or OCR of printed data either at time of transaction or after the event.") + MANUAL("Manual"), + + /** Account data on file */ + @Schema(description = "Account data on file") + FILE("File"), + + /** Scanned by a bar code reader. */ + @Schema(description = "Scanned by a bar code reader.") + SCANNED("Scanned"), + + /** Magnetic stripe */ + @Schema(description = "Magnetic stripe ") + MAG_STRIPE("MagStripe"), + + /** Contact ICC (asynchronous) */ + ICC("ICC"), + + /** Contact ICC (synchronous) */ + @Schema(description = "Contact ICC (synchronous)") + SYNCHRONOUS_ICC("SynchronousICC"), + + /** Contactless card reader Magnetic Stripe */ + @Schema(description = "Contactless card reader Magnetic Stripe") + TAPPED("Tapped"), + + /** Contactless card reader conform to ISO 14443 */ + @Schema(description = "Contactless card reader conform to ISO 14443") + CONTACTLESS("Contactless"), + + /** Check Reader */ + @Schema(description = "Check Reader") + CHECK_READER("CheckReader"); + + private final String value; + + ForceEntryModeType(String v) { + value = v; + } + + /** + * Returns the string representation of the ForceEntryModeType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a ForceEntryModeType from a string value. + * + * @param v the string value + * @return the corresponding ForceEntryModeType + */ + @JsonCreator + public static ForceEntryModeType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/GenericProfileType.java b/src/main/java/com/adyen/model/clouddevice/GenericProfileType.java new file mode 100644 index 000000000..4bbd32a94 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/GenericProfileType.java @@ -0,0 +1,71 @@ +package com.adyen.model.clouddevice; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + +/** + * Java class for GenericProfileType. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <simpleType name="GenericProfileType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *     <enumeration value="Basic"/>
+ *     <enumeration value="Standard"/>
+ *     <enumeration value="Extended"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ */ +@XmlType(name = "GenericProfileType") +@XmlEnum +public enum GenericProfileType { + + /** Protocol services that needs to be implemented by all the Sale and POI */ + @XmlEnumValue("Basic") + @Schema(description = "Protocol services that needs to be implemented by all the Sale and POI") + BASIC("Basic"), + + /** + * Protocol services involving interaction between Sale System and POI System as devices shared + * between the two Systems. + */ + @XmlEnumValue("Standard") + @Schema( + description = + "Protocol services involving interaction between Sale System and POI System as devices shared between the two Systems.") + STANDARD("Standard"), + + /** Complete Protocol services */ + @XmlEnumValue("Extended") + @Schema(description = "Complete Protocol services") + EXTENDED("Extended"); + private final String value; + + GenericProfileType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the GenericProfileType, or {@code null} if no match is found. + */ + public static GenericProfileType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/GeographicCoordinates.java b/src/main/java/com/adyen/model/clouddevice/GeographicCoordinates.java new file mode 100644 index 000000000..2f4f8719d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/GeographicCoordinates.java @@ -0,0 +1,57 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Location on the Earth specified by two numbers representing vertical and horizontal position. */ +@JsonPropertyOrder({"Latitude", "Longitude"}) +public class GeographicCoordinates { + + @JsonProperty("Latitude") + @Schema( + description = "Angular distance of a location on the earth south or north of the equator.") + protected String latitude; + + @JsonProperty("Longitude") + @Schema( + description = + "Angular measurement of the distance of a location on the earth east or west of the Greenwich observatory.") + protected String longitude; + + /** + * Gets latitude. + * + * @return the latitude + */ + public String getLatitude() { + return latitude; + } + + /** + * Sets latitude. + * + * @param latitude the latitude + */ + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + /** + * Gets longitude. + * + * @return the longitude + */ + public String getLongitude() { + return longitude; + } + + /** + * Sets longitude. + * + * @param longitude the longitude + */ + public void setLongitude(String longitude) { + this.longitude = longitude; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/Geolocation.java b/src/main/java/com/adyen/model/clouddevice/Geolocation.java new file mode 100644 index 000000000..51d6f6255 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/Geolocation.java @@ -0,0 +1,58 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Geographic location specified by geographic or UTM coordinates. */ +@JsonPropertyOrder({"GeographicCoordinates", "UTMCoordinates"}) +public class Geolocation { + + @JsonProperty("GeographicCoordinates") + @Schema( + description = + "Location on the Earth specified by two numbers representing vertical and horizontal position.") + protected GeographicCoordinates geographicCoordinates; + + @JsonProperty("UTMCoordinates") + @Schema( + description = + "Location on the Earth specified by the Universal Transverse Mercator coordinate system.") + protected UTMCoordinates utmCoordinates; + + /** + * Gets geographic coordinates. + * + * @return the geographic coordinates + */ + public GeographicCoordinates getGeographicCoordinates() { + return geographicCoordinates; + } + + /** + * Sets geographic coordinates. + * + * @param geographicCoordinates the geographic coordinates + */ + public void setGeographicCoordinates(GeographicCoordinates geographicCoordinates) { + this.geographicCoordinates = geographicCoordinates; + } + + /** + * Gets utm coordinates. + * + * @return the utm coordinates + */ + public UTMCoordinates getUTMCoordinates() { + return utmCoordinates; + } + + /** + * Sets utm coordinates. + * + * @param utmCoordinates the utm coordinates + */ + public void setUTMCoordinates(UTMCoordinates utmCoordinates) { + this.utmCoordinates = utmCoordinates; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/GetTotalsRequest.java b/src/main/java/com/adyen/model/clouddevice/GetTotalsRequest.java new file mode 100644 index 000000000..dc14d27c0 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/GetTotalsRequest.java @@ -0,0 +1,61 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Get Totals Request message. */ +@JsonPropertyOrder({"TotalDetails", "TotalFilter"}) +public class GetTotalsRequest { + + @JsonProperty("TotalDetails") + @Schema( + description = + "Indicates the hierarchical structure of the reconciliation result of the Sale to POI reconciliation. --Rule: Require to present totals per value of element included in this cluster (POI Terminal, Sale Terminal, Cashier, Shift,") + protected List totalDetails; + + @JsonProperty("TotalFilter") + @Schema(description = "Filter to compute the totals. --Rule: If structure is not empty") + protected TotalFilter totalFilter; + + /** + * Gets total details. + * + * @return the total details + */ + public List getTotalDetails() { + if (totalDetails == null) { + totalDetails = new ArrayList<>(); + } + return this.totalDetails; + } + + /** + * Sets total details. + * + * @param totalDetails the total details + */ + public void setTotalDetails(List totalDetails) { + this.totalDetails = totalDetails; + } + + /** + * Gets total filter. + * + * @return the total filter + */ + public TotalFilter getTotalFilter() { + return totalFilter; + } + + /** + * Sets total filter. + * + * @param totalFilter the total filter + */ + public void setTotalFilter(TotalFilter totalFilter) { + this.totalFilter = totalFilter; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/GetTotalsResponse.java b/src/main/java/com/adyen/model/clouddevice/GetTotalsResponse.java new file mode 100644 index 000000000..30015cf9a --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/GetTotalsResponse.java @@ -0,0 +1,83 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Reconciliation Response message. */ +@JsonPropertyOrder({"Response", "TransactionTotals", "POIReconciliationID"}) +public class GetTotalsResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("TransactionTotals") + @Schema( + description = + "Result of the Sale to POI Reconciliation processing. --Rule: if Response.Result is Success") + protected List transactionTotals; + + @JsonProperty("POIReconciliationID") + @Schema(description = "Identification of the reconciliation period between Sale and POI. ") + protected String poiReconciliationID; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets transaction totals. + * + * @return the transaction totals + */ + public List getTransactionTotals() { + if (transactionTotals == null) { + transactionTotals = new ArrayList<>(); + } + return this.transactionTotals; + } + + /** + * Sets transaction totals. + * + * @param transactionTotals the transaction totals + */ + public void setTransactionTotals(List transactionTotals) { + this.transactionTotals = transactionTotals; + } + + /** + * Gets poi reconciliation id. + * + * @return the poi reconciliation id + */ + public String getPOIReconciliationID() { + return poiReconciliationID; + } + + /** + * Sets poi reconciliation id. + * + * @param poiReconciliationID the poi reconciliation id + */ + public void setPOIReconciliationID(String poiReconciliationID) { + this.poiReconciliationID = poiReconciliationID; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/GlobalStatusType.java b/src/main/java/com/adyen/model/clouddevice/GlobalStatusType.java new file mode 100644 index 000000000..93cf7673e --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/GlobalStatusType.java @@ -0,0 +1,54 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of global status. */ +public enum GlobalStatusType { + + /** The POI is ready to receive and process a request */ + OK("OK"), + + /** The POI Terminal cannot process a request because another processing is in progress. */ + @Schema( + description = + "The POI Terminal cannot process a request because another processing is in progress.") + BUSY("Busy"), + + /** The POI is in maintenance processing */ + @Schema(description = "The POI is in maintenance processing") + MAINTENANCE("Maintenance"), + + /** The POI is unreachable or not responding */ + @Schema(description = "The POI is unreachable or not responding") + UNREACHABLE("Unreachable"); + + private final String value; + + GlobalStatusType(String v) { + value = v; + } + + /** + * Returns the string representation of the GlobalStatusType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a GlobalStatusType from a string value. + * + * @param v the string value + * @return the corresponding GlobalStatusType + */ + @JsonCreator + public static GlobalStatusType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/HostStatus.java b/src/main/java/com/adyen/model/clouddevice/HostStatus.java new file mode 100644 index 000000000..b419e9a09 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/HostStatus.java @@ -0,0 +1,58 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** State of a Host. */ +@JsonPropertyOrder({"AcquirerID", "IsReachableFlag"}) +public class HostStatus { + + @JsonProperty("AcquirerID") + @Schema(description = "Identification of the Acquirer") + protected String acquirerID; + + @JsonProperty("IsReachableFlag") + @Schema(description = "Indicate if a Host is reachable") + protected Boolean isReachableFlag; + + /** + * Gets acquirer id. + * + * @return the acquirer id + */ + public String getAcquirerID() { + return acquirerID; + } + + /** + * Sets acquirer id. + * + * @param acquirerID the acquirer id + */ + public void setAcquirerID(String acquirerID) { + this.acquirerID = acquirerID; + } + + /** + * Is is reachable flag boolean. + * + * @return the boolean + */ + public boolean isIsReachableFlag() { + if (isReachableFlag == null) { + return true; + } else { + return isReachableFlag; + } + } + + /** + * Sets is reachable flag. + * + * @param isReachableFlag the is reachable flag + */ + public void setIsReachableFlag(Boolean isReachableFlag) { + this.isReachableFlag = isReachableFlag; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ICCResetData.java b/src/main/java/com/adyen/model/clouddevice/ICCResetData.java new file mode 100644 index 000000000..a78a363bf --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ICCResetData.java @@ -0,0 +1,60 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data of a Chip Card related to the reset of the chip. */ +@JsonPropertyOrder({"ATRValue", "CardStatusWords"}) +public class ICCResetData { + + @JsonProperty("ATRValue") + @Schema( + description = "Value of the Answer To Reset of a chip card --Rule: if available", + minLength = 1, + maxLength = 100) + protected byte[] atrValue; + + @JsonProperty("CardStatusWords") + @Schema( + description = "Status of a smartcard response to a command (SW1-SW2) --Rule: if available", + minLength = 2, + maxLength = 2) + protected byte[] cardStatusWords; + + /** + * Get atr value. + * + * @return the byte [ ] + */ + public byte[] getATRValue() { + return atrValue; + } + + /** + * Sets atr value. + * + * @param atrValue the atr value + */ + public void setATRValue(byte[] atrValue) { + this.atrValue = atrValue; + } + + /** + * Get card status words. + * + * @return the byte [ ] + */ + public byte[] getCardStatusWords() { + return cardStatusWords; + } + + /** + * Sets card status words. + * + * @param cardStatusWords the card status words + */ + public void setCardStatusWords(byte[] cardStatusWords) { + this.cardStatusWords = cardStatusWords; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/IdentificationSupportType.java b/src/main/java/com/adyen/model/clouddevice/IdentificationSupportType.java new file mode 100644 index 000000000..ae31ca50e --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/IdentificationSupportType.java @@ -0,0 +1,60 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of identification support. */ +public enum IdentificationSupportType { + + /** The identification is not found on a card */ + @Schema(description = "The identification is not found on a card") + NO_CARD("NoCard"), + + /** The identification is on a card dedicated to this loyalty brand. */ + @Schema(description = "The identification is on a card dedicated to this loyalty brand.") + LOYALTY_CARD("LoyaltyCard"), + + /** The identification is on a card which might be used both for the loyalty and the payment. */ + @Schema( + description = + "The identification is on a card which might be used both for the loyalty and the payment.") + HYBRID_CARD("HybridCard"), + + /** + * The loyalty account is implicitly attached to the payment card. This is usually detected by the + * loyalty Acquirer. + */ + @Schema( + description = + "The loyalty account is implicitly attached to the payment card. This is usually detected by the loyalty Acquirer.") + LINKED_CARD("LinkedCard"); + + private final String value; + + IdentificationSupportType(String v) { + value = v; + } + + /** + * Returns the string representation of the IdentificationSupportType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a IdentificationSupportType from a string value. + * + * @param v the string value + * @return the corresponding IdentificationSupportType + */ + @JsonCreator + public static IdentificationSupportType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/IdentificationType.java b/src/main/java/com/adyen/model/clouddevice/IdentificationType.java new file mode 100644 index 000000000..5815a0877 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/IdentificationType.java @@ -0,0 +1,57 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of identification. */ +public enum IdentificationType { + + /** Standard card identification (card number) */ + PAN("PAN"), + + /** ISO Track 2 including identification. */ + @Schema(description = "ISO Track 2 including identification.") + ISO_TRACK_2("ISOTrack2"), + + /** Bar-code with a specific form of identification */ + @Schema(description = "Bar-code with a specific form of identification") + BAR_CODE("BarCode"), + + /** Account number */ + @Schema(description = "Account number") + ACCOUNT_NUMBER("AccountNumber"), + + /** A phone number identifies the account on which the phone card is assigned. */ + @Schema( + description = "A phone number identifies the account on which the phone card is assigned.") + PHONE_NUMBER("PhoneNumber"); + + private final String value; + + IdentificationType(String v) { + value = v; + } + + /** + * Returns the string representation of the IdentificationType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a IdentificationType from a string value. + * + * @param v the string value + * @return the corresponding IdentificationType + */ + @JsonCreator + public static IdentificationType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/InfoQualifyType.java b/src/main/java/com/adyen/model/clouddevice/InfoQualifyType.java new file mode 100644 index 000000000..dcb4dfa77 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/InfoQualifyType.java @@ -0,0 +1,110 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of information qualifier. */ +public enum InfoQualifyType { + + /** + * The information is a new state on which the messageType sender is entering. For instance, + * during a payment, the POI could display to the Cashier that POI request + */ + @Schema( + description = + "The information is a new state on which the message sender is entering. For instance, during a payment, the POI could display to the Cashier that POI request") + STATUS("Status"), + + /** The information is related to an error situation occurring on the messageType sender. */ + @Schema( + description = + "The information is related to an error situation occurring on the message sender.") + ERROR("Error"), + + /** Standard display interface. */ + @Schema(description = "Standard display interface.") + DISPLAY("Display"), + + /** Standard sound interface. */ + @Schema(description = "Standard sound interface.") + SOUND("Sound"), + + /** + * Answer to a question or information to be entered by the Cashier or the Customer, at the + * request of the POI Terminal or the Sale Terminal. + */ + @Schema( + description = + "Answer to a question or information to be entered by the Cashier or the Customer, at the request of the POI Terminal or the Sale Terminal.") + INPUT("Input"), + + /** Information displayed on the Cardholder POI interface, replicated on the Cashier interface. */ + @Schema( + description = + "Information displayed on the Cardholder POI interface, replicated on the Cashier interface.") + POI_REPLICATION("POIReplication"), + + /** + * Input of the Cardholder POI interface which can be entered by the Cashier to assist the + * Customer. + */ + @Schema( + description = + "Input of the Cardholder POI interface which can be entered by the Cashier to assist the Customer.") + CUSTOMER_ASSISTANCE("CustomerAssistance"), + + /** + * Where you print the Payment receipt that could be located on the Sale Terminal or in some cases + * a restricted Sale ticket on the POI Terminal. + */ + @Schema( + description = + "Where you print the Payment receipt that could be located on the Sale Terminal or in some cases a restricted Sale ticket on the POI Terminal.") + RECEIPT("Receipt"), + + /** + * When the POI System wants to print specific document (check, dynamic currency conversion ...). + * Used by the Sale System when the printer is not located on the + */ + @Schema( + description = + "When the POI System wants to print specific document (check, dynamic currency conversion ...). Used by the Sale System when the printer is not located on the") + DOCUMENT("Document"), + + /** + * Coupons, voucher or special ticket generated by the POI or the Sale System and to be printed. + */ + @Schema( + description = + "Coupons, voucher or special ticket generated by the POI or the Sale System and to be printed.") + VOUCHER("Voucher"); + + private final String value; + + InfoQualifyType(String v) { + value = v; + } + + /** + * Returns the string representation of the InfoQualifyType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a InfoQualifyType from a string value. + * + * @param v the string value + * @return the corresponding InfoQualifyType + */ + @JsonCreator + public static InfoQualifyType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/Input.java b/src/main/java/com/adyen/model/clouddevice/Input.java new file mode 100644 index 000000000..3a987e5fa --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/Input.java @@ -0,0 +1,184 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data entered by the user, related to the input command. */ +@JsonPropertyOrder({ + "ConfirmedFlag", + "FunctionKey", + "TextInput", + "DigitInput", + "Password", + "MenuEntryNumber", + "InputCommand" +}) +public class Input { + + @JsonProperty("ConfirmedFlag") + @Schema( + description = + "Confirmation or not of what has been requested to the user in a GetConfirmation input command. --Rule: Mandatory, if InputCommand is GetConfirmation or SiteManager Not allowed, otherwise") + protected Boolean confirmedFlag; + + @JsonProperty("FunctionKey") + @Schema( + description = + "The number of the function key which is typed by the Customer on the POI or the Cashier on the Sale Terminal. --Rule: Mandatory, if InputCommand is GetFunctionKey Not allowed, otherwise") + protected String functionKey; + + @JsonProperty("TextInput") + @Schema( + description = + "The text which is typed by the Customer on the POI or the Cashier on the Sale Terminal. --Rule: Mandatory, if InputCommand is TextString Not allowed, otherwise") + protected String textInput; + + @JsonProperty("DigitInput") + @Schema( + description = + "The digits which are typed by the Customer on the POI or the Cashier on the Sale Terminal. --Rule: Mandatory, if InputCommand is DigitString Not allowed, otherwise") + protected String digitInput; + + @JsonProperty("Password") + @Schema( + description = + "A text password which is typed by the Customer on the POI or the Cashier on the Sale Terminal. --Rule: Mandatory, if InputCommand is Password Not allowed, otherwise") + protected ContentInformation password; + + @JsonProperty("MenuEntryNumber") + @Schema( + description = + "The index from 1 to n, of the menu item which is selected by the Cashier on the Sale Terminal. The value -1 indicates --Rule: Mandatory, if InputCommand is GetMenuEntry Not allowed, otherwise") + protected Integer[] menuEntryNumber; + + @JsonProperty("InputCommand") + @Schema(description = "Type of requested input --Rule: Copy") + protected InputCommandType inputCommand; + + /** + * Is confirmed flag boolean. + * + * @return the boolean + */ + public Boolean isConfirmedFlag() { + return confirmedFlag; + } + + /** + * Sets confirmed flag. + * + * @param confirmedFlag the confirmed flag + */ + public void setConfirmedFlag(Boolean confirmedFlag) { + this.confirmedFlag = confirmedFlag; + } + + /** + * Gets function key. + * + * @return the function key + */ + public String getFunctionKey() { + return functionKey; + } + + /** + * Sets function key. + * + * @param functionKey the function key + */ + public void setFunctionKey(String functionKey) { + this.functionKey = functionKey; + } + + /** + * Gets text input. + * + * @return the text input + */ + public String getTextInput() { + return textInput; + } + + /** + * Sets text input. + * + * @param textInput the text input + */ + public void setTextInput(String textInput) { + this.textInput = textInput; + } + + /** + * Gets digit input. + * + * @return the digit input + */ + public String getDigitInput() { + return digitInput; + } + + /** + * Sets digit input. + * + * @param digitInput the digit input + */ + public void setDigitInput(String digitInput) { + this.digitInput = digitInput; + } + + /** + * Gets password. + * + * @return the password + */ + public ContentInformation getPassword() { + return password; + } + + /** + * Sets password. + * + * @param password the password + */ + public void setPassword(ContentInformation password) { + this.password = password; + } + + /** + * Get menu entry number. + * + * @return the integer [ ] + */ + public Integer[] getMenuEntryNumber() { + return menuEntryNumber; + } + + /** + * Sets menu entry number. + * + * @param menuEntryNumber the menu entry number + */ + public void setMenuEntryNumber(Integer[] menuEntryNumber) { + this.menuEntryNumber = menuEntryNumber; + } + + /** + * Gets input command. + * + * @return the input command + */ + public InputCommandType getInputCommand() { + return inputCommand; + } + + /** + * Sets input command. + * + * @param inputCommand the input command + */ + public void setInputCommand(InputCommandType inputCommand) { + this.inputCommand = inputCommand; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/InputCommandType.java b/src/main/java/com/adyen/model/clouddevice/InputCommandType.java new file mode 100644 index 000000000..7f614432b --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/InputCommandType.java @@ -0,0 +1,104 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of input command. */ +public enum InputCommandType { + + /** + * Wait for a key pressed on the Terminal, to be able to read the messageType displayed on the + * Terminal. + */ + @Schema( + description = + "Wait for a key pressed on the Terminal, to be able to read the message displayed on the Terminal.") + GET_ANY_KEY("GetAnyKey"), + + /** + * Wait for a confirmation Yes (Y) or No (N) on the Sale Terminal. Wait for a confirmation (Valid + * or Cancel button) on the POI Terminal. The result of the command + */ + @Schema( + description = + "Wait for a confirmation Yes (Y) or No (N) on the Sale Terminal. Wait for a confirmation (Valid or Cancel button) on the POI Terminal. The result of the command") + GET_CONFIRMATION("GetConfirmation"), + + /** Wait for a confirmation Yes (Y) or No (N) of the Site Manager on the Sale Terminal. */ + @Schema( + description = + "Wait for a confirmation Yes (Y) or No (N) of the Site Manager on the Sale Terminal.") + SITE_MANAGER("SiteManager"), + + /** Wait for a string of alphanumeric characters, the length range could be specified. */ + @Schema( + description = + "Wait for a string of alphanumeric characters, the length range could be specified.") + TEXT_STRING("TextString"), + + /** Wait for a string of digit characters, the length range could be specified. */ + @Schema( + description = "Wait for a string of digit characters, the length range could be specified.") + DIGIT_STRING("DigitString"), + + /** + * Wait for a string of digit characters with a decimal point, the length range could be + * specified. + */ + @Schema( + description = + "Wait for a string of digit characters with a decimal point, the length range could be specified.") + DECIMAL_STRING("DecimalString"), + + /** + * Wait for a function key pressed on the Terminal: From POI, Valid, Clear, Correct, Generic + * Function key number. From Sale, Generic Function key. + */ + @Schema( + description = + "Wait for a function key pressed on the Terminal: From POI, Valid, Clear, Correct, Generic Function key number. From Sale, Generic Function key.") + GET_FUNCTION_KEY("GetFunctionKey"), + + /** + * To choose an entry among a list of entrys (all of them are not necessary selectable). The + * OutputFormat has to be MenuEntry. + */ + @Schema( + description = + "To choose an entry among a list of entrys (all of them are not necessary selectable). The OutputFormat has to be MenuEntry.") + GET_MENU_ENTRY("GetMenuEntry"), + + /** Request to enter a password with masked characters while typing the password. */ + @Schema( + description = "Request to enter a password with masked characters while typing the password.") + PASSWORD("Password"); + + private final String value; + + InputCommandType(String v) { + value = v; + } + + /** + * Returns the string representation of the InputCommandType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a InputCommandType from a string value. + * + * @param v the string value + * @return the corresponding InputCommandType + */ + @JsonCreator + public static InputCommandType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/InputData.java b/src/main/java/com/adyen/model/clouddevice/InputData.java new file mode 100644 index 000000000..cdc6cd526 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/InputData.java @@ -0,0 +1,550 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigInteger; + +/** Information related to an Input request. */ +@JsonPropertyOrder({ + "DefaultInputString", + "StringMask", + "Device", + "InfoQualify", + "InputCommand", + "NotifyCardInputFlag", + "MaxInputTime", + "ImmediateResponseFlag", + "MinLength", + "MaxLength", + "MaxDecimalLength", + "WaitUserValidationFlag", + "FromRightToLeftFlag", + "MaskCharactersFlag", + "BeepKeyFlag", + "GlobalCorrectionFlag", + "DisableCancelFlag", + "DisableCorrectFlag", + "DisableValidFlag", + "MenuBackFlag" +}) +public class InputData { + + @JsonProperty("DefaultInputString") + @Schema( + description = + "Default string value for an input command. --Rule: Not allowed if InputCommand is not TextString, DigitString or DecimalString") + protected String defaultInputString; + + @JsonProperty("StringMask") + @Schema( + description = + "String mask to get information requiring a specific format. --Rule: Not allowed if InputCommand is not TextString, DigitString or DecimalString") + protected String stringMask; + + @JsonProperty("Device") + @Schema( + description = + "Logical device located on a Sale Terminal or a POI Terminal, in term of class of information to output (display, print --Rule: CashierInput , CustomerInput, CustomerAssistance") + protected DeviceType device; + + @JsonProperty("InfoQualify") + @Schema( + description = + "Qualification of the information to sent to an output logical device, to display or print to the Cashier or the --Rule: Input, CustomerAssistance") + protected InfoQualifyType infoQualify; + + @JsonProperty("InputCommand") + @Schema(description = "Type of requested input") + protected InputCommandType inputCommand; + + @JsonProperty("NotifyCardInputFlag") + @Schema(description = "Request Notification of card entered in the POI card reader.") + protected Boolean notifyCardInputFlag; + + @JsonProperty("MaxInputTime") + @Schema(description = "Maximum input time in seconds --Rule: If time limit for responding") + protected BigInteger maxInputTime; + + @JsonProperty("ImmediateResponseFlag") + @Schema( + description = + "Request Immediate response to the message without waiting for the completion of the command. --Rule: Optional if InputCommand is \"GetAnyKey\".") + protected Boolean immediateResponseFlag; + + @JsonProperty("MinLength") + @Schema( + description = + "Minimum input length --Rule: Not allowed if InputCommand is not TextString or DigitString") + protected BigInteger minLength; + + @JsonProperty("MaxLength") + @Schema( + description = + "Maximum input length --Rule: Not allowed if InputCommand is not TextString or DigitString") + protected BigInteger maxLength; + + @JsonProperty("MaxDecimalLength") + @Schema( + description = + "Maximum input length of the decimal part (without decimal point) --Rule: Not allowed if InputCommand is not DecimalString Greater than MinLength, lower than MaxLength.") + protected BigInteger maxDecimalLength; + + @JsonProperty("WaitUserValidationFlag") + @Schema( + description = + "Indicates that the user must confirm the entered characters, when the maximum allowed length is reached. --Rule: Optional if MaxLength or MaxDecimalLength present ") + protected Boolean waitUserValidationFlag; + + @JsonProperty("FromRightToLeftFlag") + @Schema( + description = + "Indicate if the entered character has to be displayed from the right to the left of the display field. --Rule: Not allowed if InputCommand is not TextString, DigitString or DecimalString") + protected Boolean fromRightToLeftFlag; + + @JsonProperty("MaskCharactersFlag") + @Schema( + description = + "Indicates to mask the characters entered by the user (i.e. replacing in the display of the input, the entered character --Rule: Not allowed if InputCommand is not TextString, DigitString or Password") + protected Boolean maskCharactersFlag; + + @JsonProperty("BeepKeyFlag") + @Schema( + description = + "Indicates, when the user press a key, if a beep has to be generated (value True).") + protected Boolean beepKeyFlag; + + @JsonProperty("GlobalCorrectionFlag") + @Schema( + description = + "Indicates, when the user press the Correct function key in an input entry, if all the entered characters are removed --Rule: Not allowed if InputCommand is not TextString, DigitString, Password or DecimalString") + protected Boolean globalCorrectionFlag; + + @JsonProperty("DisableCancelFlag") + @Schema( + description = + "Indicates if the Cancel function key has to be desactived (value True). --Rule: Not allowed if InputCommand is not GetConfirmation, SiteManager, or GetMenuEntry") + protected Boolean disableCancelFlag; + + @JsonProperty("DisableCorrectFlag") + @Schema( + description = + "Indicates if the Correct function key has to be desactived (value True). --Rule: Not allowed if InputCommand is not GetConfirmation, SiteManager, or GetMenuEntry") + protected Boolean disableCorrectFlag; + + @JsonProperty("DisableValidFlag") + @Schema( + description = + "Indicates if the Valid function key has to be desactived (value True). --Rule: Not allowed if InputCommand is not GetConfirmation, SiteManager, or GetMenuEntry") + protected Boolean disableValidFlag; + + @JsonProperty("MenuBackFlag") + @Schema( + description = + "If it has the value True, it indicates that the \"Back\" function key (respectively \"Home\" function key) may be used to --Rule: Allowed for the GetMenuEntry value of InputCommand.") + protected Boolean menuBackFlag; + + /** + * Gets default input string. + * + * @return the default input string + */ + public String getDefaultInputString() { + return defaultInputString; + } + + /** + * Sets default input string. + * + * @param defaultInputString the default input string + */ + public void setDefaultInputString(String defaultInputString) { + this.defaultInputString = defaultInputString; + } + + /** + * Gets string mask. + * + * @return the string mask + */ + public String getStringMask() { + return stringMask; + } + + /** + * Sets string mask. + * + * @param stringMask the string mask + */ + public void setStringMask(String stringMask) { + this.stringMask = stringMask; + } + + /** + * Gets device. + * + * @return the device + */ + public DeviceType getDevice() { + return device; + } + + /** + * Sets device. + * + * @param device the device + */ + public void setDevice(DeviceType device) { + this.device = device; + } + + /** + * Gets info qualify. + * + * @return the info qualify + */ + public InfoQualifyType getInfoQualify() { + return infoQualify; + } + + /** + * Sets info qualify. + * + * @param infoQualify the info qualify + */ + public void setInfoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + } + + /** + * Gets input command. + * + * @return the input command + */ + public InputCommandType getInputCommand() { + return inputCommand; + } + + /** + * Sets input command. + * + * @param inputCommand the input command + */ + public void setInputCommand(InputCommandType inputCommand) { + this.inputCommand = inputCommand; + } + + /** + * Is notify card input flag boolean. + * + * @return the boolean + */ + public boolean isNotifyCardInputFlag() { + if (notifyCardInputFlag == null) { + return false; + } else { + return notifyCardInputFlag; + } + } + + /** + * Sets notify card input flag. + * + * @param notifyCardInputFlag the notify card input flag + */ + public void setNotifyCardInputFlag(Boolean notifyCardInputFlag) { + this.notifyCardInputFlag = notifyCardInputFlag; + } + + /** + * Gets max input time. + * + * @return the max input time + */ + public BigInteger getMaxInputTime() { + return maxInputTime; + } + + /** + * Sets max input time. + * + * @param maxInputTime the max input time + */ + public void setMaxInputTime(BigInteger maxInputTime) { + this.maxInputTime = maxInputTime; + } + + /** + * Is immediate response flag boolean. + * + * @return the boolean + */ + public boolean isImmediateResponseFlag() { + if (immediateResponseFlag == null) { + return false; + } else { + return immediateResponseFlag; + } + } + + /** + * Sets immediate response flag. + * + * @param immediateResponseFlag the immediate response flag + */ + public void setImmediateResponseFlag(Boolean immediateResponseFlag) { + this.immediateResponseFlag = immediateResponseFlag; + } + + /** + * Gets min length. + * + * @return the min length + */ + public BigInteger getMinLength() { + return minLength; + } + + /** + * Sets min length. + * + * @param minLength the min length + */ + public void setMinLength(BigInteger minLength) { + this.minLength = minLength; + } + + /** + * Gets max length. + * + * @return the max length + */ + public BigInteger getMaxLength() { + return maxLength; + } + + /** + * Sets max length. + * + * @param maxLength the max length + */ + public void setMaxLength(BigInteger maxLength) { + this.maxLength = maxLength; + } + + /** + * Gets max decimal length. + * + * @return the max decimal length + */ + public BigInteger getMaxDecimalLength() { + return maxDecimalLength; + } + + /** + * Sets max decimal length. + * + * @param maxDecimalLength the max decimal length + */ + public void setMaxDecimalLength(BigInteger maxDecimalLength) { + this.maxDecimalLength = maxDecimalLength; + } + + /** + * Is wait user validation flag boolean. + * + * @return the boolean + */ + public boolean isWaitUserValidationFlag() { + if (waitUserValidationFlag == null) { + return true; + } else { + return waitUserValidationFlag; + } + } + + /** + * Sets wait user validation flag. + * + * @param waitUserValidationFlag the wait user validation flag + */ + public void setWaitUserValidationFlag(Boolean waitUserValidationFlag) { + this.waitUserValidationFlag = waitUserValidationFlag; + } + + /** + * Is from right to left flag boolean. + * + * @return the boolean + */ + public boolean isFromRightToLeftFlag() { + if (fromRightToLeftFlag == null) { + return false; + } else { + return fromRightToLeftFlag; + } + } + + /** + * Sets from right to left flag. + * + * @param fromRightToLeftFlag the from right to left flag + */ + public void setFromRightToLeftFlag(Boolean fromRightToLeftFlag) { + this.fromRightToLeftFlag = fromRightToLeftFlag; + } + + /** + * Is mask characters flag boolean. + * + * @return the boolean + */ + public boolean isMaskCharactersFlag() { + if (maskCharactersFlag == null) { + return false; + } else { + return maskCharactersFlag; + } + } + + /** + * Sets mask characters flag. + * + * @param maskCharactersFlag the mask characters flag + */ + public void setMaskCharactersFlag(Boolean maskCharactersFlag) { + this.maskCharactersFlag = maskCharactersFlag; + } + + /** + * Is beep key flag boolean. + * + * @return the boolean + */ + public boolean isBeepKeyFlag() { + if (beepKeyFlag == null) { + return false; + } else { + return beepKeyFlag; + } + } + + /** + * Sets beep key flag. + * + * @param beepKeyFlag the beep key flag + */ + public void setBeepKeyFlag(Boolean beepKeyFlag) { + this.beepKeyFlag = beepKeyFlag; + } + + /** + * Is global correction flag boolean. + * + * @return the boolean + */ + public boolean isGlobalCorrectionFlag() { + if (globalCorrectionFlag == null) { + return false; + } else { + return globalCorrectionFlag; + } + } + + /** + * Sets global correction flag. + * + * @param globalCorrectionFlag the global correction flag + */ + public void setGlobalCorrectionFlag(Boolean globalCorrectionFlag) { + this.globalCorrectionFlag = globalCorrectionFlag; + } + + /** + * Is disable cancel flag boolean. + * + * @return the boolean + */ + public boolean isDisableCancelFlag() { + if (disableCancelFlag == null) { + return false; + } else { + return disableCancelFlag; + } + } + + /** + * Sets disable cancel flag. + * + * @param disableCancelFlag the disable cancel flag + */ + public void setDisableCancelFlag(Boolean disableCancelFlag) { + this.disableCancelFlag = disableCancelFlag; + } + + /** + * Is disable correct flag boolean. + * + * @return the boolean + */ + public boolean isDisableCorrectFlag() { + if (disableCorrectFlag == null) { + return false; + } else { + return disableCorrectFlag; + } + } + + /** + * Sets disable correct flag. + * + * @param disableCorrectFlag the disable correct flag + */ + public void setDisableCorrectFlag(Boolean disableCorrectFlag) { + this.disableCorrectFlag = disableCorrectFlag; + } + + /** + * Is disable valid flag boolean. + * + * @return the boolean + */ + public boolean isDisableValidFlag() { + if (disableValidFlag == null) { + return false; + } else { + return disableValidFlag; + } + } + + /** + * Sets disable valid flag. + * + * @param disableValidFlag the disable valid flag + */ + public void setDisableValidFlag(Boolean disableValidFlag) { + this.disableValidFlag = disableValidFlag; + } + + /** + * Is menu back flag boolean. + * + * @return the boolean + */ + public boolean isMenuBackFlag() { + if (menuBackFlag == null) { + return false; + } else { + return menuBackFlag; + } + } + + /** + * Sets menu back flag. + * + * @param menuBackFlag the menu back flag + */ + public void setMenuBackFlag(Boolean menuBackFlag) { + this.menuBackFlag = menuBackFlag; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/InputRequest.java b/src/main/java/com/adyen/model/clouddevice/InputRequest.java new file mode 100644 index 000000000..6db1d2e98 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/InputRequest.java @@ -0,0 +1,76 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Input Request message. */ +@JsonPropertyOrder({"DisplayOutput", "InputData"}) +public class InputRequest { + + @JsonProperty("DisplayOutput") + @Schema( + description = + "Information to display and the way to process the display. --Rule: Mandatory if the display device is managed by the receiver.") + protected DisplayOutput displayOutput; + + @JsonProperty("InputData") + @Schema(description = "Information related to an Input request.") + protected InputData inputData; + + /** + * Gets display output. + * + * @return the display output + */ + public DisplayOutput getDisplayOutput() { + return displayOutput; + } + + /** + * Sets display output. + * + * @param displayOutput the display output + */ + public void setDisplayOutput(DisplayOutput displayOutput) { + this.displayOutput = displayOutput; + } + + /** + * Gets input data. + * + * @return the input data + */ + public InputData getInputData() { + return inputData; + } + + /** + * Sets input data. + * + * @param inputData the input data + */ + public void setInputData(InputData inputData) { + this.inputData = inputData; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InputRequest {\n"); + sb.append(" displayOutput: ").append(toIndentedString(displayOutput)).append("\n"); + sb.append(" inputData: ").append(toIndentedString(inputData)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/InputResponse.java b/src/main/java/com/adyen/model/clouddevice/InputResponse.java new file mode 100644 index 000000000..ab1a9afaf --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/InputResponse.java @@ -0,0 +1,76 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Input Response message. */ +@JsonPropertyOrder({"OutputResult", "InputResult"}) +public class InputResponse { + + @JsonProperty("OutputResult") + @Schema( + description = + "Information related to the result the output (display, print, input). --Rule: If DisplayOutput present in the request.") + protected OutputResult outputResult; + + @JsonProperty("InputResult") + @Schema(description = "Information related to the result the input.") + protected InputResult inputResult; + + /** + * Gets output result. + * + * @return the output result + */ + public OutputResult getOutputResult() { + return outputResult; + } + + /** + * Sets output result. + * + * @param outputResult the output result + */ + public void setOutputResult(OutputResult outputResult) { + this.outputResult = outputResult; + } + + /** + * Gets input result. + * + * @return the input result + */ + public InputResult getInputResult() { + return inputResult; + } + + /** + * Sets input result. + * + * @param inputResult the input result + */ + public void setInputResult(InputResult inputResult) { + this.inputResult = inputResult; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InputResponse {\n"); + sb.append(" outputResult: ").append(toIndentedString(outputResult)).append("\n"); + sb.append(" inputResult: ").append(toIndentedString(inputResult)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/InputResult.java b/src/main/java/com/adyen/model/clouddevice/InputResult.java new file mode 100644 index 000000000..ae85dd55d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/InputResult.java @@ -0,0 +1,104 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Information related to the result the input. */ +@JsonPropertyOrder({"Response", "Input", "Device", "InfoQualify"}) +public class InputResult { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("Input") + @Schema( + description = + "Data entered by the user, related to the input command. --Rule: If Response.Result is Success") + protected Input input; + + @JsonProperty("Device") + @Schema( + description = + "Logical device located on a Sale Terminal or a POI Terminal, in term of class of information to output (display, print --Rule: Copy") + protected DeviceType device; + + @JsonProperty("InfoQualify") + @Schema( + description = + "Qualification of the information to sent to an output logical device, to display or print to the Cashier or the --Rule: Copy") + protected InfoQualifyType infoQualify; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets input. + * + * @return the input + */ + public Input getInput() { + return input; + } + + /** + * Sets input. + * + * @param input the input + */ + public void setInput(Input input) { + this.input = input; + } + + /** + * Gets device. + * + * @return the device + */ + public DeviceType getDevice() { + return device; + } + + /** + * Sets device. + * + * @param device the device + */ + public void setDevice(DeviceType device) { + this.device = device; + } + + /** + * Gets info qualify. + * + * @return the info qualify + */ + public InfoQualifyType getInfoQualify() { + return infoQualify; + } + + /** + * Sets info qualify. + * + * @param infoQualify the info qualify + */ + public void setInfoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/InputUpdate.java b/src/main/java/com/adyen/model/clouddevice/InputUpdate.java new file mode 100644 index 000000000..a64f1b7b3 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/InputUpdate.java @@ -0,0 +1,180 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Input Update message. */ +@JsonPropertyOrder({ + "MessageReference", + "OutputContent", + "MenuEntry", + "OutputSignature", + "MinLength", + "MaxLength", + "MaxDecimalLength" +}) +public class InputUpdate { + + @JsonProperty("MessageReference") + @Schema(description = "Identification of a previous POI transaction.") + protected MessageReference messageReference; + + @JsonProperty("OutputContent") + @Schema(description = "Content to display or print.") + protected OutputContent outputContent; + + @JsonProperty("MenuEntry") + @Schema(description = "An entryof the menu to present to the Cashier") + protected List menuEntry; + + @JsonProperty("OutputSignature") + @Schema(description = "Vendor specific signature of text message to display or print.") + protected byte[] outputSignature; + + @JsonProperty("MinLength") + @Schema(description = "Minimum input length --Rule: If present in the Input to update.") + protected BigInteger minLength; + + @JsonProperty("MaxLength") + @Schema(description = "Maximum input length --Rule: If present in the Input to update.") + protected BigInteger maxLength; + + @JsonProperty("MaxDecimalLength") + @Schema( + description = + "Maximum input length of the decimal part (without decimal point) --Rule: If present in the Input to update.") + protected BigInteger maxDecimalLength; + + /** + * Gets message reference. + * + * @return the message reference + */ + public MessageReference getMessageReference() { + return messageReference; + } + + /** + * Sets message reference. + * + * @param messageReference the message reference + */ + public void setMessageReference(MessageReference messageReference) { + this.messageReference = messageReference; + } + + /** + * Gets output content. + * + * @return the output content + */ + public OutputContent getOutputContent() { + return outputContent; + } + + /** + * Sets output content. + * + * @param outputContent the output content + */ + public void setOutputContent(OutputContent outputContent) { + this.outputContent = outputContent; + } + + /** + * Gets menu entry. + * + * @return the menu entry + */ + public List getMenuEntry() { + if (menuEntry == null) { + menuEntry = new ArrayList<>(); + } + return this.menuEntry; + } + + /** + * Sets menu entry. + * + * @param menuEntry the menu entry + */ + public void setMenuEntry(List menuEntry) { + this.menuEntry = menuEntry; + } + + /** + * Get output signature. + * + * @return the byte [ ] + */ + public byte[] getOutputSignature() { + return outputSignature; + } + + /** + * Sets output signature. + * + * @param outputSignature the output signature + */ + public void setOutputSignature(byte[] outputSignature) { + this.outputSignature = outputSignature; + } + + /** + * Gets min length. + * + * @return the min length + */ + public BigInteger getMinLength() { + return minLength; + } + + /** + * Sets min length. + * + * @param minLength the min length + */ + public void setMinLength(BigInteger minLength) { + this.minLength = minLength; + } + + /** + * Gets max length. + * + * @return the max length + */ + public BigInteger getMaxLength() { + return maxLength; + } + + /** + * Sets max length. + * + * @param maxLength the max length + */ + public void setMaxLength(BigInteger maxLength) { + this.maxLength = maxLength; + } + + /** + * Gets max decimal length. + * + * @return the max decimal length + */ + public BigInteger getMaxDecimalLength() { + return maxDecimalLength; + } + + /** + * Sets max decimal length. + * + * @param maxDecimalLength the max decimal length + */ + public void setMaxDecimalLength(BigInteger maxDecimalLength) { + this.maxDecimalLength = maxDecimalLength; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/Instalment.java b/src/main/java/com/adyen/model/clouddevice/Instalment.java new file mode 100644 index 000000000..7bd643070 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/Instalment.java @@ -0,0 +1,270 @@ +package com.adyen.model.clouddevice; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.math.BigInteger; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + * Definition: Information related an instalment transaction. -- Usage: To request an instalment to + * the issuer, or to make individual instalments of a payment transaction. + * + *

Java class for Instalment complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Instalment">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="Instalment" type="{}InstalmentType" />
+ *       <attribute name="SequenceNumber" type="{}SequenceNumber" />
+ *       <attribute name="PlanID" type="{}PlanID" />
+ *       <attribute name="Period" type="{}Period" />
+ *       <attribute name="PeriodUnit" type="{}PeriodUnitType" />
+ *       <attribute name="FirstPaymentDate" type="{}ISODate" />
+ *       <attribute name="TotalNbOfPayments" type="{}TotalNbOfPayments" />
+ *       <attribute name="CumulativeAmount" type="{}SimpleAmountType" />
+ *       <attribute name="FirstAmount" type="{}SimpleAmountType" />
+ *       <attribute name="Charges" type="{}SimpleAmountType" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Instalment") +public class Instalment { + + /** The Instalment type. */ + @XmlElement(name = "InstalmentType") + @Schema(description = "Type of instalment transaction.") + protected InstalmentType instalmentType; + + /** The Sequence number. */ + @XmlElement(name = "SequenceNumber") + @Schema(description = "Sequence number of the instalment.") + protected BigInteger sequenceNumber; + + /** The Plan id. */ + @XmlElement(name = "PlanID") + @Schema(description = "Identification of an instalment plan.") + protected String planID; + + /** The Period. */ + @XmlElement(name = "Period") + @Schema(description = "Period of time with defined unit of time.") + protected BigInteger period; + + /** The Period unit. */ + @XmlElement(name = "PeriodUnit") + protected PeriodUnitType periodUnit; + + /** The First payment date. */ + @XmlElement(name = "FirstPaymentDate") + @Schema(description = "First date of a payment.") + protected String firstPaymentDate; + + /** The Total nb of payments. */ + @XmlElement(name = "TotalNbOfPayments") + @Schema(description = "Total number of payments.") + protected BigInteger totalNbOfPayments; + + /** The Cumulative amount. */ + @XmlElement(name = "CumulativeAmount") + @Schema(description = "Sum of a collection of amounts.") + protected BigDecimal cumulativeAmount; + + /** The First amount. */ + @XmlElement(name = "FirstAmount") + @Schema(description = "First amount of a payment.") + protected BigDecimal firstAmount; + + /** The Charges. */ + @XmlElement(name = "Charges") + @Schema(description = "Charges related to a transaction.") + protected BigDecimal charges; + + /** + * Gets the value of the instalment property. + * + * @return possible object is {@link InstalmentType } + */ + public InstalmentType getInstalmentType() { + return instalmentType; + } + + /** + * Sets the value of the instalmentType property. + * + * @param value allowed object is {@link InstalmentType } + */ + public void setInstalmentType(InstalmentType value) { + this.instalmentType = value; + } + + /** + * Gets the value of the sequenceNumber property. + * + * @return possible object is {@link BigInteger } + */ + public BigInteger getSequenceNumber() { + return sequenceNumber; + } + + /** + * Sets the value of the sequenceNumber property. + * + * @param value allowed object is {@link BigInteger } + */ + public void setSequenceNumber(BigInteger value) { + this.sequenceNumber = value; + } + + /** + * Gets the value of the planID property. + * + * @return possible object is {@link String } + */ + public String getPlanID() { + return planID; + } + + /** + * Sets the value of the planID property. + * + * @param value allowed object is {@link String } + */ + public void setPlanID(String value) { + this.planID = value; + } + + /** + * Gets the value of the period property. + * + * @return possible object is {@link BigInteger } + */ + public BigInteger getPeriod() { + return period; + } + + /** + * Sets the value of the period property. + * + * @param value allowed object is {@link BigInteger } + */ + public void setPeriod(BigInteger value) { + this.period = value; + } + + /** + * Gets the value of the periodUnit property. + * + * @return possible object is {@link PeriodUnitType } + */ + public PeriodUnitType getPeriodUnit() { + return periodUnit; + } + + /** + * Sets the value of the periodUnit property. + * + * @param value allowed object is {@link PeriodUnitType } + */ + public void setPeriodUnit(PeriodUnitType value) { + this.periodUnit = value; + } + + /** + * Gets the value of the firstPaymentDate property. + * + * @return possible object is {@link String } + */ + public String getFirstPaymentDate() { + return firstPaymentDate; + } + + /** + * Sets the value of the firstPaymentDate property. + * + * @param value allowed object is {@link String } + */ + public void setFirstPaymentDate(String value) { + this.firstPaymentDate = value; + } + + /** + * Gets the value of the totalNbOfPayments property. + * + * @return possible object is {@link BigInteger } + */ + public BigInteger getTotalNbOfPayments() { + return totalNbOfPayments; + } + + /** + * Sets the value of the totalNbOfPayments property. + * + * @param value allowed object is {@link BigInteger } + */ + public void setTotalNbOfPayments(BigInteger value) { + this.totalNbOfPayments = value; + } + + /** + * Gets the value of the cumulativeAmount property. + * + * @return possible object is {@link BigDecimal } + */ + public BigDecimal getCumulativeAmount() { + return cumulativeAmount; + } + + /** + * Sets the value of the cumulativeAmount property. + * + * @param value allowed object is {@link BigDecimal } + */ + public void setCumulativeAmount(BigDecimal value) { + this.cumulativeAmount = value; + } + + /** + * Gets the value of the firstAmount property. + * + * @return possible object is {@link BigDecimal } + */ + public BigDecimal getFirstAmount() { + return firstAmount; + } + + /** + * Sets the value of the firstAmount property. + * + * @param value allowed object is {@link BigDecimal } + */ + public void setFirstAmount(BigDecimal value) { + this.firstAmount = value; + } + + /** + * Gets the value of the charges property. + * + * @return possible object is {@link BigDecimal } + */ + public BigDecimal getCharges() { + return charges; + } + + /** + * Sets the value of the charges property. + * + * @param value allowed object is {@link BigDecimal } + */ + public void setCharges(BigDecimal value) { + this.charges = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/InstalmentType.java b/src/main/java/com/adyen/model/clouddevice/InstalmentType.java new file mode 100644 index 000000000..d1f76e8db --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/InstalmentType.java @@ -0,0 +1,47 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum InstalmentType { + + /** The payment of the service or goods is deferred. */ + @Schema(description = "The payment of the service or goods is deferred.") + DEFERRED_INSTALMENTS("DeferredInstalments"), + + /** The payment is split in several instalments of equal amounts. */ + @Schema(description = "The payment is split in several instalments of equal amounts.") + EQUAL_INSTALMENTS("EqualInstalments"), + + /** The payment is split in several instalments of different amounts. */ + @Schema(description = "The payment is split in several instalments of different amounts.") + INEQUAL_INSTALMENTS("InequalInstalments"); + private final String value; + + InstalmentType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the InstalmentType, or {@code null} if no match is found. + */ + @JsonCreator + public static InstalmentType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/Issuer.java b/src/main/java/com/adyen/model/clouddevice/Issuer.java new file mode 100644 index 000000000..1091ded53 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/Issuer.java @@ -0,0 +1,36 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; + +/** Certificate issuer name (see X.501-88). */ +@JsonPropertyOrder({"RelativeDistinguishedName"}) +public class Issuer { + + @JsonProperty("RelativeDistinguishedName") + protected List relativeDistinguishedName; + + /** + * Gets relative distinguished name. + * + * @return the relative distinguished name + */ + public List getRelativeDistinguishedName() { + if (relativeDistinguishedName == null) { + relativeDistinguishedName = new ArrayList<>(); + } + return this.relativeDistinguishedName; + } + + /** + * Sets relative distinguished name. + * + * @param relativeDistinguishedName the relative distinguished name + */ + public void setRelativeDistinguishedName( + List relativeDistinguishedName) { + this.relativeDistinguishedName = relativeDistinguishedName; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/IssuerAndSerialNumber.java b/src/main/java/com/adyen/model/clouddevice/IssuerAndSerialNumber.java new file mode 100644 index 000000000..038332750 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/IssuerAndSerialNumber.java @@ -0,0 +1,55 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigInteger; + +/** + * Cryptographic Message Syntax (CMS) data structure containing the issuer name and certificate + * serial number. + */ +@JsonPropertyOrder({"Issuer", "SerialNumber"}) +public class IssuerAndSerialNumber { + + @JsonProperty("Issuer") + protected Issuer issuer; + + @JsonProperty("SerialNumber") + protected BigInteger serialNumber; + + /** + * Gets issuer. + * + * @return the issuer + */ + public Issuer getIssuer() { + return issuer; + } + + /** + * Sets issuer. + * + * @param issuer the issuer + */ + public void setIssuer(Issuer issuer) { + this.issuer = issuer; + } + + /** + * Gets serial number. + * + * @return the serial number + */ + public BigInteger getSerialNumber() { + return serialNumber; + } + + /** + * Sets serial number. + * + * @param serialNumber the serial number + */ + public void setSerialNumber(BigInteger serialNumber) { + this.serialNumber = serialNumber; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/JSON.java b/src/main/java/com/adyen/model/clouddevice/JSON.java new file mode 100644 index 000000000..0b3e0b59e --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/JSON.java @@ -0,0 +1,62 @@ +package com.adyen.model.clouddevice; + +import com.adyen.serializer.ByteArrayDeserializer; +import com.adyen.serializer.ByteArraySerializer; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import jakarta.ws.rs.ext.ContextResolver; +import java.text.DateFormat; + +public class JSON implements ContextResolver { + private static ObjectMapper mapper; + + private static final JSON json; + + static { + json = new JSON(); + } + + private JSON() { + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, true); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + + mapper.registerModule(new JavaTimeModule()); + // Custom ByteSerializer + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(byte[].class, new ByteArraySerializer()); + simpleModule.addDeserializer(byte[].class, new ByteArrayDeserializer()); + mapper.registerModule(simpleModule); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public static ObjectMapper getMapper() { + return mapper; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/KEK.java b/src/main/java/com/adyen/model/clouddevice/KEK.java new file mode 100644 index 000000000..0dfd76b99 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/KEK.java @@ -0,0 +1,97 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** Encryption key using previously distributed symmetric key. */ +@JsonPropertyOrder({"KEKIdentifier", "KeyEncryptionAlgorithm", "Version", "EncryptedKey"}) +public class KEK { + + @JsonProperty("KEKIdentifier") + protected KEKIdentifier kekIdentifier; + + @JsonProperty("KeyEncryptionAlgorithm") + protected AlgorithmIdentifier keyEncryptionAlgorithm; + + @JsonProperty("Version") + protected VersionType version; + + @JsonProperty("EncryptedKey") + protected byte[] encryptedKey; + + /** + * Gets kek identifier. + * + * @return the kek identifier + */ + public KEKIdentifier getKEKIdentifier() { + return kekIdentifier; + } + + /** + * Sets kek identifier. + * + * @param kekIdentifier the kek identifier + */ + public void setKEKIdentifier(KEKIdentifier kekIdentifier) { + this.kekIdentifier = kekIdentifier; + } + + /** + * Gets key encryption algorithm. + * + * @return the key encryption algorithm + */ + public AlgorithmIdentifier getKeyEncryptionAlgorithm() { + return keyEncryptionAlgorithm; + } + + /** + * Sets key encryption algorithm. + * + * @param keyEncryptionAlgorithm the key encryption algorithm + */ + public void setKeyEncryptionAlgorithm(AlgorithmIdentifier keyEncryptionAlgorithm) { + this.keyEncryptionAlgorithm = keyEncryptionAlgorithm; + } + + /** + * Gets version. + * + * @return the version + */ + public VersionType getVersion() { + if (version == null) { + return VersionType.V_4; + } else { + return version; + } + } + + /** + * Sets version. + * + * @param version the version + */ + public void setVersion(VersionType version) { + this.version = version; + } + + /** + * Get encrypted key. + * + * @return the byte [ ] + */ + public byte[] getEncryptedKey() { + return encryptedKey; + } + + /** + * Sets encrypted key. + * + * @param encryptedKey the encrypted key + */ + public void setEncryptedKey(byte[] encryptedKey) { + this.encryptedKey = encryptedKey; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/KEKIdentifier.java b/src/main/java/com/adyen/model/clouddevice/KEKIdentifier.java new file mode 100644 index 000000000..86cfbd085 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/KEKIdentifier.java @@ -0,0 +1,75 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Identification of a key encryption key (key management using previously distributed symmetric + * key). + */ +@JsonPropertyOrder({"KeyIdentifier", "KeyVersion", "DerivationIdentifier"}) +public class KEKIdentifier { + + @JsonProperty("KeyIdentifier") + protected String keyIdentifier; + + @JsonProperty("KeyVersion") + protected String keyVersion; + + @JsonProperty("DerivationIdentifier") + protected byte[] derivationIdentifier; + + /** + * Gets key identifier. + * + * @return the key identifier + */ + public String getKeyIdentifier() { + return keyIdentifier; + } + + /** + * Sets key identifier. + * + * @param keyIdentifier the key identifier + */ + public void setKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + } + + /** + * Gets key version. + * + * @return the key version + */ + public String getKeyVersion() { + return keyVersion; + } + + /** + * Sets key version. + * + * @param keyVersion the key version + */ + public void setKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + } + + /** + * Get derivation identifier. + * + * @return the byte [ ] + */ + public byte[] getDerivationIdentifier() { + return derivationIdentifier; + } + + /** + * Sets derivation identifier. + * + * @param derivationIdentifier the derivation identifier + */ + public void setDerivationIdentifier(byte[] derivationIdentifier) { + this.derivationIdentifier = derivationIdentifier; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/KeyTransport.java b/src/main/java/com/adyen/model/clouddevice/KeyTransport.java new file mode 100644 index 000000000..179bf13f1 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/KeyTransport.java @@ -0,0 +1,97 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** Encryption key using previously distributed asymmetric key. */ +@JsonPropertyOrder({"RecipientIdentifier", "KeyEncryptionAlgorithm", "Version", "EncryptedKey"}) +public class KeyTransport { + + @JsonProperty("RecipientIdentifier") + protected RecipientIdentifier recipientIdentifier; + + @JsonProperty("KeyEncryptionAlgorithm") + protected AlgorithmIdentifier keyEncryptionAlgorithm; + + @JsonProperty("Version") + protected VersionType version; + + @JsonProperty("EncryptedKey") + protected byte[] encryptedKey; + + /** + * Gets recipient identifier. + * + * @return the recipient identifier + */ + public RecipientIdentifier getRecipientIdentifier() { + return recipientIdentifier; + } + + /** + * Sets recipient identifier. + * + * @param recipientIdentifier the recipient identifier + */ + public void setRecipientIdentifier(RecipientIdentifier recipientIdentifier) { + this.recipientIdentifier = recipientIdentifier; + } + + /** + * Gets key encryption algorithm. + * + * @return the key encryption algorithm + */ + public AlgorithmIdentifier getKeyEncryptionAlgorithm() { + return keyEncryptionAlgorithm; + } + + /** + * Sets key encryption algorithm. + * + * @param keyEncryptionAlgorithm the key encryption algorithm + */ + public void setKeyEncryptionAlgorithm(AlgorithmIdentifier keyEncryptionAlgorithm) { + this.keyEncryptionAlgorithm = keyEncryptionAlgorithm; + } + + /** + * Gets version. + * + * @return the version + */ + public VersionType getVersion() { + if (version == null) { + return VersionType.V_0; + } else { + return version; + } + } + + /** + * Sets version. + * + * @param version the version + */ + public void setVersion(VersionType version) { + this.version = version; + } + + /** + * Get encrypted key. + * + * @return the byte [ ] + */ + public byte[] getEncryptedKey() { + return encryptedKey; + } + + /** + * Sets encrypted key. + * + * @param encryptedKey the encrypted key + */ + public void setEncryptedKey(byte[] encryptedKey) { + this.encryptedKey = encryptedKey; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoginRequest.java b/src/main/java/com/adyen/model/clouddevice/LoginRequest.java new file mode 100644 index 000000000..c349a306f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoginRequest.java @@ -0,0 +1,269 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Login Request message. */ +@JsonPropertyOrder({ + "DateTime", + "SaleSoftware", + "SaleTerminalData", + "TrainingModeFlag", + "OperatorLanguage", + "OperatorID", + "ShiftNumber", + "TokenRequestedType", + "CustomerOrderReq", + "POISerialNumber" +}) +public class LoginRequest { + + @JsonProperty("DateTime") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") + @Schema(description = "Date and Time") + protected OffsetDateTime dateTime; + + @JsonProperty("SaleSoftware") + @Schema( + description = + "Information related to the software of the Sale System which manages the Sale to POI protocol.") + protected SaleSoftware saleSoftware; + + @JsonProperty("SaleTerminalData") + @Schema( + description = + "Information related to the software and hardware feature of the Sale Terminal. --Rule: Present if the login involve a Sale Terminal") + protected SaleTerminalData saleTerminalData; + + @JsonProperty("TrainingModeFlag") + @Schema( + description = + "Training mode --Rule: The POI does not realise the transaction with the Acquirer") + protected Boolean trainingModeFlag; + + @JsonProperty("OperatorLanguage") + @Schema( + description = + "Language of the Cashier or Operator. --Rule: Default value for Device type displays") + protected String operatorLanguage; + + @JsonProperty("OperatorID") + @Schema( + description = + "Identification of the Cashier or Operator. --Rule: 4 conditions to send it: a) the Sale System wants the POI log it in the transaction log b) because of reconciliation") + protected String operatorID; + + @JsonProperty("ShiftNumber") + @Schema(description = "Shift number. --Rule: Same as OperatorID") + protected String shiftNumber; + + @JsonProperty("TokenRequestedType") + @Schema( + description = + "Type of token replacing the PAN of a payment card to identify the payment mean of the customer. --Rule: If a token is requested during the the session.") + protected TokenRequestedType tokenRequestedType; + + @JsonProperty("CustomerOrderReq") + @Schema( + description = + "List of customer orders must be sent in response message. --Rule: If customer orders must be listed in Card Acquisition and Payment response messages during the session.") + protected List customerOrderReq; + + @JsonProperty("POISerialNumber") + @Schema( + description = + "Serial number of a POI Terminal --Rule: If the login involve a POI Terminal and not the first Login to the POI System") + protected String poiSerialNumber; + + /** + * Gets date time. + * + * @return the date time + */ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Sets date time. + * + * @param dateTime the date time + */ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + /** + * Gets sale software. + * + * @return the sale software + */ + public SaleSoftware getSaleSoftware() { + return saleSoftware; + } + + /** + * Sets sale software. + * + * @param saleSoftware the sale software + */ + public void setSaleSoftware(SaleSoftware saleSoftware) { + this.saleSoftware = saleSoftware; + } + + /** + * Gets sale terminal data. + * + * @return the sale terminal data + */ + public SaleTerminalData getSaleTerminalData() { + return saleTerminalData; + } + + /** + * Sets sale terminal data. + * + * @param saleTerminalData the sale terminal data + */ + public void setSaleTerminalData(SaleTerminalData saleTerminalData) { + this.saleTerminalData = saleTerminalData; + } + + /** + * Is training mode flag boolean. + * + * @return the boolean + */ + public boolean isTrainingModeFlag() { + if (trainingModeFlag == null) { + return false; + } else { + return trainingModeFlag; + } + } + + /** + * Sets training mode flag. + * + * @param trainingModeFlag the training mode flag + */ + public void setTrainingModeFlag(Boolean trainingModeFlag) { + this.trainingModeFlag = trainingModeFlag; + } + + /** + * Gets operator language. + * + * @return the operator language + */ + public String getOperatorLanguage() { + return operatorLanguage; + } + + /** + * Sets operator language. + * + * @param operatorLanguage the operator language + */ + public void setOperatorLanguage(String operatorLanguage) { + this.operatorLanguage = operatorLanguage; + } + + /** + * Gets operator id. + * + * @return the operator id + */ + public String getOperatorID() { + return operatorID; + } + + /** + * Sets operator id. + * + * @param operatorID the operator id + */ + public void setOperatorID(String operatorID) { + this.operatorID = operatorID; + } + + /** + * Gets shift number. + * + * @return the shift number + */ + public String getShiftNumber() { + return shiftNumber; + } + + /** + * Sets shift number. + * + * @param shiftNumber the shift number + */ + public void setShiftNumber(String shiftNumber) { + this.shiftNumber = shiftNumber; + } + + /** + * Gets token requested type. + * + * @return the token requested type + */ + public TokenRequestedType getTokenRequestedType() { + return tokenRequestedType; + } + + /** + * Sets token requested type. + * + * @param tokenRequestedType the token requested type + */ + public void setTokenRequestedType(TokenRequestedType tokenRequestedType) { + this.tokenRequestedType = tokenRequestedType; + } + + /** + * Gets customer order req. + * + * @return the customer order req + */ + public List getCustomerOrderReq() { + if (customerOrderReq == null) { + customerOrderReq = new ArrayList<>(); + } + return this.customerOrderReq; + } + + /** + * Sets customer order req. + * + * @param customerOrderReq the customer order req + */ + public void setCustomerOrderReq(List customerOrderReq) { + this.customerOrderReq = customerOrderReq; + } + + /** + * Gets poi serial number. + * + * @return the poi serial number + */ + public String getPOISerialNumber() { + return poiSerialNumber; + } + + /** + * Sets poi serial number. + * + * @param poiSerialNumber the poi serial number + */ + public void setPOISerialNumber(String poiSerialNumber) { + this.poiSerialNumber = poiSerialNumber; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoginResponse.java b/src/main/java/com/adyen/model/clouddevice/LoginResponse.java new file mode 100644 index 000000000..506b867e5 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoginResponse.java @@ -0,0 +1,75 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Login Response message. */ +@JsonPropertyOrder({"Response", "POISystemData"}) +public class LoginResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("POISystemData") + @Schema( + description = "Information related to the POI System --Rule: if Response.Result is Success") + protected POISystemData poiSystemData; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets poi system data. + * + * @return the poi system data + */ + public POISystemData getPOISystemData() { + return poiSystemData; + } + + /** + * Sets poi system data. + * + * @param poiSystemData the poi system data + */ + public void setPOISystemData(POISystemData poiSystemData) { + this.poiSystemData = poiSystemData; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" poiSystemData: ").append(toIndentedString(poiSystemData)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LogoutRequest.java b/src/main/java/com/adyen/model/clouddevice/LogoutRequest.java new file mode 100644 index 000000000..9b0e3545d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LogoutRequest.java @@ -0,0 +1,37 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Logout Request message. */ +@JsonPropertyOrder({"MaintenanceAllowed"}) +public class LogoutRequest { + + @JsonProperty("MaintenanceAllowed") + @Schema( + description = "Indicates that the POI terminal is able to (or have to) go to maintenance.") + protected Boolean maintenanceAllowed; + + /** + * Is maintenance allowed boolean. + * + * @return the boolean + */ + public boolean isMaintenanceAllowed() { + if (maintenanceAllowed == null) { + return false; + } else { + return maintenanceAllowed; + } + } + + /** + * Sets maintenance allowed. + * + * @param maintenanceAllowed the maintenance allowed + */ + public void setMaintenanceAllowed(Boolean maintenanceAllowed) { + this.maintenanceAllowed = maintenanceAllowed; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LogoutResponse.java b/src/main/java/com/adyen/model/clouddevice/LogoutResponse.java new file mode 100644 index 000000000..b0cf0d764 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LogoutResponse.java @@ -0,0 +1,32 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Logout Response message. */ +@JsonPropertyOrder({"Response"}) +public class LogoutResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyAccount.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyAccount.java new file mode 100644 index 000000000..c420f2237 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyAccount.java @@ -0,0 +1,54 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data related to a loyalty account processed in the transaction. */ +@JsonPropertyOrder({"LoyaltyAccountID", "LoyaltyBrand"}) +public class LoyaltyAccount { + + @JsonProperty("LoyaltyAccountID") + @Schema(description = "Identification of a Loyalty account.") + protected LoyaltyAccountID loyaltyAccountID; + + @JsonProperty("LoyaltyBrand") + @Schema(description = "Identification of a Loyalty brand. --Rule: If a card is analysed") + protected String loyaltyBrand; + + /** + * Gets loyalty account id. + * + * @return the loyalty account id + */ + public LoyaltyAccountID getLoyaltyAccountID() { + return loyaltyAccountID; + } + + /** + * Sets loyalty account id. + * + * @param loyaltyAccountID the loyalty account id + */ + public void setLoyaltyAccountID(LoyaltyAccountID loyaltyAccountID) { + this.loyaltyAccountID = loyaltyAccountID; + } + + /** + * Gets loyalty brand. + * + * @return the loyalty brand + */ + public String getLoyaltyBrand() { + return loyaltyBrand; + } + + /** + * Sets loyalty brand. + * + * @param loyaltyBrand the loyalty brand + */ + public void setLoyaltyBrand(String loyaltyBrand) { + this.loyaltyBrand = loyaltyBrand; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyAccountID.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyAccountID.java new file mode 100644 index 000000000..30eacf915 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyAccountID.java @@ -0,0 +1,105 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Identification of a Loyalty account. */ +@JsonPropertyOrder({"LoyaltyID", "EntryMode", "IdentificationType", "IdentificationSupport"}) +public class LoyaltyAccountID { + + @JsonProperty("LoyaltyID") + @Schema(description = "Loyalty account identification") + protected String loyaltyID; + + @JsonProperty("EntryMode") + @Schema(description = "Entry mode of the payment instrument information") + protected List entryMode; + + @JsonProperty("IdentificationType") + @Schema(description = "Type of account identification") + protected IdentificationType identificationType; + + @JsonProperty("IdentificationSupport") + @Schema( + description = + "Support of the loyalty account identification --Rule: if PaymentResponse or LoyaltyResponse or BalanceInquiryResponse") + protected IdentificationSupportType identificationSupport; + + /** + * Gets loyalty id. + * + * @return the loyalty id + */ + public String getLoyaltyID() { + return loyaltyID; + } + + /** + * Sets loyalty id. + * + * @param loyaltyID the loyalty id + */ + public void setLoyaltyID(String loyaltyID) { + this.loyaltyID = loyaltyID; + } + + /** + * Gets entry mode. + * + * @return the entry mode + */ + public List getEntryMode() { + if (entryMode == null) { + entryMode = new ArrayList<>(); + } + return this.entryMode; + } + + /** + * Sets entry mode. + * + * @param entryMode the entry mode + */ + public void setEntryMode(List entryMode) { + this.entryMode = entryMode; + } + + /** + * Gets identification type. + * + * @return the identification type + */ + public IdentificationType getIdentificationType() { + return identificationType; + } + + /** + * Sets identification type. + * + * @param identificationType the identification type + */ + public void setIdentificationType(IdentificationType identificationType) { + this.identificationType = identificationType; + } + + /** + * Gets identification support. + * + * @return the identification support + */ + public IdentificationSupportType getIdentificationSupport() { + return identificationSupport; + } + + /** + * Sets identification support. + * + * @param identificationSupport the identification support + */ + public void setIdentificationSupport(IdentificationSupportType identificationSupport) { + this.identificationSupport = identificationSupport; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyAccountReq.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyAccountReq.java new file mode 100644 index 000000000..139028f1c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyAccountReq.java @@ -0,0 +1,58 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data related to a requested Loyalty program or account. */ +@JsonPropertyOrder({"CardAcquisitionReference", "LoyaltyAccountID"}) +public class LoyaltyAccountReq { + + @JsonProperty("CardAcquisitionReference") + @Schema( + description = + "Reference to the last CardAcquisition, to use the same card. --Rule: If the loyalty account ID comes from a previous CardAcquisition") + protected TransactionIdentification cardAcquisitionReference; + + @JsonProperty("LoyaltyAccountID") + @Schema( + description = + "Identification of a Loyalty account. --Rule: If loyalty identification of the loyalty account is realised by the Sale System") + protected LoyaltyAccountID loyaltyAccountID; + + /** + * Gets card acquisition reference. + * + * @return the card acquisition reference + */ + public TransactionIdentification getCardAcquisitionReference() { + return cardAcquisitionReference; + } + + /** + * Sets card acquisition reference. + * + * @param cardAcquisitionReference the card acquisition reference + */ + public void setCardAcquisitionReference(TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + } + + /** + * Gets loyalty account id. + * + * @return the loyalty account id + */ + public LoyaltyAccountID getLoyaltyAccountID() { + return loyaltyAccountID; + } + + /** + * Sets loyalty account id. + * + * @param loyaltyAccountID the loyalty account id + */ + public void setLoyaltyAccountID(LoyaltyAccountID loyaltyAccountID) { + this.loyaltyAccountID = loyaltyAccountID; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyAccountStatus.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyAccountStatus.java new file mode 100644 index 000000000..9038fa7c7 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyAccountStatus.java @@ -0,0 +1,107 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +/** Data related to the result of a loyalty Balance Inquiry. */ +@JsonPropertyOrder({"LoyaltyAccount", "CurrentBalance", "LoyaltyUnit", "Currency"}) +public class LoyaltyAccountStatus { + + @JsonProperty("LoyaltyAccount") + @Schema(description = "Data related to a loyalty account processed in the transaction.") + protected LoyaltyAccount loyaltyAccount; + + @JsonProperty("CurrentBalance") + @Schema( + description = + "Balance of an account. --Rule: if known (provided by the card or an external host)") + protected BigDecimal currentBalance; + + @JsonProperty("LoyaltyUnit") + @Schema(description = "Unit of a loyalty amount.") + protected LoyaltyUnitType loyaltyUnit; + + @JsonProperty("Currency") + @Schema( + description = + "Currency of a monetary amount. --Rule: If Result is Success and If LoyaltyUnit is \"Monetary\"") + protected String currency; + + /** + * Gets loyalty account. + * + * @return the loyalty account + */ + public LoyaltyAccount getLoyaltyAccount() { + return loyaltyAccount; + } + + /** + * Sets loyalty account. + * + * @param loyaltyAccount the loyalty account + */ + public void setLoyaltyAccount(LoyaltyAccount loyaltyAccount) { + this.loyaltyAccount = loyaltyAccount; + } + + /** + * Gets current balance. + * + * @return the current balance + */ + public BigDecimal getCurrentBalance() { + return currentBalance; + } + + /** + * Sets current balance. + * + * @param currentBalance the current balance + */ + public void setCurrentBalance(BigDecimal currentBalance) { + this.currentBalance = currentBalance; + } + + /** + * Gets loyalty unit. + * + * @return the loyalty unit + */ + public LoyaltyUnitType getLoyaltyUnit() { + if (loyaltyUnit == null) { + return LoyaltyUnitType.POINT; + } else { + return loyaltyUnit; + } + } + + /** + * Sets loyalty unit. + * + * @param loyaltyUnit the loyalty unit + */ + public void setLoyaltyUnit(LoyaltyUnitType loyaltyUnit) { + this.loyaltyUnit = loyaltyUnit; + } + + /** + * Gets currency. + * + * @return the currency + */ + public String getCurrency() { + return currency; + } + + /** + * Sets currency. + * + * @param currency the currency + */ + public void setCurrency(String currency) { + this.currency = currency; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyAcquirerData.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyAcquirerData.java new file mode 100644 index 000000000..b0aca9a74 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyAcquirerData.java @@ -0,0 +1,109 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data related to the loyalty Acquirer during a loyalty transaction. */ +@JsonPropertyOrder({ + "ApprovalCode", + "LoyaltyTransactionID", + "LoyaltyAcquirerID", + "HostReconciliationID" +}) +public class LoyaltyAcquirerData { + + @JsonProperty("ApprovalCode") + @Schema( + description = + "Code assigned to a transaction approval by the Acquirer. --Rule: If provided by the Acquirer") + protected String approvalCode; + + @JsonProperty("LoyaltyTransactionID") + @Schema( + description = + "Identification of the Transaction for the Loyalty Acquirer. --Rule: If provided by the Acquirer") + protected TransactionIdentification loyaltyTransactionID; + + @JsonProperty("LoyaltyAcquirerID") + @Schema(description = "Identification of the loyalty Acquirer. --Rule: If available") + protected String loyaltyAcquirerID; + + @JsonProperty("HostReconciliationID") + @Schema( + description = + "Identifier of a reconciliation period with a payment or loyalty host. --Rule: If provided by the Acquirer") + protected String hostReconciliationID; + + /** + * Gets approval code. + * + * @return the approval code + */ + public String getApprovalCode() { + return approvalCode; + } + + /** + * Sets approval code. + * + * @param approvalCode the approval code + */ + public void setApprovalCode(String approvalCode) { + this.approvalCode = approvalCode; + } + + /** + * Gets loyalty transaction id. + * + * @return the loyalty transaction id + */ + public TransactionIdentification getLoyaltyTransactionID() { + return loyaltyTransactionID; + } + + /** + * Sets loyalty transaction id. + * + * @param loyaltyTransactionID the loyalty transaction id + */ + public void setLoyaltyTransactionID(TransactionIdentification loyaltyTransactionID) { + this.loyaltyTransactionID = loyaltyTransactionID; + } + + /** + * Gets loyalty acquirer id. + * + * @return the loyalty acquirer id + */ + public String getLoyaltyAcquirerID() { + return loyaltyAcquirerID; + } + + /** + * Sets loyalty acquirer id. + * + * @param loyaltyAcquirerID the loyalty acquirer id + */ + public void setLoyaltyAcquirerID(String loyaltyAcquirerID) { + this.loyaltyAcquirerID = loyaltyAcquirerID; + } + + /** + * Gets host reconciliation id. + * + * @return the host reconciliation id + */ + public String getHostReconciliationID() { + return hostReconciliationID; + } + + /** + * Sets host reconciliation id. + * + * @param hostReconciliationID the host reconciliation id + */ + public void setHostReconciliationID(String hostReconciliationID) { + this.hostReconciliationID = hostReconciliationID; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyAmount.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyAmount.java new file mode 100644 index 000000000..ffe77e702 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyAmount.java @@ -0,0 +1,79 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +/** Amount of a loyalty account. */ +@JsonPropertyOrder({"Value", "LoyaltyUnit", "Currency"}) +public class LoyaltyAmount { + + @JsonProperty("Value") + protected BigDecimal value; + + @JsonProperty("LoyaltyUnit") + protected LoyaltyUnitType loyaltyUnit; + + @JsonProperty("Currency") + @Schema(description = "Currency of a monetary amount. --Rule: if LoyaltyUnit is Monetary") + protected String currency; + + /** + * Gets value. + * + * @return the value + */ + public BigDecimal getValue() { + return value; + } + + /** + * Sets value. + * + * @param value the value + */ + public void setValue(BigDecimal value) { + this.value = value; + } + + /** + * Gets loyalty unit. + * + * @return the loyalty unit + */ + public LoyaltyUnitType getLoyaltyUnit() { + if (loyaltyUnit == null) { + return LoyaltyUnitType.POINT; + } else { + return loyaltyUnit; + } + } + + /** + * Sets loyalty unit. + * + * @param loyaltyUnit the loyalty unit + */ + public void setLoyaltyUnit(LoyaltyUnitType loyaltyUnit) { + this.loyaltyUnit = loyaltyUnit; + } + + /** + * Gets currency. + * + * @return the currency + */ + public String getCurrency() { + return currency; + } + + /** + * Sets currency. + * + * @param currency the currency + */ + public void setCurrency(String currency) { + this.currency = currency; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyData.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyData.java new file mode 100644 index 000000000..bb24688c0 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyData.java @@ -0,0 +1,82 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data related to a Loyalty program or account. */ +@JsonPropertyOrder({"CardAcquisitionReference", "LoyaltyAccountID", "LoyaltyAmount"}) +public class LoyaltyData { + + @JsonProperty("CardAcquisitionReference") + @Schema( + description = + "Reference to the last CardAcquisition, to use the same card. --Rule: If the loyalty account ID comes from a previous CardAcquisition") + protected TransactionIdentification cardAcquisitionReference; + + @JsonProperty("LoyaltyAccountID") + @Schema( + description = + "Identification of a Loyalty account. --Rule: If loyalty identification of the loyalty account is realised by the Sale System") + protected LoyaltyAccountID loyaltyAccountID; + + @JsonProperty("LoyaltyAmount") + @Schema( + description = + "Amount of a loyalty account. --Rule: When the Sale System want to award the Loyalty account (not for BalanceInquiryRequest)") + protected LoyaltyAmount loyaltyAmount; + + /** + * Gets card acquisition reference. + * + * @return the card acquisition reference + */ + public TransactionIdentification getCardAcquisitionReference() { + return cardAcquisitionReference; + } + + /** + * Sets card acquisition reference. + * + * @param cardAcquisitionReference the card acquisition reference + */ + public void setCardAcquisitionReference(TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + } + + /** + * Gets loyalty account id. + * + * @return the loyalty account id + */ + public LoyaltyAccountID getLoyaltyAccountID() { + return loyaltyAccountID; + } + + /** + * Sets loyalty account id. + * + * @param loyaltyAccountID the loyalty account id + */ + public void setLoyaltyAccountID(LoyaltyAccountID loyaltyAccountID) { + this.loyaltyAccountID = loyaltyAccountID; + } + + /** + * Gets loyalty amount. + * + * @return the loyalty amount + */ + public LoyaltyAmount getLoyaltyAmount() { + return loyaltyAmount; + } + + /** + * Sets loyalty amount. + * + * @param loyaltyAmount the loyalty amount + */ + public void setLoyaltyAmount(LoyaltyAmount loyaltyAmount) { + this.loyaltyAmount = loyaltyAmount; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyHandlingType.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyHandlingType.java new file mode 100644 index 000000000..ff4103d1c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyHandlingType.java @@ -0,0 +1,82 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of loyalty handling. */ +public enum LoyaltyHandlingType { + + /** + * No loyalty card to read and loyalty transaction to process. Any attempt to enter a pure loyalty + * card is rejected. + */ + @Schema( + description = + "No loyalty card to read and loyalty transaction to process. Any attempt to enter a pure loyalty card is rejected.") + FORBIDDEN("Forbidden"), + + /** + * The loyalty transaction is already processed, no loyalty card or loyalty transaction to + * process. + */ + @Schema( + description = + "The loyalty transaction is already processed, no loyalty card or loyalty transaction to process.") + PROCESSED("Processed"), + + /** + * The loyalty is accepted, but the POI has not to require or ask a loyalty card. The loyalty is + * involved by the payment card (e.g. an hybrid or linked card). + */ + @Schema( + description = + "The loyalty is accepted, but the POI has not to require or ask a loyalty card. The loyalty is involved by the payment card (e.g. an hybrid or linked card).") + ALLOWED("Allowed"), + + /** + * The loyalty is accepted, and the POI has to ask a loyalty card. If the Customer does not enter + * a loyalty card, no loyalty transaction is realised. + */ + @Schema( + description = + "The loyalty is accepted, and the POI has to ask a loyalty card. If the Customer does not enter a loyalty card, no loyalty transaction is realised.") + PROPOSED("Proposed"), + + /** + * The loyalty is required, and the POI refuses the processing of the messageType request if the + * cardholder does not entre a loyalty card + */ + @Schema( + description = + "The loyalty is required, and the POI refuses the processing of the message request if the cardholder does not entre a loyalty card") + REQUIRED("Required"); + + private final String value; + + LoyaltyHandlingType(String v) { + value = v; + } + + /** + * Returns the string representation of the LoyaltyHandlingType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a LoyaltyHandlingType from a string value. + * + * @param v the string value + * @return the corresponding LoyaltyHandlingType + */ + @JsonCreator + public static LoyaltyHandlingType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyRequest.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyRequest.java new file mode 100644 index 000000000..acc545c3e --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyRequest.java @@ -0,0 +1,81 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Loyalty Request message. */ +@JsonPropertyOrder({"SaleData", "LoyaltyTransaction", "LoyaltyData"}) +public class LoyaltyRequest { + + @JsonProperty("SaleData") + @Schema(description = "Data related to the Sale System.") + protected SaleData saleData; + + @JsonProperty("LoyaltyTransaction") + @Schema(description = "Data related to the loyalty transaction.") + protected LoyaltyTransaction loyaltyTransaction; + + @JsonProperty("LoyaltyData") + @Schema(description = "Data related to a Loyalty program or account.") + protected List loyaltyData; + + /** + * Gets sale data. + * + * @return the sale data + */ + public SaleData getSaleData() { + return saleData; + } + + /** + * Sets sale data. + * + * @param saleData the sale data + */ + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + } + + /** + * Gets loyalty transaction. + * + * @return the loyalty transaction + */ + public LoyaltyTransaction getLoyaltyTransaction() { + return loyaltyTransaction; + } + + /** + * Sets loyalty transaction. + * + * @param loyaltyTransaction the loyalty transaction + */ + public void setLoyaltyTransaction(LoyaltyTransaction loyaltyTransaction) { + this.loyaltyTransaction = loyaltyTransaction; + } + + /** + * Gets loyalty data. + * + * @return the loyalty data + */ + public List getLoyaltyData() { + if (loyaltyData == null) { + loyaltyData = new ArrayList<>(); + } + return this.loyaltyData; + } + + /** + * Sets loyalty data. + * + * @param loyaltyData the loyalty data + */ + public void setLoyaltyData(List loyaltyData) { + this.loyaltyData = loyaltyData; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyResponse.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyResponse.java new file mode 100644 index 000000000..d2a85fb5f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyResponse.java @@ -0,0 +1,132 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Loyalty Response message. */ +@JsonPropertyOrder({"Response", "SaleData", "POIData", "LoyaltyResult", "PaymentReceipt"}) +public class LoyaltyResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("SaleData") + @Schema(description = "Data related to the Sale System.") + protected SaleData saleData; + + @JsonProperty("POIData") + @Schema(description = "Data related to the POI System.") + protected POIData poiData; + + @JsonProperty("LoyaltyResult") + @Schema( + description = + "Data related to the result of a processed loyalty transaction. --Rule: if loyalty account identified") + protected List loyaltyResult; + + @JsonProperty("PaymentReceipt") + @Schema( + description = + "Customer or Merchant payment receipt. --Rule: If Basic profile implementation with no printer on the POI.") + protected List paymentReceipt; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets sale data. + * + * @return the sale data + */ + public SaleData getSaleData() { + return saleData; + } + + /** + * Sets sale data. + * + * @param saleData the sale data + */ + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + } + + /** + * Gets poi data. + * + * @return the poi data + */ + public POIData getPOIData() { + return poiData; + } + + /** + * Sets poi data. + * + * @param poiData the poi data + */ + public void setPOIData(POIData poiData) { + this.poiData = poiData; + } + + /** + * Gets loyalty result. + * + * @return the loyalty result + */ + public List getLoyaltyResult() { + if (loyaltyResult == null) { + loyaltyResult = new ArrayList<>(); + } + return this.loyaltyResult; + } + + /** + * Sets loyalty result. + * + * @param loyaltyResult the loyalty result + */ + public void setLoyaltyResult(List loyaltyResult) { + this.loyaltyResult = loyaltyResult; + } + + /** + * Gets payment receipt. + * + * @return the payment receipt + */ + public List getPaymentReceipt() { + if (paymentReceipt == null) { + paymentReceipt = new ArrayList<>(); + } + return this.paymentReceipt; + } + + /** + * Sets payment receipt. + * + * @param paymentReceipt the payment receipt + */ + public void setPaymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyResult.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyResult.java new file mode 100644 index 000000000..0a1953683 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyResult.java @@ -0,0 +1,131 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +/** Data related to the result of a processed loyalty transaction. */ +@JsonPropertyOrder({ + "LoyaltyAccount", + "LoyaltyAmount", + "LoyaltyAcquirerData", + "Rebates", + "CurrentBalance" +}) +public class LoyaltyResult { + + @JsonProperty("LoyaltyAccount") + @Schema(description = "Data related to a loyalty account processed in the transaction.") + protected LoyaltyAccount loyaltyAccount; + + @JsonProperty("LoyaltyAmount") + @Schema(description = "Amount of a loyalty account. --Rule: If awarded amount") + protected LoyaltyAmount loyaltyAmount; + + @JsonProperty("LoyaltyAcquirerData") + @Schema( + description = + "Data related to the loyalty Acquirer during a loyalty transaction. --Rule: if content not empty") + protected LoyaltyAcquirerData loyaltyAcquirerData; + + @JsonProperty("Rebates") + @Schema(description = "Rebate form to an award; --Rule: if rebates awarded") + protected Rebates rebates; + + @JsonProperty("CurrentBalance") + @Schema( + description = + "Balance of an account. --Rule: if known (provided by the card or an external host)") + protected BigDecimal currentBalance; + + /** + * Gets loyalty account. + * + * @return the loyalty account + */ + public LoyaltyAccount getLoyaltyAccount() { + return loyaltyAccount; + } + + /** + * Sets loyalty account. + * + * @param loyaltyAccount the loyalty account + */ + public void setLoyaltyAccount(LoyaltyAccount loyaltyAccount) { + this.loyaltyAccount = loyaltyAccount; + } + + /** + * Gets loyalty amount. + * + * @return the loyalty amount + */ + public LoyaltyAmount getLoyaltyAmount() { + return loyaltyAmount; + } + + /** + * Sets loyalty amount. + * + * @param loyaltyAmount the loyalty amount + */ + public void setLoyaltyAmount(LoyaltyAmount loyaltyAmount) { + this.loyaltyAmount = loyaltyAmount; + } + + /** + * Gets loyalty acquirer data. + * + * @return the loyalty acquirer data + */ + public LoyaltyAcquirerData getLoyaltyAcquirerData() { + return loyaltyAcquirerData; + } + + /** + * Sets loyalty acquirer data. + * + * @param loyaltyAcquirerData the loyalty acquirer data + */ + public void setLoyaltyAcquirerData(LoyaltyAcquirerData loyaltyAcquirerData) { + this.loyaltyAcquirerData = loyaltyAcquirerData; + } + + /** + * Gets rebates. + * + * @return the rebates + */ + public Rebates getRebates() { + return rebates; + } + + /** + * Sets rebates. + * + * @param rebates the rebates + */ + public void setRebates(Rebates rebates) { + this.rebates = rebates; + } + + /** + * Gets current balance. + * + * @return the current balance + */ + public BigDecimal getCurrentBalance() { + return currentBalance; + } + + /** + * Sets current balance. + * + * @param currentBalance the current balance + */ + public void setCurrentBalance(BigDecimal currentBalance) { + this.currentBalance = currentBalance; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyTotals.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyTotals.java new file mode 100644 index 000000000..cc0844732 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyTotals.java @@ -0,0 +1,80 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** Totals of the loyalty transaction during the reconciliation period. */ +@JsonPropertyOrder({"TransactionType", "TransactionCount", "TransactionAmount"}) +public class LoyaltyTotals { + + @JsonProperty("TransactionType") + @Schema( + description = + "Type of transaction for which totals are grouped. --Rule: Award, ReverseAward, Redemption, ReverseRedemption, Rebate, ReverseRebate") + protected TransactionType transactionType; + + @JsonProperty("TransactionCount") + @Schema(description = "Number of processed transaction during the period.") + protected BigInteger transactionCount; + + @JsonProperty("TransactionAmount") + @Schema(description = "Sum of amount of processed transaction during the period.") + protected BigDecimal transactionAmount; + + /** + * Gets transaction type. + * + * @return the transaction type + */ + public TransactionType getTransactionType() { + return transactionType; + } + + /** + * Sets transaction type. + * + * @param transactionType the transaction type + */ + public void setTransactionType(TransactionType transactionType) { + this.transactionType = transactionType; + } + + /** + * Gets transaction count. + * + * @return the transaction count + */ + public BigInteger getTransactionCount() { + return transactionCount; + } + + /** + * Sets transaction count. + * + * @param transactionCount the transaction count + */ + public void setTransactionCount(BigInteger transactionCount) { + this.transactionCount = transactionCount; + } + + /** + * Gets transaction amount. + * + * @return the transaction amount + */ + public BigDecimal getTransactionAmount() { + return transactionAmount; + } + + /** + * Sets transaction amount. + * + * @param transactionAmount the transaction amount + */ + public void setTransactionAmount(BigDecimal transactionAmount) { + this.transactionAmount = transactionAmount; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyTransaction.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyTransaction.java new file mode 100644 index 000000000..cb19e0903 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyTransaction.java @@ -0,0 +1,159 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** Data related to the loyalty transaction. */ +@JsonPropertyOrder({ + "OriginalPOITransaction", + "TransactionConditions", + "SaleItem", + "LoyaltyTransactionType", + "Currency", + "TotalAmount" +}) +public class LoyaltyTransaction { + + @JsonProperty("OriginalPOITransaction") + @Schema( + description = + "Identification of a previous POI transaction. --Rule: if LoyaltyTransactionType is \"AwardRefund\", \"RebateRefund\" or \"RedemptionRefund\"") + protected OriginalPOITransaction originalPOITransaction; + + @JsonProperty("TransactionConditions") + @Schema( + description = + "Conditions on which the transaction must be processed. --Rule: If one data element is present") + protected TransactionConditions transactionConditions; + + @JsonProperty("SaleItem") + @Schema(description = "Sale items of a transaction.") + protected List saleItem; + + @JsonProperty("LoyaltyTransactionType") + @Schema(description = "Type of loyalty transaction.") + protected LoyaltyTransactionType loyaltyTransactionType; + + @JsonProperty("Currency") + @Schema(description = "Currency of a monetary amount.") + protected String currency; + + @JsonProperty("TotalAmount") + @Schema(description = "Amount of a transaction.") + protected BigDecimal totalAmount; + + /** + * Gets original poi transaction. + * + * @return the original poi transaction + */ + public OriginalPOITransaction getOriginalPOITransaction() { + return originalPOITransaction; + } + + /** + * Sets original poi transaction. + * + * @param originalPOITransaction the original poi transaction + */ + public void setOriginalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + } + + /** + * Gets transaction conditions. + * + * @return the transaction conditions + */ + public TransactionConditions getTransactionConditions() { + return transactionConditions; + } + + /** + * Sets transaction conditions. + * + * @param transactionConditions the transaction conditions + */ + public void setTransactionConditions(TransactionConditions transactionConditions) { + this.transactionConditions = transactionConditions; + } + + /** + * Gets sale item. + * + * @return the sale item + */ + public List getSaleItem() { + if (saleItem == null) { + saleItem = new ArrayList<>(); + } + return this.saleItem; + } + + /** + * Sets sale item. + * + * @param saleItem the sale item + */ + public void setSaleItem(List saleItem) { + this.saleItem = saleItem; + } + + /** + * Gets loyalty transaction type. + * + * @return the loyalty transaction type + */ + public LoyaltyTransactionType getLoyaltyTransactionType() { + return loyaltyTransactionType; + } + + /** + * Sets loyalty transaction type. + * + * @param loyaltyTransactionType the loyalty transaction type + */ + public void setLoyaltyTransactionType(LoyaltyTransactionType loyaltyTransactionType) { + this.loyaltyTransactionType = loyaltyTransactionType; + } + + /** + * Gets currency. + * + * @return the currency + */ + public String getCurrency() { + return currency; + } + + /** + * Sets currency. + * + * @param currency the currency + */ + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * Gets total amount. + * + * @return the total amount + */ + public BigDecimal getTotalAmount() { + return totalAmount; + } + + /** + * Sets total amount. + * + * @param totalAmount the total amount + */ + public void setTotalAmount(BigDecimal totalAmount) { + this.totalAmount = totalAmount; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyTransactionType.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyTransactionType.java new file mode 100644 index 000000000..fc2b1e120 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyTransactionType.java @@ -0,0 +1,66 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of loyalty transaction. */ +public enum LoyaltyTransactionType { + + /** + * Direct or payment related award on a loyalty account. Award alone, award associated to a + * payment (may be with an additional award alone), award because of a + */ + @Schema( + description = + "Direct or payment related award on a loyalty account. Award alone, award associated to a payment (may be with an additional award alone), award because of a") + AWARD("Award"), + + /** Rebate on a total amount, sale item amount, or sale items */ + @Schema(description = "Rebate on a total amount, sale item amount, or sale items") + REBATE("Rebate"), + + /** Redemption on a loyalty account. */ + @Schema(description = "Redemption on a loyalty account.") + REDEMPTION("Redemption"), + + /** Refund of a loyalty award transaction. */ + @Schema(description = "Refund of a loyalty award transaction.") + AWARD_REFUND("AwardRefund"), + + /** Refund of a loyalty rebate transaction. */ + @Schema(description = "Refund of a loyalty rebate transaction.") + REBATE_REFUND("RebateRefund"), + + /** Refund of a loyalty redemption transaction. */ + @Schema(description = "Refund of a loyalty redemption transaction.") + REDEMPTION_REFUND("RedemptionRefund"); + + private final String value; + + LoyaltyTransactionType(String v) { + value = v; + } + + /** + * Returns the string representation of the LoyaltyTransactionType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a LoyaltyTransactionType from a string value. + * + * @param v the string value + * @return the corresponding LoyaltyTransactionType + */ + @JsonCreator + public static LoyaltyTransactionType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/LoyaltyUnitType.java b/src/main/java/com/adyen/model/clouddevice/LoyaltyUnitType.java new file mode 100644 index 000000000..13ca2e9a7 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/LoyaltyUnitType.java @@ -0,0 +1,45 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of loyalty unit. */ +public enum LoyaltyUnitType { + + /** The amount is expressed in point. */ + @Schema(description = "The amount is expressed in point.") + POINT("Point"), + + /** The amount is expressed in a monetary value in a currency. */ + @Schema(description = "The amount is expressed in a monetary value in a currency.") + MONETARY("Monetary"); + + private final String value; + + LoyaltyUnitType(String v) { + value = v; + } + + /** + * Returns the string representation of the LoyaltyUnitType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a LoyaltyUnitType from a string value. + * + * @param v the string value + * @return the corresponding LoyaltyUnitType + */ + @JsonCreator + public static LoyaltyUnitType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/MenuEntry.java b/src/main/java/com/adyen/model/clouddevice/MenuEntry.java new file mode 100644 index 000000000..ba7309241 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/MenuEntry.java @@ -0,0 +1,168 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** An entryof the menu to present to the Cashier. */ +@JsonPropertyOrder({ + "PredefinedContent", + "OutputText", + "OutputXHTML", + "MenuEntryTag", + "OutputFormat", + "DefaultSelectedFlag" +}) +public class MenuEntry { + + @JsonProperty("PredefinedContent") + @Schema( + description = + "Reference of a predefined message to display or print. --Rule: Mandatory, if OutputFormat is MessageRef, not allowed otherwise.") + protected PredefinedContent predefinedContent; + + @JsonProperty("OutputText") + @Schema( + description = + "Content of text message to display or print. --Rule: Mandatory, if OutputFormat is Text, not allowed otherwise. One instance of OutputText per shared format") + protected List outputText; + + @JsonProperty("OutputXHTML") + @Schema( + description = + "XHTML document body containing the message to display or print. --Rule: Mandatory, if OutputFormat is XHTML, not allowed otherwise.") + protected byte[] outputXHTML; + + @JsonProperty("MenuEntryTag") + @Schema(description = "Characteristics related to the selection of a menu entry") + protected MenuEntryTagType menuEntryTag; + + @JsonProperty("OutputFormat") + @Schema(description = "Format of the content to display or print --Rule: MessageRef, Text, XHTML") + protected OutputFormatType outputFormat; + + @JsonProperty("DefaultSelectedFlag") + @Schema(description = "Selection of a menu entry to be displayed.") + protected Boolean defaultSelectedFlag; + + /** + * Gets predefined content. + * + * @return the predefined content + */ + public PredefinedContent getPredefinedContent() { + return predefinedContent; + } + + /** + * Sets predefined content. + * + * @param predefinedContent the predefined content + */ + public void setPredefinedContent(PredefinedContent predefinedContent) { + this.predefinedContent = predefinedContent; + } + + /** + * Gets output text. + * + * @return the output text + */ + public List getOutputText() { + if (outputText == null) { + outputText = new ArrayList<>(); + } + return this.outputText; + } + + /** + * Sets output text. + * + * @param outputText the output text + */ + public void setOutputText(List outputText) { + this.outputText = outputText; + } + + /** + * Get output xhtml. + * + * @return the byte [ ] + */ + public byte[] getOutputXHTML() { + return outputXHTML; + } + + /** + * Sets output xhtml. + * + * @param outputXHTML the output xhtml + */ + public void setOutputXHTML(byte[] outputXHTML) { + this.outputXHTML = outputXHTML; + } + + /** + * Gets menu entry tag. + * + * @return the menu entry tag + */ + public MenuEntryTagType getMenuEntryTag() { + if (menuEntryTag == null) { + return MenuEntryTagType.SELECTABLE; + } else { + return menuEntryTag; + } + } + + /** + * Sets menu entry tag. + * + * @param menuEntryTag the menu entry tag + */ + public void setMenuEntryTag(MenuEntryTagType menuEntryTag) { + this.menuEntryTag = menuEntryTag; + } + + /** + * Gets output format. + * + * @return the output format + */ + public OutputFormatType getOutputFormat() { + return outputFormat; + } + + /** + * Sets output format. + * + * @param outputFormat the output format + */ + public void setOutputFormat(OutputFormatType outputFormat) { + this.outputFormat = outputFormat; + } + + /** + * Is default selected flag boolean. + * + * @return the boolean + */ + public boolean isDefaultSelectedFlag() { + if (defaultSelectedFlag == null) { + return false; + } else { + return defaultSelectedFlag; + } + } + + /** + * Sets default selected flag. + * + * @param defaultSelectedFlag the default selected flag + */ + public void setDefaultSelectedFlag(Boolean defaultSelectedFlag) { + this.defaultSelectedFlag = defaultSelectedFlag; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/MenuEntryTagType.java b/src/main/java/com/adyen/model/clouddevice/MenuEntryTagType.java new file mode 100644 index 000000000..360b1ef76 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/MenuEntryTagType.java @@ -0,0 +1,58 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of menu entry tag. */ +public enum MenuEntryTagType { + + /** The Cashier may select this entryof the menu */ + @Schema(description = "The Cashier may select this entryof the menu") + SELECTABLE("Selectable"), + + /** The Cashier cannot select this entryof the menu */ + @Schema(description = "The Cashier cannot select this entryof the menu") + NON_SELECTABLE("NonSelectable"), + + /** + * The selection of this entry produces the display of a sub-menu (by the sending of another Input + * Request messageType containing the entries of this sub-menu). + */ + @Schema( + description = + "The selection of this entry produces the display of a sub-menu (by the sending of another Input Request message containing the entries of this sub-menu).") + SUB_MENU("SubMenu"), + + /** The menu entry is a submenu, but cannot be selected. */ + @Schema(description = "The menu entry is a submenu, but cannot be selected.") + NON_SELECTABLE_SUB_MENU("NonSelectableSubMenu"); + + private final String value; + + MenuEntryTagType(String v) { + value = v; + } + + /** + * Returns the string representation of the MenuEntryTagType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a MenuEntryTagType from a string value. + * + * @param v the string value + * @return the corresponding MenuEntryTagType + */ + @JsonCreator + public static MenuEntryTagType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/MessageCategoryType.java b/src/main/java/com/adyen/model/clouddevice/MessageCategoryType.java new file mode 100644 index 000000000..5e5234458 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/MessageCategoryType.java @@ -0,0 +1,144 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of message category. */ +public enum MessageCategoryType { + + /** Abort messageType request */ + @Schema(description = "Abort message request") + ABORT("Abort"), + + /** Admin request or response */ + @Schema(description = "Admin request or response") + ADMIN("Admin"), + + /** Balance Inquiry request or response */ + @Schema(description = "Balance Inquiry request or response") + BALANCE_INQUIRY("BalanceInquiry"), + + /** Batch request or response */ + @Schema(description = "Batch request or response") + BATCH("Batch"), + + /** Card Acquisition request or response */ + @Schema(description = "Card Acquisition request or response") + CARD_ACQUISITION("CardAcquisition"), + + /** Card Reader APDU request or response */ + @Schema(description = "Card Reader APDU request or response") + CARD_READER_APDU("CardReaderAPDU"), + + /** Card Reader Init request or response */ + @Schema(description = "Card Reader Init request or response") + CARD_READER_INIT("CardReaderInit"), + + /** Card Reader Power-Off request or response */ + @Schema(description = "Card Reader Power-Off request or response") + CARD_READER_POWER_OFF("CardReaderPowerOff"), + + /** Diagnosis request or response */ + @Schema(description = "Diagnosis request or response") + DIAGNOSIS("Diagnosis"), + + /** Display messageType request or response */ + @Schema(description = "Display message request or response") + DISPLAY("Display"), + + /** Enable Service messageType request or response */ + @Schema(description = "Enable Service message request or response") + ENABLE_SERVICE("EnableService"), + + /** Event Notification messageType */ + @Schema(description = "Event Notification message") + EVENT("Event"), + + /** GetTotals messageType request or response */ + @Schema(description = "GetTotals message request or response") + GET_TOTALS("GetTotals"), + + /** Input messageType request or response */ + @Schema(description = "Input message request or response") + INPUT("Input"), + + /** Input Update messageType */ + @Schema(description = "Input Update message") + INPUT_UPDATE("InputUpdate"), + + /** Login messageType request or response */ + @Schema(description = "Login message request or response") + LOGIN("Login"), + + /** Logout messageType request or response */ + @Schema(description = "Logout message request or response") + LOGOUT("Logout"), + + /** Loyalty messageType request or response */ + @Schema(description = "Loyalty message request or response") + LOYALTY("Loyalty"), + + /** Payment messageType request or response */ + @Schema(description = "Payment message request or response") + PAYMENT("Payment"), + + /** PIN messageType request or response */ + PIN("PIN"), + + /** Print messageType request or response */ + @Schema(description = "Print message request or response") + PRINT("Print"), + + /** Reconciliation messageType request or response */ + @Schema(description = "Reconciliation message request or response") + RECONCILIATION("Reconciliation"), + + /** Reversal messageType request or response */ + @Schema(description = "Reversal message request or response") + REVERSAL("Reversal"), + + /** Sound messageType request or response */ + @Schema(description = "Sound message request or response") + SOUND("Sound"), + + /** Stored Value messageType request or response */ + @Schema(description = "Stored Value message request or response") + STORED_VALUE("StoredValue"), + + /** TransactionStatus messageType request or response */ + @Schema(description = "TransactionStatus message request or response") + TRANSACTION_STATUS("TransactionStatus"), + + /** Transmit messageType request or response */ + @Schema(description = "Transmit message request or response") + TRANSMIT("Transmit"); + + private final String value; + + MessageCategoryType(String v) { + value = v; + } + + /** + * Returns the string representation of the MessageCategoryType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a MessageCategoryType from a string value. + * + * @param v the string value + * @return the corresponding MessageCategoryType + */ + @JsonCreator + public static MessageCategoryType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/MessageClassType.java b/src/main/java/com/adyen/model/clouddevice/MessageClassType.java new file mode 100644 index 000000000..6be4bcc6e --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/MessageClassType.java @@ -0,0 +1,58 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of message class. */ +public enum MessageClassType { + + /** + * A transaction messageType pair initiated by the Sale System, and requested to the POI System. + */ + @Schema( + description = + "A transaction message pair initiated by the Sale System, and requested to the POI System.") + SERVICE("Service"), + + /** + * A device messageType pair either: Inside a Service request and response. This device + * messageType pair is initiated by the POI System, and sent to Sale System, + */ + @Schema( + description = + "A device message pair either: Inside a Service request and response. This device message pair is initiated by the POI System, and sent to Sale System,") + DEVICE("Device"), + + /** An unsolicited event notification by the POI System to the Sale System. */ + @Schema(description = "An unsolicited event notification by the POI System to the Sale System.") + EVENT("Event"); + + private final String value; + + MessageClassType(String v) { + value = v; + } + + /** + * Returns the string representation of the MessageClassType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a MessageClassType from a string value. + * + * @param v the string value + * @return the corresponding MessageClassType + */ + @JsonCreator + public static MessageClassType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/MessageHeader.java b/src/main/java/com/adyen/model/clouddevice/MessageHeader.java new file mode 100644 index 000000000..ac5d84dad --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/MessageHeader.java @@ -0,0 +1,229 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Message header of the Sale to POI protocol message. */ +@JsonPropertyOrder({ + "ProtocolVersion", + "MessageClass", + "MessageCategory", + "MessageType", + "ServiceID", + "DeviceID", + "SaleID", + "POIID" +}) +public class MessageHeader { + + @JsonProperty("ProtocolVersion") + @Schema(description = ">--Rule:If MessageCategory is Login or Diagnosis") + protected String protocolVersion; + + @JsonProperty("MessageClass") + @Schema(description = "Class of the message") + protected MessageClassType messageClass; + + @JsonProperty("MessageCategory") + @Schema(description = "Category of message.") + protected MessageCategoryType messageCategory; + + @JsonProperty("MessageType") + @Schema(description = "Type of message of the Sale to POI protocol") + protected MessageType messageType; + + @JsonProperty("ServiceID") + @Schema( + description = + "Identification of a message pair, which processes a transaction --Rule: If \"Service\" or \"Event\" MessageClass message. If \"Device\" MessageClass, and request from POI or response from Sale.", + minLength = 1, + maxLength = 10) + protected String serviceID; + + @JsonProperty("DeviceID") + @Schema( + description = "Identification of a device message pair --Rule: If \"Device\" MessageClass") + protected String deviceID; + + @JsonProperty("SaleID") + @Schema( + description = + "Identification of a Sale System or a Sale Terminal for the Sale to POI protocol") + protected String saleID; + + @JsonProperty("POIID") + @Schema( + description = "Identification of a POI System or a POI Terminal for the Sale to POI protocol") + protected String poiid; + + /** + * Gets protocol version. + * + * @return the protocol version + */ + public String getProtocolVersion() { + return protocolVersion; + } + + /** + * Sets protocol version. + * + * @param protocolVersion the protocol version + */ + public void setProtocolVersion(String protocolVersion) { + this.protocolVersion = protocolVersion; + } + + /** + * Gets message class. + * + * @return the message class + */ + public MessageClassType getMessageClass() { + return messageClass; + } + + /** + * Sets message class. + * + * @param messageClass the message class + */ + public void setMessageClass(MessageClassType messageClass) { + this.messageClass = messageClass; + } + + /** + * Gets message category. + * + * @return the message category + */ + public MessageCategoryType getMessageCategory() { + return messageCategory; + } + + /** + * Sets message category. + * + * @param messageCategory the message category + */ + public void setMessageCategory(MessageCategoryType messageCategory) { + this.messageCategory = messageCategory; + } + + /** + * Gets message type. + * + * @return the message type + */ + public MessageType getMessageType() { + return messageType; + } + + /** + * Sets message type. + * + * @param messageType the message type + */ + public void setMessageType(MessageType messageType) { + this.messageType = messageType; + } + + /** + * Gets service id. + * + * @return the service id + */ + public String getServiceID() { + return serviceID; + } + + /** + * Sets service id. + * + * @param serviceID the service id + */ + public void setServiceID(String serviceID) { + this.serviceID = serviceID; + } + + /** + * Gets device id. + * + * @return the device id + */ + public String getDeviceID() { + return deviceID; + } + + /** + * Sets device id. + * + * @param deviceID the device id + */ + public void setDeviceID(String deviceID) { + this.deviceID = deviceID; + } + + /** + * Gets sale id. + * + * @return the sale id + */ + public String getSaleID() { + return saleID; + } + + /** + * Sets sale id. + * + * @param saleID the sale id + */ + public void setSaleID(String saleID) { + this.saleID = saleID; + } + + /** + * Gets poiid. + * + * @return the poiid + */ + public String getPOIID() { + return poiid; + } + + /** + * Sets poiid. + * + * @param poiid the poiid + */ + public void setPOIID(String poiid) { + this.poiid = poiid; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessageHeader {\n"); + sb.append(" protocolVersion: ").append(toIndentedString(protocolVersion)).append("\n"); + sb.append(" messageClass: ").append(toIndentedString(messageClass)).append("\n"); + sb.append(" messageCategory: ").append(toIndentedString(messageCategory)).append("\n"); + sb.append(" messageType: ").append(toIndentedString(messageType)).append("\n"); + sb.append(" serviceID: ").append(toIndentedString(serviceID)).append("\n"); + sb.append(" deviceID: ").append(toIndentedString(deviceID)).append("\n"); + sb.append(" saleID: ").append(toIndentedString(saleID)).append("\n"); + sb.append(" poiid: ").append(toIndentedString(poiid)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/MessageReference.java b/src/main/java/com/adyen/model/clouddevice/MessageReference.java new file mode 100644 index 000000000..073e27cba --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/MessageReference.java @@ -0,0 +1,126 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Identification of a previous POI transaction. */ +@JsonPropertyOrder({"MessageCategory", "ServiceID", "DeviceID", "SaleID", "POIID"}) +public class MessageReference { + + @JsonProperty("MessageCategory") + @Schema( + description = + "Category of message. --Rule: Payment, Loyalty, StoredValue, CardAcquisition, Batch, Reconciliation, Display, Input, Print, CardReaderAPDU,") + protected MessageCategoryType messageCategory; + + @JsonProperty("ServiceID") + @Schema(description = "Identification of a message pair, which processes a transaction") + protected String serviceID; + + @JsonProperty("DeviceID") + @Schema(description = "Identification of a device message pair", minLength = 1, maxLength = 10) + protected String deviceID; + + @JsonProperty("SaleID") + @Schema( + description = + "Identification of a Sale System or a Sale Terminal for the Sale to POI protocol --Rule: default MessageHeader.SaleID") + protected String saleID; + + @JsonProperty("POIID") + @Schema( + description = + "Identification of a POI System or a POI Terminal for the Sale to POI protocol --Rule: default MessageHeader.POIID") + protected String poiid; + + /** + * Gets message category. + * + * @return the message category + */ + public MessageCategoryType getMessageCategory() { + return messageCategory; + } + + /** + * Sets message category. + * + * @param messageCategory the message category + */ + public void setMessageCategory(MessageCategoryType messageCategory) { + this.messageCategory = messageCategory; + } + + /** + * Gets service id. + * + * @return the service id + */ + public String getServiceID() { + return serviceID; + } + + /** + * Sets service id. + * + * @param serviceID the service id + */ + public void setServiceID(String serviceID) { + this.serviceID = serviceID; + } + + /** + * Gets device id. + * + * @return the device id + */ + public String getDeviceID() { + return deviceID; + } + + /** + * Sets device id. + * + * @param deviceID the device id + */ + public void setDeviceID(String deviceID) { + this.deviceID = deviceID; + } + + /** + * Gets sale id. + * + * @return the sale id + */ + public String getSaleID() { + return saleID; + } + + /** + * Sets sale id. + * + * @param saleID the sale id + */ + public void setSaleID(String saleID) { + this.saleID = saleID; + } + + /** + * Gets poiid. + * + * @return the poiid + */ + public String getPOIID() { + return poiid; + } + + /** + * Sets poiid. + * + * @param poiid the poiid + */ + public void setPOIID(String poiid) { + this.poiid = poiid; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/MessageType.java b/src/main/java/com/adyen/model/clouddevice/MessageType.java new file mode 100644 index 000000000..8eed26fc1 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/MessageType.java @@ -0,0 +1,54 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of message. */ +public enum MessageType { + + /** + * Request messageType that requires a response, except if the request messageType mentions + * explicitely that a response messageType is not expected. + */ + @Schema( + description = + "Request message that requires a response, except if the request message mentions explicitely that a response message is not expected.") + REQUEST("Request"), + + /** Response messageType, sent to answer to a request messageType. */ + @Schema(description = "Response message, sent to answer to a request message.") + RESPONSE("Response"), + + /** Unsollicited notification messageType that does not require an answer. */ + @Schema(description = "Unsollicited notification message that does not require an answer.") + NOTIFICATION("Notification"); + + private final String value; + + MessageType(String v) { + value = v; + } + + /** + * Returns the string representation of the MessageType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a MessageType from a string value. + * + * @param v the string value + * @return the corresponding MessageType + */ + @JsonCreator + public static MessageType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/MobileData.java b/src/main/java/com/adyen/model/clouddevice/MobileData.java new file mode 100644 index 000000000..558f03abb --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/MobileData.java @@ -0,0 +1,164 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Information related to the mobile for the payment transaction. */ +@JsonPropertyOrder({ + "MobileCountryCode", + "Geolocation", + "ProtectedMobileData", + "SensitiveMobileData", + "MobileNetworkCode", + "MaskedMSISDN" +}) +public class MobileData { + + @JsonProperty("MobileCountryCode") + @Schema( + description = "Identifies the country of a mobile phone operator. --Rule: If data available", + minLength = 3, + maxLength = 3) + protected String mobileCountryCode; + + @JsonProperty("Geolocation") + @Schema( + description = + "Geographic location specified by geographic or UTM coordinates. --Rule: If data available") + protected Geolocation geolocation; + + @JsonProperty("ProtectedMobileData") + @Schema( + description = + "Sensitive information related to the mobile phone, protected by CMS. --Rule: SensitiveMobileData") + protected ContentInformation protectedMobileData; + + @JsonProperty("SensitiveMobileData") + @Schema( + description = + "Sensitive information related to the mobile phone. --Rule: If unprotected mobile data") + protected SensitiveMobileData sensitiveMobileData; + + @JsonProperty("MobileNetworkCode") + @Schema( + description = + "Identifies the mobile phone operator inside a country. --Rule: If data available", + minLength = 2, + maxLength = 3) + protected String mobileNetworkCode; + + @JsonProperty("MaskedMSISDN") + @Schema( + description = + "Masked Mobile Subscriber Integrated Service Digital Network. --Rule: If data available") + protected String maskedMSISDN; + + /** + * Gets mobile country code. + * + * @return the mobile country code + */ + public String getMobileCountryCode() { + return mobileCountryCode; + } + + /** + * Sets mobile country code. + * + * @param mobileCountryCode the mobile country code + */ + public void setMobileCountryCode(String mobileCountryCode) { + this.mobileCountryCode = mobileCountryCode; + } + + /** + * Gets geolocation. + * + * @return the geolocation + */ + public Geolocation getGeolocation() { + return geolocation; + } + + /** + * Sets geolocation. + * + * @param geolocation the geolocation + */ + public void setGeolocation(Geolocation geolocation) { + this.geolocation = geolocation; + } + + /** + * Gets protected mobile data. + * + * @return the protected mobile data + */ + public ContentInformation getProtectedMobileData() { + return protectedMobileData; + } + + /** + * Sets protected mobile data. + * + * @param protectedMobileData the protected mobile data + */ + public void setProtectedMobileData(ContentInformation protectedMobileData) { + this.protectedMobileData = protectedMobileData; + } + + /** + * Gets sensitive mobile data. + * + * @return the sensitive mobile data + */ + public SensitiveMobileData getSensitiveMobileData() { + return sensitiveMobileData; + } + + /** + * Sets sensitive mobile data. + * + * @param sensitiveMobileData the sensitive mobile data + */ + public void setSensitiveMobileData(SensitiveMobileData sensitiveMobileData) { + this.sensitiveMobileData = sensitiveMobileData; + } + + /** + * Gets mobile network code. + * + * @return the mobile network code + */ + public String getMobileNetworkCode() { + return mobileNetworkCode; + } + + /** + * Sets mobile network code. + * + * @param mobileNetworkCode the mobile network code + */ + public void setMobileNetworkCode(String mobileNetworkCode) { + this.mobileNetworkCode = mobileNetworkCode; + } + + /** + * Gets masked msisdn. + * + * @return the masked msisdn + */ + public String getMaskedMSISDN() { + return maskedMSISDN; + } + + /** + * Sets masked msisdn. + * + * @param maskedMSISDN the masked msisdn + */ + public void setMaskedMSISDN(String maskedMSISDN) { + this.maskedMSISDN = maskedMSISDN; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/NamedKeyEncryptedData.java b/src/main/java/com/adyen/model/clouddevice/NamedKeyEncryptedData.java new file mode 100644 index 000000000..6f77bd143 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/NamedKeyEncryptedData.java @@ -0,0 +1,79 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Cryptographic Message Syntax (CMS) data structure containing encrypted data and integrated + * optional data filed keyName. + */ +@JsonPropertyOrder({"KeyName", "EncryptedContent", "Version"}) +public class NamedKeyEncryptedData { + + @JsonProperty("KeyName") + protected String keyName; + + @JsonProperty("EncryptedContent") + protected EncryptedContent encryptedContent; + + @JsonProperty("Version") + protected VersionType version; + + /** + * Gets key name. + * + * @return the key name + */ + public String getKeyName() { + return keyName; + } + + /** + * Sets key name. + * + * @param keyName the key name + */ + public void setKeyName(String keyName) { + this.keyName = keyName; + } + + /** + * Gets encrypted content. + * + * @return the encrypted content + */ + public EncryptedContent getEncryptedContent() { + return encryptedContent; + } + + /** + * Sets encrypted content. + * + * @param encryptedContent the encrypted content + */ + public void setEncryptedContent(EncryptedContent encryptedContent) { + this.encryptedContent = encryptedContent; + } + + /** + * Gets version. + * + * @return the version + */ + public VersionType getVersion() { + if (version == null) { + return VersionType.V_0; + } else { + return version; + } + } + + /** + * Sets version. + * + * @param version the version + */ + public void setVersion(VersionType version) { + this.version = version; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/OriginalPOITransaction.java b/src/main/java/com/adyen/model/clouddevice/OriginalPOITransaction.java new file mode 100644 index 000000000..f73903d4d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/OriginalPOITransaction.java @@ -0,0 +1,210 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Identification of a previous POI transaction. */ +@JsonPropertyOrder({ + "POITransactionID", + "ApprovalCode", + "HostTransactionID", + "SaleID", + "POIID", + "ReuseCardDataFlag", + "CustomerLanguage", + "AcquirerID" +}) +public class OriginalPOITransaction { + + @JsonProperty("POITransactionID") + @Schema( + description = + "Unique identification of a POI transaction for a POI --Rule: Absent if SaleReferenceID is sufficient to identify the transaction, or for some reversal cases.") + protected TransactionIdentification poiTransactionID; + + @JsonProperty("ApprovalCode") + @Schema( + description = "Code assigned to a transaction approval by the Acquirer. --Rule: If referral") + protected String approvalCode; + + @JsonProperty("HostTransactionID") + @Schema( + description = + "Identification of the transaction by the host in charge of the stored value transaction --Rule: If POITransactionID not present") + protected TransactionIdentification hostTransactionID; + + @JsonProperty("SaleID") + @Schema( + description = + "Identification of a Sale System or a Sale Terminal for the Sale to POI protocol") + protected String saleID; + + @JsonProperty("POIID") + @Schema( + description = + "Identification of a POI System or a POI Terminal for the Sale to POI protocol --Rule: If original transaction is coming from another POI") + protected String poiid; + + @JsonProperty("ReuseCardDataFlag") + @Schema(description = "Indicate if the card data has to be got from a previous transaction.") + protected Boolean reuseCardDataFlag; + + @JsonProperty("CustomerLanguage") + @Schema(description = "Language of the Customer --Rule: Optional for Reversal, otherwise absent.") + protected String customerLanguage; + + @JsonProperty("AcquirerID") + @Schema( + description = + "Identification of the Acquirer --Rule: Optional for Reversal, otherwise absent.") + protected String acquirerID; + + /** + * Gets poi transaction id. + * + * @return the poi transaction id + */ + public TransactionIdentification getPOITransactionID() { + return poiTransactionID; + } + + /** + * Sets poi transaction id. + * + * @param poiTransactionID the poi transaction id + */ + public void setPOITransactionID(TransactionIdentification poiTransactionID) { + this.poiTransactionID = poiTransactionID; + } + + /** + * Gets approval code. + * + * @return the approval code + */ + public String getApprovalCode() { + return approvalCode; + } + + /** + * Sets approval code. + * + * @param approvalCode the approval code + */ + public void setApprovalCode(String approvalCode) { + this.approvalCode = approvalCode; + } + + /** + * Gets host transaction id. + * + * @return the host transaction id + */ + public TransactionIdentification getHostTransactionID() { + return hostTransactionID; + } + + /** + * Sets host transaction id. + * + * @param hostTransactionID the host transaction id + */ + public void setHostTransactionID(TransactionIdentification hostTransactionID) { + this.hostTransactionID = hostTransactionID; + } + + /** + * Gets sale id. + * + * @return the sale id + */ + public String getSaleID() { + return saleID; + } + + /** + * Sets sale id. + * + * @param saleID the sale id + */ + public void setSaleID(String saleID) { + this.saleID = saleID; + } + + /** + * Gets poiid. + * + * @return the poiid + */ + public String getPOIID() { + return poiid; + } + + /** + * Sets poiid. + * + * @param poiid the poiid + */ + public void setPOIID(String poiid) { + this.poiid = poiid; + } + + /** + * Is reuse card data flag boolean. + * + * @return the boolean + */ + public boolean isReuseCardDataFlag() { + if (reuseCardDataFlag == null) { + return true; + } else { + return reuseCardDataFlag; + } + } + + /** + * Sets reuse card data flag. + * + * @param reuseCardDataFlag the reuse card data flag + */ + public void setReuseCardDataFlag(Boolean reuseCardDataFlag) { + this.reuseCardDataFlag = reuseCardDataFlag; + } + + /** + * Gets customer language. + * + * @return the customer language + */ + public String getCustomerLanguage() { + return customerLanguage; + } + + /** + * Sets customer language. + * + * @param customerLanguage the customer language + */ + public void setCustomerLanguage(String customerLanguage) { + this.customerLanguage = customerLanguage; + } + + /** + * Gets acquirer id. + * + * @return the acquirer id + */ + public String getAcquirerID() { + return acquirerID; + } + + /** + * Sets acquirer id. + * + * @param acquirerID the acquirer id + */ + public void setAcquirerID(String acquirerID) { + this.acquirerID = acquirerID; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/OutputBarcode.java b/src/main/java/com/adyen/model/clouddevice/OutputBarcode.java new file mode 100644 index 000000000..58a5537a6 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/OutputBarcode.java @@ -0,0 +1,58 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** BarCode content to display or print. */ +@JsonPropertyOrder({"BarcodeValue", "BarcodeType"}) +public class OutputBarcode { + + @JsonProperty("BarcodeValue") + @Schema(description = "Value with a BarCode coding.") + protected String barcodeValue; + + @JsonProperty("BarcodeType") + @Schema(description = "Type of BarCode coding.") + protected BarcodeType barcodeType; + + /** + * Gets barcode value. + * + * @return the barcode value + */ + public String getBarcodeValue() { + return barcodeValue; + } + + /** + * Sets barcode value. + * + * @param barcodeValue the barcode value + */ + public void setBarcodeValue(String barcodeValue) { + this.barcodeValue = barcodeValue; + } + + /** + * Gets barcode type. + * + * @return the barcode type + */ + public BarcodeType getBarcodeType() { + if (barcodeType == null) { + return BarcodeType.EAN_13; + } else { + return barcodeType; + } + } + + /** + * Sets barcode type. + * + * @param barcodeType the barcode type + */ + public void setBarcodeType(BarcodeType barcodeType) { + this.barcodeType = barcodeType; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/OutputContent.java b/src/main/java/com/adyen/model/clouddevice/OutputContent.java new file mode 100644 index 000000000..7a8e36880 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/OutputContent.java @@ -0,0 +1,139 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content to display or print. */ +@JsonPropertyOrder({ + "PredefinedContent", + "OutputText", + "OutputXHTML", + "OutputBarcode", + "OutputFormat" +}) +public class OutputContent { + + @JsonProperty("PredefinedContent") + @Schema( + description = + "Reference of a predefined message to display or print. --Rule: Mandatory, if OutputFormat is MessageRef, not allowed otherwise.") + protected PredefinedContent predefinedContent; + + @JsonProperty("OutputText") + @Schema( + description = + "Content of text message to display or print. --Rule: Mandatory, if OutputFormat is Text, not allowed otherwise. One instance of OutputText per shared format") + protected List outputText; + + @JsonProperty("OutputXHTML") + @Schema( + description = + "XHTML document body containing the message to display or print. --Rule: Mandatory, if OutputFormat is XHTML, not allowed otherwise.") + protected byte[] outputXHTML; + + @JsonProperty("OutputBarcode") + @Schema( + description = + "BarCode content to display or print. --Rule: Mandatory, if OutputFormat is BarCode, not allowed otherwise.") + protected OutputBarcode outputBarcode; + + @JsonProperty("OutputFormat") + @Schema(description = "Format of the content to display or print") + protected OutputFormatType outputFormat; + + /** + * Gets predefined content. + * + * @return the predefined content + */ + public PredefinedContent getPredefinedContent() { + return predefinedContent; + } + + /** + * Sets predefined content. + * + * @param predefinedContent the predefined content + */ + public void setPredefinedContent(PredefinedContent predefinedContent) { + this.predefinedContent = predefinedContent; + } + + /** + * Gets output text. + * + * @return the output text + */ + public List getOutputText() { + if (outputText == null) { + outputText = new ArrayList<>(); + } + return this.outputText; + } + + /** + * Sets output text. + * + * @param outputText the output text + */ + public void setOutputText(List outputText) { + this.outputText = outputText; + } + + /** + * Get output xhtml. + * + * @return the byte [ ] + */ + public byte[] getOutputXHTML() { + return outputXHTML; + } + + /** + * Sets output xhtml. + * + * @param outputXHTML the output xhtml + */ + public void setOutputXHTML(byte[] outputXHTML) { + this.outputXHTML = outputXHTML; + } + + /** + * Gets output barcode. + * + * @return the output barcode + */ + public OutputBarcode getOutputBarcode() { + return outputBarcode; + } + + /** + * Sets output barcode. + * + * @param outputBarcode the output barcode + */ + public void setOutputBarcode(OutputBarcode outputBarcode) { + this.outputBarcode = outputBarcode; + } + + /** + * Gets output format. + * + * @return the output format + */ + public OutputFormatType getOutputFormat() { + return outputFormat; + } + + /** + * Sets output format. + * + * @param outputFormat the output format + */ + public void setOutputFormat(OutputFormatType outputFormat) { + this.outputFormat = outputFormat; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/OutputFormatType.java b/src/main/java/com/adyen/model/clouddevice/OutputFormatType.java new file mode 100644 index 000000000..0521278df --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/OutputFormatType.java @@ -0,0 +1,63 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of output format. */ +public enum OutputFormatType { + + /** + * Predefined messageType (of any format) on the POI or the Sale. The output is then a + * PredefinedContent data structure. + */ + @Schema( + description = + "Predefined message (of any format) on the POI or the Sale. The output is then a PredefinedContent data structure. ") + MESSAGE_REF("MessageRef"), + + /** + * Text messageType including control characters prefixed by an escape character. The + * DisplayOutput is then an OutputText data structure. + */ + @Schema( + description = + "Text message including control characters prefixed by an escape character. The DisplayOutput is then an OutputText data structure.") + TEXT("Text"), + + /** DisplayOutput uses the eXtensible HyperText Markup Language. */ + @Schema(description = "DisplayOutput uses the eXtensible HyperText Markup Language.") + XHTML("XHTML"), + + /** Barcode type to print The output is then a OutputBarCode data structure. */ + @Schema(description = "Barcode type to print The output is then a OutputBarCode data structure.") + BAR_CODE("BarCode"); + + private final String value; + + OutputFormatType(String v) { + value = v; + } + + /** + * Returns the string representation of the OutputFormatType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a OutputFormatType from a string value. + * + * @param v the string value + * @return the corresponding OutputFormatType + */ + @JsonCreator + public static OutputFormatType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/OutputResult.java b/src/main/java/com/adyen/model/clouddevice/OutputResult.java new file mode 100644 index 000000000..342499dd6 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/OutputResult.java @@ -0,0 +1,80 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Information related to the result the output (display, print, input). */ +@JsonPropertyOrder({"Response", "Device", "InfoQualify"}) +public class OutputResult { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("Device") + @Schema( + description = + "Logical device located on a Sale Terminal or a POI Terminal, in term of class of information to output (display, print --Rule: Copy") + protected DeviceType device; + + @JsonProperty("InfoQualify") + @Schema( + description = + "Qualification of the information to sent to an output logical device, to display or print to the Cashier or the --Rule: Copy") + protected InfoQualifyType infoQualify; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets device. + * + * @return the device + */ + public DeviceType getDevice() { + return device; + } + + /** + * Sets device. + * + * @param device the device + */ + public void setDevice(DeviceType device) { + this.device = device; + } + + /** + * Gets info qualify. + * + * @return the info qualify + */ + public InfoQualifyType getInfoQualify() { + return infoQualify; + } + + /** + * Sets info qualify. + * + * @param infoQualify the info qualify + */ + public void setInfoQualify(InfoQualifyType infoQualify) { + this.infoQualify = infoQualify; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/OutputText.java b/src/main/java/com/adyen/model/clouddevice/OutputText.java new file mode 100644 index 000000000..18635afeb --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/OutputText.java @@ -0,0 +1,286 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of text message to display or print. */ +@JsonPropertyOrder({ + "Text", + "CharacterSet", + "Font", + "StartRow", + "StartColumn", + "Color", + "CharacterWidth", + "CharacterHeight", + "CharacterStyle", + "Alignment", + "EndOfLineFlag" +}) +public class OutputText { + + @JsonProperty("Text") + @Schema(description = "Content of text message to display, print or play.") + protected String text; + + @JsonProperty("CharacterSet") + @Schema( + description = + "The character encoding of the text string. --Rule: If not present, the settings of thetarget system or device are used. ") + protected Integer characterSet; + + @JsonProperty("Font") + @Schema( + description = + "Name of the font. --Rule: If not present, the settings of the target system or deviceare used. ") + protected String font; + + @JsonProperty("StartRow") + @Schema( + description = + "Row from which the text string has to be displayed or printed. --Rule: If not present,the settings of the target system or device are used(e.g.current row position). ") + protected Integer startRow; + + @JsonProperty("StartColumn") + @Schema( + description = + "Column from which the text string has to be displayed or printed. --Rule: If notpresent, the settings of the target system or device are used(e.g.current column position). ") + protected Integer startColumn; + + @JsonProperty("Color") + @Schema( + description = + "Color of the text string to display or print. --Rule: If not present, default colourused ") + protected ColorType color; + + @JsonProperty("CharacterWidth") + @Schema( + description = + "Character width of the text string to display or print. --Rule: If not present, default width used") + protected CharacterWidthType characterWidth; + + @JsonProperty("CharacterHeight") + @Schema( + description = + "Character height of the text string to display or print. --Rule: If not present, default height used ") + protected CharacterHeightType characterHeight; + + @JsonProperty("CharacterStyle") + @Schema( + description = + "Typographic style of the sequence of characters to display or print. --Rule: If notpresent, default style used ") + protected CharacterStyleType characterStyle; + + @JsonProperty("Alignment") + @Schema( + description = + "Alignment of the text string on the display line or print line --Rule: If not present, default alignment used ") + protected AlignmentType alignment; + + @JsonProperty("EndOfLineFlag") + @Schema(description = "Text is at the end of a line.") + protected Boolean endOfLineFlag; + + /** + * Gets text. + * + * @return the text + */ + public String getText() { + return text; + } + + /** + * Sets text. + * + * @param text the text + */ + public void setText(String text) { + this.text = text; + } + + /** + * Gets character set. + * + * @return the character set + */ + public Integer getCharacterSet() { + return characterSet; + } + + /** + * Sets character set. + * + * @param characterSet the character set + */ + public void setCharacterSet(Integer characterSet) { + this.characterSet = characterSet; + } + + /** + * Gets font. + * + * @return the font + */ + public String getFont() { + return font; + } + + /** + * Sets font. + * + * @param font the font + */ + public void setFont(String font) { + this.font = font; + } + + /** + * Gets start row. + * + * @return the start row + */ + public Integer getStartRow() { + return startRow; + } + + /** + * Sets start row. + * + * @param startRow the start row + */ + public void setStartRow(Integer startRow) { + this.startRow = startRow; + } + + /** + * Gets start column. + * + * @return the start column + */ + public Integer getStartColumn() { + return startColumn; + } + + /** + * Sets start column. + * + * @param startColumn the start column + */ + public void setStartColumn(Integer startColumn) { + this.startColumn = startColumn; + } + + /** + * Gets color. + * + * @return the color + */ + public ColorType getColor() { + return color; + } + + /** + * Sets color. + * + * @param color the color + */ + public void setColor(ColorType color) { + this.color = color; + } + + /** + * Gets character width. + * + * @return the character width + */ + public CharacterWidthType getCharacterWidth() { + return characterWidth; + } + + /** + * Sets character width. + * + * @param characterWidth the character width + */ + public void setCharacterWidth(CharacterWidthType characterWidth) { + this.characterWidth = characterWidth; + } + + /** + * Gets character height. + * + * @return the character height + */ + public CharacterHeightType getCharacterHeight() { + return characterHeight; + } + + /** + * Sets character height. + * + * @param characterHeight the character height + */ + public void setCharacterHeight(CharacterHeightType characterHeight) { + this.characterHeight = characterHeight; + } + + /** + * Gets character style. + * + * @return the character style + */ + public CharacterStyleType getCharacterStyle() { + return characterStyle; + } + + /** + * Sets character style. + * + * @param characterStyle the character style + */ + public void setCharacterStyle(CharacterStyleType characterStyle) { + this.characterStyle = characterStyle; + } + + /** + * Gets alignment. + * + * @return the alignment + */ + public AlignmentType getAlignment() { + return alignment; + } + + /** + * Sets alignment. + * + * @param alignment the alignment + */ + public void setAlignment(AlignmentType alignment) { + this.alignment = alignment; + } + + /** + * Is end of line flag boolean. + * + * @return the boolean + */ + public boolean isEndOfLineFlag() { + if (endOfLineFlag == null) { + return true; + } else { + return endOfLineFlag; + } + } + + /** + * Sets end of line flag. + * + * @param endOfLineFlag the end of line flag + */ + public void setEndOfLineFlag(Boolean endOfLineFlag) { + this.endOfLineFlag = endOfLineFlag; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PINFormatType.java b/src/main/java/com/adyen/model/clouddevice/PINFormatType.java new file mode 100644 index 000000000..2a9599673 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PINFormatType.java @@ -0,0 +1,53 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of PIN format. */ +public enum PINFormatType { + + /** ISO 0 */ + @Schema(description = "ISO 0") + ISO_0("ISO0"), + + /** ISO 1 */ + @Schema(description = "ISO 1") + ISO_1("ISO1"), + + /** ISO 2 */ + @Schema(description = "ISO 2") + ISO_2("ISO2"), + + /** ISO 3 */ + @Schema(description = "ISO 3") + ISO_3("ISO3"); + + private final String value; + + PINFormatType(String v) { + value = v; + } + + /** + * Returns the string representation of the PINFormatType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a PINFormatType from a string value. + * + * @param v the string value + * @return the corresponding PINFormatType + */ + @JsonCreator + public static PINFormatType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PINRequest.java b/src/main/java/com/adyen/model/clouddevice/PINRequest.java new file mode 100644 index 000000000..895a32391 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PINRequest.java @@ -0,0 +1,202 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigInteger; + +/** Content of the PIN Request message. */ +@JsonPropertyOrder({ + "CardholderPIN", + "PINRequestType", + "PINVerifMethod", + "AdditionalInput", + "PINEncAlgorithm", + "PINFormat", + "KeyReference", + "MaxWaitingTime" +}) +public class PINRequest { + + @JsonProperty("CardholderPIN") + @Schema( + description = + "Encrypted PIN and related information --Rule: PINRequestTypeConformed to EPAS Acquirer protocol.") + protected CardholderPIN cardholderPIN; + + @JsonProperty("PINRequestType") + @Schema(description = "Type of PIN Service.") + protected PINRequestType pinRequestType; + + @JsonProperty("PINVerifMethod") + @Schema(description = "Identify the PIN verification method and keys. --Rule: PINRequestType") + protected String pinVerifMethod; + + @JsonProperty("AdditionalInput") + @Schema( + description = + "Additional information required to verify the PIN like part of the PAN, or driver ID. --Rule: PINRequestType") + protected String additionalInput; + + @JsonProperty("PINEncAlgorithm") + @Schema(description = "Identify the encrypted PIN block algorithm. --Rule: PINRequestType") + protected String pinEncAlgorithm; + + @JsonProperty("PINFormat") + @Schema(description = "Identify the format of the PIN before encryption. --Rule: PINRequestType") + protected PINFormatType pinFormat; + + @JsonProperty("KeyReference") + @Schema(description = "Identify the key to use to encrypt the PIN block. --Rule: PINRequestType") + protected String keyReference; + + @JsonProperty("MaxWaitingTime") + @Schema( + description = + "Maximum time to wait for the request processing in seconds. --Rule: PINRequestTypePINRequestType") + protected BigInteger maxWaitingTime; + + /** + * Gets cardholder pin. + * + * @return the cardholder pin + */ + public CardholderPIN getCardholderPIN() { + return cardholderPIN; + } + + /** + * Sets cardholder pin. + * + * @param cardholderPIN the cardholder pin + */ + public void setCardholderPIN(CardholderPIN cardholderPIN) { + this.cardholderPIN = cardholderPIN; + } + + /** + * Gets pin request type. + * + * @return the pin request type + */ + public PINRequestType getPINRequestType() { + return pinRequestType; + } + + /** + * Sets pin request type. + * + * @param pinRequestType the pin request type + */ + public void setPINRequestType(PINRequestType pinRequestType) { + this.pinRequestType = pinRequestType; + } + + /** + * Gets pin verif method. + * + * @return the pin verif method + */ + public String getPINVerifMethod() { + return pinVerifMethod; + } + + /** + * Sets pin verif method. + * + * @param pinVerifMethod the pin verif method + */ + public void setPINVerifMethod(String pinVerifMethod) { + this.pinVerifMethod = pinVerifMethod; + } + + /** + * Gets additional input. + * + * @return the additional input + */ + public String getAdditionalInput() { + return additionalInput; + } + + /** + * Sets additional input. + * + * @param additionalInput the additional input + */ + public void setAdditionalInput(String additionalInput) { + this.additionalInput = additionalInput; + } + + /** + * Gets pin enc algorithm. + * + * @return the pin enc algorithm + */ + public String getPINEncAlgorithm() { + return pinEncAlgorithm; + } + + /** + * Sets pin enc algorithm. + * + * @param pinEncAlgorithm the pin enc algorithm + */ + public void setPINEncAlgorithm(String pinEncAlgorithm) { + this.pinEncAlgorithm = pinEncAlgorithm; + } + + /** + * Gets pin format. + * + * @return the pin format + */ + public PINFormatType getPINFormat() { + return pinFormat; + } + + /** + * Sets pin format. + * + * @param pinFormat the pin format + */ + public void setPINFormat(PINFormatType pinFormat) { + this.pinFormat = pinFormat; + } + + /** + * Gets key reference. + * + * @return the key reference + */ + public String getKeyReference() { + return keyReference; + } + + /** + * Sets key reference. + * + * @param keyReference the key reference + */ + public void setKeyReference(String keyReference) { + this.keyReference = keyReference; + } + + /** + * Gets max waiting time. + * + * @return the max waiting time + */ + public BigInteger getMaxWaitingTime() { + return maxWaitingTime; + } + + /** + * Sets max waiting time. + * + * @param maxWaitingTime the max waiting time + */ + public void setMaxWaitingTime(BigInteger maxWaitingTime) { + this.maxWaitingTime = maxWaitingTime; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PINRequestType.java b/src/main/java/com/adyen/model/clouddevice/PINRequestType.java new file mode 100644 index 000000000..34925c1f3 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PINRequestType.java @@ -0,0 +1,55 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of PIN request. */ +public enum PINRequestType { + + /** The PIN Entering and Verify. */ + @Schema(description = "The PIN Entering and Verify.") + PIN_VERIFY("PINVerify"), + + /** + * The PIN Verify only, the PIN is entered before and the PIN Block (encrypted PIN) is provided. + */ + @Schema( + description = + "The PIN Verify only, the PIN is entered before and the PIN Block (encrypted PIN) is provided.") + PIN_VERIFY_ONLY("PINVerifyOnly"), + + /** The PIN is entered by the Cardholder, encrypted by the POI, and provided as a result. */ + @Schema( + description = + "The PIN is entered by the Cardholder, encrypted by the POI, and provided as a result.") + PIN_ENTER("PINEnter"); + + private final String value; + + PINRequestType(String v) { + value = v; + } + + /** + * Returns the string representation of the PINRequestType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a PINRequestType from a string value. + * + * @param v the string value + * @return the corresponding PINRequestType + */ + @JsonCreator + public static PINRequestType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PINResponse.java b/src/main/java/com/adyen/model/clouddevice/PINResponse.java new file mode 100644 index 000000000..02e0641f9 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PINResponse.java @@ -0,0 +1,54 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the PIN Response message. */ +@JsonPropertyOrder({"Response", "CardholderPIN"}) +public class PINResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("CardholderPIN") + @Schema(description = "Encrypted PIN and related information") + protected CardholderPIN cardholderPIN; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets cardholder pin. + * + * @return the cardholder pin + */ + public CardholderPIN getCardholderPIN() { + return cardholderPIN; + } + + /** + * Sets cardholder pin. + * + * @param cardholderPIN the cardholder pin + */ + public void setCardholderPIN(CardholderPIN cardholderPIN) { + this.cardholderPIN = cardholderPIN; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/POICapabilitiesType.java b/src/main/java/com/adyen/model/clouddevice/POICapabilitiesType.java new file mode 100644 index 000000000..6ae8d15fa --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/POICapabilitiesType.java @@ -0,0 +1,124 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of POI capabilities. */ +public enum POICapabilitiesType { + + /** + * Used by the Sale System when the device is managed by the POI Terminal, to ask question or + * display some information to the Cashier. + */ + @Schema( + description = + "Used by the Sale System when the device is managed by the POI Terminal, to ask question or display some information to the Cashier.") + CASHIER_DISPLAY("CashierDisplay"), + + /** + * To display to the Cashier information is related to an error situation occurring on the Sale + * Terminal when the device is managed by the POI Terminal. + */ + @Schema( + description = + "To display to the Cashier information is related to an error situation occurring on the Sale Terminal when the device is managed by the POI Terminal.") + CASHIER_ERROR("CashierError"), + + /** + * Any kind of keyboard allowing all or part of the commands of the Input messageType request from + * the POI System to the Sale System (InputCommand data element). The + */ + @Schema( + description = + "Any kind of keyboard allowing all or part of the commands of the Input message request from the POI System to the Sale System (InputCommand data element). The") + CASHIER_INPUT("CashierInput"), + + /** + * Standard Customer display interface used by the Sale System to ask question, or to show + * information to the Customer outside a Service dialogue. + */ + @Schema( + description = + "Standard Customer display interface used by the Sale System to ask question, or to show information to the Customer outside a Service dialogue.") + CUSTOMER_DISPLAY("CustomerDisplay"), + + /** + * To display to the Customer information is related to an error situation occurring on the Sale + * Terminal during a Sale transaction. + */ + @Schema( + description = + "To display to the Customer information is related to an error situation occurring on the Sale Terminal during a Sale transaction.") + CUSTOMER_ERROR("CustomerError"), + + /** + * Any kind of keyboard allowing all or part of the commands of the Input messageType request from + * the POI System to the Sale System (InputCommand data element). The + */ + @Schema( + description = + "Any kind of keyboard allowing all or part of the commands of the Input message request from the POI System to the Sale System (InputCommand data element). The") + CUSTOMER_INPUT("CustomerInput"), + + /** Printer for the Sale receipt. */ + @Schema(description = "Printer for the Sale receipt.") + PRINTER_RECEIPT("PrinterReceipt"), + + /** + * When the Sale System wants to print specific document (check, dynamic currency conversion ...). + */ + @Schema( + description = + "When the Sale System wants to print specific document (check, dynamic currency conversion ...). ") + PRINTER_DOCUMENT("PrinterDocument"), + + /** Coupons, voucher or special ticket generated by the Sale System and to be printed. */ + @Schema( + description = + "Coupons, voucher or special ticket generated by the Sale System and to be printed.") + PRINTER_VOUCHER("PrinterVoucher"), + + /** Magnetic stripe card reader */ + @Schema(description = "Magnetic stripe card reader") + MAG_STRIPE("MagStripe"), + + /** Contact ICC card reader */ + ICC("ICC"), + + /** Contactless card reader with EMV applications */ + @Schema(description = "Contactless card reader with EMV applications") + EMV_CONTACTLESS("EMVContactless"), + + /** Device which performs cash change, cash dispense or cash acceptance. */ + @Schema(description = "Device which performs cash change, cash dispense or cash acceptance.") + CASH_HANDLING("CashHandling"); + + private final String value; + + POICapabilitiesType(String v) { + value = v; + } + + /** + * Returns the string representation of the POICapabilitiesType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a POICapabilitiesType from a string value. + * + * @param v the string value + * @return the corresponding POICapabilitiesType + */ + @JsonCreator + public static POICapabilitiesType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/POIData.java b/src/main/java/com/adyen/model/clouddevice/POIData.java new file mode 100644 index 000000000..bef69384b --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/POIData.java @@ -0,0 +1,66 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data related to the POI System. */ +@JsonPropertyOrder({"POITransactionID", "POIReconciliationID"}) +public class POIData { + + @JsonProperty("POITransactionID") + @Schema(description = "Unique identification of a POI transaction for a POI") + protected TransactionIdentification poiTransactionID; + + @JsonProperty("POIReconciliationID") + @Schema( + description = + "Identification of the reconciliation period between Sale and POI. --Rule: If Result is Success") + protected String poiReconciliationID; + + /** + * Gets poi transaction id. + * + * @return the poi transaction id + */ + public TransactionIdentification getPOITransactionID() { + return poiTransactionID; + } + + /** + * Sets poi transaction id. + * + * @param poiTransactionID the poi transaction id + */ + public void setPOITransactionID(TransactionIdentification poiTransactionID) { + this.poiTransactionID = poiTransactionID; + } + + /** + * Gets poi reconciliation id. + * + * @return the poi reconciliation id + */ + public String getPOIReconciliationID() { + return poiReconciliationID; + } + + /** + * Sets poi reconciliation id. + * + * @param poiReconciliationID the poi reconciliation id + */ + public void setPOIReconciliationID(String poiReconciliationID) { + this.poiReconciliationID = poiReconciliationID; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("POIData{"); + sb.append("poiTransactionID=").append(poiTransactionID); + sb.append(", poiReconciliationID='").append(poiReconciliationID).append('\''); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/POIProfile.java b/src/main/java/com/adyen/model/clouddevice/POIProfile.java new file mode 100644 index 000000000..774c75b56 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/POIProfile.java @@ -0,0 +1,65 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Functional profile of the POI Terminal. */ +@JsonPropertyOrder({"ServiceProfiles", "GenericProfile"}) +public class POIProfile { + + @JsonProperty("ServiceProfiles") + @Schema( + description = + "Service profiles of the Sale to POI protocol. --Rule: If a service profile could be requested") + protected List serviceProfiles; + + @JsonProperty("GenericProfile") + @Schema(description = "Functional profile of the Sale to POI protocol.") + protected GenericProfileType genericProfile; + + /** + * Gets service profiles. + * + * @return the service profiles + */ + public List getServiceProfiles() { + if (serviceProfiles == null) { + serviceProfiles = new ArrayList<>(); + } + return this.serviceProfiles; + } + + /** + * Sets service profiles. + * + * @param serviceProfiles the service profiles + */ + public void setServiceProfiles(List serviceProfiles) { + this.serviceProfiles = serviceProfiles; + } + + /** + * Gets generic profile. + * + * @return the generic profile + */ + public GenericProfileType getGenericProfile() { + if (genericProfile == null) { + return GenericProfileType.STANDARD; + } else { + return genericProfile; + } + } + + /** + * Sets generic profile. + * + * @param genericProfile the generic profile + */ + public void setGenericProfile(GenericProfileType genericProfile) { + this.genericProfile = genericProfile; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/POISoftware.java b/src/main/java/com/adyen/model/clouddevice/POISoftware.java new file mode 100644 index 000000000..cb982d673 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/POISoftware.java @@ -0,0 +1,99 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Information related to the software of the POI System which manages the Sale to POI protocol. */ +@JsonPropertyOrder({"ManufacturerID", "ApplicationName", "SoftwareVersion", "CertificationCode"}) +public class POISoftware { + + @JsonProperty("ManufacturerID") + @Schema(description = "Identification of the Manufacturer") + protected String manufacturerID; + + @JsonProperty("ApplicationName") + @Schema(description = "Name of the software product.") + protected String applicationName; + + @JsonProperty("SoftwareVersion") + @Schema(description = "Version of the software product") + protected String softwareVersion; + + @JsonProperty("CertificationCode") + @Schema( + description = "Certification code of the software which manages the Sale to POI protocol.") + protected String certificationCode; + + /** + * Gets manufacturer id. + * + * @return the manufacturer id + */ + public String getManufacturerID() { + return manufacturerID; + } + + /** + * Sets manufacturer id. + * + * @param manufacturerID the manufacturer id + */ + public void setManufacturerID(String manufacturerID) { + this.manufacturerID = manufacturerID; + } + + /** + * Gets application name. + * + * @return the application name + */ + public String getApplicationName() { + return applicationName; + } + + /** + * Sets application name. + * + * @param applicationName the application name + */ + public void setApplicationName(String applicationName) { + this.applicationName = applicationName; + } + + /** + * Gets software version. + * + * @return the software version + */ + public String getSoftwareVersion() { + return softwareVersion; + } + + /** + * Sets software version. + * + * @param softwareVersion the software version + */ + public void setSoftwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + } + + /** + * Gets certification code. + * + * @return the certification code + */ + public String getCertificationCode() { + return certificationCode; + } + + /** + * Sets certification code. + * + * @param certificationCode the certification code + */ + public void setCertificationCode(String certificationCode) { + this.certificationCode = certificationCode; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/POIStatus.java b/src/main/java/com/adyen/model/clouddevice/POIStatus.java new file mode 100644 index 000000000..e1bf5845d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/POIStatus.java @@ -0,0 +1,208 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** State of a POI Terminal. */ +@JsonPropertyOrder({ + "CashHandlingDevice", + "GlobalStatus", + "SecurityOKFlag", + "PEDOKFlag", + "CardReaderOKFlag", + "PrinterStatus", + "CommunicationOKFlag", + "FraudPreventionFlag" +}) +public class POIStatus { + + @JsonProperty("CashHandlingDevice") + @Schema(description = "Status of cash handling device. --Rule: If cash handling devices present.") + protected List cashHandlingDevice; + + @JsonProperty("GlobalStatus") + @Schema(description = "Global status of a POI Server or POI Terminal.") + protected GlobalStatusType globalStatus; + + @JsonProperty("SecurityOKFlag") + @Schema( + description = + "Indicates if the security module of the POI is working and usable. --Rule: If security module present") + protected Boolean securityOKFlag; + + @JsonProperty("PEDOKFlag") + @Schema(description = "Indicates if the PED is working and usable. --Rule: If PED present") + protected Boolean pedokFlag; + + @JsonProperty("CardReaderOKFlag") + @Schema( + description = + "Indicates if the card readers are working and usable. --Rule: If card reader device present") + protected Boolean cardReaderOKFlag; + + @JsonProperty("PrinterStatus") + @Schema( + description = + "Indicates if the printer is working and usable. --Rule: If printer device present") + protected PrinterStatusType printerStatus; + + @JsonProperty("CommunicationOKFlag") + @Schema( + description = + "Indicates if the communication infrastructure is working and usable. --Rule: If communication infrastructure present") + protected Boolean communicationOKFlag; + + @JsonProperty("FraudPreventionFlag") + @Schema(description = "Indicate a suspicion of fraud by the POI System. --Rule: default False") + protected Boolean fraudPreventionFlag; + + /** + * Gets cash handling device. + * + * @return the cash handling device + */ + public List getCashHandlingDevice() { + if (cashHandlingDevice == null) { + cashHandlingDevice = new ArrayList<>(); + } + return this.cashHandlingDevice; + } + + /** + * Sets cash handling device. + * + * @param cashHandlingDevice the cash handling device + */ + public void setCashHandlingDevice(List cashHandlingDevice) { + this.cashHandlingDevice = cashHandlingDevice; + } + + /** + * Gets global status. + * + * @return the global status + */ + public GlobalStatusType getGlobalStatus() { + return globalStatus; + } + + /** + * Sets global status. + * + * @param globalStatus the global status + */ + public void setGlobalStatus(GlobalStatusType globalStatus) { + this.globalStatus = globalStatus; + } + + /** + * Is security ok flag boolean. + * + * @return the boolean + */ + public Boolean isSecurityOKFlag() { + return securityOKFlag; + } + + /** + * Sets security ok flag. + * + * @param securityOKFlag the security ok flag + */ + public void setSecurityOKFlag(Boolean securityOKFlag) { + this.securityOKFlag = securityOKFlag; + } + + /** + * Is pedok flag boolean. + * + * @return the boolean + */ + public Boolean isPEDOKFlag() { + return pedokFlag; + } + + /** + * Sets pedok flag. + * + * @param pedokFlag the pedok flag + */ + public void setPEDOKFlag(Boolean pedokFlag) { + this.pedokFlag = pedokFlag; + } + + /** + * Is card reader ok flag boolean. + * + * @return the boolean + */ + public Boolean isCardReaderOKFlag() { + return cardReaderOKFlag; + } + + /** + * Sets card reader ok flag. + * + * @param cardReaderOKFlag the card reader ok flag + */ + public void setCardReaderOKFlag(Boolean cardReaderOKFlag) { + this.cardReaderOKFlag = cardReaderOKFlag; + } + + /** + * Gets printer status. + * + * @return the printer status + */ + public PrinterStatusType getPrinterStatus() { + return printerStatus; + } + + /** + * Sets printer status. + * + * @param printerStatus the printer status + */ + public void setPrinterStatus(PrinterStatusType printerStatus) { + this.printerStatus = printerStatus; + } + + /** + * Is communication ok flag boolean. + * + * @return the boolean + */ + public Boolean isCommunicationOKFlag() { + return communicationOKFlag; + } + + /** + * Sets communication ok flag. + * + * @param communicationOKFlag the communication ok flag + */ + public void setCommunicationOKFlag(Boolean communicationOKFlag) { + this.communicationOKFlag = communicationOKFlag; + } + + /** + * Is fraud prevention flag boolean. + * + * @return the boolean + */ + public Boolean isFraudPreventionFlag() { + return fraudPreventionFlag; + } + + /** + * Sets fraud prevention flag. + * + * @param fraudPreventionFlag the fraud prevention flag + */ + public void setFraudPreventionFlag(Boolean fraudPreventionFlag) { + this.fraudPreventionFlag = fraudPreventionFlag; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/POISystemData.java b/src/main/java/com/adyen/model/clouddevice/POISystemData.java new file mode 100644 index 000000000..f9a118442 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/POISystemData.java @@ -0,0 +1,105 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.OffsetDateTime; + +/** Information related to the POI System. */ +@JsonPropertyOrder({"DateTime", "POISoftware", "POITerminalData", "POIStatus"}) +public class POISystemData { + + @JsonProperty("DateTime") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") + @Schema(description = "Date and Time") + protected OffsetDateTime dateTime; + + @JsonProperty("POISoftware") + @Schema( + description = + "Information related to the software of the POI System which manages the Sale to POI protocol.") + protected POISoftware poiSoftware; + + @JsonProperty("POITerminalData") + @Schema( + description = + "Information related to the software and hardware feature of the POI Terminal --Rule: Present if the login involve a POI Terminal") + protected POITerminalData poiTerminalData; + + @JsonProperty("POIStatus") + @Schema(description = "State of a POI Terminal. --Rule: if Response.Result is Success") + protected POIStatus poiStatus; + + /** + * Gets date time. + * + * @return the date time + */ + public OffsetDateTime getDateTime() { + return dateTime; + } + + /** + * Sets date time. + * + * @param dateTime the date time + */ + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + /** + * Gets poi software. + * + * @return the poi software + */ + public POISoftware getPOISoftware() { + return poiSoftware; + } + + /** + * Sets poi software. + * + * @param poiSoftware the poi software + */ + public void setPOISoftware(POISoftware poiSoftware) { + this.poiSoftware = poiSoftware; + } + + /** + * Gets poi terminal data. + * + * @return the poi terminal data + */ + public POITerminalData getPOITerminalData() { + return poiTerminalData; + } + + /** + * Sets poi terminal data. + * + * @param poiTerminalData the poi terminal data + */ + public void setPOITerminalData(POITerminalData poiTerminalData) { + this.poiTerminalData = poiTerminalData; + } + + /** + * Gets poi status. + * + * @return the poi status + */ + public POIStatus getPOIStatus() { + return poiStatus; + } + + /** + * Sets poi status. + * + * @param poiStatus the poi status + */ + public void setPOIStatus(POIStatus poiStatus) { + this.poiStatus = poiStatus; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/POITerminalData.java b/src/main/java/com/adyen/model/clouddevice/POITerminalData.java new file mode 100644 index 000000000..e222ddd7c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/POITerminalData.java @@ -0,0 +1,105 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Information related to the software and hardware feature of the POI Terminal. */ +@JsonPropertyOrder({"POICapabilities", "POIProfile", "TerminalEnvironment", "POISerialNumber"}) +public class POITerminalData { + + @JsonProperty("POICapabilities") + @Schema(description = "Hardware capabilities of the POI Terminal.") + protected List poiCapabilities; + + @JsonProperty("POIProfile") + @Schema( + description = + "Functional profile of the POI Terminal. --Rule: If at least one element is present. The Sale System decides if it can continue or not.") + protected POIProfile poiProfile; + + @JsonProperty("TerminalEnvironment") + @Schema(description = "Environment of the Terminal.") + protected TerminalEnvironmentType terminalEnvironment; + + @JsonProperty("POISerialNumber") + @Schema(description = "Serial number of a POI Terminal") + protected String poiSerialNumber; + + /** + * Gets poi capabilities. + * + * @return the poi capabilities + */ + public List getPOICapabilities() { + if (poiCapabilities == null) { + poiCapabilities = new ArrayList<>(); + } + return this.poiCapabilities; + } + + /** + * Sets poi capabilities. + * + * @param poiCapabilities the poi capabilities + */ + public void setPOICapabilities(List poiCapabilities) { + this.poiCapabilities = poiCapabilities; + } + + /** + * Gets poi profile. + * + * @return the poi profile + */ + public POIProfile getPOIProfile() { + return poiProfile; + } + + /** + * Sets poi profile. + * + * @param poiProfile the poi profile + */ + public void setPOIProfile(POIProfile poiProfile) { + this.poiProfile = poiProfile; + } + + /** + * Gets terminal environment. + * + * @return the terminal environment + */ + public TerminalEnvironmentType getTerminalEnvironment() { + return terminalEnvironment; + } + + /** + * Sets terminal environment. + * + * @param terminalEnvironment the terminal environment + */ + public void setTerminalEnvironment(TerminalEnvironmentType terminalEnvironment) { + this.terminalEnvironment = terminalEnvironment; + } + + /** + * Gets poi serial number. + * + * @return the poi serial number + */ + public String getPOISerialNumber() { + return poiSerialNumber; + } + + /** + * Sets poi serial number. + * + * @param poiSerialNumber the poi serial number + */ + public void setPOISerialNumber(String poiSerialNumber) { + this.poiSerialNumber = poiSerialNumber; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/Parameter.java b/src/main/java/com/adyen/model/clouddevice/Parameter.java new file mode 100644 index 000000000..d7fe2c3e4 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/Parameter.java @@ -0,0 +1,30 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** Parameters associated to a cryptographic algorithm. */ +@JsonPropertyOrder({"InitialisationVector"}) +public class Parameter { + + @JsonProperty("InitialisationVector") + protected byte[] initialisationVector; + + /** + * Get initialisation vector. + * + * @return the byte [ ] + */ + public byte[] getInitialisationVector() { + return initialisationVector; + } + + /** + * Sets initialisation vector. + * + * @param initialisationVector the initialisation vector + */ + public void setInitialisationVector(byte[] initialisationVector) { + this.initialisationVector = initialisationVector; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentAccountReq.java b/src/main/java/com/adyen/model/clouddevice/PaymentAccountReq.java new file mode 100644 index 000000000..e0b9bb9d2 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentAccountReq.java @@ -0,0 +1,82 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data related to the account pointed by the payment card. */ +@JsonPropertyOrder({"CardAcquisitionReference", "PaymentInstrumentData", "AccountType"}) +public class PaymentAccountReq { + + @JsonProperty("CardAcquisitionReference") + @Schema( + description = + "Reference to the last CardAcquisition, to use the same card. --Rule: if the card data comes from a previous CardAcquisition") + protected TransactionIdentification cardAcquisitionReference; + + @JsonProperty("PaymentInstrumentData") + @Schema(description = "Data related to the instrument of payment for the transaction.") + protected PaymentInstrumentData paymentInstrumentData; + + @JsonProperty("AccountType") + @Schema(description = "Type of cardholder account used for the transaction") + protected AccountType accountType; + + /** + * Gets card acquisition reference. + * + * @return the card acquisition reference + */ + public TransactionIdentification getCardAcquisitionReference() { + return cardAcquisitionReference; + } + + /** + * Sets card acquisition reference. + * + * @param cardAcquisitionReference the card acquisition reference + */ + public void setCardAcquisitionReference(TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + } + + /** + * Gets payment instrument data. + * + * @return the payment instrument data + */ + public PaymentInstrumentData getPaymentInstrumentData() { + return paymentInstrumentData; + } + + /** + * Sets payment instrument data. + * + * @param paymentInstrumentData the payment instrument data + */ + public void setPaymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + } + + /** + * Gets account type. + * + * @return the account type + */ + public AccountType getAccountType() { + if (accountType == null) { + return AccountType.DEFAULT; + } else { + return accountType; + } + } + + /** + * Sets account type. + * + * @param accountType the account type + */ + public void setAccountType(AccountType accountType) { + this.accountType = accountType; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentAccountStatus.java b/src/main/java/com/adyen/model/clouddevice/PaymentAccountStatus.java new file mode 100644 index 000000000..02da6d7de --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentAccountStatus.java @@ -0,0 +1,137 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +/** Data related to the result of a Balance Inquiry request. */ +@JsonPropertyOrder({ + "PaymentInstrumentData", + "PaymentAcquirerData", + "LoyaltyAccountStatus", + "Currency", + "CurrentBalance" +}) +public class PaymentAccountStatus { + + @JsonProperty("PaymentInstrumentData") + @Schema( + description = + "Data related to the instrument of payment for the transaction. --Rule: If a payment instrument is analysed") + protected PaymentInstrumentData paymentInstrumentData; + + @JsonProperty("PaymentAcquirerData") + @Schema( + description = + "Data related to the response from the payment Acquirer. --Rule: If a card is analysed") + protected PaymentAcquirerData paymentAcquirerData; + + @JsonProperty("LoyaltyAccountStatus") + @Schema( + description = + "Data related to the result of a loyalty Balance Inquiry. --Rule: If PaymentInstrumentData absent and Result is Success") + protected LoyaltyAccountStatus loyaltyAccountStatus; + + @JsonProperty("Currency") + @Schema( + description = + "Currency of a monetary amount. --Rule: If PaymentInstrumentData present and Result is Success") + protected String currency; + + @JsonProperty("CurrentBalance") + @Schema( + description = + "Balance of an account. --Rule: If PaymentInstrumentData present and Result is Success") + protected BigDecimal currentBalance; + + /** + * Gets payment instrument data. + * + * @return the payment instrument data + */ + public PaymentInstrumentData getPaymentInstrumentData() { + return paymentInstrumentData; + } + + /** + * Sets payment instrument data. + * + * @param paymentInstrumentData the payment instrument data + */ + public void setPaymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + } + + /** + * Gets payment acquirer data. + * + * @return the payment acquirer data + */ + public PaymentAcquirerData getPaymentAcquirerData() { + return paymentAcquirerData; + } + + /** + * Sets payment acquirer data. + * + * @param paymentAcquirerData the payment acquirer data + */ + public void setPaymentAcquirerData(PaymentAcquirerData paymentAcquirerData) { + this.paymentAcquirerData = paymentAcquirerData; + } + + /** + * Gets loyalty account status. + * + * @return the loyalty account status + */ + public LoyaltyAccountStatus getLoyaltyAccountStatus() { + return loyaltyAccountStatus; + } + + /** + * Sets loyalty account status. + * + * @param loyaltyAccountStatus the loyalty account status + */ + public void setLoyaltyAccountStatus(LoyaltyAccountStatus loyaltyAccountStatus) { + this.loyaltyAccountStatus = loyaltyAccountStatus; + } + + /** + * Gets currency. + * + * @return the currency + */ + public String getCurrency() { + return currency; + } + + /** + * Sets currency. + * + * @param currency the currency + */ + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * Gets current balance. + * + * @return the current balance + */ + public BigDecimal getCurrentBalance() { + return currentBalance; + } + + /** + * Sets current balance. + * + * @param currentBalance the current balance + */ + public void setCurrentBalance(BigDecimal currentBalance) { + this.currentBalance = currentBalance; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentAcquirerData.java b/src/main/java/com/adyen/model/clouddevice/PaymentAcquirerData.java new file mode 100644 index 000000000..0e6bd1c36 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentAcquirerData.java @@ -0,0 +1,129 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data related to the response from the payment Acquirer. */ +@JsonPropertyOrder({ + "AcquirerTransactionID", + "ApprovalCode", + "AcquirerID", + "MerchantID", + "AcquirerPOIID" +}) +public class PaymentAcquirerData { + + @JsonProperty("AcquirerTransactionID") + @Schema( + description = + "Identification of the Transaction for the Acquirer. --Rule: If provided by the Acquirer") + protected TransactionIdentification acquirerTransactionID; + + @JsonProperty("ApprovalCode") + @Schema( + description = "Code assigned to a transaction approval by the Acquirer. --Rule: If available") + protected String approvalCode; + + @JsonProperty("AcquirerID") + @Schema(description = "Identification of the Acquirer --Rule: If several Acquirers") + protected String acquirerID; + + @JsonProperty("MerchantID") + @Schema(description = "Identification of the Merchant for the Acquirer") + protected String merchantID; + + @JsonProperty("AcquirerPOIID") + @Schema(description = "Identification of the POI for the payment Acquirer") + protected String acquirerPOIID; + + /** + * Gets acquirer transaction id. + * + * @return the acquirer transaction id + */ + public TransactionIdentification getAcquirerTransactionID() { + return acquirerTransactionID; + } + + /** + * Sets acquirer transaction id. + * + * @param acquirerTransactionID the acquirer transaction id + */ + public void setAcquirerTransactionID(TransactionIdentification acquirerTransactionID) { + this.acquirerTransactionID = acquirerTransactionID; + } + + /** + * Gets approval code. + * + * @return the approval code + */ + public String getApprovalCode() { + return approvalCode; + } + + /** + * Sets approval code. + * + * @param approvalCode the approval code + */ + public void setApprovalCode(String approvalCode) { + this.approvalCode = approvalCode; + } + + /** + * Gets acquirer id. + * + * @return the acquirer id + */ + public String getAcquirerID() { + return acquirerID; + } + + /** + * Sets acquirer id. + * + * @param acquirerID the acquirer id + */ + public void setAcquirerID(String acquirerID) { + this.acquirerID = acquirerID; + } + + /** + * Gets merchant id. + * + * @return the merchant id + */ + public String getMerchantID() { + return merchantID; + } + + /** + * Sets merchant id. + * + * @param merchantID the merchant id + */ + public void setMerchantID(String merchantID) { + this.merchantID = merchantID; + } + + /** + * Gets acquirer poiid. + * + * @return the acquirer poiid + */ + public String getAcquirerPOIID() { + return acquirerPOIID; + } + + /** + * Sets acquirer poiid. + * + * @param acquirerPOIID the acquirer poiid + */ + public void setAcquirerPOIID(String acquirerPOIID) { + this.acquirerPOIID = acquirerPOIID; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentData.java b/src/main/java/com/adyen/model/clouddevice/PaymentData.java new file mode 100644 index 000000000..ae10b2d32 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentData.java @@ -0,0 +1,190 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data related to the payment transaction. */ +@JsonPropertyOrder({ + "CardAcquisitionReference", + "RequestedValidityDate", + "Instalment", + "CustomerOrder", + "PaymentInstrumentData", + "PaymentType", + "SplitPaymentFlag" +}) +public class PaymentData { + + @JsonProperty("CardAcquisitionReference") + @Schema( + description = + "Reference to the last CardAcquisition, to use the same card. --Rule: if the card data comes from a previous CardAcquisition") + protected TransactionIdentification cardAcquisitionReference; + + @JsonProperty("RequestedValidityDate") + @Schema( + description = + "Requested validity date for the reservation. --Rule: If time period of the OneTimeReservation, FirstReservation or UpdateReservation is requested") + protected String requestedValidityDate; + + @JsonProperty("Instalment") + @Schema( + description = + "Information related an instalment transaction. --Rule: If PaymentType is \"Instalment\" or \"IssuerInstalment\"") + protected Instalment instalment; + + @JsonProperty("CustomerOrder") + @Schema( + description = + "Customer order attached to a card, recorded in the POI system. --Rule: If a customer orders has to be created.") + protected CustomerOrder customerOrder; + + @JsonProperty("PaymentInstrumentData") + @Schema( + description = + "Data related to the instrument of payment for the transaction. --Rule: If payment instrument data are read by the Sale System") + protected PaymentInstrumentData paymentInstrumentData; + + @JsonProperty("PaymentType") + @Schema(description = "Type of payment transaction.") + protected PaymentType paymentType; + + @JsonProperty("SplitPaymentFlag") + @Schema(description = "Indicates if the payment of the Sale transaction is split.") + protected Boolean splitPaymentFlag; + + /** + * Gets card acquisition reference. + * + * @return the card acquisition reference + */ + public TransactionIdentification getCardAcquisitionReference() { + return cardAcquisitionReference; + } + + /** + * Sets card acquisition reference. + * + * @param cardAcquisitionReference the card acquisition reference + */ + public void setCardAcquisitionReference(TransactionIdentification cardAcquisitionReference) { + this.cardAcquisitionReference = cardAcquisitionReference; + } + + /** + * Gets requested validity date. + * + * @return the requested validity date + */ + public String getRequestedValidityDate() { + return requestedValidityDate; + } + + /** + * Sets requested validity date. + * + * @param requestedValidityDate the requested validity date + */ + public void setRequestedValidityDate(String requestedValidityDate) { + this.requestedValidityDate = requestedValidityDate; + } + + /** + * Gets instalment. + * + * @return the instalment + */ + public Instalment getInstalment() { + return instalment; + } + + /** + * Sets instalment. + * + * @param instalment the instalment + */ + public void setInstalment(Instalment instalment) { + this.instalment = instalment; + } + + /** + * Gets customer order. + * + * @return the customer order + */ + public CustomerOrder getCustomerOrder() { + return customerOrder; + } + + /** + * Sets customer order. + * + * @param customerOrder the customer order + */ + public void setCustomerOrder(CustomerOrder customerOrder) { + this.customerOrder = customerOrder; + } + + /** + * Gets payment instrument data. + * + * @return the payment instrument data + */ + public PaymentInstrumentData getPaymentInstrumentData() { + return paymentInstrumentData; + } + + /** + * Sets payment instrument data. + * + * @param paymentInstrumentData the payment instrument data + */ + public void setPaymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + } + + /** + * Gets payment type. + * + * @return the payment type + */ + public PaymentType getPaymentType() { + if (paymentType == null) { + return PaymentType.NORMAL; + } else { + return paymentType; + } + } + + /** + * Sets payment type. + * + * @param paymentType the payment type + */ + public void setPaymentType(PaymentType paymentType) { + this.paymentType = paymentType; + } + + /** + * Is split payment flag boolean. + * + * @return the boolean + */ + public boolean isSplitPaymentFlag() { + if (splitPaymentFlag == null) { + return false; + } else { + return splitPaymentFlag; + } + } + + /** + * Sets split payment flag. + * + * @param splitPaymentFlag the split payment flag + */ + public void setSplitPaymentFlag(Boolean splitPaymentFlag) { + this.splitPaymentFlag = splitPaymentFlag; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentInstrumentData.java b/src/main/java/com/adyen/model/clouddevice/PaymentInstrumentData.java new file mode 100644 index 000000000..a77221c93 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentInstrumentData.java @@ -0,0 +1,157 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Data related to the instrument of payment for the transaction. */ +@JsonPropertyOrder({ + "CardData", + "CheckData", + "MobileData", + "PaymentInstrumentType", + "StoredValueAccountID", + "ProtectedCardData" +}) +public class PaymentInstrumentData { + + @JsonProperty("CardData") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema( + description = + "Information related to the payment card used for the transaction. --Rule: If PaymentInstrumentType is \"Card\"") + protected CardData cardData; + + @JsonProperty("CheckData") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema( + description = + "Information related to the paper check used for the transaction. --Rule: If PaymentInstrumentType is \"Check\"") + protected CheckData checkData; + + @JsonProperty("MobileData") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema( + description = + "Information related to the mobile for the payment transaction. --Rule: If PaymentInstrumentType is \"Mobile\"") + protected MobileData mobileData; + + @JsonProperty("PaymentInstrumentType") + @Schema(description = "Type of payment instrument.") + protected PaymentInstrumentType paymentInstrumentType; + + @JsonProperty("StoredValueAccountID") + protected StoredValueAccountID storedValueAccountID; + + @JsonProperty("ProtectedCardData") + protected String protectedCardData; + + /** + * Gets card data. + * + * @return the card data + */ + public CardData getCardData() { + return cardData; + } + + /** + * Sets card data. + * + * @param cardData the card data + */ + public void setCardData(CardData cardData) { + this.cardData = cardData; + } + + /** + * Gets check data. + * + * @return the check data + */ + public CheckData getCheckData() { + return checkData; + } + + /** + * Sets check data. + * + * @param checkData the check data + */ + public void setCheckData(CheckData checkData) { + this.checkData = checkData; + } + + /** + * Gets mobile data. + * + * @return the mobile data + */ + public MobileData getMobileData() { + return mobileData; + } + + /** + * Sets mobile data. + * + * @param mobileData the mobile data + */ + public void setMobileData(MobileData mobileData) { + this.mobileData = mobileData; + } + + /** + * Gets payment instrument type. + * + * @return the payment instrument type + */ + public PaymentInstrumentType getPaymentInstrumentType() { + return paymentInstrumentType; + } + + /** + * Sets payment instrument type. + * + * @param paymentInstrumentType the payment instrument type + */ + public void setPaymentInstrumentType(PaymentInstrumentType paymentInstrumentType) { + this.paymentInstrumentType = paymentInstrumentType; + } + + /** + * Gets stored value account id. + * + * @return the stored value account id + */ + public StoredValueAccountID getStoredValueAccountID() { + return storedValueAccountID; + } + + /** + * Sets stored value account id. + * + * @param storedValueAccountID the stored value account id + */ + public void setStoredValueAccountID(StoredValueAccountID storedValueAccountID) { + this.storedValueAccountID = storedValueAccountID; + } + + /** + * Gets protected card data. + * + * @return the protected card data + */ + public String getProtectedCardData() { + return protectedCardData; + } + + /** + * Sets protected card data. + * + * @param protectedCardData the protected card data + */ + public void setProtectedCardData(String protectedCardData) { + this.protectedCardData = protectedCardData; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentInstrumentType.java b/src/main/java/com/adyen/model/clouddevice/PaymentInstrumentType.java new file mode 100644 index 000000000..19af1adac --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentInstrumentType.java @@ -0,0 +1,58 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of payment instrument. */ +public enum PaymentInstrumentType { + + /** Payment card (credit or debit). */ + @Schema(description = "Payment card (credit or debit).") + CARD("Card"), + + /** Paper check. */ + @Schema(description = "Paper check.") + CHECK("Check"), + + /** Operator account accessed by a mobile phone. */ + @Schema(description = "Operator account accessed by a mobile phone.") + MOBILE("Mobile"), + + /** Account accesed by a stored value instrument such as a card or a certificate. */ + @Schema( + description = "Account accesed by a stored value instrument such as a card or a certificate.") + STORED_VALUE("StoredValue"), + + /** Cash managed by a cash handling system. */ + @Schema(description = "Cash managed by a cash handling system.") + CASH("Cash"); + + private final String value; + + PaymentInstrumentType(String v) { + value = v; + } + + /** + * Returns the string representation of the PaymentInstrumentType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a PaymentInstrumentType from a string value. + * + * @param v the string value + * @return the corresponding PaymentInstrumentType + */ + @JsonCreator + public static PaymentInstrumentType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentReceipt.java b/src/main/java/com/adyen/model/clouddevice/PaymentReceipt.java new file mode 100644 index 000000000..fb80c677f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentReceipt.java @@ -0,0 +1,127 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Customer or Merchant payment receipt. */ +@JsonPropertyOrder({ + "OutputContent", + "DocumentQualifier", + "IntegratedPrintFlag", + "RequiredSignatureFlag" +}) +public class PaymentReceipt { + + @JsonProperty("OutputContent") + @Schema(description = "Content to display or print.") + protected OutputContent outputContent; + + @JsonProperty("DocumentQualifier") + @Schema( + description = + "Qualification of the document to print to the Cashier or the Customer. --Rule: SaleReceipt or CashierReceipt") + protected DocumentQualifierType documentQualifier; + + @JsonProperty("IntegratedPrintFlag") + @Schema(description = "Type of the print integrated to other prints.") + protected Boolean integratedPrintFlag; + + @JsonProperty("RequiredSignatureFlag") + @Schema( + description = + "Indicate that the cardholder payment receipt requires a physical signature by the Customer.") + protected Boolean requiredSignatureFlag; + + /** + * Gets output content. + * + * @return the output content + */ + public OutputContent getOutputContent() { + return outputContent; + } + + /** + * Sets output content. + * + * @param outputContent the output content + */ + public void setOutputContent(OutputContent outputContent) { + this.outputContent = outputContent; + } + + /** + * Gets document qualifier. + * + * @return the document qualifier + */ + public DocumentQualifierType getDocumentQualifier() { + return documentQualifier; + } + + /** + * Sets document qualifier. + * + * @param documentQualifier the document qualifier + */ + public void setDocumentQualifier(DocumentQualifierType documentQualifier) { + this.documentQualifier = documentQualifier; + } + + /** + * Is integrated print flag boolean. + * + * @return the boolean + */ + public boolean isIntegratedPrintFlag() { + if (integratedPrintFlag == null) { + return false; + } else { + return integratedPrintFlag; + } + } + + /** + * Sets integrated print flag. + * + * @param integratedPrintFlag the integrated print flag + */ + public void setIntegratedPrintFlag(Boolean integratedPrintFlag) { + this.integratedPrintFlag = integratedPrintFlag; + } + + /** + * Is required signature flag boolean. + * + * @return the boolean + */ + public boolean isRequiredSignatureFlag() { + if (requiredSignatureFlag == null) { + return false; + } else { + return requiredSignatureFlag; + } + } + + /** + * Sets required signature flag. + * + * @param requiredSignatureFlag the required signature flag + */ + public void setRequiredSignatureFlag(Boolean requiredSignatureFlag) { + this.requiredSignatureFlag = requiredSignatureFlag; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("PaymentReceipt{"); + sb.append("outputContent=").append(outputContent); + sb.append(", documentQualifier=").append(documentQualifier); + sb.append(", integratedPrintFlag=").append(integratedPrintFlag); + sb.append(", requiredSignatureFlag=").append(requiredSignatureFlag); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentRequest.java b/src/main/java/com/adyen/model/clouddevice/PaymentRequest.java new file mode 100644 index 000000000..3b1d52068 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentRequest.java @@ -0,0 +1,129 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Payment Request message. */ +@JsonPropertyOrder({"SaleData", "PaymentTransaction", "PaymentData", "LoyaltyData"}) +public class PaymentRequest { + + @JsonProperty("SaleData") + @Schema(description = "Data related to the Sale System.") + protected SaleData saleData; + + @JsonProperty("PaymentTransaction") + @Schema(description = "Data related to the payment and loyalty transaction.") + protected PaymentTransaction paymentTransaction; + + @JsonProperty("PaymentData") + @Schema( + description = + "Data related to the payment transaction. --Rule: If one data element is present") + protected PaymentData paymentData; + + @JsonProperty("LoyaltyData") + @Schema( + description = + "Data related to a Loyalty program or account. --Rule: Loyalty cards used with the payment transaction and read by the Sale System") + protected List loyaltyData; + + /** + * Gets sale data. + * + * @return the sale data + */ + public SaleData getSaleData() { + return saleData; + } + + /** + * Sets sale data. + * + * @param saleData the sale data + */ + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + } + + /** + * Gets payment transaction. + * + * @return the payment transaction + */ + public PaymentTransaction getPaymentTransaction() { + return paymentTransaction; + } + + /** + * Sets payment transaction. + * + * @param paymentTransaction the payment transaction + */ + public void setPaymentTransaction(PaymentTransaction paymentTransaction) { + this.paymentTransaction = paymentTransaction; + } + + /** + * Gets payment data. + * + * @return the payment data + */ + public PaymentData getPaymentData() { + return paymentData; + } + + /** + * Sets payment data. + * + * @param paymentData the payment data + */ + public void setPaymentData(PaymentData paymentData) { + this.paymentData = paymentData; + } + + /** + * Gets loyalty data. + * + * @return the loyalty data + */ + public List getLoyaltyData() { + if (loyaltyData == null) { + loyaltyData = new ArrayList<>(); + } + return this.loyaltyData; + } + + /** + * Sets loyalty data. + * + * @param loyaltyData the loyalty data + */ + public void setLoyaltyData(List loyaltyData) { + this.loyaltyData = loyaltyData; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentRequest {\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" paymentTransaction: ").append(toIndentedString(paymentTransaction)).append("\n"); + sb.append(" paymentData: ").append(toIndentedString(paymentData)).append("\n"); + sb.append(" loyaltyData: ").append(toIndentedString(loyaltyData)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentResponse.java b/src/main/java/com/adyen/model/clouddevice/PaymentResponse.java new file mode 100644 index 000000000..2ae3c8e7f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentResponse.java @@ -0,0 +1,216 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Payment Response message. */ +@JsonPropertyOrder({ + "Response", + "SaleData", + "POIData", + "PaymentResult", + "LoyaltyResult", + "PaymentReceipt", + "CustomerOrder" +}) +public class PaymentResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("SaleData") + @Schema(description = "Data related to the Sale System. --Rule: Copy") + protected SaleData saleData; + + @JsonProperty("POIData") + @Schema(description = "Data related to the POI System.") + protected POIData poiData; + + @JsonProperty("PaymentResult") + @Schema( + description = + "Data related to the result of a processed payment transaction. --Rule: If one data element is present") + protected PaymentResult paymentResult; + + @JsonProperty("LoyaltyResult") + @Schema( + description = + "Data related to the result of a processed loyalty transaction. --Rule: Loyalty cards used with the payment transaction") + protected List loyaltyResult; + + @JsonProperty("PaymentReceipt") + @Schema( + description = + "Customer or Merchant payment receipt. --Rule: If Basic profile implementation with no printer on the POI.") + protected List paymentReceipt; + + @JsonProperty("CustomerOrder") + @Schema( + description = + "Customer order attached to a card, recorded in the POI system. --Rule: If the list of customer orders has been requested.") + protected List customerOrder; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets sale data. + * + * @return the sale data + */ + public SaleData getSaleData() { + return saleData; + } + + /** + * Sets sale data. + * + * @param saleData the sale data + */ + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + } + + /** + * Gets poi data. + * + * @return the poi data + */ + public POIData getPOIData() { + return poiData; + } + + /** + * Sets poi data. + * + * @param poiData the poi data + */ + public void setPOIData(POIData poiData) { + this.poiData = poiData; + } + + /** + * Gets payment result. + * + * @return the payment result + */ + public PaymentResult getPaymentResult() { + return paymentResult; + } + + /** + * Sets payment result. + * + * @param paymentResult the payment result + */ + public void setPaymentResult(PaymentResult paymentResult) { + this.paymentResult = paymentResult; + } + + /** + * Gets loyalty result. + * + * @return the loyalty result + */ + public List getLoyaltyResult() { + if (loyaltyResult == null) { + loyaltyResult = new ArrayList<>(); + } + return this.loyaltyResult; + } + + /** + * Sets loyalty result. + * + * @param loyaltyResult the loyalty result + */ + public void setLoyaltyResult(List loyaltyResult) { + this.loyaltyResult = loyaltyResult; + } + + /** + * Gets payment receipt. + * + * @return the payment receipt + */ + public List getPaymentReceipt() { + if (paymentReceipt == null) { + paymentReceipt = new ArrayList<>(); + } + return this.paymentReceipt; + } + + /** + * Sets payment receipt. + * + * @param paymentReceipt the payment receipt + */ + public void setPaymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + } + + /** + * Gets customer order. + * + * @return the customer order + */ + public List getCustomerOrder() { + if (customerOrder == null) { + customerOrder = new ArrayList<>(); + } + return this.customerOrder; + } + + /** + * Sets customer order. + * + * @param customerOrder the customer order + */ + public void setCustomerOrder(List customerOrder) { + this.customerOrder = customerOrder; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentResponse {\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" saleData: ").append(toIndentedString(saleData)).append("\n"); + sb.append(" poiData: ").append(toIndentedString(poiData)).append("\n"); + sb.append(" paymentResult: ").append(toIndentedString(paymentResult)).append("\n"); + sb.append(" loyaltyResult: ").append(toIndentedString(loyaltyResult)).append("\n"); + sb.append(" paymentReceipt: ").append(toIndentedString(paymentReceipt)).append("\n"); + sb.append(" customerOrder: ").append(toIndentedString(customerOrder)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentResult.java b/src/main/java/com/adyen/model/clouddevice/PaymentResult.java new file mode 100644 index 000000000..7d1379ea0 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentResult.java @@ -0,0 +1,354 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Data related to the result of a processed payment transaction. */ +@JsonPropertyOrder({ + "PaymentInstrumentData", + "AmountsResp", + "Instalment", + "CurrencyConversion", + "CapturedSignature", + "ProtectedSignature", + "PaymentAcquirerData", + "PaymentType", + "MerchantOverrideFlag", + "CustomerLanguage", + "OnlineFlag", + "AuthenticationMethod", + "ValidityDate" +}) +public class PaymentResult { + + @JsonProperty("PaymentInstrumentData") + @Schema( + description = + "Data related to the instrument of payment for the transaction. --Rule: If a payment instrument is analysed by the POI") + protected PaymentInstrumentData paymentInstrumentData; + + @JsonProperty("AmountsResp") + @Schema( + description = + "Various amounts related to the payment response from the POI System. --Rule: If Result is Success or Partial") + protected AmountsResp amountsResp; + + @JsonProperty("Instalment") + @Schema( + description = + "Information related an instalment transaction. --Rule: Absent if PaymentType is not \"IssuerInstalment\"") + protected Instalment instalment; + + @JsonProperty("CurrencyConversion") + @Schema( + description = + "Information related to a currency conversion --Rule: If currency conversion the Sale needs to know") + protected List currencyConversion; + + @JsonProperty("CapturedSignature") + @Schema( + description = + "Numeric value of a handwritten signature. --Rule: If handwritten signature is captured on the POI by a signature capture device.") + protected CapturedSignature capturedSignature; + + @JsonProperty("ProtectedSignature") + @Schema( + description = + "Numeric value of a handwritten signature. --Rule: Encrypted handwritten signature captured on the POI by a signature capture device.") + protected ContentInformation protectedSignature; + + @JsonProperty("PaymentAcquirerData") + @Schema( + description = + "Data related to the response from the payment Acquirer. --Rule: If a card is analysed and data available") + protected PaymentAcquirerData paymentAcquirerData; + + @JsonProperty("PaymentType") + @Schema(description = "Type of payment transaction. --Rule: Copy") + protected PaymentType paymentType; + + @JsonProperty("MerchantOverrideFlag") + @Schema( + description = + "Indicate that the Merchant forced the result of the payment to successfull. --Rule: If payment forced by the Cashier") + protected Boolean merchantOverrideFlag; + + @JsonProperty("CustomerLanguage") + @Schema( + description = + "Language of the Customer --Rule: If the customer language is different from the default language or different from the CustomerLanguage of the") + protected String customerLanguage; + + @JsonProperty("OnlineFlag") + @Schema( + description = + "Indicate that the payment transaction processing has required the approval of a host. --Rule: \"True\" if the payment transaction processing has required the approval of a host.") + protected Boolean onlineFlag; + + @JsonProperty("AuthenticationMethod") + @Schema( + description = + "Method for customer authentication. --Rule: Method for customer authentication.") + protected List authenticationMethod; + + @JsonProperty("ValidityDate") + @Schema( + description = + "End of the validity period for the reservation. --Rule: if OneTimeReservation, FirstReservation or UpdateReservation") + protected String validityDate; + + /** + * Gets payment instrument data. + * + * @return the payment instrument data + */ + public PaymentInstrumentData getPaymentInstrumentData() { + return paymentInstrumentData; + } + + /** + * Sets payment instrument data. + * + * @param paymentInstrumentData the payment instrument data + */ + public void setPaymentInstrumentData(PaymentInstrumentData paymentInstrumentData) { + this.paymentInstrumentData = paymentInstrumentData; + } + + /** + * Gets amounts resp. + * + * @return the amounts resp + */ + public AmountsResp getAmountsResp() { + return amountsResp; + } + + /** + * Sets amounts resp. + * + * @param amountsResp the amounts resp + */ + public void setAmountsResp(AmountsResp amountsResp) { + this.amountsResp = amountsResp; + } + + /** + * Gets instalment. + * + * @return the instalment + */ + public Instalment getInstalment() { + return instalment; + } + + /** + * Sets instalment. + * + * @param instalment the instalment + */ + public void setInstalment(Instalment instalment) { + this.instalment = instalment; + } + + /** + * Gets currency conversion. + * + * @return the currency conversion + */ + public List getCurrencyConversion() { + if (currencyConversion == null) { + currencyConversion = new ArrayList<>(); + } + return this.currencyConversion; + } + + /** + * Sets currency conversion. + * + * @param currencyConversion the currency conversion + */ + public void setCurrencyConversion(List currencyConversion) { + this.currencyConversion = currencyConversion; + } + + /** + * Gets captured signature. + * + * @return the captured signature + */ + public CapturedSignature getCapturedSignature() { + return capturedSignature; + } + + /** + * Sets captured signature. + * + * @param capturedSignature the captured signature + */ + public void setCapturedSignature(CapturedSignature capturedSignature) { + this.capturedSignature = capturedSignature; + } + + /** + * Gets protected signature. + * + * @return the protected signature + */ + public ContentInformation getProtectedSignature() { + return protectedSignature; + } + + /** + * Sets protected signature. + * + * @param protectedSignature the protected signature + */ + public void setProtectedSignature(ContentInformation protectedSignature) { + this.protectedSignature = protectedSignature; + } + + /** + * Gets payment acquirer data. + * + * @return the payment acquirer data + */ + public PaymentAcquirerData getPaymentAcquirerData() { + return paymentAcquirerData; + } + + /** + * Sets payment acquirer data. + * + * @param paymentAcquirerData the payment acquirer data + */ + public void setPaymentAcquirerData(PaymentAcquirerData paymentAcquirerData) { + this.paymentAcquirerData = paymentAcquirerData; + } + + /** + * Gets payment type. + * + * @return the payment type + */ + public PaymentType getPaymentType() { + if (paymentType == null) { + return PaymentType.NORMAL; + } else { + return paymentType; + } + } + + /** + * Sets payment type. + * + * @param paymentType the payment type + */ + public void setPaymentType(PaymentType paymentType) { + this.paymentType = paymentType; + } + + /** + * Is merchant override flag boolean. + * + * @return the boolean + */ + public boolean isMerchantOverrideFlag() { + if (merchantOverrideFlag == null) { + return false; + } else { + return merchantOverrideFlag; + } + } + + /** + * Sets merchant override flag. + * + * @param merchantOverrideFlag the merchant override flag + */ + public void setMerchantOverrideFlag(Boolean merchantOverrideFlag) { + this.merchantOverrideFlag = merchantOverrideFlag; + } + + /** + * Gets customer language. + * + * @return the customer language + */ + public String getCustomerLanguage() { + return customerLanguage; + } + + /** + * Sets customer language. + * + * @param customerLanguage the customer language + */ + public void setCustomerLanguage(String customerLanguage) { + this.customerLanguage = customerLanguage; + } + + /** + * Is online flag boolean. + * + * @return the boolean + */ + public boolean isOnlineFlag() { + if (onlineFlag == null) { + return true; + } else { + return onlineFlag; + } + } + + /** + * Sets online flag. + * + * @param onlineFlag the online flag + */ + public void setOnlineFlag(Boolean onlineFlag) { + this.onlineFlag = onlineFlag; + } + + /** + * Gets authentication method. + * + * @return the authentication method + */ + public List getAuthenticationMethod() { + if (authenticationMethod == null) { + authenticationMethod = new ArrayList<>(); + } + return this.authenticationMethod; + } + + /** + * Sets authentication method. + * + * @param authenticationMethod the authentication method + */ + public void setAuthenticationMethod(List authenticationMethod) { + this.authenticationMethod = authenticationMethod; + } + + /** + * Gets validity date. + * + * @return the validity date + */ + public String getValidityDate() { + return validityDate; + } + + /** + * Sets validity date. + * + * @param validityDate the validity date + */ + public void setValidityDate(String validityDate) { + this.validityDate = validityDate; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentToken.java b/src/main/java/com/adyen/model/clouddevice/PaymentToken.java new file mode 100644 index 000000000..741097d66 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentToken.java @@ -0,0 +1,106 @@ +package com.adyen.model.clouddevice; + +import io.swagger.v3.oas.annotations.media.Schema; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.datatype.XMLGregorianCalendar; + +/** + * Definition: Surrogate of the PAN (Primary Account Number) of the payment card to identify the + * payment mean of the customer. -- Usage: It allows, for a merchant, to identify the customer. + * + *

Java class for PaymentToken complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="PaymentToken">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute name="TokenRequested" use="required" type="{}TokenRequestedType" />
+ *       <attribute name="TokenValue" use="required" type="{}TokenValue" />
+ *       <attribute name="ExpiryDateTime" type="{}ExpiryDateTime" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "PaymentToken") +public class PaymentToken { + + /** The Token requested. */ + @XmlElement(name = "TokenRequestedType", required = true) + @Schema( + description = + "Type of token replacing the PAN of a payment card to identify the payment mean of the customer.") + protected TokenRequestedType tokenRequestedType; + + /** The Token value. */ + @XmlElement(name = "TokenValue", required = true) + @Schema( + description = + "Payment token replacing the PAN of the payment card to identify the payment mean of the customer.") + protected String tokenValue; + + /** The Expiry date time. */ + @XmlElement(name = "ExpiryDateTime") + @Schema(description = "Expiry date and time.") + protected XMLGregorianCalendar expiryDateTime; + + /** + * Gets the value of the tokenRequestedType property. + * + * @return possible object is {@link TokenRequestedType } + */ + public TokenRequestedType getTokenRequestedType() { + return tokenRequestedType; + } + + /** + * Sets the value of the tokenRequestedType property. + * + * @param value allowed object is {@link TokenRequestedType } + */ + public void setTokenRequestedType(TokenRequestedType value) { + this.tokenRequestedType = value; + } + + /** + * Gets the value of the tokenValue property. + * + * @return possible object is {@link String } + */ + public String getTokenValue() { + return tokenValue; + } + + /** + * Sets the value of the tokenValue property. + * + * @param value allowed object is {@link String } + */ + public void setTokenValue(String value) { + this.tokenValue = value; + } + + /** + * Gets the value of the expiryDateTime property. + * + * @return possible object is {@link XMLGregorianCalendar } + */ + public XMLGregorianCalendar getExpiryDateTime() { + return expiryDateTime; + } + + /** + * Sets the value of the expiryDateTime property. + * + * @param value allowed object is {@link XMLGregorianCalendar } + */ + public void setExpiryDateTime(XMLGregorianCalendar value) { + this.expiryDateTime = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentTotals.java b/src/main/java/com/adyen/model/clouddevice/PaymentTotals.java new file mode 100644 index 000000000..891ca1bf0 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentTotals.java @@ -0,0 +1,80 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** Totals of the payment transaction during the reconciliation period. */ +@JsonPropertyOrder({"TransactionType", "TransactionCount", "TransactionAmount"}) +public class PaymentTotals { + + @JsonProperty("TransactionType") + @Schema( + description = + "Type of transaction for which totals are grouped. --Rule: Debit, Credit, ReverseDebit, ReverseCredit, OneTimeReservation, CompletedDeffered, FirstReservation, UpdateReservation,") + protected TransactionType transactionType; + + @JsonProperty("TransactionCount") + @Schema(description = "Number of processed transaction during the period.") + protected BigInteger transactionCount; + + @JsonProperty("TransactionAmount") + @Schema(description = "Sum of amount of processed transaction during the period.") + protected BigDecimal transactionAmount; + + /** + * Gets transaction type. + * + * @return the transaction type + */ + public TransactionType getTransactionType() { + return transactionType; + } + + /** + * Sets transaction type. + * + * @param transactionType the transaction type + */ + public void setTransactionType(TransactionType transactionType) { + this.transactionType = transactionType; + } + + /** + * Gets transaction count. + * + * @return the transaction count + */ + public BigInteger getTransactionCount() { + return transactionCount; + } + + /** + * Sets transaction count. + * + * @param transactionCount the transaction count + */ + public void setTransactionCount(BigInteger transactionCount) { + this.transactionCount = transactionCount; + } + + /** + * Gets transaction amount. + * + * @return the transaction amount + */ + public BigDecimal getTransactionAmount() { + return transactionAmount; + } + + /** + * Sets transaction amount. + * + * @param transactionAmount the transaction amount + */ + public void setTransactionAmount(BigDecimal transactionAmount) { + this.transactionAmount = transactionAmount; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentTransaction.java b/src/main/java/com/adyen/model/clouddevice/PaymentTransaction.java new file mode 100644 index 000000000..b407b57b5 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentTransaction.java @@ -0,0 +1,111 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Data related to the payment and loyalty transaction. */ +@JsonPropertyOrder({"AmountsReq", "OriginalPOITransaction", "TransactionConditions", "SaleItem"}) +public class PaymentTransaction { + + @JsonProperty("AmountsReq") + @Schema( + description = + "Various amounts related to the payment and loyalty request from the Sale System.") + protected AmountsReq amountsReq; + + @JsonProperty("OriginalPOITransaction") + @Schema( + description = + "Identification of a previous POI transaction. --Rule: if UpdateReservation, Completion or Refund") + protected OriginalPOITransaction originalPOITransaction; + + @JsonProperty("TransactionConditions") + @Schema( + description = + "Conditions on which the transaction must be processed. --Rule: If one data element is present") + protected TransactionConditions transactionConditions; + + @JsonProperty("SaleItem") + @Schema( + description = + "Sale items of a transaction. --Rule: If purchased products are required for the payment") + protected List saleItem; + + /** + * Gets amounts req. + * + * @return the amounts req + */ + public AmountsReq getAmountsReq() { + return amountsReq; + } + + /** + * Sets amounts req. + * + * @param amountsReq the amounts req + */ + public void setAmountsReq(AmountsReq amountsReq) { + this.amountsReq = amountsReq; + } + + /** + * Gets original poi transaction. + * + * @return the original poi transaction + */ + public OriginalPOITransaction getOriginalPOITransaction() { + return originalPOITransaction; + } + + /** + * Sets original poi transaction. + * + * @param originalPOITransaction the original poi transaction + */ + public void setOriginalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + } + + /** + * Gets transaction conditions. + * + * @return the transaction conditions + */ + public TransactionConditions getTransactionConditions() { + return transactionConditions; + } + + /** + * Sets transaction conditions. + * + * @param transactionConditions the transaction conditions + */ + public void setTransactionConditions(TransactionConditions transactionConditions) { + this.transactionConditions = transactionConditions; + } + + /** + * Gets sale item. + * + * @return the sale item + */ + public List getSaleItem() { + if (saleItem == null) { + saleItem = new ArrayList<>(); + } + return this.saleItem; + } + + /** + * Sets sale item. + * + * @param saleItem the sale item + */ + public void setSaleItem(List saleItem) { + this.saleItem = saleItem; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PaymentType.java b/src/main/java/com/adyen/model/clouddevice/PaymentType.java new file mode 100644 index 000000000..9f10e071f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PaymentType.java @@ -0,0 +1,95 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of payment. */ +public enum PaymentType { + + /** Normal Payment */ + @Schema(description = "Normal Payment") + NORMAL("Normal"), + + /** Payment refund */ + @Schema(description = "Payment refund") + REFUND("Refund"), + + /** + * One time reservation to be just followed by a completion when the service or good is delivered. + * This service is sometimes called "Deferred Sale". + */ + @Schema( + description = + "One time reservation to be just followed by a completion when the service or good is delivered. This service is sometimes called \"Deferred Sale\".") + ONE_TIME_RESERVATION("OneTimeReservation"), + + /** + * First reservation for an amount and period of time. This service is sometimes called + * "Pre-Authorisation". + */ + @Schema( + description = + "First reservation for an amount and period of time. This service is sometimes called \"Pre-Authorisation\".") + FIRST_RESERVATION("FirstReservation"), + + /** Adjustment of the amount or period of time of a reservation. */ + @Schema(description = "Adjustment of the amount or period of time of a reservation. ") + UPDATE_RESERVATION("UpdateReservation"), + + /** End of the reservation transaction. */ + @Schema(description = "End of the reservation transaction.") + COMPLETION("Completion"), + + /** Cash advance at the POI System. */ + @Schema(description = "Cash advance at the POI System.") + CASH_ADVANCE("CashAdvance"), + + /** Cash deposit at the POI System, to credit an account. */ + @Schema(description = "Cash deposit at the POI System, to credit an account.") + CASH_DEPOSIT("CashDeposit"), + + /** Recurring payment. */ + @Schema(description = "Recurring payment.") + RECURRING("Recurring"), + + /** Instalments of payment performed on behalf of the merchant. */ + @Schema(description = "Instalments of payment performed on behalf of the merchant.") + INSTALMENT("Instalment"), + + /** Instalments of payment performed by the card issuer. */ + @Schema(description = "Instalments of payment performed by the card issuer.") + ISSUER_INSTALMENT("IssuerInstalment"), + + /** Give money to in return for goods or services rendered to the merchant. */ + @Schema(description = "Give money to in return for goods or services rendered to the merchant.") + PAID_OUT("PaidOut"); + + private final String value; + + PaymentType(String v) { + value = v; + } + + /** + * Returns the string representation of the PaymentType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a PaymentType from a string value. + * + * @param v the string value + * @return the corresponding PaymentType + */ + @JsonCreator + public static PaymentType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PerformedTransaction.java b/src/main/java/com/adyen/model/clouddevice/PerformedTransaction.java new file mode 100644 index 000000000..9f5a9f1cc --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PerformedTransaction.java @@ -0,0 +1,163 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** Result of performed transactions. */ +@JsonPropertyOrder({ + "Response", + "SaleData", + "POIData", + "PaymentResult", + "LoyaltyResult", + "ReversedAmount" +}) +public class PerformedTransaction { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("SaleData") + @Schema( + description = + "Data related to the Sale System. --Rule: If a request has been generated by the Sale system.") + protected SaleData saleData; + + @JsonProperty("POIData") + @Schema(description = "Data related to the POI System.") + protected POIData poiData; + + @JsonProperty("PaymentResult") + @Schema( + description = + "Data related to the result of a processed payment transaction. --Rule: If a Payment transaction has been performed and one (or several) data element is present") + protected PaymentResult paymentResult; + + @JsonProperty("LoyaltyResult") + @Schema( + description = + "Data related to the result of a processed loyalty transaction. --Rule: If a Loyalty transaction has been performed alone or with the Payment transaction.") + protected List loyaltyResult; + + @JsonProperty("ReversedAmount") + @Schema( + description = + "Amount of the payment or loyalty to reverse.. --Rule: If a transaction Reversal has been performed.") + protected BigDecimal reversedAmount; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets sale data. + * + * @return the sale data + */ + public SaleData getSaleData() { + return saleData; + } + + /** + * Sets sale data. + * + * @param saleData the sale data + */ + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + } + + /** + * Gets poi data. + * + * @return the poi data + */ + public POIData getPOIData() { + return poiData; + } + + /** + * Sets poi data. + * + * @param poiData the poi data + */ + public void setPOIData(POIData poiData) { + this.poiData = poiData; + } + + /** + * Gets payment result. + * + * @return the payment result + */ + public PaymentResult getPaymentResult() { + return paymentResult; + } + + /** + * Sets payment result. + * + * @param paymentResult the payment result + */ + public void setPaymentResult(PaymentResult paymentResult) { + this.paymentResult = paymentResult; + } + + /** + * Gets loyalty result. + * + * @return the loyalty result + */ + public List getLoyaltyResult() { + if (loyaltyResult == null) { + loyaltyResult = new ArrayList<>(); + } + return this.loyaltyResult; + } + + /** + * Sets loyalty result. + * + * @param loyaltyResult the loyalty result + */ + public void setLoyaltyResult(List loyaltyResult) { + this.loyaltyResult = loyaltyResult; + } + + /** + * Gets reversed amount. + * + * @return the reversed amount + */ + public BigDecimal getReversedAmount() { + return reversedAmount; + } + + /** + * Sets reversed amount. + * + * @param reversedAmount the reversed amount + */ + public void setReversedAmount(BigDecimal reversedAmount) { + this.reversedAmount = reversedAmount; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PeriodUnitType.java b/src/main/java/com/adyen/model/clouddevice/PeriodUnitType.java new file mode 100644 index 000000000..6269711aa --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PeriodUnitType.java @@ -0,0 +1,53 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of period unit. */ +public enum PeriodUnitType { + + /** The day is the unit of the period. */ + @Schema(description = "The day is the unit of the period.") + DAILY("Daily"), + + /** The week is the unit of the period. */ + @Schema(description = "The week is the unit of the period.") + WEEKLY("Weekly"), + + /** The month is the unit of the period. */ + @Schema(description = "The month is the unit of the period.") + MONTHLY("Monthly"), + + /** The year is the unit of the period. */ + @Schema(description = "The year is the unit of the period.") + ANNUAL("Annual"); + + private final String value; + + PeriodUnitType(String v) { + value = v; + } + + /** + * Returns the string representation of the PeriodUnitType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a PeriodUnitType from a string value. + * + * @param v the string value + * @return the corresponding PeriodUnitType + */ + @JsonCreator + public static PeriodUnitType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PredefinedContent.java b/src/main/java/com/adyen/model/clouddevice/PredefinedContent.java new file mode 100644 index 000000000..8d36c9298 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PredefinedContent.java @@ -0,0 +1,54 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Reference of a predefined message to display or print. */ +@JsonPropertyOrder({"ReferenceID", "Language"}) +public class PredefinedContent { + + @JsonProperty("ReferenceID") + @Schema(description = "Identification of a predefined message to display, print or play.") + protected String referenceID; + + @JsonProperty("Language") + @Schema(description = "Identification of a language.") + protected String language; + + /** + * Gets reference id. + * + * @return the reference id + */ + public String getReferenceID() { + return referenceID; + } + + /** + * Sets reference id. + * + * @param referenceID the reference id + */ + public void setReferenceID(String referenceID) { + this.referenceID = referenceID; + } + + /** + * Gets language. + * + * @return the language + */ + public String getLanguage() { + return language; + } + + /** + * Sets language. + * + * @param language the language + */ + public void setLanguage(String language) { + this.language = language; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PredefinedContentHelper.java b/src/main/java/com/adyen/model/clouddevice/PredefinedContentHelper.java new file mode 100644 index 000000000..72d3ff4d5 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PredefinedContentHelper.java @@ -0,0 +1,148 @@ +package com.adyen.model.clouddevice; + +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; + +/** + * A helper class to parse and manage the key-value pairs within a PredefinedContent referenceID + * string. The referenceID is expected to be in a URL query string format (e.g., {@code + * key1=value1&key2=value2}). + */ +public final class PredefinedContentHelper { + + private static final String KEY_EVENT = "event"; + private static final String KEY_TRANSACTION_ID = "TransactionID"; + private static final String KEY_TIME_STAMP = "TimeStamp"; + + /** + * Defines the supported events for display notifications within a PredefinedContent reference ID. + */ + public enum DisplayNotificationEvent { + TENDER_CREATED, + CARD_INSERTED, + CARD_PRESENTED, + CARD_SWIPED, + WAIT_FOR_APP_SELECTION, + APPLICATION_SELECTED, + ASK_SIGNATURE, + CHECK_SIGNATURE, + SIGNATURE_CHECKED, + WAIT_FOR_PIN, + PIN_ENTERED, + PRINT_RECEIPT, + RECEIPT_PRINTED, + CARD_REMOVED, + TENDER_FINAL, + ASK_DCC, + DCC_ACCEPTED, + DCC_REJECTED, + ASK_GRATUITY, + GRATUITY_ENTERED, + BALANCE_QUERY_STARTED, + BALANCE_QUERY_COMPLETED, + LOAD_STARTED, + LOAD_COMPLETED, + PROVIDE_CARD_DETAILS, + CARD_DETAILS_PROVIDED + } + + private final Map params; + + /** + * Constructs a helper instance by parsing the provided reference ID. + * + * @param referenceId The string from {@link PredefinedContent#getReferenceID()}, expected to be + * in URL query string format. + */ + public PredefinedContentHelper(String referenceId) { + this.params = parse(referenceId); + } + + /** + * Extracts and validates the 'event' value from the reference ID. + * + * @return An {@link Optional} containing the {@link DisplayNotificationEvent} if it is present + * and valid, otherwise an empty Optional. + *
{@code
+   * PredefinedContentHelper helper = new PredefinedContentHelper("...&event=PIN_ENTERED");
+   * helper.getEvent().ifPresent(event -> System.out.println(event)); // Prints PIN_ENTERED
+   * }
+ */ + public Optional getEvent() { + return get(KEY_EVENT) + .flatMap( + eventValue -> { + try { + return Optional.of(DisplayNotificationEvent.valueOf(eventValue)); + } catch (IllegalArgumentException e) { + return Optional.empty(); // The event string is not a valid enum constant + } + }); + } + + /** + * Gets the transaction ID from the reference ID. + * + * @return An {@link Optional} containing the TransactionID, or an empty Optional if not present. + */ + public Optional getTransactionId() { + return get(KEY_TRANSACTION_ID); + } + + /** + * Gets the timestamp from the reference ID. + * + * @return An {@link Optional} containing the TimeStamp, or an empty Optional if not present. + */ + public Optional getTimeStamp() { + return get(KEY_TIME_STAMP); + } + + /** + * Gets the value for a given key from the reference ID. + * + * @param key The name of the parameter to retrieve. + * @return An {@link Optional} containing the parameter's value, or an empty Optional if not + * present. + */ + public Optional get(String key) { + return Optional.ofNullable(params.get(key)); + } + + /** + * Returns an unmodifiable view of all parsed parameters. + * + * @return An unmodifiable {@link Map} of all key-value pairs from the reference ID. + */ + public Map toMap() { + return Collections.unmodifiableMap(params); + } + + /** + * Parses a URL query-like string into a map. + * + * @param referenceId The string to parse. + * @return A map of the parsed key-value pairs. + */ + private static Map parse(String referenceId) { + if (referenceId == null || referenceId.trim().isEmpty()) { + return Collections.emptyMap(); + } + + Map queryPairs = new LinkedHashMap<>(); + String[] pairs = referenceId.split("&"); + for (String pair : pairs) { + int idx = pair.indexOf("="); + if (idx > 0 && idx < pair.length() - 1) { + String key = URLDecoder.decode(pair.substring(0, idx), StandardCharsets.UTF_8); + String value = URLDecoder.decode(pair.substring(idx + 1), StandardCharsets.UTF_8); + queryPairs.put(key, value); + } + } + return queryPairs; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PrintOutput.java b/src/main/java/com/adyen/model/clouddevice/PrintOutput.java new file mode 100644 index 000000000..4f662fd82 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PrintOutput.java @@ -0,0 +1,161 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Information to print and the way to process the print. */ +@JsonPropertyOrder({ + "OutputContent", + "OutputSignature", + "DocumentQualifier", + "ResponseMode", + "IntegratedPrintFlag", + "RequiredSignatureFlag" +}) +public class PrintOutput { + + @JsonProperty("OutputContent") + @Schema(description = "Content to display or print.") + protected OutputContent outputContent; + + @JsonProperty("OutputSignature") + @Schema( + description = + "Vendor specific signature of text message to display or print. --Rule: If protection has to be provided to the vendor on the text to display or print.") + protected byte[] outputSignature; + + @JsonProperty("DocumentQualifier") + @Schema(description = "Qualification of the document to print to the Cashier or the Customer.") + protected DocumentQualifierType documentQualifier; + + @JsonProperty("ResponseMode") + @Schema(description = "Message response awaited by the initiator of the Request") + protected ResponseModeType responseMode; + + @JsonProperty("IntegratedPrintFlag") + @Schema(description = "Type of the print integrated to other prints.") + protected Boolean integratedPrintFlag; + + @JsonProperty("RequiredSignatureFlag") + @Schema( + description = + "Indicate that the cardholder payment receipt requires a physical signature by the Customer.") + protected Boolean requiredSignatureFlag; + + /** + * Gets output content. + * + * @return the output content + */ + public OutputContent getOutputContent() { + return outputContent; + } + + /** + * Sets output content. + * + * @param outputContent the output content + */ + public void setOutputContent(OutputContent outputContent) { + this.outputContent = outputContent; + } + + /** + * Get output signature. + * + * @return the byte [ ] + */ + public byte[] getOutputSignature() { + return outputSignature; + } + + /** + * Sets output signature. + * + * @param outputSignature the output signature + */ + public void setOutputSignature(byte[] outputSignature) { + this.outputSignature = outputSignature; + } + + /** + * Gets document qualifier. + * + * @return the document qualifier + */ + public DocumentQualifierType getDocumentQualifier() { + return documentQualifier; + } + + /** + * Sets document qualifier. + * + * @param documentQualifier the document qualifier + */ + public void setDocumentQualifier(DocumentQualifierType documentQualifier) { + this.documentQualifier = documentQualifier; + } + + /** + * Gets response mode. + * + * @return the response mode + */ + public ResponseModeType getResponseMode() { + return responseMode; + } + + /** + * Sets response mode. + * + * @param responseMode the response mode + */ + public void setResponseMode(ResponseModeType responseMode) { + this.responseMode = responseMode; + } + + /** + * Is integrated print flag boolean. + * + * @return the boolean + */ + public boolean isIntegratedPrintFlag() { + if (integratedPrintFlag == null) { + return false; + } else { + return integratedPrintFlag; + } + } + + /** + * Sets integrated print flag. + * + * @param integratedPrintFlag the integrated print flag + */ + public void setIntegratedPrintFlag(Boolean integratedPrintFlag) { + this.integratedPrintFlag = integratedPrintFlag; + } + + /** + * Is required signature flag boolean. + * + * @return the boolean + */ + public boolean isRequiredSignatureFlag() { + if (requiredSignatureFlag == null) { + return false; + } else { + return requiredSignatureFlag; + } + } + + /** + * Sets required signature flag. + * + * @param requiredSignatureFlag the required signature flag + */ + public void setRequiredSignatureFlag(Boolean requiredSignatureFlag) { + this.requiredSignatureFlag = requiredSignatureFlag; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PrintRequest.java b/src/main/java/com/adyen/model/clouddevice/PrintRequest.java new file mode 100644 index 000000000..9bf5d195f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PrintRequest.java @@ -0,0 +1,32 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Print Request message. */ +@JsonPropertyOrder({"PrintOutput"}) +public class PrintRequest { + + @JsonProperty("PrintOutput") + @Schema(description = "Information to print and the way to process the print.") + protected PrintOutput printOutput; + + /** + * Gets print output. + * + * @return the print output + */ + public PrintOutput getPrintOutput() { + return printOutput; + } + + /** + * Sets print output. + * + * @param printOutput the print output + */ + public void setPrintOutput(PrintOutput printOutput) { + this.printOutput = printOutput; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PrintResponse.java b/src/main/java/com/adyen/model/clouddevice/PrintResponse.java new file mode 100644 index 000000000..8fbddb9ad --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PrintResponse.java @@ -0,0 +1,56 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Print Response message. */ +@JsonPropertyOrder({"Response", "DocumentQualifier"}) +public class PrintResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("DocumentQualifier") + @Schema( + description = + "Qualification of the document to print to the Cashier or the Customer. --Rule: Copy") + protected DocumentQualifierType documentQualifier; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets document qualifier. + * + * @return the document qualifier + */ + public DocumentQualifierType getDocumentQualifier() { + return documentQualifier; + } + + /** + * Sets document qualifier. + * + * @param documentQualifier the document qualifier + */ + public void setDocumentQualifier(DocumentQualifierType documentQualifier) { + this.documentQualifier = documentQualifier; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/PrinterStatusType.java b/src/main/java/com/adyen/model/clouddevice/PrinterStatusType.java new file mode 100644 index 000000000..ba3b1ba20 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/PrinterStatusType.java @@ -0,0 +1,56 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of printer status. */ +public enum PrinterStatusType { + + /** The printer is operational. */ + OK("OK"), + + /** The printer is operational but paper roll is almost empty. */ + @Schema(description = "The printer is operational but paper roll is almost empty.") + PAPER_LOW("PaperLow"), + + /** Paper roll is empty, an operator must insert a new paper roll. */ + @Schema(description = "Paper roll is empty, an operator must insert a new paper roll.") + NO_PAPER("NoPaper"), + + /** An operator must remove the paper jam manually. */ + @Schema(description = "An operator must remove the paper jam manually.") + PAPER_JAM("PaperJam"), + + /** The printer is out of order. */ + @Schema(description = "The printer is out of order.") + OUT_OF_ORDER("OutOfOrder"); + + private final String value; + + PrinterStatusType(String v) { + value = v; + } + + /** + * Returns the string representation of the PrinterStatusType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a PrinterStatusType from a string value. + * + * @param v the string value + * @return the corresponding PrinterStatusType + */ + @JsonCreator + public static PrinterStatusType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/Rebates.java b/src/main/java/com/adyen/model/clouddevice/Rebates.java new file mode 100644 index 000000000..04d29e210 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/Rebates.java @@ -0,0 +1,88 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** Rebate form to an award. */ +@JsonPropertyOrder({"TotalRebate", "RebateLabel", "SaleItemRebate"}) +public class Rebates { + + @JsonProperty("TotalRebate") + @Schema( + description = + "The global awarded amount that is not attached to an item. --Rule: If rebate on the total amount for this loyalty program") + protected BigDecimal totalRebate; + + @JsonProperty("RebateLabel") + @Schema( + description = + "Short text to qualify a rebate on an line item. --Rule: If provided by the Acquirer") + protected String rebateLabel; + + @JsonProperty("SaleItemRebate") + @Schema( + description = + "The awarded amount that is attached to an item as a rebate. --Rule: only items with rebate (identified by ItemID)") + protected List saleItemRebate; + + /** + * Gets total rebate. + * + * @return the total rebate + */ + public BigDecimal getTotalRebate() { + return totalRebate; + } + + /** + * Sets total rebate. + * + * @param totalRebate the total rebate + */ + public void setTotalRebate(BigDecimal totalRebate) { + this.totalRebate = totalRebate; + } + + /** + * Gets rebate label. + * + * @return the rebate label + */ + public String getRebateLabel() { + return rebateLabel; + } + + /** + * Sets rebate label. + * + * @param rebateLabel the rebate label + */ + public void setRebateLabel(String rebateLabel) { + this.rebateLabel = rebateLabel; + } + + /** + * Gets sale item rebate. + * + * @return the sale item rebate + */ + public List getSaleItemRebate() { + if (saleItemRebate == null) { + saleItemRebate = new ArrayList<>(); + } + return this.saleItemRebate; + } + + /** + * Sets sale item rebate. + * + * @param saleItemRebate the sale item rebate + */ + public void setSaleItemRebate(List saleItemRebate) { + this.saleItemRebate = saleItemRebate; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/RecipientIdentifier.java b/src/main/java/com/adyen/model/clouddevice/RecipientIdentifier.java new file mode 100644 index 000000000..8cb0710bb --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/RecipientIdentifier.java @@ -0,0 +1,30 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** Cryptographic Message Syntax (CMS) data structure containing the Recipient Identifier. */ +@JsonPropertyOrder({"IssuerAndSerialNumber"}) +public class RecipientIdentifier { + + @JsonProperty("IssuerAndSerialNumber") + protected IssuerAndSerialNumber issuerAndSerialNumber; + + /** + * Gets issuer and serial number. + * + * @return the issuer and serial number + */ + public IssuerAndSerialNumber getIssuerAndSerialNumber() { + return issuerAndSerialNumber; + } + + /** + * Sets issuer and serial number. + * + * @param issuerAndSerialNumber the issuer and serial number + */ + public void setIssuerAndSerialNumber(IssuerAndSerialNumber issuerAndSerialNumber) { + this.issuerAndSerialNumber = issuerAndSerialNumber; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ReconciliationRequest.java b/src/main/java/com/adyen/model/clouddevice/ReconciliationRequest.java new file mode 100644 index 000000000..0a8492e90 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ReconciliationRequest.java @@ -0,0 +1,85 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Reconciliation Request message. */ +@JsonPropertyOrder({"AcquirerID", "ReconciliationType", "POIReconciliationID"}) +public class ReconciliationRequest { + + @JsonProperty("AcquirerID") + @Schema( + description = + "Identification of the Acquirer --Rule: Could be present only if ReconciliationType is \"AcquirerReconciliation\" or \"AcquirerSynchronisation\"") + protected List acquirerID; + + @JsonProperty("ReconciliationType") + @Schema(description = "Type of Reconciliation requested by the Sale to the POI.") + protected ReconciliationType reconciliationType; + + @JsonProperty("POIReconciliationID") + @Schema( + description = + "Identification of the reconciliation period between Sale and POI. --Rule: Absent if ReconciliationType is not \"PreviousReconciliation\"") + protected String poiReconciliationID; + + /** + * Gets acquirer id. + * + * @return the acquirer id + */ + public List getAcquirerID() { + if (acquirerID == null) { + acquirerID = new ArrayList<>(); + } + return this.acquirerID; + } + + /** + * Sets acquirer id. + * + * @param acquirerID the acquirer id + */ + public void setAcquirerID(List acquirerID) { + this.acquirerID = acquirerID; + } + + /** + * Gets reconciliation type. + * + * @return the reconciliation type + */ + public ReconciliationType getReconciliationType() { + return reconciliationType; + } + + /** + * Sets reconciliation type. + * + * @param reconciliationType the reconciliation type + */ + public void setReconciliationType(ReconciliationType reconciliationType) { + this.reconciliationType = reconciliationType; + } + + /** + * Gets poi reconciliation id. + * + * @return the poi reconciliation id + */ + public String getPOIReconciliationID() { + return poiReconciliationID; + } + + /** + * Sets poi reconciliation id. + * + * @param poiReconciliationID the poi reconciliation id + */ + public void setPOIReconciliationID(String poiReconciliationID) { + this.poiReconciliationID = poiReconciliationID; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ReconciliationResponse.java b/src/main/java/com/adyen/model/clouddevice/ReconciliationResponse.java new file mode 100644 index 000000000..ffe9137fc --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ReconciliationResponse.java @@ -0,0 +1,107 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Reconciliation Response message. */ +@JsonPropertyOrder({"Response", "TransactionTotals", "ReconciliationType", "POIReconciliationID"}) +public class ReconciliationResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("TransactionTotals") + @Schema( + description = + "Result of the Sale to POI Reconciliation processing. --Rule: if Response.Result is Success") + protected List transactionTotals; + + @JsonProperty("ReconciliationType") + @Schema(description = "Type of Reconciliation requested by the Sale to the POI. --Rule: Copy") + protected ReconciliationType reconciliationType; + + @JsonProperty("POIReconciliationID") + @Schema( + description = + "Identification of the reconciliation period between Sale and POI. --Rule: Absent if ReconciliationType is \"AcquirerReconciliation\"") + protected String poiReconciliationID; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets transaction totals. + * + * @return the transaction totals + */ + public List getTransactionTotals() { + if (transactionTotals == null) { + transactionTotals = new ArrayList<>(); + } + return this.transactionTotals; + } + + /** + * Sets transaction totals. + * + * @param transactionTotals the transaction totals + */ + public void setTransactionTotals(List transactionTotals) { + this.transactionTotals = transactionTotals; + } + + /** + * Gets reconciliation type. + * + * @return the reconciliation type + */ + public ReconciliationType getReconciliationType() { + return reconciliationType; + } + + /** + * Sets reconciliation type. + * + * @param reconciliationType the reconciliation type + */ + public void setReconciliationType(ReconciliationType reconciliationType) { + this.reconciliationType = reconciliationType; + } + + /** + * Gets poi reconciliation id. + * + * @return the poi reconciliation id + */ + public String getPOIReconciliationID() { + return poiReconciliationID; + } + + /** + * Sets poi reconciliation id. + * + * @param poiReconciliationID the poi reconciliation id + */ + public void setPOIReconciliationID(String poiReconciliationID) { + this.poiReconciliationID = poiReconciliationID; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ReconciliationType.java b/src/main/java/com/adyen/model/clouddevice/ReconciliationType.java new file mode 100644 index 000000000..8c6f8b51c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ReconciliationType.java @@ -0,0 +1,65 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of reconciliation. */ +public enum ReconciliationType { + + /** Reconciliation with closure of the current period, without any Acquirers synchronisation. */ + @Schema( + description = + "Reconciliation with closure of the current period, without any Acquirers synchronisation.") + SALE_RECONCILIATION("SaleReconciliation"), + + /** + * Reconciliation and closure of the current period, with synchronisation of the reconciliation + * between the POI and Acquirers. + */ + @Schema( + description = + "Reconciliation and closure of the current period, with synchronisation of the reconciliation between the POI and Acquirers.") + ACQUIRER_SYNCHRONISATION("AcquirerSynchronisation"), + + /** + * Reconciliation between the POI and one or several Acquirers only. There is no reconciliation + * between the Sale System and the POI System. + */ + @Schema( + description = + "Reconciliation between the POI and one or several Acquirers only. There is no reconciliation between the Sale System and the POI System.") + ACQUIRER_RECONCILIATION("AcquirerReconciliation"), + + /** Request result of a previous reconciliation. */ + @Schema(description = "Request result of a previous reconciliation.") + PREVIOUS_RECONCILIATION("PreviousReconciliation"); + + private final String value; + + ReconciliationType(String v) { + value = v; + } + + /** + * Returns the string representation of the ReconciliationType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a ReconciliationType from a string value. + * + * @param v the string value + * @return the corresponding ReconciliationType + */ + @JsonCreator + public static ReconciliationType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/RelativeDistinguishedName.java b/src/main/java/com/adyen/model/clouddevice/RelativeDistinguishedName.java new file mode 100644 index 000000000..d1af53044 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/RelativeDistinguishedName.java @@ -0,0 +1,51 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** Certificate distinguished name (DN). */ +@JsonPropertyOrder({"Attribute", "AttributeValue"}) +public class RelativeDistinguishedName { + + @JsonProperty("Attribute") + protected String attribute; + + @JsonProperty("AttributeValue") + protected String attributeValue; + + /** + * Gets attribute. + * + * @return the attribute + */ + public String getAttribute() { + return attribute; + } + + /** + * Sets attribute. + * + * @param attribute the attribute + */ + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + /** + * Gets attribute value. + * + * @return the attribute value + */ + public String getAttributeValue() { + return attributeValue; + } + + /** + * Sets attribute value. + * + * @param attributeValue the attribute value + */ + public void setAttributeValue(String attributeValue) { + this.attributeValue = attributeValue; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/RepeatedMessageResponse.java b/src/main/java/com/adyen/model/clouddevice/RepeatedMessageResponse.java new file mode 100644 index 000000000..d9143d9e9 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/RepeatedMessageResponse.java @@ -0,0 +1,173 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the requested Message Response. */ +@JsonPropertyOrder({ + "MessageHeader", + "LoyaltyResponse", + "PaymentResponse", + "ReversalResponse", + "StoredValueResponse", + "CardAcquisitionResponse", + "CardReaderAPDUResponse" +}) +public class RepeatedMessageResponse { + + @JsonProperty("MessageHeader") + @Schema(description = "Message header of the Sale to POI protocol message.") + protected MessageHeader messageHeader; + + @JsonProperty("LoyaltyResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected LoyaltyResponse loyaltyResponse; + + @JsonProperty("PaymentResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected PaymentResponse paymentResponse; + + @JsonProperty("ReversalResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected ReversalResponse reversalResponse; + + @JsonProperty("StoredValueResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected StoredValueResponse storedValueResponse; + + @JsonProperty("CardAcquisitionResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected CardAcquisitionResponse cardAcquisitionResponse; + + @JsonProperty("CardReaderAPDUResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + protected CardReaderAPDUResponse cardReaderAPDUResponse; + + /** + * Gets message header. + * + * @return the message header + */ + public MessageHeader getMessageHeader() { + return messageHeader; + } + + /** + * Sets message header. + * + * @param messageHeader the message header + */ + public void setMessageHeader(MessageHeader messageHeader) { + this.messageHeader = messageHeader; + } + + /** + * Gets loyalty response. + * + * @return the loyalty response + */ + public LoyaltyResponse getLoyaltyResponse() { + return loyaltyResponse; + } + + /** + * Sets loyalty response. + * + * @param loyaltyResponse the loyalty response + */ + public void setLoyaltyResponse(LoyaltyResponse loyaltyResponse) { + this.loyaltyResponse = loyaltyResponse; + } + + /** + * Gets payment response. + * + * @return the payment response + */ + public PaymentResponse getPaymentResponse() { + return paymentResponse; + } + + /** + * Sets payment response. + * + * @param paymentResponse the payment response + */ + public void setPaymentResponse(PaymentResponse paymentResponse) { + this.paymentResponse = paymentResponse; + } + + /** + * Gets reversal response. + * + * @return the reversal response + */ + public ReversalResponse getReversalResponse() { + return reversalResponse; + } + + /** + * Sets reversal response. + * + * @param reversalResponse the reversal response + */ + public void setReversalResponse(ReversalResponse reversalResponse) { + this.reversalResponse = reversalResponse; + } + + /** + * Gets stored value response. + * + * @return the stored value response + */ + public StoredValueResponse getStoredValueResponse() { + return storedValueResponse; + } + + /** + * Sets stored value response. + * + * @param storedValueResponse the stored value response + */ + public void setStoredValueResponse(StoredValueResponse storedValueResponse) { + this.storedValueResponse = storedValueResponse; + } + + /** + * Gets card acquisition response. + * + * @return the card acquisition response + */ + public CardAcquisitionResponse getCardAcquisitionResponse() { + return cardAcquisitionResponse; + } + + /** + * Sets card acquisition response. + * + * @param cardAcquisitionResponse the card acquisition response + */ + public void setCardAcquisitionResponse(CardAcquisitionResponse cardAcquisitionResponse) { + this.cardAcquisitionResponse = cardAcquisitionResponse; + } + + /** + * Gets card reader apdu response. + * + * @return the card reader apdu response + */ + public CardReaderAPDUResponse getCardReaderAPDUResponse() { + return cardReaderAPDUResponse; + } + + /** + * Sets card reader apdu response. + * + * @param cardReaderAPDUResponse the card reader apdu response + */ + public void setCardReaderAPDUResponse(CardReaderAPDUResponse cardReaderAPDUResponse) { + this.cardReaderAPDUResponse = cardReaderAPDUResponse; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/RepeatedMessageResponseBody.java b/src/main/java/com/adyen/model/clouddevice/RepeatedMessageResponseBody.java new file mode 100644 index 000000000..a4542a4fc --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/RepeatedMessageResponseBody.java @@ -0,0 +1,142 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** The type Repeated message response body. */ +@JsonPropertyOrder({ + "LoyaltyResponse", + "PaymentResponse", + "ReversalResponse", + "StoredValueResponse", + "CardAcquisitionResponse", + "CardReaderAPDUResponse" +}) +public class RepeatedMessageResponseBody { + + @JsonProperty("LoyaltyResponse") + protected LoyaltyResponse loyaltyResponse; + + @JsonProperty("PaymentResponse") + protected PaymentResponse paymentResponse; + + @JsonProperty("ReversalResponse") + protected ReversalResponse reversalResponse; + + @JsonProperty("StoredValueResponse") + protected StoredValueResponse storedValueResponse; + + @JsonProperty("CardAcquisitionResponse") + protected CardAcquisitionResponse cardAcquisitionResponse; + + @JsonProperty("CardReaderAPDUResponse") + protected CardReaderAPDUResponse cardReaderAPDUResponse; + + /** + * Gets loyalty response. + * + * @return the loyalty response + */ + public LoyaltyResponse getLoyaltyResponse() { + return loyaltyResponse; + } + + /** + * Sets loyalty response. + * + * @param loyaltyResponse the loyalty response + */ + public void setLoyaltyResponse(LoyaltyResponse loyaltyResponse) { + this.loyaltyResponse = loyaltyResponse; + } + + /** + * Gets payment response. + * + * @return the payment response + */ + public PaymentResponse getPaymentResponse() { + return paymentResponse; + } + + /** + * Sets payment response. + * + * @param paymentResponse the payment response + */ + public void setPaymentResponse(PaymentResponse paymentResponse) { + this.paymentResponse = paymentResponse; + } + + /** + * Gets reversal response. + * + * @return the reversal response + */ + public ReversalResponse getReversalResponse() { + return reversalResponse; + } + + /** + * Sets reversal response. + * + * @param reversalResponse the reversal response + */ + public void setReversalResponse(ReversalResponse reversalResponse) { + this.reversalResponse = reversalResponse; + } + + /** + * Gets stored value response. + * + * @return the stored value response + */ + public StoredValueResponse getStoredValueResponse() { + return storedValueResponse; + } + + /** + * Sets stored value response. + * + * @param storedValueResponse the stored value response + */ + public void setStoredValueResponse(StoredValueResponse storedValueResponse) { + this.storedValueResponse = storedValueResponse; + } + + /** + * Gets card acquisition response. + * + * @return the card acquisition response + */ + public CardAcquisitionResponse getCardAcquisitionResponse() { + return cardAcquisitionResponse; + } + + /** + * Sets card acquisition response. + * + * @param cardAcquisitionResponse the card acquisition response + */ + public void setCardAcquisitionResponse(CardAcquisitionResponse cardAcquisitionResponse) { + this.cardAcquisitionResponse = cardAcquisitionResponse; + } + + /** + * Gets card reader apdu response. + * + * @return the card reader apdu response + */ + public CardReaderAPDUResponse getCardReaderAPDUResponse() { + return cardReaderAPDUResponse; + } + + /** + * Sets card reader apdu response. + * + * @param cardReaderAPDUResponse the card reader apdu response + */ + public void setCardReaderAPDUResponse(CardReaderAPDUResponse cardReaderAPDUResponse) { + this.cardReaderAPDUResponse = cardReaderAPDUResponse; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/RepeatedResponseMessageBody.java b/src/main/java/com/adyen/model/clouddevice/RepeatedResponseMessageBody.java new file mode 100644 index 000000000..9adc0e997 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/RepeatedResponseMessageBody.java @@ -0,0 +1,142 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** The type Repeated message response body. */ +@JsonPropertyOrder({ + "LoyaltyResponse", + "PaymentResponse", + "ReversalResponse", + "StoredValueResponse", + "CardAcquisitionResponse", + "CardReaderAPDUResponse" +}) +public class RepeatedResponseMessageBody { + + @JsonProperty("LoyaltyResponse") + protected LoyaltyResponse loyaltyResponse; + + @JsonProperty("PaymentResponse") + protected PaymentResponse paymentResponse; + + @JsonProperty("ReversalResponse") + protected ReversalResponse reversalResponse; + + @JsonProperty("StoredValueResponse") + protected StoredValueResponse storedValueResponse; + + @JsonProperty("CardAcquisitionResponse") + protected CardAcquisitionResponse cardAcquisitionResponse; + + @JsonProperty("CardReaderAPDUResponse") + protected CardReaderAPDUResponse cardReaderAPDUResponse; + + /** + * Gets loyalty response. + * + * @return the loyalty response + */ + public LoyaltyResponse getLoyaltyResponse() { + return loyaltyResponse; + } + + /** + * Sets loyalty response. + * + * @param loyaltyResponse the loyalty response + */ + public void setLoyaltyResponse(LoyaltyResponse loyaltyResponse) { + this.loyaltyResponse = loyaltyResponse; + } + + /** + * Gets payment response. + * + * @return the payment response + */ + public PaymentResponse getPaymentResponse() { + return paymentResponse; + } + + /** + * Sets payment response. + * + * @param paymentResponse the payment response + */ + public void setPaymentResponse(PaymentResponse paymentResponse) { + this.paymentResponse = paymentResponse; + } + + /** + * Gets reversal response. + * + * @return the reversal response + */ + public ReversalResponse getReversalResponse() { + return reversalResponse; + } + + /** + * Sets reversal response. + * + * @param reversalResponse the reversal response + */ + public void setReversalResponse(ReversalResponse reversalResponse) { + this.reversalResponse = reversalResponse; + } + + /** + * Gets stored value response. + * + * @return the stored value response + */ + public StoredValueResponse getStoredValueResponse() { + return storedValueResponse; + } + + /** + * Sets stored value response. + * + * @param storedValueResponse the stored value response + */ + public void setStoredValueResponse(StoredValueResponse storedValueResponse) { + this.storedValueResponse = storedValueResponse; + } + + /** + * Gets card acquisition response. + * + * @return the card acquisition response + */ + public CardAcquisitionResponse getCardAcquisitionResponse() { + return cardAcquisitionResponse; + } + + /** + * Sets card acquisition response. + * + * @param cardAcquisitionResponse the card acquisition response + */ + public void setCardAcquisitionResponse(CardAcquisitionResponse cardAcquisitionResponse) { + this.cardAcquisitionResponse = cardAcquisitionResponse; + } + + /** + * Gets card reader apdu response. + * + * @return the card reader apdu response + */ + public CardReaderAPDUResponse getCardReaderAPDUResponse() { + return cardReaderAPDUResponse; + } + + /** + * Sets card reader apdu response. + * + * @param cardReaderAPDUResponse the card reader apdu response + */ + public void setCardReaderAPDUResponse(CardReaderAPDUResponse cardReaderAPDUResponse) { + this.cardReaderAPDUResponse = cardReaderAPDUResponse; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/Response.java b/src/main/java/com/adyen/model/clouddevice/Response.java new file mode 100644 index 000000000..b06a8bd40 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/Response.java @@ -0,0 +1,91 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Result of a message request processing. */ +@JsonPropertyOrder({"AdditionalResponse", "Result", "ErrorCondition"}) +public class Response { + + @JsonProperty("AdditionalResponse") + @Schema( + description = + "Additional information related to processing status of a message request . --Rule: If present, the POI logs it for further examination") + protected String additionalResponse; + + @JsonProperty("Result") + @Schema(description = "Result of the processing of the message") + protected ResultType result; + + @JsonProperty("ErrorCondition") + @Schema( + description = + "Condition that has produced an error on the processing of a message request --Rule: If Result is not Success") + protected ErrorConditionType errorCondition; + + /** + * Gets additional response. + * + * @return the additional response + */ + public String getAdditionalResponse() { + return additionalResponse; + } + + /** + * Sets additional response. + * + * @param additionalResponse the additional response + */ + public void setAdditionalResponse(String additionalResponse) { + this.additionalResponse = additionalResponse; + } + + /** + * Gets result. + * + * @return the result + */ + public ResultType getResult() { + return result; + } + + /** + * Sets result. + * + * @param result the result + */ + public void setResult(ResultType result) { + this.result = result; + } + + /** + * Gets error condition. + * + * @return the error condition + */ + public ErrorConditionType getErrorCondition() { + return errorCondition; + } + + /** + * Sets error condition. + * + * @param errorCondition the error condition + */ + public void setErrorCondition(ErrorConditionType errorCondition) { + this.errorCondition = errorCondition; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Response{"); + sb.append("additionalResponse='").append(additionalResponse).append('\''); + sb.append(", result=").append(result); + sb.append(", errorCondition=").append(errorCondition); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ResponseModeType.java b/src/main/java/com/adyen/model/clouddevice/ResponseModeType.java new file mode 100644 index 000000000..89e8898e3 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ResponseModeType.java @@ -0,0 +1,53 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of response mode. */ +public enum ResponseModeType { + + /** The Message Response is not required, except in case of error. */ + @Schema(description = "The Message Response is not required, except in case of error.") + NOT_REQUIRED("NotRequired"), + + /** The Message Response is immediate, after taking into account the request. */ + @Schema(description = "The Message Response is immediate, after taking into account the request.") + IMMEDIATE("Immediate"), + + /** The Print Response is required at the end of print. */ + @Schema(description = "The Print Response is required at the end of print.") + PRINT_END("PrintEnd"), + + /** The Sound Response is required at the end of play. */ + @Schema(description = "The Sound Response is required at the end of play.") + SOUND_END("SoundEnd"); + + private final String value; + + ResponseModeType(String v) { + value = v; + } + + /** + * Returns the string representation of the ResponseModeType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a ResponseModeType from a string value. + * + * @param v the string value + * @return the corresponding ResponseModeType + */ + @JsonCreator + public static ResponseModeType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ResultType.java b/src/main/java/com/adyen/model/clouddevice/ResultType.java new file mode 100644 index 000000000..f4ff4da46 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ResultType.java @@ -0,0 +1,59 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of result. */ +public enum ResultType { + + /** + * Processing OK. Information related to the result of the processing is contained in other parts + * of the response messageType. + */ + @Schema( + description = + "Processing OK. Information related to the result of the processing is contained in other parts of the response message.") + SUCCESS("Success"), + + /** ErrorCondition */ + @Schema(description = "ErrorCondition") + FAILURE("Failure"), + + /** + * The transaction has been processed successfully, but the success is not complete (e.g. only a + * partial amount is available for the payment, the format to be + */ + @Schema( + description = + "The transaction has been processed successfully, but the success is not complete (e.g. only a partial amount is available for the payment, the format to be") + PARTIAL("Partial"); + + private final String value; + + ResultType(String v) { + value = v; + } + + /** + * Returns the string representation of the ResultType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a ResultType from a string value. + * + * @param v the string value + * @return the corresponding ResultType + */ + @JsonCreator + public static ResultType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ReversalReasonType.java b/src/main/java/com/adyen/model/clouddevice/ReversalReasonType.java new file mode 100644 index 000000000..128559908 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ReversalReasonType.java @@ -0,0 +1,53 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of reversal reason. */ +public enum ReversalReasonType { + + /** Customer cancellation */ + @Schema(description = "Customer cancellation") + CUST_CANCEL("CustCancel"), + + /** Cashier cancellation */ + @Schema(description = "Cashier cancellation") + MERCHANT_CANCEL("MerchantCancel"), + + /** Suspected malfunction */ + @Schema(description = "Suspected malfunction") + MALFUNCTION("Malfunction"), + + /** Card acceptor device unable to complete transaction */ + @Schema(description = "Card acceptor device unable to complete transaction") + UNABLE_2_COMPL("Unable2Compl"); + + private final String value; + + ReversalReasonType(String v) { + value = v; + } + + /** + * Returns the string representation of the ReversalReasonType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a ReversalReasonType from a string value. + * + * @param v the string value + * @return the corresponding ReversalReasonType + */ + @JsonCreator + public static ReversalReasonType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ReversalRequest.java b/src/main/java/com/adyen/model/clouddevice/ReversalRequest.java new file mode 100644 index 000000000..bcd35b861 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ReversalRequest.java @@ -0,0 +1,153 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +/** Content of the Reversal Request message. */ +@JsonPropertyOrder({ + "OriginalPOITransaction", + "CustomerOrderID", + "SaleReferenceID", + "ReversalReason", + "ReversedAmount", + "SaleData" +}) +public class ReversalRequest { + + @JsonProperty("OriginalPOITransaction") + @Schema(description = "Identification of a previous POI transaction.") + protected OriginalPOITransaction originalPOITransaction; + + @JsonProperty("CustomerOrderID") + @Schema(description = "If the reversal is performed inside a customer order.") + protected CustomerOrder customerOrderID; + + @JsonProperty("SaleReferenceID") + @Schema( + description = + "Identification of a Sale global transaction for a sequence of related POI transactions --Rule: If payment reservation reversal") + protected String saleReferenceID; + + @JsonProperty("ReversalReason") + @Schema(description = "Reason of the payment or loyalty reversal..") + protected ReversalReasonType reversalReason; + + @JsonProperty("ReversedAmount") + @Schema( + description = + "Amount of the payment or loyalty to reverse.. --Rule: ReversedAmount is implicitely the AuthorizedAmount if absent.") + protected BigDecimal reversedAmount; + + @JsonProperty("SaleData") + protected SaleData saleData; + + /** + * Gets original poi transaction. + * + * @return the original poi transaction + */ + public OriginalPOITransaction getOriginalPOITransaction() { + return originalPOITransaction; + } + + /** + * Sets original poi transaction. + * + * @param originalPOITransaction the original poi transaction + */ + public void setOriginalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + } + + /** + * Gets customer order id. + * + * @return the customer order id + */ + public CustomerOrder getCustomerOrderID() { + return customerOrderID; + } + + /** + * Sets customer order id. + * + * @param customerOrderID the customer order id + */ + public void setCustomerOrderID(CustomerOrder customerOrderID) { + this.customerOrderID = customerOrderID; + } + + /** + * Gets sale reference id. + * + * @return the sale reference id + */ + public String getSaleReferenceID() { + return saleReferenceID; + } + + /** + * Sets sale reference id. + * + * @param saleReferenceID the sale reference id + */ + public void setSaleReferenceID(String saleReferenceID) { + this.saleReferenceID = saleReferenceID; + } + + /** + * Gets reversal reason. + * + * @return the reversal reason + */ + public ReversalReasonType getReversalReason() { + return reversalReason; + } + + /** + * Sets reversal reason. + * + * @param reversalReason the reversal reason + */ + public void setReversalReason(ReversalReasonType reversalReason) { + this.reversalReason = reversalReason; + } + + /** + * Gets reversed amount. + * + * @return the reversed amount + */ + public BigDecimal getReversedAmount() { + return reversedAmount; + } + + /** + * Sets reversed amount. + * + * @param reversedAmount the reversed amount + */ + public void setReversedAmount(BigDecimal reversedAmount) { + this.reversedAmount = reversedAmount; + } + + /** + * Gets sale data. + * + * @return the sale data + */ + public SaleData getSaleData() { + return saleData; + } + + /** + * Sets sale data. + * + * @param saleData the sale data + */ + public void setSaleData(SaleData saleData) { + this.saleData = saleData; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ReversalResponse.java b/src/main/java/com/adyen/model/clouddevice/ReversalResponse.java new file mode 100644 index 000000000..4c612ef14 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ReversalResponse.java @@ -0,0 +1,161 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** Content of the Reversal Response message. */ +@JsonPropertyOrder({ + "Response", + "POIData", + "OriginalPOITransaction", + "PaymentReceipt", + "ReversedAmount", + "CustomerOrderID" +}) +public class ReversalResponse { + + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + @JsonProperty("POIData") + @Schema(description = "Data related to the POI System. --Rule: If Result is Success") + protected POIData poiData; + + @JsonProperty("OriginalPOITransaction") + @Schema( + description = + "Identification of a previous POI transaction. --Rule: Present if POITransactionID absent in the request") + protected OriginalPOITransaction originalPOITransaction; + + @JsonProperty("PaymentReceipt") + @Schema( + description = + "Customer or Merchant payment receipt. --Rule: If Basic profile implementation with no printer on the POI.") + protected List paymentReceipt; + + @JsonProperty("ReversedAmount") + @Schema(description = "Amount of the payment or loyalty to reverse.. --Rule: Copy") + protected BigDecimal reversedAmount; + + @JsonProperty("CustomerOrderID") + @Schema( + description = + "Customer order attached to a card, recorded in the POI system. --Rule: If the reversal is performed inside a customer order.") + protected String customerOrderID; + + /** + * Gets response. + * + * @return the response + */ + public Response getResponse() { + return response; + } + + /** + * Sets response. + * + * @param response the response + */ + public void setResponse(Response response) { + this.response = response; + } + + /** + * Gets poi data. + * + * @return the poi data + */ + public POIData getPOIData() { + return poiData; + } + + /** + * Sets poi data. + * + * @param poiData the poi data + */ + public void setPOIData(POIData poiData) { + this.poiData = poiData; + } + + /** + * Gets original poi transaction. + * + * @return the original poi transaction + */ + public OriginalPOITransaction getOriginalPOITransaction() { + return originalPOITransaction; + } + + /** + * Sets original poi transaction. + * + * @param originalPOITransaction the original poi transaction + */ + public void setOriginalPOITransaction(OriginalPOITransaction originalPOITransaction) { + this.originalPOITransaction = originalPOITransaction; + } + + /** + * Gets payment receipt. + * + * @return the payment receipt + */ + public List getPaymentReceipt() { + if (paymentReceipt == null) { + paymentReceipt = new ArrayList<>(); + } + return this.paymentReceipt; + } + + /** + * Sets payment receipt. + * + * @param paymentReceipt the payment receipt + */ + public void setPaymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + } + + /** + * Gets reversed amount. + * + * @return the reversed amount + */ + public BigDecimal getReversedAmount() { + return reversedAmount; + } + + /** + * Sets reversed amount. + * + * @param reversedAmount the reversed amount + */ + public void setReversedAmount(BigDecimal reversedAmount) { + this.reversedAmount = reversedAmount; + } + + /** + * Gets customer order id. + * + * @return the customer order id + */ + public String getCustomerOrderID() { + return customerOrderID; + } + + /** + * Sets customer order id. + * + * @param customerOrderID the customer order id + */ + public void setCustomerOrderID(String customerOrderID) { + this.customerOrderID = customerOrderID; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleCapabilitiesType.java b/src/main/java/com/adyen/model/clouddevice/SaleCapabilitiesType.java new file mode 100644 index 000000000..fce713c5f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleCapabilitiesType.java @@ -0,0 +1,136 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +/** Type of sale capabilities. */ +public enum SaleCapabilitiesType { + + /** + * To display to the Cashier a new state on which the POI is entering. For instance, during a + * payment, the POI could display to the Cashier that POI request an + */ + @Schema( + description = + "To display to the Cashier a new state on which the POI is entering. For instance, during a payment, the POI could display to the Cashier that POI request an") + CASHIER_STATUS("CashierStatus"), + + /** To display to the Cashier information related to an error situation occurring on the POI. */ + @Schema( + description = + "To display to the Cashier information related to an error situation occurring on the POI.") + CASHIER_ERROR("CashierError"), + + /** Standard Cashier display interface (to ask question, or to show information). */ + @Schema( + description = "Standard Cashier display interface (to ask question, or to show information).") + CASHIER_DISPLAY("CashierDisplay"), + + /** Information displayed on the Cardholder POI interface, replicated on the Cashier interface. */ + @Schema( + description = + "Information displayed on the Cardholder POI interface, replicated on the Cashier interface.") + POI_REPLICATION("POIReplication"), + + /** + * Any kind of keyboard allowing all or part of the commands of the Input messageType request from + * the Sale System to the POI System (InputCommand data element). The + */ + @Schema( + description = + "Any kind of keyboard allowing all or part of the commands of the Input message request from the Sale System to the POI System (InputCommand data element). The") + CASHIER_INPUT("CashierInput"), + + /** + * Input of the Cardholder POI interface which can be entered by the Cashier to assist the + * Customer. + */ + @Schema( + description = + "Input of the Cardholder POI interface which can be entered by the Cashier to assist the Customer.") + CUSTOMER_ASSISTANCE("CustomerAssistance"), + + /** + * Standard Customer display interface used by the POI System to ask question, or to show + * information to the Customer inside a Service dialogue. + */ + @Schema( + description = + "Standard Customer display interface used by the POI System to ask question, or to show information to the Customer inside a Service dialogue.") + CUSTOMER_DISPLAY("CustomerDisplay"), + + /** + * To display to the Customer information is related to an error situation occurring on the Sale + * Terminal during a Sale transaction. + */ + @Schema( + description = + "To display to the Customer information is related to an error situation occurring on the Sale Terminal during a Sale transaction.") + CUSTOMER_ERROR("CustomerError"), + + /** + * Any kind of keyboard allowing all or part of the commands of the Input messageType request from + * the Sale System to the POI System (InputCommand data element). The + */ + @Schema( + description = + "Any kind of keyboard allowing all or part of the commands of the Input message request from the Sale System to the POI System (InputCommand data element). The") + CUSTOMER_INPUT("CustomerInput"), + + /** Printer for the Payment receipt. */ + @Schema(description = "Printer for the Payment receipt.") + PRINTER_RECEIPT("PrinterReceipt"), + + /** + * When the POI System wants to print specific document (check, dynamic currency conversion ...). + */ + @Schema( + description = + "When the POI System wants to print specific document (check, dynamic currency conversion ...). ") + PRINTER_DOCUMENT("PrinterDocument"), + + /** Coupons, voucher or special ticket generated by the POI and to be printed. */ + @Schema( + description = "Coupons, voucher or special ticket generated by the POI and to be printed.") + PRINTER_VOUCHER("PrinterVoucher"), + + /** Magnetic stripe card reader */ + @Schema(description = "Magnetic stripe card reader") + MAG_STRIPE("MagStripe"), + + /** Contact ICC card reader */ + ICC("ICC"), + + /** Contactless card reader with EMV applications */ + @Schema(description = "Contactless card reader with EMV applications") + EMV_CONTACTLESS("EMVContactless"); + + private final String value; + + SaleCapabilitiesType(String v) { + value = v; + } + + /** + * Returns the string representation of the SaleCapabilitiesType. + * + * @return the string value + */ + @JsonValue + public String value() { + return value; + } + + /** + * Creates a SaleCapabilitiesType from a string value. + * + * @param v the string value + * @return the corresponding SaleCapabilitiesType + */ + @JsonCreator + public static SaleCapabilitiesType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleData.java b/src/main/java/com/adyen/model/clouddevice/SaleData.java new file mode 100644 index 000000000..fba8944ad --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleData.java @@ -0,0 +1,359 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Data related to the Sale System. */ +@JsonPropertyOrder({ + "SaleTransactionID", + "SaleTerminalData", + "SponsoredMerchant", + "SaleToPOIData", + "SaleToAcquirerData", + "SaleToIssuerData", + "OperatorID", + "OperatorLanguage", + "ShiftNumber", + "SaleReferenceID", + "TokenRequestedType", + "CustomerOrderID", + "CustomerOrderReq" +}) +public class SaleData { + + @JsonProperty("SaleTransactionID") + @Schema(description = "Unique identification of a Sale transaction") + protected TransactionIdentification saleTransactionID; + + @JsonProperty("SaleTerminalData") + @Schema( + description = + "Information related to the software and hardware feature of the Sale Terminal. --Rule: If content is not empty") + protected SaleTerminalData saleTerminalData; + + @JsonProperty("SponsoredMerchant") + @Schema( + description = + "Merchant using the payment services of a payment facilitator, acting as a card acceptor. --Rule: If the merchant is a payment facilitator providing services to sponsored merchants.") + protected List sponsoredMerchant; + + @JsonProperty("SaleToPOIData") + @Schema( + description = "Sale information intended for the POI. --Rule: Stored with the transaction") + protected String saleToPOIData; + + @JsonProperty("SaleToAcquirerData") + @Schema( + description = + "Sale information intended for the Acquirer. --Rule: Send to the Acquirer if present") + protected SaleToAcquirerData saleToAcquirerData; + + @JsonProperty("SaleToIssuerData") + @Schema( + description = + "Sale information intended for the Issuer. --Rule: Send to the Acquirer if present") + protected SaleToIssuerData saleToIssuerData; + + @JsonProperty("OperatorID") + @Schema( + description = + "Identification of the Cashier or Operator. --Rule: if different from the Login and see Login .SaleData") + protected String operatorID; + + @JsonProperty("OperatorLanguage") + @Schema(description = "Language of the Cashier or Operator. --Rule: if different from the Login") + protected String operatorLanguage; + + @JsonProperty("ShiftNumber") + @Schema( + description = "Shift number. --Rule: if different from the Login and see Login .SaleData") + protected String shiftNumber; + + @JsonProperty("SaleReferenceID") + @Schema( + description = + "Identification of a Sale global transaction for a sequence of related POI transactions --Rule: If payment reservation") + protected String saleReferenceID; + + @JsonProperty("TokenRequestedType") + @Schema( + description = + "Type of token replacing the PAN of a payment card to identify the payment mean of the customer. --Rule: In a Payment or CardAcquisition request, if a token is requested.") + protected TokenRequestedType tokenRequestedType; + + @JsonProperty("CustomerOrderID") + @Schema( + description = + "Identification of a customer order. --Rule: If the payment is related to an open customer order.") + protected String customerOrderID; + + @JsonProperty("CustomerOrderReq") + @Schema( + description = + "List of customer orders must be sent in response message. --Rule: If customer orders must be listed in the response message.") + protected List customerOrderReq; + + /** + * Gets sale transaction id. + * + * @return the sale transaction id + */ + public TransactionIdentification getSaleTransactionID() { + return saleTransactionID; + } + + /** + * Sets sale transaction id. + * + * @param saleTransactionID the sale transaction id + */ + public void setSaleTransactionID(TransactionIdentification saleTransactionID) { + this.saleTransactionID = saleTransactionID; + } + + /** + * Gets sale terminal data. + * + * @return the sale terminal data + */ + public SaleTerminalData getSaleTerminalData() { + return saleTerminalData; + } + + /** + * Sets sale terminal data. + * + * @param saleTerminalData the sale terminal data + */ + public void setSaleTerminalData(SaleTerminalData saleTerminalData) { + this.saleTerminalData = saleTerminalData; + } + + /** + * Gets sponsored merchant. + * + * @return the sponsored merchant + */ + public List getSponsoredMerchant() { + if (sponsoredMerchant == null) { + sponsoredMerchant = new ArrayList<>(); + } + return this.sponsoredMerchant; + } + + /** + * Sets sponsored merchant. + * + * @param sponsoredMerchant the sponsored merchant + */ + public void setSponsoredMerchant(List sponsoredMerchant) { + this.sponsoredMerchant = sponsoredMerchant; + } + + /** + * Gets sale to poi data. + * + * @return the sale to poi data + */ + public String getSaleToPOIData() { + return saleToPOIData; + } + + /** + * Sets sale to poi data. + * + * @param saleToPOIData the sale to poi data + */ + public void setSaleToPOIData(String saleToPOIData) { + this.saleToPOIData = saleToPOIData; + } + + /** + * Gets sale to acquirer data. + * + * @return the sale to acquirer data + */ + public SaleToAcquirerData getSaleToAcquirerData() { + return saleToAcquirerData; + } + + /** + * Sets sale to acquirer data. + * + * @param saleToAcquirerData the sale to acquirer data + */ + public void setSaleToAcquirerData(SaleToAcquirerData saleToAcquirerData) { + this.saleToAcquirerData = saleToAcquirerData; + } + + /** + * Gets sale to issuer data. + * + * @return the sale to issuer data + */ + public SaleToIssuerData getSaleToIssuerData() { + return saleToIssuerData; + } + + /** + * Sets sale to issuer data. + * + * @param saleToIssuerData the sale to issuer data + */ + public void setSaleToIssuerData(SaleToIssuerData saleToIssuerData) { + this.saleToIssuerData = saleToIssuerData; + } + + /** + * Gets operator id. + * + * @return the operator id + */ + public String getOperatorID() { + return operatorID; + } + + /** + * Sets operator id. + * + * @param operatorID the operator id + */ + public void setOperatorID(String operatorID) { + this.operatorID = operatorID; + } + + /** + * Gets operator language. + * + * @return the operator language + */ + public String getOperatorLanguage() { + return operatorLanguage; + } + + /** + * Sets operator language. + * + * @param operatorLanguage the operator language + */ + public void setOperatorLanguage(String operatorLanguage) { + this.operatorLanguage = operatorLanguage; + } + + /** + * Gets shift number. + * + * @return the shift number + */ + public String getShiftNumber() { + return shiftNumber; + } + + /** + * Sets shift number. + * + * @param shiftNumber the shift number + */ + public void setShiftNumber(String shiftNumber) { + this.shiftNumber = shiftNumber; + } + + /** + * Gets sale reference id. + * + * @return the sale reference id + */ + public String getSaleReferenceID() { + return saleReferenceID; + } + + /** + * Sets sale reference id. + * + * @param saleReferenceID the sale reference id + */ + public void setSaleReferenceID(String saleReferenceID) { + this.saleReferenceID = saleReferenceID; + } + + /** + * Gets token requested type. + * + * @return the token requested type + */ + public TokenRequestedType getTokenRequestedType() { + return tokenRequestedType; + } + + /** + * Sets token requested type. + * + * @param tokenRequestedType the token requested type + */ + public void setTokenRequestedType(TokenRequestedType tokenRequestedType) { + this.tokenRequestedType = tokenRequestedType; + } + + /** + * Gets customer order id. + * + * @return the customer order id + */ + public String getCustomerOrderID() { + return customerOrderID; + } + + /** + * Sets customer order id. + * + * @param customerOrderID the customer order id + */ + public void setCustomerOrderID(String customerOrderID) { + this.customerOrderID = customerOrderID; + } + + /** + * Gets customer order req. + * + * @return the customer order req + */ + public List getCustomerOrderReq() { + if (customerOrderReq == null) { + customerOrderReq = new ArrayList<>(); + } + return this.customerOrderReq; + } + + /** + * Sets customer order req. + * + * @param customerOrderReq the customer order req + */ + public void setCustomerOrderReq(List customerOrderReq) { + this.customerOrderReq = customerOrderReq; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("SaleData{"); + sb.append("saleTransactionID=").append(saleTransactionID); + sb.append(", saleTerminalData=").append(saleTerminalData); + sb.append(", sponsoredMerchant=").append(sponsoredMerchant); + sb.append(", saleToPOIData='").append(saleToPOIData).append('\''); + sb.append(", saleToAcquirerData=").append(saleToAcquirerData); + sb.append(", saleToIssuerData=").append(saleToIssuerData); + sb.append(", operatorID='").append(operatorID).append('\''); + sb.append(", operatorLanguage='").append(operatorLanguage).append('\''); + sb.append(", shiftNumber='").append(shiftNumber).append('\''); + sb.append(", saleReferenceID='").append(saleReferenceID).append('\''); + sb.append(", tokenRequestedType=").append(tokenRequestedType); + sb.append(", customerOrderID='").append(customerOrderID).append('\''); + sb.append(", customerOrderReq=").append(customerOrderReq); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleItem.java b/src/main/java/com/adyen/model/clouddevice/SaleItem.java new file mode 100644 index 000000000..f64c1e3a9 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleItem.java @@ -0,0 +1,276 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** Sale items of a transaction. */ +@JsonPropertyOrder({ + "UnitOfMeasure", + "Quantity", + "UnitPrice", + "TaxCode", + "SaleChannel", + "ProductLabel", + "AdditionalProductInfo", + "ItemID", + "ProductCode", + "EanUpc", + "ItemAmount" +}) +public class SaleItem { + + @JsonProperty("UnitOfMeasure") + @Schema(description = "Unit of measure of a quantity --Rule: if Quantity present") + protected UnitOfMeasureType unitOfMeasure; + + @JsonProperty("Quantity") + @Schema( + description = + "Product quantity --Rule: If data sent, POI has to store it and send it if the host protocol allows it") + protected BigDecimal quantity; + + @JsonProperty("UnitPrice") + @Schema(description = "Price per unit of product --Rule: if Quantity present") + protected BigDecimal unitPrice; + + @JsonProperty("TaxCode") + @Schema( + description = + "Type of taxes associated to the line item. --Rule: If data sent, POI has to store it and send it if the host protocol allows it") + protected String taxCode; + + @JsonProperty("SaleChannel") + @Schema( + description = + "Commercial or distribution channel associated to the line item. --Rule: If data sent, POI has to store it and send it if the host protocol allows it") + protected String saleChannel; + + @JsonProperty("ProductLabel") + @Schema(description = "Product name of an item purchased with the transaction.") + protected String productLabel; + + @JsonProperty("AdditionalProductInfo") + @Schema( + description = + "Additionl information related to the line item. --Rule: If data sent, POI has to store it and send it if the host protocol allows it") + protected String additionalProductInfo; + + @JsonProperty("ItemID") + @Schema(description = "Item identification inside a transaction (0 to n).") + protected BigInteger itemID; + + @JsonProperty("ProductCode") + @Schema(description = "Product code of item purchased with the transaction.") + protected String productCode; + + @JsonProperty("EanUpc") + @Schema( + description = + "Standard product code of item purchased with the transaction. --Rule: If data sent, POI has to store it and send it if the host protocol allows it") + protected String eanUpc; + + @JsonProperty("ItemAmount") + @Schema(description = "Total amount of the item line.") + protected BigDecimal itemAmount; + + /** + * Gets unit of measure. + * + * @return the unit of measure + */ + public UnitOfMeasureType getUnitOfMeasure() { + return unitOfMeasure; + } + + /** + * Sets unit of measure. + * + * @param unitOfMeasure the unit of measure + */ + public void setUnitOfMeasure(UnitOfMeasureType unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + } + + /** + * Gets quantity. + * + * @return the quantity + */ + public BigDecimal getQuantity() { + return quantity; + } + + /** + * Sets quantity. + * + * @param quantity the quantity + */ + public void setQuantity(BigDecimal quantity) { + this.quantity = quantity; + } + + /** + * Gets unit price. + * + * @return the unit price + */ + public BigDecimal getUnitPrice() { + return unitPrice; + } + + /** + * Sets unit price. + * + * @param unitPrice the unit price + */ + public void setUnitPrice(BigDecimal unitPrice) { + this.unitPrice = unitPrice; + } + + /** + * Gets tax code. + * + * @return the tax code + */ + public String getTaxCode() { + return taxCode; + } + + /** + * Sets tax code. + * + * @param taxCode the tax code + */ + public void setTaxCode(String taxCode) { + this.taxCode = taxCode; + } + + /** + * Gets sale channel. + * + * @return the sale channel + */ + public String getSaleChannel() { + return saleChannel; + } + + /** + * Sets sale channel. + * + * @param saleChannel the sale channel + */ + public void setSaleChannel(String saleChannel) { + this.saleChannel = saleChannel; + } + + /** + * Gets product label. + * + * @return the product label + */ + public String getProductLabel() { + return productLabel; + } + + /** + * Sets product label. + * + * @param productLabel the product label + */ + public void setProductLabel(String productLabel) { + this.productLabel = productLabel; + } + + /** + * Gets additional product info. + * + * @return the additional product info + */ + public String getAdditionalProductInfo() { + return additionalProductInfo; + } + + /** + * Sets additional product info. + * + * @param additionalProductInfo the additional product info + */ + public void setAdditionalProductInfo(String additionalProductInfo) { + this.additionalProductInfo = additionalProductInfo; + } + + /** + * Gets item id. + * + * @return the item id + */ + public BigInteger getItemID() { + return itemID; + } + + /** + * Sets item id. + * + * @param itemID the item id + */ + public void setItemID(BigInteger itemID) { + this.itemID = itemID; + } + + /** + * Gets product code. + * + * @return the product code + */ + public String getProductCode() { + return productCode; + } + + /** + * Sets product code. + * + * @param productCode the product code + */ + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + /** + * Gets ean upc. + * + * @return the ean upc + */ + public String getEanUpc() { + return eanUpc; + } + + /** + * Sets ean upc. + * + * @param eanUpc the ean upc + */ + public void setEanUpc(String eanUpc) { + this.eanUpc = eanUpc; + } + + /** + * Gets item amount. + * + * @return the item amount + */ + public BigDecimal getItemAmount() { + return itemAmount; + } + + /** + * Sets item amount. + * + * @param itemAmount the item amount + */ + public void setItemAmount(BigDecimal itemAmount) { + this.itemAmount = itemAmount; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleItemRebate.java b/src/main/java/com/adyen/model/clouddevice/SaleItemRebate.java new file mode 100644 index 000000000..52e519105 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleItemRebate.java @@ -0,0 +1,178 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; +import java.math.BigInteger; + +/** The awarded amount that is attached to an item as a rebate. */ +@JsonPropertyOrder({ + "UnitOfMeasure", + "Quantity", + "RebateLabel", + "ItemID", + "ProductCode", + "EanUpc", + "ItemAmount" +}) +public class SaleItemRebate { + + @JsonProperty("UnitOfMeasure") + @Schema(description = "Unit of measure of a quantity --Rule: if Quantity present") + protected UnitOfMeasureType unitOfMeasure; + + @JsonProperty("Quantity") + @Schema(description = "Product quantity --Rule: if rebate is additional units") + protected BigDecimal quantity; + + @JsonProperty("RebateLabel") + @Schema( + description = + "Short text to qualify a rebate on an line item. --Rule: If provided by the Acquirer") + protected String rebateLabel; + + @JsonProperty("ItemID") + @Schema(description = "Item identification inside a transaction (0 to n).") + protected BigInteger itemID; + + @JsonProperty("ProductCode") + @Schema(description = "Product code of item purchased with the transaction.") + protected String productCode; + + @JsonProperty("EanUpc") + @Schema( + description = + "Standard product code of item purchased with the transaction. --Rule: if present in the related SaleItem") + protected String eanUpc; + + @JsonProperty("ItemAmount") + @Schema(description = "Total amount of the item line. --Rule: if rebate on the line item amount") + protected BigDecimal itemAmount; + + /** + * Gets unit of measure. + * + * @return the unit of measure + */ + public UnitOfMeasureType getUnitOfMeasure() { + return unitOfMeasure; + } + + /** + * Sets unit of measure. + * + * @param unitOfMeasure the unit of measure + */ + public void setUnitOfMeasure(UnitOfMeasureType unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + } + + /** + * Gets quantity. + * + * @return the quantity + */ + public BigDecimal getQuantity() { + return quantity; + } + + /** + * Sets quantity. + * + * @param quantity the quantity + */ + public void setQuantity(BigDecimal quantity) { + this.quantity = quantity; + } + + /** + * Gets rebate label. + * + * @return the rebate label + */ + public String getRebateLabel() { + return rebateLabel; + } + + /** + * Sets rebate label. + * + * @param rebateLabel the rebate label + */ + public void setRebateLabel(String rebateLabel) { + this.rebateLabel = rebateLabel; + } + + /** + * Gets item id. + * + * @return the item id + */ + public BigInteger getItemID() { + return itemID; + } + + /** + * Sets item id. + * + * @param itemID the item id + */ + public void setItemID(BigInteger itemID) { + this.itemID = itemID; + } + + /** + * Gets product code. + * + * @return the product code + */ + public String getProductCode() { + return productCode; + } + + /** + * Sets product code. + * + * @param productCode the product code + */ + public void setProductCode(String productCode) { + this.productCode = productCode; + } + + /** + * Gets ean upc. + * + * @return the ean upc + */ + public String getEanUpc() { + return eanUpc; + } + + /** + * Sets ean upc. + * + * @param eanUpc the ean upc + */ + public void setEanUpc(String eanUpc) { + this.eanUpc = eanUpc; + } + + /** + * Gets item amount. + * + * @return the item amount + */ + public BigDecimal getItemAmount() { + return itemAmount; + } + + /** + * Sets item amount. + * + * @param itemAmount the item amount + */ + public void setItemAmount(BigDecimal itemAmount) { + this.itemAmount = itemAmount; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleProfile.java b/src/main/java/com/adyen/model/clouddevice/SaleProfile.java new file mode 100644 index 000000000..4773c7e56 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleProfile.java @@ -0,0 +1,65 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Functional profile of the Sale Terminal. */ +@JsonPropertyOrder({"ServiceProfiles", "GenericProfile"}) +public class SaleProfile { + + @JsonProperty("ServiceProfiles") + @Schema( + description = + "Service profiles of the Sale to POI protocol. --Rule: If a service profile could be requested") + protected List serviceProfiles; + + @JsonProperty("GenericProfile") + @Schema(description = "Functional profile of the Sale to POI protocol.") + protected GenericProfileType genericProfile; + + /** + * Gets service profiles. + * + * @return the service profiles + */ + public List getServiceProfiles() { + if (serviceProfiles == null) { + serviceProfiles = new ArrayList<>(); + } + return this.serviceProfiles; + } + + /** + * Sets service profiles. + * + * @param serviceProfiles the service profiles + */ + public void setServiceProfiles(List serviceProfiles) { + this.serviceProfiles = serviceProfiles; + } + + /** + * Gets generic profile. + * + * @return the generic profile + */ + public GenericProfileType getGenericProfile() { + if (genericProfile == null) { + return GenericProfileType.STANDARD; + } else { + return genericProfile; + } + } + + /** + * Sets generic profile. + * + * @param genericProfile the generic profile + */ + public void setGenericProfile(GenericProfileType genericProfile) { + this.genericProfile = genericProfile; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleSoftware.java b/src/main/java/com/adyen/model/clouddevice/SaleSoftware.java new file mode 100644 index 000000000..bd5a97fa6 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleSoftware.java @@ -0,0 +1,101 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * Information related to the software of the Sale System which manages the Sale to POI protocol. + */ +@JsonPropertyOrder({"ManufacturerID", "ApplicationName", "SoftwareVersion", "CertificationCode"}) +public class SaleSoftware { + + @JsonProperty("ManufacturerID") + @Schema(description = "Identification of the Manufacturer") + protected String manufacturerID; + + @JsonProperty("ApplicationName") + @Schema(description = "Name of the software product.") + protected String applicationName; + + @JsonProperty("SoftwareVersion") + @Schema(description = "Version of the software product") + protected String softwareVersion; + + @JsonProperty("CertificationCode") + @Schema( + description = "Certification code of the software which manages the Sale to POI protocol.") + protected String certificationCode; + + /** + * Gets manufacturer id. + * + * @return the manufacturer id + */ + public String getManufacturerID() { + return manufacturerID; + } + + /** + * Sets manufacturer id. + * + * @param manufacturerID the manufacturer id + */ + public void setManufacturerID(String manufacturerID) { + this.manufacturerID = manufacturerID; + } + + /** + * Gets application name. + * + * @return the application name + */ + public String getApplicationName() { + return applicationName; + } + + /** + * Sets application name. + * + * @param applicationName the application name + */ + public void setApplicationName(String applicationName) { + this.applicationName = applicationName; + } + + /** + * Gets software version. + * + * @return the software version + */ + public String getSoftwareVersion() { + return softwareVersion; + } + + /** + * Sets software version. + * + * @param softwareVersion the software version + */ + public void setSoftwareVersion(String softwareVersion) { + this.softwareVersion = softwareVersion; + } + + /** + * Gets certification code. + * + * @return the certification code + */ + public String getCertificationCode() { + return certificationCode; + } + + /** + * Sets certification code. + * + * @param certificationCode the certification code + */ + public void setCertificationCode(String certificationCode) { + this.certificationCode = certificationCode; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleTerminalData.java b/src/main/java/com/adyen/model/clouddevice/SaleTerminalData.java new file mode 100644 index 000000000..5b7efe767 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleTerminalData.java @@ -0,0 +1,119 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Information related to the software and hardware feature of the Sale Terminal. */ +@JsonPropertyOrder({"SaleCapabilities", "SaleProfile", "TerminalEnvironment", "TotalsGroupID"}) +public class SaleTerminalData { + + @JsonProperty("SaleCapabilities") + @Schema(description = "Hardware capabilities of the Sale Terminal.") + protected List saleCapabilities; + + @JsonProperty("SaleProfile") + @Schema( + description = + "Functional profile of the Sale Terminal. --Rule: If at least one element is present") + protected SaleProfile saleProfile; + + @JsonProperty("TerminalEnvironment") + @Schema(description = "Environment of the Terminal.") + protected TerminalEnvironmentType terminalEnvironment; + + @JsonProperty("TotalsGroupID") + @Schema( + description = + "Identification of a group of transaction on a POI Terminal, having the same Sale features. --Rule: If present, default value for all transaction.") + protected String totalsGroupID; + + /** + * Gets sale capabilities. + * + * @return the sale capabilities + */ + public List getSaleCapabilities() { + if (saleCapabilities == null) { + saleCapabilities = new ArrayList<>(); + } + return this.saleCapabilities; + } + + /** + * Sets sale capabilities. + * + * @param saleCapabilities the sale capabilities + */ + public void setSaleCapabilities(List saleCapabilities) { + this.saleCapabilities = saleCapabilities; + } + + /** + * Gets sale profile. + * + * @return the sale profile + */ + public SaleProfile getSaleProfile() { + return saleProfile; + } + + /** + * Sets sale profile. + * + * @param saleProfile the sale profile + */ + public void setSaleProfile(SaleProfile saleProfile) { + this.saleProfile = saleProfile; + } + + /** + * Gets terminal environment. + * + * @return the terminal environment + */ + public TerminalEnvironmentType getTerminalEnvironment() { + return terminalEnvironment; + } + + /** + * Sets terminal environment. + * + * @param terminalEnvironment the terminal environment + */ + public void setTerminalEnvironment(TerminalEnvironmentType terminalEnvironment) { + this.terminalEnvironment = terminalEnvironment; + } + + /** + * Gets totals group id. + * + * @return the totals group id + */ + public String getTotalsGroupID() { + return totalsGroupID; + } + + /** + * Sets totals group id. + * + * @param totalsGroupID the totals group id + */ + public void setTotalsGroupID(String totalsGroupID) { + this.totalsGroupID = totalsGroupID; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("SaleTerminalData{"); + sb.append("saleCapabilities=").append(saleCapabilities); + sb.append(", saleProfile=").append(saleProfile); + sb.append(", terminalEnvironment=").append(terminalEnvironment); + sb.append(", totalsGroupID='").append(totalsGroupID).append('\''); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleToAcquirerData.java b/src/main/java/com/adyen/model/clouddevice/SaleToAcquirerData.java new file mode 100644 index 000000000..ae5a4e298 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleToAcquirerData.java @@ -0,0 +1,342 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2020 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.model.clouddevice; + +import com.adyen.model.applicationinfo.ApplicationInfo; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.annotations.SerializedName; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.Map; +import java.util.Objects; +import org.apache.commons.codec.binary.Base64; + +public class SaleToAcquirerData { + + private Map metadata; + private String shopperEmail; + private String shopperReference; + private String recurringContract; + private String shopperStatement; + private String recurringDetailName; + private String recurringTokenService; + private String store; + private String merchantAccount; + private String currency; + private ApplicationInfo applicationInfo; + private String tenderOption; + private Map additionalData; + private String authorisationType; + private String ssc; + private RecurringProcessingModelEnum recurringProcessingModel; + private String redemptionType; + private static final Gson PRETTY_PRINT_GSON = new GsonBuilder().setPrettyPrinting().create(); + + public SaleToAcquirerData() { + applicationInfo = new ApplicationInfo(); + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public String getShopperEmail() { + return shopperEmail; + } + + public void setShopperEmail(String shopperEmail) { + this.shopperEmail = shopperEmail; + } + + public String getShopperReference() { + return shopperReference; + } + + public void setShopperReference(String shopperReference) { + this.shopperReference = shopperReference; + } + + public String getRecurringContract() { + return recurringContract; + } + + public void setRecurringContract(String recurringContract) { + this.recurringContract = recurringContract; + } + + public String getShopperStatement() { + return shopperStatement; + } + + public void setShopperStatement(String shopperStatement) { + this.shopperStatement = shopperStatement; + } + + public String getRecurringDetailName() { + return recurringDetailName; + } + + public void setRecurringDetailName(String recurringDetailName) { + this.recurringDetailName = recurringDetailName; + } + + public String getRecurringTokenService() { + return recurringTokenService; + } + + public void setRecurringTokenService(String recurringTokenService) { + this.recurringTokenService = recurringTokenService; + } + + public String getStore() { + return store; + } + + public void setStore(String store) { + this.store = store; + } + + public String getMerchantAccount() { + return merchantAccount; + } + + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public ApplicationInfo getApplicationInfo() { + return applicationInfo; + } + + public void setApplicationInfo(ApplicationInfo applicationInfo) { + this.applicationInfo = applicationInfo; + } + + public String getTenderOption() { + return tenderOption; + } + + public void setTenderOption(String tenderOption) { + this.tenderOption = tenderOption; + } + + public Map getAdditionalData() { + return additionalData; + } + + public void setAdditionalData(Map additionalData) { + this.additionalData = additionalData; + } + + public String getAuthorisationType() { + return authorisationType; + } + + public void setAuthorisationType(String authorisationType) { + this.authorisationType = authorisationType; + } + + /** + * Defines a recurring payment type. Required when creating a token to store payment details or + * using stored payment details. + */ + public enum RecurringProcessingModelEnum { + @SerializedName("Subscription") + SUBSCRIPTION("Subscription"), + + @SerializedName("CardOnFile") + CARD_ON_FILE("CardOnFile"), + + @SerializedName("UnscheduledCardOnFile") + UNSCHEDULED_CARD_ON_FILE("UnscheduledCardOnFile"); + + private String value; + + RecurringProcessingModelEnum(String value) { + this.value = value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + } + + public RecurringProcessingModelEnum getRecurringProcessingModel() { + return this.recurringProcessingModel; + } + + public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { + this.recurringProcessingModel = recurringProcessingModel; + } + + public String getSsc() { + return ssc; + } + + public void setSsc(String ssc) { + this.ssc = ssc; + } + + public String getRedemptionType() { + return redemptionType; + } + + public void setRedemptionType(String redemptionType) { + this.redemptionType = redemptionType; + } + + public static Gson getPrettyPrintGson() { + return PRETTY_PRINT_GSON; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SaleToAcquirerData that = (SaleToAcquirerData) o; + return Objects.equals(metadata, that.metadata) + && Objects.equals(shopperEmail, that.shopperEmail) + && Objects.equals(shopperReference, that.shopperReference) + && Objects.equals(recurringContract, that.recurringContract) + && Objects.equals(shopperStatement, that.shopperStatement) + && Objects.equals(recurringDetailName, that.recurringDetailName) + && Objects.equals(recurringTokenService, that.recurringTokenService) + && Objects.equals(store, that.store) + && Objects.equals(merchantAccount, that.merchantAccount) + && Objects.equals(currency, that.currency) + && Objects.equals(applicationInfo, that.applicationInfo) + && Objects.equals(tenderOption, that.tenderOption) + && Objects.equals(additionalData, that.additionalData) + && Objects.equals(authorisationType, that.authorisationType) + && Objects.equals(ssc, that.ssc) + && Objects.equals(recurringProcessingModel, that.recurringProcessingModel) + && Objects.equals(redemptionType, that.redemptionType); + } + + @Override + public int hashCode() { + return Objects.hash( + metadata, + shopperEmail, + shopperReference, + recurringContract, + shopperStatement, + recurringDetailName, + recurringTokenService, + store, + merchantAccount, + currency, + applicationInfo, + tenderOption, + additionalData, + authorisationType, + ssc, + recurringProcessingModel, + redemptionType); + } + + @Override + public String toString() { + return "SaleToAcquirerDataModel{" + + "metadata=" + + metadata + + ", shopperEmail='" + + shopperEmail + + '\'' + + ", shopperReference='" + + shopperReference + + '\'' + + ", recurringContract='" + + recurringContract + + '\'' + + ", shopperStatement='" + + shopperStatement + + '\'' + + ", recurringDetailName='" + + recurringDetailName + + '\'' + + ", recurringTokenService='" + + recurringTokenService + + '\'' + + ", store='" + + store + + '\'' + + ", merchantAccount='" + + merchantAccount + + '\'' + + ", currency='" + + currency + + '\'' + + ", applicationInfo=" + + applicationInfo + + ", tenderOption='" + + tenderOption + + '\'' + + ", additionalData=" + + additionalData + + ", authorisationType=" + + authorisationType + + ", ssc='" + + ssc + + '\'' + + ", recurringProcessingModel=" + + recurringProcessingModel + + '\'' + + ", redemptionType=" + + redemptionType + + '}'; + } + + public String toBase64() { + String json = PRETTY_PRINT_GSON.toJson(this); + byte[] encodedBytes = Base64.encodeBase64(json.getBytes()); + return new String(encodedBytes); + } + + public static SaleToAcquirerData fromBase64(String base64) { + byte[] decoded = Base64.decodeBase64(base64); + try (Reader reader = new InputStreamReader(new ByteArrayInputStream(decoded))) { + return PRETTY_PRINT_GSON.fromJson(reader, SaleToAcquirerData.class); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleToIssuerData.java b/src/main/java/com/adyen/model/clouddevice/SaleToIssuerData.java new file mode 100644 index 000000000..4ccf42d1a --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleToIssuerData.java @@ -0,0 +1,34 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Sale information intended for the Issuer. */ +@JsonPropertyOrder({"StatementReference"}) +public class SaleToIssuerData { + + @JsonProperty("StatementReference") + @Schema( + description = + "Label to print on the bank statement. --Rule: Information to print on the bank statement") + protected String statementReference; + + /** + * Gets statement reference. + * + * @return the statement reference + */ + public String getStatementReference() { + return statementReference; + } + + /** + * Sets statement reference. + * + * @param statementReference the statement reference + */ + public void setStatementReference(String statementReference) { + this.statementReference = statementReference; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleToPOIRequest.java b/src/main/java/com/adyen/model/clouddevice/SaleToPOIRequest.java new file mode 100644 index 000000000..8fa7fd376 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleToPOIRequest.java @@ -0,0 +1,745 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** SaleToPOIRequest */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "MessageHeader", + "AbortRequest", + "BalanceInquiryRequest", + "BatchRequest", + "CardAcquisitionRequest", + "AdminRequest", + "DiagnosisRequest", + "DisplayRequest", + "EnableServiceRequest", + "EventNotification", + "GetTotalsRequest", + "InputRequest", + "InputUpdate", + "LoginRequest", + "LogoutRequest", + "LoyaltyRequest", + "PaymentRequest", + "PINRequest", + "PrintRequest", + "CardReaderInitRequest", + "CardReaderAPDURequest", + "CardReaderPowerOffRequest", + "ReconciliationRequest", + "ReversalRequest", + "SoundRequest", + "StoredValueRequest", + "TransactionStatusRequest", + "TransmitRequest", + "SecurityTrailer" +}) +public class SaleToPOIRequest { + + /** The Message header. */ + @JsonProperty("MessageHeader") + protected MessageHeader messageHeader; + + /** The Abort request. */ + @JsonProperty("AbortRequest") + @Schema(description = "Body of the Abort Request message.") + protected AbortRequest abortRequest; + + /** The Balance inquiry request. */ + @JsonProperty("BalanceInquiryRequest") + @Schema(description = "Content of the Balance Inquiry Request message.") + protected BalanceInquiryRequest balanceInquiryRequest; + + /** The Batch request. */ + @JsonProperty("BatchRequest") + @Schema(description = "Content of the Batch Request message.") + protected BatchRequest batchRequest; + + /** The Card acquisition request. */ + @JsonProperty("CardAcquisitionRequest") + @Schema(description = "Content of the Card Acquisition Request message.") + protected CardAcquisitionRequest cardAcquisitionRequest; + + /** The Admin request. */ + @JsonProperty("AdminRequest") + @Schema(description = "Content of the Custom Admin Request message.") + protected AdminRequest adminRequest; + + /** The Diagnosis request. */ + @JsonProperty("DiagnosisRequest") + @Schema(description = "Content of the Diagnosis Request message.") + protected DiagnosisRequest diagnosisRequest; + + /** The Display request. */ + @JsonProperty("DisplayRequest") + @Schema(description = "Content of the Display Request message.") + protected DisplayRequest displayRequest; + + /** The Enable service request. */ + @JsonProperty("EnableServiceRequest") + @Schema(description = "Content of the Enable Service Request message.") + protected EnableServiceRequest enableServiceRequest; + + /** The Event notification. */ + @JsonProperty("EventNotification") + @Schema(description = "Content of the EventNotification message.") + protected EventNotification eventNotification; + + /** The Get totals request. */ + @JsonProperty("GetTotalsRequest") + @Schema(description = "Content of the Get Totals Request message.") + protected GetTotalsRequest getTotalsRequest; + + /** The Input request. */ + @JsonProperty("InputRequest") + @Schema(description = "Content of the Input Request message.") + protected InputRequest inputRequest; + + /** The Input update. */ + @JsonProperty("InputUpdate") + @Schema(description = "Content of the Input Update message.") + protected InputUpdate inputUpdate; + + /** The Login request. */ + @JsonProperty("LoginRequest") + @Schema(description = "Content of the Login Request message.") + protected LoginRequest loginRequest; + + /** The Logout request. */ + @JsonProperty("LogoutRequest") + @Schema(description = "Content of the Logout Request message.") + protected LogoutRequest logoutRequest; + + /** The Loyalty request. */ + @JsonProperty("LoyaltyRequest") + @Schema(description = "Content of the Loyalty Request message.") + protected LoyaltyRequest loyaltyRequest; + + /** The Payment request. */ + @JsonProperty("PaymentRequest") + @Schema(description = "Content of the Payment Request message.") + protected PaymentRequest paymentRequest; + + /** The Pin request. */ + @JsonProperty("PINRequest") + @Schema(description = "Content of the PIN Request message.") + protected PINRequest pinRequest; + + /** The Print request. */ + @JsonProperty("PrintRequest") + @Schema(description = "Content of the Print Request message.") + protected PrintRequest printRequest; + + /** The Card reader init request. */ + @JsonProperty("CardReaderInitRequest") + @Schema(description = "Content of the Card Reader Init Request message.") + protected CardReaderInitRequest cardReaderInitRequest; + + /** The Card reader apdu request. */ + @JsonProperty("CardReaderAPDURequest") + @Schema(description = "Content of the Card Reader APDU Request message.") + protected CardReaderAPDURequest cardReaderAPDURequest; + + /** The Card reader power off request. */ + @JsonProperty("CardReaderPowerOffRequest") + @Schema(description = "Content of the Card Reader Power-Off Request message.") + protected CardReaderPowerOffRequest cardReaderPowerOffRequest; + + /** The Reconciliation request. */ + @JsonProperty("ReconciliationRequest") + @Schema(description = "Content of the Reconciliation Request message.") + protected ReconciliationRequest reconciliationRequest; + + /** The Reversal request. */ + @JsonProperty("ReversalRequest") + @Schema(description = "Content of the Reversal Request message.") + protected ReversalRequest reversalRequest; + + /** The Sound request. */ + @JsonProperty("SoundRequest") + @Schema(description = "Content of the Sound Request message.") + protected SoundRequest soundRequest; + + /** The Stored value request. */ + @JsonProperty("StoredValueRequest") + @Schema(description = "Content of the Stored Value Request message.") + protected StoredValueRequest storedValueRequest; + + /** The Transaction status request. */ + @JsonProperty("TransactionStatusRequest") + @Schema(description = "Content of the TransactionStatus Request message.") + protected TransactionStatusRequest transactionStatusRequest; + + /** The Transmit request. */ + @JsonProperty("TransmitRequest") + @Schema(description = "Content of the Transmit Request message.") + protected TransmitRequest transmitRequest; + + /** The Security trailer. */ + @JsonProperty("SecurityTrailer") + @Schema(description = "Protection of the whole message") + protected ContentInformation securityTrailer; + + /** + * Gets the value of the messageHeader property. + * + * @return possible object is {@link MessageHeader } + */ + public MessageHeader getMessageHeader() { + return messageHeader; + } + + /** + * Sets the value of the messageHeader property. + * + * @param value allowed object is {@link MessageHeader } + */ + public void setMessageHeader(MessageHeader value) { + this.messageHeader = value; + } + + /** + * Gets the value of the abortRequest property. + * + * @return possible object is {@link AbortRequest } + */ + public AbortRequest getAbortRequest() { + return abortRequest; + } + + /** + * Sets the value of the abortRequest property. + * + * @param value allowed object is {@link AbortRequest } + */ + public void setAbortRequest(AbortRequest value) { + this.abortRequest = value; + } + + /** + * Gets the value of the balanceInquiryRequest property. + * + * @return possible object is {@link BalanceInquiryRequest } + */ + public BalanceInquiryRequest getBalanceInquiryRequest() { + return balanceInquiryRequest; + } + + /** + * Sets the value of the balanceInquiryRequest property. + * + * @param value allowed object is {@link BalanceInquiryRequest } + */ + public void setBalanceInquiryRequest(BalanceInquiryRequest value) { + this.balanceInquiryRequest = value; + } + + /** + * Gets the value of the batchRequest property. + * + * @return possible object is {@link BatchRequest } + */ + public BatchRequest getBatchRequest() { + return batchRequest; + } + + /** + * Sets the value of the batchRequest property. + * + * @param value allowed object is {@link BatchRequest } + */ + public void setBatchRequest(BatchRequest value) { + this.batchRequest = value; + } + + /** + * Gets the value of the cardAcquisitionRequest property. + * + * @return possible object is {@link CardAcquisitionRequest } + */ + public CardAcquisitionRequest getCardAcquisitionRequest() { + return cardAcquisitionRequest; + } + + /** + * Sets the value of the cardAcquisitionRequest property. + * + * @param value allowed object is {@link CardAcquisitionRequest } + */ + public void setCardAcquisitionRequest(CardAcquisitionRequest value) { + this.cardAcquisitionRequest = value; + } + + /** + * Gets the value of the adminRequest property. + * + * @return possible object is {@link AdminRequest } + */ + public AdminRequest getAdminRequest() { + return adminRequest; + } + + /** + * Sets the value of the adminRequest property. + * + * @param value allowed object is {@link AdminRequest } + */ + public void setAdminRequest(AdminRequest value) { + this.adminRequest = value; + } + + /** + * Gets the value of the diagnosisRequest property. + * + * @return possible object is {@link DiagnosisRequest } + */ + public DiagnosisRequest getDiagnosisRequest() { + return diagnosisRequest; + } + + /** + * Sets the value of the diagnosisRequest property. + * + * @param value allowed object is {@link DiagnosisRequest } + */ + public void setDiagnosisRequest(DiagnosisRequest value) { + this.diagnosisRequest = value; + } + + /** + * Gets the value of the displayRequest property. + * + * @return possible object is {@link DisplayRequest } + */ + public DisplayRequest getDisplayRequest() { + return displayRequest; + } + + /** + * Sets the value of the displayRequest property. + * + * @param value allowed object is {@link DisplayRequest } + */ + public void setDisplayRequest(DisplayRequest value) { + this.displayRequest = value; + } + + /** + * Gets the value of the enableServiceRequest property. + * + * @return possible object is {@link EnableServiceRequest } + */ + public EnableServiceRequest getEnableServiceRequest() { + return enableServiceRequest; + } + + /** + * Sets the value of the enableServiceRequest property. + * + * @param value allowed object is {@link EnableServiceRequest } + */ + public void setEnableServiceRequest(EnableServiceRequest value) { + this.enableServiceRequest = value; + } + + /** + * Gets the value of the eventNotification property. + * + * @return possible object is {@link EventNotification } + */ + public EventNotification getEventNotification() { + return eventNotification; + } + + /** + * Sets the value of the eventNotification property. + * + * @param value allowed object is {@link EventNotification } + */ + public void setEventNotification(EventNotification value) { + this.eventNotification = value; + } + + /** + * Gets the value of the getTotalsRequest property. + * + * @return possible object is {@link GetTotalsRequest } + */ + public GetTotalsRequest getGetTotalsRequest() { + return getTotalsRequest; + } + + /** + * Sets the value of the getTotalsRequest property. + * + * @param value allowed object is {@link GetTotalsRequest } + */ + public void setGetTotalsRequest(GetTotalsRequest value) { + this.getTotalsRequest = value; + } + + /** + * Gets the value of the inputRequest property. + * + * @return possible object is {@link InputRequest } + */ + public InputRequest getInputRequest() { + return inputRequest; + } + + /** + * Sets the value of the inputRequest property. + * + * @param value allowed object is {@link InputRequest } + */ + public void setInputRequest(InputRequest value) { + this.inputRequest = value; + } + + /** + * Gets the value of the inputUpdate property. + * + * @return possible object is {@link InputUpdate } + */ + public InputUpdate getInputUpdate() { + return inputUpdate; + } + + /** + * Sets the value of the inputUpdate property. + * + * @param value allowed object is {@link InputUpdate } + */ + public void setInputUpdate(InputUpdate value) { + this.inputUpdate = value; + } + + /** + * Gets the value of the loginRequest property. + * + * @return possible object is {@link LoginRequest } + */ + public LoginRequest getLoginRequest() { + return loginRequest; + } + + /** + * Sets the value of the loginRequest property. + * + * @param value allowed object is {@link LoginRequest } + */ + public void setLoginRequest(LoginRequest value) { + this.loginRequest = value; + } + + /** + * Gets the value of the logoutRequest property. + * + * @return possible object is {@link LogoutRequest } + */ + public LogoutRequest getLogoutRequest() { + return logoutRequest; + } + + /** + * Sets the value of the logoutRequest property. + * + * @param value allowed object is {@link LogoutRequest } + */ + public void setLogoutRequest(LogoutRequest value) { + this.logoutRequest = value; + } + + /** + * Gets the value of the loyaltyRequest property. + * + * @return possible object is {@link LoyaltyRequest } + */ + public LoyaltyRequest getLoyaltyRequest() { + return loyaltyRequest; + } + + /** + * Sets the value of the loyaltyRequest property. + * + * @param value allowed object is {@link LoyaltyRequest } + */ + public void setLoyaltyRequest(LoyaltyRequest value) { + this.loyaltyRequest = value; + } + + /** + * Gets the value of the paymentRequest property. + * + * @return possible object is {@link PaymentRequest } + */ + public PaymentRequest getPaymentRequest() { + return paymentRequest; + } + + /** + * Sets the value of the paymentRequest property. + * + * @param value allowed object is {@link PaymentRequest } + */ + public void setPaymentRequest(PaymentRequest value) { + this.paymentRequest = value; + } + + /** + * Gets the value of the pinRequest property. + * + * @return possible object is {@link PINRequest } + */ + public PINRequest getPINRequest() { + return pinRequest; + } + + /** + * Sets the value of the pinRequest property. + * + * @param value allowed object is {@link PINRequest } + */ + public void setPINRequest(PINRequest value) { + this.pinRequest = value; + } + + /** + * Gets the value of the printRequest property. + * + * @return possible object is {@link PrintRequest } + */ + public PrintRequest getPrintRequest() { + return printRequest; + } + + /** + * Sets the value of the printRequest property. + * + * @param value allowed object is {@link PrintRequest } + */ + public void setPrintRequest(PrintRequest value) { + this.printRequest = value; + } + + /** + * Gets the value of the cardReaderInitRequest property. + * + * @return possible object is {@link CardReaderInitRequest } + */ + public CardReaderInitRequest getCardReaderInitRequest() { + return cardReaderInitRequest; + } + + /** + * Sets the value of the cardReaderInitRequest property. + * + * @param value allowed object is {@link CardReaderInitRequest } + */ + public void setCardReaderInitRequest(CardReaderInitRequest value) { + this.cardReaderInitRequest = value; + } + + /** + * Gets the value of the cardReaderAPDURequest property. + * + * @return possible object is {@link CardReaderAPDURequest } + */ + public CardReaderAPDURequest getCardReaderAPDURequest() { + return cardReaderAPDURequest; + } + + /** + * Sets the value of the cardReaderAPDURequest property. + * + * @param value allowed object is {@link CardReaderAPDURequest } + */ + public void setCardReaderAPDURequest(CardReaderAPDURequest value) { + this.cardReaderAPDURequest = value; + } + + /** + * Gets the value of the cardReaderPowerOffRequest property. + * + * @return possible object is {@link CardReaderPowerOffRequest } + */ + public CardReaderPowerOffRequest getCardReaderPowerOffRequest() { + return cardReaderPowerOffRequest; + } + + /** + * Sets the value of the cardReaderPowerOffRequest property. + * + * @param value allowed object is {@link CardReaderPowerOffRequest } + */ + public void setCardReaderPowerOffRequest(CardReaderPowerOffRequest value) { + this.cardReaderPowerOffRequest = value; + } + + /** + * Gets the value of the reconciliationRequest property. + * + * @return possible object is {@link ReconciliationRequest } + */ + public ReconciliationRequest getReconciliationRequest() { + return reconciliationRequest; + } + + /** + * Sets the value of the reconciliationRequest property. + * + * @param value allowed object is {@link ReconciliationRequest } + */ + public void setReconciliationRequest(ReconciliationRequest value) { + this.reconciliationRequest = value; + } + + /** + * Gets the value of the reversalRequest property. + * + * @return possible object is {@link ReversalRequest } + */ + public ReversalRequest getReversalRequest() { + return reversalRequest; + } + + /** + * Sets the value of the reversalRequest property. + * + * @param value allowed object is {@link ReversalRequest } + */ + public void setReversalRequest(ReversalRequest value) { + this.reversalRequest = value; + } + + /** + * Gets the value of the soundRequest property. + * + * @return possible object is {@link SoundRequest } + */ + public SoundRequest getSoundRequest() { + return soundRequest; + } + + /** + * Sets the value of the soundRequest property. + * + * @param value allowed object is {@link SoundRequest } + */ + public void setSoundRequest(SoundRequest value) { + this.soundRequest = value; + } + + /** + * Gets the value of the storedValueRequest property. + * + * @return possible object is {@link StoredValueRequest } + */ + public StoredValueRequest getStoredValueRequest() { + return storedValueRequest; + } + + /** + * Sets the value of the storedValueRequest property. + * + * @param value allowed object is {@link StoredValueRequest } + */ + public void setStoredValueRequest(StoredValueRequest value) { + this.storedValueRequest = value; + } + + /** + * Gets the value of the transactionStatusRequest property. + * + * @return possible object is {@link TransactionStatusRequest } + */ + public TransactionStatusRequest getTransactionStatusRequest() { + return transactionStatusRequest; + } + + /** + * Sets the value of the transactionStatusRequest property. + * + * @param value allowed object is {@link TransactionStatusRequest } + */ + public void setTransactionStatusRequest(TransactionStatusRequest value) { + this.transactionStatusRequest = value; + } + + /** + * Gets the value of the transmitRequest property. + * + * @return possible object is {@link TransmitRequest } + */ + public TransmitRequest getTransmitRequest() { + return transmitRequest; + } + + /** + * Sets the value of the transmitRequest property. + * + * @param value allowed object is {@link TransmitRequest } + */ + public void setTransmitRequest(TransmitRequest value) { + this.transmitRequest = value; + } + + /** + * Gets the value of the securityTrailer property. + * + * @return possible object is {@link ContentInformation } + */ + public ContentInformation getSecurityTrailer() { + return securityTrailer; + } + + /** + * Sets the value of the securityTrailer property. + * + * @param value allowed object is {@link ContentInformation } + */ + public void setSecurityTrailer(ContentInformation value) { + this.securityTrailer = value; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("SaleToPOIRequest{"); + sb.append("messageHeader=").append(messageHeader); + sb.append(", abortRequest=").append(abortRequest); + sb.append(", balanceInquiryRequest=").append(balanceInquiryRequest); + sb.append(", batchRequest=").append(batchRequest); + sb.append(", cardAcquisitionRequest=").append(cardAcquisitionRequest); + sb.append(", adminRequest=").append(adminRequest); + sb.append(", diagnosisRequest=").append(diagnosisRequest); + sb.append(", displayRequest=").append(displayRequest); + sb.append(", enableServiceRequest=").append(enableServiceRequest); + sb.append(", eventNotification=").append(eventNotification); + sb.append(", getTotalsRequest=").append(getTotalsRequest); + sb.append(", inputRequest=").append(inputRequest); + sb.append(", inputUpdate=").append(inputUpdate); + sb.append(", loginRequest=").append(loginRequest); + sb.append(", logoutRequest=").append(logoutRequest); + sb.append(", loyaltyRequest=").append(loyaltyRequest); + sb.append(", paymentRequest=").append(paymentRequest); + sb.append(", pinRequest=").append(pinRequest); + sb.append(", printRequest=").append(printRequest); + sb.append(", cardReaderInitRequest=").append(cardReaderInitRequest); + sb.append(", cardReaderAPDURequest=").append(cardReaderAPDURequest); + sb.append(", cardReaderPowerOffRequest=").append(cardReaderPowerOffRequest); + sb.append(", reconciliationRequest=").append(reconciliationRequest); + sb.append(", reversalRequest=").append(reversalRequest); + sb.append(", soundRequest=").append(soundRequest); + sb.append(", storedValueRequest=").append(storedValueRequest); + sb.append(", transactionStatusRequest=").append(transactionStatusRequest); + sb.append(", transmitRequest=").append(transmitRequest); + sb.append(", securityTrailer=").append(securityTrailer); + sb.append('}'); + return sb.toString(); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleToPOIResponse.java b/src/main/java/com/adyen/model/clouddevice/SaleToPOIResponse.java new file mode 100644 index 000000000..e1c01a4c6 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleToPOIResponse.java @@ -0,0 +1,696 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Content of the Sale to POI Response message. */ +@JsonPropertyOrder({ + "MessageHeader", + "BalanceInquiryResponse", + "BatchResponse", + "CardAcquisitionResponse", + "AdminResponse", + "DiagnosisResponse", + "DisplayResponse", + "EnableServiceResponse", + "GetTotalsResponse", + "InputResponse", + "LoginResponse", + "LogoutResponse", + "LoyaltyResponse", + "PaymentResponse", + "PINResponse", + "PrintResponse", + "CardReaderInitResponse", + "CardReaderAPDUResponse", + "CardReaderPowerOffResponse", + "ReconciliationResponse", + "ReversalResponse", + "SoundResponse", + "StoredValueResponse", + "TransactionStatusResponse", + "TransmitResponse", + "SecurityTrailer" +}) +public class SaleToPOIResponse { + + @JsonProperty("MessageHeader") + protected MessageHeader messageHeader; + + @JsonProperty("BalanceInquiryResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Balance Inquiry Response message.") + protected BalanceInquiryResponse balanceInquiryResponse; + + @JsonProperty("BatchResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Batch Response message.") + protected BatchResponse batchResponse; + + @JsonProperty("CardAcquisitionResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Card Acquisition Response message.") + protected CardAcquisitionResponse cardAcquisitionResponse; + + @JsonProperty("AdminResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Custom Admin Response message.") + protected AdminResponse adminResponse; + + @JsonProperty("DiagnosisResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Diagnosis Response message.") + protected DiagnosisResponse diagnosisResponse; + + @JsonProperty("DisplayResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Display Response message.") + protected DisplayResponse displayResponse; + + @JsonProperty("EnableServiceResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Enable Service Response message.") + protected EnableServiceResponse enableServiceResponse; + + @JsonProperty("GetTotalsResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Reconciliation Response message.") + protected GetTotalsResponse getTotalsResponse; + + @JsonProperty("InputResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Input Response message.") + protected InputResponse inputResponse; + + @JsonProperty("LoginResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Login Response message.") + protected LoginResponse loginResponse; + + @JsonProperty("LogoutResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Logout Response message.") + protected LogoutResponse logoutResponse; + + @JsonProperty("LoyaltyResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Loyalty Response message.") + protected LoyaltyResponse loyaltyResponse; + + @JsonProperty("PaymentResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Payment Response message.") + protected PaymentResponse paymentResponse; + + @JsonProperty("PINResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the PIN Response message.") + protected PINResponse pinResponse; + + @JsonProperty("PrintResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Print Response message.") + protected PrintResponse printResponse; + + @JsonProperty("CardReaderInitResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Card Reader Init Response message.") + protected CardReaderInitResponse cardReaderInitResponse; + + @JsonProperty("CardReaderAPDUResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Card Reader APDU Response message.") + protected CardReaderAPDUResponse cardReaderAPDUResponse; + + @JsonProperty("CardReaderPowerOffResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Card Reader Power-Off Response message.") + protected CardReaderPowerOffResponse cardReaderPowerOffResponse; + + @JsonProperty("ReconciliationResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Reconciliation Response message.") + protected ReconciliationResponse reconciliationResponse; + + @JsonProperty("ReversalResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Reversal Response message.") + protected ReversalResponse reversalResponse; + + @JsonProperty("SoundResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Sound Response message.") + protected SoundResponse soundResponse; + + @JsonProperty("StoredValueResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Stored Value Response message.") + protected StoredValueResponse storedValueResponse; + + @JsonProperty("TransactionStatusResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the TransactionStatus Response message.") + protected TransactionStatusResponse transactionStatusResponse; + + @JsonProperty("TransmitResponse") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Content of the Transmit Response message.") + protected TransmitResponse transmitResponse; + + @JsonProperty("SecurityTrailer") + @JsonInclude(JsonInclude.Include.NON_NULL) + @Schema(description = "Protection of the whole message") + protected ContentInformation securityTrailer; + + /** + * Gets message header. + * + * @return the message header + */ + public MessageHeader getMessageHeader() { + return messageHeader; + } + + /** + * Sets message header. + * + * @param messageHeader the message header + */ + public void setMessageHeader(MessageHeader messageHeader) { + this.messageHeader = messageHeader; + } + + /** + * Gets balance inquiry response. + * + * @return the balance inquiry response + */ + public BalanceInquiryResponse getBalanceInquiryResponse() { + return balanceInquiryResponse; + } + + /** + * Sets balance inquiry response. + * + * @param balanceInquiryResponse the balance inquiry response + */ + public void setBalanceInquiryResponse(BalanceInquiryResponse balanceInquiryResponse) { + this.balanceInquiryResponse = balanceInquiryResponse; + } + + /** + * Gets batch response. + * + * @return the batch response + */ + public BatchResponse getBatchResponse() { + return batchResponse; + } + + /** + * Sets batch response. + * + * @param batchResponse the batch response + */ + public void setBatchResponse(BatchResponse batchResponse) { + this.batchResponse = batchResponse; + } + + /** + * Gets card acquisition response. + * + * @return the card acquisition response + */ + public CardAcquisitionResponse getCardAcquisitionResponse() { + return cardAcquisitionResponse; + } + + /** + * Sets card acquisition response. + * + * @param cardAcquisitionResponse the card acquisition response + */ + public void setCardAcquisitionResponse(CardAcquisitionResponse cardAcquisitionResponse) { + this.cardAcquisitionResponse = cardAcquisitionResponse; + } + + /** + * Gets admin response. + * + * @return the admin response + */ + public AdminResponse getAdminResponse() { + return adminResponse; + } + + /** + * Sets admin response. + * + * @param adminResponse the admin response + */ + public void setAdminResponse(AdminResponse adminResponse) { + this.adminResponse = adminResponse; + } + + /** + * Gets diagnosis response. + * + * @return the diagnosis response + */ + public DiagnosisResponse getDiagnosisResponse() { + return diagnosisResponse; + } + + /** + * Sets diagnosis response. + * + * @param diagnosisResponse the diagnosis response + */ + public void setDiagnosisResponse(DiagnosisResponse diagnosisResponse) { + this.diagnosisResponse = diagnosisResponse; + } + + /** + * Gets display response. + * + * @return the display response + */ + public DisplayResponse getDisplayResponse() { + return displayResponse; + } + + /** + * Sets display response. + * + * @param displayResponse the display response + */ + public void setDisplayResponse(DisplayResponse displayResponse) { + this.displayResponse = displayResponse; + } + + /** + * Gets enable service response. + * + * @return the enable service response + */ + public EnableServiceResponse getEnableServiceResponse() { + return enableServiceResponse; + } + + /** + * Sets enable service response. + * + * @param enableServiceResponse the enable service response + */ + public void setEnableServiceResponse(EnableServiceResponse enableServiceResponse) { + this.enableServiceResponse = enableServiceResponse; + } + + /** + * Gets get totals response. + * + * @return the get totals response + */ + public GetTotalsResponse getGetTotalsResponse() { + return getTotalsResponse; + } + + /** + * Sets get totals response. + * + * @param getTotalsResponse the get totals response + */ + public void setGetTotalsResponse(GetTotalsResponse getTotalsResponse) { + this.getTotalsResponse = getTotalsResponse; + } + + /** + * Gets input response. + * + * @return the input response + */ + public InputResponse getInputResponse() { + return inputResponse; + } + + /** + * Sets input response. + * + * @param inputResponse the input response + */ + public void setInputResponse(InputResponse inputResponse) { + this.inputResponse = inputResponse; + } + + /** + * Gets login response. + * + * @return the login response + */ + public LoginResponse getLoginResponse() { + return loginResponse; + } + + /** + * Sets login response. + * + * @param loginResponse the login response + */ + public void setLoginResponse(LoginResponse loginResponse) { + this.loginResponse = loginResponse; + } + + /** + * Gets logout response. + * + * @return the logout response + */ + public LogoutResponse getLogoutResponse() { + return logoutResponse; + } + + /** + * Sets logout response. + * + * @param logoutResponse the logout response + */ + public void setLogoutResponse(LogoutResponse logoutResponse) { + this.logoutResponse = logoutResponse; + } + + /** + * Gets loyalty response. + * + * @return the loyalty response + */ + public LoyaltyResponse getLoyaltyResponse() { + return loyaltyResponse; + } + + /** + * Sets loyalty response. + * + * @param loyaltyResponse the loyalty response + */ + public void setLoyaltyResponse(LoyaltyResponse loyaltyResponse) { + this.loyaltyResponse = loyaltyResponse; + } + + /** + * Gets payment response. + * + * @return the payment response + */ + public PaymentResponse getPaymentResponse() { + return paymentResponse; + } + + /** + * Sets payment response. + * + * @param paymentResponse the payment response + */ + public void setPaymentResponse(PaymentResponse paymentResponse) { + this.paymentResponse = paymentResponse; + } + + /** + * Gets pin response. + * + * @return the pin response + */ + public PINResponse getPINResponse() { + return pinResponse; + } + + /** + * Sets pin response. + * + * @param pinResponse the pin response + */ + public void setPINResponse(PINResponse pinResponse) { + this.pinResponse = pinResponse; + } + + /** + * Gets print response. + * + * @return the print response + */ + public PrintResponse getPrintResponse() { + return printResponse; + } + + /** + * Sets print response. + * + * @param printResponse the print response + */ + public void setPrintResponse(PrintResponse printResponse) { + this.printResponse = printResponse; + } + + /** + * Gets card reader init response. + * + * @return the card reader init response + */ + public CardReaderInitResponse getCardReaderInitResponse() { + return cardReaderInitResponse; + } + + /** + * Sets card reader init response. + * + * @param cardReaderInitResponse the card reader init response + */ + public void setCardReaderInitResponse(CardReaderInitResponse cardReaderInitResponse) { + this.cardReaderInitResponse = cardReaderInitResponse; + } + + /** + * Gets card reader apdu response. + * + * @return the card reader apdu response + */ + public CardReaderAPDUResponse getCardReaderAPDUResponse() { + return cardReaderAPDUResponse; + } + + /** + * Sets card reader apdu response. + * + * @param cardReaderAPDUResponse the card reader apdu response + */ + public void setCardReaderAPDUResponse(CardReaderAPDUResponse cardReaderAPDUResponse) { + this.cardReaderAPDUResponse = cardReaderAPDUResponse; + } + + /** + * Gets card reader power off response. + * + * @return the card reader power off response + */ + public CardReaderPowerOffResponse getCardReaderPowerOffResponse() { + return cardReaderPowerOffResponse; + } + + /** + * Sets card reader power off response. + * + * @param cardReaderPowerOffResponse the card reader power off response + */ + public void setCardReaderPowerOffResponse(CardReaderPowerOffResponse cardReaderPowerOffResponse) { + this.cardReaderPowerOffResponse = cardReaderPowerOffResponse; + } + + /** + * Gets reconciliation response. + * + * @return the reconciliation response + */ + public ReconciliationResponse getReconciliationResponse() { + return reconciliationResponse; + } + + /** + * Sets reconciliation response. + * + * @param reconciliationResponse the reconciliation response + */ + public void setReconciliationResponse(ReconciliationResponse reconciliationResponse) { + this.reconciliationResponse = reconciliationResponse; + } + + /** + * Gets reversal response. + * + * @return the reversal response + */ + public ReversalResponse getReversalResponse() { + return reversalResponse; + } + + /** + * Sets reversal response. + * + * @param reversalResponse the reversal response + */ + public void setReversalResponse(ReversalResponse reversalResponse) { + this.reversalResponse = reversalResponse; + } + + /** + * Gets sound response. + * + * @return the sound response + */ + public SoundResponse getSoundResponse() { + return soundResponse; + } + + /** + * Sets sound response. + * + * @param soundResponse the sound response + */ + public void setSoundResponse(SoundResponse soundResponse) { + this.soundResponse = soundResponse; + } + + /** + * Gets stored value response. + * + * @return the stored value response + */ + public StoredValueResponse getStoredValueResponse() { + return storedValueResponse; + } + + /** + * Sets stored value response. + * + * @param storedValueResponse the stored value response + */ + public void setStoredValueResponse(StoredValueResponse storedValueResponse) { + this.storedValueResponse = storedValueResponse; + } + + /** + * Gets transaction status response. + * + * @return the transaction status response + */ + public TransactionStatusResponse getTransactionStatusResponse() { + return transactionStatusResponse; + } + + /** + * Sets transaction status response. + * + * @param transactionStatusResponse the transaction status response + */ + public void setTransactionStatusResponse(TransactionStatusResponse transactionStatusResponse) { + this.transactionStatusResponse = transactionStatusResponse; + } + + /** + * Gets transmit response. + * + * @return the transmit response + */ + public TransmitResponse getTransmitResponse() { + return transmitResponse; + } + + /** + * Sets transmit response. + * + * @param transmitResponse the transmit response + */ + public void setTransmitResponse(TransmitResponse transmitResponse) { + this.transmitResponse = transmitResponse; + } + + /** + * Gets security trailer. + * + * @return the security trailer + */ + public ContentInformation getSecurityTrailer() { + return securityTrailer; + } + + /** + * Sets security trailer. + * + * @param securityTrailer the security trailer + */ + public void setSecurityTrailer(ContentInformation securityTrailer) { + this.securityTrailer = securityTrailer; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SaleToPOIResponse {\n"); + sb.append(" messageHeader: ").append(toIndentedString(messageHeader)).append("\n"); + sb.append(" balanceInquiryResponse: ") + .append(toIndentedString(balanceInquiryResponse)) + .append("\n"); + sb.append(" batchResponse: ").append(toIndentedString(batchResponse)).append("\n"); + sb.append(" cardAcquisitionResponse: ") + .append(toIndentedString(cardAcquisitionResponse)) + .append("\n"); + sb.append(" adminResponse: ").append(toIndentedString(adminResponse)).append("\n"); + sb.append(" diagnosisResponse: ").append(toIndentedString(diagnosisResponse)).append("\n"); + sb.append(" displayResponse: ").append(toIndentedString(displayResponse)).append("\n"); + sb.append(" enableServiceResponse: ") + .append(toIndentedString(enableServiceResponse)) + .append("\n"); + sb.append(" getTotalsResponse: ").append(toIndentedString(getTotalsResponse)).append("\n"); + sb.append(" inputResponse: ").append(toIndentedString(inputResponse)).append("\n"); + sb.append(" loginResponse: ").append(toIndentedString(loginResponse)).append("\n"); + sb.append(" logoutResponse: ").append(toIndentedString(logoutResponse)).append("\n"); + sb.append(" loyaltyResponse: ").append(toIndentedString(loyaltyResponse)).append("\n"); + sb.append(" paymentResponse: ").append(toIndentedString(paymentResponse)).append("\n"); + sb.append(" pinResponse: ").append(toIndentedString(pinResponse)).append("\n"); + sb.append(" printResponse: ").append(toIndentedString(printResponse)).append("\n"); + sb.append(" cardReaderInitResponse: ") + .append(toIndentedString(cardReaderInitResponse)) + .append("\n"); + sb.append(" cardReaderAPDUResponse: ") + .append(toIndentedString(cardReaderAPDUResponse)) + .append("\n"); + sb.append(" cardReaderPowerOffResponse: ") + .append(toIndentedString(cardReaderPowerOffResponse)) + .append("\n"); + sb.append(" reconciliationResponse: ") + .append(toIndentedString(reconciliationResponse)) + .append("\n"); + sb.append(" reversalResponse: ").append(toIndentedString(reversalResponse)).append("\n"); + sb.append(" soundResponse: ").append(toIndentedString(soundResponse)).append("\n"); + sb.append(" storedValueResponse: ") + .append(toIndentedString(storedValueResponse)) + .append("\n"); + sb.append(" transactionStatusResponse: ") + .append(toIndentedString(transactionStatusResponse)) + .append("\n"); + sb.append(" transmitResponse: ").append(toIndentedString(transmitResponse)).append("\n"); + sb.append(" securityTrailer: ").append(toIndentedString(securityTrailer)).append("\n"); + sb.append("}\n"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SaleToPOISecuredMessage.java b/src/main/java/com/adyen/model/clouddevice/SaleToPOISecuredMessage.java new file mode 100644 index 000000000..764891052 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SaleToPOISecuredMessage.java @@ -0,0 +1,115 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ + +package com.adyen.model.clouddevice; + +import com.adyen.model.clouddevice.security.SecurityTrailer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.Objects; + +public class SaleToPOISecuredMessage { + @JsonProperty("MessageHeader") + private MessageHeader messageHeader; + + @JsonProperty("NexoBlob") + private String nexoBlob; + + @JsonProperty("SecurityTrailer") + private SecurityTrailer securityTrailer; + + public MessageHeader getMessageHeader() { + return messageHeader; + } + + public void setMessageHeader(MessageHeader messageHeader) { + this.messageHeader = messageHeader; + } + + public String getNexoBlob() { + return nexoBlob; + } + + public void setNexoBlob(String nexoBlob) { + this.nexoBlob = nexoBlob; + } + + public SecurityTrailer getSecurityTrailer() { + return securityTrailer; + } + + public void setSecurityTrailer(SecurityTrailer securityTrailer) { + this.securityTrailer = securityTrailer; + } + + /** + * Create an instance of SaleToPOISecuredMessage given an JSON string + * + * @param jsonString JSON string + * @return An instance of SaleToPOISecuredMessage + * @throws JsonProcessingException if the JSON string is invalid with respect to + * SaleToPOISecuredMessage + */ + public static SaleToPOISecuredMessage fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SaleToPOISecuredMessage.class); + } + + /** + * Convert an instance of SaleToPOISecuredMessage to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SaleToPOISecuredMessage that = (SaleToPOISecuredMessage) o; + return messageHeader.equals(that.messageHeader) + && nexoBlob.equals(that.nexoBlob) + && securityTrailer.equals(that.securityTrailer); + } + + @Override + public int hashCode() { + return Objects.hash(messageHeader, nexoBlob, securityTrailer); + } + + @Override + public String toString() { + return "SaleToPOISecuredMessage{" + + "messageHeader=" + + messageHeader + + ", nexoBlob='" + + nexoBlob + + '\'' + + ", securityTrailer=" + + securityTrailer + + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SensitiveCardData.java b/src/main/java/com/adyen/model/clouddevice/SensitiveCardData.java new file mode 100644 index 000000000..5da166119 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SensitiveCardData.java @@ -0,0 +1,111 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +/** Sensitive information related to the payment card, entered or read by the Sale System. */ +@JsonPropertyOrder({"TrackData", "PAN", "CardSeqNumb", "ExpiryDate"}) +public class SensitiveCardData { + + @JsonProperty("TrackData") + @Schema( + description = + "Magnetic track or magnetic ink characters line. --Rule: if EntryMode is MagStripe or RFID ") + protected List trackData; + + @JsonProperty("PAN") + @Schema(description = "Primary Account Number --Rule: ", minLength = 8, maxLength = 28) + protected String pan; + + @JsonProperty("CardSeqNumb") + @Schema( + description = "Card Sequence Number --Rule: if EntryMode is File, Keyed or Manual", + minLength = 2, + maxLength = 3) + protected String cardSeqNumb; + + @JsonProperty("ExpiryDate") + @Schema( + description = "Date after which the card cannot be used. --Rule: if EntryMode is File", + minLength = 4, + maxLength = 4) + protected String expiryDate; + + /** + * Gets track data. + * + * @return the track data + */ + public List getTrackData() { + if (trackData == null) { + trackData = new ArrayList<>(); + } + return this.trackData; + } + + /** + * Sets track data. + * + * @param trackData the track data + */ + public void setTrackData(List trackData) { + this.trackData = trackData; + } + + /** + * Gets pan. + * + * @return the pan + */ + public String getPAN() { + return pan; + } + + /** + * Sets pan. + * + * @param pan the pan + */ + public void setPAN(String pan) { + this.pan = pan; + } + + /** + * Gets card seq numb. + * + * @return the card seq numb + */ + public String getCardSeqNumb() { + return cardSeqNumb; + } + + /** + * Sets card seq numb. + * + * @param cardSeqNumb the card seq numb + */ + public void setCardSeqNumb(String cardSeqNumb) { + this.cardSeqNumb = cardSeqNumb; + } + + /** + * Gets expiry date. + * + * @return the expiry date + */ + public String getExpiryDate() { + return expiryDate; + } + + /** + * Sets expiry date. + * + * @param expiryDate the expiry date + */ + public void setExpiryDate(String expiryDate) { + this.expiryDate = expiryDate; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SensitiveMobileData.java b/src/main/java/com/adyen/model/clouddevice/SensitiveMobileData.java new file mode 100644 index 000000000..5520eb7a6 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SensitiveMobileData.java @@ -0,0 +1,78 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.v3.oas.annotations.media.Schema; + +/** Sensitive information related to the mobile phone. */ +@JsonPropertyOrder({"MSISDN", "IMSI", "IMEI"}) +public class SensitiveMobileData { + + @JsonProperty("MSISDN") + @Schema( + description = + "Mobile Subscriber Integrated Service Digital Network (i.e. mobile phone number of the SIM card).") + protected String msisdn; + + @JsonProperty("IMSI") + @Schema(description = "International Mobile Subscriber Identity. --Rule: If data available") + protected String imsi; + + @JsonProperty("IMEI") + @Schema(description = "International Mobile Equipement Identity. --Rule: If data available") + protected String imei; + + /** + * Gets msisdn. + * + * @return the msisdn + */ + public String getMSISDN() { + return msisdn; + } + + /** + * Sets msisdn. + * + * @param msisdn the msisdn + */ + public void setMSISDN(String msisdn) { + this.msisdn = msisdn; + } + + /** + * Gets imsi. + * + * @return the imsi + */ + public String getIMSI() { + return imsi; + } + + /** + * Sets imsi. + * + * @param imsi the imsi + */ + public void setIMSI(String imsi) { + this.imsi = imsi; + } + + /** + * Gets imei. + * + * @return the imei + */ + public String getIMEI() { + return imei; + } + + /** + * Sets imei. + * + * @param imei the imei + */ + public void setIMEI(String imei) { + this.imei = imei; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ServiceProfilesType.java b/src/main/java/com/adyen/model/clouddevice/ServiceProfilesType.java new file mode 100644 index 000000000..58ce6edff --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ServiceProfilesType.java @@ -0,0 +1,83 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum ServiceProfilesType { + + /** CardAcquisition and EnableService could be requested by the Sale System to the POI System. */ + @Schema( + description = + "CardAcquisition and EnableService could be requested by the Sale System to the POI System.") + SYNCHRO("Synchro"), + + /** + * When the POI is unable to perform transactions without the Sale system, e.g. payment at + * delivery, the POI provides in a Batch the performed transactions, and + */ + @Schema( + description = + "When the POI is unable to perform transactions without the Sale system, e.g. payment at delivery, the POI provides in a Batch the performed transactions, and") + BATCH("Batch"), + + /** One Time Reservation service could be requested by the Sale System (as petrol distribution) */ + @Schema( + description = + "One Time Reservation service could be requested by the Sale System (as petrol distribution)") + ONE_TIME_RES("OneTimeRes"), + + /** The Reservation services could be requested by the Sale System */ + @Schema(description = "The Reservation services could be requested by the Sale System") + RESERVATION("Reservation"), + + /** Loyalty services could be requested by the Sale System */ + @Schema(description = "Loyalty services could be requested by the Sale System") + LOYALTY("Loyalty"), + + /** Stored Value service could be requested by the Sale System */ + @Schema(description = "Stored Value service could be requested by the Sale System") + STORED_VALUE("StoredValue"), + + /** The Sale System could request the PIN validation services. */ + PIN("PIN"), + + /** The Sale System could request Card Reader services. */ + @Schema(description = "The Sale System could request Card Reader services.") + CARD_READER("CardReader"), + + /** To produce various forms of sounds to a customer or an operator interface. */ + @Schema( + description = "To produce various forms of sounds to a customer or an operator interface.") + SOUND("Sound"), + + /** + * The POI or Sale System could request communication through the Transmit device messages + * exchange. + */ + @Schema( + description = + "The POI or Sale System could request communication through the Transmit device messages exchange.") + COMMUNICATION("Communication"); + private final String value; + + ServiceProfilesType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + @JsonCreator + public static ServiceProfilesType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/ServicesEnabledType.java b/src/main/java/com/adyen/model/clouddevice/ServicesEnabledType.java new file mode 100644 index 000000000..b4c337b37 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/ServicesEnabledType.java @@ -0,0 +1,62 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum ServicesEnabledType { + + /** + * Enable the POI to process a card acquisition before the request of the Sale System (e.g. the + * same processing as the CardAcquisition command, but no more) + */ + @Schema( + description = + "Enable the POI to process a card acquisition before the request of the Sale System (e.g. the same processing as the CardAcquisition command, but no more)") + CARD_ACQUISITION("CardAcquisition"), + + /** + * Enable the POI to start a payment transaction before the request of the Sale System (e.g. the + * same processing as the Payment command) + */ + @Schema( + description = + "Enable the POI to start a payment transaction before the request of the Sale System (e.g. the same processing as the Payment command)") + PAYMENT("Payment"), + + /** + * Enable the POI to start a loyalty transaction before the request of the Sale System (e.g. the + * same processing as the Loyalty command) + */ + @Schema( + description = + "Enable the POI to start a loyalty transaction before the request of the Sale System (e.g. the same processing as the Loyalty command)") + LOYALTY("Loyalty"); + private final String value; + + ServicesEnabledType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the ServicesEnabledType, or {@code null} if no match is found. + */ + @JsonCreator + public static ServicesEnabledType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SignaturePoint.java b/src/main/java/com/adyen/model/clouddevice/SignaturePoint.java new file mode 100644 index 000000000..1f157aed3 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SignaturePoint.java @@ -0,0 +1,53 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class SignaturePoint { + + /** The X. */ + @JsonProperty("X") + @Schema(description = "Abscissa of a point coordinates.") + protected String x; + + /** The Y. */ + @JsonProperty("Y") + @Schema(description = "Ordinate of a point coordinates.") + protected String y; + + /** + * Gets the value of the x property. + * + * @return possible object is {@link String } + */ + public String getX() { + return x; + } + + /** + * Sets the value of the x property. + * + * @param value allowed object is {@link String } + */ + public void setX(String value) { + this.x = value; + } + + /** + * Gets the value of the y property. + * + * @return possible object is {@link String } + */ + public String getY() { + return y; + } + + /** + * Sets the value of the y property. + * + * @param value allowed object is {@link String } + */ + public void setY(String value) { + this.y = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SignedData.java b/src/main/java/com/adyen/model/clouddevice/SignedData.java new file mode 100644 index 000000000..3cf04300b --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SignedData.java @@ -0,0 +1,164 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.List; + +public class SignedData { + + /** The Digest algorithm. */ + @JsonProperty("DigestAlgorithm") + protected List digestAlgorithm; + + /** The Encapsulated content. */ + @JsonProperty("EncapsulatedContent") + protected EncapsulatedContent encapsulatedContent; + + /** The Certificate. */ + @JsonProperty("Certificate") + protected List certificate; + + /** The Signer. */ + @JsonProperty("Signer") + protected List signer; + + /** The Version. */ + @JsonProperty("Version") + protected VersionType version; + + /** + * Gets the value of the digestAlgorithm property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the digestAlgorithm property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getDigestAlgorithm().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link AlgorithmIdentifier } + * + * @return the digest algorithm + */ + public List getDigestAlgorithm() { + if (digestAlgorithm == null) { + digestAlgorithm = new ArrayList<>(); + } + return this.digestAlgorithm; + } + + /** + * Gets the value of the encapsulatedContent property. + * + * @return possible object is {@link EncapsulatedContent } + */ + public EncapsulatedContent getEncapsulatedContent() { + return encapsulatedContent; + } + + /** + * Sets the value of the encapsulatedContent property. + * + * @param value allowed object is {@link EncapsulatedContent } + */ + public void setEncapsulatedContent(EncapsulatedContent value) { + this.encapsulatedContent = value; + } + + /** + * Gets the value of the certificate property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the certificate property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getCertificate().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list byte[] + * + * @return the certificate + */ + public List getCertificate() { + if (certificate == null) { + certificate = new ArrayList<>(); + } + return this.certificate; + } + + /** + * Gets the value of the signer property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the signer property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getSigner().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link Signer } + * + * @return the signer + */ + public List getSigner() { + if (signer == null) { + signer = new ArrayList<>(); + } + return this.signer; + } + + /** + * Gets the value of the version property. + * + * @return possible object is {@link VersionType } + */ + public VersionType getVersion() { + if (version == null) { + return VersionType.V_1; + } else { + return version; + } + } + + /** + * Sets the value of the version property. + * + * @param value allowed object is {@link VersionType } + */ + public void setVersion(VersionType value) { + this.version = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/Signer.java b/src/main/java/com/adyen/model/clouddevice/Signer.java new file mode 100644 index 000000000..382ef5ede --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/Signer.java @@ -0,0 +1,120 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Signer { + + /** The Signer identifier. */ + @JsonProperty("SignerIdentifier") + protected SignerIdentifier signerIdentifier; + + /** The Digest algorithm. */ + @JsonProperty("DigestAlgorithm") + protected AlgorithmIdentifier digestAlgorithm; + + /** The Signature algorithm. */ + @JsonProperty("SignatureAlgorithm") + protected AlgorithmIdentifier signatureAlgorithm; + + /** The Signature. */ + @JsonProperty("Signature") + protected byte[] signature; + + /** The Version. */ + @JsonProperty("Version") + protected VersionType version; + + /** + * Gets the value of the signerIdentifier property. + * + * @return possible object is {@link SignerIdentifier } + */ + public SignerIdentifier getSignerIdentifier() { + return signerIdentifier; + } + + /** + * Sets the value of the signerIdentifier property. + * + * @param value allowed object is {@link SignerIdentifier } + */ + public void setSignerIdentifier(SignerIdentifier value) { + this.signerIdentifier = value; + } + + /** + * Gets the value of the digestAlgorithm property. + * + * @return possible object is {@link AlgorithmIdentifier } + */ + public AlgorithmIdentifier getDigestAlgorithm() { + return digestAlgorithm; + } + + /** + * Sets the value of the digestAlgorithm property. + * + * @param value allowed object is {@link AlgorithmIdentifier } + */ + public void setDigestAlgorithm(AlgorithmIdentifier value) { + this.digestAlgorithm = value; + } + + /** + * Gets the value of the signatureAlgorithm property. + * + * @return possible object is {@link AlgorithmIdentifier } + */ + public AlgorithmIdentifier getSignatureAlgorithm() { + return signatureAlgorithm; + } + + /** + * Sets the value of the signatureAlgorithm property. + * + * @param value allowed object is {@link AlgorithmIdentifier } + */ + public void setSignatureAlgorithm(AlgorithmIdentifier value) { + this.signatureAlgorithm = value; + } + + /** + * Gets the value of the signature property. + * + * @return possible object is byte[] + */ + public byte[] getSignature() { + return signature; + } + + /** + * Sets the value of the signature property. + * + * @param value allowed object is byte[] + */ + public void setSignature(byte[] value) { + this.signature = value; + } + + /** + * Gets the value of the version property. + * + * @return possible object is {@link VersionType } + */ + public VersionType getVersion() { + if (version == null) { + return VersionType.V_1; + } else { + return version; + } + } + + /** + * Sets the value of the version property. + * + * @param value allowed object is {@link VersionType } + */ + public void setVersion(VersionType value) { + this.version = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SignerIdentifier.java b/src/main/java/com/adyen/model/clouddevice/SignerIdentifier.java new file mode 100644 index 000000000..628c9511a --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SignerIdentifier.java @@ -0,0 +1,28 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class SignerIdentifier { + + /** The Issuer and serial number. */ + @JsonProperty("IssuerAndSerialNumber") + protected IssuerAndSerialNumber issuerAndSerialNumber; + + /** + * Gets the value of the issuerAndSerialNumber property. + * + * @return possible object is {@link IssuerAndSerialNumber } + */ + public IssuerAndSerialNumber getIssuerAndSerialNumber() { + return issuerAndSerialNumber; + } + + /** + * Sets the value of the issuerAndSerialNumber property. + * + * @param value allowed object is {@link IssuerAndSerialNumber } + */ + public void setIssuerAndSerialNumber(IssuerAndSerialNumber value) { + this.issuerAndSerialNumber = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SoundActionType.java b/src/main/java/com/adyen/model/clouddevice/SoundActionType.java new file mode 100644 index 000000000..785afe7fe --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SoundActionType.java @@ -0,0 +1,47 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum SoundActionType { + + /** Start the sound as specified in the messageType. */ + @Schema(description = "Start the sound as specified in the message.") + START_SOUND("StartSound"), + + /** Stop the sound in progress. */ + @Schema(description = "Stop the sound in progress.") + STOP_SOUND("StopSound"), + + /** Set the default volume of sounds. */ + @Schema(description = "Set the default volume of sounds.") + SET_DEFAULT_VOLUME("SetDefaultVolume"); + private final String value; + + SoundActionType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the SoundActionType, or {@code null} if no match is found. + */ + @JsonCreator + public static SoundActionType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SoundContent.java b/src/main/java/com/adyen/model/clouddevice/SoundContent.java new file mode 100644 index 000000000..1139551ec --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SoundContent.java @@ -0,0 +1,97 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class SoundContent { + + @JsonProperty("SoundFormat") + @Schema(description = "Type of sound to play.") + protected SoundFormatType soundFormat; + + @JsonProperty("Language") + @Schema(description = "Identification of a language.") + protected String language; + + @JsonProperty("ReferenceID") + @Schema( + description = + "Identification of a predefined message to display, print or play. --Rule: Mandatory if SoundFormat is SoundRef or MessageRef.") + protected String referenceID; + + @JsonProperty("Text") + @Schema(description = "Content of text message to display, print or play.") + protected String text; + + /** + * Gets the value of the soundFormat property. + * + * @return possible object is {@link SoundFormatType } + */ + public SoundFormatType getSoundFormat() { + return soundFormat; + } + + /** + * Sets the value of the soundFormat property. + * + * @param value allowed object is {@link SoundFormatType } + */ + public void setSoundFormat(SoundFormatType value) { + this.soundFormat = value; + } + + /** + * Gets the value of the language property. + * + * @return possible object is {@link String } + */ + public String getLanguage() { + return language; + } + + /** + * Sets the value of the language property. + * + * @param value allowed object is {@link String } + */ + public void setLanguage(String value) { + this.language = value; + } + + /** + * Gets the value of the referenceID property. + * + * @return possible object is {@link String } + */ + public String getReferenceID() { + return referenceID; + } + + /** + * Sets the value of the referenceID property. + * + * @param value allowed object is {@link String } + */ + public void setReferenceID(String value) { + this.referenceID = value; + } + + /** + * Gets the value of the text property. + * + * @return possible object is {@link String } + */ + public String getText() { + return text; + } + + /** + * Sets the value of the text property. + * + * @param value allowed object is {@link String } + */ + public void setText(String value) { + this.text = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SoundFormatType.java b/src/main/java/com/adyen/model/clouddevice/SoundFormatType.java new file mode 100644 index 000000000..b2d66d8eb --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SoundFormatType.java @@ -0,0 +1,47 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum SoundFormatType { + + /** Preloaded sound File. */ + @Schema(description = "Preloaded sound File.") + SOUND_REF("SoundRef"), + + /** Reference of a preloaded text to play. */ + @Schema(description = "Reference of a preloaded text to play.") + MESSAGE_REF("MessageRef"), + + /** Text to play. */ + @Schema(description = "Text to play.") + TEXT("Text"); + private final String value; + + SoundFormatType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the SoundFormatType, or {@code null} if no match is found. + */ + @JsonCreator + public static SoundFormatType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SoundRequest.java b/src/main/java/com/adyen/model/clouddevice/SoundRequest.java new file mode 100644 index 000000000..02450980d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SoundRequest.java @@ -0,0 +1,108 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigInteger; + +public class SoundRequest { + + /** The Sound content. */ + @JsonProperty("SoundContent") + @Schema( + description = + "Content of the Sound to play. --Rule: Absent if SoundAction is SetDefaultVolume, otherwise mandatory.") + protected SoundContent soundContent; + + /** The Response mode. */ + @JsonProperty("ResponseMode") + @Schema(description = "Message response awaited by the initiator of the Request") + protected ResponseModeType responseMode; + + /** The Sound action. */ + @JsonProperty("SoundAction") + @Schema(description = "Type of action to perform on the sound.") + protected SoundActionType soundAction; + + /** The Sound volume. */ + @JsonProperty("SoundVolume") + @Schema( + description = + "Volume of a sound, either in a pourcentage of the maximum volume, or 0 to mute. --Rule: Mandatory if SoundAction is SetDefaultVolume") + protected BigInteger soundVolume; + + /** + * Gets the value of the soundContent property. + * + * @return possible object is {@link SoundContent } + */ + public SoundContent getSoundContent() { + return soundContent; + } + + /** + * Sets the value of the soundContent property. + * + * @param value allowed object is {@link SoundContent } + */ + public void setSoundContent(SoundContent value) { + this.soundContent = value; + } + + /** + * Gets the value of the responseMode property. + * + * @return possible object is {@link ResponseModeType } + */ + public ResponseModeType getResponseMode() { + if (responseMode == null) { + return ResponseModeType.NOT_REQUIRED; + } else { + return responseMode; + } + } + + /** + * Sets the value of the responseMode property. + * + * @param value allowed object is {@link ResponseModeType } + */ + public void setResponseMode(ResponseModeType value) { + this.responseMode = value; + } + + /** + * Gets the value of the soundAction property. + * + * @return possible object is {@link SoundActionType } + */ + public SoundActionType getSoundAction() { + return soundAction; + } + + /** + * Sets the value of the soundAction property. + * + * @param value allowed object is {@link SoundActionType } + */ + public void setSoundAction(SoundActionType value) { + this.soundAction = value; + } + + /** + * Gets the value of the soundVolume property. + * + * @return possible object is {@link BigInteger } + */ + public BigInteger getSoundVolume() { + return soundVolume; + } + + /** + * Sets the value of the soundVolume property. + * + * @param value allowed object is {@link BigInteger } + */ + public void setSoundVolume(BigInteger value) { + this.soundVolume = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SoundResponse.java b/src/main/java/com/adyen/model/clouddevice/SoundResponse.java new file mode 100644 index 000000000..90ee6db2d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SoundResponse.java @@ -0,0 +1,30 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class SoundResponse { + + /** The Response. */ + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + /** + * Gets the value of the response property. + * + * @return possible object is {@link Response } + */ + public Response getResponse() { + return response; + } + + /** + * Sets the value of the response property. + * + * @param value allowed object is {@link Response } + */ + public void setResponse(Response value) { + this.response = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/SponsoredMerchant.java b/src/main/java/com/adyen/model/clouddevice/SponsoredMerchant.java new file mode 100644 index 000000000..23e08f68e --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/SponsoredMerchant.java @@ -0,0 +1,122 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class SponsoredMerchant { + + /** The Merchant name. */ + @JsonProperty("MerchantName") + @Schema(description = "Unformatted name of the merchant.") + protected String merchantName; + + /** The Merchant address. */ + @JsonProperty("MerchantAddress") + @Schema(description = "Unformatted address of the merchant.") + protected String merchantAddress; + + /** The Merchant country. */ + @JsonProperty("MerchantCountry") + @Schema(description = "Country of the merchant.") + protected String merchantCountry; + + /** The Merchant category code. */ + @JsonProperty("MerchantCategoryCode") + @Schema(description = "The code which identifies the category of the transaction (MCC).") + protected String merchantCategoryCode; + + /** The Registration id. */ + @JsonProperty("RegistrationID") + @Schema(description = "Identification of a registered entity.") + protected String registrationID; + + /** + * Gets the value of the merchantName property. + * + * @return possible object is {@link String } + */ + public String getMerchantName() { + return merchantName; + } + + /** + * Sets the value of the merchantName property. + * + * @param value allowed object is {@link String } + */ + public void setMerchantName(String value) { + this.merchantName = value; + } + + /** + * Gets the value of the merchantAddress property. + * + * @return possible object is {@link String } + */ + public String getMerchantAddress() { + return merchantAddress; + } + + /** + * Sets the value of the merchantAddress property. + * + * @param value allowed object is {@link String } + */ + public void setMerchantAddress(String value) { + this.merchantAddress = value; + } + + /** + * Gets the value of the merchantCountry property. + * + * @return possible object is {@link String } + */ + public String getMerchantCountry() { + return merchantCountry; + } + + /** + * Sets the value of the merchantCountry property. + * + * @param value allowed object is {@link String } + */ + public void setMerchantCountry(String value) { + this.merchantCountry = value; + } + + /** + * Gets the value of the merchantCategoryCode property. + * + * @return possible object is {@link String } + */ + public String getMerchantCategoryCode() { + return merchantCategoryCode; + } + + /** + * Sets the value of the merchantCategoryCode property. + * + * @param value allowed object is {@link String } + */ + public void setMerchantCategoryCode(String value) { + this.merchantCategoryCode = value; + } + + /** + * Gets the value of the registrationID property. + * + * @return possible object is {@link String } + */ + public String getRegistrationID() { + return registrationID; + } + + /** + * Sets the value of the registrationID property. + * + * @param value allowed object is {@link String } + */ + public void setRegistrationID(String value) { + this.registrationID = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/StoredValueAccountID.java b/src/main/java/com/adyen/model/clouddevice/StoredValueAccountID.java new file mode 100644 index 000000000..531e86b44 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/StoredValueAccountID.java @@ -0,0 +1,171 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +public class StoredValueAccountID { + + @JsonProperty("StoredValueAccountType") + @Schema(description = "Type of stored value account") + protected StoredValueAccountType storedValueAccountType; + + @JsonProperty("StoredValueProvider") + @Schema( + description = + "Identification of the provider of the stored value account load/reload --Rule: If available for the card or account.") + protected String storedValueProvider; + + @JsonProperty("OwnerName") + @Schema(description = "Owner name of an account --Rule: If available for the card or account.") + protected String ownerName; + + @JsonProperty("ExpiryDate") + @Schema( + description = + "Date after which the card cannot be used. --Rule: If required for the card or account.") + protected String expiryDate; + + @JsonProperty("EntryMode") + @Schema(description = "Entry mode of the payment instrument information") + protected List entryMode; + + @JsonProperty("IdentificationType") + @Schema(description = "Type of account identification") + protected IdentificationType identificationType; + + @JsonProperty("StoredValueID") + @Schema(description = "Stored value account identification") + protected String storedValueID; + + /** + * Gets the value of the storedValueAccountType property. + * + * @return possible object is {@link StoredValueAccountType } + */ + public StoredValueAccountType getStoredValueAccountType() { + return storedValueAccountType; + } + + /** + * Sets the value of the storedValueAccountType property. + * + * @param value allowed object is {@link StoredValueAccountType } + */ + public void setStoredValueAccountType(StoredValueAccountType value) { + this.storedValueAccountType = value; + } + + /** + * Gets the value of the storedValueProvider property. + * + * @return possible object is {@link String } + */ + public String getStoredValueProvider() { + return storedValueProvider; + } + + /** + * Sets the value of the storedValueProvider property. + * + * @param value allowed object is {@link String } + */ + public void setStoredValueProvider(String value) { + this.storedValueProvider = value; + } + + /** + * Gets the value of the ownerName property. + * + * @return possible object is {@link String } + */ + public String getOwnerName() { + return ownerName; + } + + /** + * Sets the value of the ownerName property. + * + * @param value allowed object is {@link String } + */ + public void setOwnerName(String value) { + this.ownerName = value; + } + + /** + * Gets the value of the expiryDate property. + * + * @return possible object is {@link String } + */ + public String getExpiryDate() { + return expiryDate; + } + + /** + * Sets the value of the expiryDate property. + * + * @param value allowed object is {@link String } + */ + public void setExpiryDate(String value) { + this.expiryDate = value; + } + + /** + * Gets the value of the entryMode property. + * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the entryMode property. + * + *

For example, to add a new item, do as follows: + * + *

+   *    getEntryMode().add(newItem);
+   * 
+ * + *

Objects of the following type(s) are allowed in the list {@link EntryModeType } + */ + public List getEntryMode() { + if (entryMode == null) { + entryMode = new ArrayList<>(); + } + return this.entryMode; + } + + /** + * Gets the value of the identificationType property. + * + * @return possible object is {@link IdentificationType } + */ + public IdentificationType getIdentificationType() { + return identificationType; + } + + /** + * Sets the value of the identificationType property. + * + * @param value allowed object is {@link IdentificationType } + */ + public void setIdentificationType(IdentificationType value) { + this.identificationType = value; + } + + /** + * Gets the value of the storedValueID property. + * + * @return possible object is {@link String } + */ + public String getStoredValueID() { + return storedValueID; + } + + /** + * Sets the value of the storedValueID property. + * + * @param value allowed object is {@link String } + */ + public void setStoredValueID(String value) { + this.storedValueID = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/StoredValueAccountStatus.java b/src/main/java/com/adyen/model/clouddevice/StoredValueAccountStatus.java new file mode 100644 index 000000000..395e2605b --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/StoredValueAccountStatus.java @@ -0,0 +1,54 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +public class StoredValueAccountStatus { + + /** The Stored value account id. */ + @JsonProperty("StoredValueAccountID") + @Schema(description = "Identification of the stored value account or the stored value card") + protected StoredValueAccountID storedValueAccountID; + + /** The Current balance. */ + @JsonProperty("CurrentBalance") + @Schema(description = "Balance of an account. --Rule: if relevant and known") + protected BigDecimal currentBalance; + + /** + * Gets the value of the storedValueAccountID property. + * + * @return possible object is {@link StoredValueAccountID } + */ + public StoredValueAccountID getStoredValueAccountID() { + return storedValueAccountID; + } + + /** + * Sets the value of the storedValueAccountID property. + * + * @param value allowed object is {@link StoredValueAccountID } + */ + public void setStoredValueAccountID(StoredValueAccountID value) { + this.storedValueAccountID = value; + } + + /** + * Gets the value of the currentBalance property. + * + * @return possible object is {@link BigDecimal } + */ + public BigDecimal getCurrentBalance() { + return currentBalance; + } + + /** + * Sets the value of the currentBalance property. + * + * @param value allowed object is {@link BigDecimal } + */ + public void setCurrentBalance(BigDecimal value) { + this.currentBalance = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/StoredValueAccountType.java b/src/main/java/com/adyen/model/clouddevice/StoredValueAccountType.java new file mode 100644 index 000000000..e76019f6d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/StoredValueAccountType.java @@ -0,0 +1,51 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum StoredValueAccountType { + + /** Payment mean issued by retailers or banks as a substitute to a non-monetary gift. */ + @Schema( + description = + "Payment mean issued by retailers or banks as a substitute to a non-monetary gift.") + GIFT_CARD("GiftCard"), + + /** Stored value instrument used to pay telephone services (e.g. card or identifier). */ + @Schema( + description = + "Stored value instrument used to pay telephone services (e.g. card or identifier).") + PHONE_CARD("PhoneCard"), + + /** Other stored value instrument. */ + @Schema(description = "Other stored value instrument.") + OTHER("Other"); + private final String value; + + StoredValueAccountType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the StoredValueAccountType, or {@code null} if no match is found. + */ + @JsonCreator + public static StoredValueAccountType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/StoredValueData.java b/src/main/java/com/adyen/model/clouddevice/StoredValueData.java new file mode 100644 index 000000000..46c13de2f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/StoredValueData.java @@ -0,0 +1,203 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +public class StoredValueData { + + /** The Stored value account id. */ + @JsonProperty("StoredValueAccountID") + @Schema( + description = + "Identification of the stored value account or the stored value card --Rule: If the identification of the Stored Value account or card has been made by the Sale System before the request") + protected StoredValueAccountID storedValueAccountID; + + /** The Original poi transaction. */ + @JsonProperty("OriginalPOITransaction") + @Schema( + description = + "Identification of a previous POI transaction. --Rule: if StoredValueTransactionType is Reverse or Duplicate") + protected OriginalPOITransaction originalPOITransaction; + + /** The Stored value provider. */ + @JsonProperty("StoredValueProvider") + @Schema( + description = + "Identification of the provider of the stored value account load/reload --Rule: If more than one provider to manage on the POI, and StoredValueAccountID absent.") + protected String storedValueProvider; + + /** The Stored value transaction. */ + @JsonProperty("StoredValueTransactionType") + @Schema( + description = + "Identification of operation to proceed on the stored value account or the stored value card") + protected StoredValueTransactionType storedValueTransactionType; + + /** The Product code. */ + @JsonProperty("ProductCode") + @Schema( + description = "Product code of item purchased with the transaction.", + minLength = 1, + maxLength = 20) + protected String productCode; + + /** The Ean upc. */ + @JsonProperty("EanUpc") + @Schema(description = "Standard product code of item purchased with the transaction.") + protected String eanUpc; + + /** The Item amount. */ + @JsonProperty("ItemAmount") + @Schema(description = "Total amount of the item line.") + protected BigDecimal itemAmount; + + /** The Currency. */ + @JsonProperty("Currency") + @Schema(description = "Currency of a monetary amount.") + protected String currency; + + /** + * Gets the value of the storedValueAccountID property. + * + * @return possible object is {@link StoredValueAccountID } + */ + public StoredValueAccountID getStoredValueAccountID() { + return storedValueAccountID; + } + + /** + * Sets the value of the storedValueAccountID property. + * + * @param value allowed object is {@link StoredValueAccountID } + */ + public void setStoredValueAccountID(StoredValueAccountID value) { + this.storedValueAccountID = value; + } + + /** + * Gets the value of the originalPOITransaction property. + * + * @return possible object is {@link OriginalPOITransaction } + */ + public OriginalPOITransaction getOriginalPOITransaction() { + return originalPOITransaction; + } + + /** + * Sets the value of the originalPOITransaction property. + * + * @param value allowed object is {@link OriginalPOITransaction } + */ + public void setOriginalPOITransaction(OriginalPOITransaction value) { + this.originalPOITransaction = value; + } + + /** + * Gets the value of the storedValueProvider property. + * + * @return possible object is {@link String } + */ + public String getStoredValueProvider() { + return storedValueProvider; + } + + /** + * Sets the value of the storedValueProvider property. + * + * @param value allowed object is {@link String } + */ + public void setStoredValueProvider(String value) { + this.storedValueProvider = value; + } + + /** + * Gets the value of the storedValueTransactionType property. + * + * @return possible object is {@link StoredValueTransactionType } + */ + public StoredValueTransactionType getStoredValueTransactionType() { + return storedValueTransactionType; + } + + /** + * Sets the value of the storedValueTransactionType property. + * + * @param value allowed object is {@link StoredValueTransactionType } + */ + public void setStoredValueTransactionType(StoredValueTransactionType value) { + this.storedValueTransactionType = value; + } + + /** + * Gets the value of the productCode property. + * + * @return possible object is {@link String } + */ + public String getProductCode() { + return productCode; + } + + /** + * Sets the value of the productCode property. + * + * @param value allowed object is {@link String } + */ + public void setProductCode(String value) { + this.productCode = value; + } + + /** + * Gets the value of the eanUpc property. + * + * @return possible object is {@link String } + */ + public String getEanUpc() { + return eanUpc; + } + + /** + * Sets the value of the eanUpc property. + * + * @param value allowed object is {@link String } + */ + public void setEanUpc(String value) { + this.eanUpc = value; + } + + /** + * Gets the value of the itemAmount property. + * + * @return possible object is {@link BigDecimal } + */ + public BigDecimal getItemAmount() { + return itemAmount; + } + + /** + * Sets the value of the itemAmount property. + * + * @param value allowed object is {@link BigDecimal } + */ + public void setItemAmount(BigDecimal value) { + this.itemAmount = value; + } + + /** + * Gets the value of the currency property. + * + * @return possible object is {@link String } + */ + public String getCurrency() { + return currency; + } + + /** + * Sets the value of the currency property. + * + * @param value allowed object is {@link String } + */ + public void setCurrency(String value) { + this.currency = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/StoredValueRequest.java b/src/main/java/com/adyen/model/clouddevice/StoredValueRequest.java new file mode 100644 index 000000000..a6aa234fb --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/StoredValueRequest.java @@ -0,0 +1,96 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +public class StoredValueRequest { + + /** The Sale data. */ + @JsonProperty("SaleData") + @Schema(description = "Data related to the Sale System.") + protected SaleData saleData; + + /** The Stored value data. */ + @JsonProperty("StoredValueData") + @Schema(description = "Data related to the stored value card.") + protected List storedValueData; + + /** The Customer language. */ + @JsonProperty("CustomerLanguage") + @Schema( + description = + "Language of the Customer --Rule: If the language is selected by the Sale System before the request to the POI.") + protected String customerLanguage; + + /** + * Gets the value of the saleData property. + * + * @return possible object is {@link SaleData } + */ + public SaleData getSaleData() { + return saleData; + } + + /** + * Sets the value of the saleData property. + * + * @param value allowed object is {@link SaleData } + */ + public void setSaleData(SaleData value) { + this.saleData = value; + } + + /** + * Gets the value of the storedValueData property. + * + *

+ * + *

+ * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the storedValueData property. + * + *

+ * + *

+ * + *

+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link StoredValueData } + * + * @return the stored value data + */ + public List getStoredValueData() { + if (storedValueData == null) { + storedValueData = new ArrayList<>(); + } + return this.storedValueData; + } + + /** + * Gets the value of the customerLanguage property. + * + * @return possible object is {@link String } + */ + public String getCustomerLanguage() { + return customerLanguage; + } + + /** + * Sets the value of the customerLanguage property. + * + * @param value allowed object is {@link String } + */ + public void setCustomerLanguage(String value) { + this.customerLanguage = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/StoredValueResponse.java b/src/main/java/com/adyen/model/clouddevice/StoredValueResponse.java new file mode 100644 index 000000000..4ca847698 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/StoredValueResponse.java @@ -0,0 +1,129 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +public class StoredValueResponse { + + /** The Response. */ + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + /** The Sale data. */ + @JsonProperty("SaleData") + @Schema(description = "Data related to the Sale System.") + protected SaleData saleData; + + /** The Poi data. */ + @JsonProperty("POIData") + @Schema(description = "Data related to the POI System.") + protected POIData poiData; + + /** The Stored value result. */ + @JsonProperty("StoredValueResult") + @Schema( + description = + "Result of loading/reloading a stored value card.. --Rule: If StoredValueResponse.Result is \"Success\" or \"Partial\", one entry per StoredValueRequest.StoredValueData loaded or") + protected List storedValueResult; + + /** The Payment receipt. */ + @JsonProperty("PaymentReceipt") + protected List paymentReceipt; + + /** + * Gets the value of the response property. + * + * @return possible object is {@link Response } + */ + public Response getResponse() { + return response; + } + + /** + * Sets the value of the response property. + * + * @param value allowed object is {@link Response } + */ + public void setResponse(Response value) { + this.response = value; + } + + /** + * Gets the value of the saleData property. + * + * @return possible object is {@link SaleData } + */ + public SaleData getSaleData() { + return saleData; + } + + /** + * Sets the value of the saleData property. + * + * @param value allowed object is {@link SaleData } + */ + public void setSaleData(SaleData value) { + this.saleData = value; + } + + /** + * Gets the value of the poiData property. + * + * @return possible object is {@link POIData } + */ + public POIData getPOIData() { + return poiData; + } + + /** + * Sets the value of the poiData property. + * + * @param value allowed object is {@link POIData } + */ + public void setPOIData(POIData value) { + this.poiData = value; + } + + /** + * Gets the value of the storedValueResult property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the storedValueResult property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getStoredValueResult().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link StoredValueResult } + * + * @return the stored value result + */ + public List getStoredValueResult() { + if (storedValueResult == null) { + storedValueResult = new ArrayList<>(); + } + return this.storedValueResult; + } + + public List getPaymentReceipt() { + return paymentReceipt; + } + + public void setPaymentReceipt(List paymentReceipt) { + this.paymentReceipt = paymentReceipt; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/StoredValueResult.java b/src/main/java/com/adyen/model/clouddevice/StoredValueResult.java new file mode 100644 index 000000000..147bceb8e --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/StoredValueResult.java @@ -0,0 +1,174 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigDecimal; + +public class StoredValueResult { + + /** The Stored value account status. */ + @JsonProperty("StoredValueAccountStatus") + @Schema(description = "Data related to the result of the stored value card transaction.") + protected StoredValueAccountStatus storedValueAccountStatus; + + /** The Host transaction id. */ + @JsonProperty("HostTransactionID") + @Schema( + description = + "Identification of the transaction by the host in charge of the stored value transaction --Rule: If provided by the Host") + protected TransactionIdentification hostTransactionID; + + /** The Stored value transaction. */ + @JsonProperty("StoredValueTransactionType") + @Schema( + description = + "Identification of operation to proceed on the stored value account or the stored value card --Rule: Copy") + protected StoredValueTransactionType storedValueTransactionType; + + /** The Product code. */ + @JsonProperty("ProductCode") + @Schema(description = "Product code of item purchased with the transaction. --Rule: Copy") + protected String productCode; + + /** The Ean upc. */ + @JsonProperty("EanUpc") + @Schema( + description = "Standard product code of item purchased with the transaction. --Rule: Copy") + protected String eanUpc; + + /** The Item amount. */ + @JsonProperty("ItemAmount") + @Schema(description = "Total amount of the item line.") + protected BigDecimal itemAmount; + + /** The Currency. */ + @JsonProperty("Currency") + @Schema(description = "Currency of a monetary amount. --Rule: Copy") + protected String currency; + + /** + * Gets the value of the storedValueAccountStatus property. + * + * @return possible object is {@link StoredValueAccountStatus } + */ + public StoredValueAccountStatus getStoredValueAccountStatus() { + return storedValueAccountStatus; + } + + /** + * Sets the value of the storedValueAccountStatus property. + * + * @param value allowed object is {@link StoredValueAccountStatus } + */ + public void setStoredValueAccountStatus(StoredValueAccountStatus value) { + this.storedValueAccountStatus = value; + } + + /** + * Gets the value of the hostTransactionID property. + * + * @return possible object is {@link TransactionIdentification } + */ + public TransactionIdentification getHostTransactionID() { + return hostTransactionID; + } + + /** + * Sets the value of the hostTransactionID property. + * + * @param value allowed object is {@link TransactionIdentification } + */ + public void setHostTransactionID(TransactionIdentification value) { + this.hostTransactionID = value; + } + + /** + * Gets the value of the storedValueTransactionType property. + * + * @return possible object is {@link StoredValueTransactionType } + */ + public StoredValueTransactionType getStoredValueTransactionType() { + return storedValueTransactionType; + } + + /** + * Sets the value of the storedValueTransactionType property. + * + * @param value allowed object is {@link StoredValueTransactionType } + */ + public void setStoredValueTransactionType(StoredValueTransactionType value) { + this.storedValueTransactionType = value; + } + + /** + * Gets the value of the productCode property. + * + * @return possible object is {@link String } + */ + public String getProductCode() { + return productCode; + } + + /** + * Sets the value of the productCode property. + * + * @param value allowed object is {@link String } + */ + public void setProductCode(String value) { + this.productCode = value; + } + + /** + * Gets the value of the eanUpc property. + * + * @return possible object is {@link String } + */ + public String getEanUpc() { + return eanUpc; + } + + /** + * Sets the value of the eanUpc property. + * + * @param value allowed object is {@link String } + */ + public void setEanUpc(String value) { + this.eanUpc = value; + } + + /** + * Gets the value of the itemAmount property. + * + * @return possible object is {@link BigDecimal } + */ + public BigDecimal getItemAmount() { + return itemAmount; + } + + /** + * Sets the value of the itemAmount property. + * + * @param value allowed object is {@link BigDecimal } + */ + public void setItemAmount(BigDecimal value) { + this.itemAmount = value; + } + + /** + * Gets the value of the currency property. + * + * @return possible object is {@link String } + */ + public String getCurrency() { + return currency; + } + + /** + * Sets the value of the currency property. + * + * @param value allowed object is {@link String } + */ + public void setCurrency(String value) { + this.currency = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/StoredValueTransactionType.java b/src/main/java/com/adyen/model/clouddevice/StoredValueTransactionType.java new file mode 100644 index 000000000..bf2908e0d --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/StoredValueTransactionType.java @@ -0,0 +1,59 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum StoredValueTransactionType { + + /** Reserve the account (e.g. get an activation code) */ + @Schema(description = "Reserve the account (e.g. get an activation code)") + RESERVE("Reserve"), + + /** Activate the account or the card */ + @Schema(description = "Activate the account or the card") + ACTIVATE("Activate"), + + /** Load the account or the card with money */ + @Schema(description = "Load the account or the card with money") + LOAD("Load"), + + /** Unload the account */ + @Schema(description = "Unload the account") + UNLOAD("Unload"), + + /** Reverse an activation or loading. */ + @Schema(description = "Reverse an activation or loading.") + REVERSE("Reverse"), + + /** Duplicate the code or number provided by the loading or activation */ + @Schema(description = "Duplicate the code or number provided by the loading or activation") + DUPLICATE("Duplicate"); + private final String value; + + StoredValueTransactionType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the StoredValueTransactionType, or {@code null} if no match is found. + */ + @JsonCreator + public static StoredValueTransactionType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TerminalEnvironmentType.java b/src/main/java/com/adyen/model/clouddevice/TerminalEnvironmentType.java new file mode 100644 index 000000000..6490e4d99 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TerminalEnvironmentType.java @@ -0,0 +1,62 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum TerminalEnvironmentType { + + /** + * The Sale Terminal is managed by a Cashier through the Sale System. A Cashier Interface is + * provided by the POI System during the process of a request from the + */ + @Schema( + description = + "The Sale Terminal is managed by a Cashier through the Sale System. A Cashier Interface is provided by the POI System during the process of a request from the") + ATTENDED("Attended"), + + /** + * Without a Cashier Interface. The POI Terminal is managed by the Customer through the Customer + * Interface. A Cashier could help the Cardholder during the + */ + @Schema( + description = + "Without a Cashier Interface. The POI Terminal is managed by the Customer through the Customer Interface. A Cashier could help the Cardholder during the") + SEMI_ATTENDED("SemiAttended"), + + /** + * The Sale Terminal is managed as a logical terminal without any Cashier Interface (typically a + * background process). The POI Terminal is managed by the Customer + */ + @Schema( + description = + "The Sale Terminal is managed as a logical terminal without any Cashier Interface (typically a background process). The POI Terminal is managed by the Customer") + UNATTENDED("Unattended"); + private final String value; + + TerminalEnvironmentType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the TerminalEnvironmentType, or {@code null} if no match is found. + */ + @JsonCreator + public static TerminalEnvironmentType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TokenRequestedType.java b/src/main/java/com/adyen/model/clouddevice/TokenRequestedType.java new file mode 100644 index 000000000..45005be8c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TokenRequestedType.java @@ -0,0 +1,45 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum TokenRequestedType { + + /** The token is generated to recognise a customer during the time of a transaction. */ + @Schema( + description = + "The token is generated to recognise a customer during the time of a transaction.") + TRANSACTION("Transaction"), + + /** The token is generated to recognise a customer for a longer period. */ + @Schema(description = "The token is generated to recognise a customer for a longer period.") + CUSTOMER("Customer"); + private final String value; + + TokenRequestedType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the TokenRequestedType, or {@code null} if no match is found. + */ + @JsonCreator + public static TokenRequestedType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TotalDetailsType.java b/src/main/java/com/adyen/model/clouddevice/TotalDetailsType.java new file mode 100644 index 000000000..99fb1ff9f --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TotalDetailsType.java @@ -0,0 +1,54 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum TotalDetailsType { + + /** Give the totals result per POIID value. */ + POIID("POIID"), + + /** Give the totals result per SaleID value. */ + @Schema(description = "Give the totals result per SaleID value.") + SALE_ID("SaleID"), + + /** Give the totals result per OperatorID value. */ + @Schema(description = "Give the totals result per OperatorID value.") + OPERATOR_ID("OperatorID"), + + /** Give the totals result per ShiftNumber value. */ + @Schema(description = "Give the totals result per ShiftNumber value.") + SHIFT_NUMBER("ShiftNumber"), + + /** Give the totals result per TotalsGroupID value. */ + @Schema(description = "Give the totals result per TotalsGroupID value.") + TOTALS_GROUP_ID("TotalsGroupID"); + private final String value; + + TotalDetailsType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the TotalDetailsType, or {@code null} if no match is found. + */ + @JsonCreator + public static TotalDetailsType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TotalFilter.java b/src/main/java/com/adyen/model/clouddevice/TotalFilter.java new file mode 100644 index 000000000..9257286a3 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TotalFilter.java @@ -0,0 +1,134 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class TotalFilter { + + /** The Poiid. */ + @JsonProperty("POIID") + @Schema( + description = + "Identification of a POI System or a POI Terminal for the Sale to POI protocol --Rule: If totals in the response have to be computed only for this particular value of POIID") + protected String poiid; + + /** The Sale id. */ + @JsonProperty("SaleID") + @Schema( + description = + "Identification of a Sale System or a Sale Terminal for the Sale to POI protocol --Rule: If totals in the response have to be computed only for this particular value of SaleID") + protected String saleID; + + /** The Operator id. */ + @JsonProperty("OperatorID") + @Schema( + description = + "Identification of the Cashier or Operator. --Rule: If totals in the response have to be computed only for this particular value of OperatorID") + protected String operatorID; + + /** The Shift number. */ + @JsonProperty("ShiftNumber") + @Schema( + description = + "Shift number. --Rule: If totals in the response have to be computed only for this particular value of ShiftNumber") + protected String shiftNumber; + + /** The Totals group id. */ + @JsonProperty("TotalsGroupID") + @Schema( + description = + "Identification of a group of transaction on a POI Terminal, having the same Sale features. --Rule: If totals in the response have to be computed only for this particular value of TotalsGroupID", + minLength = 1, + maxLength = 16) + protected String totalsGroupID; + + /** + * Gets the value of the poiid property. + * + * @return possible object is {@link String } + */ + public String getPOIID() { + return poiid; + } + + /** + * Sets the value of the poiid property. + * + * @param value allowed object is {@link String } + */ + public void setPOIID(String value) { + this.poiid = value; + } + + /** + * Gets the value of the saleID property. + * + * @return possible object is {@link String } + */ + public String getSaleID() { + return saleID; + } + + /** + * Sets the value of the saleID property. + * + * @param value allowed object is {@link String } + */ + public void setSaleID(String value) { + this.saleID = value; + } + + /** + * Gets the value of the operatorID property. + * + * @return possible object is {@link String } + */ + public String getOperatorID() { + return operatorID; + } + + /** + * Sets the value of the operatorID property. + * + * @param value allowed object is {@link String } + */ + public void setOperatorID(String value) { + this.operatorID = value; + } + + /** + * Gets the value of the shiftNumber property. + * + * @return possible object is {@link String } + */ + public String getShiftNumber() { + return shiftNumber; + } + + /** + * Sets the value of the shiftNumber property. + * + * @param value allowed object is {@link String } + */ + public void setShiftNumber(String value) { + this.shiftNumber = value; + } + + /** + * Gets the value of the totalsGroupID property. + * + * @return possible object is {@link String } + */ + public String getTotalsGroupID() { + return totalsGroupID; + } + + /** + * Sets the value of the totalsGroupID property. + * + * @param value allowed object is {@link String } + */ + public void setTotalsGroupID(String value) { + this.totalsGroupID = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TrackData.java b/src/main/java/com/adyen/model/clouddevice/TrackData.java new file mode 100644 index 000000000..e966a33a7 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TrackData.java @@ -0,0 +1,81 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class TrackData { + + @JsonProperty("TrackValue") + @Schema(description = "Card track content", minLength = 1, maxLength = 104) + protected String trackValue; + + @JsonProperty("TrackNumb") + @Schema(description = "Card track number") + protected Integer trackNumb; + + @JsonProperty("TrackFormat") + @Schema(description = "Card track format") + protected TrackFormatType trackFormat; + + /** + * Gets the value of the trackValue property. + * + * @return possible object is {@link String } + */ + public String getTrackValue() { + return trackValue; + } + + /** + * Sets the value of the trackValue property. + * + * @param value allowed object is {@link String } + */ + public void setTrackValue(String value) { + this.trackValue = value; + } + + /** + * Gets the value of the trackNumb property. + * + * @return possible object is {@link Integer } + */ + public int getTrackNumb() { + if (trackNumb == null) { + return 2; + } else { + return trackNumb; + } + } + + /** + * Sets the value of the trackNumb property. + * + * @param value allowed object is {@link Integer } + */ + public void setTrackNumb(Integer value) { + this.trackNumb = value; + } + + /** + * Gets the value of the trackFormat property. + * + * @return possible object is {@link TrackFormatType } + */ + public TrackFormatType getTrackFormat() { + if (trackFormat == null) { + return TrackFormatType.ISO; + } else { + return trackFormat; + } + } + + /** + * Sets the value of the trackFormat property. + * + * @param value allowed object is {@link TrackFormatType } + */ + public void setTrackFormat(TrackFormatType value) { + this.trackFormat = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TrackFormatType.java b/src/main/java/com/adyen/model/clouddevice/TrackFormatType.java new file mode 100644 index 000000000..0508a5710 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TrackFormatType.java @@ -0,0 +1,67 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum TrackFormatType { + + /** ISO card track format - ISO 7813 - ISO 4909 */ + ISO("ISO"), + + /** Japenese track format I */ + @Schema(description = "Japenese track format I") + JIS_I("JIS-I"), + + /** Japenese track format II */ + @Schema(description = "Japenese track format II") + JIS_II("JIS-II"), + + /** American driver license */ + AAMVA("AAMVA"), + + /** + * ((Magnetic Ink Character Recognition, using the CMC-7 font - ISO 1004) Line at the bottom of a + * check containing the bank account and the check number. + */ + @Schema( + description = + "((Magnetic Ink Character Recognition, using the CMC-7 font - ISO 1004) Line at the bottom of a check containing the bank account and the check number.") + CMC_7("CMC-7"), + + /** + * (Magnetic Ink Character Recognition, using the E-13B font) Line at the bottom of a check + * containing the bank account and the check number. + */ + @Schema( + description = + "(Magnetic Ink Character Recognition, using the E-13B font) Line at the bottom of a check containing the bank account and the check number.") + E_13_B("E-13B"); + private final String value; + + TrackFormatType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the TrackFormatType, or {@code null} if no match is found. + */ + @JsonCreator + public static TrackFormatType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TransactionActionType.java b/src/main/java/com/adyen/model/clouddevice/TransactionActionType.java new file mode 100644 index 000000000..2e7a11940 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TransactionActionType.java @@ -0,0 +1,50 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum TransactionActionType { + + /** Start a transaction by a swipe ahead mechanism, with the services which are enabled. */ + @Schema( + description = + "Start a transaction by a swipe ahead mechanism, with the services which are enabled.") + START_TRANSACTION("StartTransaction"), + + /** + * Abort a transaction started either by a CardAcquisition or EnableService with TransactionAction + * to "StartTransaction", not followed by a service request from + */ + @Schema( + description = + "Abort a transaction started either by a CardAcquisition or EnableService with TransactionAction to \"StartTransaction\", not followed by a service request from") + ABORT_TRANSACTION("AbortTransaction"); + private final String value; + + TransactionActionType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the TransactionActionType, or {@code null} if no match is found. + */ + @JsonCreator + public static TransactionActionType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TransactionConditions.java b/src/main/java/com/adyen/model/clouddevice/TransactionConditions.java new file mode 100644 index 000000000..3fa38d276 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TransactionConditions.java @@ -0,0 +1,301 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +public class TransactionConditions { + + /** The Allowed payment brand. */ + @JsonProperty("AllowedPaymentBrand") + @Schema( + description = + "Card payment brands allowed by the Sale System for the payment transaction. --Rule: Restrict brand if data sent") + protected List allowedPaymentBrand; + + /** The Acquirer id. */ + @JsonProperty("AcquirerID") + @Schema( + description = "Identification of the Acquirer --Rule: Restrict to these Acquirer if present") + protected List acquirerID; + + /** The Allowed loyalty brand. */ + @JsonProperty("AllowedLoyaltyBrand") + @Schema( + description = + "Loyalty brands or programs allowed by the Sale System for the loyalty transaction. --Rule: Restrict brand if data sent") + protected List allowedLoyaltyBrand; + + /** The Force entry mode. */ + @JsonProperty("ForceEntryMode") + @Schema( + description = + "Payment instrument entry mode requested by the Sale System. --Rule: Restrict entry mode if sent") + protected List forceEntryMode; + + /** The Debit preferred flag. */ + @JsonProperty("DebitPreferredFlag") + @Schema( + description = + "The preferred type of payment is a debit transaction rather a credit transaction. --Rule: The preferred type of payment is a debit transaction rather a credit transaction.") + protected Boolean debitPreferredFlag; + + /** The Loyalty handling. */ + @JsonProperty("LoyaltyHandling") + @Schema(description = "Type of Loyalty processing requested by the Sale System.") + protected LoyaltyHandlingType loyaltyHandling; + + /** The Customer language. */ + @JsonProperty("CustomerLanguage") + @Schema( + description = + "Language of the Customer --Rule: If the language is selected by the Sale System before the request to the POI.") + protected String customerLanguage; + + /** The Force online flag. */ + @JsonProperty("ForceOnlineFlag") + @Schema( + description = + "Indicates if the Cashier requires POI forces online access to the Acquirer. --Rule: Go online if data sent") + protected Boolean forceOnlineFlag; + + /** The Merchant category code. */ + @JsonProperty("MerchantCategoryCode") + @Schema( + description = + "The code which identifies the category of the transaction (MCC). --Rule: The payment implies a specific MCC.", + minLength = 3, + maxLength = 4) + protected String merchantCategoryCode; + + /** + * Gets the value of the allowedPaymentBrand property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the allowedPaymentBrand property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getAllowedPaymentBrand().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link String } + * + * @return the allowed payment brand + */ + public List getAllowedPaymentBrand() { + if (allowedPaymentBrand == null) { + allowedPaymentBrand = new ArrayList<>(); + } + return this.allowedPaymentBrand; + } + + /** + * Gets the value of the acquirerID property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the acquirerID property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getAcquirerID().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link String } + * + * @return the acquirer id + */ + public List getAcquirerID() { + if (acquirerID == null) { + acquirerID = new ArrayList<>(); + } + return this.acquirerID; + } + + /** + * Gets the value of the allowedLoyaltyBrand property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the allowedLoyaltyBrand property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getAllowedLoyaltyBrand().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link String } + * + * @return the allowed loyalty brand + */ + public List getAllowedLoyaltyBrand() { + if (allowedLoyaltyBrand == null) { + allowedLoyaltyBrand = new ArrayList<>(); + } + return this.allowedLoyaltyBrand; + } + + /** + * Gets the value of the forceEntryMode property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the forceEntryMode property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getForceEntryMode().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link ForceEntryModeType } + * + * @return the force entry mode + */ + public List getForceEntryMode() { + if (forceEntryMode == null) { + forceEntryMode = new ArrayList<>(); + } + return this.forceEntryMode; + } + + /** + * Gets the value of the debitPreferredFlag property. + * + * @return possible object is {@link Boolean } + */ + public boolean isDebitPreferredFlag() { + if (debitPreferredFlag == null) { + return false; + } else { + return debitPreferredFlag; + } + } + + /** + * Sets the value of the debitPreferredFlag property. + * + * @param value allowed object is {@link Boolean } + */ + public void setDebitPreferredFlag(Boolean value) { + this.debitPreferredFlag = value; + } + + /** + * Gets the value of the loyaltyHandling property. + * + * @return possible object is {@link LoyaltyHandlingType } + */ + public LoyaltyHandlingType getLoyaltyHandling() { + if (loyaltyHandling == null) { + return LoyaltyHandlingType.FORBIDDEN; + } else { + return loyaltyHandling; + } + } + + /** + * Sets the value of the loyaltyHandling property. + * + * @param value allowed object is {@link LoyaltyHandlingType } + */ + public void setLoyaltyHandling(LoyaltyHandlingType value) { + this.loyaltyHandling = value; + } + + /** + * Gets the value of the customerLanguage property. + * + * @return possible object is {@link String } + */ + public String getCustomerLanguage() { + return customerLanguage; + } + + /** + * Sets the value of the customerLanguage property. + * + * @param value allowed object is {@link String } + */ + public void setCustomerLanguage(String value) { + this.customerLanguage = value; + } + + /** + * Gets the value of the forceOnlineFlag property. + * + * @return possible object is {@link Boolean } + */ + public boolean isForceOnlineFlag() { + if (forceOnlineFlag == null) { + return false; + } else { + return forceOnlineFlag; + } + } + + /** + * Sets the value of the forceOnlineFlag property. + * + * @param value allowed object is {@link Boolean } + */ + public void setForceOnlineFlag(Boolean value) { + this.forceOnlineFlag = value; + } + + /** + * Gets the value of the merchantCategoryCode property. + * + * @return possible object is {@link String } + */ + public String getMerchantCategoryCode() { + return merchantCategoryCode; + } + + /** + * Sets the value of the merchantCategoryCode property. + * + * @param value allowed object is {@link String } + */ + public void setMerchantCategoryCode(String value) { + this.merchantCategoryCode = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TransactionIdentification.java b/src/main/java/com/adyen/model/clouddevice/TransactionIdentification.java new file mode 100644 index 000000000..6a084b54e --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TransactionIdentification.java @@ -0,0 +1,58 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.time.OffsetDateTime; + +public class TransactionIdentification { + + /** The Transaction id. */ + @JsonProperty("TransactionID") + @Schema(description = "Unique identification of a transaction") + protected String transactionID; + + /** The Time stamp. */ + @JsonProperty("TimeStamp") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSX") + @Schema( + description = + "Date and time of a transaction for the Sale System, the POI System or the Acquirer.") + protected OffsetDateTime timeStamp; + + /** + * Gets the value of the transactionID property. + * + * @return possible object is {@link String } + */ + public String getTransactionID() { + return transactionID; + } + + /** + * Sets the value of the transactionID property. + * + * @param value allowed object is {@link String } + */ + public void setTransactionID(String value) { + this.transactionID = value; + } + + /** + * Gets the value of the timeStamp property. + * + * @return instance of OffsetDateTime + */ + public OffsetDateTime getTimeStamp() { + return timeStamp; + } + + /** + * Sets the value of the timeStamp property. + * + * @param value instance of OffsetDateTime + */ + public void setTimeStamp(OffsetDateTime value) { + this.timeStamp = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TransactionStatusRequest.java b/src/main/java/com/adyen/model/clouddevice/TransactionStatusRequest.java new file mode 100644 index 000000000..716340c29 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TransactionStatusRequest.java @@ -0,0 +1,100 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +public class TransactionStatusRequest { + + /** The Message reference. */ + @JsonProperty("MessageReference") + @Schema( + description = + "Identification of a previous POI transaction. --Rule: Present if it contains any data") + protected MessageReference messageReference; + + /** The Document qualifier. */ + @JsonProperty("DocumentQualifier") + @Schema( + description = + "Qualification of the document to print to the Cashier or the Customer. --Rule: CustomerReceipt or CashierReceipt. Mandatory if ReceiptReprintFlag is True, otherwise absent.") + protected List documentQualifier; + + /** The Receipt reprint flag. */ + @JsonProperty("ReceiptReprintFlag") + @Schema(description = "Request to reprint the POI receipt(s).") + protected Boolean receiptReprintFlag; + + /** + * Gets the value of the messageReference property. + * + * @return possible object is {@link MessageReference } + */ + public MessageReference getMessageReference() { + return messageReference; + } + + /** + * Sets the value of the messageReference property. + * + * @param value allowed object is {@link MessageReference } + */ + public void setMessageReference(MessageReference value) { + this.messageReference = value; + } + + /** + * Gets the value of the documentQualifier property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the documentQualifier property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getDocumentQualifier().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link DocumentQualifierType } + * + * @return the document qualifier + */ + public List getDocumentQualifier() { + if (documentQualifier == null) { + documentQualifier = new ArrayList<>(); + } + return this.documentQualifier; + } + + /** + * Gets the value of the receiptReprintFlag property. + * + * @return possible object is {@link Boolean } + */ + public boolean isReceiptReprintFlag() { + if (receiptReprintFlag == null) { + return false; + } else { + return receiptReprintFlag; + } + } + + /** + * Sets the value of the receiptReprintFlag property. + * + * @param value allowed object is {@link Boolean } + */ + public void setReceiptReprintFlag(Boolean value) { + this.receiptReprintFlag = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TransactionStatusResponse.java b/src/main/java/com/adyen/model/clouddevice/TransactionStatusResponse.java new file mode 100644 index 000000000..1cbdbc4b3 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TransactionStatusResponse.java @@ -0,0 +1,80 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class TransactionStatusResponse { + + /** The Response. */ + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + /** The Message reference. */ + @JsonProperty("MessageReference") + @Schema( + description = + "Identification of a previous POI transaction. --Rule: if Response.Result is Success") + protected MessageReference messageReference; + + /** The Repeated message response. */ + @JsonProperty("RepeatedMessageResponse") + @Schema( + description = + "Content of the requested Message Response. --Rule: If Result is Success (process completed)") + protected RepeatedMessageResponse repeatedMessageResponse; + + /** + * Gets the value of the response property. + * + * @return possible object is {@link Response } + */ + public Response getResponse() { + return response; + } + + /** + * Sets the value of the response property. + * + * @param value allowed object is {@link Response } + */ + public void setResponse(Response value) { + this.response = value; + } + + /** + * Gets the value of the messageReference property. + * + * @return possible object is {@link MessageReference } + */ + public MessageReference getMessageReference() { + return messageReference; + } + + /** + * Sets the value of the messageReference property. + * + * @param value allowed object is {@link MessageReference } + */ + public void setMessageReference(MessageReference value) { + this.messageReference = value; + } + + /** + * Gets the value of the repeatedMessageResponse property. + * + * @return possible object is {@link RepeatedMessageResponse } + */ + public RepeatedMessageResponse getRepeatedMessageResponse() { + return repeatedMessageResponse; + } + + /** + * Sets the value of the repeatedMessageResponse property. + * + * @param value allowed object is {@link RepeatedMessageResponse } + */ + public void setRepeatedMessageResponse(RepeatedMessageResponse value) { + this.repeatedMessageResponse = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TransactionToPerform.java b/src/main/java/com/adyen/model/clouddevice/TransactionToPerform.java new file mode 100644 index 000000000..0402b4ebe --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TransactionToPerform.java @@ -0,0 +1,76 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class TransactionToPerform { + + /** The Payment request. */ + @JsonProperty("PaymentRequest") + @Schema(description = "Data related to the Payment transaction request.") + protected PaymentRequest paymentRequest; + + /** The Loyalty request. */ + @JsonProperty("LoyaltyRequest") + @Schema(description = "Data related to the Loyalty transaction request.") + protected LoyaltyRequest loyaltyRequest; + + /** The Reversal request. */ + @JsonProperty("ReversalRequest") + @Schema(description = "Data related to the Reveraal transaction request.") + protected ReversalRequest reversalRequest; + + /** + * Gets the value of the paymentRequest property. + * + * @return possible object is {@link PaymentRequest } + */ + public PaymentRequest getPaymentRequest() { + return paymentRequest; + } + + /** + * Sets the value of the paymentRequest property. + * + * @param value allowed object is {@link PaymentRequest } + */ + public void setPaymentRequest(PaymentRequest value) { + this.paymentRequest = value; + } + + /** + * Gets the value of the loyaltyRequest property. + * + * @return possible object is {@link LoyaltyRequest } + */ + public LoyaltyRequest getLoyaltyRequest() { + return loyaltyRequest; + } + + /** + * Sets the value of the loyaltyRequest property. + * + * @param value allowed object is {@link LoyaltyRequest } + */ + public void setLoyaltyRequest(LoyaltyRequest value) { + this.loyaltyRequest = value; + } + + /** + * Gets the value of the reversalRequest property. + * + * @return possible object is {@link ReversalRequest } + */ + public ReversalRequest getReversalRequest() { + return reversalRequest; + } + + /** + * Sets the value of the reversalRequest property. + * + * @param value allowed object is {@link ReversalRequest } + */ + public void setReversalRequest(ReversalRequest value) { + this.reversalRequest = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TransactionTotals.java b/src/main/java/com/adyen/model/clouddevice/TransactionTotals.java new file mode 100644 index 000000000..785eaf88c --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TransactionTotals.java @@ -0,0 +1,404 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.ArrayList; +import java.util.List; + +public class TransactionTotals { + + /** The Payment totals. */ + @JsonProperty("PaymentTotals") + @Schema( + description = + "Totals of the payment transaction during the reconciliation period. --Rule: If both TransactionCount and TransactionAmount are not equal to zero") + protected List paymentTotals; + + /** The Loyalty totals. */ + @JsonProperty("LoyaltyTotals") + @Schema( + description = + "Totals of the loyalty transaction during the reconciliation period. --Rule: If both TransactionCount and TransactionAmount are not equal to zero") + protected List loyaltyTotals; + + /** The Payment instrument. */ + @JsonProperty("PaymentInstrumentType") + @Schema(description = "Type of payment instrument.") + protected PaymentInstrumentType paymentInstrumentType; + + /** The Acquirer id. */ + @JsonProperty("AcquirerID") + @Schema(description = "Identification of the Acquirer --Rule: If available") + protected String acquirerID; + + /** The Error condition. */ + @JsonProperty("ErrorCondition") + @Schema( + description = + "Condition that has produced an error on the processing of a message request --Rule: if Response.Result is Partial, and the reconciliation with this Acquirer failed.") + protected ErrorConditionType errorCondition; + + /** The Host reconciliation id. */ + @JsonProperty("HostReconciliationID") + @Schema( + description = + "Identifier of a reconciliation period with a payment or loyalty host. --Rule: If available") + protected String hostReconciliationID; + + /** The Card brand. */ + @JsonProperty("CardBrand") + @Schema( + description = + "Type of payment or loyalty card --Rule: If configured to present totals per card brand, and Response.Result is Success") + protected String cardBrand; + + /** The Poiid. */ + @JsonProperty("POIID") + @Schema( + description = + "Identification of a POI System or a POI Terminal for the Sale to POI protocol --Rule: If requested in the message request") + protected String poiid; + + /** The Sale id. */ + @JsonProperty("SaleID") + @Schema( + description = + "Identification of a Sale System or a Sale Terminal for the Sale to POI protocol --Rule: If requested in the message request") + protected String saleID; + + /** The Operator id. */ + @JsonProperty("OperatorID") + @Schema( + description = + "Identification of the Cashier or Operator. --Rule: If requested in the message request") + protected String operatorID; + + /** The Shift number. */ + @JsonProperty("ShiftNumber") + @Schema(description = "Shift number. --Rule: If requested in the message request") + protected String shiftNumber; + + /** The Totals group id. */ + @JsonProperty("TotalsGroupID") + @Schema( + description = + "Identification of a group of transaction on a POI Terminal, having the same Sale features. --Rule: If requested in the message request") + protected String totalsGroupID; + + /** The Payment currency. */ + @JsonProperty("PaymentCurrency") + @Schema(description = "Currency of a monetary amount.") + protected String paymentCurrency; + + /** The Loyalty unit. */ + @JsonProperty("LoyaltyUnit") + @Schema(description = "Unit of a loyalty amount.") + protected LoyaltyUnitType loyaltyUnit; + + /** The Loyalty currency. */ + @JsonProperty("LoyaltyCurrency") + @Schema(description = "Currency of a monetary amount. --Rule: If LoyaltyUnit is Monetary") + protected String loyaltyCurrency; + + /** + * Gets the value of the paymentTotals property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the paymentTotals property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getPaymentTotals().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link PaymentTotals } + * + * @return the payment totals + */ + public List getPaymentTotals() { + if (paymentTotals == null) { + paymentTotals = new ArrayList<>(); + } + return this.paymentTotals; + } + + /** + * Gets the value of the loyaltyTotals property. + * + *

+ * + *

This accessor method returns a reference to the live list, not a snapshot. Therefore any + * modification you make to the returned list will be present inside the JAXB object. This is why + * there is not a set method for the loyaltyTotals property. + * + *

+ * + *

For example, to add a new item, do as follows: + * + *

+   *    getLoyaltyTotals().add(newItem);
+   * 
+ * + *

+ * + *

+ * + *

Objects of the following type(s) are allowed in the list {@link LoyaltyTotals } + * + * @return the loyalty totals + */ + public List getLoyaltyTotals() { + if (loyaltyTotals == null) { + loyaltyTotals = new ArrayList<>(); + } + return this.loyaltyTotals; + } + + /** + * Gets the value of the paymentInstrumentType property. + * + * @return possible object is {@link PaymentInstrumentType } + */ + public PaymentInstrumentType getPaymentInstrumentType() { + return paymentInstrumentType; + } + + /** + * Sets the value of the paymentInstrumentType property. + * + * @param value allowed object is {@link PaymentInstrumentType } + */ + public void setPaymentInstrumentType(PaymentInstrumentType value) { + this.paymentInstrumentType = value; + } + + /** + * Gets the value of the acquirerID property. + * + * @return possible object is {@link String } + */ + public String getAcquirerID() { + return acquirerID; + } + + /** + * Sets the value of the acquirerID property. + * + * @param value allowed object is {@link String } + */ + public void setAcquirerID(String value) { + this.acquirerID = value; + } + + /** + * Gets the value of the errorCondition property. + * + * @return possible object is {@link ErrorConditionType } + */ + public ErrorConditionType getErrorCondition() { + return errorCondition; + } + + /** + * Sets the value of the errorCondition property. + * + * @param value allowed object is {@link ErrorConditionType } + */ + public void setErrorCondition(ErrorConditionType value) { + this.errorCondition = value; + } + + /** + * Gets the value of the hostReconciliationID property. + * + * @return possible object is {@link String } + */ + public String getHostReconciliationID() { + return hostReconciliationID; + } + + /** + * Sets the value of the hostReconciliationID property. + * + * @param value allowed object is {@link String } + */ + public void setHostReconciliationID(String value) { + this.hostReconciliationID = value; + } + + /** + * Gets the value of the cardBrand property. + * + * @return possible object is {@link String } + */ + public String getCardBrand() { + return cardBrand; + } + + /** + * Sets the value of the cardBrand property. + * + * @param value allowed object is {@link String } + */ + public void setCardBrand(String value) { + this.cardBrand = value; + } + + /** + * Gets the value of the poiid property. + * + * @return possible object is {@link String } + */ + public String getPOIID() { + return poiid; + } + + /** + * Sets the value of the poiid property. + * + * @param value allowed object is {@link String } + */ + public void setPOIID(String value) { + this.poiid = value; + } + + /** + * Gets the value of the saleID property. + * + * @return possible object is {@link String } + */ + public String getSaleID() { + return saleID; + } + + /** + * Sets the value of the saleID property. + * + * @param value allowed object is {@link String } + */ + public void setSaleID(String value) { + this.saleID = value; + } + + /** + * Gets the value of the operatorID property. + * + * @return possible object is {@link String } + */ + public String getOperatorID() { + return operatorID; + } + + /** + * Sets the value of the operatorID property. + * + * @param value allowed object is {@link String } + */ + public void setOperatorID(String value) { + this.operatorID = value; + } + + /** + * Gets the value of the shiftNumber property. + * + * @return possible object is {@link String } + */ + public String getShiftNumber() { + return shiftNumber; + } + + /** + * Sets the value of the shiftNumber property. + * + * @param value allowed object is {@link String } + */ + public void setShiftNumber(String value) { + this.shiftNumber = value; + } + + /** + * Gets the value of the totalsGroupID property. + * + * @return possible object is {@link String } + */ + public String getTotalsGroupID() { + return totalsGroupID; + } + + /** + * Sets the value of the totalsGroupID property. + * + * @param value allowed object is {@link String } + */ + public void setTotalsGroupID(String value) { + this.totalsGroupID = value; + } + + /** + * Gets the value of the paymentCurrency property. + * + * @return possible object is {@link String } + */ + public String getPaymentCurrency() { + return paymentCurrency; + } + + /** + * Sets the value of the paymentCurrency property. + * + * @param value allowed object is {@link String } + */ + public void setPaymentCurrency(String value) { + this.paymentCurrency = value; + } + + /** + * Gets the value of the loyaltyUnit property. + * + * @return possible object is {@link LoyaltyUnitType } + */ + public LoyaltyUnitType getLoyaltyUnit() { + if (loyaltyUnit == null) { + return LoyaltyUnitType.POINT; + } else { + return loyaltyUnit; + } + } + + /** + * Sets the value of the loyaltyUnit property. + * + * @param value allowed object is {@link LoyaltyUnitType } + */ + public void setLoyaltyUnit(LoyaltyUnitType value) { + this.loyaltyUnit = value; + } + + /** + * Gets the value of the loyaltyCurrency property. + * + * @return possible object is {@link String } + */ + public String getLoyaltyCurrency() { + return loyaltyCurrency; + } + + /** + * Sets the value of the loyaltyCurrency property. + * + * @param value allowed object is {@link String } + */ + public void setLoyaltyCurrency(String value) { + this.loyaltyCurrency = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TransactionType.java b/src/main/java/com/adyen/model/clouddevice/TransactionType.java new file mode 100644 index 000000000..64a290e12 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TransactionType.java @@ -0,0 +1,124 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum TransactionType { + + /** Payment Debit transactions (e.g. if PaymentType is "Normal") */ + @Schema(description = "Payment Debit transactions (e.g. if PaymentType is \"Normal\")") + DEBIT("Debit"), + + /** Payment Credit transactions (e.g. if PaymentType is "Refund") */ + @Schema(description = "Payment Credit transactions (e.g. if PaymentType is \"Refund\")") + CREDIT("Credit"), + + /** Payment Reversal Debit transactions */ + @Schema(description = "Payment Reversal Debit transactions") + REVERSE_DEBIT("ReverseDebit"), + + /** Payment Reversal Credit transactions */ + @Schema(description = "Payment Reversal Credit transactions") + REVERSE_CREDIT("ReverseCredit"), + + /** Outstanding OneTimeReservation transactions, i.e. between OneTimeReservation and Completion */ + @Schema( + description = + "Outstanding OneTimeReservation transactions, i.e. between OneTimeReservation and Completion") + ONE_TIME_RESERVATION("OneTimeReservation"), + + /** OneTimeReservation transactions which have been completed by the Completion. */ + @Schema( + description = "OneTimeReservation transactions which have been completed by the Completion.") + COMPLETED_DEFFERED("CompletedDeffered"), + + /** + * Outstanding FirstReservation transactions, i.e. between FirstReservation and UpdateReservation + * or Completion + */ + @Schema( + description = + "Outstanding FirstReservation transactions, i.e. between FirstReservation and UpdateReservation or Completion") + FIRST_RESERVATION("FirstReservation"), + + /** + * Outstanding UpdateReservation transactions, i.e. between UpdateReservation and + * UpdateReservation or Completion + */ + @Schema( + description = + "Outstanding UpdateReservation transactions, i.e. between UpdateReservation and UpdateReservation or Completion") + UPDATE_RESERVATION("UpdateReservation"), + + /** Reservation transactions which have been completed by the Completion. */ + @Schema(description = "Reservation transactions which have been completed by the Completion.") + COMPLETED_RESERVATION("CompletedReservation"), + + /** Cash Advance transactions. */ + @Schema(description = "Cash Advance transactions.") + CASH_ADVANCE("CashAdvance"), + + /** Issuer instalment transactions. */ + @Schema(description = "Issuer instalment transactions.") + ISSUER_INSTALMENT("IssuerInstalment"), + + /** ResultErrorCondition */ + @Schema(description = "ResultErrorCondition") + DECLINED("Declined"), + + /** ResultErrorCondition */ + @Schema(description = "ResultErrorCondition") + FAILED("Failed"), + + /** Loyalty Award Transaction */ + @Schema(description = "Loyalty Award Transaction") + AWARD("Award"), + + /** Loyalty Reversal Award Transaction */ + @Schema(description = "Loyalty Reversal Award Transaction") + REVERSE_AWARD("ReverseAward"), + + /** Loyalty Redemption Transaction */ + @Schema(description = "Loyalty Redemption Transaction") + REDEMPTION("Redemption"), + + /** Loyalty Reversal Redemption Transaction */ + @Schema(description = "Loyalty Reversal Redemption Transaction") + REVERSE_REDEMPTION("ReverseRedemption"), + + /** Loyalty Rebate Transaction */ + @Schema(description = "Loyalty Rebate Transaction") + REBATE("Rebate"), + + /** Loyalty Reversal Rebate Transaction */ + @Schema(description = "Loyalty Reversal Rebate Transaction") + REVERSE_REBATE("ReverseRebate"); + private final String value; + + TransactionType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the TransactionType, or {@code null} if no match is found. + */ + @JsonCreator + public static TransactionType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TransmitRequest.java b/src/main/java/com/adyen/model/clouddevice/TransmitRequest.java new file mode 100644 index 000000000..128f69424 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TransmitRequest.java @@ -0,0 +1,106 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import java.math.BigInteger; + +public class TransmitRequest { + + /** The Message. */ + @JsonProperty("Message") + @Schema(description = "Content of a transmitted message.") + protected byte[] message; + + /** The Wait response flag. */ + @JsonProperty("WaitResponseFlag") + @Schema(description = "Indicates that a response message has to be received.") + protected Boolean waitResponseFlag; + + /** The Maximum transmit time. */ + @JsonProperty("MaximumTransmitTime") + @Schema(description = "Maximum time in seconds of transmission.") + protected BigInteger maximumTransmitTime; + + /** The Destination address. */ + @JsonProperty("DestinationAddress") + @Schema( + description = + "Transport address containing the IP address or the DNS (Domain Name Server) address, followed by the character ':' and") + protected String destinationAddress; + + /** + * Gets the value of the messageType property. + * + * @return possible object is byte[] + */ + public byte[] getMessage() { + return message; + } + + /** + * Sets the value of the messageType property. + * + * @param value allowed object is byte[] + */ + public void setMessage(byte[] value) { + this.message = value; + } + + /** + * Gets the value of the waitResponseFlag property. + * + * @return possible object is {@link Boolean } + */ + public boolean isWaitResponseFlag() { + if (waitResponseFlag == null) { + return false; + } else { + return waitResponseFlag; + } + } + + /** + * Sets the value of the waitResponseFlag property. + * + * @param value allowed object is {@link Boolean } + */ + public void setWaitResponseFlag(Boolean value) { + this.waitResponseFlag = value; + } + + /** + * Gets the value of the maximumTransmitTime property. + * + * @return possible object is {@link BigInteger } + */ + public BigInteger getMaximumTransmitTime() { + return maximumTransmitTime; + } + + /** + * Sets the value of the maximumTransmitTime property. + * + * @param value allowed object is {@link BigInteger } + */ + public void setMaximumTransmitTime(BigInteger value) { + this.maximumTransmitTime = value; + } + + /** + * Gets the value of the destinationAddress property. + * + * @return possible object is {@link String } + */ + public String getDestinationAddress() { + return destinationAddress; + } + + /** + * Sets the value of the destinationAddress property. + * + * @param value allowed object is {@link String } + */ + public void setDestinationAddress(String value) { + this.destinationAddress = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/TransmitResponse.java b/src/main/java/com/adyen/model/clouddevice/TransmitResponse.java new file mode 100644 index 000000000..0c3c83290 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/TransmitResponse.java @@ -0,0 +1,53 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class TransmitResponse { + + /** The Response. */ + @JsonProperty("Response") + @Schema(description = "Result of a message request processing.") + protected Response response; + + /** The Message. */ + @JsonProperty("Message") + @Schema(description = "Content of a transmitted message.") + protected byte[] message; + + /** + * Gets the value of the response property. + * + * @return possible object is {@link Response } + */ + public Response getResponse() { + return response; + } + + /** + * Sets the value of the response property. + * + * @param value allowed object is {@link Response } + */ + public void setResponse(Response value) { + this.response = value; + } + + /** + * Gets the value of the messageType property. + * + * @return possible object is byte[] + */ + public byte[] getMessage() { + return message; + } + + /** + * Sets the value of the messageType property. + * + * @param value allowed object is byte[] + */ + public void setMessage(byte[] value) { + this.message = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/UTMCoordinates.java b/src/main/java/com/adyen/model/clouddevice/UTMCoordinates.java new file mode 100644 index 000000000..0ff2b3608 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/UTMCoordinates.java @@ -0,0 +1,78 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import io.swagger.v3.oas.annotations.media.Schema; + +public class UTMCoordinates { + + /** The Utm zone. */ + @JsonProperty("UTMZone") + @Schema( + description = + "UTM grid zone combination of the longitude zone (1 to 60) and the latitude band (C to X, excluding I and O).") + protected String utmZone; + + /** The Utm eastward. */ + @JsonProperty("UTMEastward") + @Schema(description = "X-coordinate of the Universal Transverse Mercator coordinate system.") + protected String utmEastward; + + /** The Utm northward. */ + @JsonProperty("UTMNorthward") + @Schema(description = "Y-coordinate of the Universal Transverse Mercator coordinate system.") + protected String utmNorthward; + + /** + * Gets the value of the utmZone property. + * + * @return possible object is {@link String } + */ + public String getUTMZone() { + return utmZone; + } + + /** + * Sets the value of the utmZone property. + * + * @param value allowed object is {@link String } + */ + public void setUTMZone(String value) { + this.utmZone = value; + } + + /** + * Gets the value of the utmEastward property. + * + * @return possible object is {@link String } + */ + public String getUTMEastward() { + return utmEastward; + } + + /** + * Sets the value of the utmEastward property. + * + * @param value allowed object is {@link String } + */ + public void setUTMEastward(String value) { + this.utmEastward = value; + } + + /** + * Gets the value of the utmNorthward property. + * + * @return possible object is {@link String } + */ + public String getUTMNorthward() { + return utmNorthward; + } + + /** + * Sets the value of the utmNorthward property. + * + * @param value allowed object is {@link String } + */ + public void setUTMNorthward(String value) { + this.utmNorthward = value; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/UnitOfMeasureType.java b/src/main/java/com/adyen/model/clouddevice/UnitOfMeasureType.java new file mode 100644 index 000000000..6b56728ef --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/UnitOfMeasureType.java @@ -0,0 +1,111 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.Arrays; + +public enum UnitOfMeasureType { + + /** Case or Carton */ + @Schema(description = "Case or Carton") + CASE("Case"), + + /** Foot */ + @Schema(description = "Foot") + FOOT("Foot"), + + /** Gallon (UK) */ + @Schema(description = "Gallon (UK)") + UK_GALLON("UKGallon"), + + /** Gallon (US) */ + @Schema(description = "Gallon (US)") + US_GALLON("USGallon"), + + /** Gram */ + @Schema(description = "Gram") + GRAM("Gram"), + + /** Inch */ + @Schema(description = "Inch") + INCH("Inch"), + + /** Kilogram */ + @Schema(description = "Kilogram") + KILOGRAM("Kilogram"), + + /** Pound */ + @Schema(description = "Pound") + POUND("Pound"), + + /** Meter */ + @Schema(description = "Meter") + METER("Meter"), + + /** Centimetre */ + @Schema(description = "Centimetre") + CENTIMETRE("Centimetre"), + + /** Litre */ + @Schema(description = "Litre") + LITRE("Litre"), + + /** Centilitre */ + @Schema(description = "Centilitre") + CENTILITRE("Centilitre"), + + /** Ounce */ + @Schema(description = "Ounce") + OUNCE("Ounce"), + + /** Quart */ + @Schema(description = "Quart") + QUART("Quart"), + + /** Pint */ + @Schema(description = "Pint") + PINT("Pint"), + + /** Mile */ + @Schema(description = "Mile") + MILE("Mile"), + + /** Kilometre */ + @Schema(description = "Kilometre") + KILOMETRE("Kilometre"), + + /** Yard */ + @Schema(description = "Yard") + YARD("Yard"), + + /** Other unit than the previous one */ + @Schema(description = "Other unit than the previous one") + OTHER("Other"); + private final String value; + + UnitOfMeasureType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the UnitOfMeasureType, or {@code null} if no match is found. + */ + @JsonCreator + public static UnitOfMeasureType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/VersionType.java b/src/main/java/com/adyen/model/clouddevice/VersionType.java new file mode 100644 index 000000000..08f39a251 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/VersionType.java @@ -0,0 +1,52 @@ +package com.adyen.model.clouddevice; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; + +public enum VersionType { + + /** Version 0 */ + V_0("v0"), + + /** Version 1 */ + V_1("v1"), + + /** Version 2 */ + V_2("v2"), + + /** Version 3 */ + V_3("v3"), + + /** Version 4 */ + V_4("v4"), + + /** Version 5 */ + V_5("v5"); + private final String value; + + VersionType(String v) { + value = v; + } + + /** + * Value string. + * + * @return the string + */ + @JsonValue + public String value() { + return value; + } + + /** + * Returns the enum constant matching the given string, or {@code null} if no match is found. + * + * @param v string value + * @return the VersionType, or {@code null} if no match is found. + */ + @JsonCreator + public static VersionType fromValue(String v) { + return Arrays.stream(values()).filter(s -> s.value.equals(v)).findFirst().orElse(null); + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/security/NexoDerivedKey.java b/src/main/java/com/adyen/model/clouddevice/security/NexoDerivedKey.java new file mode 100644 index 000000000..b9ce6748e --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/security/NexoDerivedKey.java @@ -0,0 +1,105 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ + +package com.adyen.model.clouddevice.security; + +import java.util.Arrays; + +/** + * A container for Nexo derived keys + * + *

Nexo derived keys is a 80 byte struct containing key data: a 32 byte cipher key, a 32 byte + * HMAC key and a 16 byte initialization vector (IV). These 80 bytes are derived from a passphrase. + */ +public class NexoDerivedKey { + + public static final int NEXO_HMAC_KEY_LENGTH = 32; + public static final int NEXO_CIPHER_KEY_LENGTH = 32; + public static final int NEXO_IV_LENGTH = 16; + + private byte[] hmacKey; + private byte[] cipherKey; + private byte[] iv; + + public NexoDerivedKey() { + hmacKey = new byte[NEXO_HMAC_KEY_LENGTH]; + cipherKey = new byte[NEXO_CIPHER_KEY_LENGTH]; + iv = new byte[NEXO_IV_LENGTH]; + } + + public byte[] getHmacKey() { + return hmacKey; + } + + public void setHmacKey(byte[] hmacKey) { + this.hmacKey = hmacKey; + } + + public byte[] getCipherKey() { + return cipherKey; + } + + public void setCipherKey(byte[] cipherKey) { + this.cipherKey = cipherKey; + } + + public byte[] getIv() { + return iv; + } + + public void setIv(byte[] iv) { + this.iv = iv; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NexoDerivedKey that = (NexoDerivedKey) o; + return Arrays.equals(hmacKey, that.hmacKey) + && Arrays.equals(cipherKey, that.cipherKey) + && Arrays.equals(iv, that.iv); + } + + @Override + public int hashCode() { + int result = Arrays.hashCode(hmacKey); + result = 31 * result + Arrays.hashCode(cipherKey); + result = 31 * result + Arrays.hashCode(iv); + return result; + } + + @Override + public String toString() { + return "NexoDerivedKey{" + + "hmacKey=" + + Arrays.toString(hmacKey) + + ", cipherKey=" + + Arrays.toString(cipherKey) + + ", iv=" + + Arrays.toString(iv) + + '}'; + } +} diff --git a/src/main/java/com/adyen/model/clouddevice/security/SecurityTrailer.java b/src/main/java/com/adyen/model/clouddevice/security/SecurityTrailer.java new file mode 100644 index 000000000..3aa137bb2 --- /dev/null +++ b/src/main/java/com/adyen/model/clouddevice/security/SecurityTrailer.java @@ -0,0 +1,124 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ + +package com.adyen.model.clouddevice.security; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Arrays; +import java.util.Objects; + +public class SecurityTrailer { + @JsonProperty("AdyenCryptoVersion") + private Integer adyenCryptoVersion; + + @JsonProperty("KeyIdentifier") + private String keyIdentifier; + + @JsonProperty("KeyVersion") + private Integer keyVersion; + + @JsonProperty("Nonce") + private byte[] nonce; + + @JsonProperty("Hmac") + private byte[] hmac; + + public Integer getAdyenCryptoVersion() { + return adyenCryptoVersion; + } + + public void setAdyenCryptoVersion(Integer adyenCryptoVersion) { + this.adyenCryptoVersion = adyenCryptoVersion; + } + + public String getKeyIdentifier() { + return keyIdentifier; + } + + public void setKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + } + + public Integer getKeyVersion() { + return keyVersion; + } + + public void setKeyVersion(Integer keyVersion) { + this.keyVersion = keyVersion; + } + + public byte[] getNonce() { + return nonce; + } + + public void setNonce(byte[] nonce) { + this.nonce = nonce; + } + + public byte[] getHmac() { + return hmac; + } + + public void setHmac(byte[] hmac) { + this.hmac = hmac; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityTrailer that = (SecurityTrailer) o; + return adyenCryptoVersion.equals(that.adyenCryptoVersion) + && keyIdentifier.equals(that.keyIdentifier) + && keyVersion.equals(that.keyVersion) + && Arrays.equals(nonce, that.nonce) + && Arrays.equals(hmac, that.hmac); + } + + @Override + public int hashCode() { + int result = Objects.hash(adyenCryptoVersion, keyIdentifier, keyVersion); + result = 31 * result + Arrays.hashCode(nonce); + result = 31 * result + Arrays.hashCode(hmac); + return result; + } + + @Override + public String toString() { + return "SecurityTrailer{" + + "adyenCryptoVersion=" + + adyenCryptoVersion + + ", keyIdentifier='" + + keyIdentifier + + '\'' + + ", keyVersion=" + + keyVersion + + ", nonce=" + + Arrays.toString(nonce) + + ", hmac=" + + Arrays.toString(hmac) + + '}'; + } +} diff --git a/src/main/java/com/adyen/security/clouddevice/EncryptionCredentialDetails.java b/src/main/java/com/adyen/security/clouddevice/EncryptionCredentialDetails.java new file mode 100644 index 000000000..bdb3245d9 --- /dev/null +++ b/src/main/java/com/adyen/security/clouddevice/EncryptionCredentialDetails.java @@ -0,0 +1,112 @@ +package com.adyen.security.clouddevice; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Details of the encryption credential used for encrypting the request payload (nexoBlob) */ +public class EncryptionCredentialDetails { + + /** The passphrase used to derive the encryption key. */ + @JsonProperty("Passphrase") + private String passphrase; + + /** The unique identifier of the key. */ + @JsonProperty("KeyIdentifier") + private String keyIdentifier; + + /** The version of the key. */ + @JsonProperty("KeyVersion") + private Integer keyVersion; + + /** The version of the Adyen-specific crypto implementation. */ + @JsonProperty("AdyenCryptoVersion") + private Integer adyenCryptoVersion; + + public String getPassphrase() { + return passphrase; + } + + public void setPassphrase(String passphrase) { + this.passphrase = passphrase; + } + + public String getKeyIdentifier() { + return keyIdentifier; + } + + public void setKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + } + + public Integer getKeyVersion() { + return keyVersion; + } + + public void setKeyVersion(Integer keyVersion) { + this.keyVersion = keyVersion; + } + + public Integer getAdyenCryptoVersion() { + return adyenCryptoVersion; + } + + public void setAdyenCryptoVersion(Integer adyenCryptoVersion) { + this.adyenCryptoVersion = adyenCryptoVersion; + } + + public EncryptionCredentialDetails passphrase(String passphrase) { + this.passphrase = passphrase; + return this; + } + + public EncryptionCredentialDetails keyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + public EncryptionCredentialDetails keyVersion(Integer keyVersion) { + this.keyVersion = keyVersion; + return this; + } + + public EncryptionCredentialDetails adyenCryptoVersion(Integer adyenCryptoVersion) { + this.adyenCryptoVersion = adyenCryptoVersion; + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EncryptionCredentialDetails that = (EncryptionCredentialDetails) o; + return Objects.equals(passphrase, that.passphrase) + && Objects.equals(keyIdentifier, that.keyIdentifier) + && Objects.equals(keyVersion, that.keyVersion) + && Objects.equals(adyenCryptoVersion, that.adyenCryptoVersion); + } + + @Override + public int hashCode() { + return Objects.hash(passphrase, keyIdentifier, keyVersion, adyenCryptoVersion); + } + + @Override + public String toString() { + return "EncryptionCredentialDetails{" + + "passphrase='" + + passphrase + + '\'' + + ", keyIdentifier='" + + keyIdentifier + + '\'' + + ", keyVersion=" + + keyVersion + + ", adyenCryptoVersion=" + + adyenCryptoVersion + + '}'; + } +} diff --git a/src/main/java/com/adyen/security/clouddevice/NexoDerivedKeyGenerator.java b/src/main/java/com/adyen/security/clouddevice/NexoDerivedKeyGenerator.java new file mode 100644 index 000000000..2922d57c6 --- /dev/null +++ b/src/main/java/com/adyen/security/clouddevice/NexoDerivedKeyGenerator.java @@ -0,0 +1,73 @@ +package com.adyen.security.clouddevice; + +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ + +import static com.adyen.model.clouddevice.security.NexoDerivedKey.NEXO_CIPHER_KEY_LENGTH; +import static com.adyen.model.clouddevice.security.NexoDerivedKey.NEXO_HMAC_KEY_LENGTH; +import static com.adyen.model.clouddevice.security.NexoDerivedKey.NEXO_IV_LENGTH; + +import com.adyen.model.clouddevice.security.NexoDerivedKey; +import java.security.NoSuchAlgorithmException; +import java.security.spec.InvalidKeySpecException; +import java.util.Arrays; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.PBEKeySpec; + +final class NexoDerivedKeyGenerator { + + private NexoDerivedKeyGenerator() {} + + /** Given a passphrase, compute 80 byte key of key material according to crypto.md */ + static NexoDerivedKey deriveKeyMaterial(String passphrase) + throws NoSuchAlgorithmException, InvalidKeySpecException { + byte[] salt = "AdyenNexoV1Salt".getBytes(); + int iterations = 4000; + + PBEKeySpec spec = + new PBEKeySpec( + passphrase.toCharArray(), + salt, + iterations, + (NEXO_CIPHER_KEY_LENGTH + NEXO_HMAC_KEY_LENGTH + NEXO_IV_LENGTH) * 8); + SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); + byte[] key = skf.generateSecret(spec).getEncoded(); + + return readKeyData(key); + } + + /** Read a key material file of 80 bytes, splitting it in the hmacKey, cipherKey and iv */ + private static NexoDerivedKey readKeyData(byte[] key) { + NexoDerivedKey nexoDerivedKey = new NexoDerivedKey(); + + nexoDerivedKey.setHmacKey(Arrays.copyOfRange(key, 0, NEXO_HMAC_KEY_LENGTH)); + nexoDerivedKey.setCipherKey( + Arrays.copyOfRange( + key, NEXO_HMAC_KEY_LENGTH, NEXO_HMAC_KEY_LENGTH + NEXO_CIPHER_KEY_LENGTH)); + nexoDerivedKey.setIv( + Arrays.copyOfRange( + key, + NEXO_HMAC_KEY_LENGTH + NEXO_CIPHER_KEY_LENGTH, + NEXO_CIPHER_KEY_LENGTH + NEXO_HMAC_KEY_LENGTH + NEXO_IV_LENGTH)); + + return nexoDerivedKey; + } +} diff --git a/src/main/java/com/adyen/security/clouddevice/NexoSecurityException.java b/src/main/java/com/adyen/security/clouddevice/NexoSecurityException.java new file mode 100644 index 000000000..d9c75244b --- /dev/null +++ b/src/main/java/com/adyen/security/clouddevice/NexoSecurityException.java @@ -0,0 +1,40 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Java API Library + * + * Copyright (c) 2019 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen.security.clouddevice; + +public class NexoSecurityException extends Exception { + public NexoSecurityException(String message) { + super(message); + } + + public NexoSecurityException(String message, Throwable cause) { + super(message, cause); + } + + public NexoSecurityException(Throwable cause) { + super(cause); + } + + @Override + public String toString() { + return "NexoSecurityException{message=" + getMessage() + '}'; + } +} diff --git a/src/main/java/com/adyen/security/clouddevice/NexoSecurityManager.java b/src/main/java/com/adyen/security/clouddevice/NexoSecurityManager.java new file mode 100644 index 000000000..f2a33aabe --- /dev/null +++ b/src/main/java/com/adyen/security/clouddevice/NexoSecurityManager.java @@ -0,0 +1,223 @@ +package com.adyen.security.clouddevice; + +import static com.adyen.model.clouddevice.security.NexoDerivedKey.NEXO_IV_LENGTH; + +import com.adyen.model.clouddevice.MessageHeader; +import com.adyen.model.clouddevice.SaleToPOISecuredMessage; +import com.adyen.model.clouddevice.security.NexoDerivedKey; +import com.adyen.model.clouddevice.security.SecurityTrailer; +import java.nio.charset.StandardCharsets; +import java.security.GeneralSecurityException; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.Mac; +import javax.crypto.NoSuchPaddingException; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import org.apache.commons.codec.binary.Base64; + +/** + * Handles encryption, decryption, and integrity validation for Nexo SaleToPOI messages using AES + * and HMAC. + * + *

- Derives keys from EncryptionCredentialDetails - Encrypts and decrypts Nexo messages + * (AES-256-CBC) - Generates and validates HMAC (SHA-256) - Constructs and validates SecurityTrailer + */ +public class NexoSecurityManager { + + private final EncryptionCredentialDetails encryptionCredentialDetails; + private volatile NexoDerivedKey nexoDerivedKey; + + public NexoSecurityManager(EncryptionCredentialDetails encryptionCredentialDetails) + throws NexoSecurityException { + validateSecurityKey(encryptionCredentialDetails); + this.encryptionCredentialDetails = encryptionCredentialDetails; + } + + /** + * Encrypts the SaleToPOI message using the provided message header and security key. + * + * @param saleToPoiMessageJson the JSON string representing the SaleToPOI message + * @param messageHeader the message header for encryption + * @return encrypted SaleToPOISecuredMessage + * @throws NexoSecurityException if encryption fails + */ + public SaleToPOISecuredMessage encrypt(String saleToPoiMessageJson, MessageHeader messageHeader) + throws NexoSecurityException { + + try { + NexoDerivedKey derivedKey = getNexoDerivedKey(); + byte[] saleToPoiMessageByteArray = saleToPoiMessageJson.getBytes(StandardCharsets.UTF_8); + + // Generate a random initialization vector (IV) nonce + byte[] ivNonce = generateRandomIvNonce(); + + // Perform AES encryption + byte[] encryptedSaleToPoiMessage = + crypt(saleToPoiMessageByteArray, derivedKey, ivNonce, Cipher.ENCRYPT_MODE); + + // Generate HMAC for message authentication + byte[] hmacSignature = hmac(saleToPoiMessageByteArray, derivedKey); + + // Populate security trailer with metadata and HMAC + SecurityTrailer securityTrailer = new SecurityTrailer(); + securityTrailer.setAdyenCryptoVersion( + this.encryptionCredentialDetails.getAdyenCryptoVersion()); + securityTrailer.setKeyIdentifier(this.encryptionCredentialDetails.getKeyIdentifier()); + securityTrailer.setKeyVersion(this.encryptionCredentialDetails.getKeyVersion()); + securityTrailer.setNonce(Base64.encodeBase64String(ivNonce).getBytes()); + securityTrailer.setHmac(Base64.encodeBase64String(hmacSignature).getBytes()); + + // Construct the secured message with the encrypted content and securityTrailer + SaleToPOISecuredMessage saleToPoiSecuredMessage = new SaleToPOISecuredMessage(); + saleToPoiSecuredMessage.setMessageHeader(messageHeader); + saleToPoiSecuredMessage.setNexoBlob(Base64.encodeBase64String(encryptedSaleToPoiMessage)); + saleToPoiSecuredMessage.setSecurityTrailer(securityTrailer); + + return saleToPoiSecuredMessage; + + } catch (Exception e) { + throw new NexoSecurityException("Cannot encrypt the SaleToPOISecuredMessage", e); + } + } + + /** + * Decrypts the SaleToPOI secured message. + * + * @param saleToPoiSecuredMessage the encrypted message + * @return the decrypted SaleToPOI message as a JSON string + * @throws NexoSecurityException if decryption fails + */ + public String decrypt(SaleToPOISecuredMessage saleToPoiSecuredMessage) + throws NexoSecurityException { + try { + NexoDerivedKey derivedKey = getNexoDerivedKey(); + + // Decode the encrypted blob + byte[] encryptedSaleToPoiMessageByteArray = + Base64.decodeBase64(saleToPoiSecuredMessage.getNexoBlob().getBytes()); + + // Retrieve the nonce (IV) from the securityTrailer + byte[] ivNonceB64 = saleToPoiSecuredMessage.getSecurityTrailer().getNonce(); + String nonceString = new String(ivNonceB64, StandardCharsets.UTF_8); + byte[] ivNonce = Base64.decodeBase64(nonceString); + + // Decrypt the message + byte[] decryptedSaleToPoiMessageByteArray = + crypt(encryptedSaleToPoiMessageByteArray, derivedKey, ivNonce, Cipher.DECRYPT_MODE); + + // Validate HMAC to ensure message integrity + byte[] receivedHmac = saleToPoiSecuredMessage.getSecurityTrailer().getHmac(); + + String hmacString = new String(receivedHmac, StandardCharsets.UTF_8); + byte[] hmacBytes = Base64.decodeBase64(hmacString); + validateHmac(hmacBytes, decryptedSaleToPoiMessageByteArray, derivedKey); + + return new String(decryptedSaleToPoiMessageByteArray, StandardCharsets.UTF_8); + + } catch (Exception e) { + throw new NexoSecurityException("Cannot decrypt the SaleToPOISecuredMessage", e); + } + } + + /** + * Validates the encryptionCredentialDetails to ensure all required fields are present. + * + * @param encryptionCredentialDetails the encryptionCredentialDetails to validate + * @throws NexoSecurityException if the security key is invalid + */ + private void validateSecurityKey(EncryptionCredentialDetails encryptionCredentialDetails) + throws NexoSecurityException { + if (encryptionCredentialDetails == null + || encryptionCredentialDetails.getPassphrase() == null + || encryptionCredentialDetails.getPassphrase().isEmpty() + || encryptionCredentialDetails.getKeyIdentifier() == null + || encryptionCredentialDetails.getKeyVersion() == null + || encryptionCredentialDetails.getAdyenCryptoVersion() == null) { + throw new NexoSecurityException("Invalid Security Key"); + } + } + + /** + * Lazily initializes and retrieves the derived key material for encryption/decryption. + * + * @return the derived key material + */ + NexoDerivedKey getNexoDerivedKey() throws GeneralSecurityException { + if (nexoDerivedKey == null) { + synchronized (this) { + if (nexoDerivedKey == null) { + nexoDerivedKey = + NexoDerivedKeyGenerator.deriveKeyMaterial( + this.encryptionCredentialDetails.getPassphrase()); + } + } + } + return nexoDerivedKey; + } + + /** Performs AES encryption/decryption using the derived key and provided IV. */ + private byte[] crypt(byte[] bytes, NexoDerivedKey dk, byte[] ivNonce, int mode) + throws NoSuchAlgorithmException, + NoSuchPaddingException, + IllegalBlockSizeException, + BadPaddingException, + InvalidKeyException, + InvalidAlgorithmParameterException { + + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + SecretKeySpec secretKeySpec = new SecretKeySpec(dk.getCipherKey(), "AES"); + + // Derive the actual IV by XORing the derived IV with the nonce + byte[] iv = dk.getIv(); + byte[] actualIV = new byte[NEXO_IV_LENGTH]; + for (int i = 0; i < NEXO_IV_LENGTH; i++) { + actualIV[i] = (byte) (iv[i] ^ ivNonce[i]); + } + + IvParameterSpec ivParameterSpec = new IvParameterSpec(actualIV); + cipher.init(mode, secretKeySpec, ivParameterSpec); + return cipher.doFinal(bytes); + } + + /** Generates an HMAC for message authentication. */ + byte[] hmac(byte[] bytes, NexoDerivedKey derivedKey) + throws NoSuchAlgorithmException, InvalidKeyException { + Mac mac = Mac.getInstance("HmacSHA256"); + SecretKeySpec s = new SecretKeySpec(derivedKey.getHmacKey(), "HmacSHA256"); + + mac.init(s); + return mac.doFinal(bytes); + } + + /** Validates the HMAC of a decrypted message to ensure data integrity. */ + void validateHmac(byte[] receivedHmac, byte[] decryptedMessage, NexoDerivedKey derivedKey) + throws NexoSecurityException, InvalidKeyException, NoSuchAlgorithmException { + byte[] hmac = hmac(decryptedMessage, derivedKey); + boolean valid = MessageDigest.isEqual(hmac, receivedHmac); + + if (!valid) { + throw new NexoSecurityException("HMAC validation failed"); + } + } + + /** Generates a random IV nonce using a secure random number generator. */ + private byte[] generateRandomIvNonce() { + byte[] ivNonce = new byte[NEXO_IV_LENGTH]; + SecureRandom secureRandom; + try { + secureRandom = SecureRandom.getInstance("NativePRNGNonBlocking"); + } catch (Exception NoSuchAlgorithmException) { + // Fallback to default SecureRandom implementation + secureRandom = new SecureRandom(); + } + secureRandom.nextBytes(ivNonce); + return ivNonce; + } +} diff --git a/src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java b/src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java new file mode 100644 index 000000000..b647db7fc --- /dev/null +++ b/src/main/java/com/adyen/service/clouddevice/CloudDeviceApi.java @@ -0,0 +1,414 @@ +package com.adyen.service.clouddevice; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.clouddevice.*; +import com.adyen.security.clouddevice.EncryptionCredentialDetails; +import com.adyen.security.clouddevice.NexoSecurityManager; +import com.adyen.service.exception.CloudDeviceException; +import com.adyen.service.resource.Resource; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; +import java.util.Map; + +/** + * Cloud Device API service + * + *

With the Cloud device API you can: - send Terminal API requests to the Adyen cloud endpoints. + * - check the cloud connection of a payment terminal or of a device used in a Mobile solution for + * in-person payments. + */ +public class CloudDeviceApi extends Service { + + public static final String API_VERSION = "1"; + + protected String baseURL; + + private final ObjectMapper objectMapper = new ObjectMapper(); + + /** + * CloudDeviceApi constructor in {@link com.adyen.service.clouddevice package}. + * + * @param client {@link Client } (required) + */ + public CloudDeviceApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://device-api-test.adyen.com/v" + API_VERSION); + } + + /** + * Send a synchronous payment request. + * + * @param merchantAccount The unique identifier of the merchant account + * @param deviceId The unique identifier of the payment device that you send this request to (must + * match POIID in the MessageHeader). + * @param cloudDeviceApiRequest The request to send. + * @return instance of CloudDeviceApiResponse + * @throws CloudDeviceException when an error occurs + */ + public CloudDeviceApiResponse sendSync( + String merchantAccount, String deviceId, CloudDeviceApiRequest cloudDeviceApiRequest) + throws CloudDeviceException { + + try { + // Add path params + Map pathParams = new HashMap<>(); + + if (merchantAccount == null) { + throw new IllegalArgumentException("Please provide the merchantAccount path parameter"); + } + pathParams.put("merchantAccount", merchantAccount); + + if (deviceId == null) { + throw new IllegalArgumentException("Please provide the deviceId path parameter"); + } + pathParams.put("deviceId", deviceId); + + // set deviceId + cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader().setPOIID(deviceId); + + String requestBody = cloudDeviceApiRequest.toJson(); + Resource resource = + new Resource( + this, this.baseURL + "/merchants/{merchantAccount}/devices/{deviceId}/sync", null); + String response = + resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); + + return CloudDeviceApiResponse.fromJson(response); + + } catch (Exception e) { + throw new CloudDeviceException(e.getMessage(), e); + } + } + + /** + * Send an asynchronous payment request. + * + * @param merchantAccount The unique identifier of the merchant account + * @param deviceId The unique identifier of the device that you send this request to (must match + * POIID in the MessageHeader). + * @param cloudDeviceApiRequest The request to send. + * @return instance of CloudDeviceApiAsyncResponse wrapping the response (success or an + * EventNotification with error details) + * @throws CloudDeviceException when an error occurs + */ + public CloudDeviceApiAsyncResponse sendAsync( + String merchantAccount, String deviceId, CloudDeviceApiRequest cloudDeviceApiRequest) + throws CloudDeviceException { + + try { + // Add path params + Map pathParams = new HashMap<>(); + + if (merchantAccount == null) { + throw new IllegalArgumentException("Please provide the merchantAccount path parameter"); + } + pathParams.put("merchantAccount", merchantAccount); + + if (deviceId == null) { + throw new IllegalArgumentException("Please provide the deviceId path parameter"); + } + pathParams.put("deviceId", deviceId); + + // set deviceId + cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader().setPOIID(deviceId); + + String requestBody = cloudDeviceApiRequest.toJson(); + Resource resource = + new Resource( + this, this.baseURL + "/merchants/{merchantAccount}/devices/{deviceId}/async", null); + String response = + resource.request(requestBody, null, ApiConstants.HttpMethod.POST, pathParams); + + CloudDeviceApiAsyncResponse cloudDeviceApiAsyncResponse = new CloudDeviceApiAsyncResponse(); + + // Define response based on the outcome + if ("ok".equals(response)) { + cloudDeviceApiAsyncResponse.setResult(response); + } else { + CloudDeviceApiResponse errorResponse = CloudDeviceApiResponse.fromJson(response); + cloudDeviceApiAsyncResponse.setSaleToPOIRequest(errorResponse.getSaleToPOIRequest()); + } + + return cloudDeviceApiAsyncResponse; + + } catch (Exception e) { + throw new CloudDeviceException(e.getMessage(), e); + } + } + + /** + * Get a list of connected devices for a merchant account. + * + * @param merchantAccount The unique identifier of the merchant account. + * @return An instance of ConnectedDevicesResponse. + * @throws CloudDeviceException when an error occurs + */ + public ConnectedDevicesResponse getConnectedDevices(String merchantAccount) + throws CloudDeviceException { + return getConnectedDevices(merchantAccount, null); + } + + /** + * Get a list of connected devices for a merchant account and store. + * + * @param merchantAccount The unique identifier of the merchant account. + * @param store The unique identifier of the store. + * @return An instance of ConnectedDevicesResponse. + * @throws CloudDeviceException when an error occurs + */ + public ConnectedDevicesResponse getConnectedDevices(String merchantAccount, String store) + throws CloudDeviceException { + + try { + // Add path params + Map pathParams = new HashMap<>(); + + if (merchantAccount == null) { + throw new IllegalArgumentException("Please provide the merchantAccount path parameter"); + } + pathParams.put("merchantAccount", merchantAccount); + + // Add query params + Map queryParams = new HashMap<>(); + if (store != null) { + queryParams.put("store", store); + } + + Resource resource = + new Resource(this, this.baseURL + "/merchants/{merchantAccount}/connectedDevices", null); + String response = + resource.request( + null, + null, + ApiConstants.HttpMethod.GET, + pathParams, + queryParams.isEmpty() ? null : queryParams); + + return ConnectedDevicesResponse.fromJson(response); + + } catch (Exception e) { + throw new CloudDeviceException(e.getMessage(), e); + } + } + + /** + * Get the status of a device. + * + * @param merchantAccount The unique identifier of the merchant account. + * @param deviceId The unique identifier of the device. + * @return An instance of DeviceStatus. + * @throws CloudDeviceException when an error occurs + */ + public DeviceStatusResponse getDeviceStatus(String merchantAccount, String deviceId) + throws CloudDeviceException { + + try { + // Add path params + Map pathParams = new HashMap<>(); + + if (merchantAccount == null) { + throw new IllegalArgumentException("Please provide the merchantAccount path parameter"); + } + pathParams.put("merchantAccount", merchantAccount); + + if (deviceId == null) { + throw new IllegalArgumentException("Please provide the deviceId path parameter"); + } + pathParams.put("deviceId", deviceId); + + Resource resource = + new Resource( + this, this.baseURL + "/merchants/{merchantAccount}/devices/{deviceId}/status", null); + String response = resource.request(null, null, ApiConstants.HttpMethod.GET, pathParams, null); + + return DeviceStatusResponse.fromJson(response); + + } catch (Exception e) { + throw new CloudDeviceException(e.getMessage(), e); + } + } + + /** + * Send a synchronous encrypted payment request. + * + * @param merchantAccount The unique identifier of the merchant account + * @param deviceId The unique identifier of the payment device that you send this request to (must + * match POIID in the MessageHeader). + * @param cloudDeviceApiRequest The request to send. + * @return instance of CloudDeviceApiResponse + * @throws CloudDeviceException when an error occurs + */ + public CloudDeviceApiResponse sendEncryptedSync( + String merchantAccount, + String deviceId, + CloudDeviceApiRequest cloudDeviceApiRequest, + EncryptionCredentialDetails encryptionCredentialDetails) + throws CloudDeviceException { + + try { + NexoSecurityManager nexoSecurityManager = + new NexoSecurityManager(encryptionCredentialDetails); + + // Add path params + Map pathParams = new HashMap<>(); + + if (merchantAccount == null) { + throw new IllegalArgumentException("Please provide the merchantAccount path parameter"); + } + pathParams.put("merchantAccount", merchantAccount); + + if (deviceId == null) { + throw new IllegalArgumentException("Please provide the deviceId path parameter"); + } + pathParams.put("deviceId", deviceId); + + // set deviceId + cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader().setPOIID(deviceId); + + // encrypt payload + SaleToPOISecuredMessage saleToPOISecuredRequest = + nexoSecurityManager.encrypt( + cloudDeviceApiRequest.toJson(), + cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader()); + + CloudDeviceApiSecuredRequest cloudDeviceApiSecuredRequest = + new CloudDeviceApiSecuredRequest(); + cloudDeviceApiSecuredRequest.setSaleToPOIRequest(saleToPOISecuredRequest); + + String encryptedJson = cloudDeviceApiSecuredRequest.toJson(); + + // perform API call + Resource resource = + new Resource( + this, this.baseURL + "/merchants/{merchantAccount}/devices/{deviceId}/sync", null); + String response = + resource.request(encryptedJson, null, ApiConstants.HttpMethod.POST, pathParams); + + CloudDeviceApiSecuredResponse cloudDeviceApiSecuredResponse = + CloudDeviceApiSecuredResponse.fromJson(response); + + String jsonDecryptedResponse = + nexoSecurityManager.decrypt(cloudDeviceApiSecuredResponse.getSaleToPOIResponse()); + + return CloudDeviceApiResponse.fromJson(jsonDecryptedResponse); + + } catch (Exception e) { + throw new CloudDeviceException(e.getMessage(), e); + } + } + + /** + * Send an asynchronous encrypted payment request. + * + * @param merchantAccount The unique identifier of the merchant account + * @param deviceId The unique identifier of the payment device that you send this request to (must + * match POIID in the MessageHeader). + * @param cloudDeviceApiRequest The request to send. + * @return instance of CloudDeviceApiResponse + * @throws CloudDeviceException when an error occurs + */ + public String sendEncryptedAsync( + String merchantAccount, + String deviceId, + CloudDeviceApiRequest cloudDeviceApiRequest, + EncryptionCredentialDetails encryptionCredentialDetails) + throws CloudDeviceException { + + try { + NexoSecurityManager nexoSecurityManager = + new NexoSecurityManager(encryptionCredentialDetails); + + // Add path params + Map pathParams = new HashMap<>(); + + if (merchantAccount == null) { + throw new IllegalArgumentException("Please provide the merchantAccount path parameter"); + } + pathParams.put("merchantAccount", merchantAccount); + + if (deviceId == null) { + throw new IllegalArgumentException("Please provide the deviceId path parameter"); + } + pathParams.put("deviceId", deviceId); + + // set deviceId + cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader().setPOIID(deviceId); + + // encrypt payload + SaleToPOISecuredMessage saleToPOISecuredRequest = + nexoSecurityManager.encrypt( + cloudDeviceApiRequest.toJson(), + cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader()); + + CloudDeviceApiSecuredRequest cloudDeviceApiSecuredRequest = + new CloudDeviceApiSecuredRequest(); + cloudDeviceApiSecuredRequest.setSaleToPOIRequest(saleToPOISecuredRequest); + + String encryptedJson = cloudDeviceApiSecuredRequest.toJson(); + + // perform API call + Resource resource = + new Resource( + this, this.baseURL + "/merchants/{merchantAccount}/devices/{deviceId}/async", null); + String response = + resource.request(encryptedJson, null, ApiConstants.HttpMethod.POST, pathParams); + + return response; + + } catch (Exception e) { + throw new CloudDeviceException(e.getMessage(), e); + } + } + + /** + * Decrypt an event notification + * + * @param payload Event notification in JSON string format: it can be SaleToPOIResponse (async + * response) or SaleToPOIRequest (event notification) + * @param encryptionCredentialDetails The details of the encryption credential used for decrypting + * the payload (nexoBlob) + * @return the decrypted payload + * @throws CloudDeviceException when an error occurs + */ + public String decryptNotification( + String payload, EncryptionCredentialDetails encryptionCredentialDetails) + throws CloudDeviceException { + + try { + NexoSecurityManager nexoSecurityManager = + new NexoSecurityManager(encryptionCredentialDetails); + + ObjectMapper objectMapper = new ObjectMapper(); + JsonNode jsonNode; + + try { + jsonNode = objectMapper.readTree(payload); + } catch (Exception e) { + throw new CloudDeviceException("Invalid payload"); + } + + String decryptedMessage; + if (jsonNode.has("SaleToPOIResponse")) { + // async response received + var cloudDeviceApiSecuredResponse = CloudDeviceApiSecuredResponse.fromJson(payload); + decryptedMessage = + nexoSecurityManager.decrypt(cloudDeviceApiSecuredResponse.getSaleToPOIResponse()); + } else if (jsonNode.has("SaleToPOIRequest")) { + var cloudDeviceApiSecuredRequest = CloudDeviceApiSecuredRequest.fromJson(payload); + decryptedMessage = + nexoSecurityManager.decrypt(cloudDeviceApiSecuredRequest.getSaleToPOIRequest()); + } else { + throw new CloudDeviceException( + "Unexpected payload without SaleToPOIResponse or SaleToPOIRequest"); + } + + return decryptedMessage; + + } catch (Exception e) { + throw new CloudDeviceException(e.getMessage(), e); + } + } +} diff --git a/src/main/java/com/adyen/service/exception/CloudDeviceException.java b/src/main/java/com/adyen/service/exception/CloudDeviceException.java new file mode 100644 index 000000000..796f5d613 --- /dev/null +++ b/src/main/java/com/adyen/service/exception/CloudDeviceException.java @@ -0,0 +1,15 @@ +package com.adyen.service.exception; + +public class CloudDeviceException extends Exception { + + public CloudDeviceException(String message) { + super(message); + } + + public CloudDeviceException(String message, Throwable cause) {} + + @Override + public String toString() { + return "CloudDeviceException{message=" + getMessage() + '}'; + } +} diff --git a/src/test/java/com/adyen/BaseIntegrationTest.java b/src/test/java/com/adyen/BaseIntegrationTest.java new file mode 100644 index 000000000..1ef1d706f --- /dev/null +++ b/src/test/java/com/adyen/BaseIntegrationTest.java @@ -0,0 +1,81 @@ +/* + * Adyen Java API Library + * + * Copyright (c) 2025 Adyen B.V. + * This file is open source and available under the MIT license. + * See the LICENSE file for more info. + */ +package com.adyen; + +import com.adyen.enums.Environment; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +/** + * Base class for Integration tests + * + *

Define in src/test/resources the configuration for the tests + * + *

``` ADYEN_API_KEY= ADYEN_MERCHANT_ACCOUNT= ADYEN_TERMINAL_DEVICE_ID= + * ADYEN_TERMINAL_DEVICE_KEY_IDENTIFIER= ADYEN_TERMINAL_DEVICE_PASSPHRASE= ``` + */ +public class BaseIntegrationTest { + + private static Properties properties = null; + + protected Client getClient() { + return new Client(new Config().apiKey(getApiKey()).environment(Environment.TEST)); + } + + protected String getApiKey() { + return getProperty("ADYEN_API_KEY"); + } + + protected String getMerchantAccount() { + return getProperty("ADYEN_MERCHANT_ACCOUNT"); + } + + protected String getTerminalDeviceId() { + return getProperty("ADYEN_TERMINAL_DEVICE_ID"); + } + + protected String getTerminalDeviceKeyIdentifier() { + return getProperty("ADYEN_TERMINAL_DEVICE_KEY_IDENTIFIER"); + } + + protected String getTerminalDevicePassphrase() { + return getProperty("ADYEN_TERMINAL_DEVICE_PASSPHRASE"); + } + + private Properties getProperties() { + if (properties == null) { + properties = new Properties(); + try (InputStream inputStream = + BaseIntegrationTest.class.getClassLoader().getResourceAsStream("config.properties")) { + if (inputStream != null) { + properties.load(inputStream); + } + } catch (IOException e) { + // Do nothing, properties will be empty + } + } + + return properties; + } + + private String getProperty(String name) { + String property = System.getenv(name); + + if (property != null && !property.isEmpty()) { + return property; + } + property = getProperties().getProperty(name); + + if (property == null || property.isEmpty()) { + throw new RuntimeException("Property " + name + " not defined"); + } + + return property; + } +} diff --git a/src/test/java/com/adyen/clouddevice/CloudDeviceApiTerminalTest.java b/src/test/java/com/adyen/clouddevice/CloudDeviceApiTerminalTest.java new file mode 100644 index 000000000..8b1a7d1d0 --- /dev/null +++ b/src/test/java/com/adyen/clouddevice/CloudDeviceApiTerminalTest.java @@ -0,0 +1,163 @@ +package com.adyen.clouddevice; + +import static org.junit.Assert.assertNotNull; + +import com.adyen.BaseIntegrationTest; +import com.adyen.model.clouddevice.*; +import com.adyen.security.clouddevice.EncryptionCredentialDetails; +import com.adyen.service.clouddevice.CloudDeviceApi; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.UUID; +import org.junit.Ignore; +import org.junit.Test; + +/** + * Verify Terminal integration: tests to send API requests to the Cloud Device API and test the + * Terminal responds as expected. + * + *

Don't forget to: - Enable the terminal - Enable the test to run (by removing/comment + * the @Ignore annotation) - Set required variables (ADYEN_API_KEY, ADYEN_MERCHANT_ACCOUNT, + * ADYEN_TERMINAL_DEVICE_ID) creating the src/main/resources/config.properties file: + * + *

# Adyen Test Credentials ADYEN_API_KEY=##### ADYEN_MERCHANT_ACCOUNT=MyMerchantAccount + * ADYEN_TERMINAL_DEVICE_ID=V400m-1234567890 # Terminal configuration + * ADYEN_TERMINAL_DEVICE_KEY_IDENTIFIER==##### ADYEN_TERMINAL_DEVICE_PASSPHRASE==##### + * + *

- Run one test at the time with `mvn test -Dtest=CloudDeviceApiTerminalTest#sendSync` - + * Disable the test again + */ +public class CloudDeviceApiTerminalTest extends BaseIntegrationTest { + + @Ignore // enable when you want to test with the Terminal + @Test + public void sendSync() throws Exception { + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(getClient()); + + CloudDeviceApiRequest cloudDeviceApiRequest = + createCloudDeviceAPIPaymentRequest(getTerminalDeviceId()); + + var response = + cloudDeviceApi.sendSync(getMerchantAccount(), getTerminalDeviceId(), cloudDeviceApiRequest); + + assertNotNull(response); + System.out.println("Response: " + response); + } + + @Ignore // enable when you want to test with the Terminal + @Test + public void sendAsync() throws Exception { + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(getClient()); + + CloudDeviceApiRequest cloudDeviceApiRequest = + createCloudDeviceAPIPaymentRequest(getTerminalDeviceId()); + + cloudDeviceApiRequest.getSaleToPOIRequest().setPaymentRequest(null); + + var response = + cloudDeviceApi.sendAsync( + getMerchantAccount(), getTerminalDeviceId(), cloudDeviceApiRequest); + + assertNotNull(response); + System.out.println("Response: " + response); + } + + @Ignore // enable when you want to test with the Terminal + @Test + public void sendEncryptedSync() throws Exception { + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(getClient()); + + CloudDeviceApiRequest cloudDeviceApiRequest = + createCloudDeviceAPIPaymentRequest(getTerminalDeviceId()); + + EncryptionCredentialDetails encryptionCredentialDetails = + new EncryptionCredentialDetails() + .adyenCryptoVersion(1) + .keyIdentifier(getTerminalDeviceKeyIdentifier()) + .keyVersion(1) + .passphrase(getTerminalDevicePassphrase()); + + var response = + cloudDeviceApi.sendEncryptedSync( + getMerchantAccount(), + getTerminalDeviceId(), + cloudDeviceApiRequest, + encryptionCredentialDetails); + + assertNotNull(response); + System.out.println("Response: " + response); + } + + @Ignore // enable when you want to test with the Terminal + @Test + public void sendEncryptedAsync() throws Exception { + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(getClient()); + + CloudDeviceApiRequest cloudDeviceApiRequest = + createCloudDeviceAPIPaymentRequest(getTerminalDeviceId()); + + EncryptionCredentialDetails encryptionCredentialDetails = + new EncryptionCredentialDetails() + .adyenCryptoVersion(1) + .keyIdentifier(getTerminalDeviceKeyIdentifier()) + .keyVersion(1) + .passphrase(getTerminalDevicePassphrase()); + + var response = + cloudDeviceApi.sendEncryptedAsync( + getMerchantAccount(), + getTerminalDeviceId(), + cloudDeviceApiRequest, + encryptionCredentialDetails); + + assertNotNull(response); + System.out.println("Response: " + response); + } + + protected CloudDeviceApiRequest createCloudDeviceAPIPaymentRequest(String deviceId) { + SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); + + var randomId = UUID.randomUUID().toString().replaceAll("-", "").substring(0, 10); + + MessageHeader messageHeader = new MessageHeader(); + messageHeader.setProtocolVersion("3.0"); + messageHeader.setMessageClass(MessageClassType.SERVICE); + messageHeader.setMessageCategory(MessageCategoryType.PAYMENT); + messageHeader.setMessageType(MessageType.REQUEST); + messageHeader.setSaleID(randomId); + messageHeader.setServiceID(randomId); + messageHeader.setPOIID(deviceId); + + saleToPOIRequest.setMessageHeader(messageHeader); + + PaymentRequest paymentRequest = new PaymentRequest(); + + SaleData saleData = new SaleData(); + TransactionIdentification transactionIdentification = new TransactionIdentification(); + transactionIdentification.setTransactionID(randomId); + OffsetDateTime timestamp = OffsetDateTime.now(ZoneOffset.UTC); + transactionIdentification.setTimeStamp(timestamp); + saleData.setSaleTransactionID(transactionIdentification); + + PaymentTransaction paymentTransaction = new PaymentTransaction(); + AmountsReq amountsReq = new AmountsReq(); + amountsReq.setCurrency("EUR"); + amountsReq.setRequestedAmount(BigDecimal.ONE); + paymentTransaction.setAmountsReq(amountsReq); + + paymentRequest.setSaleData(saleData); + paymentRequest.setPaymentTransaction(paymentTransaction); + + saleToPOIRequest.setPaymentRequest(paymentRequest); + + CloudDeviceApiRequest cloudDeviceApiRequest = new CloudDeviceApiRequest(); + cloudDeviceApiRequest.setSaleToPOIRequest(saleToPOIRequest); + + return cloudDeviceApiRequest; + } +} diff --git a/src/test/java/com/adyen/clouddevice/CloudDeviceApiTest.java b/src/test/java/com/adyen/clouddevice/CloudDeviceApiTest.java new file mode 100644 index 000000000..df86d7bdf --- /dev/null +++ b/src/test/java/com/adyen/clouddevice/CloudDeviceApiTest.java @@ -0,0 +1,347 @@ +package com.adyen.clouddevice; + +import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.verify; + +import com.adyen.BaseTest; +import com.adyen.Client; +import com.adyen.constants.ApiConstants; +import com.adyen.model.clouddevice.*; +import com.adyen.security.clouddevice.EncryptionCredentialDetails; +import com.adyen.service.clouddevice.CloudDeviceApi; +import com.adyen.service.exception.CloudDeviceException; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Map; +import org.junit.Assert; +import org.junit.Test; + +public class CloudDeviceApiTest extends BaseTest { + + @Test + public void sendSync() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/payment-sync-success.json"); + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); + + var response = + cloudDeviceApi.sendSync("myMerchant", "P400Plus-123456789", cloudDeviceApiRequest); + + assertNotNull(response); + assertNotNull(response.getSaleToPOIResponse()); + assertNotNull(response.getSaleToPOIResponse().getMessageHeader()); + assertEquals( + "P400Plus-123456789", response.getSaleToPOIResponse().getMessageHeader().getPOIID()); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/devices/P400Plus-123456789/sync", + cloudDeviceApiRequest.toJson(), + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null); + } + + @Test + public void sendAsync() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/payment-async-success.json"); + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); + + var response = + cloudDeviceApi.sendAsync("myMerchant", "P400Plus-123456789", cloudDeviceApiRequest); + + assertNotNull(response); + assertNotNull("ok", response); + assertNull(response.getSaleToPOIRequest()); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/devices/P400Plus-123456789/async", + cloudDeviceApiRequest.toJson(), + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null); + } + + @Test + public void sendAsyncReturningError() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/payment-async-error.json"); + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); + + var response = + cloudDeviceApi.sendAsync("myMerchant", "P400Plus-123456789", cloudDeviceApiRequest); + + assertNotNull(response); + assertNull(response.getResult()); + assertNotNull(response.getSaleToPOIRequest()); + + assertEquals( + "Invalid event", + EventToNotifyType.REJECT, + response.getSaleToPOIRequest().getEventNotification().getEventToNotify()); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/devices/P400Plus-123456789/async", + cloudDeviceApiRequest.toJson(), + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.POST, + null); + } + + @Test + public void sendEncryptedSync() throws Exception { + Client client = + createMockClientFromFile("mocks/clouddevice/payment-sync-encrypted-success.json"); + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); + + EncryptionCredentialDetails encryptionCredentialDetails = + new EncryptionCredentialDetails() + .adyenCryptoVersion(0) + .keyIdentifier("CryptoKeyIdentifier12345") + .keyVersion(0) + .passphrase("p@ssw0rd123456"); + + var response = + cloudDeviceApi.sendEncryptedSync( + "TestMerchantAccount", + "MX915-284251016", + cloudDeviceApiRequest, + encryptionCredentialDetails); + + assertNotNull(response); + assertNotNull(response.getSaleToPOIResponse()); + assertNotNull(response.getSaleToPOIResponse().getMessageHeader()); + assertEquals("MX915-284251016", response.getSaleToPOIResponse().getMessageHeader().getPOIID()); + + verify(client.getHttpClient()) + .request( + eq( + "https://device-api-test.adyen.com/v1/merchants/TestMerchantAccount/devices/MX915-284251016/sync"), + argThat( + json -> { + assertTrue( + json.contains("\"NexoBlob\":"), "JSON payload should contain NexoBlob field"); + return true; + }), + eq(client.getConfig()), + eq(false), + isNull(), + eq(ApiConstants.HttpMethod.POST), + isNull()); + } + + @Test + public void sendEncryptedAsync() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/payment-async-success.json"); + + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); + + EncryptionCredentialDetails encryptionCredentialDetails = + new EncryptionCredentialDetails() + .adyenCryptoVersion(0) + .keyIdentifier("CryptoKeyIdentifier12345") + .keyVersion(0) + .passphrase("p@ssw0rd123456"); + + var response = + cloudDeviceApi.sendEncryptedAsync( + "TestMerchantAccount", + "MX915-284251016", + cloudDeviceApiRequest, + encryptionCredentialDetails); + + assertNotNull(response); + assertEquals("ok", response); + + verify(client.getHttpClient()) + .request( + eq( + "https://device-api-test.adyen.com/v1/merchants/TestMerchantAccount/devices/MX915-284251016/async"), + argThat( + json -> { + assertTrue( + json.contains("\"NexoBlob\":"), "JSON payload should contain NexoBlob field"); + return true; + }), + eq(client.getConfig()), + eq(false), + isNull(), + eq(ApiConstants.HttpMethod.POST), + isNull()); + } + + @Test + public void getConnectedDevices() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/connected-devices.json"); + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + ConnectedDevicesResponse response = cloudDeviceApi.getConnectedDevices("myMerchant"); + + assertNotNull(response); + assertEquals(2, response.getUniqueDeviceIds().size()); + assertEquals("P400Plus-123456789", response.getUniqueDeviceIds().get(0)); + assertEquals("V400m-123456789", response.getUniqueDeviceIds().get(1)); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/connectedDevices", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + null); + } + + @Test + public void getConnectedDevicesWithStore() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/connected-devices.json"); + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + ConnectedDevicesResponse response = cloudDeviceApi.getConnectedDevices("myMerchant", "myStore"); + + assertNotNull(response); + assertEquals(2, response.getUniqueDeviceIds().size()); + assertEquals("P400Plus-123456789", response.getUniqueDeviceIds().get(0)); + assertEquals("V400m-123456789", response.getUniqueDeviceIds().get(1)); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/connectedDevices", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + Map.of("store", "myStore")); + } + + @Test + public void getDeviceStatus() throws Exception { + Client client = createMockClientFromFile("mocks/clouddevice/status-device.json"); + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + DeviceStatusResponse response = + cloudDeviceApi.getDeviceStatus("myMerchant", "AMS1-000168242800763"); + + assertNotNull(response); + assertEquals("AMS1-000168242800763", response.getDeviceId()); + assertEquals(DeviceStatus.ONLINE, response.getStatus()); + + verify(client.getHttpClient()) + .request( + "https://device-api-test.adyen.com/v1/merchants/myMerchant/devices/AMS1-000168242800763/status", + null, + client.getConfig(), + false, + null, + ApiConstants.HttpMethod.GET, + null); + } + + @Test + public void decryptNotification() throws Exception { + + Client client = createMockClientFromResponse(""); // nop client + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + String payload = getFileContents("mocks/clouddevice/encrypted-event-notification.json"); + + EncryptionCredentialDetails encryptionCredentialDetails = + new EncryptionCredentialDetails() + .adyenCryptoVersion(1) + .keyIdentifier("Key123456789crypt") + .keyVersion(1) + .passphrase("P@ssw0rd123456"); + + var response = cloudDeviceApi.decryptNotification(payload, encryptionCredentialDetails); + + assertNotNull(response); + assertFalse(response.contains("\"NexoBlob\":")); + assertTrue(response.contains("\"PaymentResponse\":")); + } + + @Test + public void decryptNotificationInvalidPayload() throws Exception { + + Client client = createMockClientFromResponse(""); // nop client + CloudDeviceApi cloudDeviceApi = new CloudDeviceApi(client); + + String payload = "{...}"; + + EncryptionCredentialDetails encryptionCredentialDetails = + new EncryptionCredentialDetails() + .adyenCryptoVersion(1) + .keyIdentifier("Key123456789crypt") + .keyVersion(1) + .passphrase("P@ssw0rd123456"); + + Assert.assertThrows( + CloudDeviceException.class, + () -> cloudDeviceApi.decryptNotification(payload, encryptionCredentialDetails)); + } + + protected CloudDeviceApiRequest createCloudDeviceAPIPaymentRequest() { + SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); + + MessageHeader messageHeader = new MessageHeader(); + messageHeader.setProtocolVersion("3.0"); + messageHeader.setMessageClass(MessageClassType.SERVICE); + messageHeader.setMessageCategory(MessageCategoryType.PAYMENT); + messageHeader.setMessageType(MessageType.REQUEST); + messageHeader.setSaleID("001"); + messageHeader.setServiceID("001"); + messageHeader.setPOIID("P400Plus-123456789"); + + saleToPOIRequest.setMessageHeader(messageHeader); + + PaymentRequest paymentRequest = new PaymentRequest(); + + SaleData saleData = new SaleData(); + TransactionIdentification transactionIdentification = new TransactionIdentification(); + transactionIdentification.setTransactionID("001"); + OffsetDateTime timestamp = OffsetDateTime.now(ZoneOffset.UTC); + transactionIdentification.setTimeStamp(timestamp); + saleData.setSaleTransactionID(transactionIdentification); + + PaymentTransaction paymentTransaction = new PaymentTransaction(); + AmountsReq amountsReq = new AmountsReq(); + amountsReq.setCurrency("EUR"); + amountsReq.setRequestedAmount(BigDecimal.ONE); + paymentTransaction.setAmountsReq(amountsReq); + + paymentRequest.setSaleData(saleData); + paymentRequest.setPaymentTransaction(paymentTransaction); + + saleToPOIRequest.setPaymentRequest(paymentRequest); + + CloudDeviceApiRequest cloudDeviceApiRequest = new CloudDeviceApiRequest(); + cloudDeviceApiRequest.setSaleToPOIRequest(saleToPOIRequest); + + return cloudDeviceApiRequest; + } +} diff --git a/src/test/java/com/adyen/security/clouddevice/NexoSecurityManagerTest.java b/src/test/java/com/adyen/security/clouddevice/NexoSecurityManagerTest.java new file mode 100644 index 000000000..475754914 --- /dev/null +++ b/src/test/java/com/adyen/security/clouddevice/NexoSecurityManagerTest.java @@ -0,0 +1,152 @@ +package com.adyen.security.clouddevice; + +import static org.junit.Assert.*; + +import com.adyen.BaseTest; +import com.adyen.model.clouddevice.*; +import java.math.BigDecimal; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import org.apache.commons.codec.binary.Base64; +import org.junit.Test; + +public class NexoSecurityManagerTest extends BaseTest { + + @Test + public void testEncryptDecrypt() throws Exception { + EncryptionCredentialDetails encryptionCredentialDetails = + new EncryptionCredentialDetails() + .adyenCryptoVersion(1) + .keyIdentifier("SpecV2TestMACKey") + .keyVersion(1) + .passphrase("12345678901234567890123456789012"); + + NexoSecurityManager nexoSecurityManager = new NexoSecurityManager(encryptionCredentialDetails); + + CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); + + // encrypt CloudDeviceApiRequest + SaleToPOISecuredMessage saleToPoiSecuredMessage = + nexoSecurityManager.encrypt( + cloudDeviceApiRequest.toJson(), + cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader()); + + assertNotNull(saleToPoiSecuredMessage.getMessageHeader()); + assertNotNull(saleToPoiSecuredMessage.getNexoBlob()); + assertNotNull(saleToPoiSecuredMessage.getSecurityTrailer()); + assertNotNull(saleToPoiSecuredMessage.getSecurityTrailer().getHmac()); + + // decrypt SaleToPOISecuredMessage + String decryptedSaleToPoiMessageJson = nexoSecurityManager.decrypt(saleToPoiSecuredMessage); + assertEquals(cloudDeviceApiRequest.toJson(), decryptedSaleToPoiMessageJson); + } + + @Test + public void testInvalidSecurityKey() { + try { + new NexoSecurityManager(null); + fail("Expected exception"); + } catch (NexoSecurityException e) { + assertEquals("Invalid Security Key", e.getMessage()); + } + + try { + new NexoSecurityManager(new EncryptionCredentialDetails()); + fail("Expected exception"); + } catch (NexoSecurityException e) { + assertEquals("Invalid Security Key", e.getMessage()); + } + } + + @Test + public void testInvalidHmac() throws Exception { + EncryptionCredentialDetails encryptionCredentialDetails = + new EncryptionCredentialDetails() + .adyenCryptoVersion(1) + .keyIdentifier("SpecV2TestMACKey") + .keyVersion(1) + .passphrase("12345678901234567890123456789012"); + + NexoSecurityManager nexoSecurityManager = new NexoSecurityManager(encryptionCredentialDetails); + + CloudDeviceApiRequest cloudDeviceApiRequest = createCloudDeviceAPIPaymentRequest(); + + SaleToPOISecuredMessage saleToPoiSecuredMessage = + nexoSecurityManager.encrypt( + cloudDeviceApiRequest.toJson(), + cloudDeviceApiRequest.getSaleToPOIRequest().getMessageHeader()); + + // Tamper with the HMAC + saleToPoiSecuredMessage.getSecurityTrailer().setHmac("invalidhmac".getBytes()); + + try { + nexoSecurityManager.decrypt(saleToPoiSecuredMessage); + fail("Expected exception"); + } catch (NexoSecurityException e) { + assertEquals("Cannot decrypt the SaleToPOISecuredMessage", e.getMessage()); + } + } + + @Test + public void testHmac() throws Exception { + EncryptionCredentialDetails encryptionCredentialDetails = + new EncryptionCredentialDetails() + .adyenCryptoVersion(1) + .keyIdentifier("SpecV2TestMACKey") + .keyVersion(1) + .passphrase("12345678901234567890123456789012"); + + NexoSecurityManager nexoSecurityManager = new NexoSecurityManager(encryptionCredentialDetails); + + byte[] message = "0123456789abcdef0123456789abcdef".getBytes(StandardCharsets.UTF_8); + + byte[] actualHmac = nexoSecurityManager.hmac(message, nexoSecurityManager.getNexoDerivedKey()); + + assertEquals("HMAC-SHA256 should produce 32 bytes", 32, actualHmac.length); + assertEquals( + "HMAC signagtures don't match", + "GWYcM3JVYrY3b9CSLCuJ+THMxclBG9jJ05n+RR6DkQE=", + Base64.encodeBase64String(actualHmac)); + } + + protected CloudDeviceApiRequest createCloudDeviceAPIPaymentRequest() { + SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); + + MessageHeader messageHeader = new MessageHeader(); + messageHeader.setProtocolVersion("3.0"); + messageHeader.setMessageClass(MessageClassType.SERVICE); + messageHeader.setMessageCategory(MessageCategoryType.PAYMENT); + messageHeader.setMessageType(MessageType.REQUEST); + messageHeader.setSaleID("001"); + messageHeader.setServiceID("001"); + messageHeader.setPOIID("P400Plus-123456789"); + + saleToPOIRequest.setMessageHeader(messageHeader); + + PaymentRequest paymentRequest = new PaymentRequest(); + + SaleData saleData = new SaleData(); + TransactionIdentification transactionIdentification = new TransactionIdentification(); + transactionIdentification.setTransactionID("001"); + OffsetDateTime timestamp = OffsetDateTime.now(ZoneOffset.UTC); + transactionIdentification.setTimeStamp(timestamp); + saleData.setSaleTransactionID(transactionIdentification); + + PaymentTransaction paymentTransaction = new PaymentTransaction(); + AmountsReq amountsReq = new AmountsReq(); + amountsReq.setCurrency("EUR"); + amountsReq.setRequestedAmount(BigDecimal.ONE); + paymentTransaction.setAmountsReq(amountsReq); + + paymentRequest.setSaleData(saleData); + paymentRequest.setPaymentTransaction(paymentTransaction); + + saleToPOIRequest.setPaymentRequest(paymentRequest); + + CloudDeviceApiRequest cloudDeviceApiRequest = new CloudDeviceApiRequest(); + cloudDeviceApiRequest.setSaleToPOIRequest(saleToPOIRequest); + + return cloudDeviceApiRequest; + } +} diff --git a/src/test/resources/mocks/clouddevice/connected-devices.json b/src/test/resources/mocks/clouddevice/connected-devices.json new file mode 100644 index 000000000..1b46d7c29 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/connected-devices.json @@ -0,0 +1,6 @@ +{ + "uniqueDeviceIds": [ + "P400Plus-123456789", + "V400m-123456789" + ] +} \ No newline at end of file diff --git a/src/test/resources/mocks/clouddevice/encrypted-event-notification.json b/src/test/resources/mocks/clouddevice/encrypted-event-notification.json new file mode 100644 index 000000000..7c8827fe9 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/encrypted-event-notification.json @@ -0,0 +1,21 @@ +{ + "SaleToPOIResponse": { + "MessageHeader": { + "MessageCategory": "Payment", + "MessageClass": "Service", + "MessageType": "Response", + "POIID": "V400m-347374578", + "ProtocolVersion": "3.0", + "SaleID": "406aa21f8b", + "ServiceID": "406aa21f8b" + }, + "NexoBlob": "MnqvlI21WRfLyhkHUz3WkoKtn2+jq2zlb8ACsEj59vDSQmMMw5QHCyknuqP85scrhU6DsHkyjq3LWN7XxB9lADzfIIO\/6IklAfVP+aqz7zADlT6erP2Kq+\/uDKILQEAg6jikpCkCEhHQmQ+E2P7rswKyYU5I\/wfcGs46AkZ9iaBq\/DkvMDkv+3WGfN6qf\/sYmom\/zJWcWXArvsRub1\/sBsAI5QyxE+2Thsl4wfNBslrHFiIWi3akLXpTnU8wnUAykCxEjYH6kqTu2NI00iN1mNU6lhEbFyC6Nm7byjHSNkVGuHve4yHE0HMV080pyCD3ZkHGuzle54ktumLh+UdlXhZt6jNHvKZzMu4MuHjhUJuLtN1Mw\/bIEtUu5uevGyZHWZzR59PuyjBiyLF1XluNG342lyjZwTXQ\/x9OP+mx7dmINQGsNp0RKk1gC1wpKRIIHkwrmbmqSoPo6oBwg3t0V\/\/IsHLETCPXF4Ekvy\/XEw+4noMtcQMiA2x6DZK0t9Y3c+QfAYTGCWLRwXqxom+6xucZqfTtjosJXDrLTWcfHgnpwlplNv+wfzJN1RWxEY2ZV\/6gXXkuZymdlJEMtP6hF70Db2uD9MetM\/FCWxGvGQTrRA4AErPJgpA4+YnMA6K41e7DszfZNRMGs+6IJPsyvEBby5T1El1z4v1nEkPeFASDmuWICYxc6Ki8i7jdYgxmD9ztZSiKY8zrtGvIna4nxZoMbgxp6UFN0ws+Rqg++mJUkvQY0S9e1A\/CLhrxIICpOaqGPMPAWzf6nhz5HOKpdMPs2ZUrjgN7KSW28QsAtIcBfQEjZYKCvn3f68ERTEEU68vp+FfQUnXNKFQ7vH4ytuDzEqkgzD+bCbkh7VVzrJ1GdzuH+N1aBi+Hh73Qnk06\/LVdSvCp7L9CI\/8gG3oZDTk2t5BVNuHzbTsV5NWamgzJ0wtRqu6ya3qohtQNIvCMiYfNpT936hbiUyudbqAtakrgGBLo9xKWGLjjOALRMM8+URzK9kazCYg5ENFR7A8DGKpfVZEEwonOK2ISKT1\/9UbUHMrFS4UrVrginXmakwvVmCBXHgOrhMWQWFU1pDGZFaCMRMaa+2M87SGVMh0rIH+jihbfBmmTpu\/iMbjP2Qc5ZqgCnTYAr4ZECzR4cbxYxKDtvL0yWc5FxZGGxQuM6Hk+K7IfOfbUitVeyUFyGAA3t3SYbv8CCHQGCXeE6OZI92tP0T09HpbJB70s8rFYmAHR6k\/hcGNojOuuWj1hbRIdIVvdaAnazYvizQEGr\/cfZvP0Fu6WfPcggYHbGVdmVE+s61yaqJTKoFEpnrvcwaHLhIrdFD62KErll9Of46bH1s3FQokRnN\/\/lCQwjjFjP6cHWfZTVaXZLhwJ1QVXk4+567+e4mtnUk1Zx0WOQNjqfjorLPfsafmfrFLUALZYHvNYdPjtshON8Mo1QiQLtMMqzW6RmMl5VDmIlDE5m0L6QiV9SwVbo15hu0ga+ZzjffvglZzQXJbdmxq9orZspsk4NeSjE5rwQHpIamE5AtIjd+oFZwM4x13fCmECQTExY5FuUcBbRT7t0SIHRGnlFJUdzzFCPJqqvotBiVQKmx34K6+kdS5BRe2JMmyQcWd3uO11k8QWIPQMa5TzKhsDnvYeOy\/IxPPteTbAoJJfuPJ9ms7MS0YTK91abEUhVwUJVGcpQBuSz8IsHClw11iBETnC3kDqF+HaneXj6PtjkQP2ewP1Uys4qHLFpEdUKh7aQB+LYulfzzcjx3CyucH3DmB44UtqzwQEXzUu4LlSBuAwEfI8eZQNJ6SJ8hu9G2ixx4mCJJPGAtifO32s\/vq6VHUZMIxyEcHaMjy7YGigJcSfcYGbwfcChOJwyd3YMFkEtPHDbfg6eU1uC1DSfQ4s1DmJFO0i3rFGbUtLT2UaSIQWhregVOQxibREl5QUEUl\/HBboY+Hwnsj8gUTlVV4ue7X28EceaNewbKuvYSzx8H5zDR\/4UetXMqDPJgAZMlxBEYkefztAPQNlcPu95T5nb\/gQeYDNt\/lfy3yYhs1DAkLvI7uRDaPVV30uDYhMIuO0prvRWevqlIBkhvJvD99\/0VA8ccA+ophH8wC\/xpBVrE318+GjhJ8cfTvvhSPuYbcxdCg1Erl1249B4+f4arRKiOVYvfvG5YIA6FPCpNL1rP6YDNdGHEO0EP3CAPN7onMri7FVCcUzV2iI8ozgoA0J+0\/IVBbT86E0sDiLATWdKgEXOc1Bz+GNoVf3G5PYbmYCV9nZVeEOMiCeWNo1vNSIjtC407Fh9a3s3HtsGxcLYR4w5jUYByUOCkC51BTUJvmT5d6EDXInZsTxcT5Ynqp\/MwBKHYqwpFXUpL3x4w\/uya0NmoamRKHei2IwbmJvhYg4uENJigbeH7Ecsga6S91YiTaA6ZmVnyvuG+7X25lSQdn2q\/Us5wMGTQNSJLHtsEK2E9VMt1Lzk8aAjB+EgIvimPKTYtndFpZ\/sLxt\/j0McvddD8SlqGwKp84YQPNkdl9nJfdWc+rCF9sKW6zN1hW7iVvj6m8\/AsZbVb+pZAJx5wT+jmgHFeuSCpvOeDBgQqP\/rpnF84MaA9VC457ZJCbzuRZ\/a0OFdJxKNCyAL9s267W7DXaJhFi9sJRUc3\/zLwPIzgP1\/2m8OZmBZk1Tj\/SoAMuYnMMimDKU\/ktisHvhl0kLPFhSwSGx376edIfnsI9H8ocxzLZH6ypPhovlKF8XpGC1Yaz4EPVDp0tEzxYP03Hfp7s9r2kaKVqUxPkzSSSuECOrVEXXlOL5JJypewhZaGBNo2Lt3vxGtrYSO6DBFpGN8thZbECjgD5W8NLs7ZAxaT3i+QQJfbsONgYXWMyw04KKQzxXAg1qdXiqttIlQUf\/7NzKH7Vk60KIQQCbMZhgEcHgjY0S8FR+g4LmMeArXsfefcsG4nGt\/D2XVYeFmWX0S7CA5+iFRxhbMBLFlJmXAiChdluTuNY8PI2pRR3GJN0EMAYq9itxzOW6gbG5dqaSL5rj56zK2s0Oe8kXO\/+RDAkIBz9CnCXqNHyaaGW4psEuULbsfnnPfVnYHd4aokYb198C6oHSSrgSMpyd4M962xDeDqowVeyelEcs3yqJyurHgQZ3fb4m3DiL9xDtS1o140XcFs31E3TcHK81l0P6Fqhn4LhTpM+a2ofJXkjFvKF3pZpyvof9kPUi\/lZ2OVYKraTPonbh1j+zK7vdhba39oZ4taCRCRA32TvJXUlCE73R0apqUGDALrO2fC6sV3Pgx0sM5sYyYIys7Hkb8P\/eOiTJYf2PyFk5dyRY91lRI+JGtWEy7weHspKpQ9JbpI8nnmcbuOV4Dmn4yGjXW22l8beFg6eUAKWN1cNMwSakIChHqk9BobamPTnNYUOKDOsJoZ7Y\/jfrRk3iUgp3d9540s+yOSrhzHjRLs12cMcdLB6VaoeEjO0HVMghbkfirPd6S2j6s8t1PKjgZTam51TBHmQOKb4tIyVkhvQSQr5GaFR1BjqIH34UfZHPlmTaYq2LutoafOHJNPHMoKMuReq8g+xAw\/2i2jV9USz1s+\/H59sLrbLPYvkD1p4UaJISJOYNM5GIstdPHqn0DwKJ3LRmI3+kp6lbNA6LQcUKhMyKrO4\/pNhVnKF5x3GscNogwbfUOGAEjGlB+G7xu3SQh2Y5J62v8cRdepC+s0iMI2YtzjqxDHo7mMxgXCPRGVGZKBC3d7pz1mtDigXBV6zxaOWZDNPEQpElD2by7AOM6fkIsbtDoY9a\/tCH635EoNqUS\/j2IljX1TzFnzuDQm7rj41V5Rho++qgOGCtw7c3RzZWti5CuvnasiMHNdy7ceJtrVyp4Y0bNtHfQ3RxJqDj8hy\/t3DGWu5Sokeyc8Sbyl7ac0I3UqsqvmGm2V\/WfiFIkH5DhGv8kE67JLTNHOw\/42c+h+FRkTFShHnyYNQiduSqHy8pmDFwdhAs4hpNA2oGWN49ppqdoKu5cm\/WM9ZrZCeFIHnhHMY6EsYOEE8tTLF545bDZEkWKO5wBDTyxnX3Wz4amc9plEDtd9aGH7JdAU5Fnx5vHo8WZW\/OzMGW\/J2r2tClwmqLLIOEeAt4AA4E\/182HCNABlSr3NzNFzJwjR3PmnKL7kTmfj7pw\/Ic1OUBGbgJlTSHhS3+hcHZG1Ikig3XQpb1UI6Ijo4WDPkeoDwBrbIDNYdA6qPrwyUVAhM2\/4yboWDhl06tnUCiS2f+WpHy9cfD0n1GAA0HwrNK4PwnawvqpM0HeAhWecXt1s+bWixlO4bjDePeQv5HMGUX\/oyfRJcdIoEtHtruSl63DMEmHyw2NyCogtYNoMU8qedqOcyhkg5TsG1o\/KOG68isg50XIJzsYve\/xBp9t6yz9MYXMPCae1zJTWJ1F3MnonczBXN0B6xYlZT5nhH9dYCcFKWt0Hw\/nLw3dTisLbIHa\/B2tesLSxL303CW457QtRjkBDw8Zm88wF4kRrIxu9ePxGh5yvU\/\/9R+lyiDL+Dot6txOwbcp4TLnmgQ+iIcCbQnE5k1x9g7RwQlOavspGL54fWFx\/PWdsJALkWXm1NNalzDOCgtLa66xDNXcfHVWconokoMIGV66\/PPuEkiBHu1TM9wW+mFpKgmnUnzs8mAl16D\/hG95XI9UcLxATGTw52q7MblOmhmgpAIf6VP+boi2tHVVH9Dfc5EAi+\/GMQ36WKJ2cxR414wjEPAAb9OAyXvPzv4HWMp1Ws21o3EJhg\/LrHMjTzWB\/NQlFGn+bShwpcZ1tfDnfDWfK0jXLuz0IDuJYMD\/7A\/pIGvqwzYEA4QdpimmU+FJP29iSmd5v6DZ4l9VP0k5tObpw18\/2dZioPyO1SBGkwBxOgOJZOvpyYzm2tRCruZxIgO6NO+ZPe8S0s+9pcz+zIrP3C9CrF3o7+C\/c3laZ6mCj+05mcJnvaD6PqXhilQ3eI4jyk5dhobZWXFU8jQDyADFPlFA3vsdlWi210mWcxZzJ7F1s47MWZpvKu0MxrpVbRKVQSQsycWajrEXxBxHbde4heuowChips5mxZeGxbMpdvPvGxNZE2RlpuM\/m\/EJrSDFVB+RRyebAdCgI1d2kKgwytgMYs1TWsM+geiRBrSkEQ9A4hIWEo6Qe1J\/p+vm+IgU0eGTeZT6mNnDV73jyhGdTjhBXfuD4F6d4x2gQS+UVd5t9A5fQpQslYJA9uFLSQDLOAPXC6h7A\/TniKvXfzt19S9BePqNez8FOqWG7sOhYYel5iU8G+4scS3ERbC2RqtDFbhwg7IMDNiP+H\/Nu6\/4FjWMk\/M7mX1W5Yzcdq8orTryaPSpSV7+d79cfvWSFMoIjVFvL9QRdTdxq0TXTa+AfV40Ey\/DtMzgp5c4hP\/O0foFd3F75YfZey4DUIIThrkC71KJhAgiGxUNlw5U\/h4tjXl+iJfI1Flnw5DPlPdctMYF3niG+Ao7E6qcyDlreZChdgiUTa9RpsZLy75h+pKheQUTrzuqaIRFBdW3TfXBepZXedCsYwKnBxKN25Zo+PGvfxQgK0+G21BKFsOWqPVI3mDlEKbSDZfkTyH7tJGzchdQhIzJaNAmPp3uw36Klm5YP7niWjVeLFkKoD2r71krwkoIisqhmYyEXjciYN7MX0do8kdSPhVCUZd+oUha7qoSaNIM6Ud7p9XxjN0Q3Q8t68NAw1Brsnk2NmQqwBm71CIZ8oz4Du3yTFyAKS0dkxuwRn5o6K44taMGN33B\/PBdBn9rRfkk86ZKuNFaNvOhO9UC00P4A7Zg0ZJiIBggEq3o\/D1GR+SUzgo9MnlGFrRpaQ83VqBt07X2tc2E1VUPUZftkuCAIIB7L93sEshxKkQjkVsrE1m+7LnvOs1dSrke9dItqSZ9CnakMAYMR7AGAH5eHN6qSGEypaZ0wZqBr8SR1tRq9TPJVwgrym9JPqtBCJMMT5yd8GoAxqv4iuauMXs1HrTk6BzH9bb8zWV21N4YKxiHmIJBS\/Diq6ip4PWcTa5nnDik+1xeg4ACME8\/rNn+xttx0rRJ1ENBOKH8DNe5Wgyy1zqIursQ7vXQE7c685KGk7L\/4rdZYThxnON8maaedi0CRA6JBrRPtmRjpBiLulkglP6buQfeEMllJk\/q1PtwyEt\/WDisy4P27oBEBAEItJ+8zgdx4JJsf5bNwuw8+Wjg3JKcH4GVEzhtzh81gYVqs7E9wRz3GRyS7V\/eALEXW2qsfnu\/DlC11kXREw72tkWIUtXZPjQB+jJhxN1fLov4UelK8\/BBE+PzxE+jaCm48p08jGdjfm79GHhYCDQ5YLldWPdvUcYRdtMRmKDhjMxwlV3UcxH6r8Nc0MYcvCrUBokdJfwQFN7m+Qna+AwH7Bu51gUmuMy66XJepxrrJsFOWIdLiWgpZxm3\/oEs7I2DEGzHSgzOH4Zn2jU5Yep1Fh30lpaeScPYP60cCS6sAF1Dp4O1qZ57l\/O8Fqvi3f8Ng8w00aQEM9RsBBSg2Ee29eqZzEx4++\/1qtRlXmgkCkLWjBlpr3CAj3tMJJlAugQkSYq08xac9I4nqOwHGQLyOX10FPSbZcBYQqq77GpH40K9ur5PvKcXT488qgpUj8Os++tkA4fMINQTw9pdWavQmhmwogeFgP5ByQnS7zt0ocIK2OPyTbBVvVsTaQ\/wCmRqjUHmvIDIkAv7bG99wvAxksvt80OGkzaUTblEPn+TWuZ4p8yF\/DQmmiaklvZ5lPcN63Nnr6kb4KM9rxDbxiXNBRT2IMp8FeLlCs\/a+tbp+xlnIJwy34VMhva+mpZl9vmQFhICTgDwuojt5q35D9Qq6JjKisxfSY3Krb+Lao4jGi1mKzq\/pzaTahKvSIv8TshvxyIs\/ULHscvPl\/zKmTf8B54y6qrpw\/S+ILNrMop0Yib7BUAAibLNhle7bYmAAGC6nrSYcE1LF+GZvSCCDHMwsX4Y\/DQT1uNhuHsnu5PKnCjm9H6P2G9hviriHTw0VpkzqExNnLUkfkmmWYkhlKFSV0eXGZPKIib47B3n2tdNB1cLprlfdwX1mtw0TZINbHrX6mTNF+X5ErEeGVZIRwxNoeN9TPVsnhhe0aNpOZ8bACZRgpbrEWREuLP1M+oKJZWp17uy3LI6E5EdArrAR13eKw7jdCiXYYK7PCzBjOuMYcIgfF4uYPiC2FE3mbLmGUxCPBUozrwGWu3A38Pik\/mfIKXyzVem2bP\/z0xGlefa4VkxAXzL5aesbrekxPjEGUaDT+c6mH\/TU3e9i2VoZs\/dFNdgCcHIUFh1lNFMBIRHrA2b9SEM5lBV09wL\/CM107zZRwZI5wmHeR1BhcsduVPlduB7+Gujmpnm5bNTTM3a53KBMa4aQE+SLpJGsixr42mxxDyUuvlgLwg43d4xbNgwWPf\/SCaxSvAWAFWHcVlWUpaMB54al6fAPrqKJeRxU6djRqB7WHZRuodNTIJDBqOl6r3NzcPvAiOtvfAuf4kea8WYqdNcBG7q6TMTrA\/\/VQss2dhaRxTpvEoqfZpS+O2xMCqv768CBA8pCgwy3i+TU5C4e+T4CtR4SJwjRL4yfHTL8bw4fMB4Ll3v+mNxhyCaJJWPv\/RH4QLivaqb7VojpzjGIoEdma77oUVNuTU1Uh0QPKElcNmAC8UzxNTzXv+U0fmmbu3XVsyF4TDMe8mT5HgMpeSoMEAaRkllnrS62x+itTiwUl2PH+eu0BYZHxZwYSyNwlCg2d5F7HgMrEqiTKi62wkHoPthQh484AkLQu6AwTQQUSsePA8qKJT5me4x4n3HcqKxD97xd5vqT08v4wCnSmG\/rDrPaZZEfB0wouCn0z3TAKcA\/zR9kCcwlRMJwkhaOjoxRcqmAzgjhNhJr8DbhEMmoiFWVqXj7WccGGi82xrx2JdrQ5WxzzEbjOfGwV033WrrA1sGFfW7+bM2w+Dj7FK0m98eS6shV0nDv6qVDDh+HRjQfU9CKCBpZ9fSfFpWam8PqWLCdXoSMlBDx1zUw5OQBlib\/LW884zbZmQFykZ4x6A5bdbXAJIxUwft8W0zpc4rw6dG9n9D8gcaiTnllq3kel\/hQUcMPCPmUH7B5c8xCO6r7wWVHyxV7FjOKiNZiPJZUcWFGMsdnaCK\/nf4FfUV5nKZebmX9BL5nVzxiICQ06vJgVgui3jGKtsT21FEmG8p7mulX7exYp115J8qbcxjzo4Jnbb5HtZrF5ScKRiMl30CYqT+H2iMOU57Fj8Ie8CGphebVEgjMVnH2iO34yG4oOHkNah2kFjWFfVapLrsQZtgUUB74rhHCuxVMg4i8romRpGv3\/l0TDRymb97K7b59bD0MgQHL7K+ya9ghzPKU1TPFxmKHRDfgAX5b88OfKG+RML3elAWVo8VzNlApQ7tr2QzkqjBHlaegjwNKnKcYYRolSPVlndiWMf0LA2q4bbEuFaRnT9CVvuFm\/QK\/fErEIqc0fAJ\/xwzVQ\/xjp2NyWlwHnoAVscWiLcugeiNTIrC5QezTnkOHWZnIdWirxJq9hgj7WItZRGlGR9MxbXNpq1d1ILBTISz1sTFMq12ky0mK+SzVOJgpPJezsVS2j8Dooliapu8BcRTraJAgdGvyRMAJCFhr5LfiCjQxdeCu7qryY+LONUQr\/HJmKYa6r80MZehVC72TDaWmEpWBMaJKJGgPJwO0ugou9h45VMMUE4MOzkoszYMuoZidC6XrKLMwduzzxTbzvL\/4kd+621GLs5b9TdzU1S7PGtYu0ifX42eE4f+phPsny0nLZEmIH6QQ64BxfllBV1aEk8ddp2kpAlpsP78Ihetl2peeb5OAMK3Vb8PW2jrT0kv7c1eDxFw2p10e2ydO7wliz3e0WYZ5nRWZ9LQIDQrrdEt0NAgDI0aQFTIJZ2Rh\/ExomOUYovXaUJA4XJJV2ZzfdEO5mq7L3XEOmoy\/2969hEGZLZma3lyV1Q796Wjq1ZycmHLU6RA\/TqJlcx7jgOl4\/9tqsB3m+Y6BjLEvq26BOtVkDMFVQf5+GKmVfgQw+Odpp5Wv3qis1ApPKmsxnxDTYQlb2OU6yquihWazCoLjpbLcY8UJhDXLGHtm8rAHp1U7hyCih73eLFt5saB57NVA3vLISirK4Ng97M5afix8cf16PaCOtXk4vt5+nQ36dg\/SRQhqaGdeLCH3ip2FmeQ6mT2kKK6bKWa4wsKVVzFvVtw3ifa7\/tJfZD080z5xf3WWHf5ApKiafv6ep8SKTubu9u+HlVkNs9Q\/9lq9ooCMt1YRtbpKjjj6WGtT3jWWQSZXcB7EOLJntNP0xx7adJT+F6awDKswKKH8iEDbmCoVjJhid5O20Qz0zKFIXY4NEUcTyZn1yK\/yRZFENTGumypD1GAfoAcfSKgzY0IaP2F5Ep0u98RwEpqY3nnZzobI5R6GASFYxRMD6oBYWi+54OXgrMKdvGodGSBuFnBvjFR8vSqHhSW9vMwu89IAL6IvC5ikPd9A95W4dyHIMAa5DEMQFbXr4rFjQuD2Vg", + "SecurityTrailer": { + "AdyenCryptoVersion": 1, + "Hmac": "Q4GI5WPe8hduJbzvEgzqei2Dy1mZ4DAextLs6yDKVs0=", + "KeyIdentifier": "Key123456789crypt", + "KeyVersion": 1, + "Nonce": "bflPDJ8VceOR4JUFN5Ejdw==" + } + } +} \ No newline at end of file diff --git a/src/test/resources/mocks/clouddevice/payment-async-error.json b/src/test/resources/mocks/clouddevice/payment-async-error.json new file mode 100644 index 000000000..d1b92d279 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/payment-async-error.json @@ -0,0 +1,20 @@ +{ + "SaleToPOIRequest": { + "EventNotification": { + "EventToNotify": "Reject", + "EventDetails": "message=Did+not+receive+a+response+from+the+POI.", + "RejectedMessage": "ewoi...0KfQo=", + "TimeStamp": "2020-03-31T10:28:39.515Z" + }, + "MessageHeader": { + "DeviceID": "666568147", + "MessageCategory": "Event", + "MessageClass": "Event", + "MessageType": "Notification", + "POIID": "P400Plus-123456789", + "ProtocolVersion": "3.0", + "SaleID": "saleid-4c32759faaa7", + "ServiceID": "31122609" + } + } +} \ No newline at end of file diff --git a/src/test/resources/mocks/clouddevice/payment-async-success.json b/src/test/resources/mocks/clouddevice/payment-async-success.json new file mode 100644 index 000000000..b5754e203 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/payment-async-success.json @@ -0,0 +1 @@ +ok \ No newline at end of file diff --git a/src/test/resources/mocks/clouddevice/payment-sync-encrypted-success.json b/src/test/resources/mocks/clouddevice/payment-sync-encrypted-success.json new file mode 100644 index 000000000..5f3938a23 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/payment-sync-encrypted-success.json @@ -0,0 +1,21 @@ +{ + "SaleToPOIResponse": { + "SecurityTrailer": { + "AdyenCryptoVersion": 1, + "Nonce": "YIyJBzjWFCAZn31QfAvGLA==", + "KeyIdentifier": "CryptoKeyIdentifier12345", + "Hmac": "hpptt0KfxlALCMSo35tTwtgw6fDNbQEESOTdD0AD9Sg=", + "KeyVersion": 1 + }, + "NexoBlob": "fMtXTcQCbAi3gAwtOANt4tQEz2UUrorGVnDuCeYXTJUoF+NyNCmj+bwILU9io34qbHKr3hyZ9OXNqBc0xomMHLnGDbmETkY/hZ5vYAXkqQHsIN1zj1m8hYxvuma/8gy8dTUQJBBAA4XXwLImcc6v7r4LuJ77hWd8N/IxlvUw9ZG6Z4a4yxxip0Zzx8hm6ZnuVvqiKdicoewngJeNMZR0XjPUMEeS57ENWoqTkjBNBOE3KmAQ2BIV4fxHebCU9efg6EjTFv5i7Xf4Nod3w30CPbuPpWdBhDViHsGhY0uQSja/4EfI/QO4p1kF6LJuNXWCUbaJSSd494/J98KNyRDQT2OmcolCsip3KHgtaKMGuTLKqloXy9oLREjL6xPmqF0rb1HTV/q7+dKm/wZwhi6JQK6d8uUyH7+mY8rcLXb3OW/3aanTr9jPFo1yZg0+53kA1t0OkkCDLbcPoBnJFJKZwhWmy2ombWwNNXS6anqp0B3x9LDpHSekkswAu3ExhWa0cTIkT7eeLtIXzzx8K1UX93Zr54EMYmsDX2061QP8Vv4rfsXYbdX0JUJHZcohNRUamJ/hEKxT4BncGkIL47nxBC73h6Pgp3xQw20ihQ0YA4Tqli/i82yJT9tZ4JG7faITL/wTr/WKcdnKDAWgiNVqqEW6lbcITzvm76gYKGdFTu5DTs3niRB0vEQLJ8sDwUUIzMa/8m+Q5M2R5pqqcoOiLKtf/A5s5/P/MqvofrndeosOJYretNFcd/X1e8KvRQdDRYMOnE6k3bxK+1HpKNfdkDEbLGfXLjJyjHhOryijdIMDZA0kz3xfURfUOz44Sfrpn0kkVNGo3XmzpP/4lBHqMgV7kOXzmNP2ArWyj3JRYJAbwr+Tr3QbnlXo7Wo97cOiQFuZOadMpN+y50N51MKh13C9mvKR2lPaAuT2B8QTRgyiKQrbGrHf36+Tg66DM06oTNJ4w/a316Qrk3WbSponJsQ8UsY7HJpYDOdXjLNcWYf+15Ljoqtb3h+dYzsurJGvKV4Zi4rUvJ/xYfRpMGWmzK72ht+o3xHORgm9ZBoGCSxYO7SWj5N5xALjXWY1/Ys5vYvdpU7d9+6iqkerZVWBNH1hFYUDaCBtJCnqBexOt7biPm2vhxGP/f3VpnWIvSlq+raQ9tx+yIdfaleDwEp5bGIEqzEAFlQMNJQVBrJjG8Jyje8X87F7l6OHZ0XNNq15NBt5LoBv0zDQrikR8d9MBsfKZFygsxI8/y9A2vv7/7qy3kz0P0EnVz8vvgqbrn2PO7fFqrWdBIPkfh+U5qEwo3R9z8LNS3tLLJhjzmsAryIjBF1Zt2m1kZDg/D691npM2wFb1i87KNS+jNXZDWgW+py6xBa44znSQOVViJq2kkeNkE49MNa9LFy5xU/PgoziE4e4I+ikKUtoKmxncUFrW29Coqa+qOivETdIJuS3iASl4f54/dv9/2cSQleWaczl/rB9gVzhVVK5DLO8HUzPeLltK9RDLYzmK3LpG5VN2h6BZ3hw1jWGkqSMPIFNY5QbsBsYWe30FTp/h6JJrzhdxyejJx7Ibw9HBLIU8MPLbHDnKbs2u8wpFHqM4eUIGsCE86iHIJqJT1Icg42mc9UpKSJfSZt1zQiScOvnlm9Zo6GBWpvw46l4/vtHwbjodVcpFRpxZ82rdrHFAvVerl0Vu7qRgO7vNw/46Eg+5mtKxEneLoG/VIriSRzpdvpBzd4owmodeePQdQD/IPBKQNGavKrfU/Agy6Quoo7be7HhIwGH2DvhNG2Q8TVAhc7V3sf4t6nA1d9URyNmygjYmaYe6B0JU2faZXIa+UD2zIyT/j4E78pzl4SzNRRoPBGMD5mJM/kFlqcrDqtjxCPjZ1uxmYnhMlsJimRQrL0/1J+vb7X3qh6DzbQVOfGI/Fd/lnjEEJjJiIIAF+tWpLN0D08ig30nLnIzj4vaUfdyffKwMwL1QKBJgXOF/iACuY5o7H0Fk/yz8beNoPv+iLCm5i0t+a0OIAjsLNSOpVd9upnhVHhuQYu0OEbFaEsDWue4E0v0WeYDFsLkg0VoDzBDGUEGxv4fSYvNIRlr/HhE7NEgjeKa9dUm58UUxUaCAaSmEgdQQ+dPvpM24M4nvC80VXO3sMrvBFVkgAUgrlDqChK0PtgllK0zU2Hvj+xBzIP24osa2Dz/+KSXKezcacSRkWvoEd+z8+1SbY3VVezv1hukX3yZWfVhS5eK7tMnV6ZkewT1ffYMBYL2+qE4mgvP6u9+47BaEk/jmH25PgerfP+6H6M/kvaXXlfdcuAna74dWaYvKoLFrgcB094HC5yYD+6zf6J1vd8AYR7oBN+Z1QtBh4NW3UfgXgNo3mwJcdJgmgKtTM+F7xkb/J6q2F+f5fZywfRRMmNZy2Hq3c6/9CmdO2r9GmoHc6Gn0ZvODMHmEKjKCoRZ86nvMhsluRLT2tHyeC9AVfFa92q8DQ0wRYERdPMHTjOtdxi7Xc9TV0MN1Y/awOJitz3fCxts61IVBbHqsFvx4fRTJhGwGb9FP+zJbNDze9w/WEyUn51FsrUaZsq9I7cfyevu0wVhX76m7Q8o5V61gy2HUytDdWeR8LZ7a+aCRxis6fWTgTL4yj/ulIqN/a4muUTQzEMkktdOGSLUOzjLQOUrUsFOoHmVRuTKShvPMSdOitBXdHxTgGYqGl3DnbymXvC1p9NWQaFSH1BBgAsR1mflfRpdsoBxeJkY/hqHkebphOxmWfbwwsd03u0ucS7URijow6iuECDns+h+mSQi//KeU1xU2dGld5zQgQe9L0KWv5Oh1E02C5PZii/0GUc14nZP3XJxa65LTkH8/U/fCKCqQGJFNvIenb3/kHRTETTx5awFpDSPB87gsUd7S/UNu7t7iO9daId0lXLbaYjO+hXdx/ewrL2N4FSyXFhGh7BQTMEVKCbRE/JZYT1IDE2+NBh6OGJAehKN4quiaL0RE07xv3gx0iWLrqAvGZmFipWGir00akcR8toLWz9NybXQ7xInQq9OBmFFudcO8BBy+/VRyneEygMWS2vO9+Qw6G2qjlQx3RKEG9j73CVv6a4UEhc+LddzW+JrXYWQ4sYUc7RQ//kYOXXowRkTtPnY3VsiLxtTcrFDGtva1PCpjKbEk3oDLGpJbqBkVuDPrzdyzYLqK8pVj8MuvtaTlQTB9Q81R2jAPNEiSA9IV9nQKpqSN7+ez2ZBVApCZJGWRn2e1A9m0S0g9CGu4WM56kQ8eeX3yI0ULmmnOtgl2RYlNmCtJku6z8uyPR8ZR+MLfLMwcH/VJ/uTKfF3JdWLcY+5+P4mxsZ/WEV11FLx8kjBEvTv0dgKrf/l/9+EgA98jeVmbOx2DFQMeyMQS/N2G+QWtiHg9+k7YjWpz3kXo9sm6SmOn4XEfTxLQGUy3v6WOkPy0UIMH07uraozWADjsk0nAbpw6zPM3B7UZT0oJR6fW/J3d9pR1VaQZjgv/8qlpfwPV6MFXxmFIbOgSxNAvWw6Vprk631SiRKjyG1tJmKV+C/wSYu8iO1kvL1XFxkzL4dTfoe3BIv+3to3mdFffq+izegxtFWTPz0OCv9r/8RI249bdrXPj5A4lZJL5PM8iiFnXVAPELYxUAqxk8Dlxx9+khggk8YrSZXcJiIm/r4RzRWPJlkjnQ6W8HNfVEyFgNUczp3fZYCTnlUZ4nsyqTOAos4b28/VhdR0u+EQCi0ZboYrXAVVxGTBLz0izrp0qaymW07uqi6dh1bOu4mJyKjB6ig2vxJhts9r+h+znmgPViOmsjMtKw3eBE97+SZ6R7KSiefFw+eYYI4gjqgApggq1lISsVw5Tn2ELAblfZiu54q+hi7vqB8NVXntCtumnqEO7ZFIK7NWe2DPXdIEDY5W0SZG05qzv0JHG9J7nzzBYUWIHYJkatj6WjNGrUroQIDsGP1iq0ohsUqAZeRx9t9OI2ny7T3uGhpaDhHGj+JIzvOJtHvnuewTmomQ4nykTly//H8qtyDjuRYjzEURIX2oDe6lAdEU9yXeIx92EE2atDTmZrOeQh8QxMe3Kye21hzzjkIlI7mP3+QMGk6Hm7Tsn7c4pF06jlcfm9ogx5oYjOCojgZfVUUpwVsUK3sdhoMKKQUlWU2NciLQVqgzuyj4lmSMp2YuOaa4vRUbXD9gWTvc2v6gFVB0qsi4kLFCqlEI48OMu18n+SPQClk4sIAbVJKzuTxh6dO00bDSt1Ae2VnHDC4mBPStm3ZsbYYIlVwGVd2mCnpZx0xwIuJJ+eZYH5Y9/tqZlBESq/+/PX2F99WtwjrnthUn/DS+gpETqO0VPcxNGhJID9Poyk26OW85U8oeMhguybwNEFL4Eg6ly5IrD5OhJZM2be/LHq6zbERYq7EsB9yOBD1lc+Ac8Ao3BY5iX+Uh0a/vjz0dnV/5BxrLjbwYdA/ziJZn6tKAlSGzCG8OCjH2gL7fEf0orIuHnklR/UP2Fwe2hjs+X6mabS35d/3LBp50O6QD3bpOwvzTZe1yMeAHaYjObY6tzUCjtlYUH1WxOdubshfZPZB1FwDcx/+k64nCBwmEIDGNLx54dIakOo4keBF+b56VKHQ6AWAwr/T9ErBOarF6v0Kp3UZaAy6NIjuTZ50UpaY/u58mpEPNemUIjeNh1GK5YHBIfOS3TX/GK3rI82XlbJP+a+U1QArkpkF/zrDkRDEPGx+j857+5pJ9afRB1y9bzbQ3Hhq/Uk+9L5ReUO+tTXRC6zmvawjKwDj6nvQwGnksrJH0P2O05WVg3ipqB7lLBKOv39sImk6VSsW4ajQo51Zto+Jz29BxGn8Vx/7RJQpykyaRusJbfgCJnV2MamT04cmFrV2IGbUJrU1Nps2FRmmLzr+JB5lu8IiLy5ct4jYYiLtjXnMfJuN62JzZg2+0K+PVOxXlhag2Jfoe2aFCp5K5lhwrP9mHP1gCUoYZsT3Rl6MxM12KC/jXLwWiz73UweYoLznsqvomqshqUzv2YsczGdVrD8hwWIYfmTvwn0rE/aGKmSwJD2HFisf7LtdVHBn5evDydB19uBM5dQA7oHAp0I7GBjShMtRAdycnjnZks9whluN5+JEDkAiHB/EtSaQMcSWB1B+ycsxmsKpZ2rC5HxkdNvYKAfizKQedXjYhEj6j/1oBhnt3Mw2JA5d55F3D62p4sntqNW/XP+bb1thfE3IzJYd022WfarwSPuSFZ8FMZOb1UQyl5qyPy31vQsnXUThQjimw9wwGEg73P0l6bbQYDfIk15RIEIvT3nb5LXaKdW1cx/Iku4r+5etdG3oYq/ZEn3My0Usgl4035ueEerf8HrTWPXa5KQQeChNajONQL0wmrZAXx1MIsVPJLUHauhOX8k9fg0XNtAd2Uus/kDiyr7SK2mvWLcHHGCHbk+T6BaZ1mu67HJPZFGTcKHXLWRtaEOLzmPL6ZroKXPAjhrk4MuT1NIkaR3HEGkTyEk9SPsx/ROD0fKJQskkTkXlK4kDqrZ4Pyc2LaIzzLjZyIEbI4DXlKfoOJ+dbS7X/x8uoy/Co8uoUnmUE9cKP98Mwqv0y40VSyPn+0uJkEGT/k2Ww91Dt3i8j1GWC7iWMFnmJFj0j/PS/GkWOmgN3cMWu7FgW8Cdbv8NJKP7KS7ojI1UsW6rofTW+n5f8pHnp/owVbYy/auplz0fyhUht5WShDi7mjs+KTKjODoqzSdPUKS3e43Ql2z3tP66pkfVIzWw118I15Bu3LDRsumYYhHR2sRxXMEAuNIfSe/cMiJRK899tIZCxhjscfbQITihH9HoUulPjFScIwmtuhxUvpD70BEwqXX6wvcfEFFjkaBYlSlGgveXOPn6lqePJKhcATF5VVrM2NvYYQnx9Qzy4KSC377TtR07KwS5W1KdrW5QYC2ItMUUXJSoEwoOEkHlpG6uMBdzWSUkKqqiGKvWakkKNVms2H4RoBV4qnynZGsOLunQL9oQjC7dBeg4MpBNgXmVK9bhATd9pU87NHKG3fHitGq99/04o9pQ3PSHqskuIeStAV/RZ/0UPSLJZhzHhrn3XqFH+9xPQguMqXEBnVIm2edBhnfPszsdU9k3RGaf9OldiriSMhEWIXTnkVXAlKVJ6F2FcTNCQ/cWG41Msm0HtkPwuV/+Y1mvJBCqvsB1NCLjITjkvGPMCg5DqiNRaLxhDzpXJ5JYX+8l7t+rwV/45dNUci7tnf/wlg0yppld7o3PwJ+L0QNTH8pm5zA0q/1e5++u3ZTf1JLSwQJSnYSPNOJis62OLMpqxuKeKfIXGCpPwfK/+XK1TA4GxbWjz8pbJziG/YrlRWB69O6V7opFv99xV2JbgNIImZ+uEV56M1yLRGvI+HdPvPoX+1DZ5/JywPvmlu+y9uGqLcRS+5wqPr9IYcScfrVM1Fkx4lgPKFHperrb976wYTBTLS2gWaT0co3jnAYs24tP5zZEC+vxUHN0nkYE43hBrQdE7j6KZFRCMPOktGdCW7+wWc/d2YYTG+4KWCuvyICFYL1el1tHQ+ovMGmjP/M5Z0sz+eouw3ik07ICBSNiNOCSXchtsZ2BMnTl70uOrP6htBhpI4FdQ9n+AyDpFSxXndFhLLmY38/vavZgxjyI5RB+bIZa0gLvMJ+ol6LtxnJRK9Vf8HKQyU7w2wWKpp2AYrSJcFNFUYAevTfYoSp2leSmOeWWJxojVFH/T7O593I+8i6ZixkVx8WcdnIJn4g81v5i6sp7v9WKjcTi6SukUhUOFbQdUXANGq7cHJM9VzvN+QDpefUUSNdcE45z6Y5fEKjLJUzfrvCEplGFnim02YQ+LwYYM0qoOAnjh3TzsMUvoaX3OgTkFhsxatOT0zcbXvt3rk7Dt54lGZHY1wjrEJBK8eTH1JApKAk0CDRYEaV3giJ1E2J2t4FY2Axzv/Kz6ncclJMzHMLuQdJHPxfRYDiZmRwJ9DHqZ0dSzOve1861DAW/mn25AhTbgUSsdTc2T7222xkSh1E842oOniduqr+I0uRotHPb4JLyJG6vEB+RnMv1EZxxXUghaVWdzYqfsybsL2r6m7WPJ7Krqa+4o447QUk0yk1QyfWt4WfX/LNt7DAgY4nD4t9rlaiXLaRWcwnaeqmoQi+lmXtjMOS/xGnrITiZzJ1wCuqytToB6Kh0re0TduyLhmXd5tcWoOQ4jmXy6ZB9Z/nnosbugsdUd6gnG5xXn9AaeZ4yIiT9EB0ZgiSyr6u1/dTdWeP2RBeHJo9hHWAbJdfJhsx06j8F0yLwomTl3GlA1GJ09YfLu5eFbERhSaTVLjeNf3Dp7xjjEveVB2wkr6aFGRhSWxPjSe/iPsNY5PnJiVOj8rOJH+weGQz9AtBTBf8iXFp1AyHJoKNlzHooG+AM8RS7d3n6Q3Ob1UOGqKGB2HGf9n7JEz053C0HASHOFgY+tRJofi15Ytqm4+xJLNLzvwSnxKP+8xji8QHzzbsbB/5nFAZsZzE8Gm/XGPzFV4IwIxt5fJYMrXYQltRkQwlcLssroIaPHik1SISThK5lyhlMXYJcoc/0/WMgObmR4ROX5T4nMWTVOCMrty6jXsU0KoY0NuelYjaP9Oc/Y0N+n+kfSe9X54kJz946FfPqLsp8biowstav+ZL5RYkPM0YfOftrtxfFLHmBjq2OTfSokM60/mg2LPmSdhvPs9qJ4obfPf5XuPKr8yjPIvhlaLuQXyXBpJ7knP1m/7yeRiRKGPVWrlOjUbVYFAqrlyoyUxpbFTDGRXiPUkVtoGvQEpWFN/8OusQcIfAi+mxMdmkCRcFWrDNopS4nc9KTTnVWi22zmC8JNM+njxKU6HhYHMXrB0MugFnYUdPDWCLMsAfWV+mIErvpsutlrW//vtAT/CH458b3Yi9ls5fdLwJKuEPNp39o0sRHcdyKIdydD4lQ3oCZWO/9B+BTteVYM7LfMdh6Ag3gixoKI6UuO+tdB5cf1ICfGFiyJyvSOt+N9uiRsTO9uAh4CXz0LOAGtnHlvRIa9Argu9VTQYHb1X5SxI4MSJzZxhsSUVEK98IN+SzuThkWwC97baykYsp3iyypDKRZvDKbIxhpzpYahqoEHe9DZKip1B5hmzUSAKXL+xihaBtyoAxM+eHm+YoN829oqKrwHGtCrywzp7yVOJAmknazztFmTVwcBuMTBnzhpXdUe/ljUzqULHpPueauMEaPJsauYyJUi8bxG0Rspby1bBY9dSLoUMH7oGvSyoUJ7hvL6TAEpiyAUi1goekI8Bi/pzHmmNiiW5j0KctLTK5QQm1nTw1R8Dwn4z85fQU4gSEi38vknuIiWuZlpPMdMwDj7vrfyuvJhrqUwvB7KtQE6jjtX8HTjTeM+pQBOom9oqW2EswBHtpe7YyiMq+Gif/SllVMpLG8xV04m/IaLHCLXAqfL5v2jwpzw5QoJ/t6ESYyw5+46guvpZTjYpr2pjdwD6b7NYlCQdRL2xCU8SogHS0RemSIQd25/WwBqBy09vxmJJBJL9rfQDijgKheG+3OrJ5srgCDZhNNRwhCuvUXwaJbMUE/pgKgx2M/YtTPyUqt0ZOzUID/GKjVvpzTirW25WF9u3tXKEHos4YJ+pJqHhTHCXWid2b9j1qNtY88StBRM9I+tlxnILrXoaxjPzCUgpPE4SwKkAiykoPyZT8N8iiQ8lsAN6ALWVWpXBO/D5Cksi/Mdp4i4iVdF2uYvv/cL9IRnf+w6+sQBKicJQnVE8LxBasR69bENWKF/kq3rYl2AiqLDOmiBIn99O86bxwLjFbIJVMikvaczRygcE3Ou++bLhnFhpaSbu9nUxLdNJw==", + "MessageHeader": { + "ProtocolVersion": "3.0", + "SaleID": "John", + "MessageClass": "Service", + "MessageCategory": "Payment", + "ServiceID": "9739", + "POIID": "MX915-284251016", + "MessageType": "Response" + } + } +} \ No newline at end of file diff --git a/src/test/resources/mocks/clouddevice/payment-sync-success.json b/src/test/resources/mocks/clouddevice/payment-sync-success.json new file mode 100644 index 000000000..637405767 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/payment-sync-success.json @@ -0,0 +1,330 @@ +{ + "SaleToPOIResponse": { + "PaymentResponse": { + "POIData": { + "POITransactionID": { + "TimeStamp": "2019-04-29T00:00:00.000Z", + "TransactionID": "4r7i001556529591000.8515565295894301" + }, + "POIReconciliationID": "1000" + }, + "SaleData": { + "SaleTransactionID": { + "TimeStamp": "2019-04-29T00:00:00.000Z", + "TransactionID": "001" + } + }, + "PaymentReceipt": [ + { + "RequiredSignatureFlag": false, + "DocumentQualifier": "CashierReceipt", + "OutputContent": { + "OutputFormat": "Text", + "OutputText": [ + { + "CharacterStyle": "Bold", + "Text": "key=header1", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "key=header2", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=MERCHANT%20COPY&key=merchantTitle", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Date&value=29%2f04%2f19&key=txdate", + "EndOfLineFlag": true + }, + { + "Text": "name=Time&value=10%3a19%3a51&key=txtime", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Card&value=%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a3511&key=pan", + "EndOfLineFlag": true + }, + { + "Text": "name=Pref.%20name&value=MCC%20351%20v1%202&key=preferredName", + "EndOfLineFlag": true + }, + { + "Text": "name=Card%20type&value=mc&key=cardType", + "EndOfLineFlag": true + }, + { + "Text": "name=Payment%20method&value=mc&key=paymentMethod", + "EndOfLineFlag": true + }, + { + "Text": "name=Payment%20variant&value=mc&key=paymentMethodVariant", + "EndOfLineFlag": true + }, + { + "Text": "name=Entry%20mode&value=Contactless%20swipe&key=posEntryMode", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=AID&value=A0000000041010&key=aid", + "EndOfLineFlag": true + }, + { + "Text": "name=MID&value=1000&key=mid", + "EndOfLineFlag": true + }, + { + "Text": "name=TID&value=P400Plus-275039202&key=tid", + "EndOfLineFlag": true + }, + { + "Text": "name=PTID&value=75039202&key=ptid", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Auth.%20code&value=123456&key=authCode", + "EndOfLineFlag": true + }, + { + "Text": "name=Tender&value=4r7i001556529591000&key=txRef", + "EndOfLineFlag": true + }, + { + "Text": "name=Reference&value=003&key=mref", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Type&value=GOODS_SERVICES&key=txtype", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=TOTAL&value=%e2%82%ac%c2%a01.00&key=totalAmount", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=APPROVED&key=approved", + "EndOfLineFlag": true + } + ] + } + }, + { + "RequiredSignatureFlag": false, + "DocumentQualifier": "CustomerReceipt", + "OutputContent": { + "OutputFormat": "Text", + "OutputText": [ + { + "CharacterStyle": "Bold", + "Text": "key=header1", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "key=header2", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=CARDHOLDER%20COPY&key=cardholderHeader", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Date&value=29%2f04%2f19&key=txdate", + "EndOfLineFlag": true + }, + { + "Text": "name=Time&value=10%3a19%3a51&key=txtime", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Card&value=%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a3511&key=pan", + "EndOfLineFlag": true + }, + { + "Text": "name=Pref.%20name&value=MCC%20351%20v1%202&key=preferredName", + "EndOfLineFlag": true + }, + { + "Text": "name=Card%20type&value=mc&key=cardType", + "EndOfLineFlag": true + }, + { + "Text": "name=Payment%20method&value=mc&key=paymentMethod", + "EndOfLineFlag": true + }, + { + "Text": "name=Payment%20variant&value=mc&key=paymentMethodVariant", + "EndOfLineFlag": true + }, + { + "Text": "name=Entry%20mode&value=Contactless%20swipe&key=posEntryMode", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=AID&value=A0000000041010&key=aid", + "EndOfLineFlag": true + }, + { + "Text": "name=MID&value=1000&key=mid", + "EndOfLineFlag": true + }, + { + "Text": "name=TID&value=P400Plus-275039202&key=tid", + "EndOfLineFlag": true + }, + { + "Text": "name=PTID&value=75039202&key=ptid", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Auth.%20code&value=123456&key=authCode", + "EndOfLineFlag": true + }, + { + "Text": "name=Tender&value=4r7i001556529591000&key=txRef", + "EndOfLineFlag": true + }, + { + "Text": "name=Reference&value=003&key=mref", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Type&value=GOODS_SERVICES&key=txtype", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=TOTAL&value=%e2%82%ac%c2%a01.00&key=totalAmount", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "CharacterStyle": "Bold", + "Text": "name=APPROVED&key=approved", + "EndOfLineFlag": true + }, + { + "Text": "key=filler", + "EndOfLineFlag": true + }, + { + "Text": "name=Please%20retain%20for%20your%20records&key=retain", + "EndOfLineFlag": true + }, + { + "Text": "name=Thank%20you&key=thanks", + "EndOfLineFlag": true + } + ] + } + } + ], + "PaymentResult": { + "OnlineFlag": true, + "PaymentAcquirerData": { + "AcquirerPOIID": "P400Plus-123456789", + "ApprovalCode": "123456", + "AcquirerTransactionID": { + "TimeStamp": "2019-04-29T09:19:51.000Z", + "TransactionID": "8515565295894301" + }, + "MerchantID": "TestMerchant" + }, + "CurrencyConversion": [ + { + "ConvertedAmount": { + "AmountValue": 48.32, + "Currency": "EUR" + }, + "CustomerApprovedFlag": true, + "Markup": 3, + "Rate": 0.035 + } + ], + "PaymentInstrumentData": { + "CardData": { + "EntryMode": [ + "Tapped" + ], + "PaymentBrand": "mc", + "MaskedPan": "411111 **** 1111", + "SensitiveCardData": { + "ExpiryDate": "1225" + } + }, + "PaymentInstrumentType": "Card" + }, + "AmountsResp": { + "AuthorizedAmount": 1, + "Currency": "EUR" + } + }, + "Response": { + "Result": "Success", + "AdditionalResponse": "tid=75039202&AID=A0000000041010&transactionType=GOODS_SERVICES&backendGiftcardIndicator=false&expiryYear=2025&acquirerAccountCode=TestPmmAcquirerAccount&alias=M900978995070104&posOriginalAmountCurrency=EUR&giftcardIndicator=false&authorisedAmountValue=100&pspReference=8515565295894301&paymentMethodVariant=mc&cardHolderName=N%2fA&refusalReasonRaw=APPROVED&authorisationMid=1000&expiryDate=12%2f2025&applicationPreferredName=MCC%20351%20v1%202&acquirerCode=TestPmmAcquirer&txtime=10%3a19%3a51&iso8601TxDate=2019-04-29T09%3a19%3a51.0000000%2b0000&cardType=mc&posOriginalAmountValue=100&offline=false&aliasType=Default&txdate=29-04-2019&paymentMethod=mc&cvcResult=0%20Unknown&avsResult=0%20Unknown&mid=1000&merchantReference=003&transactionReferenceNumber=8515565295894301&expiryMonth=12&cardSummary=3511&posTotalAmountValue=100&posAuthAmountCurrency=EUR&cardHolderVerificationMethodResults=3F0300&authCode=123456&shopperCountry=NL&posEntryMode=CLESS_SWIPE&cardScheme=mc&cardBin=541333&posAuthAmountValue=100" + } + }, + "MessageHeader": { + "ProtocolVersion": "3.0", + "SaleID": "001", + "MessageClass": "Service", + "MessageCategory": "Payment", + "ServiceID": "1234567890", + "POIID": "P400Plus-123456789", + "MessageType": "Response" + } + } +} diff --git a/src/test/resources/mocks/clouddevice/status-device.json b/src/test/resources/mocks/clouddevice/status-device.json new file mode 100644 index 000000000..fc23716f2 --- /dev/null +++ b/src/test/resources/mocks/clouddevice/status-device.json @@ -0,0 +1,4 @@ +{ + "deviceId": "AMS1-000168242800763", + "status": "ONLINE" +} \ No newline at end of file