Fix uniq cache (#18)

* Add field to model
This commit is contained in:
Kostya 2019-10-18 16:27:55 +03:00 committed by GitHub
parent 9fa862fe43
commit 90a88facbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 4 deletions

View File

@ -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");

View File

@ -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;

View File

@ -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);
}

View File

@ -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());
}

View File

@ -1,2 +1 @@
rule: like("email", "test.*")
-> accept;
rule:cb:like("bin", "5536.*") AND in("pan","9137")->decline;