1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PayPal\StructType; |
4
|
|
|
|
5
|
|
|
use \WsdlToPhp\PackageBase\AbstractStructBase; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* This class stands for DoExpressCheckoutPaymentResponseDetailsType StructType |
9
|
|
|
* @subpackage Structs |
10
|
|
|
* @author WsdlToPhp <[email protected]> |
11
|
|
|
*/ |
12
|
|
|
class DoExpressCheckoutPaymentResponseDetailsType extends AbstractStructBase |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* The Token |
16
|
|
|
* Meta information extracted from the WSDL |
17
|
|
|
* - documentation: The timestamped token value that was returned by SetExpressCheckoutResponse and passed on GetExpressCheckoutDetailsRequest. Character length and limitations:20 single-byte characters |
18
|
|
|
* - base: xs:string |
19
|
|
|
* @var string |
20
|
|
|
*/ |
21
|
|
|
public $Token; |
22
|
|
|
/** |
23
|
|
|
* The PaymentInfo |
24
|
|
|
* Meta information extracted from the WSDL |
25
|
|
|
* - documentation: Information about the transaction |
26
|
|
|
* - maxOccurs: 10 |
27
|
|
|
* - minOccurs: 0 |
28
|
|
|
* @var \PayPal\StructType\PaymentInfoType[] |
29
|
|
|
*/ |
30
|
|
|
public $PaymentInfo; |
31
|
|
|
/** |
32
|
|
|
* The BillingAgreementID |
33
|
|
|
* Meta information extracted from the WSDL |
34
|
|
|
* - maxOccurs: 1 |
35
|
|
|
* - minOccurs: 0 |
36
|
|
|
* @var string |
37
|
|
|
*/ |
38
|
|
|
public $BillingAgreementID; |
39
|
|
|
/** |
40
|
|
|
* The RedirectRequired |
41
|
|
|
* Meta information extracted from the WSDL |
42
|
|
|
* - maxOccurs: 1 |
43
|
|
|
* - minOccurs: 0 |
44
|
|
|
* @var string |
45
|
|
|
*/ |
46
|
|
|
public $RedirectRequired; |
47
|
|
|
/** |
48
|
|
|
* The Note |
49
|
|
|
* Meta information extracted from the WSDL |
50
|
|
|
* - documentation: Memo entered by sender in PayPal Review Page note field. Optional Character length and limitations: 255 single-byte alphanumeric characters |
51
|
|
|
* - maxOccurs: 1 |
52
|
|
|
* - minOccurs: 0 |
53
|
|
|
* @var string |
54
|
|
|
*/ |
55
|
|
|
public $Note; |
56
|
|
|
/** |
57
|
|
|
* The MsgSubID |
58
|
|
|
* Meta information extracted from the WSDL |
59
|
|
|
* - documentation: Unique id passed in the DoEC call. |
60
|
|
|
* - maxOccurs: 1 |
61
|
|
|
* - minOccurs: 0 |
62
|
|
|
* @var string |
63
|
|
|
*/ |
64
|
|
|
public $MsgSubID; |
65
|
|
|
/** |
66
|
|
|
* The SuccessPageRedirectRequested |
67
|
|
|
* Meta information extracted from the WSDL |
68
|
|
|
* - documentation: Redirect back to PayPal, PayPal can host the success page. |
69
|
|
|
* - maxOccurs: 1 |
70
|
|
|
* - minOccurs: 0 |
71
|
|
|
* @var string |
72
|
|
|
*/ |
73
|
|
|
public $SuccessPageRedirectRequested; |
74
|
|
|
/** |
75
|
|
|
* The UserSelectedOptions |
76
|
|
|
* Meta information extracted from the WSDL |
77
|
|
|
* - documentation: Information about the user selected options. |
78
|
|
|
* - maxOccurs: 1 |
79
|
|
|
* - minOccurs: 0 |
80
|
|
|
* @var \PayPal\StructType\UserSelectedOptionType |
81
|
|
|
*/ |
82
|
|
|
public $UserSelectedOptions; |
83
|
|
|
/** |
84
|
|
|
* The CoupledPaymentInfo |
85
|
|
|
* Meta information extracted from the WSDL |
86
|
|
|
* - documentation: Information about Coupled Payment transactions. |
87
|
|
|
* - maxOccurs: 5 |
88
|
|
|
* - minOccurs: 0 |
89
|
|
|
* @var \PayPal\StructType\CoupledPaymentInfoType[] |
90
|
|
|
*/ |
91
|
|
|
public $CoupledPaymentInfo; |
92
|
|
|
/** |
93
|
|
|
* Constructor method for DoExpressCheckoutPaymentResponseDetailsType |
94
|
|
|
* @uses DoExpressCheckoutPaymentResponseDetailsType::setToken() |
95
|
|
|
* @uses DoExpressCheckoutPaymentResponseDetailsType::setPaymentInfo() |
96
|
|
|
* @uses DoExpressCheckoutPaymentResponseDetailsType::setBillingAgreementID() |
97
|
|
|
* @uses DoExpressCheckoutPaymentResponseDetailsType::setRedirectRequired() |
98
|
|
|
* @uses DoExpressCheckoutPaymentResponseDetailsType::setNote() |
99
|
|
|
* @uses DoExpressCheckoutPaymentResponseDetailsType::setMsgSubID() |
100
|
|
|
* @uses DoExpressCheckoutPaymentResponseDetailsType::setSuccessPageRedirectRequested() |
101
|
|
|
* @uses DoExpressCheckoutPaymentResponseDetailsType::setUserSelectedOptions() |
102
|
|
|
* @uses DoExpressCheckoutPaymentResponseDetailsType::setCoupledPaymentInfo() |
103
|
|
|
* @param string $token |
104
|
|
|
* @param \PayPal\StructType\PaymentInfoType[] $paymentInfo |
105
|
|
|
* @param string $billingAgreementID |
106
|
|
|
* @param string $redirectRequired |
107
|
|
|
* @param string $note |
108
|
|
|
* @param string $msgSubID |
109
|
|
|
* @param string $successPageRedirectRequested |
110
|
|
|
* @param \PayPal\StructType\UserSelectedOptionType $userSelectedOptions |
111
|
|
|
* @param \PayPal\StructType\CoupledPaymentInfoType[] $coupledPaymentInfo |
112
|
|
|
*/ |
113
|
|
|
public function __construct($token = null, array $paymentInfo = array(), $billingAgreementID = null, $redirectRequired = null, $note = null, $msgSubID = null, $successPageRedirectRequested = null, \PayPal\StructType\UserSelectedOptionType $userSelectedOptions = null, array $coupledPaymentInfo = array()) |
114
|
|
|
{ |
115
|
|
|
$this |
116
|
|
|
->setToken($token) |
117
|
|
|
->setPaymentInfo($paymentInfo) |
118
|
|
|
->setBillingAgreementID($billingAgreementID) |
119
|
|
|
->setRedirectRequired($redirectRequired) |
120
|
|
|
->setNote($note) |
121
|
|
|
->setMsgSubID($msgSubID) |
122
|
|
|
->setSuccessPageRedirectRequested($successPageRedirectRequested) |
123
|
|
|
->setUserSelectedOptions($userSelectedOptions) |
124
|
|
|
->setCoupledPaymentInfo($coupledPaymentInfo); |
125
|
|
|
} |
126
|
|
|
/** |
127
|
|
|
* Get Token value |
128
|
|
|
* @return string|null |
129
|
|
|
*/ |
130
|
|
|
public function getToken() |
131
|
|
|
{ |
132
|
|
|
return $this->Token; |
133
|
|
|
} |
134
|
|
|
/** |
135
|
|
|
* Set Token value |
136
|
|
|
* @param string $token |
137
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
138
|
|
|
*/ |
139
|
|
|
public function setToken($token = null) |
140
|
|
|
{ |
141
|
|
|
// validation for constraint: string |
142
|
|
|
if (!is_null($token) && !is_string($token)) { |
|
|
|
|
143
|
|
|
throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); |
144
|
|
|
} |
145
|
|
|
$this->Token = $token; |
146
|
|
|
return $this; |
147
|
|
|
} |
148
|
|
|
/** |
149
|
|
|
* Get PaymentInfo value |
150
|
|
|
* @return \PayPal\StructType\PaymentInfoType[]|null |
151
|
|
|
*/ |
152
|
|
|
public function getPaymentInfo() |
153
|
|
|
{ |
154
|
|
|
return $this->PaymentInfo; |
155
|
|
|
} |
156
|
|
|
/** |
157
|
|
|
* This method is responsible for validating the values passed to the setPaymentInfo method |
158
|
|
|
* This method is willingly generated in order to preserve the one-line inline validation within the setPaymentInfo method |
159
|
|
|
* @param array $values |
160
|
|
|
* @return string A non-empty message if the values does not match the validation rules |
161
|
|
|
*/ |
162
|
|
|
public static function validatePaymentInfoForArrayConstraintsFromSetPaymentInfo(array $values = array()) |
163
|
|
|
{ |
164
|
|
|
$message = ''; |
165
|
|
|
$invalidValues = []; |
166
|
|
|
foreach ($values as $doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem) { |
167
|
|
|
// validation for constraint: itemType |
168
|
|
|
if (!$doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem instanceof \PayPal\StructType\PaymentInfoType) { |
169
|
|
|
$invalidValues[] = is_object($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem) ? get_class($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem) : sprintf('%s(%s)', gettype($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem), var_export($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem, true)); |
170
|
|
|
} |
171
|
|
|
} |
172
|
|
|
if (!empty($invalidValues)) { |
173
|
|
|
$message = sprintf('The PaymentInfo property can only contain items of type \PayPal\StructType\PaymentInfoType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); |
|
|
|
|
174
|
|
|
} |
175
|
|
|
unset($invalidValues); |
176
|
|
|
return $message; |
177
|
|
|
} |
178
|
|
|
/** |
179
|
|
|
* Set PaymentInfo value |
180
|
|
|
* @throws \InvalidArgumentException |
181
|
|
|
* @param \PayPal\StructType\PaymentInfoType[] $paymentInfo |
182
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
183
|
|
|
*/ |
184
|
|
|
public function setPaymentInfo(array $paymentInfo = array()) |
185
|
|
|
{ |
186
|
|
|
// validation for constraint: array |
187
|
|
|
if ('' !== ($paymentInfoArrayErrorMessage = self::validatePaymentInfoForArrayConstraintsFromSetPaymentInfo($paymentInfo))) { |
188
|
|
|
throw new \InvalidArgumentException($paymentInfoArrayErrorMessage, __LINE__); |
189
|
|
|
} |
190
|
|
|
// validation for constraint: maxOccurs(10) |
191
|
|
|
if (is_array($paymentInfo) && count($paymentInfo) > 10) { |
192
|
|
|
throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 10', count($paymentInfo)), __LINE__); |
193
|
|
|
} |
194
|
|
|
$this->PaymentInfo = $paymentInfo; |
195
|
|
|
return $this; |
196
|
|
|
} |
197
|
|
|
/** |
198
|
|
|
* Add item to PaymentInfo value |
199
|
|
|
* @throws \InvalidArgumentException |
200
|
|
|
* @param \PayPal\StructType\PaymentInfoType $item |
201
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
202
|
|
|
*/ |
203
|
|
|
public function addToPaymentInfo(\PayPal\StructType\PaymentInfoType $item) |
204
|
|
|
{ |
205
|
|
|
// validation for constraint: itemType |
206
|
|
|
if (!$item instanceof \PayPal\StructType\PaymentInfoType) { |
|
|
|
|
207
|
|
|
throw new \InvalidArgumentException(sprintf('The PaymentInfo property can only contain items of type \PayPal\StructType\PaymentInfoType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); |
208
|
|
|
} |
209
|
|
|
// validation for constraint: maxOccurs(10) |
210
|
|
|
if (is_array($this->PaymentInfo) && count($this->PaymentInfo) >= 10) { |
211
|
|
|
throw new \InvalidArgumentException(sprintf('You can\'t add anymore element to this property that already contains %s elements, the number of elements contained by the property must be less than or equal to 10', count($this->PaymentInfo)), __LINE__); |
212
|
|
|
} |
213
|
|
|
$this->PaymentInfo[] = $item; |
214
|
|
|
return $this; |
215
|
|
|
} |
216
|
|
|
/** |
217
|
|
|
* Get BillingAgreementID value |
218
|
|
|
* @return string|null |
219
|
|
|
*/ |
220
|
|
|
public function getBillingAgreementID() |
221
|
|
|
{ |
222
|
|
|
return $this->BillingAgreementID; |
223
|
|
|
} |
224
|
|
|
/** |
225
|
|
|
* Set BillingAgreementID value |
226
|
|
|
* @param string $billingAgreementID |
227
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
228
|
|
|
*/ |
229
|
|
|
public function setBillingAgreementID($billingAgreementID = null) |
230
|
|
|
{ |
231
|
|
|
// validation for constraint: string |
232
|
|
|
if (!is_null($billingAgreementID) && !is_string($billingAgreementID)) { |
|
|
|
|
233
|
|
|
throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementID, true), gettype($billingAgreementID)), __LINE__); |
234
|
|
|
} |
235
|
|
|
$this->BillingAgreementID = $billingAgreementID; |
236
|
|
|
return $this; |
237
|
|
|
} |
238
|
|
|
/** |
239
|
|
|
* Get RedirectRequired value |
240
|
|
|
* @return string|null |
241
|
|
|
*/ |
242
|
|
|
public function getRedirectRequired() |
243
|
|
|
{ |
244
|
|
|
return $this->RedirectRequired; |
245
|
|
|
} |
246
|
|
|
/** |
247
|
|
|
* Set RedirectRequired value |
248
|
|
|
* @param string $redirectRequired |
249
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
250
|
|
|
*/ |
251
|
|
|
public function setRedirectRequired($redirectRequired = null) |
252
|
|
|
{ |
253
|
|
|
// validation for constraint: string |
254
|
|
|
if (!is_null($redirectRequired) && !is_string($redirectRequired)) { |
|
|
|
|
255
|
|
|
throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redirectRequired, true), gettype($redirectRequired)), __LINE__); |
256
|
|
|
} |
257
|
|
|
$this->RedirectRequired = $redirectRequired; |
258
|
|
|
return $this; |
259
|
|
|
} |
260
|
|
|
/** |
261
|
|
|
* Get Note value |
262
|
|
|
* @return string|null |
263
|
|
|
*/ |
264
|
|
|
public function getNote() |
265
|
|
|
{ |
266
|
|
|
return $this->Note; |
267
|
|
|
} |
268
|
|
|
/** |
269
|
|
|
* Set Note value |
270
|
|
|
* @param string $note |
271
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
272
|
|
|
*/ |
273
|
|
|
public function setNote($note = null) |
274
|
|
|
{ |
275
|
|
|
// validation for constraint: string |
276
|
|
|
if (!is_null($note) && !is_string($note)) { |
|
|
|
|
277
|
|
|
throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); |
278
|
|
|
} |
279
|
|
|
$this->Note = $note; |
280
|
|
|
return $this; |
281
|
|
|
} |
282
|
|
|
/** |
283
|
|
|
* Get MsgSubID value |
284
|
|
|
* @return string|null |
285
|
|
|
*/ |
286
|
|
|
public function getMsgSubID() |
287
|
|
|
{ |
288
|
|
|
return $this->MsgSubID; |
289
|
|
|
} |
290
|
|
|
/** |
291
|
|
|
* Set MsgSubID value |
292
|
|
|
* @param string $msgSubID |
293
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
294
|
|
|
*/ |
295
|
|
|
public function setMsgSubID($msgSubID = null) |
296
|
|
|
{ |
297
|
|
|
// validation for constraint: string |
298
|
|
|
if (!is_null($msgSubID) && !is_string($msgSubID)) { |
|
|
|
|
299
|
|
|
throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); |
300
|
|
|
} |
301
|
|
|
$this->MsgSubID = $msgSubID; |
302
|
|
|
return $this; |
303
|
|
|
} |
304
|
|
|
/** |
305
|
|
|
* Get SuccessPageRedirectRequested value |
306
|
|
|
* @return string|null |
307
|
|
|
*/ |
308
|
|
|
public function getSuccessPageRedirectRequested() |
309
|
|
|
{ |
310
|
|
|
return $this->SuccessPageRedirectRequested; |
311
|
|
|
} |
312
|
|
|
/** |
313
|
|
|
* Set SuccessPageRedirectRequested value |
314
|
|
|
* @param string $successPageRedirectRequested |
315
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
316
|
|
|
*/ |
317
|
|
|
public function setSuccessPageRedirectRequested($successPageRedirectRequested = null) |
318
|
|
|
{ |
319
|
|
|
// validation for constraint: string |
320
|
|
|
if (!is_null($successPageRedirectRequested) && !is_string($successPageRedirectRequested)) { |
|
|
|
|
321
|
|
|
throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($successPageRedirectRequested, true), gettype($successPageRedirectRequested)), __LINE__); |
322
|
|
|
} |
323
|
|
|
$this->SuccessPageRedirectRequested = $successPageRedirectRequested; |
324
|
|
|
return $this; |
325
|
|
|
} |
326
|
|
|
/** |
327
|
|
|
* Get UserSelectedOptions value |
328
|
|
|
* @return \PayPal\StructType\UserSelectedOptionType|null |
329
|
|
|
*/ |
330
|
|
|
public function getUserSelectedOptions() |
331
|
|
|
{ |
332
|
|
|
return $this->UserSelectedOptions; |
333
|
|
|
} |
334
|
|
|
/** |
335
|
|
|
* Set UserSelectedOptions value |
336
|
|
|
* @param \PayPal\StructType\UserSelectedOptionType $userSelectedOptions |
337
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
338
|
|
|
*/ |
339
|
|
|
public function setUserSelectedOptions(\PayPal\StructType\UserSelectedOptionType $userSelectedOptions = null) |
340
|
|
|
{ |
341
|
|
|
$this->UserSelectedOptions = $userSelectedOptions; |
342
|
|
|
return $this; |
343
|
|
|
} |
344
|
|
|
/** |
345
|
|
|
* Get CoupledPaymentInfo value |
346
|
|
|
* @return \PayPal\StructType\CoupledPaymentInfoType[]|null |
347
|
|
|
*/ |
348
|
|
|
public function getCoupledPaymentInfo() |
349
|
|
|
{ |
350
|
|
|
return $this->CoupledPaymentInfo; |
351
|
|
|
} |
352
|
|
|
/** |
353
|
|
|
* This method is responsible for validating the values passed to the setCoupledPaymentInfo method |
354
|
|
|
* This method is willingly generated in order to preserve the one-line inline validation within the setCoupledPaymentInfo method |
355
|
|
|
* @param array $values |
356
|
|
|
* @return string A non-empty message if the values does not match the validation rules |
357
|
|
|
*/ |
358
|
|
|
public static function validateCoupledPaymentInfoForArrayConstraintsFromSetCoupledPaymentInfo(array $values = array()) |
359
|
|
|
{ |
360
|
|
|
$message = ''; |
361
|
|
|
$invalidValues = []; |
362
|
|
|
foreach ($values as $doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem) { |
363
|
|
|
// validation for constraint: itemType |
364
|
|
|
if (!$doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem instanceof \PayPal\StructType\CoupledPaymentInfoType) { |
365
|
|
|
$invalidValues[] = is_object($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem) ? get_class($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem) : sprintf('%s(%s)', gettype($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem), var_export($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem, true)); |
366
|
|
|
} |
367
|
|
|
} |
368
|
|
|
if (!empty($invalidValues)) { |
369
|
|
|
$message = sprintf('The CoupledPaymentInfo property can only contain items of type \PayPal\StructType\CoupledPaymentInfoType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); |
|
|
|
|
370
|
|
|
} |
371
|
|
|
unset($invalidValues); |
372
|
|
|
return $message; |
373
|
|
|
} |
374
|
|
|
/** |
375
|
|
|
* Set CoupledPaymentInfo value |
376
|
|
|
* @throws \InvalidArgumentException |
377
|
|
|
* @param \PayPal\StructType\CoupledPaymentInfoType[] $coupledPaymentInfo |
378
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
379
|
|
|
*/ |
380
|
|
|
public function setCoupledPaymentInfo(array $coupledPaymentInfo = array()) |
381
|
|
|
{ |
382
|
|
|
// validation for constraint: array |
383
|
|
|
if ('' !== ($coupledPaymentInfoArrayErrorMessage = self::validateCoupledPaymentInfoForArrayConstraintsFromSetCoupledPaymentInfo($coupledPaymentInfo))) { |
384
|
|
|
throw new \InvalidArgumentException($coupledPaymentInfoArrayErrorMessage, __LINE__); |
385
|
|
|
} |
386
|
|
|
// validation for constraint: maxOccurs(5) |
387
|
|
|
if (is_array($coupledPaymentInfo) && count($coupledPaymentInfo) > 5) { |
388
|
|
|
throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 5', count($coupledPaymentInfo)), __LINE__); |
389
|
|
|
} |
390
|
|
|
$this->CoupledPaymentInfo = $coupledPaymentInfo; |
391
|
|
|
return $this; |
392
|
|
|
} |
393
|
|
|
/** |
394
|
|
|
* Add item to CoupledPaymentInfo value |
395
|
|
|
* @throws \InvalidArgumentException |
396
|
|
|
* @param \PayPal\StructType\CoupledPaymentInfoType $item |
397
|
|
|
* @return \PayPal\StructType\DoExpressCheckoutPaymentResponseDetailsType |
398
|
|
|
*/ |
399
|
|
|
public function addToCoupledPaymentInfo(\PayPal\StructType\CoupledPaymentInfoType $item) |
400
|
|
|
{ |
401
|
|
|
// validation for constraint: itemType |
402
|
|
|
if (!$item instanceof \PayPal\StructType\CoupledPaymentInfoType) { |
|
|
|
|
403
|
|
|
throw new \InvalidArgumentException(sprintf('The CoupledPaymentInfo property can only contain items of type \PayPal\StructType\CoupledPaymentInfoType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); |
404
|
|
|
} |
405
|
|
|
// validation for constraint: maxOccurs(5) |
406
|
|
|
if (is_array($this->CoupledPaymentInfo) && count($this->CoupledPaymentInfo) >= 5) { |
407
|
|
|
throw new \InvalidArgumentException(sprintf('You can\'t add anymore element to this property that already contains %s elements, the number of elements contained by the property must be less than or equal to 5', count($this->CoupledPaymentInfo)), __LINE__); |
408
|
|
|
} |
409
|
|
|
$this->CoupledPaymentInfo[] = $item; |
410
|
|
|
return $this; |
411
|
|
|
} |
412
|
|
|
} |
413
|
|
|
|