use of com.ingenico.connect.gateway.sdk.java.domain.sessions.SessionResponse in project connect-sdk-client-android by Ingenico-ePayments.
the class BaseAsyncTaskTest method initializeValidMocksAndSession.
/**
* Creates a mocked configuration that produces valid requests
*/
void initializeValidMocksAndSession() throws CommunicationException {
SessionRequest request = new SessionRequest();
if (token != null) {
request.setTokens(Collections.singletonList(token));
}
try {
SessionResponse response = sessionUtil.createSession(testMerchantId, request);
initializeValidMocks(response);
} catch (ApiException e) {
throw new CommunicationException("ApiException while creating session", e);
}
}
use of com.ingenico.connect.gateway.sdk.java.domain.sessions.SessionResponse in project connect-sdk-java by Ingenico-ePayments.
the class CreateSessionExample method example.
@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
Client client = getClient();
try {
List<String> tokens = new ArrayList<String>();
tokens.add("126166b16ed04b3ab85fb06da1d7a167");
tokens.add("226166b16ed04b3ab85fb06da1d7a167");
tokens.add("122c5b4d-dd40-49f0-b7c9-3594212167a9");
tokens.add("326166b16ed04b3ab85fb06da1d7a167");
tokens.add("426166b16ed04b3ab85fb06da1d7a167");
SessionRequest body = new SessionRequest();
body.setTokens(tokens);
SessionResponse response = client.merchant("merchantId").sessions().create(body);
} finally {
client.close();
}
}
Aggregations