Rules

Non-3D-Secure payments are processed by fraud rules which are defined by the merchant. Fraud Rules are defined with a language called Fraud DSL which is developed by Craftgate.

When payment matches defined rule, action of the rule (see: Fraud Actions) will be applied.

Fraud Actions
Action Description
REVIEW Review
BLOCK Block

1. Rule Definition

In order to define rules, you can use Fraud Management > Rule Management > New Rule button to open up Rule Definition modal window.

Fraud Rule Definition

When defined rule action is 'Block', payment will be blocked by FRAUD_BLOCK error group
When defined rule action is 'Review', payment will be allowed but a fraud check record will be created by system.

Rule Definition

Rule definition modal has a rule editor which configured to use Fraud DSL Language
Rule editor will help you to define rules with autocomplete features. Autocomplete will help create rules with rule variables listed below, operators and lists can be used.

Fraud DSL

In order to detect fraud payments, Fraud DSL language has a special syntax. This syntax has very flexible content with numerous predefined variables and user defined list for you to create your own criteria.

A Fraud rule can be consists of one or more conditions. These conditions can be combined with an and operator. Rule conditions can be created with variables listed below. Rule Format: [condition] and [condition] and ...

Condition Format: [variable] [operator] [value/list]

Note: Variables with type boolean can be used without operator and value because it has value of true or false. For example sameCardNumberHasFraudSuspectHourly and ...

Rule Operators

Operator Description Example
== Tests if condition variable is equal to value. clientIp == "127.0.0.1
!= Tests if condition variable is not equal to value. clientIp != "127.0.0.1
< Tests if condition variable is less than value. Can only be used with variables have numerical data types(integer ya da float). sameClientIpIn30Minutes < 3
<= Tests if condition variable is less than or equal to value. Can only be used with variables have numerical data types(integer ya da float). sameClientIpIn30Minutes <= 3
> Tests if condition variable is greater than value. Can only be used with variables have numerical data types(integer ya da float). sameClientIpIn30Minutes > 3
>= Tests if condition variable is greater than or equal to value. Can only be used with variables have numerical data types(integer ya da float). sameClientIpIn30Minutes >= 3
in Tests if condition variable exists list values. clientIp in @ipBlackList
not in Tests if condition variable not exists list values. clientIp not @ipWhiteList

Variables

Variable Name Data Type Description
cardNumber cardFingerprint Card Fingerprint
clientIp string Client IP
buyerId integer Member ID
hasSuccessPaymentIn30Minutes boolean Has any success payment before now in last 30 minutes
hasSuccessPaymentHourly boolean Has any success payment before now in last 1 hour
hasSuccessPaymentDaily boolean Has any success payment before now in last 1 day
sameClientIpIn30Minutes integer Previous payment count with same ip in last 30 minutes
sameClientIpHourly integer Previous payment count with same ip in last 1 hour
sameClientIpDaily integer Previous payment count with same ip in last 1 day
sameClientIpTotalPaidPriceIn30Minutes float Total paid price of previous payments with same ip in last 30 minutes
sameClientIpTotalPaidPriceHourly float Total paid price of previous payments with same ip in last 1 hour
sameClientIpTotalPaidPriceDaily float Total paid price of previous payments now with same ip in last 1 day
sameBuyerIdIn30Minutes integer Previous payment count with same member id in last 30 minutes
sameBuyerIdHourly integer Previous payment count with same member id in last 1 hour
sameBuyerIdDaily integer Previous payment count with same member id in last 1 day
sameBuyerIdTotalPaidPriceIn30Minutes float Total paid price of previous payments with same member id in last 30 minutes
sameBuyerIdTotalPaidPriceHourly float Total paid price of previous payments with same member id in last 1 hour
sameBuyerIdTotalPaidPriceDaily float Total paid price of previous payments now with same member id in last 1 day
sameCardNumberIn30Minutes integer Previous payment count with same card number in last 30 minutes
sameCardNumberHourly integer Previous payment count with same card number in last 1 hour
sameCardNumberTotalPaidPriceIn30Minutes float Total paid price of previous payments with same card number in last 30 minutes
sameCardNumberTotalPaidPriceHourly float Total paid price of previous payments with same card number in last 1 hour
sameCardNumberHasFraudSuspectIn30Minutes boolean Has any payment with FRAUD_SUSPECT error group before now with same card number in last 30 minutes
sameCardNumberHasFraudSuspectHourly boolean Has any payment with FRAUD_SUSPECT error group before now with same card number in last 1 hour

Rule Examples

You can check out following examples to guide you for creating your own rules

Example Rule Description
cardNumber in @blockedCardNumbers List usage example - Matches payments with card numbers in blockedCardList
sameClientIpHourly > 2 and sameClientIpTotalPaidPriceHourly >= 10000 Previous payments velocity check example
Matches if total paid price of previous payments with same ip in last 1 hour equal to or greater than 10000
and previous payment count with same ip in last 1 hour greater than 2