com.adyen.service.PosPayment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of adyen-java-api-library Show documentation
Show all versions of adyen-java-api-library Show documentation
Adyen API Client Library for Java
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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.service;
import com.adyen.ApiKeyAuthenticatedService;
import com.adyen.Client;
import com.adyen.model.terminal.ConnectedTerminalsRequest;
import com.adyen.model.terminal.ConnectedTerminalsResponse;
import com.adyen.service.exception.ApiException;
import com.adyen.service.resource.terminal.cloud.ConnectedTerminals;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
public class PosPayment extends ApiKeyAuthenticatedService {
private ConnectedTerminals connectedTerminals;
public PosPayment(Client client) {
super(client);
connectedTerminals = new ConnectedTerminals(this);
}
/**
* POST /connectedTerminals API call
*
* @param connectedTerminalsRequest ConnectedTerminalsRequest
* @return ConnectedTerminalsResponse
* @throws IOException IOException
* @throws ApiException ApiException
*/
public ConnectedTerminalsResponse connectedTerminals(ConnectedTerminalsRequest connectedTerminalsRequest) throws IOException, ApiException {
String jsonRequest = GSON.toJson(connectedTerminalsRequest);
String jsonResult = connectedTerminals.request(jsonRequest);
return GSON.fromJson(jsonResult, new TypeToken() {
}.getType());
}
}