Developer Guide

WebHook (Order Status Changed)

You can register for the order status change event by entering the callback URL at the settings page. Whenever the below state changed, FraudLabs Pro will trigger the event to the given callback URL.

  • REVIEW ==> APPROVE
  • REVIEW ==> REJECT
  • APPROVE ==> REJECT
  • REJECT ==> APPROVE

POST Data

Parameter Description
id System own unique identifier to identify a transaction.
action FraudLabs Pro status changed.
Valid Values: APPROVE | REJECT

Sample Codes

<?php
$transactionId = $_POST['id'];
$action = $_POST['action'];

switch($action){
	case 'APPROVE':
		// Do something
		break;

	case 'REJECT':
		// Do something
		break;
}
?>
private enum ACTION { APPROVE, REJECT, IGNORE; }
String transactionId = request.getParameter("id");
String action = request.getParameter("action");

switch(action) {
	case APPROVE:
		// Do something
	break;

	case REJECT:
		// Do something
	break;
}
Dim transactionId as String = Page.Request.Form("id")
Dim action as String = Page.Request.Form("action")

Select Case action
	Case "APPROVE"
		' Do something

	Case "REJECT"
		' Do something

	Case Else
		' Do something
End Select
string transactionId = Page.Request.Form("id");
string action = Page.Request.Form("action");

switch (action) {
	case "APPROVE":
		// Do something
		break;

	case "REJECT":
		// Do something
		break;

	default:
		// Do something
		break;
}
import cgi
form = cgi.FieldStorage()

transaction_id = form["id"]
action = form["action"]

if action.upper() == 'APPROVE':
	# Do something

elif action.upper() == 'REJECT':
	# Do something

else:
	# Do something