mirror of
https://github.com/valitydev/fraudo.git
synced 2024-11-06 01:45:16 +00:00
parent
9fa862fe43
commit
90a88facbe
@ -11,6 +11,7 @@ public enum CheckedField {
|
||||
COUNTRY_BANK("country_bank"),
|
||||
COUNTRY_IP("country_ip"),
|
||||
BIN("bin"),
|
||||
PAN("pan"),
|
||||
SHOP_ID("shop_id"),
|
||||
PARTY_ID("party_id"),
|
||||
CARD_TOKEN("card_token");
|
||||
|
@ -8,6 +8,7 @@ public class FraudModel {
|
||||
private String ip;
|
||||
private String email;
|
||||
private String bin;
|
||||
private String pan;
|
||||
private String binCountryCode;
|
||||
private String cardToken;
|
||||
private String fingerprint;
|
||||
|
@ -20,6 +20,8 @@ public class FieldResolver {
|
||||
return fraudModel.getBinCountryCode();
|
||||
case CARD_TOKEN:
|
||||
return fraudModel.getCardToken();
|
||||
case PAN:
|
||||
return fraudModel.getPan();
|
||||
default:
|
||||
throw new UnresolvableFieldException(fieldName);
|
||||
}
|
||||
|
@ -121,10 +121,12 @@ public class CustomTest extends AbstractFraudoTest {
|
||||
com.rbkmoney.fraudo.FraudoParser.ParseContext parseContext = getParseContext(resourceAsStream);
|
||||
FraudModel model = new FraudModel();
|
||||
model.setEmail(TEST_GMAIL_RU);
|
||||
model.setBin("553619");
|
||||
model.setPan("9137");
|
||||
ResultModel result = invoke(parseContext, model);
|
||||
assertEquals(ResultStatus.ACCEPT, result.getResultStatus());
|
||||
assertEquals(ResultStatus.DECLINE, result.getResultStatus());
|
||||
|
||||
model.setEmail("teeeee");
|
||||
model.setPan("9111");
|
||||
result = invoke(parseContext, model);
|
||||
assertEquals(ResultStatus.NORMAL, result.getResultStatus());
|
||||
}
|
||||
|
@ -1,2 +1 @@
|
||||
rule: like("email", "test.*")
|
||||
-> accept;
|
||||
rule:cb:like("bin", "5536.*") AND in("pan","9137")->decline;
|
Loading…
Reference in New Issue
Block a user