1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6
7 /**
8 * Class Error
9 *
10 * Details of an Error
11 *
12 * @package PayPal\Api
13 *
14 * @property string name
15 * @property string message
16 * @property \PayPal\Api\ErrorDetails[] details
17 * @property string information_link
18 * @property string debug_id
19 * @property \PayPal\Api\Links[] links
20 */
21 class Error extends PayPalModel
22 {
23 /**
24 * Human readable, unique name of the error.
25 *
26 * @param string $name
27 *
28 * @return $this
29 */
30 public function setName($name)
31 {
32 $this->name = $name;
33 return $this;
34 }
35
36 /**
37 * Human readable, unique name of the error.
38 *
39 * @return string
40 */
41 public function getName()
42 {
43 return $this->name;
44 }
45
46 /**
47 * Reference ID of the purchase_unit associated with this error
48 *
49 * @deprecated Not publicly available
50 * @param string $purchase_unit_reference_id
51 *
52 * @return $this
53 */
54 public function setPurchaseUnitReferenceId($purchase_unit_reference_id)
55 {
56 $this->purchase_unit_reference_id = $purchase_unit_reference_id;
57 return $this;
58 }
59
60 /**
61 * Reference ID of the purchase_unit associated with this error
62 *
63 * @deprecated Not publicly available
64 * @return string
65 */
66 public function getPurchaseUnitReferenceId()
67 {
68 return $this->purchase_unit_reference_id;
69 }
70
71 /**
72 * PayPal internal error code.
73 *
74 * @deprecated Not publicly available
75 * @param string $code
76 *
77 * @return $this
78 */
79 public function setCode($code)
80 {
81 $this->code = $code;
82 return $this;
83 }
84
85 /**
86 * PayPal internal error code.
87 *
88 * @deprecated Not publicly available
89 * @return string
90 */
91 public function getCode()
92 {
93 return $this->code;
94 }
95
96 /**
97 * PayPal internal identifier used for correlation purposes.
98 *
99 * @param string $debug_id
100 *
101 * @return $this
102 */
103 public function setDebugId($debug_id)
104 {
105 $this->debug_id = $debug_id;
106 return $this;
107 }
108
109 /**
110 * PayPal internal identifier used for correlation purposes.
111 *
112 * @return string
113 */
114 public function getDebugId()
115 {
116 return $this->debug_id;
117 }
118
119 /**
120 * Message describing the error.
121 *
122 * @param string $message
123 *
124 * @return $this
125 */
126 public function setMessage($message)
127 {
128 $this->message = $message;
129 return $this;
130 }
131
132 /**
133 * Message describing the error.
134 *
135 * @return string
136 */
137 public function getMessage()
138 {
139 return $this->message;
140 }
141
142 /**
143 * URI for detailed information related to this error for the developer.
144 *
145 * @param string $information_link
146 *
147 * @return $this
148 */
149 public function setInformationLink($information_link)
150 {
151 $this->information_link = $information_link;
152 return $this;
153 }
154
155 /**
156 * URI for detailed information related to this error for the developer.
157 *
158 * @return string
159 */
160 public function getInformationLink()
161 {
162 return $this->information_link;
163 }
164
165 /**
166 * Additional details of the error
167 *
168 * @param \PayPal\Api\ErrorDetails[] $details
169 *
170 * @return $this
171 */
172 public function setDetails($details)
173 {
174 $this->details = $details;
175 return $this;
176 }
177
178 /**
179 * Additional details of the error
180 *
181 * @return \PayPal\Api\ErrorDetails[]
182 */
183 public function getDetails()
184 {
185 return $this->details;
186 }
187
188 /**
189 * Append Details to the list.
190 *
191 * @param \PayPal\Api\ErrorDetails $errorDetails
192 * @return $this
193 */
194 public function addDetail($errorDetails)
195 {
196 if (!$this->getDetails()) {
197 return $this->setDetails(array($errorDetails));
198 } else {
199 return $this->setDetails(
200 array_merge($this->getDetails(), array($errorDetails))
201 );
202 }
203 }
204
205 /**
206 * Remove Details from the list.
207 *
208 * @param \PayPal\Api\ErrorDetails $errorDetails
209 * @return $this
210 */
211 public function removeDetail($errorDetails)
212 {
213 return $this->setDetails(
214 array_diff($this->getDetails(), array($errorDetails))
215 );
216 }
217
218 /**
219 * response codes returned from a payment processor such as avs, cvv, etc. Only supported when the `payment_method` is set to `credit_card`.
220 *
221 * @deprecated Not publicly available
222 * @param \PayPal\Api\ProcessorResponse $processor_response
223 *
224 * @return $this
225 */
226 public function setProcessorResponse($processor_response)
227 {
228 $this->processor_response = $processor_response;
229 return $this;
230 }
231
232 /**
233 * response codes returned from a payment processor such as avs, cvv, etc. Only supported when the `payment_method` is set to `credit_card`.
234 *
235 * @deprecated Not publicly available
236 * @return \PayPal\Api\ProcessorResponse
237 */
238 public function getProcessorResponse()
239 {
240 return $this->processor_response;
241 }
242
243 /**
244 * Fraud filter details. Only supported when the `payment_method` is set to `credit_card`
245 *
246 * @deprecated Not publicly available
247 * @param \PayPal\Api\FmfDetails $fmf_details
248 *
249 * @return $this
250 */
251 public function setFmfDetails($fmf_details)
252 {
253 $this->fmf_details = $fmf_details;
254 return $this;
255 }
256
257 /**
258 * Fraud filter details. Only supported when the `payment_method` is set to `credit_card`
259 *
260 * @deprecated Not publicly available
261 * @return \PayPal\Api\FmfDetails
262 */
263 public function getFmfDetails()
264 {
265 return $this->fmf_details;
266 }
267
268 /**
269 * Sets Links
270 *
271 * @param \PayPal\Api\Links[] $links
272 *
273 * @return $this
274 */
275 public function setLinks($links)
276 {
277 $this->links = $links;
278 return $this;
279 }
280
281 /**
282 * Gets Links
283 *
284 * @return \PayPal\Api\Links[]
285 */
286 public function getLinks()
287 {
288 return $this->links;
289 }
290
291 /**
292 * Append Links to the list.
293 *
294 * @param \PayPal\Api\Links $links
295 * @return $this
296 */
297 public function addLink($links)
298 {
299 if (!$this->getLinks()) {
300 return $this->setLinks(array($links));
301 } else {
302 return $this->setLinks(
303 array_merge($this->getLinks(), array($links))
304 );
305 }
306 }
307
308 /**
309 * Remove Links from the list.
310 *
311 * @param \PayPal\Api\Links $links
312 * @return $this
313 */
314 public function removeLink($links)
315 {
316 return $this->setLinks(
317 array_diff($this->getLinks(), array($links))
318 );
319 }
320 }
321