Posted By

Hexahow on 03/18/13


Tagged

reduce Online fraud fraudlabs chargeback


Versions (?)

FraudLabs Pro Fraud Prevention


 / Published in: Java
 

URL: http://www.fraudlabspro.com

This sample code shows you how to screen an order to prevent fraud and chargebacks.

  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import java.net.HttpURLConnection;
  5. import java.net.MalformedURLException;
  6. import java.net.URL;
  7.  
  8. public class FLP {
  9. public static void main(String[] args) {
  10. try {
  11.  
  12. URL url = new URL("https://api.fraudlabspro.com/v1/order/screen?key=Enter_License_Key&format=json&ip=127.0.0.1&bill_city=Cleveland&bill_state=OH&bill_zip_code=44115&bill_country=US&ship_addr=4987%20Bingamon%20Road&ship_city=Cleveland&ship_state=OH&ship_zip_code=44115&ship_country=US&email_domain=gmail.com&phone=440-5551961&email_hash=2d230a121ecf9efb075b8300c52d82ed990626fb&username_hash=e2f888cf370b546e50b4cd75d54123dc5dbb8a32&password_hash=079f277fa3c27cb64d89f9c8725c6d439af60e5e&bin_no=558265&bank_name=Bank%20of%20Ocean%20View&bank_phone=212-500-2489&card_hash=503e3a5e2e56fddf429e1c94e23f3b294bc5491a&avs_result=Y&cvv_result=M&user_order_id=7893&amount=99.95&quantity=1┬Ący=USD&department=Online+Store&payment_mode=creditcard");
  13. HttpURLConnection conn = (HttpURLConnection) url.openConnection();
  14. conn.setRequestMethod("GET");
  15. conn.setRequestProperty("Accept", "application/json");
  16.  
  17. if (conn.getResponseCode() != 200) {
  18. throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode());
  19. }
  20.  
  21. (conn.getInputStream())));
  22.  
  23. String output;
  24.  
  25. while ((output = br.readLine()) != null) {
  26. System.out.println(output);
  27. }
  28.  
  29. conn.disconnect();
  30.  
  31. } catch (MalformedURLException e) {
  32.  
  33. e.printStackTrace();
  34.  
  35. } catch (IOException e) {
  36. e.printStackTrace();
  37. }
  38. }
  39. }

Report this snippet  

You need to login to post a comment.