Skip to content

Commit

Permalink
Updated to use FraudLabs Pro v2 API
Browse files Browse the repository at this point in the history
  • Loading branch information
fraudlabspro committed Jan 11, 2024
1 parent b7b6905 commit a3cb8ee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/com/fraudlabspro/FraudLabsPro.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ public class FraudLabsPro {
/**
* Version of this library.
*
* @const string
* string
*/
public static final String VERSION = "3.2.0";
public static final String VERSION = "4.0.0";

/**
* API KEY From Merchant
Expand Down
12 changes: 6 additions & 6 deletions src/com/fraudlabspro/Order.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class Order{
/**
* Order statuses.
*
* @const string
* string
*/
public final String APPROVE = "APPROVE";
public final String REJECT = "REJECT";
Expand All @@ -26,7 +26,7 @@ public class Order{
/**
* Payment methods.
*
* @const string
* string
*/
public final String CREDIT_CARD = "CREDITCARD";
public final String PAYPAL = "PAYPAL";
Expand All @@ -41,7 +41,7 @@ public class Order{
/**
* ID types.
*
* @const string
* string
*/
public final String FLP_ID = "fraudlabspro_id";
public final String ORDER_ID = "user_order_id";
Expand Down Expand Up @@ -111,7 +111,7 @@ public String validate(Hashtable<String, String> data) {

String post = "key=" + FraudLabsPro.APIKEY + dataStr;

return Http.post(new URL("https://api.fraudlabspro.com/v1/order/screen"), post);
return Http.post(new URL("https://api.fraudlabspro.com/v2/order/screen"), post);
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand All @@ -135,7 +135,7 @@ public String feedback(Hashtable<String, String> data) {
}
String post = "key=" + FraudLabsPro.APIKEY + dataStr;

return Http.post(new URL("https://api.fraudlabspro.com/v1/order/feedback"), post);
return Http.post(new URL("https://api.fraudlabspro.com/v2/order/feedback"), post);
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand All @@ -157,7 +157,7 @@ public String getTransaction(Hashtable<String, String> data) {
dataStr.append("&").append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), "UTF-8"));
}

return Http.get(new URL("https://api.fraudlabspro.com/v1/order/result?key=" + FraudLabsPro.APIKEY + dataStr));
return Http.get(new URL("https://api.fraudlabspro.com/v2/order/result?key=" + FraudLabsPro.APIKEY + dataStr));
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down
4 changes: 2 additions & 2 deletions src/com/fraudlabspro/SMSVerification.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public String sendSMS(Hashtable<String, String> data) {
}
String post = "key=" + FraudLabsPro.APIKEY + dataStr;

return Http.post(new URL("https://api.fraudlabspro.com/v1/verification/send"), post);
return Http.post(new URL("https://api.fraudlabspro.com/v2/verification/send"), post);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand All @@ -46,7 +46,7 @@ public String verifySMS(Hashtable<String, String> data) {
dataStr.append("&").append(entry.getKey()).append("=").append(URLEncoder.encode(entry.getValue(), "UTF-8"));
}

return Http.get(new URL("https://api.fraudlabspro.com/v1/verification/result?key=" + FraudLabsPro.APIKEY + dataStr));
return Http.get(new URL("https://api.fraudlabspro.com/v2/verification/result?key=" + FraudLabsPro.APIKEY + dataStr));
} catch (Exception e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit a3cb8ee

Please sign in to comment.