mirror of
https://github.com/valitydev/fraudo.git
synced 2024-11-06 01:45:16 +00:00
Add TRUST ResultStatus (#45)
This commit is contained in:
parent
df4ac1de4d
commit
3f5aa6c9b6
@ -93,7 +93,8 @@ country_by
|
|||||||
;
|
;
|
||||||
|
|
||||||
result
|
result
|
||||||
: 'accept'
|
: 'trust'
|
||||||
|
| 'accept'
|
||||||
| '3ds'
|
| '3ds'
|
||||||
| 'highRisk'
|
| 'highRisk'
|
||||||
| 'decline'
|
| 'decline'
|
||||||
@ -103,7 +104,8 @@ result
|
|||||||
;
|
;
|
||||||
|
|
||||||
catch_result
|
catch_result
|
||||||
: 'accept'
|
: 'trust'
|
||||||
|
| 'accept'
|
||||||
| '3ds'
|
| '3ds'
|
||||||
| 'highRisk'
|
| 'highRisk'
|
||||||
| 'notify'
|
| 'notify'
|
||||||
|
@ -5,6 +5,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
public enum ResultStatus {
|
public enum ResultStatus {
|
||||||
|
|
||||||
|
TRUST("trust"),
|
||||||
ACCEPT("accept"),
|
ACCEPT("accept"),
|
||||||
ACCEPT_AND_NOTIFY("acceptAndNotify"),
|
ACCEPT_AND_NOTIFY("acceptAndNotify"),
|
||||||
THREE_DS("3ds"),
|
THREE_DS("3ds"),
|
||||||
|
@ -27,6 +27,13 @@ public class CustomTest extends AbstractPaymentTest {
|
|||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void trustTest() throws Exception {
|
||||||
|
InputStream resourceAsStream = CustomTest.class.getResourceAsStream("/rules/trust.frd");
|
||||||
|
ResultModel result = parseAndVisit(resourceAsStream);
|
||||||
|
assertEquals(ResultStatus.TRUST, ResultUtils.findFirstNotNotifyStatus(result).get().getResultStatus());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void threeDsTest() throws Exception {
|
void threeDsTest() throws Exception {
|
||||||
InputStream resourceAsStream = CustomTest.class.getResourceAsStream("/rules/three_ds.frd");
|
InputStream resourceAsStream = CustomTest.class.getResourceAsStream("/rules/three_ds.frd");
|
||||||
|
2
src/test/resources/rules/trust.frd
Normal file
2
src/test/resources/rules/trust.frd
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
rule: rand(2) < 3
|
||||||
|
-> trust;
|
Loading…
Reference in New Issue
Block a user