Return to Snippet

Revision: 62851
at March 18, 2013 18:24 by Hexahow


Initial Code
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
 
public class FLP {
    public static void main(String[] args) {
        try {
 
        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");
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("GET");
        conn.setRequestProperty("Accept", "application/json");
 
        if (conn.getResponseCode() != 200) {
            throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode());
        }
 
        BufferedReader br = new BufferedReader(new InputStreamReader(
            (conn.getInputStream())));
 
        String output;
 
        while ((output = br.readLine()) != null) {
            System.out.println(output);
        }
 
        conn.disconnect();
 
      } catch (MalformedURLException e) {
 
        e.printStackTrace();
 
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
}

Initial URL
http://www.fraudlabspro.com

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

Initial Title
FraudLabs Pro Fraud Prevention

Initial Tags
Online

Initial Language
Java