-
Notifications
You must be signed in to change notification settings - Fork 19
/
TransactionReport.php
40 lines (37 loc) · 1.1 KB
/
TransactionReport.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace MaxMind\MinFraud\Validation\Rules;
use Respect\Validation\Rules\AbstractWrapper;
use Respect\Validation\Validator as v;
/**
* @internal
*/
class TransactionReport extends AbstractWrapper
{
public function __construct()
{
$this->validatable = v::keySet(
v::key('chargeback_code', v::stringType(), false),
v::key('ip_address', v::ip(), true),
v::key('maxmind_id', v::stringType()->length(8, 8), false),
v::key(
'minfraud_id',
v::regex('/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/'),
false
),
v::key('notes', v::stringType(), false),
v::key(
'tag',
v::in(
[
'not_fraud',
'suspected_fraud',
'spam_or_abuse',
'chargeback',
]
),
true
),
v::key('transaction_id', v::stringType(), false)
);
}
}