1 | <?php |
||
19 | class Chargeback |
||
20 | { |
||
21 | /** |
||
22 | * Indicates transaction is unlikely fraudulent |
||
23 | */ |
||
24 | const NOT_FRAUD = 'not_fraud'; |
||
25 | /** |
||
26 | * Indicates transaction is suspectedly fraudulent |
||
27 | */ |
||
28 | const SUSPECTED_FRAUD = 'suspected_fraud'; |
||
29 | /** |
||
30 | * Indicates transaction is likely fraudulent |
||
31 | */ |
||
32 | const KNOWN_FRAUD = 'known_fraud'; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $ipAddress; |
||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $chargebackCode; |
||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $fraudScore; |
||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $maxmindId; |
||
50 | /** |
||
51 | * @var string |
||
52 | */ |
||
53 | protected $minfraudId; |
||
54 | /** |
||
55 | * @var string |
||
56 | */ |
||
57 | protected $transactionId; |
||
58 | |||
59 | /** |
||
60 | * @param string $ipAddress The IP address of the customer placing the order. |
||
61 | * This should be passed as a string like “44.55.66.77” or “2001:db8::2:1”. |
||
62 | * |
||
63 | * @throws InvalidArgumentException |
||
64 | */ |
||
65 | 33 | public function __construct($ipAddress) |
|
71 | |||
72 | /** |
||
73 | * @param A string which is provided by your payment processor |
||
74 | * indicating the reason for the chargeback. |
||
75 | * @see https://en.wikipedia.org/wiki/Chargeback#Reason_codes |
||
76 | * |
||
77 | * @throws InvalidArgumentException |
||
78 | * |
||
79 | * @return Chargeback |
||
80 | */ |
||
81 | 1 | public function setChargebackCode($chargebackCode) |
|
89 | |||
90 | /** |
||
91 | * @param string $fraudScore A string indicating the likelihood that |
||
92 | * a transaction may be fraudulent. |
||
93 | * Possible values: ‘not_fraud’, ‘suspected_fraud’, ‘known_fraud’. |
||
94 | * |
||
95 | * @throws InvalidArgumentException |
||
96 | * |
||
97 | * @return Chargeback |
||
98 | */ |
||
99 | 4 | public function setFraudScore($fraudScore) |
|
113 | |||
114 | /** |
||
115 | * @param string $maxmindId A unique eight character string identifying |
||
116 | * a minFraud Standard or Premium request. These IDs are returned in the |
||
117 | * maxmindID field of a response for a successful minFraud request. |
||
118 | * This field is not required, but you are encouraged to provide it, if possible. |
||
119 | * |
||
120 | * @throws InvalidArgumentException |
||
121 | * |
||
122 | * @return Chargeback |
||
123 | */ |
||
124 | 1 | public function setMaxmindId($maxmindId) |
|
132 | |||
133 | /** |
||
134 | * @param string $minfraudId A UUID that identifies a minFraud Score, |
||
135 | * minFraud Insights, or minFraud Factors request. |
||
136 | * This ID is returned at /id in the response. |
||
137 | * This field is not required, but you are encouraged to provide it if |
||
138 | * the request was made to one of these services. |
||
139 | * |
||
140 | * @throws InvalidArgumentException |
||
141 | * |
||
142 | * @return Chargeback |
||
143 | */ |
||
144 | 1 | public function setMinfraudId($minfraudId) |
|
152 | |||
153 | /** |
||
154 | * @param string $transactionId The transaction ID you originally passed to minFraud. |
||
155 | * This field is not required, but you are encouraged to provide it or |
||
156 | * the transaction’s maxmind_id or minfraud_id. |
||
157 | * |
||
158 | * @throws InvalidArgumentException |
||
159 | * |
||
160 | * @return Chargeback |
||
161 | */ |
||
162 | 1 | public function setTransactionId($transactionId) |
|
170 | |||
171 | /** |
||
172 | * @return array An array with properties in key=>value fashion |
||
173 | */ |
||
174 | 11 | public function toArray() |
|
203 | } |
||
204 |