buffer.append(" </hostedProfileSettings>\n");
buffer.append("</getHostedProfilePageRequest>\n");
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(merchant.isSandboxEnvironment() ? TEST_URL : PRODUCTION_URL);
EntityBuilder entityBuilder = EntityBuilder.create();
entityBuilder.setContentType(ContentType.TEXT_XML);
entityBuilder.setContentEncoding("utf-8");
entityBuilder.setText(buffer.toString());
httpPost.setEntity(entityBuilder.build());
try {
CloseableHttpResponse httpResponse = httpClient.execute(httpPost);
String response = EntityUtils.toString(httpResponse.getEntity());
int start = response.indexOf(ELEMENT_TOKEN_OPEN);