Here is the general code for the HttpClient call:
public static Map<String, String> sendCCPayment(Payment payment, Map<String, String> paymentGatewayConfig) {
HttpPost post = new HttpPost(gatewayUrl);
HttpClient client = new DefaultHttpClient();
Map<String, String> responseProps = new HashMap<String, String>();
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
//Bind payment name value pairs for the POST Request
//The service takes name value pairs or xml
post.setEntity(new UrlEncodedFormEntity(data));
HttpResponse response = client.execute(post);
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
String line = "";
while ((line = rd.readLine()) != null) {
//read data
}
} catch (IOException e) {
e.printStackTrace();
}
return responseProps;
}
Thanks
WS.url(url).setContentType("application/x-www-form-urlencoded")
.post(urlEncodedString);
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.