| Total Complexity | 155 |
| Total Lines | 1101 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Complex classes like GetExpressCheckoutDetailsResponseDetailsType often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use GetExpressCheckoutDetailsResponseDetailsType, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 12 | class GetExpressCheckoutDetailsResponseDetailsType 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 PayerInfo |
||
| 24 | * Meta information extracted from the WSDL |
||
| 25 | * - documentation: Information about the payer |
||
| 26 | * @var \PayPal\StructType\PayerInfoType |
||
| 27 | */ |
||
| 28 | public $PayerInfo; |
||
| 29 | /** |
||
| 30 | * The Custom |
||
| 31 | * Meta information extracted from the WSDL |
||
| 32 | * - documentation: A free-form field for your own use, as set by you in the Custom element of SetExpressCheckoutRequest. Character length and limitations: 256 single-byte alphanumeric characters |
||
| 33 | * - minOccurs: 0 |
||
| 34 | * @var string |
||
| 35 | */ |
||
| 36 | public $Custom; |
||
| 37 | /** |
||
| 38 | * The InvoiceID |
||
| 39 | * Meta information extracted from the WSDL |
||
| 40 | * - documentation: Your own invoice or tracking number, as set by you in the InvoiceID element of SetExpressCheckoutRequest. Character length and limitations: 127 single-byte alphanumeric characters |
||
| 41 | * - minOccurs: 0 |
||
| 42 | * @var string |
||
| 43 | */ |
||
| 44 | public $InvoiceID; |
||
| 45 | /** |
||
| 46 | * The ContactPhone |
||
| 47 | * Meta information extracted from the WSDL |
||
| 48 | * - documentation: Payer's contact telephone number. PayPal returns a contact telephone number only if your Merchant account profile settings require that the buyer enter one. |
||
| 49 | * - minOccurs: 0 |
||
| 50 | * @var string |
||
| 51 | */ |
||
| 52 | public $ContactPhone; |
||
| 53 | /** |
||
| 54 | * The BillingAgreementAcceptedStatus |
||
| 55 | * Meta information extracted from the WSDL |
||
| 56 | * - maxOccurs: 1 |
||
| 57 | * - minOccurs: 0 |
||
| 58 | * @var bool |
||
| 59 | */ |
||
| 60 | public $BillingAgreementAcceptedStatus; |
||
| 61 | /** |
||
| 62 | * The RedirectRequired |
||
| 63 | * Meta information extracted from the WSDL |
||
| 64 | * - maxOccurs: 1 |
||
| 65 | * - minOccurs: 0 |
||
| 66 | * @var string |
||
| 67 | */ |
||
| 68 | public $RedirectRequired; |
||
| 69 | /** |
||
| 70 | * The BillingAddress |
||
| 71 | * Meta information extracted from the WSDL |
||
| 72 | * - documentation: Customer's billing address. Optional If you have credit card mapped in your account then billing address of the credit card is returned otherwise your primary address is returned , PayPal returns this address in |
||
| 73 | * GetExpressCheckoutDetailsResponse. |
||
| 74 | * - minOccurs: 0 |
||
| 75 | * @var \PayPal\StructType\AddressType |
||
| 76 | */ |
||
| 77 | public $BillingAddress; |
||
| 78 | /** |
||
| 79 | * The Note |
||
| 80 | * Meta information extracted from the WSDL |
||
| 81 | * - documentation: Text note entered by the buyer in PayPal flow. |
||
| 82 | * - maxOccurs: 1 |
||
| 83 | * - minOccurs: 0 |
||
| 84 | * @var string |
||
| 85 | */ |
||
| 86 | public $Note; |
||
| 87 | /** |
||
| 88 | * The CheckoutStatus |
||
| 89 | * Meta information extracted from the WSDL |
||
| 90 | * - documentation: Returns the status of the EC checkout session. Values include 'PaymentActionNotInitiated', 'PaymentActionFailed', 'PaymentActionInProgress', 'PaymentCompleted'. |
||
| 91 | * - maxOccurs: 1 |
||
| 92 | * - minOccurs: 0 |
||
| 93 | * @var string |
||
| 94 | */ |
||
| 95 | public $CheckoutStatus; |
||
| 96 | /** |
||
| 97 | * The PayPalAdjustment |
||
| 98 | * Meta information extracted from the WSDL |
||
| 99 | * - documentation: PayPal may offer a discount or gift certificate to the buyer, which will be represented by a negativeamount. If the buyer has a negative balance, PayPal will add that amount to the current charges, which will be represented as a |
||
| 100 | * positive amount. |
||
| 101 | * - maxOccurs: 1 |
||
| 102 | * - minOccurs: 0 |
||
| 103 | * @var \PayPal\StructType\BasicAmountType |
||
| 104 | */ |
||
| 105 | public $PayPalAdjustment; |
||
| 106 | /** |
||
| 107 | * The PaymentDetails |
||
| 108 | * Meta information extracted from the WSDL |
||
| 109 | * - documentation: Information about the individual purchased items. |
||
| 110 | * - maxOccurs: 10 |
||
| 111 | * - minOccurs: 0 |
||
| 112 | * @var \PayPal\StructType\PaymentDetailsType[] |
||
| 113 | */ |
||
| 114 | public $PaymentDetails; |
||
| 115 | /** |
||
| 116 | * The UserSelectedOptions |
||
| 117 | * Meta information extracted from the WSDL |
||
| 118 | * - documentation: Information about the user selected options. |
||
| 119 | * - maxOccurs: 1 |
||
| 120 | * - minOccurs: 0 |
||
| 121 | * @var \PayPal\StructType\UserSelectedOptionType |
||
| 122 | */ |
||
| 123 | public $UserSelectedOptions; |
||
| 124 | /** |
||
| 125 | * The IncentiveDetails |
||
| 126 | * Meta information extracted from the WSDL |
||
| 127 | * - documentation: Information about the incentives that were applied from Ebay RYP page and PayPal RYP page. |
||
| 128 | * - maxOccurs: unbounded |
||
| 129 | * - minOccurs: 0 |
||
| 130 | * @var \PayPal\StructType\IncentiveDetailsType[] |
||
| 131 | */ |
||
| 132 | public $IncentiveDetails; |
||
| 133 | /** |
||
| 134 | * The GiftMessage |
||
| 135 | * Meta information extracted from the WSDL |
||
| 136 | * - documentation: Information about the Gift message. |
||
| 137 | * - maxOccurs: 1 |
||
| 138 | * - minOccurs: 0 |
||
| 139 | * @var string |
||
| 140 | */ |
||
| 141 | public $GiftMessage; |
||
| 142 | /** |
||
| 143 | * The GiftReceiptEnable |
||
| 144 | * Meta information extracted from the WSDL |
||
| 145 | * - documentation: Information about the Gift receipt enable. |
||
| 146 | * - maxOccurs: 1 |
||
| 147 | * - minOccurs: 0 |
||
| 148 | * @var string |
||
| 149 | */ |
||
| 150 | public $GiftReceiptEnable; |
||
| 151 | /** |
||
| 152 | * The GiftWrapName |
||
| 153 | * Meta information extracted from the WSDL |
||
| 154 | * - documentation: Information about the Gift Wrap name. |
||
| 155 | * - maxOccurs: 1 |
||
| 156 | * - minOccurs: 0 |
||
| 157 | * @var string |
||
| 158 | */ |
||
| 159 | public $GiftWrapName; |
||
| 160 | /** |
||
| 161 | * The GiftWrapAmount |
||
| 162 | * Meta information extracted from the WSDL |
||
| 163 | * - documentation: Information about the Gift Wrap amount. |
||
| 164 | * - maxOccurs: 1 |
||
| 165 | * - minOccurs: 0 |
||
| 166 | * @var \PayPal\StructType\BasicAmountType |
||
| 167 | */ |
||
| 168 | public $GiftWrapAmount; |
||
| 169 | /** |
||
| 170 | * The BuyerMarketingEmail |
||
| 171 | * Meta information extracted from the WSDL |
||
| 172 | * - documentation: Information about the Buyer marketing email. |
||
| 173 | * - maxOccurs: 1 |
||
| 174 | * - minOccurs: 0 |
||
| 175 | * @var string |
||
| 176 | */ |
||
| 177 | public $BuyerMarketingEmail; |
||
| 178 | /** |
||
| 179 | * The SurveyQuestion |
||
| 180 | * Meta information extracted from the WSDL |
||
| 181 | * - documentation: Information about the survey question. |
||
| 182 | * - maxOccurs: 1 |
||
| 183 | * - minOccurs: 0 |
||
| 184 | * @var string |
||
| 185 | */ |
||
| 186 | public $SurveyQuestion; |
||
| 187 | /** |
||
| 188 | * The SurveyChoiceSelected |
||
| 189 | * Meta information extracted from the WSDL |
||
| 190 | * - documentation: Information about the survey choice selected by the user. |
||
| 191 | * - maxOccurs: unbounded |
||
| 192 | * - minOccurs: 0 |
||
| 193 | * @var string[] |
||
| 194 | */ |
||
| 195 | public $SurveyChoiceSelected; |
||
| 196 | /** |
||
| 197 | * The PaymentRequestInfo |
||
| 198 | * Meta information extracted from the WSDL |
||
| 199 | * - documentation: Contains payment request information about each bucket in the cart. |
||
| 200 | * - maxOccurs: 10 |
||
| 201 | * - minOccurs: 0 |
||
| 202 | * @var \PayPal\StructType\PaymentRequestInfoType[] |
||
| 203 | */ |
||
| 204 | public $PaymentRequestInfo; |
||
| 205 | /** |
||
| 206 | * The ExternalRememberMeStatusDetails |
||
| 207 | * Meta information extracted from the WSDL |
||
| 208 | * - documentation: Response information resulting from opt-in operation or current login bypass status. |
||
| 209 | * - maxOccurs: 1 |
||
| 210 | * - minOccurs: 0 |
||
| 211 | * @var \PayPal\StructType\ExternalRememberMeStatusDetailsType |
||
| 212 | */ |
||
| 213 | public $ExternalRememberMeStatusDetails; |
||
| 214 | /** |
||
| 215 | * The RefreshTokenStatusDetails |
||
| 216 | * Meta information extracted from the WSDL |
||
| 217 | * - documentation: Response information resulting from opt-in operation or current login bypass status. |
||
| 218 | * - maxOccurs: 1 |
||
| 219 | * - minOccurs: 0 |
||
| 220 | * @var \PayPal\StructType\RefreshTokenStatusDetailsType |
||
| 221 | */ |
||
| 222 | public $RefreshTokenStatusDetails; |
||
| 223 | /** |
||
| 224 | * The PaymentInfo |
||
| 225 | * Meta information extracted from the WSDL |
||
| 226 | * - documentation: Information about the transaction |
||
| 227 | * - maxOccurs: 10 |
||
| 228 | * - minOccurs: 0 |
||
| 229 | * @var \PayPal\StructType\PaymentInfoType[] |
||
| 230 | */ |
||
| 231 | public $PaymentInfo; |
||
| 232 | /** |
||
| 233 | * The CartChangeTolerance |
||
| 234 | * Meta information extracted from the WSDL |
||
| 235 | * - documentation: Indicate the tolerance a cart can be changed. Possible values are NONE = cart cannot be changed (since financing was used and country is DE). FLEXIBLE = cart can be changed If this parameter does not exist, then assume cart can be |
||
| 236 | * modified. |
||
| 237 | * - maxOccurs: 1 |
||
| 238 | * - minOccurs: 0 |
||
| 239 | * @var string |
||
| 240 | */ |
||
| 241 | public $CartChangeTolerance; |
||
| 242 | /** |
||
| 243 | * The InstrumentDetails |
||
| 244 | * Meta information extracted from the WSDL |
||
| 245 | * - documentation: Type of the payment instrument. |
||
| 246 | * - minOccurs: 0 |
||
| 247 | * @var \PayPal\StructType\InstrumentDetailsType |
||
| 248 | */ |
||
| 249 | public $InstrumentDetails; |
||
| 250 | /** |
||
| 251 | * Constructor method for GetExpressCheckoutDetailsResponseDetailsType |
||
| 252 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setToken() |
||
| 253 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setPayerInfo() |
||
| 254 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setCustom() |
||
| 255 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setInvoiceID() |
||
| 256 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setContactPhone() |
||
| 257 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setBillingAgreementAcceptedStatus() |
||
| 258 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setRedirectRequired() |
||
| 259 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setBillingAddress() |
||
| 260 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setNote() |
||
| 261 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setCheckoutStatus() |
||
| 262 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setPayPalAdjustment() |
||
| 263 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setPaymentDetails() |
||
| 264 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setUserSelectedOptions() |
||
| 265 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setIncentiveDetails() |
||
| 266 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setGiftMessage() |
||
| 267 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setGiftReceiptEnable() |
||
| 268 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setGiftWrapName() |
||
| 269 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setGiftWrapAmount() |
||
| 270 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setBuyerMarketingEmail() |
||
| 271 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setSurveyQuestion() |
||
| 272 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setSurveyChoiceSelected() |
||
| 273 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setPaymentRequestInfo() |
||
| 274 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setExternalRememberMeStatusDetails() |
||
| 275 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setRefreshTokenStatusDetails() |
||
| 276 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setPaymentInfo() |
||
| 277 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setCartChangeTolerance() |
||
| 278 | * @uses GetExpressCheckoutDetailsResponseDetailsType::setInstrumentDetails() |
||
| 279 | * @param string $token |
||
| 280 | * @param \PayPal\StructType\PayerInfoType $payerInfo |
||
| 281 | * @param string $custom |
||
| 282 | * @param string $invoiceID |
||
| 283 | * @param string $contactPhone |
||
| 284 | * @param bool $billingAgreementAcceptedStatus |
||
| 285 | * @param string $redirectRequired |
||
| 286 | * @param \PayPal\StructType\AddressType $billingAddress |
||
| 287 | * @param string $note |
||
| 288 | * @param string $checkoutStatus |
||
| 289 | * @param \PayPal\StructType\BasicAmountType $payPalAdjustment |
||
| 290 | * @param \PayPal\StructType\PaymentDetailsType[] $paymentDetails |
||
| 291 | * @param \PayPal\StructType\UserSelectedOptionType $userSelectedOptions |
||
| 292 | * @param \PayPal\StructType\IncentiveDetailsType[] $incentiveDetails |
||
| 293 | * @param string $giftMessage |
||
| 294 | * @param string $giftReceiptEnable |
||
| 295 | * @param string $giftWrapName |
||
| 296 | * @param \PayPal\StructType\BasicAmountType $giftWrapAmount |
||
| 297 | * @param string $buyerMarketingEmail |
||
| 298 | * @param string $surveyQuestion |
||
| 299 | * @param string[] $surveyChoiceSelected |
||
| 300 | * @param \PayPal\StructType\PaymentRequestInfoType[] $paymentRequestInfo |
||
| 301 | * @param \PayPal\StructType\ExternalRememberMeStatusDetailsType $externalRememberMeStatusDetails |
||
| 302 | * @param \PayPal\StructType\RefreshTokenStatusDetailsType $refreshTokenStatusDetails |
||
| 303 | * @param \PayPal\StructType\PaymentInfoType[] $paymentInfo |
||
| 304 | * @param string $cartChangeTolerance |
||
| 305 | * @param \PayPal\StructType\InstrumentDetailsType $instrumentDetails |
||
| 306 | */ |
||
| 307 | public function __construct($token = null, \PayPal\StructType\PayerInfoType $payerInfo = null, $custom = null, $invoiceID = null, $contactPhone = null, $billingAgreementAcceptedStatus = null, $redirectRequired = null, \PayPal\StructType\AddressType $billingAddress = null, $note = null, $checkoutStatus = null, \PayPal\StructType\BasicAmountType $payPalAdjustment = null, array $paymentDetails = array(), \PayPal\StructType\UserSelectedOptionType $userSelectedOptions = null, array $incentiveDetails = array(), $giftMessage = null, $giftReceiptEnable = null, $giftWrapName = null, \PayPal\StructType\BasicAmountType $giftWrapAmount = null, $buyerMarketingEmail = null, $surveyQuestion = null, array $surveyChoiceSelected = array(), array $paymentRequestInfo = array(), \PayPal\StructType\ExternalRememberMeStatusDetailsType $externalRememberMeStatusDetails = null, \PayPal\StructType\RefreshTokenStatusDetailsType $refreshTokenStatusDetails = null, array $paymentInfo = array(), $cartChangeTolerance = null, \PayPal\StructType\InstrumentDetailsType $instrumentDetails = null) |
||
| 308 | { |
||
| 309 | $this |
||
| 310 | ->setToken($token) |
||
| 311 | ->setPayerInfo($payerInfo) |
||
| 312 | ->setCustom($custom) |
||
| 313 | ->setInvoiceID($invoiceID) |
||
| 314 | ->setContactPhone($contactPhone) |
||
| 315 | ->setBillingAgreementAcceptedStatus($billingAgreementAcceptedStatus) |
||
| 316 | ->setRedirectRequired($redirectRequired) |
||
| 317 | ->setBillingAddress($billingAddress) |
||
| 318 | ->setNote($note) |
||
| 319 | ->setCheckoutStatus($checkoutStatus) |
||
| 320 | ->setPayPalAdjustment($payPalAdjustment) |
||
| 321 | ->setPaymentDetails($paymentDetails) |
||
| 322 | ->setUserSelectedOptions($userSelectedOptions) |
||
| 323 | ->setIncentiveDetails($incentiveDetails) |
||
| 324 | ->setGiftMessage($giftMessage) |
||
| 325 | ->setGiftReceiptEnable($giftReceiptEnable) |
||
| 326 | ->setGiftWrapName($giftWrapName) |
||
| 327 | ->setGiftWrapAmount($giftWrapAmount) |
||
| 328 | ->setBuyerMarketingEmail($buyerMarketingEmail) |
||
| 329 | ->setSurveyQuestion($surveyQuestion) |
||
| 330 | ->setSurveyChoiceSelected($surveyChoiceSelected) |
||
| 331 | ->setPaymentRequestInfo($paymentRequestInfo) |
||
| 332 | ->setExternalRememberMeStatusDetails($externalRememberMeStatusDetails) |
||
| 333 | ->setRefreshTokenStatusDetails($refreshTokenStatusDetails) |
||
| 334 | ->setPaymentInfo($paymentInfo) |
||
| 335 | ->setCartChangeTolerance($cartChangeTolerance) |
||
| 336 | ->setInstrumentDetails($instrumentDetails); |
||
| 337 | } |
||
| 338 | /** |
||
| 339 | * Get Token value |
||
| 340 | * @return string|null |
||
| 341 | */ |
||
| 342 | public function getToken() |
||
| 343 | { |
||
| 344 | return $this->Token; |
||
| 345 | } |
||
| 346 | /** |
||
| 347 | * Set Token value |
||
| 348 | * @param string $token |
||
| 349 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 350 | */ |
||
| 351 | public function setToken($token = null) |
||
| 352 | { |
||
| 353 | // validation for constraint: string |
||
| 354 | if (!is_null($token) && !is_string($token)) { |
||
|
|
|||
| 355 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); |
||
| 356 | } |
||
| 357 | $this->Token = $token; |
||
| 358 | return $this; |
||
| 359 | } |
||
| 360 | /** |
||
| 361 | * Get PayerInfo value |
||
| 362 | * @return \PayPal\StructType\PayerInfoType|null |
||
| 363 | */ |
||
| 364 | public function getPayerInfo() |
||
| 365 | { |
||
| 366 | return $this->PayerInfo; |
||
| 367 | } |
||
| 368 | /** |
||
| 369 | * Set PayerInfo value |
||
| 370 | * @param \PayPal\StructType\PayerInfoType $payerInfo |
||
| 371 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 372 | */ |
||
| 373 | public function setPayerInfo(\PayPal\StructType\PayerInfoType $payerInfo = null) |
||
| 374 | { |
||
| 375 | $this->PayerInfo = $payerInfo; |
||
| 376 | return $this; |
||
| 377 | } |
||
| 378 | /** |
||
| 379 | * Get Custom value |
||
| 380 | * @return string|null |
||
| 381 | */ |
||
| 382 | public function getCustom() |
||
| 383 | { |
||
| 384 | return $this->Custom; |
||
| 385 | } |
||
| 386 | /** |
||
| 387 | * Set Custom value |
||
| 388 | * @param string $custom |
||
| 389 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 390 | */ |
||
| 391 | public function setCustom($custom = null) |
||
| 392 | { |
||
| 393 | // validation for constraint: string |
||
| 394 | if (!is_null($custom) && !is_string($custom)) { |
||
| 395 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); |
||
| 396 | } |
||
| 397 | $this->Custom = $custom; |
||
| 398 | return $this; |
||
| 399 | } |
||
| 400 | /** |
||
| 401 | * Get InvoiceID value |
||
| 402 | * @return string|null |
||
| 403 | */ |
||
| 404 | public function getInvoiceID() |
||
| 405 | { |
||
| 406 | return $this->InvoiceID; |
||
| 407 | } |
||
| 408 | /** |
||
| 409 | * Set InvoiceID value |
||
| 410 | * @param string $invoiceID |
||
| 411 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 412 | */ |
||
| 413 | public function setInvoiceID($invoiceID = null) |
||
| 414 | { |
||
| 415 | // validation for constraint: string |
||
| 416 | if (!is_null($invoiceID) && !is_string($invoiceID)) { |
||
| 417 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); |
||
| 418 | } |
||
| 419 | $this->InvoiceID = $invoiceID; |
||
| 420 | return $this; |
||
| 421 | } |
||
| 422 | /** |
||
| 423 | * Get ContactPhone value |
||
| 424 | * @return string|null |
||
| 425 | */ |
||
| 426 | public function getContactPhone() |
||
| 427 | { |
||
| 428 | return $this->ContactPhone; |
||
| 429 | } |
||
| 430 | /** |
||
| 431 | * Set ContactPhone value |
||
| 432 | * @param string $contactPhone |
||
| 433 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 434 | */ |
||
| 435 | public function setContactPhone($contactPhone = null) |
||
| 436 | { |
||
| 437 | // validation for constraint: string |
||
| 438 | if (!is_null($contactPhone) && !is_string($contactPhone)) { |
||
| 439 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($contactPhone, true), gettype($contactPhone)), __LINE__); |
||
| 440 | } |
||
| 441 | $this->ContactPhone = $contactPhone; |
||
| 442 | return $this; |
||
| 443 | } |
||
| 444 | /** |
||
| 445 | * Get BillingAgreementAcceptedStatus value |
||
| 446 | * @return bool|null |
||
| 447 | */ |
||
| 448 | public function getBillingAgreementAcceptedStatus() |
||
| 449 | { |
||
| 450 | return $this->BillingAgreementAcceptedStatus; |
||
| 451 | } |
||
| 452 | /** |
||
| 453 | * Set BillingAgreementAcceptedStatus value |
||
| 454 | * @param bool $billingAgreementAcceptedStatus |
||
| 455 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 456 | */ |
||
| 457 | public function setBillingAgreementAcceptedStatus($billingAgreementAcceptedStatus = null) |
||
| 458 | { |
||
| 459 | // validation for constraint: boolean |
||
| 460 | if (!is_null($billingAgreementAcceptedStatus) && !is_bool($billingAgreementAcceptedStatus)) { |
||
| 461 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($billingAgreementAcceptedStatus, true), gettype($billingAgreementAcceptedStatus)), __LINE__); |
||
| 462 | } |
||
| 463 | $this->BillingAgreementAcceptedStatus = $billingAgreementAcceptedStatus; |
||
| 464 | return $this; |
||
| 465 | } |
||
| 466 | /** |
||
| 467 | * Get RedirectRequired value |
||
| 468 | * @return string|null |
||
| 469 | */ |
||
| 470 | public function getRedirectRequired() |
||
| 471 | { |
||
| 472 | return $this->RedirectRequired; |
||
| 473 | } |
||
| 474 | /** |
||
| 475 | * Set RedirectRequired value |
||
| 476 | * @param string $redirectRequired |
||
| 477 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 478 | */ |
||
| 479 | public function setRedirectRequired($redirectRequired = null) |
||
| 480 | { |
||
| 481 | // validation for constraint: string |
||
| 482 | if (!is_null($redirectRequired) && !is_string($redirectRequired)) { |
||
| 483 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redirectRequired, true), gettype($redirectRequired)), __LINE__); |
||
| 484 | } |
||
| 485 | $this->RedirectRequired = $redirectRequired; |
||
| 486 | return $this; |
||
| 487 | } |
||
| 488 | /** |
||
| 489 | * Get BillingAddress value |
||
| 490 | * @return \PayPal\StructType\AddressType|null |
||
| 491 | */ |
||
| 492 | public function getBillingAddress() |
||
| 493 | { |
||
| 494 | return $this->BillingAddress; |
||
| 495 | } |
||
| 496 | /** |
||
| 497 | * Set BillingAddress value |
||
| 498 | * @param \PayPal\StructType\AddressType $billingAddress |
||
| 499 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 500 | */ |
||
| 501 | public function setBillingAddress(\PayPal\StructType\AddressType $billingAddress = null) |
||
| 502 | { |
||
| 503 | $this->BillingAddress = $billingAddress; |
||
| 504 | return $this; |
||
| 505 | } |
||
| 506 | /** |
||
| 507 | * Get Note value |
||
| 508 | * @return string|null |
||
| 509 | */ |
||
| 510 | public function getNote() |
||
| 511 | { |
||
| 512 | return $this->Note; |
||
| 513 | } |
||
| 514 | /** |
||
| 515 | * Set Note value |
||
| 516 | * @param string $note |
||
| 517 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 518 | */ |
||
| 519 | public function setNote($note = null) |
||
| 520 | { |
||
| 521 | // validation for constraint: string |
||
| 522 | if (!is_null($note) && !is_string($note)) { |
||
| 523 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); |
||
| 524 | } |
||
| 525 | $this->Note = $note; |
||
| 526 | return $this; |
||
| 527 | } |
||
| 528 | /** |
||
| 529 | * Get CheckoutStatus value |
||
| 530 | * @return string|null |
||
| 531 | */ |
||
| 532 | public function getCheckoutStatus() |
||
| 533 | { |
||
| 534 | return $this->CheckoutStatus; |
||
| 535 | } |
||
| 536 | /** |
||
| 537 | * Set CheckoutStatus value |
||
| 538 | * @param string $checkoutStatus |
||
| 539 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 540 | */ |
||
| 541 | public function setCheckoutStatus($checkoutStatus = null) |
||
| 542 | { |
||
| 543 | // validation for constraint: string |
||
| 544 | if (!is_null($checkoutStatus) && !is_string($checkoutStatus)) { |
||
| 545 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($checkoutStatus, true), gettype($checkoutStatus)), __LINE__); |
||
| 546 | } |
||
| 547 | $this->CheckoutStatus = $checkoutStatus; |
||
| 548 | return $this; |
||
| 549 | } |
||
| 550 | /** |
||
| 551 | * Get PayPalAdjustment value |
||
| 552 | * @return \PayPal\StructType\BasicAmountType|null |
||
| 553 | */ |
||
| 554 | public function getPayPalAdjustment() |
||
| 555 | { |
||
| 556 | return $this->PayPalAdjustment; |
||
| 557 | } |
||
| 558 | /** |
||
| 559 | * Set PayPalAdjustment value |
||
| 560 | * @param \PayPal\StructType\BasicAmountType $payPalAdjustment |
||
| 561 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 562 | */ |
||
| 563 | public function setPayPalAdjustment(\PayPal\StructType\BasicAmountType $payPalAdjustment = null) |
||
| 564 | { |
||
| 565 | $this->PayPalAdjustment = $payPalAdjustment; |
||
| 566 | return $this; |
||
| 567 | } |
||
| 568 | /** |
||
| 569 | * Get PaymentDetails value |
||
| 570 | * @return \PayPal\StructType\PaymentDetailsType[]|null |
||
| 571 | */ |
||
| 572 | public function getPaymentDetails() |
||
| 573 | { |
||
| 574 | return $this->PaymentDetails; |
||
| 575 | } |
||
| 576 | /** |
||
| 577 | * This method is responsible for validating the values passed to the setPaymentDetails method |
||
| 578 | * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentDetails method |
||
| 579 | * @param array $values |
||
| 580 | * @return string A non-empty message if the values does not match the validation rules |
||
| 581 | */ |
||
| 582 | public static function validatePaymentDetailsForArrayConstraintsFromSetPaymentDetails(array $values = array()) |
||
| 583 | { |
||
| 584 | $message = ''; |
||
| 585 | $invalidValues = []; |
||
| 586 | foreach ($values as $getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem) { |
||
| 587 | // validation for constraint: itemType |
||
| 588 | if (!$getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem instanceof \PayPal\StructType\PaymentDetailsType) { |
||
| 589 | $invalidValues[] = is_object($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem) : sprintf('%s(%s)', gettype($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem), var_export($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem, true)); |
||
| 590 | } |
||
| 591 | } |
||
| 592 | if (!empty($invalidValues)) { |
||
| 593 | $message = sprintf('The PaymentDetails property can only contain items of type \PayPal\StructType\PaymentDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); |
||
| 594 | } |
||
| 595 | unset($invalidValues); |
||
| 596 | return $message; |
||
| 597 | } |
||
| 598 | /** |
||
| 599 | * Set PaymentDetails value |
||
| 600 | * @throws \InvalidArgumentException |
||
| 601 | * @param \PayPal\StructType\PaymentDetailsType[] $paymentDetails |
||
| 602 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 603 | */ |
||
| 604 | public function setPaymentDetails(array $paymentDetails = array()) |
||
| 605 | { |
||
| 606 | // validation for constraint: array |
||
| 607 | if ('' !== ($paymentDetailsArrayErrorMessage = self::validatePaymentDetailsForArrayConstraintsFromSetPaymentDetails($paymentDetails))) { |
||
| 608 | throw new \InvalidArgumentException($paymentDetailsArrayErrorMessage, __LINE__); |
||
| 609 | } |
||
| 610 | // validation for constraint: maxOccurs(10) |
||
| 611 | if (is_array($paymentDetails) && count($paymentDetails) > 10) { |
||
| 612 | 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($paymentDetails)), __LINE__); |
||
| 613 | } |
||
| 614 | $this->PaymentDetails = $paymentDetails; |
||
| 615 | return $this; |
||
| 616 | } |
||
| 617 | /** |
||
| 618 | * Add item to PaymentDetails value |
||
| 619 | * @throws \InvalidArgumentException |
||
| 620 | * @param \PayPal\StructType\PaymentDetailsType $item |
||
| 621 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 622 | */ |
||
| 623 | public function addToPaymentDetails(\PayPal\StructType\PaymentDetailsType $item) |
||
| 624 | { |
||
| 625 | // validation for constraint: itemType |
||
| 626 | if (!$item instanceof \PayPal\StructType\PaymentDetailsType) { |
||
| 627 | throw new \InvalidArgumentException(sprintf('The PaymentDetails property can only contain items of type \PayPal\StructType\PaymentDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); |
||
| 628 | } |
||
| 629 | // validation for constraint: maxOccurs(10) |
||
| 630 | if (is_array($this->PaymentDetails) && count($this->PaymentDetails) >= 10) { |
||
| 631 | 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->PaymentDetails)), __LINE__); |
||
| 632 | } |
||
| 633 | $this->PaymentDetails[] = $item; |
||
| 634 | return $this; |
||
| 635 | } |
||
| 636 | /** |
||
| 637 | * Get UserSelectedOptions value |
||
| 638 | * @return \PayPal\StructType\UserSelectedOptionType|null |
||
| 639 | */ |
||
| 640 | public function getUserSelectedOptions() |
||
| 641 | { |
||
| 642 | return $this->UserSelectedOptions; |
||
| 643 | } |
||
| 644 | /** |
||
| 645 | * Set UserSelectedOptions value |
||
| 646 | * @param \PayPal\StructType\UserSelectedOptionType $userSelectedOptions |
||
| 647 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 648 | */ |
||
| 649 | public function setUserSelectedOptions(\PayPal\StructType\UserSelectedOptionType $userSelectedOptions = null) |
||
| 650 | { |
||
| 651 | $this->UserSelectedOptions = $userSelectedOptions; |
||
| 652 | return $this; |
||
| 653 | } |
||
| 654 | /** |
||
| 655 | * Get IncentiveDetails value |
||
| 656 | * @return \PayPal\StructType\IncentiveDetailsType[]|null |
||
| 657 | */ |
||
| 658 | public function getIncentiveDetails() |
||
| 659 | { |
||
| 660 | return $this->IncentiveDetails; |
||
| 661 | } |
||
| 662 | /** |
||
| 663 | * This method is responsible for validating the values passed to the setIncentiveDetails method |
||
| 664 | * This method is willingly generated in order to preserve the one-line inline validation within the setIncentiveDetails method |
||
| 665 | * @param array $values |
||
| 666 | * @return string A non-empty message if the values does not match the validation rules |
||
| 667 | */ |
||
| 668 | public static function validateIncentiveDetailsForArrayConstraintsFromSetIncentiveDetails(array $values = array()) |
||
| 669 | { |
||
| 670 | $message = ''; |
||
| 671 | $invalidValues = []; |
||
| 672 | foreach ($values as $getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem) { |
||
| 673 | // validation for constraint: itemType |
||
| 674 | if (!$getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem instanceof \PayPal\StructType\IncentiveDetailsType) { |
||
| 675 | $invalidValues[] = is_object($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem) : sprintf('%s(%s)', gettype($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem), var_export($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem, true)); |
||
| 676 | } |
||
| 677 | } |
||
| 678 | if (!empty($invalidValues)) { |
||
| 679 | $message = sprintf('The IncentiveDetails property can only contain items of type \PayPal\StructType\IncentiveDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); |
||
| 680 | } |
||
| 681 | unset($invalidValues); |
||
| 682 | return $message; |
||
| 683 | } |
||
| 684 | /** |
||
| 685 | * Set IncentiveDetails value |
||
| 686 | * @throws \InvalidArgumentException |
||
| 687 | * @param \PayPal\StructType\IncentiveDetailsType[] $incentiveDetails |
||
| 688 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 689 | */ |
||
| 690 | public function setIncentiveDetails(array $incentiveDetails = array()) |
||
| 691 | { |
||
| 692 | // validation for constraint: array |
||
| 693 | if ('' !== ($incentiveDetailsArrayErrorMessage = self::validateIncentiveDetailsForArrayConstraintsFromSetIncentiveDetails($incentiveDetails))) { |
||
| 694 | throw new \InvalidArgumentException($incentiveDetailsArrayErrorMessage, __LINE__); |
||
| 695 | } |
||
| 696 | $this->IncentiveDetails = $incentiveDetails; |
||
| 697 | return $this; |
||
| 698 | } |
||
| 699 | /** |
||
| 700 | * Add item to IncentiveDetails value |
||
| 701 | * @throws \InvalidArgumentException |
||
| 702 | * @param \PayPal\StructType\IncentiveDetailsType $item |
||
| 703 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 704 | */ |
||
| 705 | public function addToIncentiveDetails(\PayPal\StructType\IncentiveDetailsType $item) |
||
| 706 | { |
||
| 707 | // validation for constraint: itemType |
||
| 708 | if (!$item instanceof \PayPal\StructType\IncentiveDetailsType) { |
||
| 709 | throw new \InvalidArgumentException(sprintf('The IncentiveDetails property can only contain items of type \PayPal\StructType\IncentiveDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); |
||
| 710 | } |
||
| 711 | $this->IncentiveDetails[] = $item; |
||
| 712 | return $this; |
||
| 713 | } |
||
| 714 | /** |
||
| 715 | * Get GiftMessage value |
||
| 716 | * @return string|null |
||
| 717 | */ |
||
| 718 | public function getGiftMessage() |
||
| 719 | { |
||
| 720 | return $this->GiftMessage; |
||
| 721 | } |
||
| 722 | /** |
||
| 723 | * Set GiftMessage value |
||
| 724 | * @param string $giftMessage |
||
| 725 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 726 | */ |
||
| 727 | public function setGiftMessage($giftMessage = null) |
||
| 728 | { |
||
| 729 | // validation for constraint: string |
||
| 730 | if (!is_null($giftMessage) && !is_string($giftMessage)) { |
||
| 731 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftMessage, true), gettype($giftMessage)), __LINE__); |
||
| 732 | } |
||
| 733 | $this->GiftMessage = $giftMessage; |
||
| 734 | return $this; |
||
| 735 | } |
||
| 736 | /** |
||
| 737 | * Get GiftReceiptEnable value |
||
| 738 | * @return string|null |
||
| 739 | */ |
||
| 740 | public function getGiftReceiptEnable() |
||
| 741 | { |
||
| 742 | return $this->GiftReceiptEnable; |
||
| 743 | } |
||
| 744 | /** |
||
| 745 | * Set GiftReceiptEnable value |
||
| 746 | * @param string $giftReceiptEnable |
||
| 747 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 748 | */ |
||
| 749 | public function setGiftReceiptEnable($giftReceiptEnable = null) |
||
| 757 | } |
||
| 758 | /** |
||
| 759 | * Get GiftWrapName value |
||
| 760 | * @return string|null |
||
| 761 | */ |
||
| 762 | public function getGiftWrapName() |
||
| 765 | } |
||
| 766 | /** |
||
| 767 | * Set GiftWrapName value |
||
| 768 | * @param string $giftWrapName |
||
| 769 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 770 | */ |
||
| 771 | public function setGiftWrapName($giftWrapName = null) |
||
| 772 | { |
||
| 773 | // validation for constraint: string |
||
| 774 | if (!is_null($giftWrapName) && !is_string($giftWrapName)) { |
||
| 775 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftWrapName, true), gettype($giftWrapName)), __LINE__); |
||
| 776 | } |
||
| 777 | $this->GiftWrapName = $giftWrapName; |
||
| 778 | return $this; |
||
| 779 | } |
||
| 780 | /** |
||
| 781 | * Get GiftWrapAmount value |
||
| 782 | * @return \PayPal\StructType\BasicAmountType|null |
||
| 783 | */ |
||
| 784 | public function getGiftWrapAmount() |
||
| 785 | { |
||
| 786 | return $this->GiftWrapAmount; |
||
| 787 | } |
||
| 788 | /** |
||
| 789 | * Set GiftWrapAmount value |
||
| 790 | * @param \PayPal\StructType\BasicAmountType $giftWrapAmount |
||
| 791 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 792 | */ |
||
| 793 | public function setGiftWrapAmount(\PayPal\StructType\BasicAmountType $giftWrapAmount = null) |
||
| 794 | { |
||
| 795 | $this->GiftWrapAmount = $giftWrapAmount; |
||
| 796 | return $this; |
||
| 797 | } |
||
| 798 | /** |
||
| 799 | * Get BuyerMarketingEmail value |
||
| 800 | * @return string|null |
||
| 801 | */ |
||
| 802 | public function getBuyerMarketingEmail() |
||
| 803 | { |
||
| 804 | return $this->BuyerMarketingEmail; |
||
| 805 | } |
||
| 806 | /** |
||
| 807 | * Set BuyerMarketingEmail value |
||
| 808 | * @param string $buyerMarketingEmail |
||
| 809 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 810 | */ |
||
| 811 | public function setBuyerMarketingEmail($buyerMarketingEmail = null) |
||
| 812 | { |
||
| 813 | // validation for constraint: string |
||
| 814 | if (!is_null($buyerMarketingEmail) && !is_string($buyerMarketingEmail)) { |
||
| 815 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerMarketingEmail, true), gettype($buyerMarketingEmail)), __LINE__); |
||
| 816 | } |
||
| 817 | $this->BuyerMarketingEmail = $buyerMarketingEmail; |
||
| 818 | return $this; |
||
| 819 | } |
||
| 820 | /** |
||
| 821 | * Get SurveyQuestion value |
||
| 822 | * @return string|null |
||
| 823 | */ |
||
| 824 | public function getSurveyQuestion() |
||
| 825 | { |
||
| 826 | return $this->SurveyQuestion; |
||
| 827 | } |
||
| 828 | /** |
||
| 829 | * Set SurveyQuestion value |
||
| 830 | * @param string $surveyQuestion |
||
| 831 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 832 | */ |
||
| 833 | public function setSurveyQuestion($surveyQuestion = null) |
||
| 834 | { |
||
| 835 | // validation for constraint: string |
||
| 836 | if (!is_null($surveyQuestion) && !is_string($surveyQuestion)) { |
||
| 837 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($surveyQuestion, true), gettype($surveyQuestion)), __LINE__); |
||
| 838 | } |
||
| 839 | $this->SurveyQuestion = $surveyQuestion; |
||
| 840 | return $this; |
||
| 841 | } |
||
| 842 | /** |
||
| 843 | * Get SurveyChoiceSelected value |
||
| 844 | * @return string[]|null |
||
| 845 | */ |
||
| 846 | public function getSurveyChoiceSelected() |
||
| 847 | { |
||
| 848 | return $this->SurveyChoiceSelected; |
||
| 849 | } |
||
| 850 | /** |
||
| 851 | * This method is responsible for validating the values passed to the setSurveyChoiceSelected method |
||
| 852 | * This method is willingly generated in order to preserve the one-line inline validation within the setSurveyChoiceSelected method |
||
| 853 | * @param array $values |
||
| 854 | * @return string A non-empty message if the values does not match the validation rules |
||
| 855 | */ |
||
| 856 | public static function validateSurveyChoiceSelectedForArrayConstraintsFromSetSurveyChoiceSelected(array $values = array()) |
||
| 857 | { |
||
| 858 | $message = ''; |
||
| 859 | $invalidValues = []; |
||
| 860 | foreach ($values as $getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem) { |
||
| 861 | // validation for constraint: itemType |
||
| 862 | if (!is_string($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem)) { |
||
| 863 | $invalidValues[] = is_object($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem) : sprintf('%s(%s)', gettype($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem), var_export($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem, true)); |
||
| 864 | } |
||
| 865 | } |
||
| 866 | if (!empty($invalidValues)) { |
||
| 867 | $message = sprintf('The SurveyChoiceSelected property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); |
||
| 868 | } |
||
| 869 | unset($invalidValues); |
||
| 870 | return $message; |
||
| 871 | } |
||
| 872 | /** |
||
| 873 | * Set SurveyChoiceSelected value |
||
| 874 | * @throws \InvalidArgumentException |
||
| 875 | * @param string[] $surveyChoiceSelected |
||
| 876 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 877 | */ |
||
| 878 | public function setSurveyChoiceSelected(array $surveyChoiceSelected = array()) |
||
| 879 | { |
||
| 880 | // validation for constraint: array |
||
| 881 | if ('' !== ($surveyChoiceSelectedArrayErrorMessage = self::validateSurveyChoiceSelectedForArrayConstraintsFromSetSurveyChoiceSelected($surveyChoiceSelected))) { |
||
| 882 | throw new \InvalidArgumentException($surveyChoiceSelectedArrayErrorMessage, __LINE__); |
||
| 883 | } |
||
| 884 | $this->SurveyChoiceSelected = $surveyChoiceSelected; |
||
| 885 | return $this; |
||
| 886 | } |
||
| 887 | /** |
||
| 888 | * Add item to SurveyChoiceSelected value |
||
| 889 | * @throws \InvalidArgumentException |
||
| 890 | * @param string $item |
||
| 891 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 892 | */ |
||
| 893 | public function addToSurveyChoiceSelected($item) |
||
| 894 | { |
||
| 895 | // validation for constraint: itemType |
||
| 896 | if (!is_string($item)) { |
||
| 897 | throw new \InvalidArgumentException(sprintf('The SurveyChoiceSelected property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); |
||
| 898 | } |
||
| 899 | $this->SurveyChoiceSelected[] = $item; |
||
| 900 | return $this; |
||
| 901 | } |
||
| 902 | /** |
||
| 903 | * Get PaymentRequestInfo value |
||
| 904 | * @return \PayPal\StructType\PaymentRequestInfoType[]|null |
||
| 905 | */ |
||
| 906 | public function getPaymentRequestInfo() |
||
| 907 | { |
||
| 908 | return $this->PaymentRequestInfo; |
||
| 909 | } |
||
| 910 | /** |
||
| 911 | * This method is responsible for validating the values passed to the setPaymentRequestInfo method |
||
| 912 | * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentRequestInfo method |
||
| 913 | * @param array $values |
||
| 914 | * @return string A non-empty message if the values does not match the validation rules |
||
| 915 | */ |
||
| 916 | public static function validatePaymentRequestInfoForArrayConstraintsFromSetPaymentRequestInfo(array $values = array()) |
||
| 917 | { |
||
| 918 | $message = ''; |
||
| 919 | $invalidValues = []; |
||
| 920 | foreach ($values as $getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem) { |
||
| 921 | // validation for constraint: itemType |
||
| 922 | if (!$getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem instanceof \PayPal\StructType\PaymentRequestInfoType) { |
||
| 923 | $invalidValues[] = is_object($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem) : sprintf('%s(%s)', gettype($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem), var_export($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem, true)); |
||
| 924 | } |
||
| 925 | } |
||
| 926 | if (!empty($invalidValues)) { |
||
| 927 | $message = sprintf('The PaymentRequestInfo property can only contain items of type \PayPal\StructType\PaymentRequestInfoType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); |
||
| 928 | } |
||
| 929 | unset($invalidValues); |
||
| 930 | return $message; |
||
| 931 | } |
||
| 932 | /** |
||
| 933 | * Set PaymentRequestInfo value |
||
| 934 | * @throws \InvalidArgumentException |
||
| 935 | * @param \PayPal\StructType\PaymentRequestInfoType[] $paymentRequestInfo |
||
| 936 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 937 | */ |
||
| 938 | public function setPaymentRequestInfo(array $paymentRequestInfo = array()) |
||
| 950 | } |
||
| 951 | /** |
||
| 952 | * Add item to PaymentRequestInfo value |
||
| 953 | * @throws \InvalidArgumentException |
||
| 954 | * @param \PayPal\StructType\PaymentRequestInfoType $item |
||
| 955 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 956 | */ |
||
| 957 | public function addToPaymentRequestInfo(\PayPal\StructType\PaymentRequestInfoType $item) |
||
| 958 | { |
||
| 959 | // validation for constraint: itemType |
||
| 960 | if (!$item instanceof \PayPal\StructType\PaymentRequestInfoType) { |
||
| 961 | throw new \InvalidArgumentException(sprintf('The PaymentRequestInfo property can only contain items of type \PayPal\StructType\PaymentRequestInfoType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); |
||
| 962 | } |
||
| 963 | // validation for constraint: maxOccurs(10) |
||
| 964 | if (is_array($this->PaymentRequestInfo) && count($this->PaymentRequestInfo) >= 10) { |
||
| 965 | 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->PaymentRequestInfo)), __LINE__); |
||
| 966 | } |
||
| 967 | $this->PaymentRequestInfo[] = $item; |
||
| 968 | return $this; |
||
| 969 | } |
||
| 970 | /** |
||
| 971 | * Get ExternalRememberMeStatusDetails value |
||
| 972 | * @return \PayPal\StructType\ExternalRememberMeStatusDetailsType|null |
||
| 973 | */ |
||
| 974 | public function getExternalRememberMeStatusDetails() |
||
| 975 | { |
||
| 976 | return $this->ExternalRememberMeStatusDetails; |
||
| 977 | } |
||
| 978 | /** |
||
| 979 | * Set ExternalRememberMeStatusDetails value |
||
| 980 | * @param \PayPal\StructType\ExternalRememberMeStatusDetailsType $externalRememberMeStatusDetails |
||
| 981 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 982 | */ |
||
| 983 | public function setExternalRememberMeStatusDetails(\PayPal\StructType\ExternalRememberMeStatusDetailsType $externalRememberMeStatusDetails = null) |
||
| 984 | { |
||
| 985 | $this->ExternalRememberMeStatusDetails = $externalRememberMeStatusDetails; |
||
| 986 | return $this; |
||
| 987 | } |
||
| 988 | /** |
||
| 989 | * Get RefreshTokenStatusDetails value |
||
| 990 | * @return \PayPal\StructType\RefreshTokenStatusDetailsType|null |
||
| 991 | */ |
||
| 992 | public function getRefreshTokenStatusDetails() |
||
| 993 | { |
||
| 994 | return $this->RefreshTokenStatusDetails; |
||
| 995 | } |
||
| 996 | /** |
||
| 997 | * Set RefreshTokenStatusDetails value |
||
| 998 | * @param \PayPal\StructType\RefreshTokenStatusDetailsType $refreshTokenStatusDetails |
||
| 999 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 1000 | */ |
||
| 1001 | public function setRefreshTokenStatusDetails(\PayPal\StructType\RefreshTokenStatusDetailsType $refreshTokenStatusDetails = null) |
||
| 1002 | { |
||
| 1003 | $this->RefreshTokenStatusDetails = $refreshTokenStatusDetails; |
||
| 1004 | return $this; |
||
| 1005 | } |
||
| 1006 | /** |
||
| 1007 | * Get PaymentInfo value |
||
| 1008 | * @return \PayPal\StructType\PaymentInfoType[]|null |
||
| 1009 | */ |
||
| 1010 | public function getPaymentInfo() |
||
| 1011 | { |
||
| 1012 | return $this->PaymentInfo; |
||
| 1013 | } |
||
| 1014 | /** |
||
| 1015 | * This method is responsible for validating the values passed to the setPaymentInfo method |
||
| 1016 | * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentInfo method |
||
| 1017 | * @param array $values |
||
| 1018 | * @return string A non-empty message if the values does not match the validation rules |
||
| 1019 | */ |
||
| 1020 | public static function validatePaymentInfoForArrayConstraintsFromSetPaymentInfo(array $values = array()) |
||
| 1021 | { |
||
| 1022 | $message = ''; |
||
| 1023 | $invalidValues = []; |
||
| 1024 | foreach ($values as $getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem) { |
||
| 1025 | // validation for constraint: itemType |
||
| 1026 | if (!$getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem instanceof \PayPal\StructType\PaymentInfoType) { |
||
| 1027 | $invalidValues[] = is_object($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem) : sprintf('%s(%s)', gettype($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem), var_export($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem, true)); |
||
| 1028 | } |
||
| 1029 | } |
||
| 1030 | if (!empty($invalidValues)) { |
||
| 1031 | $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))); |
||
| 1032 | } |
||
| 1033 | unset($invalidValues); |
||
| 1034 | return $message; |
||
| 1035 | } |
||
| 1036 | /** |
||
| 1037 | * Set PaymentInfo value |
||
| 1038 | * @throws \InvalidArgumentException |
||
| 1039 | * @param \PayPal\StructType\PaymentInfoType[] $paymentInfo |
||
| 1040 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 1041 | */ |
||
| 1042 | public function setPaymentInfo(array $paymentInfo = array()) |
||
| 1043 | { |
||
| 1044 | // validation for constraint: array |
||
| 1045 | if ('' !== ($paymentInfoArrayErrorMessage = self::validatePaymentInfoForArrayConstraintsFromSetPaymentInfo($paymentInfo))) { |
||
| 1046 | throw new \InvalidArgumentException($paymentInfoArrayErrorMessage, __LINE__); |
||
| 1047 | } |
||
| 1048 | // validation for constraint: maxOccurs(10) |
||
| 1049 | if (is_array($paymentInfo) && count($paymentInfo) > 10) { |
||
| 1050 | 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__); |
||
| 1051 | } |
||
| 1052 | $this->PaymentInfo = $paymentInfo; |
||
| 1053 | return $this; |
||
| 1054 | } |
||
| 1055 | /** |
||
| 1056 | * Add item to PaymentInfo value |
||
| 1057 | * @throws \InvalidArgumentException |
||
| 1058 | * @param \PayPal\StructType\PaymentInfoType $item |
||
| 1059 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 1060 | */ |
||
| 1061 | public function addToPaymentInfo(\PayPal\StructType\PaymentInfoType $item) |
||
| 1062 | { |
||
| 1063 | // validation for constraint: itemType |
||
| 1064 | if (!$item instanceof \PayPal\StructType\PaymentInfoType) { |
||
| 1065 | 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__); |
||
| 1066 | } |
||
| 1067 | // validation for constraint: maxOccurs(10) |
||
| 1068 | if (is_array($this->PaymentInfo) && count($this->PaymentInfo) >= 10) { |
||
| 1069 | 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__); |
||
| 1070 | } |
||
| 1071 | $this->PaymentInfo[] = $item; |
||
| 1072 | return $this; |
||
| 1073 | } |
||
| 1074 | /** |
||
| 1075 | * Get CartChangeTolerance value |
||
| 1076 | * @return string|null |
||
| 1077 | */ |
||
| 1078 | public function getCartChangeTolerance() |
||
| 1079 | { |
||
| 1080 | return $this->CartChangeTolerance; |
||
| 1081 | } |
||
| 1082 | /** |
||
| 1083 | * Set CartChangeTolerance value |
||
| 1084 | * @param string $cartChangeTolerance |
||
| 1085 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 1086 | */ |
||
| 1087 | public function setCartChangeTolerance($cartChangeTolerance = null) |
||
| 1088 | { |
||
| 1089 | // validation for constraint: string |
||
| 1090 | if (!is_null($cartChangeTolerance) && !is_string($cartChangeTolerance)) { |
||
| 1091 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cartChangeTolerance, true), gettype($cartChangeTolerance)), __LINE__); |
||
| 1092 | } |
||
| 1093 | $this->CartChangeTolerance = $cartChangeTolerance; |
||
| 1094 | return $this; |
||
| 1095 | } |
||
| 1096 | /** |
||
| 1097 | * Get InstrumentDetails value |
||
| 1098 | * @return \PayPal\StructType\InstrumentDetailsType|null |
||
| 1099 | */ |
||
| 1100 | public function getInstrumentDetails() |
||
| 1103 | } |
||
| 1104 | /** |
||
| 1105 | * Set InstrumentDetails value |
||
| 1106 | * @param \PayPal\StructType\InstrumentDetailsType $instrumentDetails |
||
| 1107 | * @return \PayPal\StructType\GetExpressCheckoutDetailsResponseDetailsType |
||
| 1108 | */ |
||
| 1109 | public function setInstrumentDetails(\PayPal\StructType\InstrumentDetailsType $instrumentDetails = null) |
||
| 1110 | { |
||
| 1111 | $this->InstrumentDetails = $instrumentDetails; |
||
| 1112 | return $this; |
||
| 1113 | } |
||
| 1114 | } |
||
| 1115 |