diff --git a/composer.json b/composer.json index c7749f5..e2fefdd 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,8 @@ "require": { "php": ">=5.3.3", "ext-soap": "*", - "wsdltophp/packagebase": "~1.0" + "ext-mbstring": "*", + "wsdltophp/packagebase": "~2.0" }, "autoload": { "psr-4": { diff --git a/generate.sh b/generate.sh index a78acef..d8501f4 100755 --- a/generate.sh +++ b/generate.sh @@ -14,7 +14,7 @@ rm -rf $DEST/src/ \ $DEST/composer.lock; # package informations -php wsdltophp.phar generate:package \ +php-7.2 wsdltophp.phar generate:package \ --urlorpath="https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl" \ --destination=$DEST \ --composer-name="wsdltophp/package-paypal" \ @@ -24,7 +24,7 @@ php wsdltophp.phar generate:package \ --namespace="PayPal"; # generate package -php wsdltophp.phar generate:package \ +php-7.2 -dmemory_limit=-1 wsdltophp.phar generate:package \ --urlorpath="https://www.paypalobjects.com/wsdl/PayPalSvc.wsdl" \ --destination=$DEST \ --composer-name="wsdltophp/package-paypal" \ diff --git a/src/ArrayType/CategoryArrayType.php b/src/ArrayType/CategoryArrayType.php index ea581f1..7d4d0b1 100644 --- a/src/ArrayType/CategoryArrayType.php +++ b/src/ArrayType/CategoryArrayType.php @@ -13,7 +13,7 @@ class CategoryArrayType extends AbstractStructArrayBase { /** * The Category - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * - ref: ns:Category @@ -38,6 +38,28 @@ public function getCategory() { return $this->Category; } + /** + * This method is responsible for validating the values passed to the setCategory method + * This method is willingly generated in order to preserve the one-line inline validation within the setCategory method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateCategoryForArrayConstraintsFromSetCategory(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $categoryArrayTypeCategoryItem) { + // validation for constraint: itemType + if (!$categoryArrayTypeCategoryItem instanceof \PayPal\StructType\CategoryType) { + $invalidValues[] = is_object($categoryArrayTypeCategoryItem) ? get_class($categoryArrayTypeCategoryItem) : sprintf('%s(%s)', gettype($categoryArrayTypeCategoryItem), var_export($categoryArrayTypeCategoryItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Category property can only contain items of type \PayPal\StructType\CategoryType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Category value * @throws \InvalidArgumentException @@ -46,11 +68,9 @@ public function getCategory() */ public function setCategory(array $category = array()) { - foreach ($category as $categoryArrayTypeCategoryItem) { - // validation for constraint: itemType - if (!$categoryArrayTypeCategoryItem instanceof \PayPal\StructType\CategoryType) { - throw new \InvalidArgumentException(sprintf('The Category property can only contain items of \PayPal\StructType\CategoryType, "%s" given', is_object($categoryArrayTypeCategoryItem) ? get_class($categoryArrayTypeCategoryItem) : gettype($categoryArrayTypeCategoryItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($categoryArrayErrorMessage = self::validateCategoryForArrayConstraintsFromSetCategory($category))) { + throw new \InvalidArgumentException($categoryArrayErrorMessage, __LINE__); } $this->Category = $category; return $this; @@ -65,7 +85,7 @@ public function addToCategory(\PayPal\StructType\CategoryType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\CategoryType) { - throw new \InvalidArgumentException(sprintf('The Category property can only contain items of \PayPal\StructType\CategoryType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Category property can only contain items of type \PayPal\StructType\CategoryType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Category[] = $item; return $this; diff --git a/src/ArrayType/ItemArrayType.php b/src/ArrayType/ItemArrayType.php index 18505d9..75fab38 100644 --- a/src/ArrayType/ItemArrayType.php +++ b/src/ArrayType/ItemArrayType.php @@ -13,7 +13,7 @@ class ItemArrayType extends AbstractStructArrayBase { /** * The Item - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * - ref: ns:Item @@ -38,6 +38,28 @@ public function getItem() { return $this->Item; } + /** + * This method is responsible for validating the values passed to the setItem method + * This method is willingly generated in order to preserve the one-line inline validation within the setItem method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateItemForArrayConstraintsFromSetItem(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $itemArrayTypeItemItem) { + // validation for constraint: itemType + if (!$itemArrayTypeItemItem instanceof \PayPal\StructType\ItemType) { + $invalidValues[] = is_object($itemArrayTypeItemItem) ? get_class($itemArrayTypeItemItem) : sprintf('%s(%s)', gettype($itemArrayTypeItemItem), var_export($itemArrayTypeItemItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Item property can only contain items of type \PayPal\StructType\ItemType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Item value * @throws \InvalidArgumentException @@ -46,11 +68,9 @@ public function getItem() */ public function setItem(array $item = array()) { - foreach ($item as $itemArrayTypeItemItem) { - // validation for constraint: itemType - if (!$itemArrayTypeItemItem instanceof \PayPal\StructType\ItemType) { - throw new \InvalidArgumentException(sprintf('The Item property can only contain items of \PayPal\StructType\ItemType, "%s" given', is_object($itemArrayTypeItemItem) ? get_class($itemArrayTypeItemItem) : gettype($itemArrayTypeItemItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($itemArrayErrorMessage = self::validateItemForArrayConstraintsFromSetItem($item))) { + throw new \InvalidArgumentException($itemArrayErrorMessage, __LINE__); } $this->Item = $item; return $this; @@ -65,7 +85,7 @@ public function addToItem(\PayPal\StructType\ItemType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\ItemType) { - throw new \InvalidArgumentException(sprintf('The Item property can only contain items of \PayPal\StructType\ItemType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Item property can only contain items of type \PayPal\StructType\ItemType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Item[] = $item; return $this; diff --git a/src/EnumType/APIAuthenticationType.php b/src/EnumType/APIAuthenticationType.php index c3772ee..8f3c457 100644 --- a/src/EnumType/APIAuthenticationType.php +++ b/src/EnumType/APIAuthenticationType.php @@ -4,7 +4,7 @@ /** * This class stands for APIAuthenticationType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: API Authentication Type * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/APIType.php b/src/EnumType/APIType.php index c3fdb6d..fdc9ad0 100644 --- a/src/EnumType/APIType.php +++ b/src/EnumType/APIType.php @@ -4,7 +4,7 @@ /** * This class stands for APIType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Supported API Types for DoCancel operation * - type: ns:APIType * @subpackage Enumerations @@ -14,16 +14,22 @@ class APIType { /** * Constant for value 'CHECKOUT_AUTHORIZATION' + * Meta information extracted from the WSDL + * - documentation: POS CHECKOUT AUTHORIZATION * @return string 'CHECKOUT_AUTHORIZATION' */ const VALUE_CHECKOUT_AUTHORIZATION = 'CHECKOUT_AUTHORIZATION'; /** * Constant for value 'CHECKOUT_SALE' + * Meta information extracted from the WSDL + * - documentation: POS CHECKOUT SALE * @return string 'CHECKOUT_SALE' */ const VALUE_CHECKOUT_SALE = 'CHECKOUT_SALE'; /** * Constant for value 'REFUND_TRANSACTION' + * Meta information extracted from the WSDL + * - documentation: REFUND TRANSACTION * @return string 'REFUND_TRANSACTION' */ const VALUE_REFUND_TRANSACTION = 'REFUND_TRANSACTION'; diff --git a/src/EnumType/AccountStateCodeType.php b/src/EnumType/AccountStateCodeType.php index 69c8bbe..1d33ad4 100644 --- a/src/EnumType/AccountStateCodeType.php +++ b/src/EnumType/AccountStateCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for AccountStateCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AccountStateCodeType These are the possible codes to describe the state of an account of an eBay user. * @subpackage Enumerations * @author WsdlToPhp @@ -13,21 +13,29 @@ class AccountStateCodeType { /** * Constant for value 'Active' + * Meta information extracted from the WSDL + * - documentation: Amex * @return string 'Active' */ const VALUE_ACTIVE = 'Active'; /** * Constant for value 'Pending' + * Meta information extracted from the WSDL + * - documentation: Visa * @return string 'Pending' */ const VALUE_PENDING = 'Pending'; /** * Constant for value 'Inactive' + * Meta information extracted from the WSDL + * - documentation: Mastercard * @return string 'Inactive' */ const VALUE_INACTIVE = 'Inactive'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/AckCodeType.php b/src/EnumType/AckCodeType.php index b3bc80e..86cd258 100644 --- a/src/EnumType/AckCodeType.php +++ b/src/EnumType/AckCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for AckCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AckCodeType This code identifies the acknowledgement code types that could be used to communicate the status of processing a (request) message to an application. This code would be used as part of a response message that contains an * application level acknowledgement element. * @subpackage Enumerations @@ -14,36 +14,50 @@ class AckCodeType { /** * Constant for value 'Success' + * Meta information extracted from the WSDL + * - documentation: Request processing succeeded. * @return string 'Success' */ const VALUE_SUCCESS = 'Success'; /** * Constant for value 'Failure' + * Meta information extracted from the WSDL + * - documentation: Request processing failed. * @return string 'Failure' */ const VALUE_FAILURE = 'Failure'; /** * Constant for value 'Warning' + * Meta information extracted from the WSDL + * - documentation: Request processing completed with warning information being included in the response message. * @return string 'Warning' */ const VALUE_WARNING = 'Warning'; /** * Constant for value 'SuccessWithWarning' + * Meta information extracted from the WSDL + * - documentation: Request processing completed successful with some with some warning information that could be useful for the requesting application to process and/or record. * @return string 'SuccessWithWarning' */ const VALUE_SUCCESS_WITH_WARNING = 'SuccessWithWarning'; /** * Constant for value 'FailureWithWarning' + * Meta information extracted from the WSDL + * - documentation: Request processing failed with some error and warnining information that requesting application should process to determine cause(s) of failure. * @return string 'FailureWithWarning' */ const VALUE_FAILURE_WITH_WARNING = 'FailureWithWarning'; /** * Constant for value 'PartialSuccess' + * Meta information extracted from the WSDL + * - documentation: Request processing completed with Partial Success. * @return string 'PartialSuccess' */ const VALUE_PARTIAL_SUCCESS = 'PartialSuccess'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/AddressNormalizationStatusCodeType.php b/src/EnumType/AddressNormalizationStatusCodeType.php index 2e8d725..549a39c 100644 --- a/src/EnumType/AddressNormalizationStatusCodeType.php +++ b/src/EnumType/AddressNormalizationStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for AddressNormalizationStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Normalization Status of the Address * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/AddressOwnerCodeType.php b/src/EnumType/AddressOwnerCodeType.php index 5ce345c..9bd6f2e 100644 --- a/src/EnumType/AddressOwnerCodeType.php +++ b/src/EnumType/AddressOwnerCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for AddressOwnerCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AddressOwnerCodeType This code identifies the AddressOwner code types which indicates who owns the user'a address. * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class AddressOwnerCodeType { /** * Constant for value 'PayPal' + * Meta information extracted from the WSDL + * - documentation: PayPal owns address. * @return string 'PayPal' */ const VALUE_PAY_PAL = 'PayPal'; /** * Constant for value 'eBay' + * Meta information extracted from the WSDL + * - documentation: eBay owns address. * @return string 'eBay' */ const VALUE_E_BAY = 'eBay'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/AddressStatusCodeType.php b/src/EnumType/AddressStatusCodeType.php index c61cfab..f138d1f 100644 --- a/src/EnumType/AddressStatusCodeType.php +++ b/src/EnumType/AddressStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for AddressStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AddressStatusCodeType This is the PayPal address status * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/AllowedPaymentMethodType.php b/src/EnumType/AllowedPaymentMethodType.php index 8575736..cc7ad16 100644 --- a/src/EnumType/AllowedPaymentMethodType.php +++ b/src/EnumType/AllowedPaymentMethodType.php @@ -4,7 +4,7 @@ /** * This class stands for AllowedPaymentMethodType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AllowedPaymentMethodType This is the payment Solution merchant needs to specify for Autopay (used by Express Checkout) Optional Default indicates that its merchant supports all funding source InstantPaymentOnly indicates that its * merchant only supports instant payment AnyFundingSource allow all funding methods to be chosen by the buyer irrespective of merchant's profile setting InstantFundingSource allow only instant funding methods, block echeck, meft, elevecheck. This will * override any merchant profile setting diff --git a/src/EnumType/AuctionTypeCodeType.php b/src/EnumType/AuctionTypeCodeType.php index f95868e..0e19c8c 100644 --- a/src/EnumType/AuctionTypeCodeType.php +++ b/src/EnumType/AuctionTypeCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for AuctionTypeCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AuctionTypeCodeType - Type declaration to be used by other schema's. This includes codes indicating the type of auction for the listed item. * @subpackage Enumerations * @author WsdlToPhp @@ -13,46 +13,64 @@ class AuctionTypeCodeType { /** * Constant for value 'Unknown' + * Meta information extracted from the WSDL + * - documentation: Unknown auction type * @return string 'Unknown' */ const VALUE_UNKNOWN = 'Unknown'; /** * Constant for value 'Chinese' + * Meta information extracted from the WSDL + * - documentation: Chinese auction * @return string 'Chinese' */ const VALUE_CHINESE = 'Chinese'; /** * Constant for value 'Dutch' + * Meta information extracted from the WSDL + * - documentation: Dutch auction * @return string 'Dutch' */ const VALUE_DUTCH = 'Dutch'; /** * Constant for value 'Live' + * Meta information extracted from the WSDL + * - documentation: Live Auctions-type auction * @return string 'Live' */ const VALUE_LIVE = 'Live'; /** * Constant for value 'Ad type' + * Meta information extracted from the WSDL + * - documentation: Ad type auction * @return string 'Ad type' */ const VALUE_AD_TYPE = 'Ad type'; /** * Constant for value 'Stores Fixed-price' + * Meta information extracted from the WSDL + * - documentation: Stores Fixed-price auction (US only) * @return string 'Stores Fixed-price' */ const VALUE_STORES_FIXED_PRICE = 'Stores Fixed-price'; /** * Constant for value 'Personal Offer' + * Meta information extracted from the WSDL + * - documentation: Personal Offer auction * @return string 'Personal Offer' */ const VALUE_PERSONAL_OFFER = 'Personal Offer'; /** * Constant for value 'Fixed Price Item' + * Meta information extracted from the WSDL + * - documentation: Fixed Price item ("BIN only"). * @return string 'Fixed Price Item' */ const VALUE_FIXED_PRICE_ITEM = 'Fixed Price Item'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/AverageMonthlyVolumeType.php b/src/EnumType/AverageMonthlyVolumeType.php index 130de96..d26a352 100644 --- a/src/EnumType/AverageMonthlyVolumeType.php +++ b/src/EnumType/AverageMonthlyVolumeType.php @@ -4,7 +4,7 @@ /** * This class stands for AverageMonthlyVolumeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AverageMonthlyVolumeType Enumeration Meaning AverageMonthlyVolume-Not-Applicable AverageMonthlyVolume-Range1 Less than $1,000 USD AverageMonthlyVolume-Range2 $1,000 USD to $5,000 USD AverageMonthlyVolume-Range3 $5,000 USD to $25,000 * USD AverageMonthlyVolume-Range4 $25,000 USD to $100,000 USD AverageMonthlyVolume-Range5 $100,000 USD to $1,000,000 USD AverageMonthlyVolume-Range6 More than $1,000,000 USD * @subpackage Enumerations diff --git a/src/EnumType/AverageTransactionPriceType.php b/src/EnumType/AverageTransactionPriceType.php index efee574..286ff01 100644 --- a/src/EnumType/AverageTransactionPriceType.php +++ b/src/EnumType/AverageTransactionPriceType.php @@ -4,7 +4,7 @@ /** * This class stands for AverageTransactionPriceType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AverageTransactionPriceType Enumeration Meaning AverageTransactionPrice-Not-Applicable AverageTransactionPrice-Range1 Less than $25 USD AverageTransactionPrice-Range2 $25 USD to $50 USD AverageTransactionPrice-Range3 $50 USD to $100 * USD AverageTransactionPrice-Range4 $100 USD to $250 USD AverageTransactionPrice-Range5 $250 USD to $500 USD AverageTransactionPrice-Range6 $500 USD to $1,000 USD AverageTransactionPrice-Range7 $1,000 USD to $2,000 USD AverageTransactionPrice-Range8 * $2,000 USD to $5,000 USD AverageTransactionPrice-Range9 $5,000 USD to $10,000 USD AverageTransactionPrice-Range10 More than $10,000 USD diff --git a/src/EnumType/BalanceCodeType.php b/src/EnumType/BalanceCodeType.php index 3eff100..79bba1f 100644 --- a/src/EnumType/BalanceCodeType.php +++ b/src/EnumType/BalanceCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for BalanceCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BalanceCodeType This code identifies the types of balances in an account, e.g., a PayPal account. * @subpackage Enumerations * @author WsdlToPhp @@ -13,11 +13,15 @@ class BalanceCodeType { /** * Constant for value 'Other' + * Meta information extracted from the WSDL + * - documentation: Custom Code * @return string 'Other' */ const VALUE_OTHER = 'Other'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/BankAccountTypeType.php b/src/EnumType/BankAccountTypeType.php index 2c85688..6f5f3ba 100644 --- a/src/EnumType/BankAccountTypeType.php +++ b/src/EnumType/BankAccountTypeType.php @@ -4,7 +4,7 @@ /** * This class stands for BankAccountTypeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BankAccountTypeType * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/BankIDCodeType.php b/src/EnumType/BankIDCodeType.php index 89cf5fd..f902869 100644 --- a/src/EnumType/BankIDCodeType.php +++ b/src/EnumType/BankIDCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for BankIDCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BankID The various banks supported for China postbacks. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/BoardingStatusType.php b/src/EnumType/BoardingStatusType.php index edfd529..4321319 100644 --- a/src/EnumType/BoardingStatusType.php +++ b/src/EnumType/BoardingStatusType.php @@ -4,7 +4,7 @@ /** * This class stands for BoardingStatusType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Boarding Status * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/BusinessCategoryType.php b/src/EnumType/BusinessCategoryType.php index 499314c..336af1d 100644 --- a/src/EnumType/BusinessCategoryType.php +++ b/src/EnumType/BusinessCategoryType.php @@ -4,7 +4,7 @@ /** * This class stands for BusinessCategoryType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BusinessCategoryType * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/BusinessSubCategoryType.php b/src/EnumType/BusinessSubCategoryType.php index 09d2ca9..a7897ce 100644 --- a/src/EnumType/BusinessSubCategoryType.php +++ b/src/EnumType/BusinessSubCategoryType.php @@ -4,7 +4,7 @@ /** * This class stands for BusinessSubCategoryType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BusinessSubCategoryType * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/BusinessTypeType.php b/src/EnumType/BusinessTypeType.php index 2b86c12..a8a3407 100644 --- a/src/EnumType/BusinessTypeType.php +++ b/src/EnumType/BusinessTypeType.php @@ -4,7 +4,7 @@ /** * This class stands for BusinessTypeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BusinessTypeType * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/ButtonCodeType.php b/src/EnumType/ButtonCodeType.php index 87ff25a..38d30af 100644 --- a/src/EnumType/ButtonCodeType.php +++ b/src/EnumType/ButtonCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ButtonCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Types of button coding * @subpackage Enumerations * @author WsdlToPhp @@ -13,21 +13,29 @@ class ButtonCodeType { /** * Constant for value 'HOSTED' + * Meta information extracted from the WSDL + * - documentation: Creates Hosted Button * @return string 'HOSTED' */ const VALUE_HOSTED = 'HOSTED'; /** * Constant for value 'ENCRYPTED' + * Meta information extracted from the WSDL + * - documentation: Creates Encrypted Button * @return string 'ENCRYPTED' */ const VALUE_ENCRYPTED = 'ENCRYPTED'; /** * Constant for value 'CLEARTEXT' + * Meta information extracted from the WSDL + * - documentation: Creates Cleartext Button * @return string 'CLEARTEXT' */ const VALUE_CLEARTEXT = 'CLEARTEXT'; /** * Constant for value 'TOKEN' + * Meta information extracted from the WSDL + * - documentation: Creates Token or temporary Button * @return string 'TOKEN' */ const VALUE_TOKEN = 'TOKEN'; diff --git a/src/EnumType/ButtonImageType.php b/src/EnumType/ButtonImageType.php index cd665bd..f95016a 100644 --- a/src/EnumType/ButtonImageType.php +++ b/src/EnumType/ButtonImageType.php @@ -4,7 +4,7 @@ /** * This class stands for ButtonImageType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Types of button images * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class ButtonImageType { /** * Constant for value 'REG' + * Meta information extracted from the WSDL + * - documentation: button image type is REG * @return string 'REG' */ const VALUE_REG = 'REG'; /** * Constant for value 'SML' + * Meta information extracted from the WSDL + * - documentation: button image type is SML * @return string 'SML' */ const VALUE_SML = 'SML'; /** * Constant for value 'CC' + * Meta information extracted from the WSDL + * - documentation: button image type is CC * @return string 'CC' */ const VALUE_CC = 'CC'; diff --git a/src/EnumType/ButtonStatusType.php b/src/EnumType/ButtonStatusType.php index 27cf5c2..f73c182 100644 --- a/src/EnumType/ButtonStatusType.php +++ b/src/EnumType/ButtonStatusType.php @@ -4,7 +4,7 @@ /** * This class stands for ButtonStatusType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: values for subscribe button text * @subpackage Enumerations * @author WsdlToPhp @@ -13,6 +13,8 @@ class ButtonStatusType { /** * Constant for value 'DELETE' + * Meta information extracted from the WSDL + * - documentation: Changes Button Status to DELETE * @return string 'DELETE' */ const VALUE_DELETE = 'DELETE'; diff --git a/src/EnumType/ButtonSubTypeType.php b/src/EnumType/ButtonSubTypeType.php index f511922..f58c1ad 100644 --- a/src/EnumType/ButtonSubTypeType.php +++ b/src/EnumType/ButtonSubTypeType.php @@ -4,7 +4,7 @@ /** * This class stands for ButtonSubTypeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Types of button sub types * @subpackage Enumerations * @author WsdlToPhp @@ -13,11 +13,15 @@ class ButtonSubTypeType { /** * Constant for value 'PRODUCTS' + * Meta information extracted from the WSDL + * - documentation: button subtype is PRODUCTS * @return string 'PRODUCTS' */ const VALUE_PRODUCTS = 'PRODUCTS'; /** * Constant for value 'SERVICES' + * Meta information extracted from the WSDL + * - documentation: button subtype is SERVICES * @return string 'SERVICES' */ const VALUE_SERVICES = 'SERVICES'; diff --git a/src/EnumType/ButtonTypeType.php b/src/EnumType/ButtonTypeType.php index 8d81c1c..39e4679 100644 --- a/src/EnumType/ButtonTypeType.php +++ b/src/EnumType/ButtonTypeType.php @@ -4,7 +4,7 @@ /** * This class stands for ButtonTypeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Types of buttons * @subpackage Enumerations * @author WsdlToPhp @@ -13,51 +13,71 @@ class ButtonTypeType { /** * Constant for value 'BUYNOW' + * Meta information extracted from the WSDL + * - documentation: button type is BUYNOW * @return string 'BUYNOW' */ const VALUE_BUYNOW = 'BUYNOW'; /** * Constant for value 'CART' + * Meta information extracted from the WSDL + * - documentation: button type is CART * @return string 'CART' */ const VALUE_CART = 'CART'; /** * Constant for value 'GIFTCERTIFICATE' + * Meta information extracted from the WSDL + * - documentation: button type is GIFTCERTIFICATE * @return string 'GIFTCERTIFICATE' */ const VALUE_GIFTCERTIFICATE = 'GIFTCERTIFICATE'; /** * Constant for value 'SUBSCRIBE' + * Meta information extracted from the WSDL + * - documentation: button type is SUBSCRIBE * @return string 'SUBSCRIBE' */ const VALUE_SUBSCRIBE = 'SUBSCRIBE'; /** * Constant for value 'DONATE' + * Meta information extracted from the WSDL + * - documentation: button type is DONATE * @return string 'DONATE' */ const VALUE_DONATE = 'DONATE'; /** * Constant for value 'UNSUBSCRIBE' + * Meta information extracted from the WSDL + * - documentation: button type is UNSUBSCRIBE * @return string 'UNSUBSCRIBE' */ const VALUE_UNSUBSCRIBE = 'UNSUBSCRIBE'; /** * Constant for value 'VIEWCART' + * Meta information extracted from the WSDL + * - documentation: button type is VIEWCART * @return string 'VIEWCART' */ const VALUE_VIEWCART = 'VIEWCART'; /** * Constant for value 'PAYMENTPLAN' + * Meta information extracted from the WSDL + * - documentation: button type is PAYMENTPLAN * @return string 'PAYMENTPLAN' */ const VALUE_PAYMENTPLAN = 'PAYMENTPLAN'; /** * Constant for value 'AUTOBILLING' + * Meta information extracted from the WSDL + * - documentation: button type is AUTOBILLING * @return string 'AUTOBILLING' */ const VALUE_AUTOBILLING = 'AUTOBILLING'; /** * Constant for value 'PAYMENT' + * Meta information extracted from the WSDL + * - documentation: button type is PAYMENT * @return string 'PAYMENT' */ const VALUE_PAYMENT = 'PAYMENT'; diff --git a/src/EnumType/BuyNowTextType.php b/src/EnumType/BuyNowTextType.php index 8a588b2..e651c40 100644 --- a/src/EnumType/BuyNowTextType.php +++ b/src/EnumType/BuyNowTextType.php @@ -4,7 +4,7 @@ /** * This class stands for BuyNowTextType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: values for buynow button text * @subpackage Enumerations * @author WsdlToPhp @@ -13,11 +13,15 @@ class BuyNowTextType { /** * Constant for value 'BUYNOW' + * Meta information extracted from the WSDL + * - documentation: button wording is BUYNOW * @return string 'BUYNOW' */ const VALUE_BUYNOW = 'BUYNOW'; /** * Constant for value 'PAYNOW' + * Meta information extracted from the WSDL + * - documentation: button wording is PAYNOW * @return string 'PAYNOW' */ const VALUE_PAYNOW = 'PAYNOW'; diff --git a/src/EnumType/BuyerPaymentMethodCodeType.php b/src/EnumType/BuyerPaymentMethodCodeType.php index 767ee14..541fc6c 100644 --- a/src/EnumType/BuyerPaymentMethodCodeType.php +++ b/src/EnumType/BuyerPaymentMethodCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for BuyerPaymentMethodCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BuyerPaymentMethodCodeType - Type declaration to be used by other schema. The includes the codes for payment methods used by buyers to pay sellers. * @subpackage Enumerations * @author WsdlToPhp @@ -13,81 +13,113 @@ class BuyerPaymentMethodCodeType { /** * Constant for value 'None' + * Meta information extracted from the WSDL + * - documentation: No payment method specified * @return string 'None' */ const VALUE_NONE = 'None'; /** * Constant for value 'MOCC' + * Meta information extracted from the WSDL + * - documentation: Money order/cashiers check * @return string 'MOCC' */ const VALUE_MOCC = 'MOCC'; /** * Constant for value 'AmEx' + * Meta information extracted from the WSDL + * - documentation: American Express * @return string 'AmEx' */ const VALUE_AM_EX = 'AmEx'; /** * Constant for value 'PaymentSeeDescription' + * Meta information extracted from the WSDL + * - documentation: Payment See Description * @return string 'PaymentSeeDescription' */ const VALUE_PAYMENT_SEE_DESCRIPTION = 'PaymentSeeDescription'; /** * Constant for value 'CCAccepted' + * Meta information extracted from the WSDL + * - documentation: American Express * @return string 'CCAccepted' */ const VALUE_CCACCEPTED = 'CCAccepted'; /** * Constant for value 'PersonalCheck' + * Meta information extracted from the WSDL + * - documentation: Personal check * @return string 'PersonalCheck' */ const VALUE_PERSONAL_CHECK = 'PersonalCheck'; /** * Constant for value 'COD' + * Meta information extracted from the WSDL + * - documentation: COD * @return string 'COD' */ const VALUE_COD = 'COD'; /** * Constant for value 'VisaMC' + * Meta information extracted from the WSDL + * - documentation: Visa/Mastercard * @return string 'VisaMC' */ const VALUE_VISA_MC = 'VisaMC'; /** * Constant for value 'Other' + * Meta information extracted from the WSDL + * - documentation: Other forms of payment. Some custom method is accepted by seller as payment method in the transaction. For Motors vehicle items, this field refers to the Deposit payment method. * @return string 'Other' */ const VALUE_OTHER = 'Other'; /** * Constant for value 'PayPal' + * Meta information extracted from the WSDL + * - documentation: PayPal * @return string 'PayPal' */ const VALUE_PAY_PAL = 'PayPal'; /** * Constant for value 'Discover' + * Meta information extracted from the WSDL + * - documentation: Discover * @return string 'Discover' */ const VALUE_DISCOVER = 'Discover'; /** * Constant for value 'CashOnPickup' + * Meta information extracted from the WSDL + * - documentation: Payment on delivery acceptable payment term. * @return string 'CashOnPickup' */ const VALUE_CASH_ON_PICKUP = 'CashOnPickup'; /** * Constant for value 'MoneyXferAccepted' + * Meta information extracted from the WSDL + * - documentation: Direct transfer of money acceptable payment term. * @return string 'MoneyXferAccepted' */ const VALUE_MONEY_XFER_ACCEPTED = 'MoneyXferAccepted'; /** * Constant for value 'MoneyXferAcceptedinCheckout' + * Meta information extracted from the WSDL + * - documentation: If the seller has bank account information on file, and MoneyXferAcceptedinCheckout = true, then the bank account information will be displayed in Checkout. Applicable to German site only. * @return string 'MoneyXferAcceptedinCheckout' */ const VALUE_MONEY_XFER_ACCEPTEDIN_CHECKOUT = 'MoneyXferAcceptedinCheckout'; /** * Constant for value 'OtherOnlinePayments' + * Meta information extracted from the WSDL + * - documentation: Online Escrow paid for by seller. * @return string 'OtherOnlinePayments' */ const VALUE_OTHER_ONLINE_PAYMENTS = 'OtherOnlinePayments'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/BuyerProtectionCodeType.php b/src/EnumType/BuyerProtectionCodeType.php index 8cc18cb..5ead075 100644 --- a/src/EnumType/BuyerProtectionCodeType.php +++ b/src/EnumType/BuyerProtectionCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for BuyerProtectionCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BuyerProtectionCodeType * @subpackage Enumerations * @author WsdlToPhp @@ -13,26 +13,36 @@ class BuyerProtectionCodeType { /** * Constant for value 'ItemIneligible' + * Meta information extracted from the WSDL + * - documentation: Item is ineligible (e.g., category not applicable). * @return string 'ItemIneligible' */ const VALUE_ITEM_INELIGIBLE = 'ItemIneligible'; /** * Constant for value 'ItemEligible' + * Meta information extracted from the WSDL + * - documentation: Item is eligible per standard criteria. * @return string 'ItemEligible' */ const VALUE_ITEM_ELIGIBLE = 'ItemEligible'; /** * Constant for value 'ItemMarkedIneligible' + * Meta information extracted from the WSDL + * - documentation: Item marked ineligible per special criteria (e.g., seller's account closed). * @return string 'ItemMarkedIneligible' */ const VALUE_ITEM_MARKED_INELIGIBLE = 'ItemMarkedIneligible'; /** * Constant for value 'ItemMarkedEligible' + * Meta information extracted from the WSDL + * - documentation: Item marked eligible per other criteria. * @return string 'ItemMarkedEligible' */ const VALUE_ITEM_MARKED_ELIGIBLE = 'ItemMarkedEligible'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ChannelType.php b/src/EnumType/ChannelType.php index f274f69..10bbfe0 100644 --- a/src/EnumType/ChannelType.php +++ b/src/EnumType/ChannelType.php @@ -4,7 +4,7 @@ /** * This class stands for ChannelType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ChannelType - Type declaration to be used by other schemas. This is the PayPal Channel type (used by Express Checkout) * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/CheckoutStatusCodeType.php b/src/EnumType/CheckoutStatusCodeType.php index 03ab08e..234b294 100644 --- a/src/EnumType/CheckoutStatusCodeType.php +++ b/src/EnumType/CheckoutStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for CheckoutStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: CheckoutStatusCodeType * @subpackage Enumerations * @author WsdlToPhp @@ -13,26 +13,36 @@ class CheckoutStatusCodeType { /** * Constant for value 'CheckoutComplete' + * Meta information extracted from the WSDL + * - documentation: Checkout complete. * @return string 'CheckoutComplete' */ const VALUE_CHECKOUT_COMPLETE = 'CheckoutComplete'; /** * Constant for value 'CheckoutIncomplete' + * Meta information extracted from the WSDL + * - documentation: Checkout incomplete. No details specified. * @return string 'CheckoutIncomplete' */ const VALUE_CHECKOUT_INCOMPLETE = 'CheckoutIncomplete'; /** * Constant for value 'BuyerRequestsTotal' + * Meta information extracted from the WSDL + * - documentation: Buyer requests total. * @return string 'BuyerRequestsTotal' */ const VALUE_BUYER_REQUESTS_TOTAL = 'BuyerRequestsTotal'; /** * Constant for value 'SellerResponded' + * Meta information extracted from the WSDL + * - documentation: Seller responded to buyer's request. * @return string 'SellerResponded' */ const VALUE_SELLER_RESPONDED = 'SellerResponded'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/CompleteCodeType.php b/src/EnumType/CompleteCodeType.php index b689a44..62af969 100644 --- a/src/EnumType/CompleteCodeType.php +++ b/src/EnumType/CompleteCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for CompleteCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: CompleteCodeType This is the PayPal DoCapture CompleteType code * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/CountryCodeType.php b/src/EnumType/CountryCodeType.php index 19768a9..df83372 100644 --- a/src/EnumType/CountryCodeType.php +++ b/src/EnumType/CountryCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for CountryCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: CountryCodeType This code list module defines the enumerated types of standard 2-letter ISO 3166 country codes. This codelist contains some additional country code not defined in the ISO 3166 country code set. * @subpackage Enumerations * @author WsdlToPhp @@ -1213,36 +1213,50 @@ class CountryCodeType const VALUE_ZW = 'ZW'; /** * Constant for value 'AA' + * Meta information extracted from the WSDL + * - documentation: NOTE: APO/FPO was defined in eBay list previously but they are not defined in ISO 3166. This country will remain on eBay country code list for backward compatibility. * @return string 'AA' */ const VALUE_AA = 'AA'; /** * Constant for value 'QM' + * Meta information extracted from the WSDL + * - documentation: NOTE: Guernsey was defined in eBay list previously but they are not defined in ISO 3166. This country will remain on eBay country list for backward compatibility. * @return string 'QM' */ const VALUE_QM = 'QM'; /** * Constant for value 'QN' + * Meta information extracted from the WSDL + * - documentation: NOTE: Jan Mayen was defined in eBay list previously but they are not defined in ISO 3166. This country will remain on eBay country list for backward compatibility. * @return string 'QN' */ const VALUE_QN = 'QN'; /** * Constant for value 'QO' + * Meta information extracted from the WSDL + * - documentation: NOTE: Jersey was defined in eBay list previously but they are not defined in ISO 3166. This country will remain on eBay country list for backward compatibility. * @return string 'QO' */ const VALUE_QO = 'QO'; /** * Constant for value 'QP' + * Meta information extracted from the WSDL + * - documentation: NOTE: Tahiti was defined in eBay list previously but they are not defined in ISO 3166. This country will remain on eBay country list for backward compatibility. * @return string 'QP' */ const VALUE_QP = 'QP'; /** * Constant for value 'CS' + * Meta information extracted from the WSDL + * - documentation: NOTE: Serbia and Montenegro was not defined in the list previously but now an ISO 3166 code has been defined. As of 41.0 this country is supported in PayPal PRO. * @return string 'CS' */ const VALUE_CS = 'CS'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; @@ -1268,11 +1282,15 @@ class CountryCodeType const VALUE_TL = 'TL'; /** * Constant for value 'RS' + * Meta information extracted from the WSDL + * - documentation: Republic of Serbia. * @return string 'RS' */ const VALUE_RS = 'RS'; /** * Constant for value 'ME' + * Meta information extracted from the WSDL + * - documentation: Montenegro. * @return string 'ME' */ const VALUE_ME = 'ME'; diff --git a/src/EnumType/CoupleType.php b/src/EnumType/CoupleType.php index 74b091b..4635cf9 100644 --- a/src/EnumType/CoupleType.php +++ b/src/EnumType/CoupleType.php @@ -4,7 +4,7 @@ /** * This class stands for CoupleType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Defines couple relationship type between buckets * @subpackage Enumerations * @author WsdlToPhp @@ -13,6 +13,8 @@ class CoupleType { /** * Constant for value 'LifeTime' + * Meta information extracted from the WSDL + * - documentation: The relation between buckets are for lifetime. Any post-transaction action on one affects other as well. * @return string 'LifeTime' */ const VALUE_LIFE_TIME = 'LifeTime'; diff --git a/src/EnumType/CreditCardTypeType.php b/src/EnumType/CreditCardTypeType.php index 6813974..69acda8 100644 --- a/src/EnumType/CreditCardTypeType.php +++ b/src/EnumType/CreditCardTypeType.php @@ -4,7 +4,7 @@ /** * This class stands for CreditCardTypeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type declaration to be used by other schemas. This is the credit card type * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/CurrencyCodeType.php b/src/EnumType/CurrencyCodeType.php index a446fc0..52bd1dd 100644 --- a/src/EnumType/CurrencyCodeType.php +++ b/src/EnumType/CurrencyCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for CurrencyCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ISO 4217 standard 3-letter currency code. The following currencies are supported by PayPal. Code CurrencyMaximum Transaction Amount AUD Australian Dollar 12,500 AUD CAD Canadian Dollar12,500 CAD EUR Euro 8,000 EUR GBP Pound Sterling * 5,500 GBP JPY Japanese Yen 1,000,000 JPY USD U.S. Dollar 10,000 USD CHF Czech Koruna 70,000 CHF SEK Swedish Krona 3,50,000 SEK NOK Norwegian Krone 4,00,000 NOK DKK Danish Krone 3,00,000 DKK PLN Poland Zloty 1,60,000 PLN HUF Hungary Forint 110,00,000 * HUF SGD Singapore Dollar 80,000 SGD HKD HongKong Dollar 3,80,000 HKD NZD New Zealand Dollar 77,000 NZD CZK Czech Koruna 1,20,000 CZK @@ -885,6 +885,8 @@ class CurrencyCodeType const VALUE_ZWD = 'ZWD'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/DepositTypeCodeType.php b/src/EnumType/DepositTypeCodeType.php index ffd7afa..d7f9e01 100644 --- a/src/EnumType/DepositTypeCodeType.php +++ b/src/EnumType/DepositTypeCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for DepositTypeCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: DepositTypeCodeType - Type declaration to be used by other schema's. This code identifies the DepositType codes used to specify deposit types for Motors items. If the ietm listed is not a Motors item, then always return DepositType * value to be "None". * @subpackage Enumerations @@ -14,21 +14,29 @@ class DepositTypeCodeType { /** * Constant for value 'None' + * Meta information extracted from the WSDL + * - documentation: None * @return string 'None' */ const VALUE_NONE = 'None'; /** * Constant for value 'OtherMethod' + * Meta information extracted from the WSDL + * - documentation: Other Method * @return string 'OtherMethod' */ const VALUE_OTHER_METHOD = 'OtherMethod'; /** * Constant for value 'FastDeposit' + * Meta information extracted from the WSDL + * - documentation: Fast Deposit. * @return string 'FastDeposit' */ const VALUE_FAST_DEPOSIT = 'FastDeposit'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/DetailLevelCodeType.php b/src/EnumType/DetailLevelCodeType.php index 6b3ee1f..50f9542 100644 --- a/src/EnumType/DetailLevelCodeType.php +++ b/src/EnumType/DetailLevelCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for DetailLevelCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: DetailLevelCodeType * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class DetailLevelCodeType { /** * Constant for value 'ReturnAll' + * Meta information extracted from the WSDL + * - documentation: Return in response message all detail levels. * @return string 'ReturnAll' */ const VALUE_RETURN_ALL = 'ReturnAll'; /** * Constant for value 'ItemReturnDescription' + * Meta information extracted from the WSDL + * - documentation: Return item description. * @return string 'ItemReturnDescription' */ const VALUE_ITEM_RETURN_DESCRIPTION = 'ItemReturnDescription'; /** * Constant for value 'ItemReturnAttributes' + * Meta information extracted from the WSDL + * - documentation: Return attributes as part of the item. * @return string 'ItemReturnAttributes' */ const VALUE_ITEM_RETURN_ATTRIBUTES = 'ItemReturnAttributes'; diff --git a/src/EnumType/EscrowCodeType.php b/src/EnumType/EscrowCodeType.php index de2bf18..a8d3ebf 100644 --- a/src/EnumType/EscrowCodeType.php +++ b/src/EnumType/EscrowCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for EscrowCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: EscrowCodeType These are the possible codes to describe Escrow options. * @subpackage Enumerations * @author WsdlToPhp @@ -13,21 +13,29 @@ class EscrowCodeType { /** * Constant for value 'ByBuyer' + * Meta information extracted from the WSDL + * - documentation: By Buyer * @return string 'ByBuyer' */ const VALUE_BY_BUYER = 'ByBuyer'; /** * Constant for value 'BySeller' + * Meta information extracted from the WSDL + * - documentation: By Seller. * @return string 'BySeller' */ const VALUE_BY_SELLER = 'BySeller'; /** * Constant for value 'None' + * Meta information extracted from the WSDL + * - documentation: None. * @return string 'None' */ const VALUE_NONE = 'None'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/FMFPendingTransactionActionType.php b/src/EnumType/FMFPendingTransactionActionType.php index 052599e..bdd3568 100644 --- a/src/EnumType/FMFPendingTransactionActionType.php +++ b/src/EnumType/FMFPendingTransactionActionType.php @@ -4,7 +4,7 @@ /** * This class stands for FMFPendingTransactionActionType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This is various actions that a merchant can take on a FMF Pending Transaction. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/FeedbackRatingStarCodeType.php b/src/EnumType/FeedbackRatingStarCodeType.php index 90f643a..b365586 100644 --- a/src/EnumType/FeedbackRatingStarCodeType.php +++ b/src/EnumType/FeedbackRatingStarCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for FeedbackRatingStarCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: FeedbackRatingStarCodeType * @subpackage Enumerations * @author WsdlToPhp @@ -13,61 +13,85 @@ class FeedbackRatingStarCodeType { /** * Constant for value 'None' + * Meta information extracted from the WSDL + * - documentation: No graphic displayed * @return string 'None' */ const VALUE_NONE = 'None'; /** * Constant for value 'Yellow' + * Meta information extracted from the WSDL + * - documentation: Yellow Star * @return string 'Yellow' */ const VALUE_YELLOW = 'Yellow'; /** * Constant for value 'Turquoise' + * Meta information extracted from the WSDL + * - documentation: Turquoise Star * @return string 'Turquoise' */ const VALUE_TURQUOISE = 'Turquoise'; /** * Constant for value 'Purple' + * Meta information extracted from the WSDL + * - documentation: Purple Star * @return string 'Purple' */ const VALUE_PURPLE = 'Purple'; /** * Constant for value 'Red' + * Meta information extracted from the WSDL + * - documentation: Red Star * @return string 'Red' */ const VALUE_RED = 'Red'; /** * Constant for value 'Green' + * Meta information extracted from the WSDL + * - documentation: Green Star * @return string 'Green' */ const VALUE_GREEN = 'Green'; /** * Constant for value 'YellowShooting' + * Meta information extracted from the WSDL + * - documentation: Yellow Shooting Star * @return string 'YellowShooting' */ const VALUE_YELLOW_SHOOTING = 'YellowShooting'; /** * Constant for value 'TurquoiseShooting' + * Meta information extracted from the WSDL + * - documentation: Turquoise Shooting Star * @return string 'TurquoiseShooting' */ const VALUE_TURQUOISE_SHOOTING = 'TurquoiseShooting'; /** * Constant for value 'PurpleShooting' + * Meta information extracted from the WSDL + * - documentation: Purple Shooting Star * @return string 'PurpleShooting' */ const VALUE_PURPLE_SHOOTING = 'PurpleShooting'; /** * Constant for value 'RedShooting' + * Meta information extracted from the WSDL + * - documentation: Red Shooting Star * @return string 'RedShooting' */ const VALUE_RED_SHOOTING = 'RedShooting'; /** * Constant for value 'Blue' + * Meta information extracted from the WSDL + * - documentation: Blue Star * @return string 'Blue' */ const VALUE_BLUE = 'Blue'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/GalleryTypeCodeType.php b/src/EnumType/GalleryTypeCodeType.php index 2ee8bb1..bf0cda7 100644 --- a/src/EnumType/GalleryTypeCodeType.php +++ b/src/EnumType/GalleryTypeCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for GalleryTypeCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: GalleryTypeCodeType Specifies the codes for various properties of an item. * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class GalleryTypeCodeType { /** * Constant for value 'Featured' + * Meta information extracted from the WSDL + * - documentation: Indicates whether it is a featured item. * @return string 'Featured' */ const VALUE_FEATURED = 'Featured'; /** * Constant for value 'Gallery' + * Meta information extracted from the WSDL + * - documentation: Include in the gallery. * @return string 'Gallery' */ const VALUE_GALLERY = 'Gallery'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/GeneralPaymentMethodCodeType.php b/src/EnumType/GeneralPaymentMethodCodeType.php index d2fd325..593c1c0 100644 --- a/src/EnumType/GeneralPaymentMethodCodeType.php +++ b/src/EnumType/GeneralPaymentMethodCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for GeneralPaymentMethodCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: GeneralPaymentMethodCodeType - Type declaration to be used by other schema. This code identifies the general types of payment means, e.g., used by payment service provider applications. * @subpackage Enumerations * @author WsdlToPhp @@ -13,31 +13,43 @@ class GeneralPaymentMethodCodeType { /** * Constant for value 'Other' + * Meta information extracted from the WSDL + * - documentation: Custom Code * @return string 'Other' */ const VALUE_OTHER = 'Other'; /** * Constant for value 'Echeck' + * Meta information extracted from the WSDL + * - documentation: Electronic check. * @return string 'Echeck' */ const VALUE_ECHECK = 'Echeck'; /** * Constant for value 'ACH' + * Meta information extracted from the WSDL + * - documentation: ACH. * @return string 'ACH' */ const VALUE_ACH = 'ACH'; /** * Constant for value 'Creditcard' + * Meta information extracted from the WSDL + * - documentation: Credit-card. * @return string 'Creditcard' */ const VALUE_CREDITCARD = 'Creditcard'; /** * Constant for value 'PayPalBalance' + * Meta information extracted from the WSDL + * - documentation: Pay balance. * @return string 'PayPalBalance' */ const VALUE_PAY_PAL_BALANCE = 'PayPalBalance'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/GiftServicesCodeType.php b/src/EnumType/GiftServicesCodeType.php index da2c77b..c8ec06c 100644 --- a/src/EnumType/GiftServicesCodeType.php +++ b/src/EnumType/GiftServicesCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for GiftServicesCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: GiftServicesCodeType - Type declaration to be used by other schema's. Specifies the codes for the various Gift Services offered by sellers. If any of the Gift Services are offered by the seller, the generic gift icon should be used * to display the item: http://pics.ebay.com/aw/pics/gift/gift.gif * @subpackage Enumerations @@ -14,21 +14,29 @@ class GiftServicesCodeType { /** * Constant for value 'GiftExpressShipping' + * Meta information extracted from the WSDL + * - documentation: indicates that the seller is offering to ship the item via an express shipping method as described in the item description. * @return string 'GiftExpressShipping' */ const VALUE_GIFT_EXPRESS_SHIPPING = 'GiftExpressShipping'; /** * Constant for value 'GiftShipToRecipient' + * Meta information extracted from the WSDL + * - documentation: indicates that the seller is offering to ship to the gift recipient, not the buyer, when payment clears. * @return string 'GiftShipToRecipient' */ const VALUE_GIFT_SHIP_TO_RECIPIENT = 'GiftShipToRecipient'; /** * Constant for value 'GiftWrap' + * Meta information extracted from the WSDL + * - documentation: indicates that the seller is offering to wrap the item (and optionally include a card) as described in the item description. * @return string 'GiftWrap' */ const VALUE_GIFT_WRAP = 'GiftWrap'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/HitCounterCodeType.php b/src/EnumType/HitCounterCodeType.php index 27becee..63ad6f3 100644 --- a/src/EnumType/HitCounterCodeType.php +++ b/src/EnumType/HitCounterCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for HitCounterCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: HitCounterCodeType This code identifies the HitCounter codes used to specify whether a hit counter is used for the item's listing page and, if so, what type. * @subpackage Enumerations * @author WsdlToPhp @@ -13,26 +13,36 @@ class HitCounterCodeType { /** * Constant for value 'NoHitCounter' + * Meta information extracted from the WSDL + * - documentation: No hit counter * @return string 'NoHitCounter' */ const VALUE_NO_HIT_COUNTER = 'NoHitCounter'; /** * Constant for value 'HonestyStyle' + * Meta information extracted from the WSDL + * - documentation: Honesty Style Hit Counter * @return string 'HonestyStyle' */ const VALUE_HONESTY_STYLE = 'HonestyStyle'; /** * Constant for value 'GreenLED' + * Meta information extracted from the WSDL + * - documentation: Green LED counter. * @return string 'GreenLED' */ const VALUE_GREEN_LED = 'GreenLED'; /** * Constant for value 'Hidden' + * Meta information extracted from the WSDL + * - documentation: Hidden counter. * @return string 'Hidden' */ const VALUE_HIDDEN = 'Hidden'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/IncentiveAppliedStatusType.php b/src/EnumType/IncentiveAppliedStatusType.php index 95f295a..d3f65ef 100644 --- a/src/EnumType/IncentiveAppliedStatusType.php +++ b/src/EnumType/IncentiveAppliedStatusType.php @@ -4,7 +4,7 @@ /** * This class stands for IncentiveAppliedStatusType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This defines if the incentive is applied successfully or not. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/IncentiveRequestCodeType.php b/src/EnumType/IncentiveRequestCodeType.php index cdd31c4..7f8efb6 100644 --- a/src/EnumType/IncentiveRequestCodeType.php +++ b/src/EnumType/IncentiveRequestCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for IncentiveRequestCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IncentiveRequestType This identifies the type of request for the API call. The type of request may be used to determine whether the request is for evaluating incentives in pre-checkout or in-checkout phase. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/IncentiveRequestDetailLevelCodeType.php b/src/EnumType/IncentiveRequestDetailLevelCodeType.php index c847dd1..f9f38bb 100644 --- a/src/EnumType/IncentiveRequestDetailLevelCodeType.php +++ b/src/EnumType/IncentiveRequestDetailLevelCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for IncentiveRequestDetailLevelCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IncentiveRequestDetailLevelType This identifies the granularity of information requested by the client application. This information will be used to define the contents and details of the response. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/IncentiveSiteAppliedOnType.php b/src/EnumType/IncentiveSiteAppliedOnType.php index 1871116..7f456bf 100644 --- a/src/EnumType/IncentiveSiteAppliedOnType.php +++ b/src/EnumType/IncentiveSiteAppliedOnType.php @@ -4,7 +4,7 @@ /** * This class stands for IncentiveSiteAppliedOnType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This defines if the incentive is applied on Ebay or PayPal. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/IncentiveTypeCodeType.php b/src/EnumType/IncentiveTypeCodeType.php index d4c345b..98230bc 100644 --- a/src/EnumType/IncentiveTypeCodeType.php +++ b/src/EnumType/IncentiveTypeCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for IncentiveTypeCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IncentiveType This identifies the type of INCENTIVE for the redemption code. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/InsuranceOptionCodeType.php b/src/EnumType/InsuranceOptionCodeType.php index a5dccaa..f998137 100644 --- a/src/EnumType/InsuranceOptionCodeType.php +++ b/src/EnumType/InsuranceOptionCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for InsuranceOptionCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: InsuranceOptionCodeType These are the possible codes to describe insurance option as part of shipping service. * @subpackage Enumerations * @author WsdlToPhp @@ -13,26 +13,36 @@ class InsuranceOptionCodeType { /** * Constant for value 'Optional' + * Meta information extracted from the WSDL + * - documentation: Insurance optional. * @return string 'Optional' */ const VALUE_OPTIONAL = 'Optional'; /** * Constant for value 'Required' + * Meta information extracted from the WSDL + * - documentation: Insurance required. * @return string 'Required' */ const VALUE_REQUIRED = 'Required'; /** * Constant for value 'NotOffered' + * Meta information extracted from the WSDL + * - documentation: Insurance not offered. * @return string 'NotOffered' */ const VALUE_NOT_OFFERED = 'NotOffered'; /** * Constant for value 'IncludedInShippingHandling' + * Meta information extracted from the WSDL + * - documentation: Insurance included in Shipping and Handling costs. * @return string 'IncludedInShippingHandling' */ const VALUE_INCLUDED_IN_SHIPPING_HANDLING = 'IncludedInShippingHandling'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ItemCategoryType.php b/src/EnumType/ItemCategoryType.php index a715834..87ccfc0 100644 --- a/src/EnumType/ItemCategoryType.php +++ b/src/EnumType/ItemCategoryType.php @@ -11,11 +11,15 @@ class ItemCategoryType { /** * Constant for value 'Physical' + * Meta information extracted from the WSDL + * - documentation: Physical * @return string 'Physical' */ const VALUE_PHYSICAL = 'Physical'; /** * Constant for value 'Digital' + * Meta information extracted from the WSDL + * - documentation: Digital * @return string 'Digital' */ const VALUE_DIGITAL = 'Digital'; diff --git a/src/EnumType/LandingPageType.php b/src/EnumType/LandingPageType.php index d2f0b42..cb39c82 100644 --- a/src/EnumType/LandingPageType.php +++ b/src/EnumType/LandingPageType.php @@ -4,7 +4,7 @@ /** * This class stands for LandingPageType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: LandingPageType This is the PayPal payment Landing Page details type (used by Express Checkout) * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/ListingDurationCodeType.php b/src/EnumType/ListingDurationCodeType.php index 9c7f86f..726f385 100644 --- a/src/EnumType/ListingDurationCodeType.php +++ b/src/EnumType/ListingDurationCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ListingDurationCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ListingDurationCodeType These are the possible codes to describe the number of days the auction will be active. Must be one of the values 3, 5, 7, or 10 for auction and basic Fixed-Price (Type 9) listings. Must be 30, 60, 90, 120, or * GTC for Stores Fixed-Price (Type 7) listings. Specify GTC for the Good 'Til Cancel feature (eBay Stores items only). * @subpackage Enumerations @@ -14,56 +14,78 @@ class ListingDurationCodeType { /** * Constant for value 'Days_1' + * Meta information extracted from the WSDL + * - documentation: 1 Day * @return string 'Days_1' */ const VALUE_DAYS_1 = 'Days_1'; /** * Constant for value 'Days_3' + * Meta information extracted from the WSDL + * - documentation: 3 Days * @return string 'Days_3' */ const VALUE_DAYS_3 = 'Days_3'; /** * Constant for value 'Days_5' + * Meta information extracted from the WSDL + * - documentation: 5 Days * @return string 'Days_5' */ const VALUE_DAYS_5 = 'Days_5'; /** * Constant for value 'Days_7' + * Meta information extracted from the WSDL + * - documentation: 7 Days * @return string 'Days_7' */ const VALUE_DAYS_7 = 'Days_7'; /** * Constant for value 'Days_10' + * Meta information extracted from the WSDL + * - documentation: 10 Days * @return string 'Days_10' */ const VALUE_DAYS_10 = 'Days_10'; /** * Constant for value 'Days_30' + * Meta information extracted from the WSDL + * - documentation: 30 Days * @return string 'Days_30' */ const VALUE_DAYS_30 = 'Days_30'; /** * Constant for value 'Days_60' + * Meta information extracted from the WSDL + * - documentation: 60 Days * @return string 'Days_60' */ const VALUE_DAYS_60 = 'Days_60'; /** * Constant for value 'Days_90' + * Meta information extracted from the WSDL + * - documentation: 90 Days * @return string 'Days_90' */ const VALUE_DAYS_90 = 'Days_90'; /** * Constant for value 'Days_120' + * Meta information extracted from the WSDL + * - documentation: 120 Days * @return string 'Days_120' */ const VALUE_DAYS_120 = 'Days_120'; /** * Constant for value 'GTC' + * Meta information extracted from the WSDL + * - documentation: GTC * @return string 'GTC' */ const VALUE_GTC = 'GTC'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ListingEnhancementsCodeType.php b/src/EnumType/ListingEnhancementsCodeType.php index f91165e..1564f83 100644 --- a/src/EnumType/ListingEnhancementsCodeType.php +++ b/src/EnumType/ListingEnhancementsCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ListingEnhancementsCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ListingEnhancementsCodeType Specifies the codes for various properties of an item. * @subpackage Enumerations * @author WsdlToPhp @@ -13,31 +13,43 @@ class ListingEnhancementsCodeType { /** * Constant for value 'Border' + * Meta information extracted from the WSDL + * - documentation: Indicates whether an item will be displayed with a border that will go around the item (e.g., for category-based search result page or store search that brings up multiple items) to differentiate it from the rest of list. * @return string 'Border' */ const VALUE_BORDER = 'Border'; /** * Constant for value 'BoldTitle' + * Meta information extracted from the WSDL + * - documentation: Indicates whether the bolding option was used. * @return string 'BoldTitle' */ const VALUE_BOLD_TITLE = 'BoldTitle'; /** * Constant for value 'Featured' + * Meta information extracted from the WSDL + * - documentation: Indicates whether it is a featured item. * @return string 'Featured' */ const VALUE_FEATURED = 'Featured'; /** * Constant for value 'Highlight' + * Meta information extracted from the WSDL + * - documentation: Indicates item's listing is highlighted. * @return string 'Highlight' */ const VALUE_HIGHLIGHT = 'Highlight'; /** * Constant for value 'HomePageFeatured' + * Meta information extracted from the WSDL + * - documentation: Indicates item's listing is home page featured. * @return string 'HomePageFeatured' */ const VALUE_HOME_PAGE_FEATURED = 'HomePageFeatured'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ListingTypeCodeType.php b/src/EnumType/ListingTypeCodeType.php index 70b44cb..f44a282 100644 --- a/src/EnumType/ListingTypeCodeType.php +++ b/src/EnumType/ListingTypeCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ListingTypeCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ListingTypeCodeType - Type declaration to be used by other schema. This includes codes indicating the type of auction for the listed item. * @subpackage Enumerations * @author WsdlToPhp @@ -13,46 +13,64 @@ class ListingTypeCodeType { /** * Constant for value 'Unknown' + * Meta information extracted from the WSDL + * - documentation: Unknown Listing Type * @return string 'Unknown' */ const VALUE_UNKNOWN = 'Unknown'; /** * Constant for value 'Chinese' + * Meta information extracted from the WSDL + * - documentation: Chinese auction * @return string 'Chinese' */ const VALUE_CHINESE = 'Chinese'; /** * Constant for value 'Dutch' + * Meta information extracted from the WSDL + * - documentation: Dutch auction * @return string 'Dutch' */ const VALUE_DUTCH = 'Dutch'; /** * Constant for value 'Live' + * Meta information extracted from the WSDL + * - documentation: Live Auctions-type auction * @return string 'Live' */ const VALUE_LIVE = 'Live'; /** * Constant for value 'AdType' + * Meta information extracted from the WSDL + * - documentation: Ad type auction * @return string 'AdType' */ const VALUE_AD_TYPE = 'AdType'; /** * Constant for value 'StoresFixedPrice' + * Meta information extracted from the WSDL + * - documentation: Stores Fixed-price auction (US only) * @return string 'StoresFixedPrice' */ const VALUE_STORES_FIXED_PRICE = 'StoresFixedPrice'; /** * Constant for value 'PersonalOffer' + * Meta information extracted from the WSDL + * - documentation: Personal Offer auction * @return string 'PersonalOffer' */ const VALUE_PERSONAL_OFFER = 'PersonalOffer'; /** * Constant for value 'FixedPriceItem' + * Meta information extracted from the WSDL + * - documentation: Fixed Price item ("BIN only"). * @return string 'FixedPriceItem' */ const VALUE_FIXED_PRICE_ITEM = 'FixedPriceItem'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/LocationType.php b/src/EnumType/LocationType.php index eb6f6cd..d75d65e 100644 --- a/src/EnumType/LocationType.php +++ b/src/EnumType/LocationType.php @@ -4,7 +4,7 @@ /** * This class stands for LocationType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Location Type * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class LocationType { /** * Constant for value 'Consumer' + * Meta information extracted from the WSDL + * - documentation: Consumer * @return string 'Consumer' */ const VALUE_CONSUMER = 'Consumer'; /** * Constant for value 'Store' + * Meta information extracted from the WSDL + * - documentation: Store * @return string 'Store' */ const VALUE_STORE = 'Store'; /** * Constant for value 'PickupDropoff' + * Meta information extracted from the WSDL + * - documentation: PickupDropOff * @return string 'PickupDropoff' */ const VALUE_PICKUP_DROPOFF = 'PickupDropoff'; diff --git a/src/EnumType/MarketingCategoryType.php b/src/EnumType/MarketingCategoryType.php index 78ea7b9..bf252d1 100644 --- a/src/EnumType/MarketingCategoryType.php +++ b/src/EnumType/MarketingCategoryType.php @@ -4,7 +4,7 @@ /** * This class stands for MarketingCategoryType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MarketingCategoryType * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/MatchStatusCodeType.php b/src/EnumType/MatchStatusCodeType.php index f82e9ea..9bf0354 100644 --- a/src/EnumType/MatchStatusCodeType.php +++ b/src/EnumType/MatchStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for MatchStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MatchStatusCodeType This is the PayPal (street/zip) match code * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/MerchandizingPrefCodeType.php b/src/EnumType/MerchandizingPrefCodeType.php index 2b338e7..0ea4f23 100644 --- a/src/EnumType/MerchandizingPrefCodeType.php +++ b/src/EnumType/MerchandizingPrefCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for MerchandizingPrefCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MerchandizingPrefCodeType * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class MerchandizingPrefCodeType { /** * Constant for value 'OptIn' + * Meta information extracted from the WSDL + * - documentation: OptIn * @return string 'OptIn' */ const VALUE_OPT_IN = 'OptIn'; /** * Constant for value 'OptOut' + * Meta information extracted from the WSDL + * - documentation: OptOut * @return string 'OptOut' */ const VALUE_OPT_OUT = 'OptOut'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/MerchantPullPaymentCodeType.php b/src/EnumType/MerchantPullPaymentCodeType.php index 9ce23d0..7180c00 100644 --- a/src/EnumType/MerchantPullPaymentCodeType.php +++ b/src/EnumType/MerchantPullPaymentCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for MerchantPullPaymentCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MerchantPullPaymentCodeType Type of Payment to be initiated by the merchant * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/MerchantPullStatusCodeType.php b/src/EnumType/MerchantPullStatusCodeType.php index e91ce3d..9cac48d 100644 --- a/src/EnumType/MerchantPullStatusCodeType.php +++ b/src/EnumType/MerchantPullStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for MerchantPullStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MerchantPullStatusCodeType Status of the merchant pull * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/MobilePaymentCodeType.php b/src/EnumType/MobilePaymentCodeType.php index f06931c..adaffeb 100644 --- a/src/EnumType/MobilePaymentCodeType.php +++ b/src/EnumType/MobilePaymentCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for MobilePaymentCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MobilePaymentCodeType These are the accepted types of mobile payments * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/MobileRecipientCodeType.php b/src/EnumType/MobileRecipientCodeType.php index 96cf96a..5f2fe6b 100644 --- a/src/EnumType/MobileRecipientCodeType.php +++ b/src/EnumType/MobileRecipientCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for MobileRecipientCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MobileRecipientCodeType These are the accepted types of recipients for mobile-originated transactions * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/ModifyCodeType.php b/src/EnumType/ModifyCodeType.php index 1280762..8d5f474 100644 --- a/src/EnumType/ModifyCodeType.php +++ b/src/EnumType/ModifyCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ModifyCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ModifyCodeType This code identifies the types of modification you can make on an object. account. * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class ModifyCodeType { /** * Constant for value 'Dropped' + * Meta information extracted from the WSDL + * - documentation: Indicate filed is to be dropped. * @return string 'Dropped' */ const VALUE_DROPPED = 'Dropped'; /** * Constant for value 'Modify' + * Meta information extracted from the WSDL + * - documentation: Indicate filed is to be modified. * @return string 'Modify' */ const VALUE_MODIFY = 'Modify'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/POSTransactionCodeType.php b/src/EnumType/POSTransactionCodeType.php index ce0ba3e..b33e16c 100644 --- a/src/EnumType/POSTransactionCodeType.php +++ b/src/EnumType/POSTransactionCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for POSTransactionCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: POSTransactionCodeType POS Transaction Code Type. F for Forced Post Transaction and S for Single Call Checkout * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/PayPalUserStatusCodeType.php b/src/EnumType/PayPalUserStatusCodeType.php index 97f5486..0cc2455 100644 --- a/src/EnumType/PayPalUserStatusCodeType.php +++ b/src/EnumType/PayPalUserStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PayPalUserStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PayPalUserStatusCodeType PayPal status of a user Address * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/PaymentActionCodeType.php b/src/EnumType/PaymentActionCodeType.php index 955238c..115cc81 100644 --- a/src/EnumType/PaymentActionCodeType.php +++ b/src/EnumType/PaymentActionCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PaymentActionCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentDetailsCodeType This is the PayPal payment details type (used by DCC and Express Checkout) * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/PaymentCategoryType.php b/src/EnumType/PaymentCategoryType.php index cf249c4..e557b6d 100644 --- a/src/EnumType/PaymentCategoryType.php +++ b/src/EnumType/PaymentCategoryType.php @@ -4,7 +4,7 @@ /** * This class stands for PaymentCategoryType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Category of payment like international shipping * @subpackage Enumerations * @author WsdlToPhp @@ -13,21 +13,29 @@ class PaymentCategoryType { /** * Constant for value 'InternationalShipping' + * Meta information extracted from the WSDL + * - documentation: Internalnation Shipping * @return string 'InternationalShipping' */ const VALUE_INTERNATIONAL_SHIPPING = 'InternationalShipping'; /** * Constant for value 'LocalDelivery' + * Meta information extracted from the WSDL + * - documentation: LocalDelivery * @return string 'LocalDelivery' */ const VALUE_LOCAL_DELIVERY = 'LocalDelivery'; /** * Constant for value 'BOPIS' + * Meta information extracted from the WSDL + * - documentation: BOPIS * @return string 'BOPIS' */ const VALUE_BOPIS = 'BOPIS'; /** * Constant for value 'PUDO' + * Meta information extracted from the WSDL + * - documentation: PUDO * @return string 'PUDO' */ const VALUE_PUDO = 'PUDO'; diff --git a/src/EnumType/PaymentCodeType.php b/src/EnumType/PaymentCodeType.php index c173c71..501b7e9 100644 --- a/src/EnumType/PaymentCodeType.php +++ b/src/EnumType/PaymentCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PaymentCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentCodeType This is the type of PayPal payment which matches the output from IPN. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/PaymentNotificationServiceCodeType.php b/src/EnumType/PaymentNotificationServiceCodeType.php index fcfc588..8efb871 100644 --- a/src/EnumType/PaymentNotificationServiceCodeType.php +++ b/src/EnumType/PaymentNotificationServiceCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PaymentNotificationServiceCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentNotificationService For SetPaymentStatus API, this value should always be eBayCN. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/PaymentReasonType.php b/src/EnumType/PaymentReasonType.php index 71f8367..eaa5cd3 100644 --- a/src/EnumType/PaymentReasonType.php +++ b/src/EnumType/PaymentReasonType.php @@ -4,7 +4,7 @@ /** * This class stands for PaymentReasonType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentReasonType This is the Payment Reason type (used by DoRT and SetEC for Refund of PI transaction, eBay return shipment, external dispute) * @subpackage Enumerations * @author WsdlToPhp @@ -23,6 +23,8 @@ class PaymentReasonType const VALUE_REFUND = 'Refund'; /** * Constant for value 'ReturnShipment' + * Meta information extracted from the WSDL + * - documentation: Identifies a BA flow for return shipment * @return string 'ReturnShipment' */ const VALUE_RETURN_SHIPMENT = 'ReturnShipment'; diff --git a/src/EnumType/PaymentStatusCodeType.php b/src/EnumType/PaymentStatusCodeType.php index 3fa5615..58cefdb 100644 --- a/src/EnumType/PaymentStatusCodeType.php +++ b/src/EnumType/PaymentStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PaymentStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentStatusCodeType This is the status of a PayPal Payment which matches the output from IPN * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/PaymentTransactionClassCodeType.php b/src/EnumType/PaymentTransactionClassCodeType.php index d67fbdf..2d1bb94 100644 --- a/src/EnumType/PaymentTransactionClassCodeType.php +++ b/src/EnumType/PaymentTransactionClassCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PaymentTransactionClassCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentTransactionClassCodeType The Type of PayPal payment. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/PaymentTransactionCodeType.php b/src/EnumType/PaymentTransactionCodeType.php index 532ce7e..9434d4b 100644 --- a/src/EnumType/PaymentTransactionCodeType.php +++ b/src/EnumType/PaymentTransactionCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PaymentTransactionCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentTransactionCodeType This is the type of a PayPal of which matches the output from IPN * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/PaymentTransactionStatusCodeType.php b/src/EnumType/PaymentTransactionStatusCodeType.php index 0501fed..7cd3437 100644 --- a/src/EnumType/PaymentTransactionStatusCodeType.php +++ b/src/EnumType/PaymentTransactionStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PaymentTransactionStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentTransactionStatusCodeType The status of the PayPal payment. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/PendingStatusCodeType.php b/src/EnumType/PendingStatusCodeType.php index 3f1bead..6f3166b 100644 --- a/src/EnumType/PendingStatusCodeType.php +++ b/src/EnumType/PendingStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PendingStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PendingStatusCodeType The pending status for a PayPal Payment transaction which matches the output from IPN * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/PercentageRevenueFromOnlineSalesType.php b/src/EnumType/PercentageRevenueFromOnlineSalesType.php index a0b9d91..5fdc6ea 100644 --- a/src/EnumType/PercentageRevenueFromOnlineSalesType.php +++ b/src/EnumType/PercentageRevenueFromOnlineSalesType.php @@ -4,7 +4,7 @@ /** * This class stands for PercentageRevenueFromOnlineSalesType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PercentageRevenueFromOnlineSalesType Enumeration Meaning PercentageRevenueFromOnlineSales-Not-Applicable PercentageRevenueFromOnlineSales-Range1 Less than 25% PercentageRevenueFromOnlineSales-Range2 25% to 50% * PercentageRevenueFromOnlineSales-Range3 50% to 75% PercentageRevenueFromOnlineSales-Range4 75% to 100% * @subpackage Enumerations diff --git a/src/EnumType/PhotoDisplayCodeType.php b/src/EnumType/PhotoDisplayCodeType.php index da4a5b4..2d45da3 100644 --- a/src/EnumType/PhotoDisplayCodeType.php +++ b/src/EnumType/PhotoDisplayCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PhotoDisplayCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PhotoDisplayCodeType These are types of display for photos used for PhotoHosting slide show. * @subpackage Enumerations * @author WsdlToPhp @@ -13,26 +13,36 @@ class PhotoDisplayCodeType { /** * Constant for value 'None' + * Meta information extracted from the WSDL + * - documentation: No special Picture Services features. * @return string 'None' */ const VALUE_NONE = 'None'; /** * Constant for value 'SlideShow' + * Meta information extracted from the WSDL + * - documentation: Slideshow of multiple pictures. * @return string 'SlideShow' */ const VALUE_SLIDE_SHOW = 'SlideShow'; /** * Constant for value 'SuperSize' + * Meta information extracted from the WSDL + * - documentation: Super-size format picture. * @return string 'SuperSize' */ const VALUE_SUPER_SIZE = 'SuperSize'; /** * Constant for value 'PicturePack' + * Meta information extracted from the WSDL + * - documentation: Picture Pack. * @return string 'PicturePack' */ const VALUE_PICTURE_PACK = 'PicturePack'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ProductCategoryType.php b/src/EnumType/ProductCategoryType.php index 5319a08..c93cbd2 100644 --- a/src/EnumType/ProductCategoryType.php +++ b/src/EnumType/ProductCategoryType.php @@ -11,116 +11,162 @@ class ProductCategoryType { /** * Constant for value 'Other' + * Meta information extracted from the WSDL + * - documentation: Other * @return string 'Other' */ const VALUE_OTHER = 'Other'; /** * Constant for value 'Airlines' + * Meta information extracted from the WSDL + * - documentation: Airlines * @return string 'Airlines' */ const VALUE_AIRLINES = 'Airlines'; /** * Constant for value 'Antiques' + * Meta information extracted from the WSDL + * - documentation: Antiques * @return string 'Antiques' */ const VALUE_ANTIQUES = 'Antiques'; /** * Constant for value 'Art' + * Meta information extracted from the WSDL + * - documentation: Art * @return string 'Art' */ const VALUE_ART = 'Art'; /** * Constant for value 'Cameras_Photos' + * Meta information extracted from the WSDL + * - documentation: Cameras & Photos * @return string 'Cameras_Photos' */ const VALUE_CAMERAS_PHOTOS = 'Cameras_Photos'; /** * Constant for value 'Cars_Boats_Vehicles_Parts' + * Meta information extracted from the WSDL + * - documentation: Cars, Boats, Vehicles & Parts * @return string 'Cars_Boats_Vehicles_Parts' */ const VALUE_CARS_BOATS_VEHICLES_PARTS = 'Cars_Boats_Vehicles_Parts'; /** * Constant for value 'CellPhones_Telecom' + * Meta information extracted from the WSDL + * - documentation: Cell Phones & Telecom * @return string 'CellPhones_Telecom' */ const VALUE_CELL_PHONES_TELECOM = 'CellPhones_Telecom'; /** * Constant for value 'Coins_PaperMoney' + * Meta information extracted from the WSDL + * - documentation: Coins & Paper Money * @return string 'Coins_PaperMoney' */ const VALUE_COINS_PAPER_MONEY = 'Coins_PaperMoney'; /** * Constant for value 'Collectibles' + * Meta information extracted from the WSDL + * - documentation: Collectibles * @return string 'Collectibles' */ const VALUE_COLLECTIBLES = 'Collectibles'; /** * Constant for value 'Computers_Networking' + * Meta information extracted from the WSDL + * - documentation: Computers & Networking * @return string 'Computers_Networking' */ const VALUE_COMPUTERS_NETWORKING = 'Computers_Networking'; /** * Constant for value 'ConsumerElectronics' + * Meta information extracted from the WSDL + * - documentation: Consumer Electronics * @return string 'ConsumerElectronics' */ const VALUE_CONSUMER_ELECTRONICS = 'ConsumerElectronics'; /** * Constant for value 'Jewelry_Watches' + * Meta information extracted from the WSDL + * - documentation: Jewelry & Watches * @return string 'Jewelry_Watches' */ const VALUE_JEWELRY_WATCHES = 'Jewelry_Watches'; /** * Constant for value 'MusicalInstruments' + * Meta information extracted from the WSDL + * - documentation: Musical Instruments * @return string 'MusicalInstruments' */ const VALUE_MUSICAL_INSTRUMENTS = 'MusicalInstruments'; /** * Constant for value 'RealEstate' + * Meta information extracted from the WSDL + * - documentation: Real Estate * @return string 'RealEstate' */ const VALUE_REAL_ESTATE = 'RealEstate'; /** * Constant for value 'SportsMemorabilia_Cards_FanShop' + * Meta information extracted from the WSDL + * - documentation: Sports Memorabilia, Cards & Fan Shop * @return string 'SportsMemorabilia_Cards_FanShop' */ const VALUE_SPORTS_MEMORABILIA_CARDS_FAN_SHOP = 'SportsMemorabilia_Cards_FanShop'; /** * Constant for value 'Stamps' + * Meta information extracted from the WSDL + * - documentation: Stamps * @return string 'Stamps' */ const VALUE_STAMPS = 'Stamps'; /** * Constant for value 'Tickets' + * Meta information extracted from the WSDL + * - documentation: Tickets * @return string 'Tickets' */ const VALUE_TICKETS = 'Tickets'; /** * Constant for value 'Travels' + * Meta information extracted from the WSDL + * - documentation: Travels * @return string 'Travels' */ const VALUE_TRAVELS = 'Travels'; /** * Constant for value 'Gambling' + * Meta information extracted from the WSDL + * - documentation: Gambling * @return string 'Gambling' */ const VALUE_GAMBLING = 'Gambling'; /** * Constant for value 'Alcohol' + * Meta information extracted from the WSDL + * - documentation: Alcohol * @return string 'Alcohol' */ const VALUE_ALCOHOL = 'Alcohol'; /** * Constant for value 'Tobacco' + * Meta information extracted from the WSDL + * - documentation: Tobacco * @return string 'Tobacco' */ const VALUE_TOBACCO = 'Tobacco'; /** * Constant for value 'MoneyTransfer' + * Meta information extracted from the WSDL + * - documentation: Money Transfer * @return string 'MoneyTransfer' */ const VALUE_MONEY_TRANSFER = 'MoneyTransfer'; /** * Constant for value 'Software' + * Meta information extracted from the WSDL + * - documentation: Software * @return string 'Software' */ const VALUE_SOFTWARE = 'Software'; diff --git a/src/EnumType/PromotionItemPriceTypeCodeType.php b/src/EnumType/PromotionItemPriceTypeCodeType.php index 0d000f4..2b7b86e 100644 --- a/src/EnumType/PromotionItemPriceTypeCodeType.php +++ b/src/EnumType/PromotionItemPriceTypeCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PromotionItemPriceTypeCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Cross Promotion Method. * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class PromotionItemPriceTypeCodeType { /** * Constant for value 'AuctionPrice' + * Meta information extracted from the WSDL + * - documentation: Auction Item * @return string 'AuctionPrice' */ const VALUE_AUCTION_PRICE = 'AuctionPrice'; /** * Constant for value 'BuyItNowPrice' + * Meta information extracted from the WSDL + * - documentation: Buy It Now * @return string 'BuyItNowPrice' */ const VALUE_BUY_IT_NOW_PRICE = 'BuyItNowPrice'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved. Do not use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/PromotionItemSelectionCodeType.php b/src/EnumType/PromotionItemSelectionCodeType.php index fbf7ec3..d4e4318 100644 --- a/src/EnumType/PromotionItemSelectionCodeType.php +++ b/src/EnumType/PromotionItemSelectionCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PromotionItemSelectionCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Cross Promotion Method. * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class PromotionItemSelectionCodeType { /** * Constant for value 'Manual' + * Meta information extracted from the WSDL + * - documentation: Manual Selection * @return string 'Manual' */ const VALUE_MANUAL = 'Manual'; /** * Constant for value 'Automatic' + * Meta information extracted from the WSDL + * - documentation: Automatic Selection * @return string 'Automatic' */ const VALUE_AUTOMATIC = 'Automatic'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved. Do not use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/PromotionMethodCodeType.php b/src/EnumType/PromotionMethodCodeType.php index b0a4706..914a9dc 100644 --- a/src/EnumType/PromotionMethodCodeType.php +++ b/src/EnumType/PromotionMethodCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PromotionMethodCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Cross Promotion Method. * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class PromotionMethodCodeType { /** * Constant for value 'CrossSell' + * Meta information extracted from the WSDL + * - documentation: Cross Sell * @return string 'CrossSell' */ const VALUE_CROSS_SELL = 'CrossSell'; /** * Constant for value 'UpSell' + * Meta information extracted from the WSDL + * - documentation: Up Sell * @return string 'UpSell' */ const VALUE_UP_SELL = 'UpSell'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved. Do not use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/PromotionSchemeCodeType.php b/src/EnumType/PromotionSchemeCodeType.php index fd498d2..110b7f7 100644 --- a/src/EnumType/PromotionSchemeCodeType.php +++ b/src/EnumType/PromotionSchemeCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PromotionSchemeCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Cross Promotion Context Promotion Scheme. * @subpackage Enumerations * @author WsdlToPhp @@ -13,21 +13,29 @@ class PromotionSchemeCodeType { /** * Constant for value 'ItemToItem' + * Meta information extracted from the WSDL + * - documentation: Item to Item Promotional Scheme * @return string 'ItemToItem' */ const VALUE_ITEM_TO_ITEM = 'ItemToItem'; /** * Constant for value 'ItemToStoreCat' + * Meta information extracted from the WSDL + * - documentation: Item to Item Store Scheme * @return string 'ItemToStoreCat' */ const VALUE_ITEM_TO_STORE_CAT = 'ItemToStoreCat'; /** * Constant for value 'StoreToStoreCat' + * Meta information extracted from the WSDL + * - documentation: Store to Store Scheme * @return string 'StoreToStoreCat' */ const VALUE_STORE_TO_STORE_CAT = 'StoreToStoreCat'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved. Do not use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/PurchasePurposeTypeCodeType.php b/src/EnumType/PurchasePurposeTypeCodeType.php index 66b60c5..3a3f5d2 100644 --- a/src/EnumType/PurchasePurposeTypeCodeType.php +++ b/src/EnumType/PurchasePurposeTypeCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for PurchasePurposeTypeCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PurchasePurposeTypeCodeType - Type declaration to be used by other schema. This code identifies the purpose of purchases, e.g., by a PayPal application. * @subpackage Enumerations * @author WsdlToPhp @@ -13,6 +13,8 @@ class PurchasePurposeTypeCodeType { /** * Constant for value 'Other' + * Meta information extracted from the WSDL + * - documentation: Custom Code * @return string 'Other' */ const VALUE_OTHER = 'Other'; @@ -53,6 +55,8 @@ class PurchasePurposeTypeCodeType const VALUE_E_BAY_BILLING = 'eBayBilling'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ReceiverInfoCodeType.php b/src/EnumType/ReceiverInfoCodeType.php index 5f1ce6a..9097302 100644 --- a/src/EnumType/ReceiverInfoCodeType.php +++ b/src/EnumType/ReceiverInfoCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ReceiverInfoCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ReceiverInfoCodeType Payee identifier type for MassPay API * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/RefundSourceCodeType.php b/src/EnumType/RefundSourceCodeType.php index dd78785..481ea11 100644 --- a/src/EnumType/RefundSourceCodeType.php +++ b/src/EnumType/RefundSourceCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for RefundSourceCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: RefundSourceCodeType This is the type of PayPal funding source that can be used for auto refund. any - Means Merchant doesn't have any preference. PayPal can use any available funding source (Balance or eCheck) default - Means * merchant's preferred funding source as configured in his profile. (Balance or eCheck) instant - Only Balance echeck - Merchant prefers echeck. If PayPal balance can cover the refund amount, we will use PayPal balance. (balance or eCheck) * @subpackage Enumerations diff --git a/src/EnumType/RefundType.php b/src/EnumType/RefundType.php index 7f6c765..ffd01cd 100644 --- a/src/EnumType/RefundType.php +++ b/src/EnumType/RefundType.php @@ -4,7 +4,7 @@ /** * This class stands for RefundType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: RefundType - Type declaration to be used by other schema. This code identifies the types of refund transactions supported. * - type: ns:RefundType * @subpackage Enumerations @@ -19,16 +19,22 @@ class RefundType const VALUE_OTHER = 'Other'; /** * Constant for value 'Full' + * Meta information extracted from the WSDL + * - documentation: Full Refund * @return string 'Full' */ const VALUE_FULL = 'Full'; /** * Constant for value 'Partial' + * Meta information extracted from the WSDL + * - documentation: Partial Refund * @return string 'Partial' */ const VALUE_PARTIAL = 'Partial'; /** * Constant for value 'ExternalDispute' + * Meta information extracted from the WSDL + * - documentation: External Dispute * @return string 'ExternalDispute' */ const VALUE_EXTERNAL_DISPUTE = 'ExternalDispute'; diff --git a/src/EnumType/ReversalReasonCodeType.php b/src/EnumType/ReversalReasonCodeType.php index 12382cb..f6405f5 100644 --- a/src/EnumType/ReversalReasonCodeType.php +++ b/src/EnumType/ReversalReasonCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ReversalReasonCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ReversalReasonCodeType Reason for a reversal on a PayPal transaction which matches the output from IPN * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/SalesVenueType.php b/src/EnumType/SalesVenueType.php index 75b73f9..4634d03 100644 --- a/src/EnumType/SalesVenueType.php +++ b/src/EnumType/SalesVenueType.php @@ -4,7 +4,7 @@ /** * This class stands for SalesVenueType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: SalesVenueType * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/SellerLevelCodeType.php b/src/EnumType/SellerLevelCodeType.php index 7772419..d9d0fd9 100644 --- a/src/EnumType/SellerLevelCodeType.php +++ b/src/EnumType/SellerLevelCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for SellerLevelCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: SellerLevelCodeType * @subpackage Enumerations * @author WsdlToPhp @@ -13,36 +13,50 @@ class SellerLevelCodeType { /** * Constant for value 'Bronze' + * Meta information extracted from the WSDL + * - documentation: Bronze * @return string 'Bronze' */ const VALUE_BRONZE = 'Bronze'; /** * Constant for value 'Silver' + * Meta information extracted from the WSDL + * - documentation: Silver * @return string 'Silver' */ const VALUE_SILVER = 'Silver'; /** * Constant for value 'Gold' + * Meta information extracted from the WSDL + * - documentation: Gold * @return string 'Gold' */ const VALUE_GOLD = 'Gold'; /** * Constant for value 'Platinum' + * Meta information extracted from the WSDL + * - documentation: Platinum * @return string 'Platinum' */ const VALUE_PLATINUM = 'Platinum'; /** * Constant for value 'Titanium' + * Meta information extracted from the WSDL + * - documentation: Titanium * @return string 'Titanium' */ const VALUE_TITANIUM = 'Titanium'; /** * Constant for value 'None' + * Meta information extracted from the WSDL + * - documentation: None * @return string 'None' */ const VALUE_NONE = 'None'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/SellerPaymentMethodCodeType.php b/src/EnumType/SellerPaymentMethodCodeType.php index 57da5e9..732dec0 100644 --- a/src/EnumType/SellerPaymentMethodCodeType.php +++ b/src/EnumType/SellerPaymentMethodCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for SellerPaymentMethodCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: SellerPaymentMethodCodeType These are payment methods that sellers can use to pay eBay. * @subpackage Enumerations * @author WsdlToPhp @@ -13,41 +13,57 @@ class SellerPaymentMethodCodeType { /** * Constant for value 'Other' + * Meta information extracted from the WSDL + * - documentation: No payment method specified - some other payment method. * @return string 'Other' */ const VALUE_OTHER = 'Other'; /** * Constant for value 'Amex' + * Meta information extracted from the WSDL + * - documentation: Amex * @return string 'Amex' */ const VALUE_AMEX = 'Amex'; /** * Constant for value 'Visa' + * Meta information extracted from the WSDL + * - documentation: Visa * @return string 'Visa' */ const VALUE_VISA = 'Visa'; /** * Constant for value 'Mastercard' + * Meta information extracted from the WSDL + * - documentation: Mastercard * @return string 'Mastercard' */ const VALUE_MASTERCARD = 'Mastercard'; /** * Constant for value 'Discover' + * Meta information extracted from the WSDL + * - documentation: Discover * @return string 'Discover' */ const VALUE_DISCOVER = 'Discover'; /** * Constant for value 'JCB' + * Meta information extracted from the WSDL + * - documentation: JCB * @return string 'JCB' */ const VALUE_JCB = 'JCB'; /** * Constant for value 'Diners' + * Meta information extracted from the WSDL + * - documentation: Diners * @return string 'Diners' */ const VALUE_DINERS = 'Diners'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/SeverityCodeType.php b/src/EnumType/SeverityCodeType.php index 663b809..bd16800 100644 --- a/src/EnumType/SeverityCodeType.php +++ b/src/EnumType/SeverityCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for SeverityCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: SeverityCodeType This code identifies the Severity code types in terms of whether there is an API-level error or warning that needs to be communicated to the client. * @subpackage Enumerations * @author WsdlToPhp @@ -13,21 +13,29 @@ class SeverityCodeType { /** * Constant for value 'Warning' + * Meta information extracted from the WSDL + * - documentation: Warning or informational error. * @return string 'Warning' */ const VALUE_WARNING = 'Warning'; /** * Constant for value 'Error' + * Meta information extracted from the WSDL + * - documentation: Application-level error. * @return string 'Error' */ const VALUE_ERROR = 'Error'; /** * Constant for value 'PartialSuccess' + * Meta information extracted from the WSDL + * - documentation: Partial Success. * @return string 'PartialSuccess' */ const VALUE_PARTIAL_SUCCESS = 'PartialSuccess'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ShippingOptionCodeType.php b/src/EnumType/ShippingOptionCodeType.php index 848f732..64872b2 100644 --- a/src/EnumType/ShippingOptionCodeType.php +++ b/src/EnumType/ShippingOptionCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ShippingOptionCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ShippingOptionCodeType These are the possible codes to describe shipping options in terms of where the seller is willing to ship the item. * @subpackage Enumerations * @author WsdlToPhp @@ -13,26 +13,36 @@ class ShippingOptionCodeType { /** * Constant for value 'SiteOnly' + * Meta information extracted from the WSDL + * - documentation: Site only. * @return string 'SiteOnly' */ const VALUE_SITE_ONLY = 'SiteOnly'; /** * Constant for value 'WorldWide' + * Meta information extracted from the WSDL + * - documentation: WorldWide. * @return string 'WorldWide' */ const VALUE_WORLD_WIDE = 'WorldWide'; /** * Constant for value 'SitePlusRegions' + * Meta information extracted from the WSDL + * - documentation: SitePlusRegions. * @return string 'SitePlusRegions' */ const VALUE_SITE_PLUS_REGIONS = 'SitePlusRegions'; /** * Constant for value 'WillNotShip' + * Meta information extracted from the WSDL + * - documentation: WillNotShip. * @return string 'WillNotShip' */ const VALUE_WILL_NOT_SHIP = 'WillNotShip'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ShippingPackageCodeType.php b/src/EnumType/ShippingPackageCodeType.php index 4152e7f..06ab90a 100644 --- a/src/EnumType/ShippingPackageCodeType.php +++ b/src/EnumType/ShippingPackageCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ShippingPackageCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ShippingPackageCodeType These are the possible codes to describe shipping package options. * @subpackage Enumerations * @author WsdlToPhp @@ -13,46 +13,64 @@ class ShippingPackageCodeType { /** * Constant for value 'None' + * Meta information extracted from the WSDL + * - documentation: None. * @return string 'None' */ const VALUE_NONE = 'None'; /** * Constant for value 'Letter' + * Meta information extracted from the WSDL + * - documentation: Letter. * @return string 'Letter' */ const VALUE_LETTER = 'Letter'; /** * Constant for value 'LargeEnvelope' + * Meta information extracted from the WSDL + * - documentation: LargeEnvelope * @return string 'LargeEnvelope' */ const VALUE_LARGE_ENVELOPE = 'LargeEnvelope'; /** * Constant for value 'USPSLargePack' + * Meta information extracted from the WSDL + * - documentation: USPS Large Package/Oversize 1 * @return string 'USPSLargePack' */ const VALUE_USPSLARGE_PACK = 'USPSLargePack'; /** * Constant for value 'VeryLargePack' + * Meta information extracted from the WSDL + * - documentation: Very Large Package/Oversize 2 * @return string 'VeryLargePack' */ const VALUE_VERY_LARGE_PACK = 'VeryLargePack'; /** * Constant for value 'UPSLetter' + * Meta information extracted from the WSDL + * - documentation: UPS Letter * @return string 'UPSLetter' */ const VALUE_UPSLETTER = 'UPSLetter'; /** * Constant for value 'USPSFlatRateEnvelope' + * Meta information extracted from the WSDL + * - documentation: USPS Flat Rate Envelope * @return string 'USPSFlatRateEnvelope' */ const VALUE_USPSFLAT_RATE_ENVELOPE = 'USPSFlatRateEnvelope'; /** * Constant for value 'PackageThickEnvelope' + * Meta information extracted from the WSDL + * - documentation: Package/thick envelope * @return string 'PackageThickEnvelope' */ const VALUE_PACKAGE_THICK_ENVELOPE = 'PackageThickEnvelope'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ShippingRatesTypeCodeType.php b/src/EnumType/ShippingRatesTypeCodeType.php index 563f3b7..ae0c37e 100644 --- a/src/EnumType/ShippingRatesTypeCodeType.php +++ b/src/EnumType/ShippingRatesTypeCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ShippingRatesTypeCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ShippingRatesTypeCodeType - Type declaration to be used by other schema. The includes the codes for shipping types supported by sellers to transport items sold to buyers. * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class ShippingRatesTypeCodeType { /** * Constant for value 'Flat' + * Meta information extracted from the WSDL + * - documentation: Flat shipping rate. * @return string 'Flat' */ const VALUE_FLAT = 'Flat'; /** * Constant for value 'Calculated' + * Meta information extracted from the WSDL + * - documentation: Calculated shipping rate. * @return string 'Calculated' */ const VALUE_CALCULATED = 'Calculated'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ShippingRegionCodeType.php b/src/EnumType/ShippingRegionCodeType.php index 6e76bc9..c508bf7 100644 --- a/src/EnumType/ShippingRegionCodeType.php +++ b/src/EnumType/ShippingRegionCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ShippingRegionCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ShippingRegion CodeType This code list module defines the enumerated types of regions for shipping items (i.e., a seller may support shipment of an item). * @subpackage Enumerations * @author WsdlToPhp @@ -13,51 +13,71 @@ class ShippingRegionCodeType { /** * Constant for value 'Africa' + * Meta information extracted from the WSDL + * - documentation: Africa * @return string 'Africa' */ const VALUE_AFRICA = 'Africa'; /** * Constant for value 'Asia' + * Meta information extracted from the WSDL + * - documentation: Asia * @return string 'Asia' */ const VALUE_ASIA = 'Asia'; /** * Constant for value 'Caribbean' + * Meta information extracted from the WSDL + * - documentation: Carribbean * @return string 'Caribbean' */ const VALUE_CARIBBEAN = 'Caribbean'; /** * Constant for value 'Europe' + * Meta information extracted from the WSDL + * - documentation: Europe * @return string 'Europe' */ const VALUE_EUROPE = 'Europe'; /** * Constant for value 'LatinAmerica' + * Meta information extracted from the WSDL + * - documentation: LatinAmerica * @return string 'LatinAmerica' */ const VALUE_LATIN_AMERICA = 'LatinAmerica'; /** * Constant for value 'MiddleEast' + * Meta information extracted from the WSDL + * - documentation: MiddleEast * @return string 'MiddleEast' */ const VALUE_MIDDLE_EAST = 'MiddleEast'; /** * Constant for value 'NorthAmerica' + * Meta information extracted from the WSDL + * - documentation: NorthAmerica * @return string 'NorthAmerica' */ const VALUE_NORTH_AMERICA = 'NorthAmerica'; /** * Constant for value 'Oceania' + * Meta information extracted from the WSDL + * - documentation: Oceania (i.e., Pacific region other than Asia) * @return string 'Oceania' */ const VALUE_OCEANIA = 'Oceania'; /** * Constant for value 'SouthAmerica' + * Meta information extracted from the WSDL + * - documentation: SouthAmerica * @return string 'SouthAmerica' */ const VALUE_SOUTH_AMERICA = 'SouthAmerica'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ShippingServiceCodeType.php b/src/EnumType/ShippingServiceCodeType.php index 1cbf82b..a4a4902 100644 --- a/src/EnumType/ShippingServiceCodeType.php +++ b/src/EnumType/ShippingServiceCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ShippingServiceCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ShippingServiceCodeType These are the possible codes to describe insurance option as part of shipping service. * @subpackage Enumerations * @author WsdlToPhp @@ -13,81 +13,113 @@ class ShippingServiceCodeType { /** * Constant for value 'UPSGround' + * Meta information extracted from the WSDL + * - documentation: UPS Ground * @return string 'UPSGround' */ const VALUE_UPSGROUND = 'UPSGround'; /** * Constant for value 'UPS3rdDay' + * Meta information extracted from the WSDL + * - documentation: UPS 3rd Day * @return string 'UPS3rdDay' */ const VALUE_UPS_3_RD_DAY = 'UPS3rdDay'; /** * Constant for value 'UPS2ndDay' + * Meta information extracted from the WSDL + * - documentation: UPS 2nd Day * @return string 'UPS2ndDay' */ const VALUE_UPS_2_ND_DAY = 'UPS2ndDay'; /** * Constant for value 'UPSNextDay' + * Meta information extracted from the WSDL + * - documentation: UPS Next Day. * @return string 'UPSNextDay' */ const VALUE_UPSNEXT_DAY = 'UPSNextDay'; /** * Constant for value 'USPSPriority' + * Meta information extracted from the WSDL + * - documentation: USPS Priority. * @return string 'USPSPriority' */ const VALUE_USPSPRIORITY = 'USPSPriority'; /** * Constant for value 'USPSParcel' + * Meta information extracted from the WSDL + * - documentation: USPS Parcel. * @return string 'USPSParcel' */ const VALUE_USPSPARCEL = 'USPSParcel'; /** * Constant for value 'USPSMedia' + * Meta information extracted from the WSDL + * - documentation: USPS Media. * @return string 'USPSMedia' */ const VALUE_USPSMEDIA = 'USPSMedia'; /** * Constant for value 'USPSFirstClass' + * Meta information extracted from the WSDL + * - documentation: USPS First Class * @return string 'USPSFirstClass' */ const VALUE_USPSFIRST_CLASS = 'USPSFirstClass'; /** * Constant for value 'ShippingMethodStandard' + * Meta information extracted from the WSDL + * - documentation: ShippingMethodStandard - used by merchant tool only * @return string 'ShippingMethodStandard' */ const VALUE_SHIPPING_METHOD_STANDARD = 'ShippingMethodStandard'; /** * Constant for value 'ShippingMethodExpress' + * Meta information extracted from the WSDL + * - documentation: ShippingMethodExpress- used by merchant tool only * @return string 'ShippingMethodExpress' */ const VALUE_SHIPPING_METHOD_EXPRESS = 'ShippingMethodExpress'; /** * Constant for value 'ShippingMethodNextDay' + * Meta information extracted from the WSDL + * - documentation: ShippingMethodNextDay- used by merchant tool only * @return string 'ShippingMethodNextDay' */ const VALUE_SHIPPING_METHOD_NEXT_DAY = 'ShippingMethodNextDay'; /** * Constant for value 'USPSExpressMail' + * Meta information extracted from the WSDL + * - documentation: USPS Express Mail * @return string 'USPSExpressMail' */ const VALUE_USPSEXPRESS_MAIL = 'USPSExpressMail'; /** * Constant for value 'USPSGround' + * Meta information extracted from the WSDL + * - documentation: USPS Ground * @return string 'USPSGround' */ const VALUE_USPSGROUND = 'USPSGround'; /** * Constant for value 'Download' + * Meta information extracted from the WSDL + * - documentation: Download. * @return string 'Download' */ const VALUE_DOWNLOAD = 'Download'; /** * Constant for value 'WillCall_Or_Pickup' + * Meta information extracted from the WSDL + * - documentation: Will Call Or Pick Up. * @return string 'WillCall_Or_Pickup' */ const VALUE_WILL_CALL_OR_PICKUP = 'WillCall_Or_Pickup'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/ShippingTermsCodeType.php b/src/EnumType/ShippingTermsCodeType.php index fd7eb3b..27f87a7 100644 --- a/src/EnumType/ShippingTermsCodeType.php +++ b/src/EnumType/ShippingTermsCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for ShippingTermsCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ShippingTermsCodeType - Type declaration to be used by other schema's. Shipping terms code describes who pays for the shipping of an item. These are the standard shipping terms, i.e., terms of delivery of an item. * @subpackage Enumerations * @author WsdlToPhp @@ -13,16 +13,22 @@ class ShippingTermsCodeType { /** * Constant for value 'SellerPays' + * Meta information extracted from the WSDL + * - documentation: Seller pays all shipping costs. * @return string 'SellerPays' */ const VALUE_SELLER_PAYS = 'SellerPays'; /** * Constant for value 'BuyerPays' + * Meta information extracted from the WSDL + * - documentation: Buyer pays all shipping costs. * @return string 'BuyerPays' */ const VALUE_BUYER_PAYS = 'BuyerPays'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/SiteCodeType.php b/src/EnumType/SiteCodeType.php index 1d13686..525d54a 100644 --- a/src/EnumType/SiteCodeType.php +++ b/src/EnumType/SiteCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for SiteCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: SiteCodeType These are site codes that buyers and sellers can use to identify their sites. * @subpackage Enumerations * @author WsdlToPhp @@ -13,91 +13,127 @@ class SiteCodeType { /** * Constant for value 'US' + * Meta information extracted from the WSDL + * - documentation: USA * @return string 'US' */ const VALUE_US = 'US'; /** * Constant for value 'Canada' + * Meta information extracted from the WSDL + * - documentation: Canada * @return string 'Canada' */ const VALUE_CANADA = 'Canada'; /** * Constant for value 'UK' + * Meta information extracted from the WSDL + * - documentation: United Kingdom * @return string 'UK' */ const VALUE_UK = 'UK'; /** * Constant for value 'Australia' + * Meta information extracted from the WSDL + * - documentation: Australia * @return string 'Australia' */ const VALUE_AUSTRALIA = 'Australia'; /** * Constant for value 'Austria' + * Meta information extracted from the WSDL + * - documentation: Austria * @return string 'Austria' */ const VALUE_AUSTRIA = 'Austria'; /** * Constant for value 'Belgium_French' + * Meta information extracted from the WSDL + * - documentation: Belgium (French) * @return string 'Belgium_French' */ const VALUE_BELGIUM_FRENCH = 'Belgium_French'; /** * Constant for value 'France' + * Meta information extracted from the WSDL + * - documentation: France * @return string 'France' */ const VALUE_FRANCE = 'France'; /** * Constant for value 'Germany' + * Meta information extracted from the WSDL + * - documentation: Germany * @return string 'Germany' */ const VALUE_GERMANY = 'Germany'; /** * Constant for value 'Italy' + * Meta information extracted from the WSDL + * - documentation: Italy * @return string 'Italy' */ const VALUE_ITALY = 'Italy'; /** * Constant for value 'Belgium_Dutch' + * Meta information extracted from the WSDL + * - documentation: Belgium (Dutch) * @return string 'Belgium_Dutch' */ const VALUE_BELGIUM_DUTCH = 'Belgium_Dutch'; /** * Constant for value 'Netherlands' + * Meta information extracted from the WSDL + * - documentation: Netherlands * @return string 'Netherlands' */ const VALUE_NETHERLANDS = 'Netherlands'; /** * Constant for value 'Spain' + * Meta information extracted from the WSDL + * - documentation: Spain * @return string 'Spain' */ const VALUE_SPAIN = 'Spain'; /** * Constant for value 'Switzerland' + * Meta information extracted from the WSDL + * - documentation: Switzerland * @return string 'Switzerland' */ const VALUE_SWITZERLAND = 'Switzerland'; /** * Constant for value 'Taiwan' + * Meta information extracted from the WSDL + * - documentation: Taiwan * @return string 'Taiwan' */ const VALUE_TAIWAN = 'Taiwan'; /** * Constant for value 'eBayMotors' + * Meta information extracted from the WSDL + * - documentation: eBay Motors * @return string 'eBayMotors' */ const VALUE_E_BAY_MOTORS = 'eBayMotors'; /** * Constant for value 'HongKong' + * Meta information extracted from the WSDL + * - documentation: Hong Kong * @return string 'HongKong' */ const VALUE_HONG_KONG = 'HongKong'; /** * Constant for value 'Singapore' + * Meta information extracted from the WSDL + * - documentation: Singapore * @return string 'Singapore' */ const VALUE_SINGAPORE = 'Singapore'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/SolutionTypeType.php b/src/EnumType/SolutionTypeType.php index 033daa9..26b2e05 100644 --- a/src/EnumType/SolutionTypeType.php +++ b/src/EnumType/SolutionTypeType.php @@ -4,7 +4,7 @@ /** * This class stands for SolutionTypeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: SolutionTypeType This is the PayPal payment Solution details type (used by Express Checkout) * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/StoreVisibilityStatusType.php b/src/EnumType/StoreVisibilityStatusType.php index a78713f..406631b 100644 --- a/src/EnumType/StoreVisibilityStatusType.php +++ b/src/EnumType/StoreVisibilityStatusType.php @@ -4,7 +4,7 @@ /** * This class stands for StoreVisibilityStatusType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This is to validate input if store should be visible/invisible in the store locator. If Merchant wants a store to be ENABLED, input should be "E". If Merchant wants a store to be DISABLED, input should be "D". If Merchant is not * giving any input, it will be taken as "DISABLED" * @subpackage Enumerations diff --git a/src/EnumType/SubscribeTextType.php b/src/EnumType/SubscribeTextType.php index ecb868d..0eb5b38 100644 --- a/src/EnumType/SubscribeTextType.php +++ b/src/EnumType/SubscribeTextType.php @@ -4,7 +4,7 @@ /** * This class stands for SubscribeTextType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: values for subscribe button text * @subpackage Enumerations * @author WsdlToPhp @@ -13,11 +13,15 @@ class SubscribeTextType { /** * Constant for value 'BUYNOW' + * Meta information extracted from the WSDL + * - documentation: button wording is BUYNOW * @return string 'BUYNOW' */ const VALUE_BUYNOW = 'BUYNOW'; /** * Constant for value 'SUBSCRIBE' + * Meta information extracted from the WSDL + * - documentation: button wording is SUBSCRIBE * @return string 'SUBSCRIBE' */ const VALUE_SUBSCRIBE = 'SUBSCRIBE'; diff --git a/src/EnumType/TotalType.php b/src/EnumType/TotalType.php index 6458399..03ef7af 100644 --- a/src/EnumType/TotalType.php +++ b/src/EnumType/TotalType.php @@ -4,7 +4,7 @@ /** * This class stands for TotalType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: TotalType - Type declaration for the label to be displayed in MiniCart for UX. * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/TransactionEntityType.php b/src/EnumType/TransactionEntityType.php index 6760916..5bb1660 100644 --- a/src/EnumType/TransactionEntityType.php +++ b/src/EnumType/TransactionEntityType.php @@ -4,7 +4,7 @@ /** * This class stands for TransactionEntityType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: TransactionEntityType This is the PayPal DoAuthorization TransactionEntityType code * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/UnitCodeType.php b/src/EnumType/UnitCodeType.php index 8abe1dd..188b557 100644 --- a/src/EnumType/UnitCodeType.php +++ b/src/EnumType/UnitCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for UnitCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: UnitCodeType * @subpackage Enumerations * @author WsdlToPhp @@ -13,36 +13,50 @@ class UnitCodeType { /** * Constant for value 'kg' + * Meta information extracted from the WSDL + * - documentation: Kilogram. * @return string 'kg' */ const VALUE_KG = 'kg'; /** * Constant for value 'lbs' + * Meta information extracted from the WSDL + * - documentation: Pounds. * @return string 'lbs' */ const VALUE_LBS = 'lbs'; /** * Constant for value 'oz' + * Meta information extracted from the WSDL + * - documentation: Ounces * @return string 'oz' */ const VALUE_OZ = 'oz'; /** * Constant for value 'cm' + * Meta information extracted from the WSDL + * - documentation: Centimeter. * @return string 'cm' */ const VALUE_CM = 'cm'; /** * Constant for value 'inches' + * Meta information extracted from the WSDL + * - documentation: Inches. * @return string 'inches' */ const VALUE_INCHES = 'inches'; /** * Constant for value 'ft' + * Meta information extracted from the WSDL + * - documentation: Feet. * @return string 'ft' */ const VALUE_FT = 'ft'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/UnitOfMeasure.php b/src/EnumType/UnitOfMeasure.php index 7aaf5f0..ecef97f 100644 --- a/src/EnumType/UnitOfMeasure.php +++ b/src/EnumType/UnitOfMeasure.php @@ -4,7 +4,7 @@ /** * This class stands for UnitOfMeasure EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Based on NRF-ARTS Specification for Units of Measure * @subpackage Enumerations * @author WsdlToPhp @@ -13,121 +13,169 @@ class UnitOfMeasure { /** * Constant for value 'EA' + * Meta information extracted from the WSDL + * - documentation: Each * @return string 'EA' */ const VALUE_EA = 'EA'; /** * Constant for value 'Hours' + * Meta information extracted from the WSDL + * - documentation: Hours * @return string 'Hours' */ const VALUE_HOURS = 'Hours'; /** * Constant for value 'Days' + * Meta information extracted from the WSDL + * - documentation: Days * @return string 'Days' */ const VALUE_DAYS = 'Days'; /** * Constant for value 'Seconds' + * Meta information extracted from the WSDL + * - documentation: Seconds * @return string 'Seconds' */ const VALUE_SECONDS = 'Seconds'; /** * Constant for value 'CrateOf12' + * Meta information extracted from the WSDL + * - documentation: Crate of 12 bottles of beer * @return string 'CrateOf12' */ const VALUE_CRATE_OF_12 = 'CrateOf12'; /** * Constant for value '6Pack' + * Meta information extracted from the WSDL + * - documentation: 6Pack * @return string '6Pack' */ const VALUE_6_PACK = '6Pack'; /** * Constant for value 'GLI' + * Meta information extracted from the WSDL + * - documentation: Gallon (UK) * @return string 'GLI' */ const VALUE_GLI = 'GLI'; /** * Constant for value 'GLL' + * Meta information extracted from the WSDL + * - documentation: Gallon (US) * @return string 'GLL' */ const VALUE_GLL = 'GLL'; /** * Constant for value 'LTR' + * Meta information extracted from the WSDL + * - documentation: Litre * @return string 'LTR' */ const VALUE_LTR = 'LTR'; /** * Constant for value 'INH' + * Meta information extracted from the WSDL + * - documentation: Inch * @return string 'INH' */ const VALUE_INH = 'INH'; /** * Constant for value 'FOT' + * Meta information extracted from the WSDL + * - documentation: Foot * @return string 'FOT' */ const VALUE_FOT = 'FOT'; /** * Constant for value 'MMT' + * Meta information extracted from the WSDL + * - documentation: Millimeter * @return string 'MMT' */ const VALUE_MMT = 'MMT'; /** * Constant for value 'CMQ' + * Meta information extracted from the WSDL + * - documentation: Centimeter * @return string 'CMQ' */ const VALUE_CMQ = 'CMQ'; /** * Constant for value 'MTR' + * Meta information extracted from the WSDL + * - documentation: Meter * @return string 'MTR' */ const VALUE_MTR = 'MTR'; /** * Constant for value 'MTK' + * Meta information extracted from the WSDL + * - documentation: Square Meter * @return string 'MTK' */ const VALUE_MTK = 'MTK'; /** * Constant for value 'MTQ' + * Meta information extracted from the WSDL + * - documentation: Cubic Meter * @return string 'MTQ' */ const VALUE_MTQ = 'MTQ'; /** * Constant for value 'GRM' + * Meta information extracted from the WSDL + * - documentation: Gram * @return string 'GRM' */ const VALUE_GRM = 'GRM'; /** * Constant for value 'KGM' + * Meta information extracted from the WSDL + * - documentation: Kilogram * @return string 'KGM' */ const VALUE_KGM = 'KGM'; /** * Constant for value 'KG' + * Meta information extracted from the WSDL + * - documentation: Kilogram * @return string 'KG' */ const VALUE_KG = 'KG'; /** * Constant for value 'LBR' + * Meta information extracted from the WSDL + * - documentation: Pound * @return string 'LBR' */ const VALUE_LBR = 'LBR'; /** * Constant for value 'ANN' + * Meta information extracted from the WSDL + * - documentation: Annual * @return string 'ANN' */ const VALUE_ANN = 'ANN'; /** * Constant for value 'CEL' + * Meta information extracted from the WSDL + * - documentation: Degree Celcius * @return string 'CEL' */ const VALUE_CEL = 'CEL'; /** * Constant for value 'FAH' + * Meta information extracted from the WSDL + * - documentation: Degree Fahrenheit * @return string 'FAH' */ const VALUE_FAH = 'FAH'; /** * Constant for value 'RESERVED' + * Meta information extracted from the WSDL + * - documentation: RESERVED * @return string 'RESERVED' */ const VALUE_RESERVED = 'RESERVED'; diff --git a/src/EnumType/UserChannelCodeType.php b/src/EnumType/UserChannelCodeType.php index cca5a35..a4b18e7 100644 --- a/src/EnumType/UserChannelCodeType.php +++ b/src/EnumType/UserChannelCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for UserChannelCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: It defines the enumerated types of the user channels defined in biz/User/value_object/Channel.oml * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/UserSelectedFundingSourceType.php b/src/EnumType/UserSelectedFundingSourceType.php index 0926596..5140f59 100644 --- a/src/EnumType/UserSelectedFundingSourceType.php +++ b/src/EnumType/UserSelectedFundingSourceType.php @@ -4,7 +4,7 @@ /** * This class stands for UserSelectedFundingSourceType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: UserSelectedFundingSourceType User Selected Funding Source (used by Express Checkout) * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/UserStatusCodeType.php b/src/EnumType/UserStatusCodeType.php index 595c559..cfb93e1 100644 --- a/src/EnumType/UserStatusCodeType.php +++ b/src/EnumType/UserStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for UserStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: UserStatusCodeType * @subpackage Enumerations * @author WsdlToPhp @@ -13,91 +13,127 @@ class UserStatusCodeType { /** * Constant for value 'Unknown' + * Meta information extracted from the WSDL + * - documentation: User properties have never been set. This value should seldom, if ever, be returned and typically represents a problem. * @return string 'Unknown' */ const VALUE_UNKNOWN = 'Unknown'; /** * Constant for value 'Suspended' + * Meta information extracted from the WSDL + * - documentation: User has been suspended from selling and buying, such as for violations of eBay terms or agreement. * @return string 'Suspended' */ const VALUE_SUSPENDED = 'Suspended'; /** * Constant for value 'Confirmed' + * Meta information extracted from the WSDL + * - documentation: User has completed online registration and has properly responded to confirmation email. Most users should fall in this category. * @return string 'Confirmed' */ const VALUE_CONFIRMED = 'Confirmed'; /** * Constant for value 'Unconfirmed' + * Meta information extracted from the WSDL + * - documentation: User has completed online registration, but has either not responded to confirmation email or has not yet been sent the confirmation email. . * @return string 'Unconfirmed' */ const VALUE_UNCONFIRMED = 'Unconfirmed'; /** * Constant for value 'Ghost' + * Meta information extracted from the WSDL + * - documentation: Registered users of AuctionWeb (pre-eBay) who never re-registered on eBay. * @return string 'Ghost' */ const VALUE_GHOST = 'Ghost'; /** * Constant for value 'InMaintenance' + * Meta information extracted from the WSDL + * - documentation: Temporary user record state indicating the record is in the process of being changed by eBay. Query user information again to get new status. * @return string 'InMaintenance' */ const VALUE_IN_MAINTENANCE = 'InMaintenance'; /** * Constant for value 'Deleted' + * Meta information extracted from the WSDL + * - documentation: Records for the specified user have been deleted. * @return string 'Deleted' */ const VALUE_DELETED = 'Deleted'; /** * Constant for value 'CreditCardVerify' + * Meta information extracted from the WSDL + * - documentation: User has completed registration and confirmation, but is pending a verification of credit card information. * @return string 'CreditCardVerify' */ const VALUE_CREDIT_CARD_VERIFY = 'CreditCardVerify'; /** * Constant for value 'AccountOnHold' + * Meta information extracted from the WSDL + * - documentation: User's account is on hold, such as for non-payment of amounts due eBay. User cannot sell or buy items. * @return string 'AccountOnHold' */ const VALUE_ACCOUNT_ON_HOLD = 'AccountOnHold'; /** * Constant for value 'Merged' + * Meta information extracted from the WSDL + * - documentation: User record has been merged with another account record for the same user. * @return string 'Merged' */ const VALUE_MERGED = 'Merged'; /** * Constant for value 'RegistrationCodeMailOut' + * Meta information extracted from the WSDL + * - documentation: User has completed online registration and has been sent the confirmation email, but has not yet responded to the confirmation email. * @return string 'RegistrationCodeMailOut' */ const VALUE_REGISTRATION_CODE_MAIL_OUT = 'RegistrationCodeMailOut'; /** * Constant for value 'TermPending' + * Meta information extracted from the WSDL + * - documentation: User has been scheduled for account closure (typically when a user has requested to have their account closed.) A user in this state should not be considered an active user. * @return string 'TermPending' */ const VALUE_TERM_PENDING = 'TermPending'; /** * Constant for value 'UnconfirmedHalfOptIn' + * Meta information extracted from the WSDL + * - documentation: User has completed the registration for Half.com and opted to automatically also be registered with eBay, but the registration confirmation is still pending. * @return string 'UnconfirmedHalfOptIn' */ const VALUE_UNCONFIRMED_HALF_OPT_IN = 'UnconfirmedHalfOptIn'; /** * Constant for value 'CreditCardVerifyHalfOptIn' + * Meta information extracted from the WSDL + * - documentation: User has completed the registration for Half.com and opted to automatically also be registered with eBay, but the verification of credit card information is still pending. * @return string 'CreditCardVerifyHalfOptIn' */ const VALUE_CREDIT_CARD_VERIFY_HALF_OPT_IN = 'CreditCardVerifyHalfOptIn'; /** * Constant for value 'UnconfirmedPassport' + * Meta information extracted from the WSDL + * - documentation: Passport User. User has completed the registration process, but the registration confirmation is still pending. * @return string 'UnconfirmedPassport' */ const VALUE_UNCONFIRMED_PASSPORT = 'UnconfirmedPassport'; /** * Constant for value 'CreditCardVerifyPassport' + * Meta information extracted from the WSDL + * - documentation: Passport User Requiring Credit Card Verification. User has completed the registration process with credit card verification, but the registration confirmation is still pending. * @return string 'CreditCardVerifyPassport' */ const VALUE_CREDIT_CARD_VERIFY_PASSPORT = 'CreditCardVerifyPassport'; /** * Constant for value 'UnconfirmedExpress' + * Meta information extracted from the WSDL + * - documentation: Half.com User. User has completed the registration for Half.com and opted to automatically also be registered with eBay, but the registration confirmation is still pending. * @return string 'UnconfirmedExpress' */ const VALUE_UNCONFIRMED_EXPRESS = 'UnconfirmedExpress'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/EnumType/UserWithdrawalLimitTypeType.php b/src/EnumType/UserWithdrawalLimitTypeType.php index d729c5a..e8c81af 100644 --- a/src/EnumType/UserWithdrawalLimitTypeType.php +++ b/src/EnumType/UserWithdrawalLimitTypeType.php @@ -4,7 +4,7 @@ /** * This class stands for UserWithdrawalLimitTypeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: User Withdrawal Limit Type Type * @subpackage Enumerations * @author WsdlToPhp diff --git a/src/EnumType/VATStatusCodeType.php b/src/EnumType/VATStatusCodeType.php index 93ec9ce..86f57ee 100644 --- a/src/EnumType/VATStatusCodeType.php +++ b/src/EnumType/VATStatusCodeType.php @@ -4,7 +4,7 @@ /** * This class stands for VATStatusCodeType EnumType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: VATStatusCodeType * @subpackage Enumerations * @author WsdlToPhp @@ -13,21 +13,29 @@ class VATStatusCodeType { /** * Constant for value 'NoVATTax' + * Meta information extracted from the WSDL + * - documentation: No VAT Tax * @return string 'NoVATTax' */ const VALUE_NO_VATTAX = 'NoVATTax'; /** * Constant for value 'VATTax' + * Meta information extracted from the WSDL + * - documentation: VAT Tax * @return string 'VATTax' */ const VALUE_VATTAX = 'VATTax'; /** * Constant for value 'VATExempt' + * Meta information extracted from the WSDL + * - documentation: VAT Exempt * @return string 'VATExempt' */ const VALUE_VATEXEMPT = 'VATExempt'; /** * Constant for value 'CustomCode' + * Meta information extracted from the WSDL + * - documentation: Reserved for internal or future use. * @return string 'CustomCode' */ const VALUE_CUSTOM_CODE = 'CustomCode'; diff --git a/src/ServiceType/Address.php b/src/ServiceType/Address.php index d115bc8..3ce7040 100644 --- a/src/ServiceType/Address.php +++ b/src/ServiceType/Address.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named AddressVerify - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function AddressVerify(\PayPal\StructType\AddressVerifyReq $addressVerifyRequest) { try { - $this->setResult(self::getSoapClient()->AddressVerify($addressVerifyRequest)); + $this->setResult($this->getSoapClient()->AddressVerify($addressVerifyRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/BMB.php b/src/ServiceType/BMB.php index 41922b0..c52eeb6 100644 --- a/src/ServiceType/BMB.php +++ b/src/ServiceType/BMB.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named BMButtonSearch - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function BMButtonSearch(\PayPal\StructType\BMButtonSearchReq $bMButtonSearchRequest) { try { - $this->setResult(self::getSoapClient()->BMButtonSearch($bMButtonSearchRequest)); + $this->setResult($this->getSoapClient()->BMButtonSearch($bMButtonSearchRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/BMC.php b/src/ServiceType/BMC.php index ee20573..53806da 100644 --- a/src/ServiceType/BMC.php +++ b/src/ServiceType/BMC.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named BMCreateButton - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function BMCreateButton(\PayPal\StructType\BMCreateButtonReq $bMCreateButtonRequest) { try { - $this->setResult(self::getSoapClient()->BMCreateButton($bMCreateButtonRequest)); + $this->setResult($this->getSoapClient()->BMCreateButton($bMCreateButtonRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/BMG.php b/src/ServiceType/BMG.php index 90474e6..6b85a55 100644 --- a/src/ServiceType/BMG.php +++ b/src/ServiceType/BMG.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named BMGetButtonDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function BMGetButtonDetails(\PayPal\StructType\BMGetButtonDetailsReq $bMGetButtonDetailsRequest) { try { - $this->setResult(self::getSoapClient()->BMGetButtonDetails($bMGetButtonDetailsRequest)); + $this->setResult($this->getSoapClient()->BMGetButtonDetails($bMGetButtonDetailsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -50,7 +50,7 @@ public function BMGetButtonDetails(\PayPal\StructType\BMGetButtonDetailsReq $bMG } /** * Method to call the operation originally named BMGetInventory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -65,7 +65,7 @@ public function BMGetButtonDetails(\PayPal\StructType\BMGetButtonDetailsReq $bMG public function BMGetInventory(\PayPal\StructType\BMGetInventoryReq $bMGetInventoryRequest) { try { - $this->setResult(self::getSoapClient()->BMGetInventory($bMGetInventoryRequest)); + $this->setResult($this->getSoapClient()->BMGetInventory($bMGetInventoryRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/BMM.php b/src/ServiceType/BMM.php index bd92352..ccbc907 100644 --- a/src/ServiceType/BMM.php +++ b/src/ServiceType/BMM.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named BMManageButtonStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function BMManageButtonStatus(\PayPal\StructType\BMManageButtonStatusReq $bMManageButtonStatusRequest) { try { - $this->setResult(self::getSoapClient()->BMManageButtonStatus($bMManageButtonStatusRequest)); + $this->setResult($this->getSoapClient()->BMManageButtonStatus($bMManageButtonStatusRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/BMS.php b/src/ServiceType/BMS.php index e7d9d99..d0983f2 100644 --- a/src/ServiceType/BMS.php +++ b/src/ServiceType/BMS.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named BMSetInventory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function BMSetInventory(\PayPal\StructType\BMSetInventoryReq $bMSetInventoryRequest) { try { - $this->setResult(self::getSoapClient()->BMSetInventory($bMSetInventoryRequest)); + $this->setResult($this->getSoapClient()->BMSetInventory($bMSetInventoryRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/BMU.php b/src/ServiceType/BMU.php index 81790e1..2aa1fbc 100644 --- a/src/ServiceType/BMU.php +++ b/src/ServiceType/BMU.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named BMUpdateButton - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function BMUpdateButton(\PayPal\StructType\BMUpdateButtonReq $bMUpdateButtonRequest) { try { - $this->setResult(self::getSoapClient()->BMUpdateButton($bMUpdateButtonRequest)); + $this->setResult($this->getSoapClient()->BMUpdateButton($bMUpdateButtonRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Bill.php b/src/ServiceType/Bill.php index 22149a5..b860711 100644 --- a/src/ServiceType/Bill.php +++ b/src/ServiceType/Bill.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named BillUser - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function BillUser(\PayPal\StructType\BillUserReq $billUserRequest) { try { - $this->setResult(self::getSoapClient()->BillUser($billUserRequest)); + $this->setResult($this->getSoapClient()->BillUser($billUserRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -50,7 +50,7 @@ public function BillUser(\PayPal\StructType\BillUserReq $billUserRequest) } /** * Method to call the operation originally named BillAgreementUpdate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -65,7 +65,7 @@ public function BillUser(\PayPal\StructType\BillUserReq $billUserRequest) public function BillAgreementUpdate(\PayPal\StructType\BillAgreementUpdateReq $billAgreementUpdateRequest) { try { - $this->setResult(self::getSoapClient()->BillAgreementUpdate($billAgreementUpdateRequest)); + $this->setResult($this->getSoapClient()->BillAgreementUpdate($billAgreementUpdateRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -74,7 +74,7 @@ public function BillAgreementUpdate(\PayPal\StructType\BillAgreementUpdateReq $b } /** * Method to call the operation originally named BillOutstandingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -89,7 +89,7 @@ public function BillAgreementUpdate(\PayPal\StructType\BillAgreementUpdateReq $b public function BillOutstandingAmount(\PayPal\StructType\BillOutstandingAmountReq $billOutstandingAmountRequest) { try { - $this->setResult(self::getSoapClient()->BillOutstandingAmount($billOutstandingAmountRequest)); + $this->setResult($this->getSoapClient()->BillOutstandingAmount($billOutstandingAmountRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Cancel.php b/src/ServiceType/Cancel.php index f25b08a..0e394a0 100644 --- a/src/ServiceType/Cancel.php +++ b/src/ServiceType/Cancel.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named CancelRecoup - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function CancelRecoup(\PayPal\StructType\CancelRecoupReq $cancelRecoupRequest) { try { - $this->setResult(self::getSoapClient()->CancelRecoup($cancelRecoupRequest)); + $this->setResult($this->getSoapClient()->CancelRecoup($cancelRecoupRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Complete.php b/src/ServiceType/Complete.php index 98397bd..bded339 100644 --- a/src/ServiceType/Complete.php +++ b/src/ServiceType/Complete.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named CompleteRecoup - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function CompleteRecoup(\PayPal\StructType\CompleteRecoupReq $completeRecoupRequest) { try { - $this->setResult(self::getSoapClient()->CompleteRecoup($completeRecoupRequest)); + $this->setResult($this->getSoapClient()->CompleteRecoup($completeRecoupRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Create.php b/src/ServiceType/Create.php index 12083fa..d84d895 100644 --- a/src/ServiceType/Create.php +++ b/src/ServiceType/Create.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named CreateMobilePayment - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function CreateMobilePayment(\PayPal\StructType\CreateMobilePaymentReq $createMobilePaymentRequest) { try { - $this->setResult(self::getSoapClient()->CreateMobilePayment($createMobilePaymentRequest)); + $this->setResult($this->getSoapClient()->CreateMobilePayment($createMobilePaymentRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -50,7 +50,7 @@ public function CreateMobilePayment(\PayPal\StructType\CreateMobilePaymentReq $c } /** * Method to call the operation originally named CreateBillingAgreement - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -65,7 +65,7 @@ public function CreateMobilePayment(\PayPal\StructType\CreateMobilePaymentReq $c public function CreateBillingAgreement(\PayPal\StructType\CreateBillingAgreementReq $createBillingAgreementRequest) { try { - $this->setResult(self::getSoapClient()->CreateBillingAgreement($createBillingAgreementRequest)); + $this->setResult($this->getSoapClient()->CreateBillingAgreement($createBillingAgreementRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -74,7 +74,7 @@ public function CreateBillingAgreement(\PayPal\StructType\CreateBillingAgreement } /** * Method to call the operation originally named CreateRecurringPaymentsProfile - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -89,7 +89,7 @@ public function CreateBillingAgreement(\PayPal\StructType\CreateBillingAgreement public function CreateRecurringPaymentsProfile(\PayPal\StructType\CreateRecurringPaymentsProfileReq $createRecurringPaymentsProfileRequest) { try { - $this->setResult(self::getSoapClient()->CreateRecurringPaymentsProfile($createRecurringPaymentsProfileRequest)); + $this->setResult($this->getSoapClient()->CreateRecurringPaymentsProfile($createRecurringPaymentsProfileRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Enter.php b/src/ServiceType/Enter.php index a14034c..f581af9 100644 --- a/src/ServiceType/Enter.php +++ b/src/ServiceType/Enter.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named EnterBoarding - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function EnterBoarding(\PayPal\StructType\EnterBoardingReq $enterBoardingRequest) { try { - $this->setResult(self::getSoapClient()->EnterBoarding($enterBoardingRequest)); + $this->setResult($this->getSoapClient()->EnterBoarding($enterBoardingRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Execute.php b/src/ServiceType/Execute.php index 89ca864..1d716c6 100644 --- a/src/ServiceType/Execute.php +++ b/src/ServiceType/Execute.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named ExecuteCheckoutOperations - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function ExecuteCheckoutOperations(\PayPal\StructType\ExecuteCheckoutOperationsReq $executeCheckoutOperationsRequest) { try { - $this->setResult(self::getSoapClient()->ExecuteCheckoutOperations($executeCheckoutOperationsRequest)); + $this->setResult($this->getSoapClient()->ExecuteCheckoutOperations($executeCheckoutOperationsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/External.php b/src/ServiceType/External.php index fb58d1c..0af4023 100644 --- a/src/ServiceType/External.php +++ b/src/ServiceType/External.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named ExternalRememberMeOptOut - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function ExternalRememberMeOptOut(\PayPal\StructType\ExternalRememberMeOptOutReq $externalRememberMeOptOutRequest) { try { - $this->setResult(self::getSoapClient()->ExternalRememberMeOptOut($externalRememberMeOptOutRequest)); + $this->setResult($this->getSoapClient()->ExternalRememberMeOptOut($externalRememberMeOptOutRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Get.php b/src/ServiceType/Get.php index 742806f..58c2144 100644 --- a/src/ServiceType/Get.php +++ b/src/ServiceType/Get.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named GetTransactionDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function GetTransactionDetails(\PayPal\StructType\GetTransactionDetailsReq $getTransactionDetailsRequest) { try { - $this->setResult(self::getSoapClient()->GetTransactionDetails($getTransactionDetailsRequest)); + $this->setResult($this->getSoapClient()->GetTransactionDetails($getTransactionDetailsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -50,7 +50,7 @@ public function GetTransactionDetails(\PayPal\StructType\GetTransactionDetailsRe } /** * Method to call the operation originally named GetBoardingDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -65,7 +65,7 @@ public function GetTransactionDetails(\PayPal\StructType\GetTransactionDetailsRe public function GetBoardingDetails(\PayPal\StructType\GetBoardingDetailsReq $getBoardingDetailsRequest) { try { - $this->setResult(self::getSoapClient()->GetBoardingDetails($getBoardingDetailsRequest)); + $this->setResult($this->getSoapClient()->GetBoardingDetails($getBoardingDetailsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -74,7 +74,7 @@ public function GetBoardingDetails(\PayPal\StructType\GetBoardingDetailsReq $get } /** * Method to call the operation originally named GetMobileStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -89,7 +89,7 @@ public function GetBoardingDetails(\PayPal\StructType\GetBoardingDetailsReq $get public function GetMobileStatus(\PayPal\StructType\GetMobileStatusReq $getMobileStatusRequest) { try { - $this->setResult(self::getSoapClient()->GetMobileStatus($getMobileStatusRequest)); + $this->setResult($this->getSoapClient()->GetMobileStatus($getMobileStatusRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -98,7 +98,7 @@ public function GetMobileStatus(\PayPal\StructType\GetMobileStatusReq $getMobile } /** * Method to call the operation originally named GetBalance - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -113,7 +113,7 @@ public function GetMobileStatus(\PayPal\StructType\GetMobileStatusReq $getMobile public function GetBalance(\PayPal\StructType\GetBalanceReq $getBalanceRequest) { try { - $this->setResult(self::getSoapClient()->GetBalance($getBalanceRequest)); + $this->setResult($this->getSoapClient()->GetBalance($getBalanceRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -122,7 +122,7 @@ public function GetBalance(\PayPal\StructType\GetBalanceReq $getBalanceRequest) } /** * Method to call the operation originally named GetPalDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -137,7 +137,7 @@ public function GetBalance(\PayPal\StructType\GetBalanceReq $getBalanceRequest) public function GetPalDetails(\PayPal\StructType\GetPalDetailsReq $getPalDetailsRequest) { try { - $this->setResult(self::getSoapClient()->GetPalDetails($getPalDetailsRequest)); + $this->setResult($this->getSoapClient()->GetPalDetails($getPalDetailsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -146,7 +146,7 @@ public function GetPalDetails(\PayPal\StructType\GetPalDetailsReq $getPalDetails } /** * Method to call the operation originally named GetAuthDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -161,7 +161,7 @@ public function GetPalDetails(\PayPal\StructType\GetPalDetailsReq $getPalDetails public function GetAuthDetails(\PayPal\StructType\GetAuthDetailsReq $getAuthDetailsRequest) { try { - $this->setResult(self::getSoapClient()->GetAuthDetails($getAuthDetailsRequest)); + $this->setResult($this->getSoapClient()->GetAuthDetails($getAuthDetailsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -170,7 +170,7 @@ public function GetAuthDetails(\PayPal\StructType\GetAuthDetailsReq $getAuthDeta } /** * Method to call the operation originally named GetAccessPermissionDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -185,7 +185,7 @@ public function GetAuthDetails(\PayPal\StructType\GetAuthDetailsReq $getAuthDeta public function GetAccessPermissionDetails(\PayPal\StructType\GetAccessPermissionDetailsReq $getAccessPermissionDetailsRequest) { try { - $this->setResult(self::getSoapClient()->GetAccessPermissionDetails($getAccessPermissionDetailsRequest)); + $this->setResult($this->getSoapClient()->GetAccessPermissionDetails($getAccessPermissionDetailsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -194,7 +194,7 @@ public function GetAccessPermissionDetails(\PayPal\StructType\GetAccessPermissio } /** * Method to call the operation originally named GetIncentiveEvaluation - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -209,7 +209,7 @@ public function GetAccessPermissionDetails(\PayPal\StructType\GetAccessPermissio public function GetIncentiveEvaluation(\PayPal\StructType\GetIncentiveEvaluationReq $getIncentiveEvaluationRequest) { try { - $this->setResult(self::getSoapClient()->GetIncentiveEvaluation($getIncentiveEvaluationRequest)); + $this->setResult($this->getSoapClient()->GetIncentiveEvaluation($getIncentiveEvaluationRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -218,7 +218,7 @@ public function GetIncentiveEvaluation(\PayPal\StructType\GetIncentiveEvaluation } /** * Method to call the operation originally named GetExpressCheckoutDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -233,7 +233,7 @@ public function GetIncentiveEvaluation(\PayPal\StructType\GetIncentiveEvaluation public function GetExpressCheckoutDetails(\PayPal\StructType\GetExpressCheckoutDetailsReq $getExpressCheckoutDetailsRequest) { try { - $this->setResult(self::getSoapClient()->GetExpressCheckoutDetails($getExpressCheckoutDetailsRequest)); + $this->setResult($this->getSoapClient()->GetExpressCheckoutDetails($getExpressCheckoutDetailsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -242,7 +242,7 @@ public function GetExpressCheckoutDetails(\PayPal\StructType\GetExpressCheckoutD } /** * Method to call the operation originally named GetBillingAgreementCustomerDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -257,7 +257,7 @@ public function GetExpressCheckoutDetails(\PayPal\StructType\GetExpressCheckoutD public function GetBillingAgreementCustomerDetails(\PayPal\StructType\GetBillingAgreementCustomerDetailsReq $getBillingAgreementCustomerDetailsRequest) { try { - $this->setResult(self::getSoapClient()->GetBillingAgreementCustomerDetails($getBillingAgreementCustomerDetailsRequest)); + $this->setResult($this->getSoapClient()->GetBillingAgreementCustomerDetails($getBillingAgreementCustomerDetailsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -266,7 +266,7 @@ public function GetBillingAgreementCustomerDetails(\PayPal\StructType\GetBilling } /** * Method to call the operation originally named GetRecurringPaymentsProfileDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -281,7 +281,7 @@ public function GetBillingAgreementCustomerDetails(\PayPal\StructType\GetBilling public function GetRecurringPaymentsProfileDetails(\PayPal\StructType\GetRecurringPaymentsProfileDetailsReq $getRecurringPaymentsProfileDetailsRequest) { try { - $this->setResult(self::getSoapClient()->GetRecurringPaymentsProfileDetails($getRecurringPaymentsProfileDetailsRequest)); + $this->setResult($this->getSoapClient()->GetRecurringPaymentsProfileDetails($getRecurringPaymentsProfileDetailsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Initiate.php b/src/ServiceType/Initiate.php index ea88374..7ae1822 100644 --- a/src/ServiceType/Initiate.php +++ b/src/ServiceType/Initiate.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named InitiateRecoup - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function InitiateRecoup(\PayPal\StructType\InitiateRecoupReq $initiateRecoupRequest) { try { - $this->setResult(self::getSoapClient()->InitiateRecoup($initiateRecoupRequest)); + $this->setResult($this->getSoapClient()->InitiateRecoup($initiateRecoupRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Manage.php b/src/ServiceType/Manage.php index c0f35bb..dd282f8 100644 --- a/src/ServiceType/Manage.php +++ b/src/ServiceType/Manage.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named ManagePendingTransactionStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function ManagePendingTransactionStatus(\PayPal\StructType\ManagePendingTransactionStatusReq $managePendingTransactionStatusRequest) { try { - $this->setResult(self::getSoapClient()->ManagePendingTransactionStatus($managePendingTransactionStatusRequest)); + $this->setResult($this->getSoapClient()->ManagePendingTransactionStatus($managePendingTransactionStatusRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -51,7 +51,7 @@ public function ManagePendingTransactionStatus(\PayPal\StructType\ManagePendingT /** * Method to call the operation originally named * ManageRecurringPaymentsProfileStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -66,7 +66,7 @@ public function ManagePendingTransactionStatus(\PayPal\StructType\ManagePendingT public function ManageRecurringPaymentsProfileStatus(\PayPal\StructType\ManageRecurringPaymentsProfileStatusReq $manageRecurringPaymentsProfileStatusRequest) { try { - $this->setResult(self::getSoapClient()->ManageRecurringPaymentsProfileStatus($manageRecurringPaymentsProfileStatusRequest)); + $this->setResult($this->getSoapClient()->ManageRecurringPaymentsProfileStatus($manageRecurringPaymentsProfileStatusRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Mass.php b/src/ServiceType/Mass.php index 0283806..3f13a38 100644 --- a/src/ServiceType/Mass.php +++ b/src/ServiceType/Mass.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named MassPay - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function MassPay(\PayPal\StructType\MassPayReq $massPayRequest) { try { - $this->setResult(self::getSoapClient()->MassPay($massPayRequest)); + $this->setResult($this->getSoapClient()->MassPay($massPayRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Refund.php b/src/ServiceType/Refund.php index 6a2d6d4..0765883 100644 --- a/src/ServiceType/Refund.php +++ b/src/ServiceType/Refund.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named RefundTransaction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function RefundTransaction(\PayPal\StructType\RefundTransactionReq $refundTransactionRequest) { try { - $this->setResult(self::getSoapClient()->RefundTransaction($refundTransactionRequest)); + $this->setResult($this->getSoapClient()->RefundTransaction($refundTransactionRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Reverse.php b/src/ServiceType/Reverse.php index 807934c..f6f540f 100644 --- a/src/ServiceType/Reverse.php +++ b/src/ServiceType/Reverse.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named ReverseTransaction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function ReverseTransaction(\PayPal\StructType\ReverseTransactionReq $reverseTransactionRequest) { try { - $this->setResult(self::getSoapClient()->ReverseTransaction($reverseTransactionRequest)); + $this->setResult($this->getSoapClient()->ReverseTransaction($reverseTransactionRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Set.php b/src/ServiceType/Set.php index ce12f1d..eaa2621 100644 --- a/src/ServiceType/Set.php +++ b/src/ServiceType/Set.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named SetMobileCheckout - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function SetMobileCheckout(\PayPal\StructType\SetMobileCheckoutReq $setMobileCheckoutRequest) { try { - $this->setResult(self::getSoapClient()->SetMobileCheckout($setMobileCheckoutRequest)); + $this->setResult($this->getSoapClient()->SetMobileCheckout($setMobileCheckoutRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -50,7 +50,7 @@ public function SetMobileCheckout(\PayPal\StructType\SetMobileCheckoutReq $setMo } /** * Method to call the operation originally named SetAuthFlowParam - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -65,7 +65,7 @@ public function SetMobileCheckout(\PayPal\StructType\SetMobileCheckoutReq $setMo public function SetAuthFlowParam(\PayPal\StructType\SetAuthFlowParamReq $setAuthFlowParamRequest) { try { - $this->setResult(self::getSoapClient()->SetAuthFlowParam($setAuthFlowParamRequest)); + $this->setResult($this->getSoapClient()->SetAuthFlowParam($setAuthFlowParamRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -74,7 +74,7 @@ public function SetAuthFlowParam(\PayPal\StructType\SetAuthFlowParamReq $setAuth } /** * Method to call the operation originally named SetAccessPermissions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -89,7 +89,7 @@ public function SetAuthFlowParam(\PayPal\StructType\SetAuthFlowParamReq $setAuth public function SetAccessPermissions(\PayPal\StructType\SetAccessPermissionsReq $setAccessPermissionsRequest) { try { - $this->setResult(self::getSoapClient()->SetAccessPermissions($setAccessPermissionsRequest)); + $this->setResult($this->getSoapClient()->SetAccessPermissions($setAccessPermissionsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -98,7 +98,7 @@ public function SetAccessPermissions(\PayPal\StructType\SetAccessPermissionsReq } /** * Method to call the operation originally named SetExpressCheckout - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -113,7 +113,7 @@ public function SetAccessPermissions(\PayPal\StructType\SetAccessPermissionsReq public function SetExpressCheckout(\PayPal\StructType\SetExpressCheckoutReq $setExpressCheckoutRequest) { try { - $this->setResult(self::getSoapClient()->SetExpressCheckout($setExpressCheckoutRequest)); + $this->setResult($this->getSoapClient()->SetExpressCheckout($setExpressCheckoutRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -122,7 +122,7 @@ public function SetExpressCheckout(\PayPal\StructType\SetExpressCheckoutReq $set } /** * Method to call the operation originally named SetCustomerBillingAgreement - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -137,7 +137,7 @@ public function SetExpressCheckout(\PayPal\StructType\SetExpressCheckoutReq $set public function SetCustomerBillingAgreement(\PayPal\StructType\SetCustomerBillingAgreementReq $setCustomerBillingAgreementRequest) { try { - $this->setResult(self::getSoapClient()->SetCustomerBillingAgreement($setCustomerBillingAgreementRequest)); + $this->setResult($this->getSoapClient()->SetCustomerBillingAgreement($setCustomerBillingAgreementRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Transaction.php b/src/ServiceType/Transaction.php index 24663f9..2b7bac7 100644 --- a/src/ServiceType/Transaction.php +++ b/src/ServiceType/Transaction.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named TransactionSearch - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function TransactionSearch(\PayPal\StructType\TransactionSearchReq $transactionSearchRequest) { try { - $this->setResult(self::getSoapClient()->TransactionSearch($transactionSearchRequest)); + $this->setResult($this->getSoapClient()->TransactionSearch($transactionSearchRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/Update.php b/src/ServiceType/Update.php index a8b89d4..2b7f106 100644 --- a/src/ServiceType/Update.php +++ b/src/ServiceType/Update.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named UpdateAccessPermissions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function UpdateAccessPermissions(\PayPal\StructType\UpdateAccessPermissionsReq $updateAccessPermissionsRequest) { try { - $this->setResult(self::getSoapClient()->UpdateAccessPermissions($updateAccessPermissionsRequest)); + $this->setResult($this->getSoapClient()->UpdateAccessPermissions($updateAccessPermissionsRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -50,7 +50,7 @@ public function UpdateAccessPermissions(\PayPal\StructType\UpdateAccessPermissio } /** * Method to call the operation originally named UpdateAuthorization - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -65,7 +65,7 @@ public function UpdateAccessPermissions(\PayPal\StructType\UpdateAccessPermissio public function UpdateAuthorization(\PayPal\StructType\UpdateAuthorizationReq $updateAuthorizationRequest) { try { - $this->setResult(self::getSoapClient()->UpdateAuthorization($updateAuthorizationRequest)); + $this->setResult($this->getSoapClient()->UpdateAuthorization($updateAuthorizationRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -74,7 +74,7 @@ public function UpdateAuthorization(\PayPal\StructType\UpdateAuthorizationReq $u } /** * Method to call the operation originally named UpdateRecurringPaymentsProfile - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -89,7 +89,7 @@ public function UpdateAuthorization(\PayPal\StructType\UpdateAuthorizationReq $u public function UpdateRecurringPaymentsProfile(\PayPal\StructType\UpdateRecurringPaymentsProfileReq $updateRecurringPaymentsProfileRequest) { try { - $this->setResult(self::getSoapClient()->UpdateRecurringPaymentsProfile($updateRecurringPaymentsProfileRequest)); + $this->setResult($this->getSoapClient()->UpdateRecurringPaymentsProfile($updateRecurringPaymentsProfileRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/ServiceType/_Do.php b/src/ServiceType/_Do.php index c1ead71..9da06a7 100644 --- a/src/ServiceType/_Do.php +++ b/src/ServiceType/_Do.php @@ -26,7 +26,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur } /** * Method to call the operation originally named DoMobileCheckoutPayment - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -41,7 +41,7 @@ public function setSoapHeaderRequesterCredentials(\PayPal\StructType\CustomSecur public function DoMobileCheckoutPayment(\PayPal\StructType\DoMobileCheckoutPaymentReq $doMobileCheckoutPaymentRequest) { try { - $this->setResult(self::getSoapClient()->DoMobileCheckoutPayment($doMobileCheckoutPaymentRequest)); + $this->setResult($this->getSoapClient()->DoMobileCheckoutPayment($doMobileCheckoutPaymentRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -50,7 +50,7 @@ public function DoMobileCheckoutPayment(\PayPal\StructType\DoMobileCheckoutPayme } /** * Method to call the operation originally named DoExpressCheckoutPayment - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -65,7 +65,7 @@ public function DoMobileCheckoutPayment(\PayPal\StructType\DoMobileCheckoutPayme public function DoExpressCheckoutPayment(\PayPal\StructType\DoExpressCheckoutPaymentReq $doExpressCheckoutPaymentRequest) { try { - $this->setResult(self::getSoapClient()->DoExpressCheckoutPayment($doExpressCheckoutPaymentRequest)); + $this->setResult($this->getSoapClient()->DoExpressCheckoutPayment($doExpressCheckoutPaymentRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -74,7 +74,7 @@ public function DoExpressCheckoutPayment(\PayPal\StructType\DoExpressCheckoutPay } /** * Method to call the operation originally named DoUATPExpressCheckoutPayment - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -89,7 +89,7 @@ public function DoExpressCheckoutPayment(\PayPal\StructType\DoExpressCheckoutPay public function DoUATPExpressCheckoutPayment(\PayPal\StructType\DoUATPExpressCheckoutPaymentReq $doUATPExpressCheckoutPaymentRequest) { try { - $this->setResult(self::getSoapClient()->DoUATPExpressCheckoutPayment($doUATPExpressCheckoutPaymentRequest)); + $this->setResult($this->getSoapClient()->DoUATPExpressCheckoutPayment($doUATPExpressCheckoutPaymentRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -98,7 +98,7 @@ public function DoUATPExpressCheckoutPayment(\PayPal\StructType\DoUATPExpressChe } /** * Method to call the operation originally named DoDirectPayment - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -113,7 +113,7 @@ public function DoUATPExpressCheckoutPayment(\PayPal\StructType\DoUATPExpressChe public function DoDirectPayment(\PayPal\StructType\DoDirectPaymentReq $doDirectPaymentRequest) { try { - $this->setResult(self::getSoapClient()->DoDirectPayment($doDirectPaymentRequest)); + $this->setResult($this->getSoapClient()->DoDirectPayment($doDirectPaymentRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -122,7 +122,7 @@ public function DoDirectPayment(\PayPal\StructType\DoDirectPaymentReq $doDirectP } /** * Method to call the operation originally named DoCancel - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -137,7 +137,7 @@ public function DoDirectPayment(\PayPal\StructType\DoDirectPaymentReq $doDirectP public function DoCancel(\PayPal\StructType\DoCancelReq $doCancelRequest) { try { - $this->setResult(self::getSoapClient()->DoCancel($doCancelRequest)); + $this->setResult($this->getSoapClient()->DoCancel($doCancelRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -146,7 +146,7 @@ public function DoCancel(\PayPal\StructType\DoCancelReq $doCancelRequest) } /** * Method to call the operation originally named DoCapture - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -161,7 +161,7 @@ public function DoCancel(\PayPal\StructType\DoCancelReq $doCancelRequest) public function DoCapture(\PayPal\StructType\DoCaptureReq $doCaptureRequest) { try { - $this->setResult(self::getSoapClient()->DoCapture($doCaptureRequest)); + $this->setResult($this->getSoapClient()->DoCapture($doCaptureRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -170,7 +170,7 @@ public function DoCapture(\PayPal\StructType\DoCaptureReq $doCaptureRequest) } /** * Method to call the operation originally named DoReauthorization - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -185,7 +185,7 @@ public function DoCapture(\PayPal\StructType\DoCaptureReq $doCaptureRequest) public function DoReauthorization(\PayPal\StructType\DoReauthorizationReq $doReauthorizationRequest) { try { - $this->setResult(self::getSoapClient()->DoReauthorization($doReauthorizationRequest)); + $this->setResult($this->getSoapClient()->DoReauthorization($doReauthorizationRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -194,7 +194,7 @@ public function DoReauthorization(\PayPal\StructType\DoReauthorizationReq $doRea } /** * Method to call the operation originally named DoVoid - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -209,7 +209,7 @@ public function DoReauthorization(\PayPal\StructType\DoReauthorizationReq $doRea public function DoVoid(\PayPal\StructType\DoVoidReq $doVoidRequest) { try { - $this->setResult(self::getSoapClient()->DoVoid($doVoidRequest)); + $this->setResult($this->getSoapClient()->DoVoid($doVoidRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -218,7 +218,7 @@ public function DoVoid(\PayPal\StructType\DoVoidReq $doVoidRequest) } /** * Method to call the operation originally named DoAuthorization - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -233,7 +233,7 @@ public function DoVoid(\PayPal\StructType\DoVoidReq $doVoidRequest) public function DoAuthorization(\PayPal\StructType\DoAuthorizationReq $doAuthorizationRequest) { try { - $this->setResult(self::getSoapClient()->DoAuthorization($doAuthorizationRequest)); + $this->setResult($this->getSoapClient()->DoAuthorization($doAuthorizationRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -242,7 +242,7 @@ public function DoAuthorization(\PayPal\StructType\DoAuthorizationReq $doAuthori } /** * Method to call the operation originally named DoUATPAuthorization - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -257,7 +257,7 @@ public function DoAuthorization(\PayPal\StructType\DoAuthorizationReq $doAuthori public function DoUATPAuthorization(\PayPal\StructType\DoUATPAuthorizationReq $doUATPAuthorizationRequest) { try { - $this->setResult(self::getSoapClient()->DoUATPAuthorization($doUATPAuthorizationRequest)); + $this->setResult($this->getSoapClient()->DoUATPAuthorization($doUATPAuthorizationRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -266,7 +266,7 @@ public function DoUATPAuthorization(\PayPal\StructType\DoUATPAuthorizationReq $d } /** * Method to call the operation originally named DoReferenceTransaction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -281,7 +281,7 @@ public function DoUATPAuthorization(\PayPal\StructType\DoUATPAuthorizationReq $d public function DoReferenceTransaction(\PayPal\StructType\DoReferenceTransactionReq $doReferenceTransactionRequest) { try { - $this->setResult(self::getSoapClient()->DoReferenceTransaction($doReferenceTransactionRequest)); + $this->setResult($this->getSoapClient()->DoReferenceTransaction($doReferenceTransactionRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); @@ -290,7 +290,7 @@ public function DoReferenceTransaction(\PayPal\StructType\DoReferenceTransaction } /** * Method to call the operation originally named DoNonReferencedCredit - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - SOAPHeaderNames: RequesterCredentials * - SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI * - SOAPHeaderTypes: \PayPal\StructType\CustomSecurityHeaderType @@ -305,7 +305,7 @@ public function DoReferenceTransaction(\PayPal\StructType\DoReferenceTransaction public function DoNonReferencedCredit(\PayPal\StructType\DoNonReferencedCreditReq $doNonReferencedCreditRequest) { try { - $this->setResult(self::getSoapClient()->DoNonReferencedCredit($doNonReferencedCreditRequest)); + $this->setResult($this->getSoapClient()->DoNonReferencedCredit($doNonReferencedCreditRequest)); return $this->getResult(); } catch (\SoapFault $soapFault) { $this->saveLastError(__METHOD__, $soapFault); diff --git a/src/StructType/APICredentialsType.php b/src/StructType/APICredentialsType.php index 7e30bbd..64e1b6f 100644 --- a/src/StructType/APICredentialsType.php +++ b/src/StructType/APICredentialsType.php @@ -6,7 +6,7 @@ /** * This class stands for APICredentialsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: APICredentialsType * @subpackage Structs * @author WsdlToPhp @@ -15,21 +15,21 @@ class APICredentialsType extends AbstractStructBase { /** * The Username - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchantâs PayPal API usernameCharacter length and limitations: 128 alphanumeric characters * @var string */ public $Username; /** * The Password - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchantâs PayPal API passwordCharacter length and limitations: 40 alphanumeric characters * @var string */ public $Password; /** * The Signature - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchantâs PayPal API signature, if one exists. Character length and limitations: 256 alphanumeric characters * - minOccurs: 0 * @var string @@ -37,7 +37,7 @@ class APICredentialsType extends AbstractStructBase public $Signature; /** * The Certificate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchantâs PayPal API certificate in PEM format, if one exists The certificate consists of two parts: the private key (2,048 bytes) and the certificate proper (4,000 bytes). Character length and limitations: 6,048 alphanumeric * characters * - minOccurs: 0 @@ -46,7 +46,7 @@ class APICredentialsType extends AbstractStructBase public $Certificate; /** * The Type - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchantâs PayPal API authentication mechanism. Auth-None: no authentication mechanism on file Cert: API certificate Sign: API signature Character length and limitations: 9 alphanumeric characters * @var string */ @@ -90,7 +90,7 @@ public function setUsername($username = null) { // validation for constraint: string if (!is_null($username) && !is_string($username)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($username)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($username, true), gettype($username)), __LINE__); } $this->Username = $username; return $this; @@ -112,7 +112,7 @@ public function setPassword($password = null) { // validation for constraint: string if (!is_null($password) && !is_string($password)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($password)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($password, true), gettype($password)), __LINE__); } $this->Password = $password; return $this; @@ -134,7 +134,7 @@ public function setSignature($signature = null) { // validation for constraint: string if (!is_null($signature) && !is_string($signature)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($signature)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($signature, true), gettype($signature)), __LINE__); } $this->Signature = $signature; return $this; @@ -156,7 +156,7 @@ public function setCertificate($certificate = null) { // validation for constraint: string if (!is_null($certificate) && !is_string($certificate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($certificate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($certificate, true), gettype($certificate)), __LINE__); } $this->Certificate = $certificate; return $this; @@ -181,7 +181,7 @@ public function setType($type = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\APIAuthenticationType::valueIsValid($type)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $type, implode(', ', \PayPal\EnumType\APIAuthenticationType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\APIAuthenticationType', is_array($type) ? implode(', ', $type) : var_export($type, true), implode(', ', \PayPal\EnumType\APIAuthenticationType::getValidValues())), __LINE__); } $this->Type = $type; return $this; diff --git a/src/StructType/AbstractRequestType.php b/src/StructType/AbstractRequestType.php index c8f062e..a981a11 100644 --- a/src/StructType/AbstractRequestType.php +++ b/src/StructType/AbstractRequestType.php @@ -6,7 +6,7 @@ /** * This class stands for AbstractRequestType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Base type definition of request payload that can carry any type of payload content with optional versioning information and detail level requirements. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ abstract class AbstractRequestType extends AbstractStructBase { /** * The DetailLevel - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This specifies the required detail level that is needed by a client application pertaining to a particular data component (e.g., Item, Transaction, etc.). The detail level is specified in the DetailLevelCodeType which has all the * enumerated values of the detail level for each component. * - maxOccurs: unbounded @@ -25,7 +25,7 @@ abstract class AbstractRequestType extends AbstractStructBase public $DetailLevel; /** * The ErrorLanguage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This should be the standard RFC 3066 language identification tag, e.g., en_US. * - minOccurs: 0 * @var string @@ -33,7 +33,7 @@ abstract class AbstractRequestType extends AbstractStructBase public $ErrorLanguage; /** * The Version - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This refers to the version of the request payload schema. * @var string */ @@ -70,6 +70,28 @@ public function getDetailLevel() { return $this->DetailLevel; } + /** + * This method is responsible for validating the values passed to the setDetailLevel method + * This method is willingly generated in order to preserve the one-line inline validation within the setDetailLevel method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateDetailLevelForArrayConstraintsFromSetDetailLevel(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $abstractRequestTypeDetailLevelItem) { + // validation for constraint: enumeration + if (!\PayPal\EnumType\DetailLevelCodeType::valueIsValid($abstractRequestTypeDetailLevelItem)) { + $invalidValues[] = is_object($abstractRequestTypeDetailLevelItem) ? get_class($abstractRequestTypeDetailLevelItem) : sprintf('%s(%s)', gettype($abstractRequestTypeDetailLevelItem), var_export($abstractRequestTypeDetailLevelItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\DetailLevelCodeType', is_array($invalidValues) ? implode(', ', $invalidValues) : var_export($invalidValues, true), implode(', ', \PayPal\EnumType\DetailLevelCodeType::getValidValues())); + } + unset($invalidValues); + return $message; + } /** * Set DetailLevel value * @uses \PayPal\EnumType\DetailLevelCodeType::valueIsValid() @@ -80,14 +102,9 @@ public function getDetailLevel() */ public function setDetailLevel(array $detailLevel = array()) { - $invalidValues = array(); - foreach ($detailLevel as $abstractRequestTypeDetailLevelItem) { - if (!\PayPal\EnumType\DetailLevelCodeType::valueIsValid($abstractRequestTypeDetailLevelItem)) { - $invalidValues[] = var_export($abstractRequestTypeDetailLevelItem, true); - } - } - if (!empty($invalidValues)) { - throw new \InvalidArgumentException(sprintf('Value(s) "%s" is/are invalid, please use one of: %s', implode(', ', $invalidValues), implode(', ', \PayPal\EnumType\DetailLevelCodeType::getValidValues())), __LINE__); + // validation for constraint: array + if ('' !== ($detailLevelArrayErrorMessage = self::validateDetailLevelForArrayConstraintsFromSetDetailLevel($detailLevel))) { + throw new \InvalidArgumentException($detailLevelArrayErrorMessage, __LINE__); } $this->DetailLevel = $detailLevel; return $this; @@ -104,7 +121,7 @@ public function addToDetailLevel($item) { // validation for constraint: enumeration if (!\PayPal\EnumType\DetailLevelCodeType::valueIsValid($item)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $item, implode(', ', \PayPal\EnumType\DetailLevelCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\DetailLevelCodeType', is_array($item) ? implode(', ', $item) : var_export($item, true), implode(', ', \PayPal\EnumType\DetailLevelCodeType::getValidValues())), __LINE__); } $this->DetailLevel[] = $item; return $this; @@ -126,7 +143,7 @@ public function setErrorLanguage($errorLanguage = null) { // validation for constraint: string if (!is_null($errorLanguage) && !is_string($errorLanguage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($errorLanguage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($errorLanguage, true), gettype($errorLanguage)), __LINE__); } $this->ErrorLanguage = $errorLanguage; return $this; @@ -148,7 +165,7 @@ public function setVersion($version = null) { // validation for constraint: string if (!is_null($version) && !is_string($version)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($version)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($version, true), gettype($version)), __LINE__); } $this->Version = $version; return $this; @@ -156,33 +173,29 @@ public function setVersion($version = null) /** * Get any value * @uses \DOMDocument::loadXML() - * @uses \DOMDocument::hasChildNodes() - * @uses \DOMDocument::saveXML() - * @uses \DOMNode::item() - * @uses \PayPal\StructType\AbstractRequestType::setAny() * @param bool $asString true: returns XML string, false: returns \DOMDocument * @return \DOMDocument|null */ public function getAny($asString = true) { - if (!empty($this->any) && !($this->any instanceof \DOMDocument)) { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->formatOutput = true; - if ($dom->loadXML($this->any)) { - $this->setAny($dom); - } - unset($dom); + $domDocument = null; + if (!empty($this->any) && !$asString) { + $domDocument = new \DOMDocument('1.0', 'UTF-8'); + $domDocument->loadXML($this->any); } - return ($asString && ($this->any instanceof \DOMDocument) && $this->any->hasChildNodes()) ? $this->any->saveXML($this->any->childNodes->item(0)) : $this->any; + return $asString ? $this->any : $domDocument; } /** * Set any value + * @uses \DOMDocument::hasChildNodes() + * @uses \DOMDocument::saveXML() + * @uses \DOMNode::item() * @param \DOMDocument $any * @return \PayPal\StructType\AbstractRequestType */ public function setAny(\DOMDocument $any = null) { - $this->any = $any; + $this->any = ($any instanceof \DOMDocument) && $any->hasChildNodes() ? $any->saveXML($any->childNodes->item(0)) : $any; return $this; } /** diff --git a/src/StructType/AbstractResponseType.php b/src/StructType/AbstractResponseType.php index 1472745..c23a335 100644 --- a/src/StructType/AbstractResponseType.php +++ b/src/StructType/AbstractResponseType.php @@ -6,7 +6,7 @@ /** * This class stands for AbstractResponseType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Base type definition of a response payload that can carry any type of payload content with following optional elements: - timestamp of response message, - application level acknowledgement, and - application-level errors and * warnings. * @subpackage Structs @@ -16,7 +16,7 @@ abstract class AbstractResponseType extends AbstractStructBase { /** * The Timestamp - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This value represents the date and time (GMT) when the response was generated by a service provider (as a result of processing of a request). * - minOccurs: 0 * @var string @@ -24,14 +24,14 @@ abstract class AbstractResponseType extends AbstractStructBase public $Timestamp; /** * The Ack - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Application level acknowledgement code. * @var string */ public $Ack; /** * The CorrelationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: CorrelationID may be used optionally with an application level acknowledgement. * - minOccurs: 0 * @var string @@ -39,7 +39,7 @@ abstract class AbstractResponseType extends AbstractStructBase public $CorrelationID; /** * The Errors - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var \PayPal\StructType\ErrorType[] @@ -47,14 +47,14 @@ abstract class AbstractResponseType extends AbstractStructBase public $Errors; /** * The Version - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This refers to the version of the response payload schema. * @var string */ public $Version; /** * The Build - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This refers to the specific software build that was used in the deployment for processing the request and generating the response. * @var string */ @@ -109,7 +109,7 @@ public function setTimestamp($timestamp = null) { // validation for constraint: string if (!is_null($timestamp) && !is_string($timestamp)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($timestamp)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($timestamp, true), gettype($timestamp)), __LINE__); } $this->Timestamp = $timestamp; return $this; @@ -134,7 +134,7 @@ public function setAck($ack = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AckCodeType::valueIsValid($ack)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $ack, implode(', ', \PayPal\EnumType\AckCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AckCodeType', is_array($ack) ? implode(', ', $ack) : var_export($ack, true), implode(', ', \PayPal\EnumType\AckCodeType::getValidValues())), __LINE__); } $this->Ack = $ack; return $this; @@ -156,7 +156,7 @@ public function setCorrelationID($correlationID = null) { // validation for constraint: string if (!is_null($correlationID) && !is_string($correlationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($correlationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($correlationID, true), gettype($correlationID)), __LINE__); } $this->CorrelationID = $correlationID; return $this; @@ -169,6 +169,28 @@ public function getErrors() { return $this->Errors; } + /** + * This method is responsible for validating the values passed to the setErrors method + * This method is willingly generated in order to preserve the one-line inline validation within the setErrors method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateErrorsForArrayConstraintsFromSetErrors(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $abstractResponseTypeErrorsItem) { + // validation for constraint: itemType + if (!$abstractResponseTypeErrorsItem instanceof \PayPal\StructType\ErrorType) { + $invalidValues[] = is_object($abstractResponseTypeErrorsItem) ? get_class($abstractResponseTypeErrorsItem) : sprintf('%s(%s)', gettype($abstractResponseTypeErrorsItem), var_export($abstractResponseTypeErrorsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Errors property can only contain items of type \PayPal\StructType\ErrorType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Errors value * @throws \InvalidArgumentException @@ -177,11 +199,9 @@ public function getErrors() */ public function setErrors(array $errors = array()) { - foreach ($errors as $abstractResponseTypeErrorsItem) { - // validation for constraint: itemType - if (!$abstractResponseTypeErrorsItem instanceof \PayPal\StructType\ErrorType) { - throw new \InvalidArgumentException(sprintf('The Errors property can only contain items of \PayPal\StructType\ErrorType, "%s" given', is_object($abstractResponseTypeErrorsItem) ? get_class($abstractResponseTypeErrorsItem) : gettype($abstractResponseTypeErrorsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($errorsArrayErrorMessage = self::validateErrorsForArrayConstraintsFromSetErrors($errors))) { + throw new \InvalidArgumentException($errorsArrayErrorMessage, __LINE__); } $this->Errors = $errors; return $this; @@ -196,7 +216,7 @@ public function addToErrors(\PayPal\StructType\ErrorType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\ErrorType) { - throw new \InvalidArgumentException(sprintf('The Errors property can only contain items of \PayPal\StructType\ErrorType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Errors property can only contain items of type \PayPal\StructType\ErrorType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Errors[] = $item; return $this; @@ -218,7 +238,7 @@ public function setVersion($version = null) { // validation for constraint: string if (!is_null($version) && !is_string($version)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($version)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($version, true), gettype($version)), __LINE__); } $this->Version = $version; return $this; @@ -240,7 +260,7 @@ public function setBuild($build = null) { // validation for constraint: string if (!is_null($build) && !is_string($build)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($build)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($build, true), gettype($build)), __LINE__); } $this->Build = $build; return $this; @@ -248,33 +268,29 @@ public function setBuild($build = null) /** * Get any value * @uses \DOMDocument::loadXML() - * @uses \DOMDocument::hasChildNodes() - * @uses \DOMDocument::saveXML() - * @uses \DOMNode::item() - * @uses \PayPal\StructType\AbstractResponseType::setAny() * @param bool $asString true: returns XML string, false: returns \DOMDocument * @return \DOMDocument|null */ public function getAny($asString = true) { - if (!empty($this->any) && !($this->any instanceof \DOMDocument)) { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->formatOutput = true; - if ($dom->loadXML($this->any)) { - $this->setAny($dom); - } - unset($dom); + $domDocument = null; + if (!empty($this->any) && !$asString) { + $domDocument = new \DOMDocument('1.0', 'UTF-8'); + $domDocument->loadXML($this->any); } - return ($asString && ($this->any instanceof \DOMDocument) && $this->any->hasChildNodes()) ? $this->any->saveXML($this->any->childNodes->item(0)) : $this->any; + return $asString ? $this->any : $domDocument; } /** * Set any value + * @uses \DOMDocument::hasChildNodes() + * @uses \DOMDocument::saveXML() + * @uses \DOMNode::item() * @param \DOMDocument $any * @return \PayPal\StructType\AbstractResponseType */ public function setAny(\DOMDocument $any = null) { - $this->any = $any; + $this->any = ($any instanceof \DOMDocument) && $any->hasChildNodes() ? $any->saveXML($any->childNodes->item(0)) : $any; return $this; } /** diff --git a/src/StructType/AccountEntryType.php b/src/StructType/AccountEntryType.php index 73532d8..d967435 100644 --- a/src/StructType/AccountEntryType.php +++ b/src/StructType/AccountEntryType.php @@ -6,8 +6,8 @@ /** * This class stands for AccountEntryType StructType - * Meta informations extracted from the WSDL - * - documentation: Balance as of a given entry, can be 0.00. | Item number if transaction is associated with an auction or 0 if no item is associated with an account entry. + * Meta information extracted from the WSDL + * - documentation: Item number if transaction is associated with an auction or 0 if no item is associated with an account entry. | Balance as of a given entry, can be 0.00. * @subpackage Structs * @author WsdlToPhp */ @@ -15,57 +15,58 @@ class AccountEntryType extends AbstractStructBase { /** * The Balance - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:Balance * @var \PayPal\StructType\AmountType */ public $Balance; /** * The Credit - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Credit Amount for a detail entry, can be 0.00. * @var \PayPal\StructType\AmountType */ public $Credit; /** * The Date - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date entry was posted, in GMT. * @var string */ public $Date; /** * The Debit - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Debit Amount for this detail entry, can be 0.00. * @var \PayPal\StructType\AmountType */ public $Debit; /** * The ItemID - * Meta informations extracted from the WSDL - * - ref: ns:ItemID + * Meta information extracted from the WSDL * - documentation: Represents the unique identifier for an item. To be used to specify the elements that represents an ItemID. + * - base: xs:string + * - ref: ns:ItemID * @var string */ public $ItemID; /** * The Memo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Memo line for an account entry, can be empty string. * @var string */ public $Memo; /** * The RefNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: eBay reference number for an account entry. * @var int */ public $RefNumber; /** * The AccountEntryDetailsType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Integer code for account details entry type. This element element specifies an index to a table of explanations for accounting charges. * @var int */ @@ -154,7 +155,7 @@ public function setDate($date = null) { // validation for constraint: string if (!is_null($date) && !is_string($date)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($date)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($date, true), gettype($date)), __LINE__); } $this->Date = $date; return $this; @@ -194,7 +195,7 @@ public function setItemID($itemID = null) { // validation for constraint: string if (!is_null($itemID) && !is_string($itemID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemID, true), gettype($itemID)), __LINE__); } $this->ItemID = $itemID; return $this; @@ -216,7 +217,7 @@ public function setMemo($memo = null) { // validation for constraint: string if (!is_null($memo) && !is_string($memo)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($memo)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($memo, true), gettype($memo)), __LINE__); } $this->Memo = $memo; return $this; @@ -237,8 +238,8 @@ public function getRefNumber() public function setRefNumber($refNumber = null) { // validation for constraint: int - if (!is_null($refNumber) && !is_numeric($refNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($refNumber)), __LINE__); + if (!is_null($refNumber) && !(is_int($refNumber) || ctype_digit($refNumber))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($refNumber, true), gettype($refNumber)), __LINE__); } $this->RefNumber = $refNumber; return $this; @@ -259,8 +260,8 @@ public function getAccountEntryDetailsType() public function setAccountEntryDetailsType($accountEntryDetailsType = null) { // validation for constraint: int - if (!is_null($accountEntryDetailsType) && !is_numeric($accountEntryDetailsType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($accountEntryDetailsType)), __LINE__); + if (!is_null($accountEntryDetailsType) && !(is_int($accountEntryDetailsType) || ctype_digit($accountEntryDetailsType))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($accountEntryDetailsType, true), gettype($accountEntryDetailsType)), __LINE__); } $this->AccountEntryDetailsType = $accountEntryDetailsType; return $this; diff --git a/src/StructType/AccountSummaryType.php b/src/StructType/AccountSummaryType.php index 46f4e6f..5d27c5e 100644 --- a/src/StructType/AccountSummaryType.php +++ b/src/StructType/AccountSummaryType.php @@ -6,8 +6,8 @@ /** * This class stands for AccountSummaryType StructType - * Meta informations extracted from the WSDL - * - documentation: Includes account summary for the user. | Amount past due, 0.00 if not past due. | User's current balance. Can be 0.00, positive, or negative. + * Meta information extracted from the WSDL + * - documentation: User's current balance. Can be 0.00, positive, or negative. | Amount past due, 0.00 if not past due. | Includes account summary for the user. * - mixed: true * @subpackage Structs * @author WsdlToPhp @@ -16,14 +16,22 @@ class AccountSummaryType extends AbstractStructBase { /** * The AccountState - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * - minOccurs: 0 * @var string */ public $AccountState; /** * The AdditionalAccount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * - maxOccurs: unbounded * - minOccurs: 0 * @var \PayPal\StructType\AdditionalAccountType[] @@ -31,14 +39,22 @@ class AccountSummaryType extends AbstractStructBase public $AdditionalAccount; /** * The AdditionalAccountsCount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Number of additional accounts. + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var int */ public $AdditionalAccountsCount; /** * The AmountPastDue - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * - minOccurs: 0 * - ref: ns:AmountPastDue * @var \PayPal\StructType\AmountType @@ -46,92 +62,144 @@ class AccountSummaryType extends AbstractStructBase public $AmountPastDue; /** * The BankAccountInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: First four digits (with remainder Xed-out). This may be an empty string depending upon the value of the payment type for the user account (e.g, if no debit-card specified). + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var string */ public $BankAccountInfo; /** * The BankModifyDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Last time/day BankAccountInfo and/or BankRoutingInfo was modified, in GMT. This may be an empty string depending upon the value of the payment type for the user account (e.g, if no debit-card specified). + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var string */ public $BankModifyDate; /** * The BillingCycleDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates the billing cycle in which eBay sends a billing invoice to the specified user. Possible values: 0 = On the last day of the month. 15 = On the 15th day of the month. + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var string */ public $BillingCycleDate; /** * The CCExp - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Expiration date for the credit card selected as payment method, in GMT. Empty string if no credit card is on file or if account is inactive -- even if there is a credit card on file. + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var string */ public $CCExp; /** * The CCInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Last four digits of user's credit card selected as payment type. Empty string if no credit is on file. This may be an empty string depending upon the value of the payment type for the user account (e.g, if no debit-card specified). + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var string */ public $CCInfo; /** * The CCModifyDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Last date credit card or credit card expiration date was modified, in GMT. This may be an empty string depending upon the value of the payment type for the user account (e.g, Empty string if no credit card is on file. + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var string */ public $CCModifyDate; /** * The CurrentBalance - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * - ref: ns:CurrentBalance * @var \PayPal\StructType\AmountType */ public $CurrentBalance; /** * The LastAmountPaid - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of last payment posted, 0.00 if no payments posted. + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var \PayPal\StructType\AmountType */ public $LastAmountPaid; /** * The LastInvoiceAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of last invoice. 0.00 if account not yet invoiced. + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var \PayPal\StructType\AmountType */ public $LastInvoiceAmount; /** * The LastInvoiceDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date of last invoice sent by eBay to the user, in GMT. Empty string if this account has not been invoiced yet. + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var string */ public $LastInvoiceDate; /** * The LastPaymentDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date of last payment by specified user to eBay, in GMT. Empty string if no payments posted. + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var string */ public $LastPaymentDate; /** * The PastDue - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether the account has past due amounts outstanding. Possible values: true = Account is past due. false = Account is current. + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var bool */ public $PastDue; /** * The PaymentMethod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates the method the specified user selected for paying eBay. The values for PaymentType vary for each SiteID. + * - choice: AccountState | AdditionalAccount | AdditionalAccountsCount | AmountPastDue | BankAccountInfo | BankModifyDate | BillingCycleDate | CCExp | CCInfo | CCModifyDate | CurrentBalance | LastAmountPaid | LastInvoiceAmount | LastInvoiceDate | + * LastPaymentDate | PastDue | PaymentMethod + * - choiceMaxOccurs: unbounded + * - choiceMinOccurs: 0 * @var string */ public $PaymentMethod; @@ -199,10 +267,56 @@ public function __construct($accountState = null, array $additionalAccount = arr */ public function getAccountState() { - return $this->AccountState; + return isset($this->AccountState) ? $this->AccountState : null; + } + /** + * This method is responsible for validating the value passed to the setAccountState method + * This method is willingly generated in order to preserve the one-line inline validation within the setAccountState method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateAccountStateForChoiceConstraintsFromSetAccountState($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property AccountState can\'t be set as the property %s is already set. Only one property must be set among these properties: AccountState, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set AccountState value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @uses \PayPal\EnumType\AccountStateCodeType::valueIsValid() * @uses \PayPal\EnumType\AccountStateCodeType::getValidValues() * @throws \InvalidArgumentException @@ -213,9 +327,17 @@ public function setAccountState($accountState = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AccountStateCodeType::valueIsValid($accountState)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $accountState, implode(', ', \PayPal\EnumType\AccountStateCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AccountStateCodeType', is_array($accountState) ? implode(', ', $accountState) : var_export($accountState, true), implode(', ', \PayPal\EnumType\AccountStateCodeType::getValidValues())), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($accountStateChoiceErrorMessage = self::validateAccountStateForChoiceConstraintsFromSetAccountState($accountState))) { + throw new \InvalidArgumentException($accountStateChoiceErrorMessage, __LINE__); + } + if (is_null($accountState) || (is_array($accountState) && empty($accountState))) { + unset($this->AccountState); + } else { + $this->AccountState = $accountState; } - $this->AccountState = $accountState; return $this; } /** @@ -224,25 +346,141 @@ public function setAccountState($accountState = null) */ public function getAdditionalAccount() { - return $this->AdditionalAccount; + return isset($this->AdditionalAccount) ? $this->AdditionalAccount : null; + } + /** + * This method is responsible for validating the values passed to the setAdditionalAccount method + * This method is willingly generated in order to preserve the one-line inline validation within the setAdditionalAccount method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateAdditionalAccountForArrayConstraintsFromSetAdditionalAccount(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $accountSummaryTypeAdditionalAccountItem) { + // validation for constraint: itemType + if (!$accountSummaryTypeAdditionalAccountItem instanceof \PayPal\StructType\AdditionalAccountType) { + $invalidValues[] = is_object($accountSummaryTypeAdditionalAccountItem) ? get_class($accountSummaryTypeAdditionalAccountItem) : sprintf('%s(%s)', gettype($accountSummaryTypeAdditionalAccountItem), var_export($accountSummaryTypeAdditionalAccountItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The AdditionalAccount property can only contain items of type \PayPal\StructType\AdditionalAccountType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } + /** + * This method is responsible for validating the value passed to the setAdditionalAccount method + * This method is willingly generated in order to preserve the one-line inline validation within the setAdditionalAccount method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateAdditionalAccountForChoiceConstraintsFromSetAdditionalAccount($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property AdditionalAccount can\'t be set as the property %s is already set. Only one property must be set among these properties: AdditionalAccount, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set AdditionalAccount value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @throws \InvalidArgumentException * @param \PayPal\StructType\AdditionalAccountType[] $additionalAccount * @return \PayPal\StructType\AccountSummaryType */ public function setAdditionalAccount(array $additionalAccount = array()) { - foreach ($additionalAccount as $accountSummaryTypeAdditionalAccountItem) { - // validation for constraint: itemType - if (!$accountSummaryTypeAdditionalAccountItem instanceof \PayPal\StructType\AdditionalAccountType) { - throw new \InvalidArgumentException(sprintf('The AdditionalAccount property can only contain items of \PayPal\StructType\AdditionalAccountType, "%s" given', is_object($accountSummaryTypeAdditionalAccountItem) ? get_class($accountSummaryTypeAdditionalAccountItem) : gettype($accountSummaryTypeAdditionalAccountItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($additionalAccountArrayErrorMessage = self::validateAdditionalAccountForArrayConstraintsFromSetAdditionalAccount($additionalAccount))) { + throw new \InvalidArgumentException($additionalAccountArrayErrorMessage, __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($additionalAccountChoiceErrorMessage = self::validateAdditionalAccountForChoiceConstraintsFromSetAdditionalAccount($additionalAccount))) { + throw new \InvalidArgumentException($additionalAccountChoiceErrorMessage, __LINE__); + } + if (is_null($additionalAccount) || (is_array($additionalAccount) && empty($additionalAccount))) { + unset($this->AdditionalAccount); + } else { + $this->AdditionalAccount = $additionalAccount; } - $this->AdditionalAccount = $additionalAccount; return $this; } + /** + * This method is responsible for validating the value passed to the addToAdditionalAccount method + * This method is willingly generated in order to preserve the one-line inline validation within the addToAdditionalAccount method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateItemForChoiceConstraintsFromAddToAdditionalAccount($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property AdditionalAccount can\'t be set as the property %s is already set. Only one property must be set among these properties: AdditionalAccount, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; + } /** * Add item to AdditionalAccount value * @throws \InvalidArgumentException @@ -253,7 +491,11 @@ public function addToAdditionalAccount(\PayPal\StructType\AdditionalAccountType { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\AdditionalAccountType) { - throw new \InvalidArgumentException(sprintf('The AdditionalAccount property can only contain items of \PayPal\StructType\AdditionalAccountType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The AdditionalAccount property can only contain items of type \PayPal\StructType\AdditionalAccountType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($itemChoiceErrorMessage = self::validateItemForChoiceConstraintsFromAddToAdditionalAccount($item))) { + throw new \InvalidArgumentException($itemChoiceErrorMessage, __LINE__); } $this->AdditionalAccount[] = $item; return $this; @@ -264,20 +506,74 @@ public function addToAdditionalAccount(\PayPal\StructType\AdditionalAccountType */ public function getAdditionalAccountsCount() { - return $this->AdditionalAccountsCount; + return isset($this->AdditionalAccountsCount) ? $this->AdditionalAccountsCount : null; + } + /** + * This method is responsible for validating the value passed to the setAdditionalAccountsCount method + * This method is willingly generated in order to preserve the one-line inline validation within the setAdditionalAccountsCount method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateAdditionalAccountsCountForChoiceConstraintsFromSetAdditionalAccountsCount($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property AdditionalAccountsCount can\'t be set as the property %s is already set. Only one property must be set among these properties: AdditionalAccountsCount, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set AdditionalAccountsCount value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param int $additionalAccountsCount * @return \PayPal\StructType\AccountSummaryType */ public function setAdditionalAccountsCount($additionalAccountsCount = null) { // validation for constraint: int - if (!is_null($additionalAccountsCount) && !is_numeric($additionalAccountsCount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($additionalAccountsCount)), __LINE__); + if (!is_null($additionalAccountsCount) && !(is_int($additionalAccountsCount) || ctype_digit($additionalAccountsCount))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($additionalAccountsCount, true), gettype($additionalAccountsCount)), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($additionalAccountsCountChoiceErrorMessage = self::validateAdditionalAccountsCountForChoiceConstraintsFromSetAdditionalAccountsCount($additionalAccountsCount))) { + throw new \InvalidArgumentException($additionalAccountsCountChoiceErrorMessage, __LINE__); + } + if (is_null($additionalAccountsCount) || (is_array($additionalAccountsCount) && empty($additionalAccountsCount))) { + unset($this->AdditionalAccountsCount); + } else { + $this->AdditionalAccountsCount = $additionalAccountsCount; } - $this->AdditionalAccountsCount = $additionalAccountsCount; return $this; } /** @@ -286,16 +582,70 @@ public function setAdditionalAccountsCount($additionalAccountsCount = null) */ public function getAmountPastDue() { - return $this->AmountPastDue; + return isset($this->AmountPastDue) ? $this->AmountPastDue : null; + } + /** + * This method is responsible for validating the value passed to the setAmountPastDue method + * This method is willingly generated in order to preserve the one-line inline validation within the setAmountPastDue method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateAmountPastDueForChoiceConstraintsFromSetAmountPastDue($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property AmountPastDue can\'t be set as the property %s is already set. Only one property must be set among these properties: AmountPastDue, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set AmountPastDue value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param \PayPal\StructType\AmountType $amountPastDue * @return \PayPal\StructType\AccountSummaryType */ public function setAmountPastDue(\PayPal\StructType\AmountType $amountPastDue = null) { - $this->AmountPastDue = $amountPastDue; + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($amountPastDueChoiceErrorMessage = self::validateAmountPastDueForChoiceConstraintsFromSetAmountPastDue($amountPastDue))) { + throw new \InvalidArgumentException($amountPastDueChoiceErrorMessage, __LINE__); + } + if (is_null($amountPastDue) || (is_array($amountPastDue) && empty($amountPastDue))) { + unset($this->AmountPastDue); + } else { + $this->AmountPastDue = $amountPastDue; + } return $this; } /** @@ -304,10 +654,56 @@ public function setAmountPastDue(\PayPal\StructType\AmountType $amountPastDue = */ public function getBankAccountInfo() { - return $this->BankAccountInfo; + return isset($this->BankAccountInfo) ? $this->BankAccountInfo : null; + } + /** + * This method is responsible for validating the value passed to the setBankAccountInfo method + * This method is willingly generated in order to preserve the one-line inline validation within the setBankAccountInfo method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateBankAccountInfoForChoiceConstraintsFromSetBankAccountInfo($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property BankAccountInfo can\'t be set as the property %s is already set. Only one property must be set among these properties: BankAccountInfo, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set BankAccountInfo value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param string $bankAccountInfo * @return \PayPal\StructType\AccountSummaryType */ @@ -315,9 +711,17 @@ public function setBankAccountInfo($bankAccountInfo = null) { // validation for constraint: string if (!is_null($bankAccountInfo) && !is_string($bankAccountInfo)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($bankAccountInfo)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bankAccountInfo, true), gettype($bankAccountInfo)), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($bankAccountInfoChoiceErrorMessage = self::validateBankAccountInfoForChoiceConstraintsFromSetBankAccountInfo($bankAccountInfo))) { + throw new \InvalidArgumentException($bankAccountInfoChoiceErrorMessage, __LINE__); + } + if (is_null($bankAccountInfo) || (is_array($bankAccountInfo) && empty($bankAccountInfo))) { + unset($this->BankAccountInfo); + } else { + $this->BankAccountInfo = $bankAccountInfo; } - $this->BankAccountInfo = $bankAccountInfo; return $this; } /** @@ -326,10 +730,56 @@ public function setBankAccountInfo($bankAccountInfo = null) */ public function getBankModifyDate() { - return $this->BankModifyDate; + return isset($this->BankModifyDate) ? $this->BankModifyDate : null; + } + /** + * This method is responsible for validating the value passed to the setBankModifyDate method + * This method is willingly generated in order to preserve the one-line inline validation within the setBankModifyDate method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateBankModifyDateForChoiceConstraintsFromSetBankModifyDate($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property BankModifyDate can\'t be set as the property %s is already set. Only one property must be set among these properties: BankModifyDate, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set BankModifyDate value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param string $bankModifyDate * @return \PayPal\StructType\AccountSummaryType */ @@ -337,9 +787,17 @@ public function setBankModifyDate($bankModifyDate = null) { // validation for constraint: string if (!is_null($bankModifyDate) && !is_string($bankModifyDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($bankModifyDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bankModifyDate, true), gettype($bankModifyDate)), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($bankModifyDateChoiceErrorMessage = self::validateBankModifyDateForChoiceConstraintsFromSetBankModifyDate($bankModifyDate))) { + throw new \InvalidArgumentException($bankModifyDateChoiceErrorMessage, __LINE__); + } + if (is_null($bankModifyDate) || (is_array($bankModifyDate) && empty($bankModifyDate))) { + unset($this->BankModifyDate); + } else { + $this->BankModifyDate = $bankModifyDate; } - $this->BankModifyDate = $bankModifyDate; return $this; } /** @@ -348,10 +806,56 @@ public function setBankModifyDate($bankModifyDate = null) */ public function getBillingCycleDate() { - return $this->BillingCycleDate; + return isset($this->BillingCycleDate) ? $this->BillingCycleDate : null; + } + /** + * This method is responsible for validating the value passed to the setBillingCycleDate method + * This method is willingly generated in order to preserve the one-line inline validation within the setBillingCycleDate method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateBillingCycleDateForChoiceConstraintsFromSetBillingCycleDate($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property BillingCycleDate can\'t be set as the property %s is already set. Only one property must be set among these properties: BillingCycleDate, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set BillingCycleDate value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param string $billingCycleDate * @return \PayPal\StructType\AccountSummaryType */ @@ -359,9 +863,17 @@ public function setBillingCycleDate($billingCycleDate = null) { // validation for constraint: string if (!is_null($billingCycleDate) && !is_string($billingCycleDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingCycleDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingCycleDate, true), gettype($billingCycleDate)), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($billingCycleDateChoiceErrorMessage = self::validateBillingCycleDateForChoiceConstraintsFromSetBillingCycleDate($billingCycleDate))) { + throw new \InvalidArgumentException($billingCycleDateChoiceErrorMessage, __LINE__); + } + if (is_null($billingCycleDate) || (is_array($billingCycleDate) && empty($billingCycleDate))) { + unset($this->BillingCycleDate); + } else { + $this->BillingCycleDate = $billingCycleDate; } - $this->BillingCycleDate = $billingCycleDate; return $this; } /** @@ -370,10 +882,56 @@ public function setBillingCycleDate($billingCycleDate = null) */ public function getCCExp() { - return $this->CCExp; + return isset($this->CCExp) ? $this->CCExp : null; + } + /** + * This method is responsible for validating the value passed to the setCCExp method + * This method is willingly generated in order to preserve the one-line inline validation within the setCCExp method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateCCExpForChoiceConstraintsFromSetCCExp($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property CCExp can\'t be set as the property %s is already set. Only one property must be set among these properties: CCExp, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set CCExp value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param string $cCExp * @return \PayPal\StructType\AccountSummaryType */ @@ -381,9 +939,17 @@ public function setCCExp($cCExp = null) { // validation for constraint: string if (!is_null($cCExp) && !is_string($cCExp)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cCExp)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cCExp, true), gettype($cCExp)), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($cCExpChoiceErrorMessage = self::validateCCExpForChoiceConstraintsFromSetCCExp($cCExp))) { + throw new \InvalidArgumentException($cCExpChoiceErrorMessage, __LINE__); + } + if (is_null($cCExp) || (is_array($cCExp) && empty($cCExp))) { + unset($this->CCExp); + } else { + $this->CCExp = $cCExp; } - $this->CCExp = $cCExp; return $this; } /** @@ -392,10 +958,56 @@ public function setCCExp($cCExp = null) */ public function getCCInfo() { - return $this->CCInfo; + return isset($this->CCInfo) ? $this->CCInfo : null; + } + /** + * This method is responsible for validating the value passed to the setCCInfo method + * This method is willingly generated in order to preserve the one-line inline validation within the setCCInfo method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateCCInfoForChoiceConstraintsFromSetCCInfo($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property CCInfo can\'t be set as the property %s is already set. Only one property must be set among these properties: CCInfo, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set CCInfo value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param string $cCInfo * @return \PayPal\StructType\AccountSummaryType */ @@ -403,9 +1015,17 @@ public function setCCInfo($cCInfo = null) { // validation for constraint: string if (!is_null($cCInfo) && !is_string($cCInfo)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cCInfo)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cCInfo, true), gettype($cCInfo)), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($cCInfoChoiceErrorMessage = self::validateCCInfoForChoiceConstraintsFromSetCCInfo($cCInfo))) { + throw new \InvalidArgumentException($cCInfoChoiceErrorMessage, __LINE__); + } + if (is_null($cCInfo) || (is_array($cCInfo) && empty($cCInfo))) { + unset($this->CCInfo); + } else { + $this->CCInfo = $cCInfo; } - $this->CCInfo = $cCInfo; return $this; } /** @@ -414,10 +1034,56 @@ public function setCCInfo($cCInfo = null) */ public function getCCModifyDate() { - return $this->CCModifyDate; + return isset($this->CCModifyDate) ? $this->CCModifyDate : null; + } + /** + * This method is responsible for validating the value passed to the setCCModifyDate method + * This method is willingly generated in order to preserve the one-line inline validation within the setCCModifyDate method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateCCModifyDateForChoiceConstraintsFromSetCCModifyDate($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property CCModifyDate can\'t be set as the property %s is already set. Only one property must be set among these properties: CCModifyDate, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set CCModifyDate value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param string $cCModifyDate * @return \PayPal\StructType\AccountSummaryType */ @@ -425,9 +1091,17 @@ public function setCCModifyDate($cCModifyDate = null) { // validation for constraint: string if (!is_null($cCModifyDate) && !is_string($cCModifyDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cCModifyDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cCModifyDate, true), gettype($cCModifyDate)), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($cCModifyDateChoiceErrorMessage = self::validateCCModifyDateForChoiceConstraintsFromSetCCModifyDate($cCModifyDate))) { + throw new \InvalidArgumentException($cCModifyDateChoiceErrorMessage, __LINE__); + } + if (is_null($cCModifyDate) || (is_array($cCModifyDate) && empty($cCModifyDate))) { + unset($this->CCModifyDate); + } else { + $this->CCModifyDate = $cCModifyDate; } - $this->CCModifyDate = $cCModifyDate; return $this; } /** @@ -436,16 +1110,70 @@ public function setCCModifyDate($cCModifyDate = null) */ public function getCurrentBalance() { - return $this->CurrentBalance; + return isset($this->CurrentBalance) ? $this->CurrentBalance : null; + } + /** + * This method is responsible for validating the value passed to the setCurrentBalance method + * This method is willingly generated in order to preserve the one-line inline validation within the setCurrentBalance method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateCurrentBalanceForChoiceConstraintsFromSetCurrentBalance($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property CurrentBalance can\'t be set as the property %s is already set. Only one property must be set among these properties: CurrentBalance, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set CurrentBalance value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param \PayPal\StructType\AmountType $currentBalance * @return \PayPal\StructType\AccountSummaryType */ public function setCurrentBalance(\PayPal\StructType\AmountType $currentBalance = null) { - $this->CurrentBalance = $currentBalance; + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($currentBalanceChoiceErrorMessage = self::validateCurrentBalanceForChoiceConstraintsFromSetCurrentBalance($currentBalance))) { + throw new \InvalidArgumentException($currentBalanceChoiceErrorMessage, __LINE__); + } + if (is_null($currentBalance) || (is_array($currentBalance) && empty($currentBalance))) { + unset($this->CurrentBalance); + } else { + $this->CurrentBalance = $currentBalance; + } return $this; } /** @@ -454,16 +1182,70 @@ public function setCurrentBalance(\PayPal\StructType\AmountType $currentBalance */ public function getLastAmountPaid() { - return $this->LastAmountPaid; + return isset($this->LastAmountPaid) ? $this->LastAmountPaid : null; + } + /** + * This method is responsible for validating the value passed to the setLastAmountPaid method + * This method is willingly generated in order to preserve the one-line inline validation within the setLastAmountPaid method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateLastAmountPaidForChoiceConstraintsFromSetLastAmountPaid($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property LastAmountPaid can\'t be set as the property %s is already set. Only one property must be set among these properties: LastAmountPaid, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set LastAmountPaid value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param \PayPal\StructType\AmountType $lastAmountPaid * @return \PayPal\StructType\AccountSummaryType */ public function setLastAmountPaid(\PayPal\StructType\AmountType $lastAmountPaid = null) { - $this->LastAmountPaid = $lastAmountPaid; + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($lastAmountPaidChoiceErrorMessage = self::validateLastAmountPaidForChoiceConstraintsFromSetLastAmountPaid($lastAmountPaid))) { + throw new \InvalidArgumentException($lastAmountPaidChoiceErrorMessage, __LINE__); + } + if (is_null($lastAmountPaid) || (is_array($lastAmountPaid) && empty($lastAmountPaid))) { + unset($this->LastAmountPaid); + } else { + $this->LastAmountPaid = $lastAmountPaid; + } return $this; } /** @@ -472,16 +1254,70 @@ public function setLastAmountPaid(\PayPal\StructType\AmountType $lastAmountPaid */ public function getLastInvoiceAmount() { - return $this->LastInvoiceAmount; + return isset($this->LastInvoiceAmount) ? $this->LastInvoiceAmount : null; + } + /** + * This method is responsible for validating the value passed to the setLastInvoiceAmount method + * This method is willingly generated in order to preserve the one-line inline validation within the setLastInvoiceAmount method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateLastInvoiceAmountForChoiceConstraintsFromSetLastInvoiceAmount($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property LastInvoiceAmount can\'t be set as the property %s is already set. Only one property must be set among these properties: LastInvoiceAmount, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set LastInvoiceAmount value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param \PayPal\StructType\AmountType $lastInvoiceAmount * @return \PayPal\StructType\AccountSummaryType */ public function setLastInvoiceAmount(\PayPal\StructType\AmountType $lastInvoiceAmount = null) { - $this->LastInvoiceAmount = $lastInvoiceAmount; + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($lastInvoiceAmountChoiceErrorMessage = self::validateLastInvoiceAmountForChoiceConstraintsFromSetLastInvoiceAmount($lastInvoiceAmount))) { + throw new \InvalidArgumentException($lastInvoiceAmountChoiceErrorMessage, __LINE__); + } + if (is_null($lastInvoiceAmount) || (is_array($lastInvoiceAmount) && empty($lastInvoiceAmount))) { + unset($this->LastInvoiceAmount); + } else { + $this->LastInvoiceAmount = $lastInvoiceAmount; + } return $this; } /** @@ -490,10 +1326,56 @@ public function setLastInvoiceAmount(\PayPal\StructType\AmountType $lastInvoiceA */ public function getLastInvoiceDate() { - return $this->LastInvoiceDate; + return isset($this->LastInvoiceDate) ? $this->LastInvoiceDate : null; + } + /** + * This method is responsible for validating the value passed to the setLastInvoiceDate method + * This method is willingly generated in order to preserve the one-line inline validation within the setLastInvoiceDate method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateLastInvoiceDateForChoiceConstraintsFromSetLastInvoiceDate($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastPaymentDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property LastInvoiceDate can\'t be set as the property %s is already set. Only one property must be set among these properties: LastInvoiceDate, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set LastInvoiceDate value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param string $lastInvoiceDate * @return \PayPal\StructType\AccountSummaryType */ @@ -501,9 +1383,17 @@ public function setLastInvoiceDate($lastInvoiceDate = null) { // validation for constraint: string if (!is_null($lastInvoiceDate) && !is_string($lastInvoiceDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastInvoiceDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastInvoiceDate, true), gettype($lastInvoiceDate)), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($lastInvoiceDateChoiceErrorMessage = self::validateLastInvoiceDateForChoiceConstraintsFromSetLastInvoiceDate($lastInvoiceDate))) { + throw new \InvalidArgumentException($lastInvoiceDateChoiceErrorMessage, __LINE__); + } + if (is_null($lastInvoiceDate) || (is_array($lastInvoiceDate) && empty($lastInvoiceDate))) { + unset($this->LastInvoiceDate); + } else { + $this->LastInvoiceDate = $lastInvoiceDate; } - $this->LastInvoiceDate = $lastInvoiceDate; return $this; } /** @@ -512,10 +1402,56 @@ public function setLastInvoiceDate($lastInvoiceDate = null) */ public function getLastPaymentDate() { - return $this->LastPaymentDate; + return isset($this->LastPaymentDate) ? $this->LastPaymentDate : null; + } + /** + * This method is responsible for validating the value passed to the setLastPaymentDate method + * This method is willingly generated in order to preserve the one-line inline validation within the setLastPaymentDate method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validateLastPaymentDateForChoiceConstraintsFromSetLastPaymentDate($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'PastDue', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property LastPaymentDate can\'t be set as the property %s is already set. Only one property must be set among these properties: LastPaymentDate, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set LastPaymentDate value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param string $lastPaymentDate * @return \PayPal\StructType\AccountSummaryType */ @@ -523,9 +1459,17 @@ public function setLastPaymentDate($lastPaymentDate = null) { // validation for constraint: string if (!is_null($lastPaymentDate) && !is_string($lastPaymentDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastPaymentDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastPaymentDate, true), gettype($lastPaymentDate)), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($lastPaymentDateChoiceErrorMessage = self::validateLastPaymentDateForChoiceConstraintsFromSetLastPaymentDate($lastPaymentDate))) { + throw new \InvalidArgumentException($lastPaymentDateChoiceErrorMessage, __LINE__); + } + if (is_null($lastPaymentDate) || (is_array($lastPaymentDate) && empty($lastPaymentDate))) { + unset($this->LastPaymentDate); + } else { + $this->LastPaymentDate = $lastPaymentDate; } - $this->LastPaymentDate = $lastPaymentDate; return $this; } /** @@ -534,10 +1478,56 @@ public function setLastPaymentDate($lastPaymentDate = null) */ public function getPastDue() { - return $this->PastDue; + return isset($this->PastDue) ? $this->PastDue : null; + } + /** + * This method is responsible for validating the value passed to the setPastDue method + * This method is willingly generated in order to preserve the one-line inline validation within the setPastDue method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validatePastDueForChoiceConstraintsFromSetPastDue($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PaymentMethod', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property PastDue can\'t be set as the property %s is already set. Only one property must be set among these properties: PastDue, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set PastDue value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @param bool $pastDue * @return \PayPal\StructType\AccountSummaryType */ @@ -545,9 +1535,17 @@ public function setPastDue($pastDue = null) { // validation for constraint: boolean if (!is_null($pastDue) && !is_bool($pastDue)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($pastDue)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($pastDue, true), gettype($pastDue)), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($pastDueChoiceErrorMessage = self::validatePastDueForChoiceConstraintsFromSetPastDue($pastDue))) { + throw new \InvalidArgumentException($pastDueChoiceErrorMessage, __LINE__); + } + if (is_null($pastDue) || (is_array($pastDue) && empty($pastDue))) { + unset($this->PastDue); + } else { + $this->PastDue = $pastDue; } - $this->PastDue = $pastDue; return $this; } /** @@ -556,10 +1554,56 @@ public function setPastDue($pastDue = null) */ public function getPaymentMethod() { - return $this->PaymentMethod; + return isset($this->PaymentMethod) ? $this->PaymentMethod : null; + } + /** + * This method is responsible for validating the value passed to the setPaymentMethod method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentMethod method + * This has to validate that the property which is being set is the only one among the given choices + * @param mixed $value + * @return string A non-empty message if the values does not match the validation rules + */ + public function validatePaymentMethodForChoiceConstraintsFromSetPaymentMethod($value) + { + $message = ''; + if (is_null($value)) { + return $message; + } + $properties = [ + 'AccountState', + 'AdditionalAccount', + 'AdditionalAccountsCount', + 'AmountPastDue', + 'BankAccountInfo', + 'BankModifyDate', + 'BillingCycleDate', + 'CCExp', + 'CCInfo', + 'CCModifyDate', + 'CurrentBalance', + 'LastAmountPaid', + 'LastInvoiceAmount', + 'LastInvoiceDate', + 'LastPaymentDate', + 'PastDue', + ]; + try { + foreach ($properties as $property) { + if (isset($this->{$property})) { + throw new \InvalidArgumentException(sprintf('The property PaymentMethod can\'t be set as the property %s is already set. Only one property must be set among these properties: PaymentMethod, %s.', $property, implode(', ', $properties)), __LINE__); + } + } + } catch (\InvalidArgumentException $e) { + $message = $e->getMessage(); + } + return $message; } /** * Set PaymentMethod value + * This property belongs to a choice that allows only one property to exist. It is + * therefore removable from the request, consequently if the value assigned to this + * property is null, the property is removed from this object + * @throws \InvalidArgumentException * @uses \PayPal\EnumType\SellerPaymentMethodCodeType::valueIsValid() * @uses \PayPal\EnumType\SellerPaymentMethodCodeType::getValidValues() * @throws \InvalidArgumentException @@ -570,9 +1614,17 @@ public function setPaymentMethod($paymentMethod = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SellerPaymentMethodCodeType::valueIsValid($paymentMethod)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentMethod, implode(', ', \PayPal\EnumType\SellerPaymentMethodCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SellerPaymentMethodCodeType', is_array($paymentMethod) ? implode(', ', $paymentMethod) : var_export($paymentMethod, true), implode(', ', \PayPal\EnumType\SellerPaymentMethodCodeType::getValidValues())), __LINE__); + } + // validation for constraint: choice(AccountState, AdditionalAccount, AdditionalAccountsCount, AmountPastDue, BankAccountInfo, BankModifyDate, BillingCycleDate, CCExp, CCInfo, CCModifyDate, CurrentBalance, LastAmountPaid, LastInvoiceAmount, LastInvoiceDate, LastPaymentDate, PastDue, PaymentMethod) + if ('' !== ($paymentMethodChoiceErrorMessage = self::validatePaymentMethodForChoiceConstraintsFromSetPaymentMethod($paymentMethod))) { + throw new \InvalidArgumentException($paymentMethodChoiceErrorMessage, __LINE__); + } + if (is_null($paymentMethod) || (is_array($paymentMethod) && empty($paymentMethod))) { + unset($this->PaymentMethod); + } else { + $this->PaymentMethod = $paymentMethod; } - $this->PaymentMethod = $paymentMethod; return $this; } /** diff --git a/src/StructType/ActivationDetailsType.php b/src/StructType/ActivationDetailsType.php index 7ca9026..6e76263 100644 --- a/src/StructType/ActivationDetailsType.php +++ b/src/StructType/ActivationDetailsType.php @@ -13,7 +13,7 @@ class ActivationDetailsType extends AbstractStructBase { /** * The InitialAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var \PayPal\StructType\BasicAmountType @@ -21,7 +21,7 @@ class ActivationDetailsType extends AbstractStructBase public $InitialAmount; /** * The FailedInitialAmountAction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -78,7 +78,7 @@ public function setFailedInitialAmountAction($failedInitialAmountAction = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\FailedPaymentActionType::valueIsValid($failedInitialAmountAction)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $failedInitialAmountAction, implode(', ', \PayPal\EnumType\FailedPaymentActionType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\FailedPaymentActionType', is_array($failedInitialAmountAction) ? implode(', ', $failedInitialAmountAction) : var_export($failedInitialAmountAction, true), implode(', ', \PayPal\EnumType\FailedPaymentActionType::getValidValues())), __LINE__); } $this->FailedInitialAmountAction = $failedInitialAmountAction; return $this; diff --git a/src/StructType/AdditionalAccountType.php b/src/StructType/AdditionalAccountType.php index 2ac9400..0718a5c 100644 --- a/src/StructType/AdditionalAccountType.php +++ b/src/StructType/AdditionalAccountType.php @@ -6,7 +6,7 @@ /** * This class stands for AdditionalAccountType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The AdditionalAccount component represents historical data related to accounts that the user held with a country of residency other than the current one. eBay users can have one active account at a time. For users who change their * country of residency and modify their eBay registration to reflect this change, the new country of residence becomes the currently active account. Any account associated with a previous country is treated as an additional account. Because the * currency for these additional accounts are different than the active account, each additional account includes an indicator of the currency for that account. Users who never change their country of residence will not have any additional accounts. @@ -17,21 +17,21 @@ class AdditionalAccountType extends AbstractStructBase { /** * The Balance - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:Balance * @var \PayPal\StructType\AmountType */ public $Balance; /** * The Currency - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:Currency * @var string */ public $Currency; /** * The AccountCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:AccountCode * @var string */ @@ -90,7 +90,7 @@ public function setCurrency($currency = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CurrencyCodeType::valueIsValid($currency)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $currency, implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CurrencyCodeType', is_array($currency) ? implode(', ', $currency) : var_export($currency, true), implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); } $this->Currency = $currency; return $this; @@ -112,7 +112,7 @@ public function setAccountCode($accountCode = null) { // validation for constraint: string if (!is_null($accountCode) && !is_string($accountCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($accountCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($accountCode, true), gettype($accountCode)), __LINE__); } $this->AccountCode = $accountCode; return $this; diff --git a/src/StructType/AdditionalFeeType.php b/src/StructType/AdditionalFeeType.php index 4166dd5..f75eb03 100644 --- a/src/StructType/AdditionalFeeType.php +++ b/src/StructType/AdditionalFeeType.php @@ -13,7 +13,7 @@ class AdditionalFeeType extends AbstractStructBase { /** * The Type - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class AdditionalFeeType extends AbstractStructBase public $Type; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -57,7 +57,7 @@ public function setType($type = null) { // validation for constraint: string if (!is_null($type) && !is_string($type)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($type)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($type, true), gettype($type)), __LINE__); } $this->Type = $type; return $this; diff --git a/src/StructType/AddressType.php b/src/StructType/AddressType.php index 9d3da71..6023a9f 100644 --- a/src/StructType/AddressType.php +++ b/src/StructType/AddressType.php @@ -6,10 +6,9 @@ /** * This class stands for AddressType StructType - * Meta informations extracted from the WSDL - * - documentation: ISO 3166 standard country code Character limit: Two single-byte characters. | IMPORTANT: Do not set this element for SetExpressCheckout, DoExpressCheckoutPayment, DoDirectPayment, CreateRecurringPaymentsProfile or - * UpdateRecurringPaymentsProfile. This element should only be used in response elements and typically should not be used in creating request messages which specify the name of a country using the Country element (which refers to a 2-letter country - * code). + * Meta information extracted from the WSDL + * - documentation: IMPORTANT: Do not set this element for SetExpressCheckout, DoExpressCheckoutPayment, DoDirectPayment, CreateRecurringPaymentsProfile or UpdateRecurringPaymentsProfile. This element should only be used in response elements and + * typically should not be used in creating request messages which specify the name of a country using the Country element (which refers to a 2-letter country code). | ISO 3166 standard country code Character limit: Two single-byte characters. * @subpackage Structs * @author WsdlToPhp */ @@ -17,7 +16,7 @@ class AddressType extends AbstractStructBase { /** * The Name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Person's name associated with this address. Character length and limitations: 32 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -25,7 +24,7 @@ class AddressType extends AbstractStructBase public $Name; /** * The Street1 - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: First street address. Character length and limitations: 300 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -33,7 +32,7 @@ class AddressType extends AbstractStructBase public $Street1; /** * The Street2 - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Second street address. Character length and limitations: 300 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -41,7 +40,7 @@ class AddressType extends AbstractStructBase public $Street2; /** * The CityName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Name of city. Character length and limitations: 120 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -49,7 +48,7 @@ class AddressType extends AbstractStructBase public $CityName; /** * The StateOrProvince - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: State or province. Character length and limitations: 120 single-byte alphanumeric characters For Canada and the USA, StateOrProvince must be the standard 2-character abbreviation of a state or province. Canadian Provinces Alberta AB * British_Columbia BC Manitoba MB New_Brunswick NB Newfoundland NF Northwest_Territories NT Nova_Scotia NS Nunavut NU Ontario ON Prince_Edward_Island PE Quebec QC Saskatchewan SK Yukon YK United States Alabama AL Alaska AK American_Samoa AS Arizona AZ * Arkansas AR California CA Colorado CO Connecticut CT Delaware DE District_Of_Columbia DC Federated_States_Of_Micronesia FM Florida FL Georgia GA Guam GU Hawaii HI Idaho ID Illinois IL Indiana IN Iowa IA Kansas KS Kentucky KY Louisiana LA Maine ME @@ -62,7 +61,7 @@ class AddressType extends AbstractStructBase public $StateOrProvince; /** * The Country - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:Country * @var string @@ -70,7 +69,7 @@ class AddressType extends AbstractStructBase public $Country; /** * The CountryName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:CountryName * @var string @@ -78,7 +77,7 @@ class AddressType extends AbstractStructBase public $CountryName; /** * The Phone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Telephone number associated with this address * - minOccurs: 0 * @var string @@ -86,14 +85,14 @@ class AddressType extends AbstractStructBase public $Phone; /** * The PostalCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $PostalCode; /** * The AddressID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IMPORTANT: Do not set this element for SetExpressCheckout, DoExpressCheckoutPayment, DoDirectPayment, CreateRecurringPaymentsProfile, or UpdateRecurringPaymentsProfile. * - minOccurs: 0 * @var string @@ -101,7 +100,7 @@ class AddressType extends AbstractStructBase public $AddressID; /** * The AddressOwner - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IMPORTANT: Do not set this element for SetExpressCheckout, DoExpressCheckoutPayment, DoDirectPayment, CreateRecurringPaymentsProfile or UpdateRecurringPaymentsProfile. * - minOccurs: 0 * @var string @@ -109,7 +108,7 @@ class AddressType extends AbstractStructBase public $AddressOwner; /** * The ExternalAddressID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IMPORTANT: Do not set this element for SetExpressCheckout, DoExpressCheckoutPayment, DoDirectPayment, CreateRecurringPaymentsProfile or UpdateRecurringPaymentsProfile. * - minOccurs: 0 * @var string @@ -117,7 +116,7 @@ class AddressType extends AbstractStructBase public $ExternalAddressID; /** * The InternationalName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IMPORTANT: Do not set this element for SetExpressCheckout, DoExpressCheckoutPayment, DoDirectPayment, CreateRecurringPaymentsProfile or UpdateRecurringPaymentsProfile. Only applicable to SellerPaymentAddress today. Seller's * international name that is associated with the payment address. * - minOccurs: 0 @@ -126,7 +125,7 @@ class AddressType extends AbstractStructBase public $InternationalName; /** * The InternationalStateAndCity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IMPORTANT: Do not set this element for SetExpressCheckout, DoExpressCheckoutPayment, DoDirectPayment, CreateRecurringPaymentsProfile or UpdateRecurringPaymentsProfile. Only applicable to SellerPaymentAddress today. International * state and city for the seller's payment address. * - minOccurs: 0 @@ -135,7 +134,7 @@ class AddressType extends AbstractStructBase public $InternationalStateAndCity; /** * The InternationalStreet - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IMPORTANT: Do not set this element for SetExpressCheckout, DoExpressCheckoutPayment, DoDirectPayment, CreateRecurringPaymentsProfile or UpdateRecurringPaymentsProfile. Only applicable to SellerPaymentAddress today. Seller's * international street address that is associated with the payment address. * - minOccurs: 0 @@ -144,7 +143,7 @@ class AddressType extends AbstractStructBase public $InternationalStreet; /** * The AddressStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Status of the address on file with PayPal. IMPORTANT: Do not set this element for SetExpressCheckout, DoExpressCheckoutPayment, DoDirectPayment, CreateRecurringPaymentsProfile or UpdateRecurringPaymentsProfile. * - minOccurs: 0 * @var string @@ -152,7 +151,7 @@ class AddressType extends AbstractStructBase public $AddressStatus; /** * The AddressNormalizationStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Returns Normalization Status of the Address. Possible values are Normalized, Unnormalized, and None. * - minOccurs: 0 * @var string @@ -233,7 +232,7 @@ public function setName($name = null) { // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); } $this->Name = $name; return $this; @@ -255,7 +254,7 @@ public function setStreet1($street1 = null) { // validation for constraint: string if (!is_null($street1) && !is_string($street1)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($street1)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($street1, true), gettype($street1)), __LINE__); } $this->Street1 = $street1; return $this; @@ -277,7 +276,7 @@ public function setStreet2($street2 = null) { // validation for constraint: string if (!is_null($street2) && !is_string($street2)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($street2)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($street2, true), gettype($street2)), __LINE__); } $this->Street2 = $street2; return $this; @@ -299,7 +298,7 @@ public function setCityName($cityName = null) { // validation for constraint: string if (!is_null($cityName) && !is_string($cityName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cityName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cityName, true), gettype($cityName)), __LINE__); } $this->CityName = $cityName; return $this; @@ -321,7 +320,7 @@ public function setStateOrProvince($stateOrProvince = null) { // validation for constraint: string if (!is_null($stateOrProvince) && !is_string($stateOrProvince)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($stateOrProvince)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($stateOrProvince, true), gettype($stateOrProvince)), __LINE__); } $this->StateOrProvince = $stateOrProvince; return $this; @@ -346,7 +345,7 @@ public function setCountry($country = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CountryCodeType::valueIsValid($country)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $country, implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CountryCodeType', is_array($country) ? implode(', ', $country) : var_export($country, true), implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); } $this->Country = $country; return $this; @@ -368,7 +367,7 @@ public function setCountryName($countryName = null) { // validation for constraint: string if (!is_null($countryName) && !is_string($countryName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($countryName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($countryName, true), gettype($countryName)), __LINE__); } $this->CountryName = $countryName; return $this; @@ -390,7 +389,7 @@ public function setPhone($phone = null) { // validation for constraint: string if (!is_null($phone) && !is_string($phone)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($phone)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($phone, true), gettype($phone)), __LINE__); } $this->Phone = $phone; return $this; @@ -412,7 +411,7 @@ public function setPostalCode($postalCode = null) { // validation for constraint: string if (!is_null($postalCode) && !is_string($postalCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($postalCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($postalCode, true), gettype($postalCode)), __LINE__); } $this->PostalCode = $postalCode; return $this; @@ -434,7 +433,7 @@ public function setAddressID($addressID = null) { // validation for constraint: string if (!is_null($addressID) && !is_string($addressID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($addressID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($addressID, true), gettype($addressID)), __LINE__); } $this->AddressID = $addressID; return $this; @@ -459,7 +458,7 @@ public function setAddressOwner($addressOwner = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AddressOwnerCodeType::valueIsValid($addressOwner)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $addressOwner, implode(', ', \PayPal\EnumType\AddressOwnerCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AddressOwnerCodeType', is_array($addressOwner) ? implode(', ', $addressOwner) : var_export($addressOwner, true), implode(', ', \PayPal\EnumType\AddressOwnerCodeType::getValidValues())), __LINE__); } $this->AddressOwner = $addressOwner; return $this; @@ -481,7 +480,7 @@ public function setExternalAddressID($externalAddressID = null) { // validation for constraint: string if (!is_null($externalAddressID) && !is_string($externalAddressID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalAddressID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalAddressID, true), gettype($externalAddressID)), __LINE__); } $this->ExternalAddressID = $externalAddressID; return $this; @@ -503,7 +502,7 @@ public function setInternationalName($internationalName = null) { // validation for constraint: string if (!is_null($internationalName) && !is_string($internationalName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($internationalName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($internationalName, true), gettype($internationalName)), __LINE__); } $this->InternationalName = $internationalName; return $this; @@ -525,7 +524,7 @@ public function setInternationalStateAndCity($internationalStateAndCity = null) { // validation for constraint: string if (!is_null($internationalStateAndCity) && !is_string($internationalStateAndCity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($internationalStateAndCity)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($internationalStateAndCity, true), gettype($internationalStateAndCity)), __LINE__); } $this->InternationalStateAndCity = $internationalStateAndCity; return $this; @@ -547,7 +546,7 @@ public function setInternationalStreet($internationalStreet = null) { // validation for constraint: string if (!is_null($internationalStreet) && !is_string($internationalStreet)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($internationalStreet)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($internationalStreet, true), gettype($internationalStreet)), __LINE__); } $this->InternationalStreet = $internationalStreet; return $this; @@ -572,7 +571,7 @@ public function setAddressStatus($addressStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AddressStatusCodeType::valueIsValid($addressStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $addressStatus, implode(', ', \PayPal\EnumType\AddressStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AddressStatusCodeType', is_array($addressStatus) ? implode(', ', $addressStatus) : var_export($addressStatus, true), implode(', ', \PayPal\EnumType\AddressStatusCodeType::getValidValues())), __LINE__); } $this->AddressStatus = $addressStatus; return $this; @@ -597,7 +596,7 @@ public function setAddressNormalizationStatus($addressNormalizationStatus = null { // validation for constraint: enumeration if (!\PayPal\EnumType\AddressNormalizationStatusCodeType::valueIsValid($addressNormalizationStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $addressNormalizationStatus, implode(', ', \PayPal\EnumType\AddressNormalizationStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AddressNormalizationStatusCodeType', is_array($addressNormalizationStatus) ? implode(', ', $addressNormalizationStatus) : var_export($addressNormalizationStatus, true), implode(', ', \PayPal\EnumType\AddressNormalizationStatusCodeType::getValidValues())), __LINE__); } $this->AddressNormalizationStatus = $addressNormalizationStatus; return $this; diff --git a/src/StructType/AddressVerifyReq.php b/src/StructType/AddressVerifyReq.php index 5412fc3..7216919 100644 --- a/src/StructType/AddressVerifyReq.php +++ b/src/StructType/AddressVerifyReq.php @@ -13,7 +13,7 @@ class AddressVerifyReq extends AbstractStructBase { /** * The AddressVerifyRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:AddressVerifyRequest * @var \PayPal\StructType\AddressVerifyRequestType */ diff --git a/src/StructType/AddressVerifyRequestType.php b/src/StructType/AddressVerifyRequestType.php index f2ec1c9..bef0b97 100644 --- a/src/StructType/AddressVerifyRequestType.php +++ b/src/StructType/AddressVerifyRequestType.php @@ -13,8 +13,9 @@ class AddressVerifyRequestType extends AbstractRequestType { /** * The Email - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Email address of buyer to be verified. Required Maximum string length: 255 single-byte characters Input mask: ?@?.?? + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -22,7 +23,7 @@ class AddressVerifyRequestType extends AbstractRequestType public $Email; /** * The Street - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: First line of buyer’s billing or shipping street address to be verified. Required For verification, input value of street address must match the first three single-byte characters of the street address on file for the PayPal * account. Maximum string length: 35 single-byte characters Alphanumeric plus - , . ‘ # \ Whitespace and case of input value are ignored. * - maxOccurs: 1 @@ -32,7 +33,7 @@ class AddressVerifyRequestType extends AbstractRequestType public $Street; /** * The Zip - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Postal code to be verified. Required For verification, input value of postal code must match the first five single-byte characters of the postal code on file for the PayPal account. Maximum string length: 16 single-byte characters * Whitespace and case of input value are ignored. * - maxOccurs: 1 @@ -73,7 +74,7 @@ public function setEmail($email = null) { // validation for constraint: string if (!is_null($email) && !is_string($email)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($email)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($email, true), gettype($email)), __LINE__); } $this->Email = $email; return $this; @@ -95,7 +96,7 @@ public function setStreet($street = null) { // validation for constraint: string if (!is_null($street) && !is_string($street)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($street)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($street, true), gettype($street)), __LINE__); } $this->Street = $street; return $this; @@ -117,7 +118,7 @@ public function setZip($zip = null) { // validation for constraint: string if (!is_null($zip) && !is_string($zip)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($zip)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($zip, true), gettype($zip)), __LINE__); } $this->Zip = $zip; return $this; diff --git a/src/StructType/AddressVerifyResponseType.php b/src/StructType/AddressVerifyResponseType.php index 8f7b244..4349f72 100644 --- a/src/StructType/AddressVerifyResponseType.php +++ b/src/StructType/AddressVerifyResponseType.php @@ -13,7 +13,7 @@ class AddressVerifyResponseType extends AbstractResponseType { /** * The ConfirmationCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Confirmation of a match, with one of the following tokens: None: The input value of the Email object does not match any email address on file at PayPal. Confirmed: If the value of the StreetMatch object is Matched, PayPal responds * that the entire postal address is confirmed. Unconfirmed: PayPal responds that the postal address is unconfirmed * - maxOccurs: 1 @@ -23,7 +23,7 @@ class AddressVerifyResponseType extends AbstractResponseType public $ConfirmationCode; /** * The StreetMatch - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PayPal has compared the postal address you want to verify with the postal address on file at PayPal. None: The input value of the Email object does not match any email address on file at PayPal. In addition, an error response is * returned. No further comparison of other input values has been made. Matched: The street address matches the street address on file at PayPal. Unmatched: The street address does not match the street address on file at PayPal. * - maxOccurs: 1 @@ -33,7 +33,7 @@ class AddressVerifyResponseType extends AbstractResponseType public $StreetMatch; /** * The ZipMatch - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PayPal has compared the zip code you want to verify with the zip code on file for the email address. None: The street address was unmatched. No further comparison of other input values has been made. Matched: The zip code matches the * zip code on file at PayPal. Unmatched: The zip code does not match the zip code on file at PayPal. * - maxOccurs: 1 @@ -43,7 +43,7 @@ class AddressVerifyResponseType extends AbstractResponseType public $ZipMatch; /** * The CountryCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Two-character country code (ISO 3166) on file for the PayPal email address. * - maxOccurs: 1 * - minOccurs: 0 @@ -52,7 +52,7 @@ class AddressVerifyResponseType extends AbstractResponseType public $CountryCode; /** * The PayPalToken - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The token prevents a buyer from using any street address other than the address on file at PayPal during additional purchases he might make from the merchant. It contains encrypted information about the user’s street address and * email address. You can pass the value of the token with the Buy Now button HTML address_api_token variable so that PayPal prevents the buyer from using any street address or email address other than those verified by PayPal. The token is valid for 24 * hours. Character length and limitations: 94 single-byte characters @@ -103,7 +103,7 @@ public function setConfirmationCode($confirmationCode = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AddressStatusCodeType::valueIsValid($confirmationCode)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $confirmationCode, implode(', ', \PayPal\EnumType\AddressStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AddressStatusCodeType', is_array($confirmationCode) ? implode(', ', $confirmationCode) : var_export($confirmationCode, true), implode(', ', \PayPal\EnumType\AddressStatusCodeType::getValidValues())), __LINE__); } $this->ConfirmationCode = $confirmationCode; return $this; @@ -128,7 +128,7 @@ public function setStreetMatch($streetMatch = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MatchStatusCodeType::valueIsValid($streetMatch)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $streetMatch, implode(', ', \PayPal\EnumType\MatchStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MatchStatusCodeType', is_array($streetMatch) ? implode(', ', $streetMatch) : var_export($streetMatch, true), implode(', ', \PayPal\EnumType\MatchStatusCodeType::getValidValues())), __LINE__); } $this->StreetMatch = $streetMatch; return $this; @@ -153,7 +153,7 @@ public function setZipMatch($zipMatch = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MatchStatusCodeType::valueIsValid($zipMatch)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $zipMatch, implode(', ', \PayPal\EnumType\MatchStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MatchStatusCodeType', is_array($zipMatch) ? implode(', ', $zipMatch) : var_export($zipMatch, true), implode(', ', \PayPal\EnumType\MatchStatusCodeType::getValidValues())), __LINE__); } $this->ZipMatch = $zipMatch; return $this; @@ -178,7 +178,7 @@ public function setCountryCode($countryCode = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CountryCodeType::valueIsValid($countryCode)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $countryCode, implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CountryCodeType', is_array($countryCode) ? implode(', ', $countryCode) : var_export($countryCode, true), implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); } $this->CountryCode = $countryCode; return $this; @@ -200,7 +200,7 @@ public function setPayPalToken($payPalToken = null) { // validation for constraint: string if (!is_null($payPalToken) && !is_string($payPalToken)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payPalToken)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payPalToken, true), gettype($payPalToken)), __LINE__); } $this->PayPalToken = $payPalToken; return $this; diff --git a/src/StructType/AirlineItineraryType.php b/src/StructType/AirlineItineraryType.php index c54c136..ca55dc8 100644 --- a/src/StructType/AirlineItineraryType.php +++ b/src/StructType/AirlineItineraryType.php @@ -6,7 +6,7 @@ /** * This class stands for AirlineItineraryType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AID for Airlines * @subpackage Structs * @author WsdlToPhp @@ -15,98 +15,98 @@ class AirlineItineraryType extends AbstractStructBase { /** * The PassengerName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $PassengerName; /** * The IssueDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $IssueDate; /** * The TravelAgencyName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $TravelAgencyName; /** * The TravelAgencyCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $TravelAgencyCode; /** * The TicketNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $TicketNumber; /** * The IssuingCarrierCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $IssuingCarrierCode; /** * The CustomerCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $CustomerCode; /** * The TotalFare - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $TotalFare; /** * The TotalTaxes - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $TotalTaxes; /** * The TotalFee - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $TotalFee; /** * The RestrictedTicket - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $RestrictedTicket; /** * The ClearingSequence - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ClearingSequence; /** * The ClearingCount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ClearingCount; /** * The FlightDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var \PayPal\StructType\FlightDetailsType[] @@ -178,7 +178,7 @@ public function setPassengerName($passengerName = null) { // validation for constraint: string if (!is_null($passengerName) && !is_string($passengerName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($passengerName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($passengerName, true), gettype($passengerName)), __LINE__); } $this->PassengerName = $passengerName; return $this; @@ -200,7 +200,7 @@ public function setIssueDate($issueDate = null) { // validation for constraint: string if (!is_null($issueDate) && !is_string($issueDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($issueDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($issueDate, true), gettype($issueDate)), __LINE__); } $this->IssueDate = $issueDate; return $this; @@ -222,7 +222,7 @@ public function setTravelAgencyName($travelAgencyName = null) { // validation for constraint: string if (!is_null($travelAgencyName) && !is_string($travelAgencyName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($travelAgencyName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($travelAgencyName, true), gettype($travelAgencyName)), __LINE__); } $this->TravelAgencyName = $travelAgencyName; return $this; @@ -244,7 +244,7 @@ public function setTravelAgencyCode($travelAgencyCode = null) { // validation for constraint: string if (!is_null($travelAgencyCode) && !is_string($travelAgencyCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($travelAgencyCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($travelAgencyCode, true), gettype($travelAgencyCode)), __LINE__); } $this->TravelAgencyCode = $travelAgencyCode; return $this; @@ -266,7 +266,7 @@ public function setTicketNumber($ticketNumber = null) { // validation for constraint: string if (!is_null($ticketNumber) && !is_string($ticketNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($ticketNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($ticketNumber, true), gettype($ticketNumber)), __LINE__); } $this->TicketNumber = $ticketNumber; return $this; @@ -288,7 +288,7 @@ public function setIssuingCarrierCode($issuingCarrierCode = null) { // validation for constraint: string if (!is_null($issuingCarrierCode) && !is_string($issuingCarrierCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($issuingCarrierCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($issuingCarrierCode, true), gettype($issuingCarrierCode)), __LINE__); } $this->IssuingCarrierCode = $issuingCarrierCode; return $this; @@ -310,7 +310,7 @@ public function setCustomerCode($customerCode = null) { // validation for constraint: string if (!is_null($customerCode) && !is_string($customerCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($customerCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($customerCode, true), gettype($customerCode)), __LINE__); } $this->CustomerCode = $customerCode; return $this; @@ -386,7 +386,7 @@ public function setRestrictedTicket($restrictedTicket = null) { // validation for constraint: string if (!is_null($restrictedTicket) && !is_string($restrictedTicket)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($restrictedTicket)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($restrictedTicket, true), gettype($restrictedTicket)), __LINE__); } $this->RestrictedTicket = $restrictedTicket; return $this; @@ -408,7 +408,7 @@ public function setClearingSequence($clearingSequence = null) { // validation for constraint: string if (!is_null($clearingSequence) && !is_string($clearingSequence)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($clearingSequence)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($clearingSequence, true), gettype($clearingSequence)), __LINE__); } $this->ClearingSequence = $clearingSequence; return $this; @@ -430,7 +430,7 @@ public function setClearingCount($clearingCount = null) { // validation for constraint: string if (!is_null($clearingCount) && !is_string($clearingCount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($clearingCount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($clearingCount, true), gettype($clearingCount)), __LINE__); } $this->ClearingCount = $clearingCount; return $this; @@ -443,6 +443,28 @@ public function getFlightDetails() { return $this->FlightDetails; } + /** + * This method is responsible for validating the values passed to the setFlightDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setFlightDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateFlightDetailsForArrayConstraintsFromSetFlightDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $airlineItineraryTypeFlightDetailsItem) { + // validation for constraint: itemType + if (!$airlineItineraryTypeFlightDetailsItem instanceof \PayPal\StructType\FlightDetailsType) { + $invalidValues[] = is_object($airlineItineraryTypeFlightDetailsItem) ? get_class($airlineItineraryTypeFlightDetailsItem) : sprintf('%s(%s)', gettype($airlineItineraryTypeFlightDetailsItem), var_export($airlineItineraryTypeFlightDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The FlightDetails property can only contain items of type \PayPal\StructType\FlightDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set FlightDetails value * @throws \InvalidArgumentException @@ -451,11 +473,9 @@ public function getFlightDetails() */ public function setFlightDetails(array $flightDetails = array()) { - foreach ($flightDetails as $airlineItineraryTypeFlightDetailsItem) { - // validation for constraint: itemType - if (!$airlineItineraryTypeFlightDetailsItem instanceof \PayPal\StructType\FlightDetailsType) { - throw new \InvalidArgumentException(sprintf('The FlightDetails property can only contain items of \PayPal\StructType\FlightDetailsType, "%s" given', is_object($airlineItineraryTypeFlightDetailsItem) ? get_class($airlineItineraryTypeFlightDetailsItem) : gettype($airlineItineraryTypeFlightDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($flightDetailsArrayErrorMessage = self::validateFlightDetailsForArrayConstraintsFromSetFlightDetails($flightDetails))) { + throw new \InvalidArgumentException($flightDetailsArrayErrorMessage, __LINE__); } $this->FlightDetails = $flightDetails; return $this; @@ -470,7 +490,7 @@ public function addToFlightDetails(\PayPal\StructType\FlightDetailsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\FlightDetailsType) { - throw new \InvalidArgumentException(sprintf('The FlightDetails property can only contain items of \PayPal\StructType\FlightDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The FlightDetails property can only contain items of type \PayPal\StructType\FlightDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->FlightDetails[] = $item; return $this; diff --git a/src/StructType/AmountType.php b/src/StructType/AmountType.php index ab932e0..6dd73d1 100644 --- a/src/StructType/AmountType.php +++ b/src/StructType/AmountType.php @@ -13,7 +13,7 @@ class AmountType extends AbstractStructBase { /** * The currencyID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: required * @var string */ @@ -56,7 +56,7 @@ public function setCurrencyID($currencyID = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CurrencyCodeType::valueIsValid($currencyID)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $currencyID, implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CurrencyCodeType', is_array($currencyID) ? implode(', ', $currencyID) : var_export($currencyID, true), implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); } $this->currencyID = $currencyID; return $this; @@ -76,6 +76,10 @@ public function get_() */ public function set_($_ = null) { + // validation for constraint: float + if (!is_null($_) && !(is_float($_) || is_numeric($_))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($_, true), gettype($_)), __LINE__); + } $this->_ = $_; return $this; } diff --git a/src/StructType/AttributeSetType.php b/src/StructType/AttributeSetType.php index 5aa9b4b..d5fa2f4 100644 --- a/src/StructType/AttributeSetType.php +++ b/src/StructType/AttributeSetType.php @@ -6,7 +6,7 @@ /** * This class stands for AttributeSetType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AttributeSet. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class AttributeSetType extends AbstractStructBase { /** * The Attribute - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * @var \PayPal\StructType\AttributeType[] */ @@ -46,6 +46,28 @@ public function getAttribute() { return $this->Attribute; } + /** + * This method is responsible for validating the values passed to the setAttribute method + * This method is willingly generated in order to preserve the one-line inline validation within the setAttribute method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateAttributeForArrayConstraintsFromSetAttribute(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $attributeSetTypeAttributeItem) { + // validation for constraint: itemType + if (!$attributeSetTypeAttributeItem instanceof \PayPal\StructType\AttributeType) { + $invalidValues[] = is_object($attributeSetTypeAttributeItem) ? get_class($attributeSetTypeAttributeItem) : sprintf('%s(%s)', gettype($attributeSetTypeAttributeItem), var_export($attributeSetTypeAttributeItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Attribute property can only contain items of type \PayPal\StructType\AttributeType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Attribute value * @throws \InvalidArgumentException @@ -54,11 +76,9 @@ public function getAttribute() */ public function setAttribute(array $attribute = array()) { - foreach ($attribute as $attributeSetTypeAttributeItem) { - // validation for constraint: itemType - if (!$attributeSetTypeAttributeItem instanceof \PayPal\StructType\AttributeType) { - throw new \InvalidArgumentException(sprintf('The Attribute property can only contain items of \PayPal\StructType\AttributeType, "%s" given', is_object($attributeSetTypeAttributeItem) ? get_class($attributeSetTypeAttributeItem) : gettype($attributeSetTypeAttributeItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($attributeArrayErrorMessage = self::validateAttributeForArrayConstraintsFromSetAttribute($attribute))) { + throw new \InvalidArgumentException($attributeArrayErrorMessage, __LINE__); } $this->Attribute = $attribute; return $this; @@ -73,7 +93,7 @@ public function addToAttribute(\PayPal\StructType\AttributeType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\AttributeType) { - throw new \InvalidArgumentException(sprintf('The Attribute property can only contain items of \PayPal\StructType\AttributeType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Attribute property can only contain items of type \PayPal\StructType\AttributeType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Attribute[] = $item; return $this; @@ -95,7 +115,7 @@ public function setAttributeSetID($attributeSetID = null) { // validation for constraint: string if (!is_null($attributeSetID) && !is_string($attributeSetID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($attributeSetID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($attributeSetID, true), gettype($attributeSetID)), __LINE__); } $this->AttributeSetID = $attributeSetID; return $this; diff --git a/src/StructType/AttributeType.php b/src/StructType/AttributeType.php index 77bacd0..51fcd50 100644 --- a/src/StructType/AttributeType.php +++ b/src/StructType/AttributeType.php @@ -6,7 +6,7 @@ /** * This class stands for AttributeType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Specific physical attribute of an item. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class AttributeType extends AbstractStructBase { /** * The Value - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ValueList of the Attribute being described by the AttributeID. * - maxOccurs: unbounded * @var \PayPal\StructType\ValType[] @@ -23,7 +23,7 @@ class AttributeType extends AbstractStructBase public $Value; /** * The AttributeID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Constant name of the attribute that identifies a physical attribute within a set of characteristics that describe something in a formalised way. * @var string */ @@ -49,6 +49,28 @@ public function getValue() { return $this->Value; } + /** + * This method is responsible for validating the values passed to the setValue method + * This method is willingly generated in order to preserve the one-line inline validation within the setValue method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateValueForArrayConstraintsFromSetValue(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $attributeTypeValueItem) { + // validation for constraint: itemType + if (!$attributeTypeValueItem instanceof \PayPal\StructType\ValType) { + $invalidValues[] = is_object($attributeTypeValueItem) ? get_class($attributeTypeValueItem) : sprintf('%s(%s)', gettype($attributeTypeValueItem), var_export($attributeTypeValueItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Value property can only contain items of type \PayPal\StructType\ValType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Value value * @throws \InvalidArgumentException @@ -57,11 +79,9 @@ public function getValue() */ public function setValue(array $value = array()) { - foreach ($value as $attributeTypeValueItem) { - // validation for constraint: itemType - if (!$attributeTypeValueItem instanceof \PayPal\StructType\ValType) { - throw new \InvalidArgumentException(sprintf('The Value property can only contain items of \PayPal\StructType\ValType, "%s" given', is_object($attributeTypeValueItem) ? get_class($attributeTypeValueItem) : gettype($attributeTypeValueItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($valueArrayErrorMessage = self::validateValueForArrayConstraintsFromSetValue($value))) { + throw new \InvalidArgumentException($valueArrayErrorMessage, __LINE__); } $this->Value = $value; return $this; @@ -76,7 +96,7 @@ public function addToValue(\PayPal\StructType\ValType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\ValType) { - throw new \InvalidArgumentException(sprintf('The Value property can only contain items of \PayPal\StructType\ValType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Value property can only contain items of type \PayPal\StructType\ValType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Value[] = $item; return $this; @@ -98,7 +118,7 @@ public function setAttributeID($attributeID = null) { // validation for constraint: string if (!is_null($attributeID) && !is_string($attributeID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($attributeID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($attributeID, true), gettype($attributeID)), __LINE__); } $this->AttributeID = $attributeID; return $this; diff --git a/src/StructType/AuctionInfoType.php b/src/StructType/AuctionInfoType.php index bb912fc..7c869ae 100644 --- a/src/StructType/AuctionInfoType.php +++ b/src/StructType/AuctionInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for AuctionInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: AuctionInfoType Basic information about an auction. * @subpackage Structs * @author WsdlToPhp @@ -15,14 +15,14 @@ class AuctionInfoType extends AbstractStructBase { /** * The multiItem - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: required * @var string */ public $multiItem; /** * The BuyerID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Customer's auction ID * - minOccurs: 0 * @var string @@ -30,7 +30,7 @@ class AuctionInfoType extends AbstractStructBase public $BuyerID; /** * The ClosingDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Auction's close date * - minOccurs: 0 * @var string @@ -69,7 +69,7 @@ public function setMultiItem($multiItem = null) { // validation for constraint: string if (!is_null($multiItem) && !is_string($multiItem)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($multiItem)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($multiItem, true), gettype($multiItem)), __LINE__); } $this->multiItem = $multiItem; return $this; @@ -91,7 +91,7 @@ public function setBuyerID($buyerID = null) { // validation for constraint: string if (!is_null($buyerID) && !is_string($buyerID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerID, true), gettype($buyerID)), __LINE__); } $this->BuyerID = $buyerID; return $this; @@ -113,7 +113,7 @@ public function setClosingDate($closingDate = null) { // validation for constraint: string if (!is_null($closingDate) && !is_string($closingDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($closingDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($closingDate, true), gettype($closingDate)), __LINE__); } $this->ClosingDate = $closingDate; return $this; diff --git a/src/StructType/AuthorizationInfoType.php b/src/StructType/AuthorizationInfoType.php index 5c8229e..9bb9efc 100644 --- a/src/StructType/AuthorizationInfoType.php +++ b/src/StructType/AuthorizationInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for AuthorizationInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Authorization details * @subpackage Structs * @author WsdlToPhp @@ -15,14 +15,14 @@ class AuthorizationInfoType extends AbstractStructBase { /** * The PaymentStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The status of the payment: Pending: The payment is pending. See "PendingReason" for more information. * @var string */ public $PaymentStatus; /** * The PendingReason - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The reason the payment is pending:none: No pending reason address: The payment is pending because your customer did not include a confirmed shipping address and your Payment Receiving Preferences is set such that you want to manually * accept or deny each of these payments. To change your preference, go to the Preferences section of your Profile. authorization: The authorization is pending at time of creation if payment is not under review echeck: The payment is pending because it * was made by an eCheck that has not yet cleared. intl: The payment is pending because you hold a non-U.S. account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account Overview. multi-currency: You do @@ -36,7 +36,7 @@ class AuthorizationInfoType extends AbstractStructBase public $PendingReason; /** * The ProtectionEligibility - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Protection Eligibility for this Transaction - None, SPP or ESPP * - minOccurs: 0 * @var string @@ -44,7 +44,7 @@ class AuthorizationInfoType extends AbstractStructBase public $ProtectionEligibility; /** * The ProtectionEligibilityType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Protection Eligibility Type for this Transaction * - minOccurs: 0 * @var string @@ -89,7 +89,7 @@ public function setPaymentStatus($paymentStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentStatusCodeType::valueIsValid($paymentStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentStatus, implode(', ', \PayPal\EnumType\PaymentStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentStatusCodeType', is_array($paymentStatus) ? implode(', ', $paymentStatus) : var_export($paymentStatus, true), implode(', ', \PayPal\EnumType\PaymentStatusCodeType::getValidValues())), __LINE__); } $this->PaymentStatus = $paymentStatus; return $this; @@ -114,7 +114,7 @@ public function setPendingReason($pendingReason = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PendingStatusCodeType::valueIsValid($pendingReason)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $pendingReason, implode(', ', \PayPal\EnumType\PendingStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PendingStatusCodeType', is_array($pendingReason) ? implode(', ', $pendingReason) : var_export($pendingReason, true), implode(', ', \PayPal\EnumType\PendingStatusCodeType::getValidValues())), __LINE__); } $this->PendingReason = $pendingReason; return $this; @@ -136,7 +136,7 @@ public function setProtectionEligibility($protectionEligibility = null) { // validation for constraint: string if (!is_null($protectionEligibility) && !is_string($protectionEligibility)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($protectionEligibility)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($protectionEligibility, true), gettype($protectionEligibility)), __LINE__); } $this->ProtectionEligibility = $protectionEligibility; return $this; @@ -158,7 +158,7 @@ public function setProtectionEligibilityType($protectionEligibilityType = null) { // validation for constraint: string if (!is_null($protectionEligibilityType) && !is_string($protectionEligibilityType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($protectionEligibilityType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($protectionEligibilityType, true), gettype($protectionEligibilityType)), __LINE__); } $this->ProtectionEligibilityType = $protectionEligibilityType; return $this; diff --git a/src/StructType/AuthorizationRequestType.php b/src/StructType/AuthorizationRequestType.php index d9c74b5..87f8af1 100644 --- a/src/StructType/AuthorizationRequestType.php +++ b/src/StructType/AuthorizationRequestType.php @@ -13,7 +13,7 @@ class AuthorizationRequestType extends AbstractStructBase { /** * The IsRequested - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var bool @@ -46,7 +46,7 @@ public function setIsRequested($isRequested = null) { // validation for constraint: boolean if (!is_null($isRequested) && !is_bool($isRequested)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($isRequested)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($isRequested, true), gettype($isRequested)), __LINE__); } $this->IsRequested = $isRequested; return $this; diff --git a/src/StructType/AuthorizationResponseType.php b/src/StructType/AuthorizationResponseType.php index 85d3bc5..0253108 100644 --- a/src/StructType/AuthorizationResponseType.php +++ b/src/StructType/AuthorizationResponseType.php @@ -13,7 +13,7 @@ class AuthorizationResponseType extends AbstractStructBase { /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Status will denote whether Auto authorization was successful or not. * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class AuthorizationResponseType extends AbstractStructBase public $Status; /** * The AuthorizationError - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var \PayPal\StructType\ErrorType[] @@ -60,7 +60,7 @@ public function setStatus($status = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AckCodeType::valueIsValid($status)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $status, implode(', ', \PayPal\EnumType\AckCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AckCodeType', is_array($status) ? implode(', ', $status) : var_export($status, true), implode(', ', \PayPal\EnumType\AckCodeType::getValidValues())), __LINE__); } $this->Status = $status; return $this; @@ -73,6 +73,28 @@ public function getAuthorizationError() { return $this->AuthorizationError; } + /** + * This method is responsible for validating the values passed to the setAuthorizationError method + * This method is willingly generated in order to preserve the one-line inline validation within the setAuthorizationError method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateAuthorizationErrorForArrayConstraintsFromSetAuthorizationError(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $authorizationResponseTypeAuthorizationErrorItem) { + // validation for constraint: itemType + if (!$authorizationResponseTypeAuthorizationErrorItem instanceof \PayPal\StructType\ErrorType) { + $invalidValues[] = is_object($authorizationResponseTypeAuthorizationErrorItem) ? get_class($authorizationResponseTypeAuthorizationErrorItem) : sprintf('%s(%s)', gettype($authorizationResponseTypeAuthorizationErrorItem), var_export($authorizationResponseTypeAuthorizationErrorItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The AuthorizationError property can only contain items of type \PayPal\StructType\ErrorType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set AuthorizationError value * @throws \InvalidArgumentException @@ -81,11 +103,9 @@ public function getAuthorizationError() */ public function setAuthorizationError(array $authorizationError = array()) { - foreach ($authorizationError as $authorizationResponseTypeAuthorizationErrorItem) { - // validation for constraint: itemType - if (!$authorizationResponseTypeAuthorizationErrorItem instanceof \PayPal\StructType\ErrorType) { - throw new \InvalidArgumentException(sprintf('The AuthorizationError property can only contain items of \PayPal\StructType\ErrorType, "%s" given', is_object($authorizationResponseTypeAuthorizationErrorItem) ? get_class($authorizationResponseTypeAuthorizationErrorItem) : gettype($authorizationResponseTypeAuthorizationErrorItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($authorizationErrorArrayErrorMessage = self::validateAuthorizationErrorForArrayConstraintsFromSetAuthorizationError($authorizationError))) { + throw new \InvalidArgumentException($authorizationErrorArrayErrorMessage, __LINE__); } $this->AuthorizationError = $authorizationError; return $this; @@ -100,7 +120,7 @@ public function addToAuthorizationError(\PayPal\StructType\ErrorType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\ErrorType) { - throw new \InvalidArgumentException(sprintf('The AuthorizationError property can only contain items of \PayPal\StructType\ErrorType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The AuthorizationError property can only contain items of type \PayPal\StructType\ErrorType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->AuthorizationError[] = $item; return $this; diff --git a/src/StructType/BAUpdateRequestType.php b/src/StructType/BAUpdateRequestType.php index d728e0a..a8d2aff 100644 --- a/src/StructType/BAUpdateRequestType.php +++ b/src/StructType/BAUpdateRequestType.php @@ -13,7 +13,7 @@ class BAUpdateRequestType extends AbstractRequestType { /** * The ReferenceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class BAUpdateRequestType extends AbstractRequestType public $ReferenceID; /** * The BillingAgreementDescription - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -29,7 +29,7 @@ class BAUpdateRequestType extends AbstractRequestType public $BillingAgreementDescription; /** * The BillingAgreementStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -37,7 +37,7 @@ class BAUpdateRequestType extends AbstractRequestType public $BillingAgreementStatus; /** * The BillingAgreementCustom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -79,7 +79,7 @@ public function setReferenceID($referenceID = null) { // validation for constraint: string if (!is_null($referenceID) && !is_string($referenceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($referenceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($referenceID, true), gettype($referenceID)), __LINE__); } $this->ReferenceID = $referenceID; return $this; @@ -101,7 +101,7 @@ public function setBillingAgreementDescription($billingAgreementDescription = nu { // validation for constraint: string if (!is_null($billingAgreementDescription) && !is_string($billingAgreementDescription)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingAgreementDescription)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementDescription, true), gettype($billingAgreementDescription)), __LINE__); } $this->BillingAgreementDescription = $billingAgreementDescription; return $this; @@ -126,7 +126,7 @@ public function setBillingAgreementStatus($billingAgreementStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MerchantPullStatusCodeType::valueIsValid($billingAgreementStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $billingAgreementStatus, implode(', ', \PayPal\EnumType\MerchantPullStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MerchantPullStatusCodeType', is_array($billingAgreementStatus) ? implode(', ', $billingAgreementStatus) : var_export($billingAgreementStatus, true), implode(', ', \PayPal\EnumType\MerchantPullStatusCodeType::getValidValues())), __LINE__); } $this->BillingAgreementStatus = $billingAgreementStatus; return $this; @@ -148,7 +148,7 @@ public function setBillingAgreementCustom($billingAgreementCustom = null) { // validation for constraint: string if (!is_null($billingAgreementCustom) && !is_string($billingAgreementCustom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingAgreementCustom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementCustom, true), gettype($billingAgreementCustom)), __LINE__); } $this->BillingAgreementCustom = $billingAgreementCustom; return $this; diff --git a/src/StructType/BAUpdateResponseDetailsType.php b/src/StructType/BAUpdateResponseDetailsType.php index 4e3582a..a245234 100644 --- a/src/StructType/BAUpdateResponseDetailsType.php +++ b/src/StructType/BAUpdateResponseDetailsType.php @@ -13,7 +13,7 @@ class BAUpdateResponseDetailsType extends AbstractStructBase { /** * The BillingAgreementID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class BAUpdateResponseDetailsType extends AbstractStructBase public $BillingAgreementID; /** * The BillingAgreementStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -29,7 +29,7 @@ class BAUpdateResponseDetailsType extends AbstractStructBase public $BillingAgreementStatus; /** * The PayerInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var \PayPal\StructType\PayerInfoType @@ -37,7 +37,7 @@ class BAUpdateResponseDetailsType extends AbstractStructBase public $PayerInfo; /** * The BillingAgreementDescription - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -45,7 +45,7 @@ class BAUpdateResponseDetailsType extends AbstractStructBase public $BillingAgreementDescription; /** * The BillingAgreementCustom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -53,7 +53,7 @@ class BAUpdateResponseDetailsType extends AbstractStructBase public $BillingAgreementCustom; /** * The BillingAgreementMax - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -61,7 +61,7 @@ class BAUpdateResponseDetailsType extends AbstractStructBase public $BillingAgreementMax; /** * The BillingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - 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 * BAUpdateResponseDetails. * - minOccurs: 0 @@ -70,7 +70,7 @@ class BAUpdateResponseDetailsType extends AbstractStructBase public $BillingAddress; /** * The PayeeInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Merchant/Agreement Owner * - maxOccurs: 1 * - minOccurs: 0 @@ -125,7 +125,7 @@ public function setBillingAgreementID($billingAgreementID = null) { // validation for constraint: string if (!is_null($billingAgreementID) && !is_string($billingAgreementID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingAgreementID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementID, true), gettype($billingAgreementID)), __LINE__); } $this->BillingAgreementID = $billingAgreementID; return $this; @@ -150,7 +150,7 @@ public function setBillingAgreementStatus($billingAgreementStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MerchantPullStatusCodeType::valueIsValid($billingAgreementStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $billingAgreementStatus, implode(', ', \PayPal\EnumType\MerchantPullStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MerchantPullStatusCodeType', is_array($billingAgreementStatus) ? implode(', ', $billingAgreementStatus) : var_export($billingAgreementStatus, true), implode(', ', \PayPal\EnumType\MerchantPullStatusCodeType::getValidValues())), __LINE__); } $this->BillingAgreementStatus = $billingAgreementStatus; return $this; @@ -190,7 +190,7 @@ public function setBillingAgreementDescription($billingAgreementDescription = nu { // validation for constraint: string if (!is_null($billingAgreementDescription) && !is_string($billingAgreementDescription)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingAgreementDescription)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementDescription, true), gettype($billingAgreementDescription)), __LINE__); } $this->BillingAgreementDescription = $billingAgreementDescription; return $this; @@ -212,7 +212,7 @@ public function setBillingAgreementCustom($billingAgreementCustom = null) { // validation for constraint: string if (!is_null($billingAgreementCustom) && !is_string($billingAgreementCustom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingAgreementCustom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementCustom, true), gettype($billingAgreementCustom)), __LINE__); } $this->BillingAgreementCustom = $billingAgreementCustom; return $this; diff --git a/src/StructType/BAUpdateResponseType.php b/src/StructType/BAUpdateResponseType.php index 573c4a3..a3f836b 100644 --- a/src/StructType/BAUpdateResponseType.php +++ b/src/StructType/BAUpdateResponseType.php @@ -13,7 +13,7 @@ class BAUpdateResponseType extends AbstractResponseType { /** * The BAUpdateResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:BAUpdateResponseDetails * @var \PayPal\StructType\BAUpdateResponseDetailsType */ diff --git a/src/StructType/BMButtonSearchReq.php b/src/StructType/BMButtonSearchReq.php index 371ea05..3994691 100644 --- a/src/StructType/BMButtonSearchReq.php +++ b/src/StructType/BMButtonSearchReq.php @@ -13,7 +13,7 @@ class BMButtonSearchReq extends AbstractStructBase { /** * The BMButtonSearchRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:BMButtonSearchRequest * @var \PayPal\StructType\BMButtonSearchRequestType */ diff --git a/src/StructType/BMButtonSearchRequestType.php b/src/StructType/BMButtonSearchRequestType.php index a9bba4c..88b203f 100644 --- a/src/StructType/BMButtonSearchRequestType.php +++ b/src/StructType/BMButtonSearchRequestType.php @@ -13,7 +13,7 @@ class BMButtonSearchRequestType extends AbstractRequestType { /** * The StartDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The earliest transaction date at which to start the search. No wildcards are allowed. Required * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class BMButtonSearchRequestType extends AbstractRequestType public $StartDate; /** * The EndDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The latest transaction date to be included in the search Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -59,7 +59,7 @@ public function setStartDate($startDate = null) { // validation for constraint: string if (!is_null($startDate) && !is_string($startDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($startDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($startDate, true), gettype($startDate)), __LINE__); } $this->StartDate = $startDate; return $this; @@ -81,7 +81,7 @@ public function setEndDate($endDate = null) { // validation for constraint: string if (!is_null($endDate) && !is_string($endDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($endDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($endDate, true), gettype($endDate)), __LINE__); } $this->EndDate = $endDate; return $this; diff --git a/src/StructType/BMButtonSearchResponseType.php b/src/StructType/BMButtonSearchResponseType.php index 27772a7..9a3a760 100644 --- a/src/StructType/BMButtonSearchResponseType.php +++ b/src/StructType/BMButtonSearchResponseType.php @@ -13,7 +13,7 @@ class BMButtonSearchResponseType extends AbstractResponseType { /** * The ButtonSearchResult - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 100 * - minOccurs: 0 * - ref: ebl:ButtonSearchResult @@ -38,6 +38,28 @@ public function getButtonSearchResult() { return $this->ButtonSearchResult; } + /** + * This method is responsible for validating the values passed to the setButtonSearchResult method + * This method is willingly generated in order to preserve the one-line inline validation within the setButtonSearchResult method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateButtonSearchResultForArrayConstraintsFromSetButtonSearchResult(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMButtonSearchResponseTypeButtonSearchResultItem) { + // validation for constraint: itemType + if (!$bMButtonSearchResponseTypeButtonSearchResultItem instanceof \PayPal\StructType\ButtonSearchResultType) { + $invalidValues[] = is_object($bMButtonSearchResponseTypeButtonSearchResultItem) ? get_class($bMButtonSearchResponseTypeButtonSearchResultItem) : sprintf('%s(%s)', gettype($bMButtonSearchResponseTypeButtonSearchResultItem), var_export($bMButtonSearchResponseTypeButtonSearchResultItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The ButtonSearchResult property can only contain items of type \PayPal\StructType\ButtonSearchResultType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set ButtonSearchResult value * @throws \InvalidArgumentException @@ -46,11 +68,13 @@ public function getButtonSearchResult() */ public function setButtonSearchResult(array $buttonSearchResult = array()) { - foreach ($buttonSearchResult as $bMButtonSearchResponseTypeButtonSearchResultItem) { - // validation for constraint: itemType - if (!$bMButtonSearchResponseTypeButtonSearchResultItem instanceof \PayPal\StructType\ButtonSearchResultType) { - throw new \InvalidArgumentException(sprintf('The ButtonSearchResult property can only contain items of \PayPal\StructType\ButtonSearchResultType, "%s" given', is_object($bMButtonSearchResponseTypeButtonSearchResultItem) ? get_class($bMButtonSearchResponseTypeButtonSearchResultItem) : gettype($bMButtonSearchResponseTypeButtonSearchResultItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($buttonSearchResultArrayErrorMessage = self::validateButtonSearchResultForArrayConstraintsFromSetButtonSearchResult($buttonSearchResult))) { + throw new \InvalidArgumentException($buttonSearchResultArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(100) + if (is_array($buttonSearchResult) && count($buttonSearchResult) > 100) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 100', count($buttonSearchResult)), __LINE__); } $this->ButtonSearchResult = $buttonSearchResult; return $this; @@ -65,7 +89,11 @@ public function addToButtonSearchResult(\PayPal\StructType\ButtonSearchResultTyp { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\ButtonSearchResultType) { - throw new \InvalidArgumentException(sprintf('The ButtonSearchResult property can only contain items of \PayPal\StructType\ButtonSearchResultType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The ButtonSearchResult property can only contain items of type \PayPal\StructType\ButtonSearchResultType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(100) + if (is_array($this->ButtonSearchResult) && count($this->ButtonSearchResult) >= 100) { + 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 100', count($this->ButtonSearchResult)), __LINE__); } $this->ButtonSearchResult[] = $item; return $this; diff --git a/src/StructType/BMCreateButtonReq.php b/src/StructType/BMCreateButtonReq.php index bc8bbc6..783da22 100644 --- a/src/StructType/BMCreateButtonReq.php +++ b/src/StructType/BMCreateButtonReq.php @@ -13,7 +13,7 @@ class BMCreateButtonReq extends AbstractStructBase { /** * The BMCreateButtonRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:BMCreateButtonRequest * @var \PayPal\StructType\BMCreateButtonRequestType */ diff --git a/src/StructType/BMCreateButtonRequestType.php b/src/StructType/BMCreateButtonRequestType.php index bd8e0eb..0ec85bc 100644 --- a/src/StructType/BMCreateButtonRequestType.php +++ b/src/StructType/BMCreateButtonRequestType.php @@ -13,7 +13,7 @@ class BMCreateButtonRequestType extends AbstractRequestType { /** * The ButtonType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of Button to create. Required Must be one of the following: BUYNOW, CART, GIFTCERTIFICATE. SUBSCRIBE, PAYMENTPLAN, AUTOBILLING, DONATE, VIEWCART or UNSUBSCRIBE * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $ButtonType; /** * The ButtonCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: button code. optional Must be one of the following: hosted, encrypted or cleartext * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $ButtonCode; /** * The ButtonSubType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button sub type. optional for button types buynow and cart only Must Be either PRODUCTS or SERVICES * - maxOccurs: 1 * - minOccurs: 0 @@ -40,7 +40,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $ButtonSubType; /** * The ButtonVar - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button Variable information At least one required recurring Character length and limitations: 63 single-byte alphanumeric characters * - maxOccurs: 1000 * - minOccurs: 0 @@ -49,7 +49,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $ButtonVar; /** * The OptionDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 5 * - minOccurs: 0 * @var \PayPal\StructType\OptionDetailsType[] @@ -57,7 +57,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $OptionDetails; /** * The TextBox - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details of each option for the button. Optional * - maxOccurs: 2 * - minOccurs: 0 @@ -66,7 +66,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $TextBox; /** * The ButtonImage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button image to use. Optional Must be one of: REG, SML, or CC * - maxOccurs: 1 * - minOccurs: 0 @@ -75,7 +75,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $ButtonImage; /** * The ButtonImageURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button URL for custom button image. Optional Character length and limitations: 127 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -84,7 +84,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $ButtonImageURL; /** * The BuyNowText - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Text to use on Buy Now Button. Optional Must be either BUYNOW or PAYNOW * - maxOccurs: 1 * - minOccurs: 0 @@ -93,7 +93,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $BuyNowText; /** * The SubscribeText - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Text to use on Subscribe button. Optional Must be either BUYNOW or SUBSCRIBE * - maxOccurs: 1 * - minOccurs: 0 @@ -102,7 +102,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $SubscribeText; /** * The ButtonCountry - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button Country. Optional Must be valid ISO country code * - maxOccurs: 1 * - minOccurs: 0 @@ -111,7 +111,7 @@ class BMCreateButtonRequestType extends AbstractRequestType public $ButtonCountry; /** * The ButtonLanguage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button language code. Optional Character length and limitations: 3 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -181,7 +181,7 @@ public function setButtonType($buttonType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonTypeType::valueIsValid($buttonType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonType, implode(', ', \PayPal\EnumType\ButtonTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonTypeType', is_array($buttonType) ? implode(', ', $buttonType) : var_export($buttonType, true), implode(', ', \PayPal\EnumType\ButtonTypeType::getValidValues())), __LINE__); } $this->ButtonType = $buttonType; return $this; @@ -206,7 +206,7 @@ public function setButtonCode($buttonCode = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonCodeType::valueIsValid($buttonCode)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonCode, implode(', ', \PayPal\EnumType\ButtonCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonCodeType', is_array($buttonCode) ? implode(', ', $buttonCode) : var_export($buttonCode, true), implode(', ', \PayPal\EnumType\ButtonCodeType::getValidValues())), __LINE__); } $this->ButtonCode = $buttonCode; return $this; @@ -231,7 +231,7 @@ public function setButtonSubType($buttonSubType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonSubTypeType::valueIsValid($buttonSubType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonSubType, implode(', ', \PayPal\EnumType\ButtonSubTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonSubTypeType', is_array($buttonSubType) ? implode(', ', $buttonSubType) : var_export($buttonSubType, true), implode(', ', \PayPal\EnumType\ButtonSubTypeType::getValidValues())), __LINE__); } $this->ButtonSubType = $buttonSubType; return $this; @@ -244,6 +244,28 @@ public function getButtonVar() { return $this->ButtonVar; } + /** + * This method is responsible for validating the values passed to the setButtonVar method + * This method is willingly generated in order to preserve the one-line inline validation within the setButtonVar method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateButtonVarForArrayConstraintsFromSetButtonVar(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMCreateButtonRequestTypeButtonVarItem) { + // validation for constraint: itemType + if (!is_string($bMCreateButtonRequestTypeButtonVarItem)) { + $invalidValues[] = is_object($bMCreateButtonRequestTypeButtonVarItem) ? get_class($bMCreateButtonRequestTypeButtonVarItem) : sprintf('%s(%s)', gettype($bMCreateButtonRequestTypeButtonVarItem), var_export($bMCreateButtonRequestTypeButtonVarItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The ButtonVar property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set ButtonVar value * @throws \InvalidArgumentException @@ -252,11 +274,13 @@ public function getButtonVar() */ public function setButtonVar(array $buttonVar = array()) { - foreach ($buttonVar as $bMCreateButtonRequestTypeButtonVarItem) { - // validation for constraint: itemType - if (!is_string($bMCreateButtonRequestTypeButtonVarItem)) { - throw new \InvalidArgumentException(sprintf('The ButtonVar property can only contain items of string, "%s" given', is_object($bMCreateButtonRequestTypeButtonVarItem) ? get_class($bMCreateButtonRequestTypeButtonVarItem) : gettype($bMCreateButtonRequestTypeButtonVarItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($buttonVarArrayErrorMessage = self::validateButtonVarForArrayConstraintsFromSetButtonVar($buttonVar))) { + throw new \InvalidArgumentException($buttonVarArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($buttonVar) && count($buttonVar) > 1000) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 1000', count($buttonVar)), __LINE__); } $this->ButtonVar = $buttonVar; return $this; @@ -271,7 +295,11 @@ public function addToButtonVar($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The ButtonVar property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The ButtonVar property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($this->ButtonVar) && count($this->ButtonVar) >= 1000) { + 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 1000', count($this->ButtonVar)), __LINE__); } $this->ButtonVar[] = $item; return $this; @@ -284,6 +312,28 @@ public function getOptionDetails() { return $this->OptionDetails; } + /** + * This method is responsible for validating the values passed to the setOptionDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setOptionDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateOptionDetailsForArrayConstraintsFromSetOptionDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMCreateButtonRequestTypeOptionDetailsItem) { + // validation for constraint: itemType + if (!$bMCreateButtonRequestTypeOptionDetailsItem instanceof \PayPal\StructType\OptionDetailsType) { + $invalidValues[] = is_object($bMCreateButtonRequestTypeOptionDetailsItem) ? get_class($bMCreateButtonRequestTypeOptionDetailsItem) : sprintf('%s(%s)', gettype($bMCreateButtonRequestTypeOptionDetailsItem), var_export($bMCreateButtonRequestTypeOptionDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The OptionDetails property can only contain items of type \PayPal\StructType\OptionDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set OptionDetails value * @throws \InvalidArgumentException @@ -292,11 +342,13 @@ public function getOptionDetails() */ public function setOptionDetails(array $optionDetails = array()) { - foreach ($optionDetails as $bMCreateButtonRequestTypeOptionDetailsItem) { - // validation for constraint: itemType - if (!$bMCreateButtonRequestTypeOptionDetailsItem instanceof \PayPal\StructType\OptionDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionDetails property can only contain items of \PayPal\StructType\OptionDetailsType, "%s" given', is_object($bMCreateButtonRequestTypeOptionDetailsItem) ? get_class($bMCreateButtonRequestTypeOptionDetailsItem) : gettype($bMCreateButtonRequestTypeOptionDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($optionDetailsArrayErrorMessage = self::validateOptionDetailsForArrayConstraintsFromSetOptionDetails($optionDetails))) { + throw new \InvalidArgumentException($optionDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($optionDetails) && count($optionDetails) > 5) { + 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($optionDetails)), __LINE__); } $this->OptionDetails = $optionDetails; return $this; @@ -311,7 +363,11 @@ public function addToOptionDetails(\PayPal\StructType\OptionDetailsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\OptionDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionDetails property can only contain items of \PayPal\StructType\OptionDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The OptionDetails property can only contain items of type \PayPal\StructType\OptionDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($this->OptionDetails) && count($this->OptionDetails) >= 5) { + 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->OptionDetails)), __LINE__); } $this->OptionDetails[] = $item; return $this; @@ -324,6 +380,28 @@ public function getTextBox() { return $this->TextBox; } + /** + * This method is responsible for validating the values passed to the setTextBox method + * This method is willingly generated in order to preserve the one-line inline validation within the setTextBox method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateTextBoxForArrayConstraintsFromSetTextBox(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMCreateButtonRequestTypeTextBoxItem) { + // validation for constraint: itemType + if (!is_string($bMCreateButtonRequestTypeTextBoxItem)) { + $invalidValues[] = is_object($bMCreateButtonRequestTypeTextBoxItem) ? get_class($bMCreateButtonRequestTypeTextBoxItem) : sprintf('%s(%s)', gettype($bMCreateButtonRequestTypeTextBoxItem), var_export($bMCreateButtonRequestTypeTextBoxItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The TextBox property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set TextBox value * @throws \InvalidArgumentException @@ -332,11 +410,13 @@ public function getTextBox() */ public function setTextBox(array $textBox = array()) { - foreach ($textBox as $bMCreateButtonRequestTypeTextBoxItem) { - // validation for constraint: itemType - if (!is_string($bMCreateButtonRequestTypeTextBoxItem)) { - throw new \InvalidArgumentException(sprintf('The TextBox property can only contain items of string, "%s" given', is_object($bMCreateButtonRequestTypeTextBoxItem) ? get_class($bMCreateButtonRequestTypeTextBoxItem) : gettype($bMCreateButtonRequestTypeTextBoxItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($textBoxArrayErrorMessage = self::validateTextBoxForArrayConstraintsFromSetTextBox($textBox))) { + throw new \InvalidArgumentException($textBoxArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(2) + if (is_array($textBox) && count($textBox) > 2) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 2', count($textBox)), __LINE__); } $this->TextBox = $textBox; return $this; @@ -351,7 +431,11 @@ public function addToTextBox($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The TextBox property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The TextBox property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(2) + if (is_array($this->TextBox) && count($this->TextBox) >= 2) { + 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 2', count($this->TextBox)), __LINE__); } $this->TextBox[] = $item; return $this; @@ -376,7 +460,7 @@ public function setButtonImage($buttonImage = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonImageType::valueIsValid($buttonImage)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonImage, implode(', ', \PayPal\EnumType\ButtonImageType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonImageType', is_array($buttonImage) ? implode(', ', $buttonImage) : var_export($buttonImage, true), implode(', ', \PayPal\EnumType\ButtonImageType::getValidValues())), __LINE__); } $this->ButtonImage = $buttonImage; return $this; @@ -398,7 +482,7 @@ public function setButtonImageURL($buttonImageURL = null) { // validation for constraint: string if (!is_null($buttonImageURL) && !is_string($buttonImageURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonImageURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonImageURL, true), gettype($buttonImageURL)), __LINE__); } $this->ButtonImageURL = $buttonImageURL; return $this; @@ -423,7 +507,7 @@ public function setBuyNowText($buyNowText = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BuyNowTextType::valueIsValid($buyNowText)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buyNowText, implode(', ', \PayPal\EnumType\BuyNowTextType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BuyNowTextType', is_array($buyNowText) ? implode(', ', $buyNowText) : var_export($buyNowText, true), implode(', ', \PayPal\EnumType\BuyNowTextType::getValidValues())), __LINE__); } $this->BuyNowText = $buyNowText; return $this; @@ -448,7 +532,7 @@ public function setSubscribeText($subscribeText = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SubscribeTextType::valueIsValid($subscribeText)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $subscribeText, implode(', ', \PayPal\EnumType\SubscribeTextType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SubscribeTextType', is_array($subscribeText) ? implode(', ', $subscribeText) : var_export($subscribeText, true), implode(', ', \PayPal\EnumType\SubscribeTextType::getValidValues())), __LINE__); } $this->SubscribeText = $subscribeText; return $this; @@ -473,7 +557,7 @@ public function setButtonCountry($buttonCountry = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CountryCodeType::valueIsValid($buttonCountry)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonCountry, implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CountryCodeType', is_array($buttonCountry) ? implode(', ', $buttonCountry) : var_export($buttonCountry, true), implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); } $this->ButtonCountry = $buttonCountry; return $this; @@ -495,7 +579,7 @@ public function setButtonLanguage($buttonLanguage = null) { // validation for constraint: string if (!is_null($buttonLanguage) && !is_string($buttonLanguage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonLanguage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonLanguage, true), gettype($buttonLanguage)), __LINE__); } $this->ButtonLanguage = $buttonLanguage; return $this; diff --git a/src/StructType/BMCreateButtonResponseType.php b/src/StructType/BMCreateButtonResponseType.php index 91e76e6..61492f5 100644 --- a/src/StructType/BMCreateButtonResponseType.php +++ b/src/StructType/BMCreateButtonResponseType.php @@ -13,7 +13,7 @@ class BMCreateButtonResponseType extends AbstractResponseType { /** * The Website - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class BMCreateButtonResponseType extends AbstractResponseType public $Website; /** * The Email - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -29,7 +29,7 @@ class BMCreateButtonResponseType extends AbstractResponseType public $Email; /** * The Mobile - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -37,7 +37,7 @@ class BMCreateButtonResponseType extends AbstractResponseType public $Mobile; /** * The HostedButtonID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -79,7 +79,7 @@ public function setWebsite($website = null) { // validation for constraint: string if (!is_null($website) && !is_string($website)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($website)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($website, true), gettype($website)), __LINE__); } $this->Website = $website; return $this; @@ -101,7 +101,7 @@ public function setEmail($email = null) { // validation for constraint: string if (!is_null($email) && !is_string($email)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($email)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($email, true), gettype($email)), __LINE__); } $this->Email = $email; return $this; @@ -123,7 +123,7 @@ public function setMobile($mobile = null) { // validation for constraint: string if (!is_null($mobile) && !is_string($mobile)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($mobile)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mobile, true), gettype($mobile)), __LINE__); } $this->Mobile = $mobile; return $this; @@ -145,7 +145,7 @@ public function setHostedButtonID($hostedButtonID = null) { // validation for constraint: string if (!is_null($hostedButtonID) && !is_string($hostedButtonID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hostedButtonID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hostedButtonID, true), gettype($hostedButtonID)), __LINE__); } $this->HostedButtonID = $hostedButtonID; return $this; diff --git a/src/StructType/BMGetButtonDetailsReq.php b/src/StructType/BMGetButtonDetailsReq.php index 3afabb7..7d8c293 100644 --- a/src/StructType/BMGetButtonDetailsReq.php +++ b/src/StructType/BMGetButtonDetailsReq.php @@ -13,7 +13,7 @@ class BMGetButtonDetailsReq extends AbstractStructBase { /** * The BMGetButtonDetailsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:BMGetButtonDetailsRequest * @var \PayPal\StructType\BMGetButtonDetailsRequestType */ diff --git a/src/StructType/BMGetButtonDetailsRequestType.php b/src/StructType/BMGetButtonDetailsRequestType.php index 38d0b40..0943bf4 100644 --- a/src/StructType/BMGetButtonDetailsRequestType.php +++ b/src/StructType/BMGetButtonDetailsRequestType.php @@ -13,7 +13,7 @@ class BMGetButtonDetailsRequestType extends AbstractRequestType { /** * The HostedButtonID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button ID of button to return. Required Character length and limitations: 10 single-byte numeric characters * - maxOccurs: 1 * - minOccurs: 1 @@ -47,7 +47,7 @@ public function setHostedButtonID($hostedButtonID = null) { // validation for constraint: string if (!is_null($hostedButtonID) && !is_string($hostedButtonID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hostedButtonID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hostedButtonID, true), gettype($hostedButtonID)), __LINE__); } $this->HostedButtonID = $hostedButtonID; return $this; diff --git a/src/StructType/BMGetButtonDetailsResponseType.php b/src/StructType/BMGetButtonDetailsResponseType.php index f967003..666c3be 100644 --- a/src/StructType/BMGetButtonDetailsResponseType.php +++ b/src/StructType/BMGetButtonDetailsResponseType.php @@ -13,7 +13,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType { /** * The Website - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $Website; /** * The Email - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -29,7 +29,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $Email; /** * The Mobile - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -37,7 +37,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $Mobile; /** * The HostedButtonID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -45,7 +45,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $HostedButtonID; /** * The ButtonType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of button. One of the following: BUYNOW, CART, GIFTCERTIFICATE. SUBSCRIBE, PAYMENTPLAN, AUTOBILLING, DONATE, VIEWCART or UNSUBSCRIBE * - maxOccurs: 1 * - minOccurs: 0 @@ -54,7 +54,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $ButtonType; /** * The ButtonCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of button code. One of the following: hosted, encrypted or cleartext * - maxOccurs: 1 * - minOccurs: 0 @@ -63,7 +63,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $ButtonCode; /** * The ButtonSubType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button sub type. optional for button types buynow and cart only Either PRODUCTS or SERVICES * - maxOccurs: 1 * - minOccurs: 0 @@ -72,7 +72,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $ButtonSubType; /** * The ButtonVar - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button Variable information Character length and limitations: 63 single-byte alphanumeric characters * - maxOccurs: 1000 * - minOccurs: 0 @@ -81,7 +81,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $ButtonVar; /** * The OptionDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 5 * - minOccurs: 0 * @var \PayPal\StructType\OptionDetailsType[] @@ -89,7 +89,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $OptionDetails; /** * The TextBox - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Text field * - maxOccurs: 2 * - minOccurs: 0 @@ -98,7 +98,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $TextBox; /** * The ButtonImage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button image to use. One of: REG, SML, or CC * - maxOccurs: 1 * - minOccurs: 0 @@ -107,7 +107,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $ButtonImage; /** * The ButtonImageURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button URL for custom button image. * - maxOccurs: 1 * - minOccurs: 0 @@ -116,7 +116,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $ButtonImageURL; /** * The BuyNowText - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Text to use on Buy Now Button. Either BUYNOW or PAYNOW * - maxOccurs: 1 * - minOccurs: 0 @@ -125,7 +125,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $BuyNowText; /** * The SubscribeText - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Text to use on Subscribe button. Must be either BUYNOW or SUBSCRIBE * - maxOccurs: 1 * - minOccurs: 0 @@ -134,7 +134,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $SubscribeText; /** * The ButtonCountry - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button Country. Valid ISO country code or 'International' * - maxOccurs: 1 * - minOccurs: 0 @@ -143,7 +143,7 @@ class BMGetButtonDetailsResponseType extends AbstractResponseType public $ButtonCountry; /** * The ButtonLanguage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button language code. Character length and limitations: 3 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -222,7 +222,7 @@ public function setWebsite($website = null) { // validation for constraint: string if (!is_null($website) && !is_string($website)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($website)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($website, true), gettype($website)), __LINE__); } $this->Website = $website; return $this; @@ -244,7 +244,7 @@ public function setEmail($email = null) { // validation for constraint: string if (!is_null($email) && !is_string($email)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($email)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($email, true), gettype($email)), __LINE__); } $this->Email = $email; return $this; @@ -266,7 +266,7 @@ public function setMobile($mobile = null) { // validation for constraint: string if (!is_null($mobile) && !is_string($mobile)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($mobile)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mobile, true), gettype($mobile)), __LINE__); } $this->Mobile = $mobile; return $this; @@ -288,7 +288,7 @@ public function setHostedButtonID($hostedButtonID = null) { // validation for constraint: string if (!is_null($hostedButtonID) && !is_string($hostedButtonID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hostedButtonID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hostedButtonID, true), gettype($hostedButtonID)), __LINE__); } $this->HostedButtonID = $hostedButtonID; return $this; @@ -313,7 +313,7 @@ public function setButtonType($buttonType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonTypeType::valueIsValid($buttonType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonType, implode(', ', \PayPal\EnumType\ButtonTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonTypeType', is_array($buttonType) ? implode(', ', $buttonType) : var_export($buttonType, true), implode(', ', \PayPal\EnumType\ButtonTypeType::getValidValues())), __LINE__); } $this->ButtonType = $buttonType; return $this; @@ -338,7 +338,7 @@ public function setButtonCode($buttonCode = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonCodeType::valueIsValid($buttonCode)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonCode, implode(', ', \PayPal\EnumType\ButtonCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonCodeType', is_array($buttonCode) ? implode(', ', $buttonCode) : var_export($buttonCode, true), implode(', ', \PayPal\EnumType\ButtonCodeType::getValidValues())), __LINE__); } $this->ButtonCode = $buttonCode; return $this; @@ -363,7 +363,7 @@ public function setButtonSubType($buttonSubType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonSubTypeType::valueIsValid($buttonSubType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonSubType, implode(', ', \PayPal\EnumType\ButtonSubTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonSubTypeType', is_array($buttonSubType) ? implode(', ', $buttonSubType) : var_export($buttonSubType, true), implode(', ', \PayPal\EnumType\ButtonSubTypeType::getValidValues())), __LINE__); } $this->ButtonSubType = $buttonSubType; return $this; @@ -376,6 +376,28 @@ public function getButtonVar() { return $this->ButtonVar; } + /** + * This method is responsible for validating the values passed to the setButtonVar method + * This method is willingly generated in order to preserve the one-line inline validation within the setButtonVar method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateButtonVarForArrayConstraintsFromSetButtonVar(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMGetButtonDetailsResponseTypeButtonVarItem) { + // validation for constraint: itemType + if (!is_string($bMGetButtonDetailsResponseTypeButtonVarItem)) { + $invalidValues[] = is_object($bMGetButtonDetailsResponseTypeButtonVarItem) ? get_class($bMGetButtonDetailsResponseTypeButtonVarItem) : sprintf('%s(%s)', gettype($bMGetButtonDetailsResponseTypeButtonVarItem), var_export($bMGetButtonDetailsResponseTypeButtonVarItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The ButtonVar property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set ButtonVar value * @throws \InvalidArgumentException @@ -384,11 +406,13 @@ public function getButtonVar() */ public function setButtonVar(array $buttonVar = array()) { - foreach ($buttonVar as $bMGetButtonDetailsResponseTypeButtonVarItem) { - // validation for constraint: itemType - if (!is_string($bMGetButtonDetailsResponseTypeButtonVarItem)) { - throw new \InvalidArgumentException(sprintf('The ButtonVar property can only contain items of string, "%s" given', is_object($bMGetButtonDetailsResponseTypeButtonVarItem) ? get_class($bMGetButtonDetailsResponseTypeButtonVarItem) : gettype($bMGetButtonDetailsResponseTypeButtonVarItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($buttonVarArrayErrorMessage = self::validateButtonVarForArrayConstraintsFromSetButtonVar($buttonVar))) { + throw new \InvalidArgumentException($buttonVarArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($buttonVar) && count($buttonVar) > 1000) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 1000', count($buttonVar)), __LINE__); } $this->ButtonVar = $buttonVar; return $this; @@ -403,7 +427,11 @@ public function addToButtonVar($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The ButtonVar property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The ButtonVar property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($this->ButtonVar) && count($this->ButtonVar) >= 1000) { + 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 1000', count($this->ButtonVar)), __LINE__); } $this->ButtonVar[] = $item; return $this; @@ -416,6 +444,28 @@ public function getOptionDetails() { return $this->OptionDetails; } + /** + * This method is responsible for validating the values passed to the setOptionDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setOptionDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateOptionDetailsForArrayConstraintsFromSetOptionDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMGetButtonDetailsResponseTypeOptionDetailsItem) { + // validation for constraint: itemType + if (!$bMGetButtonDetailsResponseTypeOptionDetailsItem instanceof \PayPal\StructType\OptionDetailsType) { + $invalidValues[] = is_object($bMGetButtonDetailsResponseTypeOptionDetailsItem) ? get_class($bMGetButtonDetailsResponseTypeOptionDetailsItem) : sprintf('%s(%s)', gettype($bMGetButtonDetailsResponseTypeOptionDetailsItem), var_export($bMGetButtonDetailsResponseTypeOptionDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The OptionDetails property can only contain items of type \PayPal\StructType\OptionDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set OptionDetails value * @throws \InvalidArgumentException @@ -424,11 +474,13 @@ public function getOptionDetails() */ public function setOptionDetails(array $optionDetails = array()) { - foreach ($optionDetails as $bMGetButtonDetailsResponseTypeOptionDetailsItem) { - // validation for constraint: itemType - if (!$bMGetButtonDetailsResponseTypeOptionDetailsItem instanceof \PayPal\StructType\OptionDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionDetails property can only contain items of \PayPal\StructType\OptionDetailsType, "%s" given', is_object($bMGetButtonDetailsResponseTypeOptionDetailsItem) ? get_class($bMGetButtonDetailsResponseTypeOptionDetailsItem) : gettype($bMGetButtonDetailsResponseTypeOptionDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($optionDetailsArrayErrorMessage = self::validateOptionDetailsForArrayConstraintsFromSetOptionDetails($optionDetails))) { + throw new \InvalidArgumentException($optionDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($optionDetails) && count($optionDetails) > 5) { + 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($optionDetails)), __LINE__); } $this->OptionDetails = $optionDetails; return $this; @@ -443,7 +495,11 @@ public function addToOptionDetails(\PayPal\StructType\OptionDetailsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\OptionDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionDetails property can only contain items of \PayPal\StructType\OptionDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The OptionDetails property can only contain items of type \PayPal\StructType\OptionDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($this->OptionDetails) && count($this->OptionDetails) >= 5) { + 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->OptionDetails)), __LINE__); } $this->OptionDetails[] = $item; return $this; @@ -456,6 +512,28 @@ public function getTextBox() { return $this->TextBox; } + /** + * This method is responsible for validating the values passed to the setTextBox method + * This method is willingly generated in order to preserve the one-line inline validation within the setTextBox method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateTextBoxForArrayConstraintsFromSetTextBox(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMGetButtonDetailsResponseTypeTextBoxItem) { + // validation for constraint: itemType + if (!is_string($bMGetButtonDetailsResponseTypeTextBoxItem)) { + $invalidValues[] = is_object($bMGetButtonDetailsResponseTypeTextBoxItem) ? get_class($bMGetButtonDetailsResponseTypeTextBoxItem) : sprintf('%s(%s)', gettype($bMGetButtonDetailsResponseTypeTextBoxItem), var_export($bMGetButtonDetailsResponseTypeTextBoxItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The TextBox property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set TextBox value * @throws \InvalidArgumentException @@ -464,11 +542,13 @@ public function getTextBox() */ public function setTextBox(array $textBox = array()) { - foreach ($textBox as $bMGetButtonDetailsResponseTypeTextBoxItem) { - // validation for constraint: itemType - if (!is_string($bMGetButtonDetailsResponseTypeTextBoxItem)) { - throw new \InvalidArgumentException(sprintf('The TextBox property can only contain items of string, "%s" given', is_object($bMGetButtonDetailsResponseTypeTextBoxItem) ? get_class($bMGetButtonDetailsResponseTypeTextBoxItem) : gettype($bMGetButtonDetailsResponseTypeTextBoxItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($textBoxArrayErrorMessage = self::validateTextBoxForArrayConstraintsFromSetTextBox($textBox))) { + throw new \InvalidArgumentException($textBoxArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(2) + if (is_array($textBox) && count($textBox) > 2) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 2', count($textBox)), __LINE__); } $this->TextBox = $textBox; return $this; @@ -483,7 +563,11 @@ public function addToTextBox($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The TextBox property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The TextBox property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(2) + if (is_array($this->TextBox) && count($this->TextBox) >= 2) { + 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 2', count($this->TextBox)), __LINE__); } $this->TextBox[] = $item; return $this; @@ -508,7 +592,7 @@ public function setButtonImage($buttonImage = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonImageType::valueIsValid($buttonImage)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonImage, implode(', ', \PayPal\EnumType\ButtonImageType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonImageType', is_array($buttonImage) ? implode(', ', $buttonImage) : var_export($buttonImage, true), implode(', ', \PayPal\EnumType\ButtonImageType::getValidValues())), __LINE__); } $this->ButtonImage = $buttonImage; return $this; @@ -530,7 +614,7 @@ public function setButtonImageURL($buttonImageURL = null) { // validation for constraint: string if (!is_null($buttonImageURL) && !is_string($buttonImageURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonImageURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonImageURL, true), gettype($buttonImageURL)), __LINE__); } $this->ButtonImageURL = $buttonImageURL; return $this; @@ -555,7 +639,7 @@ public function setBuyNowText($buyNowText = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BuyNowTextType::valueIsValid($buyNowText)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buyNowText, implode(', ', \PayPal\EnumType\BuyNowTextType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BuyNowTextType', is_array($buyNowText) ? implode(', ', $buyNowText) : var_export($buyNowText, true), implode(', ', \PayPal\EnumType\BuyNowTextType::getValidValues())), __LINE__); } $this->BuyNowText = $buyNowText; return $this; @@ -580,7 +664,7 @@ public function setSubscribeText($subscribeText = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SubscribeTextType::valueIsValid($subscribeText)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $subscribeText, implode(', ', \PayPal\EnumType\SubscribeTextType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SubscribeTextType', is_array($subscribeText) ? implode(', ', $subscribeText) : var_export($subscribeText, true), implode(', ', \PayPal\EnumType\SubscribeTextType::getValidValues())), __LINE__); } $this->SubscribeText = $subscribeText; return $this; @@ -605,7 +689,7 @@ public function setButtonCountry($buttonCountry = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CountryCodeType::valueIsValid($buttonCountry)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonCountry, implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CountryCodeType', is_array($buttonCountry) ? implode(', ', $buttonCountry) : var_export($buttonCountry, true), implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); } $this->ButtonCountry = $buttonCountry; return $this; @@ -627,7 +711,7 @@ public function setButtonLanguage($buttonLanguage = null) { // validation for constraint: string if (!is_null($buttonLanguage) && !is_string($buttonLanguage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonLanguage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonLanguage, true), gettype($buttonLanguage)), __LINE__); } $this->ButtonLanguage = $buttonLanguage; return $this; diff --git a/src/StructType/BMGetInventoryReq.php b/src/StructType/BMGetInventoryReq.php index 76fb424..4091065 100644 --- a/src/StructType/BMGetInventoryReq.php +++ b/src/StructType/BMGetInventoryReq.php @@ -13,7 +13,7 @@ class BMGetInventoryReq extends AbstractStructBase { /** * The BMGetInventoryRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:BMGetInventoryRequest * @var \PayPal\StructType\BMGetInventoryRequestType */ diff --git a/src/StructType/BMGetInventoryRequestType.php b/src/StructType/BMGetInventoryRequestType.php index 707da05..ae4dc65 100644 --- a/src/StructType/BMGetInventoryRequestType.php +++ b/src/StructType/BMGetInventoryRequestType.php @@ -13,7 +13,7 @@ class BMGetInventoryRequestType extends AbstractRequestType { /** * The HostedButtonID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Hosted Button ID of the button to return inventory for. Required Character length and limitations: 10 single-byte numeric characters * - maxOccurs: 1 * - minOccurs: 1 @@ -47,7 +47,7 @@ public function setHostedButtonID($hostedButtonID = null) { // validation for constraint: string if (!is_null($hostedButtonID) && !is_string($hostedButtonID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hostedButtonID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hostedButtonID, true), gettype($hostedButtonID)), __LINE__); } $this->HostedButtonID = $hostedButtonID; return $this; diff --git a/src/StructType/BMGetInventoryResponseType.php b/src/StructType/BMGetInventoryResponseType.php index 2d5ae43..c4311fc 100644 --- a/src/StructType/BMGetInventoryResponseType.php +++ b/src/StructType/BMGetInventoryResponseType.php @@ -13,7 +13,7 @@ class BMGetInventoryResponseType extends AbstractResponseType { /** * The HostedButtonID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class BMGetInventoryResponseType extends AbstractResponseType public $HostedButtonID; /** * The TrackInv - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -29,7 +29,7 @@ class BMGetInventoryResponseType extends AbstractResponseType public $TrackInv; /** * The TrackPnl - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -37,7 +37,7 @@ class BMGetInventoryResponseType extends AbstractResponseType public $TrackPnl; /** * The ItemTrackingDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:ItemTrackingDetails @@ -46,7 +46,7 @@ class BMGetInventoryResponseType extends AbstractResponseType public $ItemTrackingDetails; /** * The OptionIndex - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -54,7 +54,7 @@ class BMGetInventoryResponseType extends AbstractResponseType public $OptionIndex; /** * The OptionName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -62,7 +62,7 @@ class BMGetInventoryResponseType extends AbstractResponseType public $OptionName; /** * The OptionTrackingDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 10 * - minOccurs: 0 * - ref: ebl:OptionTrackingDetails @@ -71,7 +71,7 @@ class BMGetInventoryResponseType extends AbstractResponseType public $OptionTrackingDetails; /** * The SoldoutURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -79,7 +79,7 @@ class BMGetInventoryResponseType extends AbstractResponseType public $SoldoutURL; /** * The DigitalDownloadKeys - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1000 * - minOccurs: 0 * @var string[] @@ -136,7 +136,7 @@ public function setHostedButtonID($hostedButtonID = null) { // validation for constraint: string if (!is_null($hostedButtonID) && !is_string($hostedButtonID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hostedButtonID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hostedButtonID, true), gettype($hostedButtonID)), __LINE__); } $this->HostedButtonID = $hostedButtonID; return $this; @@ -158,7 +158,7 @@ public function setTrackInv($trackInv = null) { // validation for constraint: string if (!is_null($trackInv) && !is_string($trackInv)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($trackInv)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($trackInv, true), gettype($trackInv)), __LINE__); } $this->TrackInv = $trackInv; return $this; @@ -180,7 +180,7 @@ public function setTrackPnl($trackPnl = null) { // validation for constraint: string if (!is_null($trackPnl) && !is_string($trackPnl)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($trackPnl)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($trackPnl, true), gettype($trackPnl)), __LINE__); } $this->TrackPnl = $trackPnl; return $this; @@ -220,7 +220,7 @@ public function setOptionIndex($optionIndex = null) { // validation for constraint: string if (!is_null($optionIndex) && !is_string($optionIndex)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionIndex)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionIndex, true), gettype($optionIndex)), __LINE__); } $this->OptionIndex = $optionIndex; return $this; @@ -242,7 +242,7 @@ public function setOptionName($optionName = null) { // validation for constraint: string if (!is_null($optionName) && !is_string($optionName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionName, true), gettype($optionName)), __LINE__); } $this->OptionName = $optionName; return $this; @@ -255,6 +255,28 @@ public function getOptionTrackingDetails() { return $this->OptionTrackingDetails; } + /** + * This method is responsible for validating the values passed to the setOptionTrackingDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setOptionTrackingDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateOptionTrackingDetailsForArrayConstraintsFromSetOptionTrackingDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMGetInventoryResponseTypeOptionTrackingDetailsItem) { + // validation for constraint: itemType + if (!$bMGetInventoryResponseTypeOptionTrackingDetailsItem instanceof \PayPal\StructType\OptionTrackingDetailsType) { + $invalidValues[] = is_object($bMGetInventoryResponseTypeOptionTrackingDetailsItem) ? get_class($bMGetInventoryResponseTypeOptionTrackingDetailsItem) : sprintf('%s(%s)', gettype($bMGetInventoryResponseTypeOptionTrackingDetailsItem), var_export($bMGetInventoryResponseTypeOptionTrackingDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The OptionTrackingDetails property can only contain items of type \PayPal\StructType\OptionTrackingDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set OptionTrackingDetails value * @throws \InvalidArgumentException @@ -263,11 +285,13 @@ public function getOptionTrackingDetails() */ public function setOptionTrackingDetails(array $optionTrackingDetails = array()) { - foreach ($optionTrackingDetails as $bMGetInventoryResponseTypeOptionTrackingDetailsItem) { - // validation for constraint: itemType - if (!$bMGetInventoryResponseTypeOptionTrackingDetailsItem instanceof \PayPal\StructType\OptionTrackingDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionTrackingDetails property can only contain items of \PayPal\StructType\OptionTrackingDetailsType, "%s" given', is_object($bMGetInventoryResponseTypeOptionTrackingDetailsItem) ? get_class($bMGetInventoryResponseTypeOptionTrackingDetailsItem) : gettype($bMGetInventoryResponseTypeOptionTrackingDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($optionTrackingDetailsArrayErrorMessage = self::validateOptionTrackingDetailsForArrayConstraintsFromSetOptionTrackingDetails($optionTrackingDetails))) { + throw new \InvalidArgumentException($optionTrackingDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($optionTrackingDetails) && count($optionTrackingDetails) > 10) { + 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($optionTrackingDetails)), __LINE__); } $this->OptionTrackingDetails = $optionTrackingDetails; return $this; @@ -282,7 +306,11 @@ public function addToOptionTrackingDetails(\PayPal\StructType\OptionTrackingDeta { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\OptionTrackingDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionTrackingDetails property can only contain items of \PayPal\StructType\OptionTrackingDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The OptionTrackingDetails property can only contain items of type \PayPal\StructType\OptionTrackingDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->OptionTrackingDetails) && count($this->OptionTrackingDetails) >= 10) { + 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->OptionTrackingDetails)), __LINE__); } $this->OptionTrackingDetails[] = $item; return $this; @@ -304,7 +332,7 @@ public function setSoldoutURL($soldoutURL = null) { // validation for constraint: string if (!is_null($soldoutURL) && !is_string($soldoutURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($soldoutURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($soldoutURL, true), gettype($soldoutURL)), __LINE__); } $this->SoldoutURL = $soldoutURL; return $this; @@ -317,6 +345,28 @@ public function getDigitalDownloadKeys() { return $this->DigitalDownloadKeys; } + /** + * This method is responsible for validating the values passed to the setDigitalDownloadKeys method + * This method is willingly generated in order to preserve the one-line inline validation within the setDigitalDownloadKeys method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateDigitalDownloadKeysForArrayConstraintsFromSetDigitalDownloadKeys(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMGetInventoryResponseTypeDigitalDownloadKeysItem) { + // validation for constraint: itemType + if (!is_string($bMGetInventoryResponseTypeDigitalDownloadKeysItem)) { + $invalidValues[] = is_object($bMGetInventoryResponseTypeDigitalDownloadKeysItem) ? get_class($bMGetInventoryResponseTypeDigitalDownloadKeysItem) : sprintf('%s(%s)', gettype($bMGetInventoryResponseTypeDigitalDownloadKeysItem), var_export($bMGetInventoryResponseTypeDigitalDownloadKeysItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The DigitalDownloadKeys property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set DigitalDownloadKeys value * @throws \InvalidArgumentException @@ -325,11 +375,13 @@ public function getDigitalDownloadKeys() */ public function setDigitalDownloadKeys(array $digitalDownloadKeys = array()) { - foreach ($digitalDownloadKeys as $bMGetInventoryResponseTypeDigitalDownloadKeysItem) { - // validation for constraint: itemType - if (!is_string($bMGetInventoryResponseTypeDigitalDownloadKeysItem)) { - throw new \InvalidArgumentException(sprintf('The DigitalDownloadKeys property can only contain items of string, "%s" given', is_object($bMGetInventoryResponseTypeDigitalDownloadKeysItem) ? get_class($bMGetInventoryResponseTypeDigitalDownloadKeysItem) : gettype($bMGetInventoryResponseTypeDigitalDownloadKeysItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($digitalDownloadKeysArrayErrorMessage = self::validateDigitalDownloadKeysForArrayConstraintsFromSetDigitalDownloadKeys($digitalDownloadKeys))) { + throw new \InvalidArgumentException($digitalDownloadKeysArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($digitalDownloadKeys) && count($digitalDownloadKeys) > 1000) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 1000', count($digitalDownloadKeys)), __LINE__); } $this->DigitalDownloadKeys = $digitalDownloadKeys; return $this; @@ -344,7 +396,11 @@ public function addToDigitalDownloadKeys($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The DigitalDownloadKeys property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The DigitalDownloadKeys property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($this->DigitalDownloadKeys) && count($this->DigitalDownloadKeys) >= 1000) { + 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 1000', count($this->DigitalDownloadKeys)), __LINE__); } $this->DigitalDownloadKeys[] = $item; return $this; diff --git a/src/StructType/BMLOfferInfoType.php b/src/StructType/BMLOfferInfoType.php index 1b756a6..4653625 100644 --- a/src/StructType/BMLOfferInfoType.php +++ b/src/StructType/BMLOfferInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for BMLOfferInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BMLOfferInfoType Specific information for BML. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class BMLOfferInfoType extends AbstractStructBase { /** * The OfferTrackingID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique identification for merchant/buyer/offer combo. * - minOccurs: 0 * @var string @@ -48,7 +48,7 @@ public function setOfferTrackingID($offerTrackingID = null) { // validation for constraint: string if (!is_null($offerTrackingID) && !is_string($offerTrackingID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($offerTrackingID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($offerTrackingID, true), gettype($offerTrackingID)), __LINE__); } $this->OfferTrackingID = $offerTrackingID; return $this; diff --git a/src/StructType/BMManageButtonStatusReq.php b/src/StructType/BMManageButtonStatusReq.php index 3bb40a7..ffb4c8c 100644 --- a/src/StructType/BMManageButtonStatusReq.php +++ b/src/StructType/BMManageButtonStatusReq.php @@ -13,7 +13,7 @@ class BMManageButtonStatusReq extends AbstractStructBase { /** * The BMManageButtonStatusRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:BMManageButtonStatusRequest * @var \PayPal\StructType\BMManageButtonStatusRequestType */ diff --git a/src/StructType/BMManageButtonStatusRequestType.php b/src/StructType/BMManageButtonStatusRequestType.php index dfe693c..15dc5f2 100644 --- a/src/StructType/BMManageButtonStatusRequestType.php +++ b/src/StructType/BMManageButtonStatusRequestType.php @@ -13,7 +13,7 @@ class BMManageButtonStatusRequestType extends AbstractRequestType { /** * The HostedButtonID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button ID of Hosted button. Required Character length and limitations: 10 single-byte numeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class BMManageButtonStatusRequestType extends AbstractRequestType public $HostedButtonID; /** * The ButtonStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Requested Status change for hosted button. Required Character length and limitations: 1 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -59,7 +59,7 @@ public function setHostedButtonID($hostedButtonID = null) { // validation for constraint: string if (!is_null($hostedButtonID) && !is_string($hostedButtonID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hostedButtonID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hostedButtonID, true), gettype($hostedButtonID)), __LINE__); } $this->HostedButtonID = $hostedButtonID; return $this; @@ -84,7 +84,7 @@ public function setButtonStatus($buttonStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonStatusType::valueIsValid($buttonStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonStatus, implode(', ', \PayPal\EnumType\ButtonStatusType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonStatusType', is_array($buttonStatus) ? implode(', ', $buttonStatus) : var_export($buttonStatus, true), implode(', ', \PayPal\EnumType\ButtonStatusType::getValidValues())), __LINE__); } $this->ButtonStatus = $buttonStatus; return $this; diff --git a/src/StructType/BMManageButtonStatusResponseType.php b/src/StructType/BMManageButtonStatusResponseType.php index 36cdd7e..5c06715 100644 --- a/src/StructType/BMManageButtonStatusResponseType.php +++ b/src/StructType/BMManageButtonStatusResponseType.php @@ -11,12 +11,6 @@ */ class BMManageButtonStatusResponseType extends AbstractResponseType { - /** - * Constructor method for BMManageButtonStatusResponseType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/BMSetInventoryReq.php b/src/StructType/BMSetInventoryReq.php index 1fd08fc..de8c84a 100644 --- a/src/StructType/BMSetInventoryReq.php +++ b/src/StructType/BMSetInventoryReq.php @@ -13,7 +13,7 @@ class BMSetInventoryReq extends AbstractStructBase { /** * The BMSetInventoryRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:BMSetInventoryRequest * @var \PayPal\StructType\BMSetInventoryRequestType */ diff --git a/src/StructType/BMSetInventoryRequestType.php b/src/StructType/BMSetInventoryRequestType.php index 236d4ea..4ca6d38 100644 --- a/src/StructType/BMSetInventoryRequestType.php +++ b/src/StructType/BMSetInventoryRequestType.php @@ -13,7 +13,7 @@ class BMSetInventoryRequestType extends AbstractRequestType { /** * The HostedButtonID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Hosted Button ID of button you wish to change. Required Character length and limitations: 10 single-byte numeric characters * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class BMSetInventoryRequestType extends AbstractRequestType public $HostedButtonID; /** * The TrackInv - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Is Inventory tracked. Required 0 or 1 * - maxOccurs: 1 * - minOccurs: 1 @@ -31,7 +31,7 @@ class BMSetInventoryRequestType extends AbstractRequestType public $TrackInv; /** * The TrackPnl - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Is PNL Tracked. Required 0 or 1 * - maxOccurs: 1 * - minOccurs: 1 @@ -40,7 +40,7 @@ class BMSetInventoryRequestType extends AbstractRequestType public $TrackPnl; /** * The ItemTrackingDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:ItemTrackingDetails @@ -49,7 +49,7 @@ class BMSetInventoryRequestType extends AbstractRequestType public $ItemTrackingDetails; /** * The OptionIndex - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Index. Optional Character length and limitations: 1 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -58,7 +58,7 @@ class BMSetInventoryRequestType extends AbstractRequestType public $OptionIndex; /** * The OptionTrackingDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 10 * - minOccurs: 0 * - ref: ebl:OptionTrackingDetails @@ -67,7 +67,7 @@ class BMSetInventoryRequestType extends AbstractRequestType public $OptionTrackingDetails; /** * The SoldoutURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL of page to display when an item is soldout. Optional Character length and limitations: 127 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -76,7 +76,7 @@ class BMSetInventoryRequestType extends AbstractRequestType public $SoldoutURL; /** * The ReuseDigitalDownloadKeys - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Whether to use the same digital download key repeatedly. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -85,7 +85,7 @@ class BMSetInventoryRequestType extends AbstractRequestType public $ReuseDigitalDownloadKeys; /** * The AppendDigitalDownloadKeys - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Whether to append these keys to the list or not (replace). Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -94,7 +94,7 @@ class BMSetInventoryRequestType extends AbstractRequestType public $AppendDigitalDownloadKeys; /** * The DigitalDownloadKeys - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Zero or more digital download keys to distribute to customers after transaction is completed. Optional Character length and limitations: 1000 single-byte alphanumeric characters * - maxOccurs: 1000 * - minOccurs: 0 @@ -155,7 +155,7 @@ public function setHostedButtonID($hostedButtonID = null) { // validation for constraint: string if (!is_null($hostedButtonID) && !is_string($hostedButtonID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hostedButtonID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hostedButtonID, true), gettype($hostedButtonID)), __LINE__); } $this->HostedButtonID = $hostedButtonID; return $this; @@ -177,7 +177,7 @@ public function setTrackInv($trackInv = null) { // validation for constraint: string if (!is_null($trackInv) && !is_string($trackInv)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($trackInv)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($trackInv, true), gettype($trackInv)), __LINE__); } $this->TrackInv = $trackInv; return $this; @@ -199,7 +199,7 @@ public function setTrackPnl($trackPnl = null) { // validation for constraint: string if (!is_null($trackPnl) && !is_string($trackPnl)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($trackPnl)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($trackPnl, true), gettype($trackPnl)), __LINE__); } $this->TrackPnl = $trackPnl; return $this; @@ -239,7 +239,7 @@ public function setOptionIndex($optionIndex = null) { // validation for constraint: string if (!is_null($optionIndex) && !is_string($optionIndex)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionIndex)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionIndex, true), gettype($optionIndex)), __LINE__); } $this->OptionIndex = $optionIndex; return $this; @@ -252,6 +252,28 @@ public function getOptionTrackingDetails() { return $this->OptionTrackingDetails; } + /** + * This method is responsible for validating the values passed to the setOptionTrackingDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setOptionTrackingDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateOptionTrackingDetailsForArrayConstraintsFromSetOptionTrackingDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMSetInventoryRequestTypeOptionTrackingDetailsItem) { + // validation for constraint: itemType + if (!$bMSetInventoryRequestTypeOptionTrackingDetailsItem instanceof \PayPal\StructType\OptionTrackingDetailsType) { + $invalidValues[] = is_object($bMSetInventoryRequestTypeOptionTrackingDetailsItem) ? get_class($bMSetInventoryRequestTypeOptionTrackingDetailsItem) : sprintf('%s(%s)', gettype($bMSetInventoryRequestTypeOptionTrackingDetailsItem), var_export($bMSetInventoryRequestTypeOptionTrackingDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The OptionTrackingDetails property can only contain items of type \PayPal\StructType\OptionTrackingDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set OptionTrackingDetails value * @throws \InvalidArgumentException @@ -260,11 +282,13 @@ public function getOptionTrackingDetails() */ public function setOptionTrackingDetails(array $optionTrackingDetails = array()) { - foreach ($optionTrackingDetails as $bMSetInventoryRequestTypeOptionTrackingDetailsItem) { - // validation for constraint: itemType - if (!$bMSetInventoryRequestTypeOptionTrackingDetailsItem instanceof \PayPal\StructType\OptionTrackingDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionTrackingDetails property can only contain items of \PayPal\StructType\OptionTrackingDetailsType, "%s" given', is_object($bMSetInventoryRequestTypeOptionTrackingDetailsItem) ? get_class($bMSetInventoryRequestTypeOptionTrackingDetailsItem) : gettype($bMSetInventoryRequestTypeOptionTrackingDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($optionTrackingDetailsArrayErrorMessage = self::validateOptionTrackingDetailsForArrayConstraintsFromSetOptionTrackingDetails($optionTrackingDetails))) { + throw new \InvalidArgumentException($optionTrackingDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($optionTrackingDetails) && count($optionTrackingDetails) > 10) { + 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($optionTrackingDetails)), __LINE__); } $this->OptionTrackingDetails = $optionTrackingDetails; return $this; @@ -279,7 +303,11 @@ public function addToOptionTrackingDetails(\PayPal\StructType\OptionTrackingDeta { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\OptionTrackingDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionTrackingDetails property can only contain items of \PayPal\StructType\OptionTrackingDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The OptionTrackingDetails property can only contain items of type \PayPal\StructType\OptionTrackingDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->OptionTrackingDetails) && count($this->OptionTrackingDetails) >= 10) { + 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->OptionTrackingDetails)), __LINE__); } $this->OptionTrackingDetails[] = $item; return $this; @@ -301,7 +329,7 @@ public function setSoldoutURL($soldoutURL = null) { // validation for constraint: string if (!is_null($soldoutURL) && !is_string($soldoutURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($soldoutURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($soldoutURL, true), gettype($soldoutURL)), __LINE__); } $this->SoldoutURL = $soldoutURL; return $this; @@ -323,7 +351,7 @@ public function setReuseDigitalDownloadKeys($reuseDigitalDownloadKeys = null) { // validation for constraint: string if (!is_null($reuseDigitalDownloadKeys) && !is_string($reuseDigitalDownloadKeys)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reuseDigitalDownloadKeys)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reuseDigitalDownloadKeys, true), gettype($reuseDigitalDownloadKeys)), __LINE__); } $this->ReuseDigitalDownloadKeys = $reuseDigitalDownloadKeys; return $this; @@ -345,7 +373,7 @@ public function setAppendDigitalDownloadKeys($appendDigitalDownloadKeys = null) { // validation for constraint: string if (!is_null($appendDigitalDownloadKeys) && !is_string($appendDigitalDownloadKeys)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($appendDigitalDownloadKeys)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($appendDigitalDownloadKeys, true), gettype($appendDigitalDownloadKeys)), __LINE__); } $this->AppendDigitalDownloadKeys = $appendDigitalDownloadKeys; return $this; @@ -358,6 +386,28 @@ public function getDigitalDownloadKeys() { return $this->DigitalDownloadKeys; } + /** + * This method is responsible for validating the values passed to the setDigitalDownloadKeys method + * This method is willingly generated in order to preserve the one-line inline validation within the setDigitalDownloadKeys method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateDigitalDownloadKeysForArrayConstraintsFromSetDigitalDownloadKeys(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMSetInventoryRequestTypeDigitalDownloadKeysItem) { + // validation for constraint: itemType + if (!is_string($bMSetInventoryRequestTypeDigitalDownloadKeysItem)) { + $invalidValues[] = is_object($bMSetInventoryRequestTypeDigitalDownloadKeysItem) ? get_class($bMSetInventoryRequestTypeDigitalDownloadKeysItem) : sprintf('%s(%s)', gettype($bMSetInventoryRequestTypeDigitalDownloadKeysItem), var_export($bMSetInventoryRequestTypeDigitalDownloadKeysItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The DigitalDownloadKeys property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set DigitalDownloadKeys value * @throws \InvalidArgumentException @@ -366,11 +416,13 @@ public function getDigitalDownloadKeys() */ public function setDigitalDownloadKeys(array $digitalDownloadKeys = array()) { - foreach ($digitalDownloadKeys as $bMSetInventoryRequestTypeDigitalDownloadKeysItem) { - // validation for constraint: itemType - if (!is_string($bMSetInventoryRequestTypeDigitalDownloadKeysItem)) { - throw new \InvalidArgumentException(sprintf('The DigitalDownloadKeys property can only contain items of string, "%s" given', is_object($bMSetInventoryRequestTypeDigitalDownloadKeysItem) ? get_class($bMSetInventoryRequestTypeDigitalDownloadKeysItem) : gettype($bMSetInventoryRequestTypeDigitalDownloadKeysItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($digitalDownloadKeysArrayErrorMessage = self::validateDigitalDownloadKeysForArrayConstraintsFromSetDigitalDownloadKeys($digitalDownloadKeys))) { + throw new \InvalidArgumentException($digitalDownloadKeysArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($digitalDownloadKeys) && count($digitalDownloadKeys) > 1000) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 1000', count($digitalDownloadKeys)), __LINE__); } $this->DigitalDownloadKeys = $digitalDownloadKeys; return $this; @@ -385,7 +437,11 @@ public function addToDigitalDownloadKeys($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The DigitalDownloadKeys property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The DigitalDownloadKeys property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($this->DigitalDownloadKeys) && count($this->DigitalDownloadKeys) >= 1000) { + 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 1000', count($this->DigitalDownloadKeys)), __LINE__); } $this->DigitalDownloadKeys[] = $item; return $this; diff --git a/src/StructType/BMSetInventoryResponseType.php b/src/StructType/BMSetInventoryResponseType.php index 6cdb696..0343cd7 100644 --- a/src/StructType/BMSetInventoryResponseType.php +++ b/src/StructType/BMSetInventoryResponseType.php @@ -11,12 +11,6 @@ */ class BMSetInventoryResponseType extends AbstractResponseType { - /** - * Constructor method for BMSetInventoryResponseType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/BMUpdateButtonReq.php b/src/StructType/BMUpdateButtonReq.php index a196e84..64610da 100644 --- a/src/StructType/BMUpdateButtonReq.php +++ b/src/StructType/BMUpdateButtonReq.php @@ -13,7 +13,7 @@ class BMUpdateButtonReq extends AbstractStructBase { /** * The BMUpdateButtonRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:BMUpdateButtonRequest * @var \PayPal\StructType\BMUpdateButtonRequestType */ diff --git a/src/StructType/BMUpdateButtonRequestType.php b/src/StructType/BMUpdateButtonRequestType.php index 894ab6c..7e74919 100644 --- a/src/StructType/BMUpdateButtonRequestType.php +++ b/src/StructType/BMUpdateButtonRequestType.php @@ -13,7 +13,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType { /** * The HostedButtonID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Hosted Button id of the button to update. Required Character length and limitations: 10 single-byte numeric characters * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $HostedButtonID; /** * The ButtonType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of Button to create. Required Must be one of the following: BUYNOW, CART, GIFTCERTIFICATE. SUBSCRIBE, PAYMENTPLAN, AUTOBILLING, DONATE, VIEWCART or UNSUBSCRIBE * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $ButtonType; /** * The ButtonCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: button code. optional Must be one of the following: hosted, encrypted or cleartext * - maxOccurs: 1 * - minOccurs: 0 @@ -40,7 +40,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $ButtonCode; /** * The ButtonSubType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button sub type. optional for button types buynow and cart only Must Be either PRODUCTS or SERVICES * - maxOccurs: 1 * - minOccurs: 0 @@ -49,7 +49,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $ButtonSubType; /** * The ButtonVar - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button Variable information At least one required recurring Character length and limitations: 63 single-byte alphanumeric characters * - maxOccurs: 1000 * - minOccurs: 0 @@ -58,7 +58,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $ButtonVar; /** * The OptionDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 5 * - minOccurs: 0 * @var \PayPal\StructType\OptionDetailsType[] @@ -66,7 +66,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $OptionDetails; /** * The TextBox - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details of each option for the button. Optional * - maxOccurs: 2 * - minOccurs: 0 @@ -75,7 +75,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $TextBox; /** * The ButtonImage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button image to use. Optional Must be one of: REG, SML, or CC * - maxOccurs: 1 * - minOccurs: 0 @@ -84,7 +84,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $ButtonImage; /** * The ButtonImageURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button URL for custom button image. Optional Character length and limitations: 127 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -93,7 +93,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $ButtonImageURL; /** * The BuyNowText - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Text to use on Buy Now Button. Optional Must be either BUYNOW or PAYNOW * - maxOccurs: 1 * - minOccurs: 0 @@ -102,7 +102,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $BuyNowText; /** * The SubscribeText - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Text to use on Subscribe button. Optional Must be either BUYNOW or SUBSCRIBE * - maxOccurs: 1 * - minOccurs: 0 @@ -111,7 +111,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $SubscribeText; /** * The ButtonCountry - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button Country. Optional Must be valid ISO country code * - maxOccurs: 1 * - minOccurs: 0 @@ -120,7 +120,7 @@ class BMUpdateButtonRequestType extends AbstractRequestType public $ButtonCountry; /** * The ButtonLanguage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Button language code. Optional Character length and limitations: 2 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -190,7 +190,7 @@ public function setHostedButtonID($hostedButtonID = null) { // validation for constraint: string if (!is_null($hostedButtonID) && !is_string($hostedButtonID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hostedButtonID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hostedButtonID, true), gettype($hostedButtonID)), __LINE__); } $this->HostedButtonID = $hostedButtonID; return $this; @@ -215,7 +215,7 @@ public function setButtonType($buttonType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonTypeType::valueIsValid($buttonType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonType, implode(', ', \PayPal\EnumType\ButtonTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonTypeType', is_array($buttonType) ? implode(', ', $buttonType) : var_export($buttonType, true), implode(', ', \PayPal\EnumType\ButtonTypeType::getValidValues())), __LINE__); } $this->ButtonType = $buttonType; return $this; @@ -240,7 +240,7 @@ public function setButtonCode($buttonCode = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonCodeType::valueIsValid($buttonCode)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonCode, implode(', ', \PayPal\EnumType\ButtonCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonCodeType', is_array($buttonCode) ? implode(', ', $buttonCode) : var_export($buttonCode, true), implode(', ', \PayPal\EnumType\ButtonCodeType::getValidValues())), __LINE__); } $this->ButtonCode = $buttonCode; return $this; @@ -265,7 +265,7 @@ public function setButtonSubType($buttonSubType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonSubTypeType::valueIsValid($buttonSubType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonSubType, implode(', ', \PayPal\EnumType\ButtonSubTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonSubTypeType', is_array($buttonSubType) ? implode(', ', $buttonSubType) : var_export($buttonSubType, true), implode(', ', \PayPal\EnumType\ButtonSubTypeType::getValidValues())), __LINE__); } $this->ButtonSubType = $buttonSubType; return $this; @@ -278,6 +278,28 @@ public function getButtonVar() { return $this->ButtonVar; } + /** + * This method is responsible for validating the values passed to the setButtonVar method + * This method is willingly generated in order to preserve the one-line inline validation within the setButtonVar method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateButtonVarForArrayConstraintsFromSetButtonVar(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMUpdateButtonRequestTypeButtonVarItem) { + // validation for constraint: itemType + if (!is_string($bMUpdateButtonRequestTypeButtonVarItem)) { + $invalidValues[] = is_object($bMUpdateButtonRequestTypeButtonVarItem) ? get_class($bMUpdateButtonRequestTypeButtonVarItem) : sprintf('%s(%s)', gettype($bMUpdateButtonRequestTypeButtonVarItem), var_export($bMUpdateButtonRequestTypeButtonVarItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The ButtonVar property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set ButtonVar value * @throws \InvalidArgumentException @@ -286,11 +308,13 @@ public function getButtonVar() */ public function setButtonVar(array $buttonVar = array()) { - foreach ($buttonVar as $bMUpdateButtonRequestTypeButtonVarItem) { - // validation for constraint: itemType - if (!is_string($bMUpdateButtonRequestTypeButtonVarItem)) { - throw new \InvalidArgumentException(sprintf('The ButtonVar property can only contain items of string, "%s" given', is_object($bMUpdateButtonRequestTypeButtonVarItem) ? get_class($bMUpdateButtonRequestTypeButtonVarItem) : gettype($bMUpdateButtonRequestTypeButtonVarItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($buttonVarArrayErrorMessage = self::validateButtonVarForArrayConstraintsFromSetButtonVar($buttonVar))) { + throw new \InvalidArgumentException($buttonVarArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($buttonVar) && count($buttonVar) > 1000) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 1000', count($buttonVar)), __LINE__); } $this->ButtonVar = $buttonVar; return $this; @@ -305,7 +329,11 @@ public function addToButtonVar($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The ButtonVar property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The ButtonVar property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($this->ButtonVar) && count($this->ButtonVar) >= 1000) { + 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 1000', count($this->ButtonVar)), __LINE__); } $this->ButtonVar[] = $item; return $this; @@ -318,6 +346,28 @@ public function getOptionDetails() { return $this->OptionDetails; } + /** + * This method is responsible for validating the values passed to the setOptionDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setOptionDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateOptionDetailsForArrayConstraintsFromSetOptionDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMUpdateButtonRequestTypeOptionDetailsItem) { + // validation for constraint: itemType + if (!$bMUpdateButtonRequestTypeOptionDetailsItem instanceof \PayPal\StructType\OptionDetailsType) { + $invalidValues[] = is_object($bMUpdateButtonRequestTypeOptionDetailsItem) ? get_class($bMUpdateButtonRequestTypeOptionDetailsItem) : sprintf('%s(%s)', gettype($bMUpdateButtonRequestTypeOptionDetailsItem), var_export($bMUpdateButtonRequestTypeOptionDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The OptionDetails property can only contain items of type \PayPal\StructType\OptionDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set OptionDetails value * @throws \InvalidArgumentException @@ -326,11 +376,13 @@ public function getOptionDetails() */ public function setOptionDetails(array $optionDetails = array()) { - foreach ($optionDetails as $bMUpdateButtonRequestTypeOptionDetailsItem) { - // validation for constraint: itemType - if (!$bMUpdateButtonRequestTypeOptionDetailsItem instanceof \PayPal\StructType\OptionDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionDetails property can only contain items of \PayPal\StructType\OptionDetailsType, "%s" given', is_object($bMUpdateButtonRequestTypeOptionDetailsItem) ? get_class($bMUpdateButtonRequestTypeOptionDetailsItem) : gettype($bMUpdateButtonRequestTypeOptionDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($optionDetailsArrayErrorMessage = self::validateOptionDetailsForArrayConstraintsFromSetOptionDetails($optionDetails))) { + throw new \InvalidArgumentException($optionDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($optionDetails) && count($optionDetails) > 5) { + 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($optionDetails)), __LINE__); } $this->OptionDetails = $optionDetails; return $this; @@ -345,7 +397,11 @@ public function addToOptionDetails(\PayPal\StructType\OptionDetailsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\OptionDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionDetails property can only contain items of \PayPal\StructType\OptionDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The OptionDetails property can only contain items of type \PayPal\StructType\OptionDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($this->OptionDetails) && count($this->OptionDetails) >= 5) { + 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->OptionDetails)), __LINE__); } $this->OptionDetails[] = $item; return $this; @@ -358,6 +414,28 @@ public function getTextBox() { return $this->TextBox; } + /** + * This method is responsible for validating the values passed to the setTextBox method + * This method is willingly generated in order to preserve the one-line inline validation within the setTextBox method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateTextBoxForArrayConstraintsFromSetTextBox(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $bMUpdateButtonRequestTypeTextBoxItem) { + // validation for constraint: itemType + if (!is_string($bMUpdateButtonRequestTypeTextBoxItem)) { + $invalidValues[] = is_object($bMUpdateButtonRequestTypeTextBoxItem) ? get_class($bMUpdateButtonRequestTypeTextBoxItem) : sprintf('%s(%s)', gettype($bMUpdateButtonRequestTypeTextBoxItem), var_export($bMUpdateButtonRequestTypeTextBoxItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The TextBox property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set TextBox value * @throws \InvalidArgumentException @@ -366,11 +444,13 @@ public function getTextBox() */ public function setTextBox(array $textBox = array()) { - foreach ($textBox as $bMUpdateButtonRequestTypeTextBoxItem) { - // validation for constraint: itemType - if (!is_string($bMUpdateButtonRequestTypeTextBoxItem)) { - throw new \InvalidArgumentException(sprintf('The TextBox property can only contain items of string, "%s" given', is_object($bMUpdateButtonRequestTypeTextBoxItem) ? get_class($bMUpdateButtonRequestTypeTextBoxItem) : gettype($bMUpdateButtonRequestTypeTextBoxItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($textBoxArrayErrorMessage = self::validateTextBoxForArrayConstraintsFromSetTextBox($textBox))) { + throw new \InvalidArgumentException($textBoxArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(2) + if (is_array($textBox) && count($textBox) > 2) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 2', count($textBox)), __LINE__); } $this->TextBox = $textBox; return $this; @@ -385,7 +465,11 @@ public function addToTextBox($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The TextBox property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The TextBox property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(2) + if (is_array($this->TextBox) && count($this->TextBox) >= 2) { + 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 2', count($this->TextBox)), __LINE__); } $this->TextBox[] = $item; return $this; @@ -410,7 +494,7 @@ public function setButtonImage($buttonImage = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ButtonImageType::valueIsValid($buttonImage)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonImage, implode(', ', \PayPal\EnumType\ButtonImageType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ButtonImageType', is_array($buttonImage) ? implode(', ', $buttonImage) : var_export($buttonImage, true), implode(', ', \PayPal\EnumType\ButtonImageType::getValidValues())), __LINE__); } $this->ButtonImage = $buttonImage; return $this; @@ -432,7 +516,7 @@ public function setButtonImageURL($buttonImageURL = null) { // validation for constraint: string if (!is_null($buttonImageURL) && !is_string($buttonImageURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonImageURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonImageURL, true), gettype($buttonImageURL)), __LINE__); } $this->ButtonImageURL = $buttonImageURL; return $this; @@ -457,7 +541,7 @@ public function setBuyNowText($buyNowText = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BuyNowTextType::valueIsValid($buyNowText)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buyNowText, implode(', ', \PayPal\EnumType\BuyNowTextType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BuyNowTextType', is_array($buyNowText) ? implode(', ', $buyNowText) : var_export($buyNowText, true), implode(', ', \PayPal\EnumType\BuyNowTextType::getValidValues())), __LINE__); } $this->BuyNowText = $buyNowText; return $this; @@ -482,7 +566,7 @@ public function setSubscribeText($subscribeText = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SubscribeTextType::valueIsValid($subscribeText)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $subscribeText, implode(', ', \PayPal\EnumType\SubscribeTextType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SubscribeTextType', is_array($subscribeText) ? implode(', ', $subscribeText) : var_export($subscribeText, true), implode(', ', \PayPal\EnumType\SubscribeTextType::getValidValues())), __LINE__); } $this->SubscribeText = $subscribeText; return $this; @@ -507,7 +591,7 @@ public function setButtonCountry($buttonCountry = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CountryCodeType::valueIsValid($buttonCountry)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buttonCountry, implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CountryCodeType', is_array($buttonCountry) ? implode(', ', $buttonCountry) : var_export($buttonCountry, true), implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); } $this->ButtonCountry = $buttonCountry; return $this; @@ -529,7 +613,7 @@ public function setButtonLanguage($buttonLanguage = null) { // validation for constraint: string if (!is_null($buttonLanguage) && !is_string($buttonLanguage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonLanguage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonLanguage, true), gettype($buttonLanguage)), __LINE__); } $this->ButtonLanguage = $buttonLanguage; return $this; diff --git a/src/StructType/BMUpdateButtonResponseType.php b/src/StructType/BMUpdateButtonResponseType.php index 550f1cb..7a43e3a 100644 --- a/src/StructType/BMUpdateButtonResponseType.php +++ b/src/StructType/BMUpdateButtonResponseType.php @@ -13,7 +13,7 @@ class BMUpdateButtonResponseType extends AbstractResponseType { /** * The Website - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class BMUpdateButtonResponseType extends AbstractResponseType public $Website; /** * The Email - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -29,7 +29,7 @@ class BMUpdateButtonResponseType extends AbstractResponseType public $Email; /** * The Mobile - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -37,7 +37,7 @@ class BMUpdateButtonResponseType extends AbstractResponseType public $Mobile; /** * The HostedButtonID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -79,7 +79,7 @@ public function setWebsite($website = null) { // validation for constraint: string if (!is_null($website) && !is_string($website)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($website)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($website, true), gettype($website)), __LINE__); } $this->Website = $website; return $this; @@ -101,7 +101,7 @@ public function setEmail($email = null) { // validation for constraint: string if (!is_null($email) && !is_string($email)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($email)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($email, true), gettype($email)), __LINE__); } $this->Email = $email; return $this; @@ -123,7 +123,7 @@ public function setMobile($mobile = null) { // validation for constraint: string if (!is_null($mobile) && !is_string($mobile)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($mobile)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mobile, true), gettype($mobile)), __LINE__); } $this->Mobile = $mobile; return $this; @@ -145,7 +145,7 @@ public function setHostedButtonID($hostedButtonID = null) { // validation for constraint: string if (!is_null($hostedButtonID) && !is_string($hostedButtonID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hostedButtonID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hostedButtonID, true), gettype($hostedButtonID)), __LINE__); } $this->HostedButtonID = $hostedButtonID; return $this; diff --git a/src/StructType/BankAccountDetailsType.php b/src/StructType/BankAccountDetailsType.php index fac6f91..9bfaf47 100644 --- a/src/StructType/BankAccountDetailsType.php +++ b/src/StructType/BankAccountDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for BankAccountDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BankAccountDetailsType * @subpackage Structs * @author WsdlToPhp @@ -15,28 +15,28 @@ class BankAccountDetailsType extends AbstractStructBase { /** * The Name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Name of bank Character length and limitations: 192 alphanumeric characters * @var string */ public $Name; /** * The Type - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of bank account: Checking or Savings * @var string */ public $Type; /** * The RoutingNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchantâs bank routing number Character length and limitations: 23 alphanumeric characters * @var string */ public $RoutingNumber; /** * The AccountNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchantâs bank account number Character length and limitations: 256 alphanumeric characters * @var string */ @@ -77,7 +77,7 @@ public function setName($name = null) { // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); } $this->Name = $name; return $this; @@ -102,7 +102,7 @@ public function setType($type = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BankAccountTypeType::valueIsValid($type)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $type, implode(', ', \PayPal\EnumType\BankAccountTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BankAccountTypeType', is_array($type) ? implode(', ', $type) : var_export($type, true), implode(', ', \PayPal\EnumType\BankAccountTypeType::getValidValues())), __LINE__); } $this->Type = $type; return $this; @@ -124,7 +124,7 @@ public function setRoutingNumber($routingNumber = null) { // validation for constraint: string if (!is_null($routingNumber) && !is_string($routingNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($routingNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($routingNumber, true), gettype($routingNumber)), __LINE__); } $this->RoutingNumber = $routingNumber; return $this; @@ -146,7 +146,7 @@ public function setAccountNumber($accountNumber = null) { // validation for constraint: string if (!is_null($accountNumber) && !is_string($accountNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($accountNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($accountNumber, true), gettype($accountNumber)), __LINE__); } $this->AccountNumber = $accountNumber; return $this; diff --git a/src/StructType/BasicAmountType.php b/src/StructType/BasicAmountType.php index 2b3ae13..a73850f 100644 --- a/src/StructType/BasicAmountType.php +++ b/src/StructType/BasicAmountType.php @@ -6,7 +6,7 @@ /** * This class stands for BasicAmountType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: On requests, you must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Decimal * separator must be a period (.), and the thousands separator must be a comma (,). * @subpackage Structs @@ -16,7 +16,7 @@ class BasicAmountType extends AbstractStructBase { /** * The currencyID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: required * @var string */ @@ -59,7 +59,7 @@ public function setCurrencyID($currencyID = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CurrencyCodeType::valueIsValid($currencyID)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $currencyID, implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CurrencyCodeType', is_array($currencyID) ? implode(', ', $currencyID) : var_export($currencyID, true), implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); } $this->currencyID = $currencyID; return $this; @@ -81,7 +81,7 @@ public function set_($_ = null) { // validation for constraint: string if (!is_null($_) && !is_string($_)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($_)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($_, true), gettype($_)), __LINE__); } $this->_ = $_; return $this; diff --git a/src/StructType/BillAgreementUpdateReq.php b/src/StructType/BillAgreementUpdateReq.php index 29731c4..6b1e83b 100644 --- a/src/StructType/BillAgreementUpdateReq.php +++ b/src/StructType/BillAgreementUpdateReq.php @@ -13,7 +13,7 @@ class BillAgreementUpdateReq extends AbstractStructBase { /** * The BAUpdateRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:BAUpdateRequest * @var \PayPal\StructType\BAUpdateRequestType */ diff --git a/src/StructType/BillOutstandingAmountReq.php b/src/StructType/BillOutstandingAmountReq.php index c54ac78..45ce961 100644 --- a/src/StructType/BillOutstandingAmountReq.php +++ b/src/StructType/BillOutstandingAmountReq.php @@ -13,7 +13,7 @@ class BillOutstandingAmountReq extends AbstractStructBase { /** * The BillOutstandingAmountRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:BillOutstandingAmountRequest * @var \PayPal\StructType\BillOutstandingAmountRequestType */ diff --git a/src/StructType/BillOutstandingAmountRequestDetailsType.php b/src/StructType/BillOutstandingAmountRequestDetailsType.php index 8f8d765..c5b87f6 100644 --- a/src/StructType/BillOutstandingAmountRequestDetailsType.php +++ b/src/StructType/BillOutstandingAmountRequestDetailsType.php @@ -13,7 +13,7 @@ class BillOutstandingAmountRequestDetailsType extends AbstractStructBase { /** * The ProfileID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class BillOutstandingAmountRequestDetailsType extends AbstractStructBase public $ProfileID; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -29,7 +29,7 @@ class BillOutstandingAmountRequestDetailsType extends AbstractStructBase public $Amount; /** * The Note - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -68,7 +68,7 @@ public function setProfileID($profileID = null) { // validation for constraint: string if (!is_null($profileID) && !is_string($profileID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileID, true), gettype($profileID)), __LINE__); } $this->ProfileID = $profileID; return $this; @@ -108,7 +108,7 @@ public function setNote($note = null) { // validation for constraint: string if (!is_null($note) && !is_string($note)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($note)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); } $this->Note = $note; return $this; diff --git a/src/StructType/BillOutstandingAmountRequestType.php b/src/StructType/BillOutstandingAmountRequestType.php index 9de9a38..7051dc9 100644 --- a/src/StructType/BillOutstandingAmountRequestType.php +++ b/src/StructType/BillOutstandingAmountRequestType.php @@ -13,7 +13,7 @@ class BillOutstandingAmountRequestType extends AbstractRequestType { /** * The BillOutstandingAmountRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:BillOutstandingAmountRequestDetails * @var \PayPal\StructType\BillOutstandingAmountRequestDetailsType */ diff --git a/src/StructType/BillOutstandingAmountResponseDetailsType.php b/src/StructType/BillOutstandingAmountResponseDetailsType.php index 35e185e..5fb9e0e 100644 --- a/src/StructType/BillOutstandingAmountResponseDetailsType.php +++ b/src/StructType/BillOutstandingAmountResponseDetailsType.php @@ -13,7 +13,7 @@ class BillOutstandingAmountResponseDetailsType extends AbstractStructBase { /** * The ProfileID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -46,7 +46,7 @@ public function setProfileID($profileID = null) { // validation for constraint: string if (!is_null($profileID) && !is_string($profileID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileID, true), gettype($profileID)), __LINE__); } $this->ProfileID = $profileID; return $this; diff --git a/src/StructType/BillOutstandingAmountResponseType.php b/src/StructType/BillOutstandingAmountResponseType.php index 9e365c8..1c0ff43 100644 --- a/src/StructType/BillOutstandingAmountResponseType.php +++ b/src/StructType/BillOutstandingAmountResponseType.php @@ -13,7 +13,7 @@ class BillOutstandingAmountResponseType extends AbstractResponseType { /** * The BillOutstandingAmountResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:BillOutstandingAmountResponseDetails * @var \PayPal\StructType\BillOutstandingAmountResponseDetailsType */ diff --git a/src/StructType/BillUserReq.php b/src/StructType/BillUserReq.php index 295c849..f47f947 100644 --- a/src/StructType/BillUserReq.php +++ b/src/StructType/BillUserReq.php @@ -13,7 +13,7 @@ class BillUserReq extends AbstractStructBase { /** * The BillUserRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:BillUserRequest * @var \PayPal\StructType\BillUserRequestType */ diff --git a/src/StructType/BillUserRequestType.php b/src/StructType/BillUserRequestType.php index dc46c4e..53e1aeb 100644 --- a/src/StructType/BillUserRequestType.php +++ b/src/StructType/BillUserRequestType.php @@ -13,14 +13,14 @@ class BillUserRequestType extends AbstractRequestType { /** * The MerchantPullPaymentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:MerchantPullPaymentDetails * @var \PayPal\StructType\MerchantPullPaymentType */ public $MerchantPullPaymentDetails; /** * The ReturnFMFDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This flag indicates that the response should include FMFDetails * - maxOccurs: 1 * - minOccurs: 0 @@ -74,8 +74,8 @@ public function getReturnFMFDetails() public function setReturnFMFDetails($returnFMFDetails = null) { // validation for constraint: int - if (!is_null($returnFMFDetails) && !is_numeric($returnFMFDetails)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($returnFMFDetails)), __LINE__); + if (!is_null($returnFMFDetails) && !(is_int($returnFMFDetails) || ctype_digit($returnFMFDetails))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($returnFMFDetails, true), gettype($returnFMFDetails)), __LINE__); } $this->ReturnFMFDetails = $returnFMFDetails; return $this; diff --git a/src/StructType/BillUserResponseType.php b/src/StructType/BillUserResponseType.php index 85af005..f85cc72 100644 --- a/src/StructType/BillUserResponseType.php +++ b/src/StructType/BillUserResponseType.php @@ -13,14 +13,14 @@ class BillUserResponseType extends AbstractResponseType { /** * The BillUserResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:BillUserResponseDetails * @var \PayPal\StructType\MerchantPullPaymentResponseType */ public $BillUserResponseDetails; /** * The FMFDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\FMFDetailsType diff --git a/src/StructType/BillingAgreementDetailsType.php b/src/StructType/BillingAgreementDetailsType.php index 5d276b4..5659fe3 100644 --- a/src/StructType/BillingAgreementDetailsType.php +++ b/src/StructType/BillingAgreementDetailsType.php @@ -13,7 +13,7 @@ class BillingAgreementDetailsType extends AbstractStructBase { /** * The BillingType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class BillingAgreementDetailsType extends AbstractStructBase public $BillingType; /** * The BillingAgreementDescription - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Only needed for AutoBill billinng type. * - maxOccurs: 1 * - minOccurs: 0 @@ -30,7 +30,7 @@ class BillingAgreementDetailsType extends AbstractStructBase public $BillingAgreementDescription; /** * The PaymentType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -38,7 +38,7 @@ class BillingAgreementDetailsType extends AbstractStructBase public $PaymentType; /** * The BillingAgreementCustom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Custom annotation field for your exclusive use. * - maxOccurs: 1 * - minOccurs: 0 @@ -84,7 +84,7 @@ public function setBillingType($billingType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BillingCodeType::valueIsValid($billingType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $billingType, implode(', ', \PayPal\EnumType\BillingCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BillingCodeType', is_array($billingType) ? implode(', ', $billingType) : var_export($billingType, true), implode(', ', \PayPal\EnumType\BillingCodeType::getValidValues())), __LINE__); } $this->BillingType = $billingType; return $this; @@ -106,7 +106,7 @@ public function setBillingAgreementDescription($billingAgreementDescription = nu { // validation for constraint: string if (!is_null($billingAgreementDescription) && !is_string($billingAgreementDescription)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingAgreementDescription)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementDescription, true), gettype($billingAgreementDescription)), __LINE__); } $this->BillingAgreementDescription = $billingAgreementDescription; return $this; @@ -131,7 +131,7 @@ public function setPaymentType($paymentType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MerchantPullPaymentCodeType::valueIsValid($paymentType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentType, implode(', ', \PayPal\EnumType\MerchantPullPaymentCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MerchantPullPaymentCodeType', is_array($paymentType) ? implode(', ', $paymentType) : var_export($paymentType, true), implode(', ', \PayPal\EnumType\MerchantPullPaymentCodeType::getValidValues())), __LINE__); } $this->PaymentType = $paymentType; return $this; @@ -153,7 +153,7 @@ public function setBillingAgreementCustom($billingAgreementCustom = null) { // validation for constraint: string if (!is_null($billingAgreementCustom) && !is_string($billingAgreementCustom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingAgreementCustom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementCustom, true), gettype($billingAgreementCustom)), __LINE__); } $this->BillingAgreementCustom = $billingAgreementCustom; return $this; diff --git a/src/StructType/BillingApprovalDetailsType.php b/src/StructType/BillingApprovalDetailsType.php index 39064ae..181629e 100644 --- a/src/StructType/BillingApprovalDetailsType.php +++ b/src/StructType/BillingApprovalDetailsType.php @@ -13,7 +13,7 @@ class BillingApprovalDetailsType extends AbstractStructBase { /** * The ApprovalType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The Type of Approval requested - Billing Agreement or Profile * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class BillingApprovalDetailsType extends AbstractStructBase public $ApprovalType; /** * The ApprovalSubType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The Approval subtype - Must be MerchantInitiatedBilling for BillingAgreement ApprovalType * - minOccurs: 0 * @var string @@ -29,7 +29,7 @@ class BillingApprovalDetailsType extends AbstractStructBase public $ApprovalSubType; /** * The OrderDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Description about the Order * - minOccurs: 0 * @var \PayPal\StructType\OrderDetailsType @@ -37,7 +37,7 @@ class BillingApprovalDetailsType extends AbstractStructBase public $OrderDetails; /** * The PaymentDirectives - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Directives about the type of payment * - minOccurs: 0 * @var \PayPal\StructType\PaymentDirectivesType @@ -45,7 +45,7 @@ class BillingApprovalDetailsType extends AbstractStructBase public $PaymentDirectives; /** * The Custom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Client may pass in its identification of this Billing Agreement. It used for the client's tracking purposes. * - minOccurs: 0 * @var string @@ -93,7 +93,7 @@ public function setApprovalType($approvalType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ApprovalTypeType::valueIsValid($approvalType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $approvalType, implode(', ', \PayPal\EnumType\ApprovalTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ApprovalTypeType', is_array($approvalType) ? implode(', ', $approvalType) : var_export($approvalType, true), implode(', ', \PayPal\EnumType\ApprovalTypeType::getValidValues())), __LINE__); } $this->ApprovalType = $approvalType; return $this; @@ -118,7 +118,7 @@ public function setApprovalSubType($approvalSubType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ApprovalSubTypeType::valueIsValid($approvalSubType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $approvalSubType, implode(', ', \PayPal\EnumType\ApprovalSubTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ApprovalSubTypeType', is_array($approvalSubType) ? implode(', ', $approvalSubType) : var_export($approvalSubType, true), implode(', ', \PayPal\EnumType\ApprovalSubTypeType::getValidValues())), __LINE__); } $this->ApprovalSubType = $approvalSubType; return $this; @@ -176,7 +176,7 @@ public function setCustom($custom = null) { // validation for constraint: string if (!is_null($custom) && !is_string($custom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($custom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); } $this->Custom = $custom; return $this; diff --git a/src/StructType/BillingPeriodDetailsType.php b/src/StructType/BillingPeriodDetailsType.php index 0b60ab3..b40b6db 100644 --- a/src/StructType/BillingPeriodDetailsType.php +++ b/src/StructType/BillingPeriodDetailsType.php @@ -13,7 +13,7 @@ class BillingPeriodDetailsType extends AbstractStructBase { /** * The BillingPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unit of meausre for billing cycle * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class BillingPeriodDetailsType extends AbstractStructBase public $BillingPeriod; /** * The BillingFrequency - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Number of BillingPeriod that make up one billing cycle * - maxOccurs: 1 * - minOccurs: 1 @@ -31,7 +31,7 @@ class BillingPeriodDetailsType extends AbstractStructBase public $BillingFrequency; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount to charge * - maxOccurs: 1 * - minOccurs: 1 @@ -40,7 +40,7 @@ class BillingPeriodDetailsType extends AbstractStructBase public $Amount; /** * The TotalBillingCycles - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total billing cycles in this portion of the schedule * - maxOccurs: 1 * - minOccurs: 0 @@ -49,7 +49,7 @@ class BillingPeriodDetailsType extends AbstractStructBase public $TotalBillingCycles; /** * The ShippingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Additional shipping amount to charge * - maxOccurs: 1 * - minOccurs: 0 @@ -58,7 +58,7 @@ class BillingPeriodDetailsType extends AbstractStructBase public $ShippingAmount; /** * The TaxAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Additional tax amount to charge * - maxOccurs: 1 * - minOccurs: 0 @@ -110,7 +110,7 @@ public function setBillingPeriod($billingPeriod = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BillingPeriodType::valueIsValid($billingPeriod)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $billingPeriod, implode(', ', \PayPal\EnumType\BillingPeriodType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BillingPeriodType', is_array($billingPeriod) ? implode(', ', $billingPeriod) : var_export($billingPeriod, true), implode(', ', \PayPal\EnumType\BillingPeriodType::getValidValues())), __LINE__); } $this->BillingPeriod = $billingPeriod; return $this; @@ -131,8 +131,8 @@ public function getBillingFrequency() public function setBillingFrequency($billingFrequency = null) { // validation for constraint: int - if (!is_null($billingFrequency) && !is_numeric($billingFrequency)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($billingFrequency)), __LINE__); + if (!is_null($billingFrequency) && !(is_int($billingFrequency) || ctype_digit($billingFrequency))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($billingFrequency, true), gettype($billingFrequency)), __LINE__); } $this->BillingFrequency = $billingFrequency; return $this; @@ -171,8 +171,8 @@ public function getTotalBillingCycles() public function setTotalBillingCycles($totalBillingCycles = null) { // validation for constraint: int - if (!is_null($totalBillingCycles) && !is_numeric($totalBillingCycles)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($totalBillingCycles)), __LINE__); + if (!is_null($totalBillingCycles) && !(is_int($totalBillingCycles) || ctype_digit($totalBillingCycles))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($totalBillingCycles, true), gettype($totalBillingCycles)), __LINE__); } $this->TotalBillingCycles = $totalBillingCycles; return $this; diff --git a/src/StructType/BillingPeriodDetailsType_Update.php b/src/StructType/BillingPeriodDetailsType_Update.php index 4cf7118..ca6d142 100644 --- a/src/StructType/BillingPeriodDetailsType_Update.php +++ b/src/StructType/BillingPeriodDetailsType_Update.php @@ -13,7 +13,7 @@ class BillingPeriodDetailsType_Update extends AbstractStructBase { /** * The BillingPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unit of meausre for billing cycle * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class BillingPeriodDetailsType_Update extends AbstractStructBase public $BillingPeriod; /** * The BillingFrequency - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Number of BillingPeriod that make up one billing cycle * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class BillingPeriodDetailsType_Update extends AbstractStructBase public $BillingFrequency; /** * The TotalBillingCycles - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total billing cycles in this portion of the schedule * - maxOccurs: 1 * - minOccurs: 0 @@ -40,7 +40,7 @@ class BillingPeriodDetailsType_Update extends AbstractStructBase public $TotalBillingCycles; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount to charge * - maxOccurs: 1 * - minOccurs: 0 @@ -49,7 +49,7 @@ class BillingPeriodDetailsType_Update extends AbstractStructBase public $Amount; /** * The ShippingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Additional shipping amount to charge * - maxOccurs: 1 * - minOccurs: 0 @@ -58,7 +58,7 @@ class BillingPeriodDetailsType_Update extends AbstractStructBase public $ShippingAmount; /** * The TaxAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Additional tax amount to charge * - maxOccurs: 1 * - minOccurs: 0 @@ -110,7 +110,7 @@ public function setBillingPeriod($billingPeriod = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BillingPeriodType::valueIsValid($billingPeriod)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $billingPeriod, implode(', ', \PayPal\EnumType\BillingPeriodType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BillingPeriodType', is_array($billingPeriod) ? implode(', ', $billingPeriod) : var_export($billingPeriod, true), implode(', ', \PayPal\EnumType\BillingPeriodType::getValidValues())), __LINE__); } $this->BillingPeriod = $billingPeriod; return $this; @@ -131,8 +131,8 @@ public function getBillingFrequency() public function setBillingFrequency($billingFrequency = null) { // validation for constraint: int - if (!is_null($billingFrequency) && !is_numeric($billingFrequency)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($billingFrequency)), __LINE__); + if (!is_null($billingFrequency) && !(is_int($billingFrequency) || ctype_digit($billingFrequency))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($billingFrequency, true), gettype($billingFrequency)), __LINE__); } $this->BillingFrequency = $billingFrequency; return $this; @@ -153,8 +153,8 @@ public function getTotalBillingCycles() public function setTotalBillingCycles($totalBillingCycles = null) { // validation for constraint: int - if (!is_null($totalBillingCycles) && !is_numeric($totalBillingCycles)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($totalBillingCycles)), __LINE__); + if (!is_null($totalBillingCycles) && !(is_int($totalBillingCycles) || ctype_digit($totalBillingCycles))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($totalBillingCycles, true), gettype($totalBillingCycles)), __LINE__); } $this->TotalBillingCycles = $totalBillingCycles; return $this; diff --git a/src/StructType/BusinessInfoType.php b/src/StructType/BusinessInfoType.php index cfa77f5..0d4cae3 100644 --- a/src/StructType/BusinessInfoType.php +++ b/src/StructType/BusinessInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for BusinessInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BusinessInfoType * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class BusinessInfoType extends AbstractStructBase { /** * The Type - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of business, such as corporation or sole proprietorship * - minOccurs: 0 * @var string @@ -23,16 +23,17 @@ class BusinessInfoType extends AbstractStructBase public $Type; /** * The Name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Official name of business Character length and limitations: 75 alphanumeric characters - * - minOccurs: 0 + * - base: xs:string * - maxLength: 25 + * - minOccurs: 0 * @var string */ public $Name; /** * The Address - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchantâs business postal address * - minOccurs: 0 * @var \PayPal\StructType\AddressType @@ -40,7 +41,7 @@ class BusinessInfoType extends AbstractStructBase public $Address; /** * The WorkPhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Businessâs primary telephone number Character length and limitations: 20 alphanumeric characters * - minOccurs: 0 * @var string @@ -48,7 +49,7 @@ class BusinessInfoType extends AbstractStructBase public $WorkPhone; /** * The Category - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Line of business, as defined in the enumerations * - minOccurs: 0 * @var string @@ -56,7 +57,7 @@ class BusinessInfoType extends AbstractStructBase public $Category; /** * The SubCategory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Business sub-category, as defined in the enumerations * - minOccurs: 0 * @var string @@ -64,7 +65,7 @@ class BusinessInfoType extends AbstractStructBase public $SubCategory; /** * The AveragePrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Average transaction price, as defined by the enumerations. Enumeration Meaning AverageTransactionPrice-Not-Applicable AverageTransactionPrice-Range1 Less than $25 USD AverageTransactionPrice-Range2 $25 USD to $50 USD * AverageTransactionPrice-Range3 $50 USD to $100 USD AverageTransactionPrice-Range4 $100 USD to $250 USD AverageTransactionPrice-Range5 $250 USD to $500 USD AverageTransactionPrice-Range6 $500 USD to $1,000 USD AverageTransactionPrice-Range7 $1,000 USD * to $2,000 USD AverageTransactionPrice-Range8 $2,000 USD to $5,000 USD AverageTransactionPrice-Range9 $5,000 USD to $10,000 USD AverageTransactionPrice-Range10 More than $10,000 USD @@ -74,7 +75,7 @@ class BusinessInfoType extends AbstractStructBase public $AveragePrice; /** * The AverageMonthlyVolume - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Average monthly sales volume, as defined by the enumerations. Enumeration Meaning AverageMonthlyVolume-Not-Applicable AverageMonthlyVolume-Range1 Less than $1,000 USD AverageMonthlyVolume-Range2 $1,000 USD to $5,000 USD * AverageMonthlyVolume-Range3 $5,000 USD to $25,000 USD AverageMonthlyVolume-Range4 $25,000 USD to $100,000 USD AverageMonthlyVolume-Range5 $100,000 USD to $1,000,000 USD AverageMonthlyVolume-Range6 More than $1,000,000 USD * - minOccurs: 0 @@ -83,7 +84,7 @@ class BusinessInfoType extends AbstractStructBase public $AverageMonthlyVolume; /** * The SalesVenue - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Main sales venue, such as eBay * - minOccurs: 0 * @var string @@ -91,7 +92,7 @@ class BusinessInfoType extends AbstractStructBase public $SalesVenue; /** * The Website - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Primary URL of business Character length and limitations: 2,048 alphanumeric characters * - minOccurs: 0 * @var string @@ -99,7 +100,7 @@ class BusinessInfoType extends AbstractStructBase public $Website; /** * The RevenueFromOnlineSales - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Percentage of revenue attributable to online sales, as defined by the enumerations Enumeration Meaning PercentageRevenueFromOnlineSales-Not-Applicable PercentageRevenueFromOnlineSales-Range1 Less than 25% * PercentageRevenueFromOnlineSales-Range2 25% to 50% PercentageRevenueFromOnlineSales-Range3 50% to 75% PercentageRevenueFromOnlineSales-Range4 75% to 100% * - minOccurs: 0 @@ -108,7 +109,7 @@ class BusinessInfoType extends AbstractStructBase public $RevenueFromOnlineSales; /** * The BusinessEstablished - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date the merchantâs business was established * - minOccurs: 0 * @var string @@ -116,15 +117,16 @@ class BusinessInfoType extends AbstractStructBase public $BusinessEstablished; /** * The CustomerServiceEmail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Email address to contact businessâs customer service Character length and limitations: 127 alphanumeric characters + * - base: xs:string * - minOccurs: 0 * @var string */ public $CustomerServiceEmail; /** * The CustomerServicePhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Telephone number to contact businessâs customer service Character length and limitations: 32 alphanumeric characters * - minOccurs: 0 * @var string @@ -199,7 +201,7 @@ public function setType($type = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BusinessTypeType::valueIsValid($type)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $type, implode(', ', \PayPal\EnumType\BusinessTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BusinessTypeType', is_array($type) ? implode(', ', $type) : var_export($type, true), implode(', ', \PayPal\EnumType\BusinessTypeType::getValidValues())), __LINE__); } $this->Type = $type; return $this; @@ -219,13 +221,13 @@ public function getName() */ public function setName($name = null) { - // validation for constraint: maxLength - if ((is_scalar($name) && strlen($name) > 25) || (is_array($name) && count($name) > 25)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 25 element(s) or a scalar of 25 character(s) at most, "%d" length given', is_scalar($name) ? strlen($name) : count($name)), __LINE__); - } // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); + } + // validation for constraint: maxLength(25) + if (!is_null($name) && mb_strlen($name) > 25) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 25', mb_strlen($name)), __LINE__); } $this->Name = $name; return $this; @@ -265,7 +267,7 @@ public function setWorkPhone($workPhone = null) { // validation for constraint: string if (!is_null($workPhone) && !is_string($workPhone)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($workPhone)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($workPhone, true), gettype($workPhone)), __LINE__); } $this->WorkPhone = $workPhone; return $this; @@ -290,7 +292,7 @@ public function setCategory($category = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BusinessCategoryType::valueIsValid($category)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $category, implode(', ', \PayPal\EnumType\BusinessCategoryType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BusinessCategoryType', is_array($category) ? implode(', ', $category) : var_export($category, true), implode(', ', \PayPal\EnumType\BusinessCategoryType::getValidValues())), __LINE__); } $this->Category = $category; return $this; @@ -315,7 +317,7 @@ public function setSubCategory($subCategory = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BusinessSubCategoryType::valueIsValid($subCategory)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $subCategory, implode(', ', \PayPal\EnumType\BusinessSubCategoryType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BusinessSubCategoryType', is_array($subCategory) ? implode(', ', $subCategory) : var_export($subCategory, true), implode(', ', \PayPal\EnumType\BusinessSubCategoryType::getValidValues())), __LINE__); } $this->SubCategory = $subCategory; return $this; @@ -340,7 +342,7 @@ public function setAveragePrice($averagePrice = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AverageTransactionPriceType::valueIsValid($averagePrice)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $averagePrice, implode(', ', \PayPal\EnumType\AverageTransactionPriceType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AverageTransactionPriceType', is_array($averagePrice) ? implode(', ', $averagePrice) : var_export($averagePrice, true), implode(', ', \PayPal\EnumType\AverageTransactionPriceType::getValidValues())), __LINE__); } $this->AveragePrice = $averagePrice; return $this; @@ -365,7 +367,7 @@ public function setAverageMonthlyVolume($averageMonthlyVolume = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AverageMonthlyVolumeType::valueIsValid($averageMonthlyVolume)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $averageMonthlyVolume, implode(', ', \PayPal\EnumType\AverageMonthlyVolumeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AverageMonthlyVolumeType', is_array($averageMonthlyVolume) ? implode(', ', $averageMonthlyVolume) : var_export($averageMonthlyVolume, true), implode(', ', \PayPal\EnumType\AverageMonthlyVolumeType::getValidValues())), __LINE__); } $this->AverageMonthlyVolume = $averageMonthlyVolume; return $this; @@ -390,7 +392,7 @@ public function setSalesVenue($salesVenue = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SalesVenueType::valueIsValid($salesVenue)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $salesVenue, implode(', ', \PayPal\EnumType\SalesVenueType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SalesVenueType', is_array($salesVenue) ? implode(', ', $salesVenue) : var_export($salesVenue, true), implode(', ', \PayPal\EnumType\SalesVenueType::getValidValues())), __LINE__); } $this->SalesVenue = $salesVenue; return $this; @@ -412,7 +414,7 @@ public function setWebsite($website = null) { // validation for constraint: string if (!is_null($website) && !is_string($website)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($website)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($website, true), gettype($website)), __LINE__); } $this->Website = $website; return $this; @@ -437,7 +439,7 @@ public function setRevenueFromOnlineSales($revenueFromOnlineSales = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PercentageRevenueFromOnlineSalesType::valueIsValid($revenueFromOnlineSales)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $revenueFromOnlineSales, implode(', ', \PayPal\EnumType\PercentageRevenueFromOnlineSalesType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PercentageRevenueFromOnlineSalesType', is_array($revenueFromOnlineSales) ? implode(', ', $revenueFromOnlineSales) : var_export($revenueFromOnlineSales, true), implode(', ', \PayPal\EnumType\PercentageRevenueFromOnlineSalesType::getValidValues())), __LINE__); } $this->RevenueFromOnlineSales = $revenueFromOnlineSales; return $this; @@ -459,7 +461,7 @@ public function setBusinessEstablished($businessEstablished = null) { // validation for constraint: string if (!is_null($businessEstablished) && !is_string($businessEstablished)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($businessEstablished)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($businessEstablished, true), gettype($businessEstablished)), __LINE__); } $this->BusinessEstablished = $businessEstablished; return $this; @@ -481,7 +483,7 @@ public function setCustomerServiceEmail($customerServiceEmail = null) { // validation for constraint: string if (!is_null($customerServiceEmail) && !is_string($customerServiceEmail)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($customerServiceEmail)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($customerServiceEmail, true), gettype($customerServiceEmail)), __LINE__); } $this->CustomerServiceEmail = $customerServiceEmail; return $this; @@ -503,7 +505,7 @@ public function setCustomerServicePhone($customerServicePhone = null) { // validation for constraint: string if (!is_null($customerServicePhone) && !is_string($customerServicePhone)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($customerServicePhone)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($customerServicePhone, true), gettype($customerServicePhone)), __LINE__); } $this->CustomerServicePhone = $customerServicePhone; return $this; diff --git a/src/StructType/BusinessOwnerInfoType.php b/src/StructType/BusinessOwnerInfoType.php index 457feb8..9e06319 100644 --- a/src/StructType/BusinessOwnerInfoType.php +++ b/src/StructType/BusinessOwnerInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for BusinessOwnerInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BusinessOwnerInfoType * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class BusinessOwnerInfoType extends AbstractStructBase { /** * The Owner - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about the business owner * - minOccurs: 0 * @var \PayPal\StructType\PayerInfoType @@ -23,7 +23,7 @@ class BusinessOwnerInfoType extends AbstractStructBase public $Owner; /** * The HomePhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Business ownerâs home telephone number Character length and limitations: 32 alphanumeric characters * - minOccurs: 0 * @var string @@ -31,7 +31,7 @@ class BusinessOwnerInfoType extends AbstractStructBase public $HomePhone; /** * The MobilePhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Business ownerâs mobile telephone number Character length and limitations: 32 alphanumeric characters * - minOccurs: 0 * @var string @@ -39,7 +39,7 @@ class BusinessOwnerInfoType extends AbstractStructBase public $MobilePhone; /** * The SSN - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Business ownerâs social security number Character length and limitations: 9 alphanumeric characters * - minOccurs: 0 * @var string @@ -99,7 +99,7 @@ public function setHomePhone($homePhone = null) { // validation for constraint: string if (!is_null($homePhone) && !is_string($homePhone)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($homePhone)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($homePhone, true), gettype($homePhone)), __LINE__); } $this->HomePhone = $homePhone; return $this; @@ -121,7 +121,7 @@ public function setMobilePhone($mobilePhone = null) { // validation for constraint: string if (!is_null($mobilePhone) && !is_string($mobilePhone)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($mobilePhone)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mobilePhone, true), gettype($mobilePhone)), __LINE__); } $this->MobilePhone = $mobilePhone; return $this; @@ -143,7 +143,7 @@ public function setSSN($sSN = null) { // validation for constraint: string if (!is_null($sSN) && !is_string($sSN)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sSN)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sSN, true), gettype($sSN)), __LINE__); } $this->SSN = $sSN; return $this; diff --git a/src/StructType/ButtonSearchResultType.php b/src/StructType/ButtonSearchResultType.php index b2d3370..b1996f8 100644 --- a/src/StructType/ButtonSearchResultType.php +++ b/src/StructType/ButtonSearchResultType.php @@ -13,7 +13,7 @@ class ButtonSearchResultType extends AbstractStructBase { /** * The HostedButtonID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class ButtonSearchResultType extends AbstractStructBase public $HostedButtonID; /** * The ButtonType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -29,7 +29,7 @@ class ButtonSearchResultType extends AbstractStructBase public $ButtonType; /** * The ItemName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -37,7 +37,7 @@ class ButtonSearchResultType extends AbstractStructBase public $ItemName; /** * The ModifyDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -79,7 +79,7 @@ public function setHostedButtonID($hostedButtonID = null) { // validation for constraint: string if (!is_null($hostedButtonID) && !is_string($hostedButtonID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hostedButtonID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hostedButtonID, true), gettype($hostedButtonID)), __LINE__); } $this->HostedButtonID = $hostedButtonID; return $this; @@ -101,7 +101,7 @@ public function setButtonType($buttonType = null) { // validation for constraint: string if (!is_null($buttonType) && !is_string($buttonType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonType, true), gettype($buttonType)), __LINE__); } $this->ButtonType = $buttonType; return $this; @@ -123,7 +123,7 @@ public function setItemName($itemName = null) { // validation for constraint: string if (!is_null($itemName) && !is_string($itemName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemName, true), gettype($itemName)), __LINE__); } $this->ItemName = $itemName; return $this; @@ -145,7 +145,7 @@ public function setModifyDate($modifyDate = null) { // validation for constraint: string if (!is_null($modifyDate) && !is_string($modifyDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($modifyDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($modifyDate, true), gettype($modifyDate)), __LINE__); } $this->ModifyDate = $modifyDate; return $this; diff --git a/src/StructType/BuyerDetailType.php b/src/StructType/BuyerDetailType.php index 460b011..2e98f82 100644 --- a/src/StructType/BuyerDetailType.php +++ b/src/StructType/BuyerDetailType.php @@ -13,7 +13,7 @@ class BuyerDetailType extends AbstractStructBase { /** * The IdentificationInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information that is used to indentify the Buyer. This is used for auto authorization. Mandatory if Authorization is requested. * - minOccurs: 0 * @var \PayPal\StructType\IdentificationInfoType @@ -21,7 +21,7 @@ class BuyerDetailType extends AbstractStructBase public $IdentificationInfo; /** * The RiskSessionCorrelationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Correlation id related to risk process done for the device. Max length is 36 Chars. * - maxOccurs: 1 * - minOccurs: 0 @@ -30,7 +30,7 @@ class BuyerDetailType extends AbstractStructBase public $RiskSessionCorrelationID; /** * The BuyerIPAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Buyer's IP Address * - maxOccurs: 1 * - minOccurs: 0 @@ -88,7 +88,7 @@ public function setRiskSessionCorrelationID($riskSessionCorrelationID = null) { // validation for constraint: string if (!is_null($riskSessionCorrelationID) && !is_string($riskSessionCorrelationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($riskSessionCorrelationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($riskSessionCorrelationID, true), gettype($riskSessionCorrelationID)), __LINE__); } $this->RiskSessionCorrelationID = $riskSessionCorrelationID; return $this; @@ -110,7 +110,7 @@ public function setBuyerIPAddress($buyerIPAddress = null) { // validation for constraint: string if (!is_null($buyerIPAddress) && !is_string($buyerIPAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerIPAddress)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerIPAddress, true), gettype($buyerIPAddress)), __LINE__); } $this->BuyerIPAddress = $buyerIPAddress; return $this; diff --git a/src/StructType/BuyerDetailsType.php b/src/StructType/BuyerDetailsType.php index 5bab991..d2d79d8 100644 --- a/src/StructType/BuyerDetailsType.php +++ b/src/StructType/BuyerDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for BuyerDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about the buyer's account passed in by the merchant or partner. Optional. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class BuyerDetailsType extends AbstractStructBase { /** * The BuyerId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The client's unique ID for this user. * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class BuyerDetailsType extends AbstractStructBase public $BuyerId; /** * The BuyerUserName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The user name of the user at the marketplaces site. * - minOccurs: 0 * @var string @@ -31,7 +31,7 @@ class BuyerDetailsType extends AbstractStructBase public $BuyerUserName; /** * The BuyerRegistrationDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date when the user registered with the marketplace. * - minOccurs: 0 * @var string @@ -39,7 +39,7 @@ class BuyerDetailsType extends AbstractStructBase public $BuyerRegistrationDate; /** * The TaxIdDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about payer's tax info. Refer to the TaxIdDetailsType for more details. * - maxOccurs: 1 * - minOccurs: 0 @@ -48,7 +48,7 @@ class BuyerDetailsType extends AbstractStructBase public $TaxIdDetails; /** * The IdentificationInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains information that identifies the buyer. e.g. email address or the external remember me id. * - maxOccurs: 1 * - minOccurs: 0 @@ -94,7 +94,7 @@ public function setBuyerId($buyerId = null) { // validation for constraint: string if (!is_null($buyerId) && !is_string($buyerId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerId, true), gettype($buyerId)), __LINE__); } $this->BuyerId = $buyerId; return $this; @@ -116,7 +116,7 @@ public function setBuyerUserName($buyerUserName = null) { // validation for constraint: string if (!is_null($buyerUserName) && !is_string($buyerUserName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerUserName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerUserName, true), gettype($buyerUserName)), __LINE__); } $this->BuyerUserName = $buyerUserName; return $this; @@ -138,7 +138,7 @@ public function setBuyerRegistrationDate($buyerRegistrationDate = null) { // validation for constraint: string if (!is_null($buyerRegistrationDate) && !is_string($buyerRegistrationDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerRegistrationDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerRegistrationDate, true), gettype($buyerRegistrationDate)), __LINE__); } $this->BuyerRegistrationDate = $buyerRegistrationDate; return $this; diff --git a/src/StructType/BuyerType.php b/src/StructType/BuyerType.php index 5b20f18..7344b8a 100644 --- a/src/StructType/BuyerType.php +++ b/src/StructType/BuyerType.php @@ -6,7 +6,7 @@ /** * This class stands for BuyerType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about user used by buying applications * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class BuyerType extends AbstractStructBase { /** * The ShippingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:ShippingAddress * @var \PayPal\StructType\AddressType diff --git a/src/StructType/CalculatedShippingRateType.php b/src/StructType/CalculatedShippingRateType.php index 9a7b835..91ceba7 100644 --- a/src/StructType/CalculatedShippingRateType.php +++ b/src/StructType/CalculatedShippingRateType.php @@ -13,7 +13,7 @@ class CalculatedShippingRateType extends AbstractStructBase { /** * The OriginatingPostalCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Potal/zip code from where package will be shipped. * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class CalculatedShippingRateType extends AbstractStructBase public $OriginatingPostalCode; /** * The ShippingIrregular - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates an item that cannot go through the stamping machine at the shipping service office (a value of True) and requires special or fragile handling. Only returned if ShippingType = 2. * - minOccurs: 0 * @var bool @@ -29,7 +29,7 @@ class CalculatedShippingRateType extends AbstractStructBase public $ShippingIrregular; /** * The CarrierDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: contains information about shipping fees per each shipping service chosen by the seller * - maxOccurs: unbounded * - minOccurs: 0 @@ -38,7 +38,7 @@ class CalculatedShippingRateType extends AbstractStructBase public $CarrierDetails; /** * The ShippingPackage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: May need to be moved into details - wait for George! The size of the package to be shipped. Possible values are: None Letter Large envelope USPS flat rate envelope Package/thick envelope USPS large package/oversize 1 Very large * package/oversize 2 UPS Letter * - minOccurs: 0 @@ -47,7 +47,7 @@ class CalculatedShippingRateType extends AbstractStructBase public $ShippingPackage; /** * The WeightMajor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Shipping weight unit of measure (major). If unit of weight is kilogram (i.e., metric system) this would be the exact weight value in kilogram (i.e., complete decimal number, e.g., 2.23 kg). Only returned if ShippingType is 2. * - minOccurs: 0 * @var \PayPal\StructType\MeasureType @@ -55,7 +55,7 @@ class CalculatedShippingRateType extends AbstractStructBase public $WeightMajor; /** * The WeightMinor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Shipping weight unit of measure (minor). If unit of weight is in pounds and/or ounces, this would be the exact weight value in ounces (i.e., complete decimal number, e.g., 8.2 or 8.0 ounces). Only returned if ShippingType is 2. * - minOccurs: 0 * @var \PayPal\StructType\MeasureType @@ -103,7 +103,7 @@ public function setOriginatingPostalCode($originatingPostalCode = null) { // validation for constraint: string if (!is_null($originatingPostalCode) && !is_string($originatingPostalCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($originatingPostalCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($originatingPostalCode, true), gettype($originatingPostalCode)), __LINE__); } $this->OriginatingPostalCode = $originatingPostalCode; return $this; @@ -125,7 +125,7 @@ public function setShippingIrregular($shippingIrregular = null) { // validation for constraint: boolean if (!is_null($shippingIrregular) && !is_bool($shippingIrregular)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($shippingIrregular)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($shippingIrregular, true), gettype($shippingIrregular)), __LINE__); } $this->ShippingIrregular = $shippingIrregular; return $this; @@ -138,6 +138,28 @@ public function getCarrierDetails() { return $this->CarrierDetails; } + /** + * This method is responsible for validating the values passed to the setCarrierDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setCarrierDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateCarrierDetailsForArrayConstraintsFromSetCarrierDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $calculatedShippingRateTypeCarrierDetailsItem) { + // validation for constraint: itemType + if (!$calculatedShippingRateTypeCarrierDetailsItem instanceof \PayPal\StructType\ShippingCarrierDetailsType) { + $invalidValues[] = is_object($calculatedShippingRateTypeCarrierDetailsItem) ? get_class($calculatedShippingRateTypeCarrierDetailsItem) : sprintf('%s(%s)', gettype($calculatedShippingRateTypeCarrierDetailsItem), var_export($calculatedShippingRateTypeCarrierDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The CarrierDetails property can only contain items of type \PayPal\StructType\ShippingCarrierDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set CarrierDetails value * @throws \InvalidArgumentException @@ -146,11 +168,9 @@ public function getCarrierDetails() */ public function setCarrierDetails(array $carrierDetails = array()) { - foreach ($carrierDetails as $calculatedShippingRateTypeCarrierDetailsItem) { - // validation for constraint: itemType - if (!$calculatedShippingRateTypeCarrierDetailsItem instanceof \PayPal\StructType\ShippingCarrierDetailsType) { - throw new \InvalidArgumentException(sprintf('The CarrierDetails property can only contain items of \PayPal\StructType\ShippingCarrierDetailsType, "%s" given', is_object($calculatedShippingRateTypeCarrierDetailsItem) ? get_class($calculatedShippingRateTypeCarrierDetailsItem) : gettype($calculatedShippingRateTypeCarrierDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($carrierDetailsArrayErrorMessage = self::validateCarrierDetailsForArrayConstraintsFromSetCarrierDetails($carrierDetails))) { + throw new \InvalidArgumentException($carrierDetailsArrayErrorMessage, __LINE__); } $this->CarrierDetails = $carrierDetails; return $this; @@ -165,7 +185,7 @@ public function addToCarrierDetails(\PayPal\StructType\ShippingCarrierDetailsTyp { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\ShippingCarrierDetailsType) { - throw new \InvalidArgumentException(sprintf('The CarrierDetails property can only contain items of \PayPal\StructType\ShippingCarrierDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The CarrierDetails property can only contain items of type \PayPal\StructType\ShippingCarrierDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->CarrierDetails[] = $item; return $this; @@ -190,7 +210,7 @@ public function setShippingPackage($shippingPackage = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ShippingPackageCodeType::valueIsValid($shippingPackage)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $shippingPackage, implode(', ', \PayPal\EnumType\ShippingPackageCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ShippingPackageCodeType', is_array($shippingPackage) ? implode(', ', $shippingPackage) : var_export($shippingPackage, true), implode(', ', \PayPal\EnumType\ShippingPackageCodeType::getValidValues())), __LINE__); } $this->ShippingPackage = $shippingPackage; return $this; diff --git a/src/StructType/CancelRecoupReq.php b/src/StructType/CancelRecoupReq.php index dcc3bea..7b55392 100644 --- a/src/StructType/CancelRecoupReq.php +++ b/src/StructType/CancelRecoupReq.php @@ -13,7 +13,7 @@ class CancelRecoupReq extends AbstractStructBase { /** * The CancelRecoupRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:CancelRecoupRequest * @var \PayPal\StructType\CancelRecoupRequestType */ diff --git a/src/StructType/CancelRecoupRequestType.php b/src/StructType/CancelRecoupRequestType.php index 37d6665..266e15d 100644 --- a/src/StructType/CancelRecoupRequestType.php +++ b/src/StructType/CancelRecoupRequestType.php @@ -13,7 +13,7 @@ class CancelRecoupRequestType extends AbstractRequestType { /** * The EnhancedCancelRecoupRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ed:EnhancedCancelRecoupRequestDetails diff --git a/src/StructType/CancelRecoupResponseType.php b/src/StructType/CancelRecoupResponseType.php index 8aecf41..382220d 100644 --- a/src/StructType/CancelRecoupResponseType.php +++ b/src/StructType/CancelRecoupResponseType.php @@ -11,12 +11,6 @@ */ class CancelRecoupResponseType extends AbstractResponseType { - /** - * Constructor method for CancelRecoupResponseType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/CategoryType.php b/src/StructType/CategoryType.php index 564d613..6a91c9b 100644 --- a/src/StructType/CategoryType.php +++ b/src/StructType/CategoryType.php @@ -6,7 +6,7 @@ /** * This class stands for CategoryType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Container for data on the primary category of listing. * @subpackage Structs * @author WsdlToPhp @@ -15,21 +15,21 @@ class CategoryType extends AbstractStructBase { /** * The AutoPayEnabled - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $AutoPayEnabled; /** * The B2BVATEnabled - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $B2BVATEnabled; /** * The CatalogEnabled - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ @@ -41,21 +41,21 @@ class CategoryType extends AbstractStructBase public $CategoryID; /** * The CategoryLevel - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ public $CategoryLevel; /** * The CategoryName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $CategoryName; /** * The CategoryParentID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var string[] @@ -63,7 +63,7 @@ class CategoryType extends AbstractStructBase public $CategoryParentID; /** * The CategoryParentName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var string[] @@ -71,7 +71,7 @@ class CategoryType extends AbstractStructBase public $CategoryParentName; /** * The CSIDList - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: CSIDList is not present if Attributes enabled. * - maxOccurs: unbounded * - minOccurs: 0 @@ -80,28 +80,28 @@ class CategoryType extends AbstractStructBase public $CSIDList; /** * The Expired - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $Expired; /** * The IntlAutosFixedCat - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $IntlAutosFixedCat; /** * The LeafCategory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $LeafCategory; /** * The Virtual - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ @@ -169,7 +169,7 @@ public function setAutoPayEnabled($autoPayEnabled = null) { // validation for constraint: boolean if (!is_null($autoPayEnabled) && !is_bool($autoPayEnabled)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($autoPayEnabled)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($autoPayEnabled, true), gettype($autoPayEnabled)), __LINE__); } $this->AutoPayEnabled = $autoPayEnabled; return $this; @@ -191,7 +191,7 @@ public function setB2BVATEnabled($b2BVATEnabled = null) { // validation for constraint: boolean if (!is_null($b2BVATEnabled) && !is_bool($b2BVATEnabled)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($b2BVATEnabled)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($b2BVATEnabled, true), gettype($b2BVATEnabled)), __LINE__); } $this->B2BVATEnabled = $b2BVATEnabled; return $this; @@ -213,7 +213,7 @@ public function setCatalogEnabled($catalogEnabled = null) { // validation for constraint: boolean if (!is_null($catalogEnabled) && !is_bool($catalogEnabled)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($catalogEnabled)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($catalogEnabled, true), gettype($catalogEnabled)), __LINE__); } $this->CatalogEnabled = $catalogEnabled; return $this; @@ -235,7 +235,7 @@ public function setCategoryID($categoryID = null) { // validation for constraint: string if (!is_null($categoryID) && !is_string($categoryID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($categoryID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($categoryID, true), gettype($categoryID)), __LINE__); } $this->CategoryID = $categoryID; return $this; @@ -256,8 +256,8 @@ public function getCategoryLevel() public function setCategoryLevel($categoryLevel = null) { // validation for constraint: int - if (!is_null($categoryLevel) && !is_numeric($categoryLevel)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($categoryLevel)), __LINE__); + if (!is_null($categoryLevel) && !(is_int($categoryLevel) || ctype_digit($categoryLevel))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($categoryLevel, true), gettype($categoryLevel)), __LINE__); } $this->CategoryLevel = $categoryLevel; return $this; @@ -279,7 +279,7 @@ public function setCategoryName($categoryName = null) { // validation for constraint: string if (!is_null($categoryName) && !is_string($categoryName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($categoryName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($categoryName, true), gettype($categoryName)), __LINE__); } $this->CategoryName = $categoryName; return $this; @@ -292,6 +292,28 @@ public function getCategoryParentID() { return $this->CategoryParentID; } + /** + * This method is responsible for validating the values passed to the setCategoryParentID method + * This method is willingly generated in order to preserve the one-line inline validation within the setCategoryParentID method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateCategoryParentIDForArrayConstraintsFromSetCategoryParentID(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $categoryTypeCategoryParentIDItem) { + // validation for constraint: itemType + if (!is_string($categoryTypeCategoryParentIDItem)) { + $invalidValues[] = is_object($categoryTypeCategoryParentIDItem) ? get_class($categoryTypeCategoryParentIDItem) : sprintf('%s(%s)', gettype($categoryTypeCategoryParentIDItem), var_export($categoryTypeCategoryParentIDItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The CategoryParentID property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set CategoryParentID value * @throws \InvalidArgumentException @@ -300,11 +322,9 @@ public function getCategoryParentID() */ public function setCategoryParentID(array $categoryParentID = array()) { - foreach ($categoryParentID as $categoryTypeCategoryParentIDItem) { - // validation for constraint: itemType - if (!is_string($categoryTypeCategoryParentIDItem)) { - throw new \InvalidArgumentException(sprintf('The CategoryParentID property can only contain items of string, "%s" given', is_object($categoryTypeCategoryParentIDItem) ? get_class($categoryTypeCategoryParentIDItem) : gettype($categoryTypeCategoryParentIDItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($categoryParentIDArrayErrorMessage = self::validateCategoryParentIDForArrayConstraintsFromSetCategoryParentID($categoryParentID))) { + throw new \InvalidArgumentException($categoryParentIDArrayErrorMessage, __LINE__); } $this->CategoryParentID = $categoryParentID; return $this; @@ -319,7 +339,7 @@ public function addToCategoryParentID($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The CategoryParentID property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The CategoryParentID property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->CategoryParentID[] = $item; return $this; @@ -332,6 +352,28 @@ public function getCategoryParentName() { return $this->CategoryParentName; } + /** + * This method is responsible for validating the values passed to the setCategoryParentName method + * This method is willingly generated in order to preserve the one-line inline validation within the setCategoryParentName method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateCategoryParentNameForArrayConstraintsFromSetCategoryParentName(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $categoryTypeCategoryParentNameItem) { + // validation for constraint: itemType + if (!is_string($categoryTypeCategoryParentNameItem)) { + $invalidValues[] = is_object($categoryTypeCategoryParentNameItem) ? get_class($categoryTypeCategoryParentNameItem) : sprintf('%s(%s)', gettype($categoryTypeCategoryParentNameItem), var_export($categoryTypeCategoryParentNameItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The CategoryParentName property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set CategoryParentName value * @throws \InvalidArgumentException @@ -340,11 +382,9 @@ public function getCategoryParentName() */ public function setCategoryParentName(array $categoryParentName = array()) { - foreach ($categoryParentName as $categoryTypeCategoryParentNameItem) { - // validation for constraint: itemType - if (!is_string($categoryTypeCategoryParentNameItem)) { - throw new \InvalidArgumentException(sprintf('The CategoryParentName property can only contain items of string, "%s" given', is_object($categoryTypeCategoryParentNameItem) ? get_class($categoryTypeCategoryParentNameItem) : gettype($categoryTypeCategoryParentNameItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($categoryParentNameArrayErrorMessage = self::validateCategoryParentNameForArrayConstraintsFromSetCategoryParentName($categoryParentName))) { + throw new \InvalidArgumentException($categoryParentNameArrayErrorMessage, __LINE__); } $this->CategoryParentName = $categoryParentName; return $this; @@ -359,7 +399,7 @@ public function addToCategoryParentName($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The CategoryParentName property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The CategoryParentName property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->CategoryParentName[] = $item; return $this; @@ -372,6 +412,28 @@ public function getCSIDList() { return $this->CSIDList; } + /** + * This method is responsible for validating the values passed to the setCSIDList method + * This method is willingly generated in order to preserve the one-line inline validation within the setCSIDList method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateCSIDListForArrayConstraintsFromSetCSIDList(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $categoryTypeCSIDListItem) { + // validation for constraint: itemType + if (!is_string($categoryTypeCSIDListItem)) { + $invalidValues[] = is_object($categoryTypeCSIDListItem) ? get_class($categoryTypeCSIDListItem) : sprintf('%s(%s)', gettype($categoryTypeCSIDListItem), var_export($categoryTypeCSIDListItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The CSIDList property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set CSIDList value * @throws \InvalidArgumentException @@ -380,11 +442,9 @@ public function getCSIDList() */ public function setCSIDList(array $cSIDList = array()) { - foreach ($cSIDList as $categoryTypeCSIDListItem) { - // validation for constraint: itemType - if (!is_string($categoryTypeCSIDListItem)) { - throw new \InvalidArgumentException(sprintf('The CSIDList property can only contain items of string, "%s" given', is_object($categoryTypeCSIDListItem) ? get_class($categoryTypeCSIDListItem) : gettype($categoryTypeCSIDListItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($cSIDListArrayErrorMessage = self::validateCSIDListForArrayConstraintsFromSetCSIDList($cSIDList))) { + throw new \InvalidArgumentException($cSIDListArrayErrorMessage, __LINE__); } $this->CSIDList = $cSIDList; return $this; @@ -399,7 +459,7 @@ public function addToCSIDList($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The CSIDList property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The CSIDList property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->CSIDList[] = $item; return $this; @@ -421,7 +481,7 @@ public function setExpired($expired = null) { // validation for constraint: boolean if (!is_null($expired) && !is_bool($expired)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($expired)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($expired, true), gettype($expired)), __LINE__); } $this->Expired = $expired; return $this; @@ -443,7 +503,7 @@ public function setIntlAutosFixedCat($intlAutosFixedCat = null) { // validation for constraint: boolean if (!is_null($intlAutosFixedCat) && !is_bool($intlAutosFixedCat)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($intlAutosFixedCat)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($intlAutosFixedCat, true), gettype($intlAutosFixedCat)), __LINE__); } $this->IntlAutosFixedCat = $intlAutosFixedCat; return $this; @@ -465,7 +525,7 @@ public function setLeafCategory($leafCategory = null) { // validation for constraint: boolean if (!is_null($leafCategory) && !is_bool($leafCategory)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($leafCategory)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($leafCategory, true), gettype($leafCategory)), __LINE__); } $this->LeafCategory = $leafCategory; return $this; @@ -487,7 +547,7 @@ public function setVirtual($virtual = null) { // validation for constraint: boolean if (!is_null($virtual) && !is_bool($virtual)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($virtual)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($virtual, true), gettype($virtual)), __LINE__); } $this->Virtual = $virtual; return $this; diff --git a/src/StructType/CharityType.php b/src/StructType/CharityType.php index f95960c..0f04499 100644 --- a/src/StructType/CharityType.php +++ b/src/StructType/CharityType.php @@ -6,7 +6,7 @@ /** * This class stands for CharityType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains information about a Charity listing.in case of revision - all data can be min occur = 0 * @subpackage Structs * @author WsdlToPhp @@ -15,21 +15,21 @@ class CharityType extends AbstractStructBase { /** * The CharityName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $CharityName; /** * The CharityNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ public $CharityNumber; /** * The DonationPercent - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var float */ @@ -67,7 +67,7 @@ public function setCharityName($charityName = null) { // validation for constraint: string if (!is_null($charityName) && !is_string($charityName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($charityName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($charityName, true), gettype($charityName)), __LINE__); } $this->CharityName = $charityName; return $this; @@ -88,8 +88,8 @@ public function getCharityNumber() public function setCharityNumber($charityNumber = null) { // validation for constraint: int - if (!is_null($charityNumber) && !is_numeric($charityNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($charityNumber)), __LINE__); + if (!is_null($charityNumber) && !(is_int($charityNumber) || ctype_digit($charityNumber))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($charityNumber, true), gettype($charityNumber)), __LINE__); } $this->CharityNumber = $charityNumber; return $this; @@ -109,6 +109,10 @@ public function getDonationPercent() */ public function setDonationPercent($donationPercent = null) { + // validation for constraint: float + if (!is_null($donationPercent) && !(is_float($donationPercent) || is_numeric($donationPercent))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($donationPercent, true), gettype($donationPercent)), __LINE__); + } $this->DonationPercent = $donationPercent; return $this; } diff --git a/src/StructType/CompleteRecoupReq.php b/src/StructType/CompleteRecoupReq.php index a345e62..8fb79c5 100644 --- a/src/StructType/CompleteRecoupReq.php +++ b/src/StructType/CompleteRecoupReq.php @@ -13,7 +13,7 @@ class CompleteRecoupReq extends AbstractStructBase { /** * The CompleteRecoupRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:CompleteRecoupRequest * @var \PayPal\StructType\CompleteRecoupRequestType */ diff --git a/src/StructType/CompleteRecoupRequestType.php b/src/StructType/CompleteRecoupRequestType.php index 9942730..39560b4 100644 --- a/src/StructType/CompleteRecoupRequestType.php +++ b/src/StructType/CompleteRecoupRequestType.php @@ -13,7 +13,7 @@ class CompleteRecoupRequestType extends AbstractRequestType { /** * The EnhancedCompleteRecoupRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ed:EnhancedCompleteRecoupRequestDetails diff --git a/src/StructType/CompleteRecoupResponseType.php b/src/StructType/CompleteRecoupResponseType.php index 492a533..3147c09 100644 --- a/src/StructType/CompleteRecoupResponseType.php +++ b/src/StructType/CompleteRecoupResponseType.php @@ -13,7 +13,7 @@ class CompleteRecoupResponseType extends AbstractResponseType { /** * The EnhancedCompleteRecoupResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ed:EnhancedCompleteRecoupResponseDetails diff --git a/src/StructType/CoupledBucketsType.php b/src/StructType/CoupledBucketsType.php index db16e74..b465dc8 100644 --- a/src/StructType/CoupledBucketsType.php +++ b/src/StructType/CoupledBucketsType.php @@ -6,7 +6,7 @@ /** * This class stands for CoupledBucketsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Defines relationship between buckets * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class CoupledBucketsType extends AbstractStructBase { /** * The PaymentRequestID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 10 * - minOccurs: 2 * @var string[] @@ -23,7 +23,7 @@ class CoupledBucketsType extends AbstractStructBase public $PaymentRequestID; /** * The CoupleType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Relationship Type - LifeTime (default) * - maxOccurs: 1 * - minOccurs: 0 @@ -32,7 +32,7 @@ class CoupledBucketsType extends AbstractStructBase public $CoupleType; /** * The CoupledPaymentRequestID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Identifier for this relation * - maxOccurs: 1 * - minOccurs: 0 @@ -63,6 +63,28 @@ public function getPaymentRequestID() { return $this->PaymentRequestID; } + /** + * This method is responsible for validating the values passed to the setPaymentRequestID method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentRequestID method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentRequestIDForArrayConstraintsFromSetPaymentRequestID(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $coupledBucketsTypePaymentRequestIDItem) { + // validation for constraint: itemType + if (!is_string($coupledBucketsTypePaymentRequestIDItem)) { + $invalidValues[] = is_object($coupledBucketsTypePaymentRequestIDItem) ? get_class($coupledBucketsTypePaymentRequestIDItem) : sprintf('%s(%s)', gettype($coupledBucketsTypePaymentRequestIDItem), var_export($coupledBucketsTypePaymentRequestIDItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The PaymentRequestID property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentRequestID value * @throws \InvalidArgumentException @@ -71,11 +93,13 @@ public function getPaymentRequestID() */ public function setPaymentRequestID(array $paymentRequestID = array()) { - foreach ($paymentRequestID as $coupledBucketsTypePaymentRequestIDItem) { - // validation for constraint: itemType - if (!is_string($coupledBucketsTypePaymentRequestIDItem)) { - throw new \InvalidArgumentException(sprintf('The PaymentRequestID property can only contain items of string, "%s" given', is_object($coupledBucketsTypePaymentRequestIDItem) ? get_class($coupledBucketsTypePaymentRequestIDItem) : gettype($coupledBucketsTypePaymentRequestIDItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentRequestIDArrayErrorMessage = self::validatePaymentRequestIDForArrayConstraintsFromSetPaymentRequestID($paymentRequestID))) { + throw new \InvalidArgumentException($paymentRequestIDArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($paymentRequestID) && count($paymentRequestID) > 10) { + 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($paymentRequestID)), __LINE__); } $this->PaymentRequestID = $paymentRequestID; return $this; @@ -90,7 +114,11 @@ public function addToPaymentRequestID($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The PaymentRequestID property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The PaymentRequestID property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->PaymentRequestID) && count($this->PaymentRequestID) >= 10) { + 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->PaymentRequestID)), __LINE__); } $this->PaymentRequestID[] = $item; return $this; @@ -115,7 +143,7 @@ public function setCoupleType($coupleType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CoupleType::valueIsValid($coupleType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $coupleType, implode(', ', \PayPal\EnumType\CoupleType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CoupleType', is_array($coupleType) ? implode(', ', $coupleType) : var_export($coupleType, true), implode(', ', \PayPal\EnumType\CoupleType::getValidValues())), __LINE__); } $this->CoupleType = $coupleType; return $this; @@ -137,7 +165,7 @@ public function setCoupledPaymentRequestID($coupledPaymentRequestID = null) { // validation for constraint: string if (!is_null($coupledPaymentRequestID) && !is_string($coupledPaymentRequestID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($coupledPaymentRequestID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($coupledPaymentRequestID, true), gettype($coupledPaymentRequestID)), __LINE__); } $this->CoupledPaymentRequestID = $coupledPaymentRequestID; return $this; diff --git a/src/StructType/CoupledPaymentInfoType.php b/src/StructType/CoupledPaymentInfoType.php index b26424d..05dd57e 100644 --- a/src/StructType/CoupledPaymentInfoType.php +++ b/src/StructType/CoupledPaymentInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for CoupledPaymentInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about Coupled Payment transactions. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class CoupledPaymentInfoType extends AbstractStructBase { /** * The CoupledPaymentID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ID that uniquely identifies this CoupledPayment. Generated by PP in Response * - maxOccurs: 1 * - minOccurs: 1 @@ -24,7 +24,7 @@ class CoupledPaymentInfoType extends AbstractStructBase public $CoupledPaymentID; /** * The CoupledPaymentRequestID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ID received in the Coupled Payment Request * - maxOccurs: 1 * - minOccurs: 0 @@ -61,7 +61,7 @@ public function setCoupledPaymentID($coupledPaymentID = null) { // validation for constraint: string if (!is_null($coupledPaymentID) && !is_string($coupledPaymentID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($coupledPaymentID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($coupledPaymentID, true), gettype($coupledPaymentID)), __LINE__); } $this->CoupledPaymentID = $coupledPaymentID; return $this; @@ -83,7 +83,7 @@ public function setCoupledPaymentRequestID($coupledPaymentRequestID = null) { // validation for constraint: string if (!is_null($coupledPaymentRequestID) && !is_string($coupledPaymentRequestID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($coupledPaymentRequestID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($coupledPaymentRequestID, true), gettype($coupledPaymentRequestID)), __LINE__); } $this->CoupledPaymentRequestID = $coupledPaymentRequestID; return $this; diff --git a/src/StructType/CreateBillingAgreementReq.php b/src/StructType/CreateBillingAgreementReq.php index 974840f..17ba7e7 100644 --- a/src/StructType/CreateBillingAgreementReq.php +++ b/src/StructType/CreateBillingAgreementReq.php @@ -13,7 +13,7 @@ class CreateBillingAgreementReq extends AbstractStructBase { /** * The CreateBillingAgreementRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:CreateBillingAgreementRequest * @var \PayPal\StructType\CreateBillingAgreementRequestType */ diff --git a/src/StructType/CreateBillingAgreementRequestType.php b/src/StructType/CreateBillingAgreementRequestType.php index 28df1c0..f9d439b 100644 --- a/src/StructType/CreateBillingAgreementRequestType.php +++ b/src/StructType/CreateBillingAgreementRequestType.php @@ -13,7 +13,8 @@ class CreateBillingAgreementRequestType extends AbstractRequestType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -46,7 +47,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/CreateBillingAgreementResponseType.php b/src/StructType/CreateBillingAgreementResponseType.php index 96a05d4..185b515 100644 --- a/src/StructType/CreateBillingAgreementResponseType.php +++ b/src/StructType/CreateBillingAgreementResponseType.php @@ -13,7 +13,7 @@ class CreateBillingAgreementResponseType extends AbstractResponseType { /** * The BillingAgreementID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -46,7 +46,7 @@ public function setBillingAgreementID($billingAgreementID = null) { // validation for constraint: string if (!is_null($billingAgreementID) && !is_string($billingAgreementID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingAgreementID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementID, true), gettype($billingAgreementID)), __LINE__); } $this->BillingAgreementID = $billingAgreementID; return $this; diff --git a/src/StructType/CreateMobilePaymentReq.php b/src/StructType/CreateMobilePaymentReq.php index 2e23214..17cd3de 100644 --- a/src/StructType/CreateMobilePaymentReq.php +++ b/src/StructType/CreateMobilePaymentReq.php @@ -13,7 +13,7 @@ class CreateMobilePaymentReq extends AbstractStructBase { /** * The CreateMobilePaymentRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:CreateMobilePaymentRequest * @var \PayPal\StructType\CreateMobilePaymentRequestType */ diff --git a/src/StructType/CreateMobilePaymentRequestDetailsType.php b/src/StructType/CreateMobilePaymentRequestDetailsType.php index 9f7ab19..8652bd2 100644 --- a/src/StructType/CreateMobilePaymentRequestDetailsType.php +++ b/src/StructType/CreateMobilePaymentRequestDetailsType.php @@ -13,14 +13,14 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase { /** * The PaymentType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of the payment Required * @var string */ public $PaymentType; /** * The PaymentAction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: How you want to obtain payment. Defaults to Sale. Optional Authorization indicates that this payment is a basic authorization subject to settlement with PayPal Authorization and Capture. Sale indicates that this is a final sale for * which you are requesting payment. * @var string @@ -28,21 +28,21 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase public $PaymentAction; /** * The SenderPhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Phone number of the user making the payment. Required * @var \PayPal\StructType\PhoneNumberType */ public $SenderPhone; /** * The RecipientType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of recipient specified, i.e., phone number or email address Required * @var string */ public $RecipientType; /** * The RecipientEmail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Email address of the recipient * - minOccurs: 0 * @var string @@ -50,7 +50,7 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase public $RecipientEmail; /** * The RecipientPhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Phone number of the recipipent Required * - minOccurs: 0 * @var \PayPal\StructType\PhoneNumberType @@ -58,14 +58,14 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase public $RecipientPhone; /** * The ItemAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of item before tax and shipping * @var \PayPal\StructType\BasicAmountType */ public $ItemAmount; /** * The Tax - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The tax charged on the transactionTax Optional * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -73,7 +73,7 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase public $Tax; /** * The Shipping - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Per-transaction shipping charge Optional * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -81,7 +81,7 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase public $Shipping; /** * The ItemName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Name of the item being ordered Optional Character length and limitations: 255 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -89,7 +89,7 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase public $ItemName; /** * The ItemNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: SKU of the item being ordered Optional Character length and limitations: 255 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -97,7 +97,7 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase public $ItemNumber; /** * The Note - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Memo entered by sender in PayPal Website Payments note field. Optional Character length and limitations: 255 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -105,7 +105,7 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase public $Note; /** * The CustomID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique ID for the order. Required for non-P2P transactions Optional Character length and limitations: 255 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -113,7 +113,7 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase public $CustomID; /** * The SharePhoneNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether the sender's phone number will be shared with recipient Optional * - minOccurs: 0 * @var int @@ -121,7 +121,7 @@ class CreateMobilePaymentRequestDetailsType extends AbstractStructBase public $SharePhoneNumber; /** * The ShareHomeAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether the sender's home address will be shared with recipient Optional * - minOccurs: 0 * @var int @@ -199,7 +199,7 @@ public function setPaymentType($paymentType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MobilePaymentCodeType::valueIsValid($paymentType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentType, implode(', ', \PayPal\EnumType\MobilePaymentCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MobilePaymentCodeType', is_array($paymentType) ? implode(', ', $paymentType) : var_export($paymentType, true), implode(', ', \PayPal\EnumType\MobilePaymentCodeType::getValidValues())), __LINE__); } $this->PaymentType = $paymentType; return $this; @@ -224,7 +224,7 @@ public function setPaymentAction($paymentAction = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentActionCodeType::valueIsValid($paymentAction)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentAction, implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentActionCodeType', is_array($paymentAction) ? implode(', ', $paymentAction) : var_export($paymentAction, true), implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); } $this->PaymentAction = $paymentAction; return $this; @@ -267,7 +267,7 @@ public function setRecipientType($recipientType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MobileRecipientCodeType::valueIsValid($recipientType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $recipientType, implode(', ', \PayPal\EnumType\MobileRecipientCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MobileRecipientCodeType', is_array($recipientType) ? implode(', ', $recipientType) : var_export($recipientType, true), implode(', ', \PayPal\EnumType\MobileRecipientCodeType::getValidValues())), __LINE__); } $this->RecipientType = $recipientType; return $this; @@ -289,7 +289,7 @@ public function setRecipientEmail($recipientEmail = null) { // validation for constraint: string if (!is_null($recipientEmail) && !is_string($recipientEmail)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($recipientEmail)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($recipientEmail, true), gettype($recipientEmail)), __LINE__); } $this->RecipientEmail = $recipientEmail; return $this; @@ -383,7 +383,7 @@ public function setItemName($itemName = null) { // validation for constraint: string if (!is_null($itemName) && !is_string($itemName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemName, true), gettype($itemName)), __LINE__); } $this->ItemName = $itemName; return $this; @@ -405,7 +405,7 @@ public function setItemNumber($itemNumber = null) { // validation for constraint: string if (!is_null($itemNumber) && !is_string($itemNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemNumber, true), gettype($itemNumber)), __LINE__); } $this->ItemNumber = $itemNumber; return $this; @@ -427,7 +427,7 @@ public function setNote($note = null) { // validation for constraint: string if (!is_null($note) && !is_string($note)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($note)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); } $this->Note = $note; return $this; @@ -449,7 +449,7 @@ public function setCustomID($customID = null) { // validation for constraint: string if (!is_null($customID) && !is_string($customID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($customID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($customID, true), gettype($customID)), __LINE__); } $this->CustomID = $customID; return $this; @@ -470,8 +470,8 @@ public function getSharePhoneNumber() public function setSharePhoneNumber($sharePhoneNumber = null) { // validation for constraint: int - if (!is_null($sharePhoneNumber) && !is_numeric($sharePhoneNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($sharePhoneNumber)), __LINE__); + if (!is_null($sharePhoneNumber) && !(is_int($sharePhoneNumber) || ctype_digit($sharePhoneNumber))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($sharePhoneNumber, true), gettype($sharePhoneNumber)), __LINE__); } $this->SharePhoneNumber = $sharePhoneNumber; return $this; @@ -492,8 +492,8 @@ public function getShareHomeAddress() public function setShareHomeAddress($shareHomeAddress = null) { // validation for constraint: int - if (!is_null($shareHomeAddress) && !is_numeric($shareHomeAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($shareHomeAddress)), __LINE__); + if (!is_null($shareHomeAddress) && !(is_int($shareHomeAddress) || ctype_digit($shareHomeAddress))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($shareHomeAddress, true), gettype($shareHomeAddress)), __LINE__); } $this->ShareHomeAddress = $shareHomeAddress; return $this; diff --git a/src/StructType/CreateMobilePaymentRequestType.php b/src/StructType/CreateMobilePaymentRequestType.php index a60e50d..45c55c0 100644 --- a/src/StructType/CreateMobilePaymentRequestType.php +++ b/src/StructType/CreateMobilePaymentRequestType.php @@ -13,7 +13,7 @@ class CreateMobilePaymentRequestType extends AbstractRequestType { /** * The CreateMobilePaymentRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:CreateMobilePaymentRequestDetails diff --git a/src/StructType/CreateMobilePaymentResponseType.php b/src/StructType/CreateMobilePaymentResponseType.php index 05abf6a..70d7230 100644 --- a/src/StructType/CreateMobilePaymentResponseType.php +++ b/src/StructType/CreateMobilePaymentResponseType.php @@ -11,12 +11,6 @@ */ class CreateMobilePaymentResponseType extends AbstractResponseType { - /** - * Constructor method for CreateMobilePaymentResponseType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/CreateRecurringPaymentsProfileReq.php b/src/StructType/CreateRecurringPaymentsProfileReq.php index 822d53d..8553fcb 100644 --- a/src/StructType/CreateRecurringPaymentsProfileReq.php +++ b/src/StructType/CreateRecurringPaymentsProfileReq.php @@ -13,7 +13,7 @@ class CreateRecurringPaymentsProfileReq extends AbstractStructBase { /** * The CreateRecurringPaymentsProfileRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:CreateRecurringPaymentsProfileRequest * @var \PayPal\StructType\CreateRecurringPaymentsProfileRequestType */ diff --git a/src/StructType/CreateRecurringPaymentsProfileRequestDetailsType.php b/src/StructType/CreateRecurringPaymentsProfileRequestDetailsType.php index 2621126..55da155 100644 --- a/src/StructType/CreateRecurringPaymentsProfileRequestDetailsType.php +++ b/src/StructType/CreateRecurringPaymentsProfileRequestDetailsType.php @@ -14,7 +14,7 @@ class CreateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas { /** * The RecurringPaymentsProfileDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Customer Information for this Recurring Payments * - maxOccurs: 1 * - minOccurs: 1 @@ -23,7 +23,7 @@ class CreateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $RecurringPaymentsProfileDetails; /** * The ScheduleDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Schedule Information for this Recurring Payments * - maxOccurs: 1 * - minOccurs: 1 @@ -32,7 +32,7 @@ class CreateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $ScheduleDetails; /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Billing Agreement token (required if Express Checkout) * - maxOccurs: 1 * - minOccurs: 0 @@ -41,7 +41,7 @@ class CreateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $Token; /** * The CreditCard - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the credit card to be charged (required if Direct Payment) * - maxOccurs: 1 * - minOccurs: 0 @@ -50,7 +50,7 @@ class CreateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $CreditCard; /** * The PaymentDetailsItem - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Item Details. * - maxOccurs: unbounded * - minOccurs: 0 @@ -59,7 +59,7 @@ class CreateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $PaymentDetailsItem; /** * The SoftDescriptor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Use this optional parameter to pass in your business name and other data describing the transaction. Optional This information is usually displayed in the CC account holder's statement. Example: RedCross Haiti, RedCross Uganda, * Realtor.com dues, Realtor.com list fee Length 25 characters. Alphanumeric characters and dash(-), dot(.), asterisk(*), space( ) On the customer's statement, an asterisk is used to separate the DBA name and product name. The asterisk delimiter can * appear in position 4, 8, or 13. @@ -70,7 +70,7 @@ class CreateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $SoftDescriptor; /** * The SoftDescriptorCity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Use this optional parameter to pass information about how consumer should contact the merchant. Optional This information is usually displayed in the CC account holder's statement. For Ecom trx: phone, email or URL is allowed For * Retail trx: only the actual city is allowed For details on allowed characters in Soft Descriptor City refer to the API documentation. * - maxOccurs: 1 @@ -159,7 +159,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; @@ -190,6 +190,28 @@ public function getPaymentDetailsItem() { return $this->PaymentDetailsItem; } + /** + * This method is responsible for validating the values passed to the setPaymentDetailsItem method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentDetailsItem method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentDetailsItemForArrayConstraintsFromSetPaymentDetailsItem(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem) { + // validation for constraint: itemType + if (!$createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem instanceof \PayPal\StructType\PaymentDetailsItemType) { + $invalidValues[] = is_object($createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem) ? get_class($createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem) : sprintf('%s(%s)', gettype($createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem), var_export($createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The PaymentDetailsItem property can only contain items of type \PayPal\StructType\PaymentDetailsItemType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentDetailsItem value * @throws \InvalidArgumentException @@ -198,11 +220,9 @@ public function getPaymentDetailsItem() */ public function setPaymentDetailsItem(array $paymentDetailsItem = array()) { - foreach ($paymentDetailsItem as $createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem) { - // validation for constraint: itemType - if (!$createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem instanceof \PayPal\StructType\PaymentDetailsItemType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetailsItem property can only contain items of \PayPal\StructType\PaymentDetailsItemType, "%s" given', is_object($createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem) ? get_class($createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem) : gettype($createRecurringPaymentsProfileRequestDetailsTypePaymentDetailsItemItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentDetailsItemArrayErrorMessage = self::validatePaymentDetailsItemForArrayConstraintsFromSetPaymentDetailsItem($paymentDetailsItem))) { + throw new \InvalidArgumentException($paymentDetailsItemArrayErrorMessage, __LINE__); } $this->PaymentDetailsItem = $paymentDetailsItem; return $this; @@ -217,7 +237,7 @@ public function addToPaymentDetailsItem(\PayPal\StructType\PaymentDetailsItemTyp { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentDetailsItemType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetailsItem property can only contain items of \PayPal\StructType\PaymentDetailsItemType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The PaymentDetailsItem property can only contain items of type \PayPal\StructType\PaymentDetailsItemType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->PaymentDetailsItem[] = $item; return $this; @@ -239,7 +259,7 @@ public function setSoftDescriptor($softDescriptor = null) { // validation for constraint: string if (!is_null($softDescriptor) && !is_string($softDescriptor)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptor)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptor, true), gettype($softDescriptor)), __LINE__); } $this->SoftDescriptor = $softDescriptor; return $this; @@ -261,7 +281,7 @@ public function setSoftDescriptorCity($softDescriptorCity = null) { // validation for constraint: string if (!is_null($softDescriptorCity) && !is_string($softDescriptorCity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptorCity)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptorCity, true), gettype($softDescriptorCity)), __LINE__); } $this->SoftDescriptorCity = $softDescriptorCity; return $this; diff --git a/src/StructType/CreateRecurringPaymentsProfileRequestType.php b/src/StructType/CreateRecurringPaymentsProfileRequestType.php index 5d2c522..d047ee2 100644 --- a/src/StructType/CreateRecurringPaymentsProfileRequestType.php +++ b/src/StructType/CreateRecurringPaymentsProfileRequestType.php @@ -13,7 +13,7 @@ class CreateRecurringPaymentsProfileRequestType extends AbstractRequestType { /** * The CreateRecurringPaymentsProfileRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:CreateRecurringPaymentsProfileRequestDetails * @var \PayPal\StructType\CreateRecurringPaymentsProfileRequestDetailsType */ diff --git a/src/StructType/CreateRecurringPaymentsProfileResponseDetailsType.php b/src/StructType/CreateRecurringPaymentsProfileResponseDetailsType.php index 9c1b1c4..0b93d9e 100644 --- a/src/StructType/CreateRecurringPaymentsProfileResponseDetailsType.php +++ b/src/StructType/CreateRecurringPaymentsProfileResponseDetailsType.php @@ -14,7 +14,7 @@ class CreateRecurringPaymentsProfileResponseDetailsType extends AbstractStructBa { /** * The ProfileID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Recurring Billing Profile ID * - maxOccurs: 1 * - minOccurs: 1 @@ -23,7 +23,7 @@ class CreateRecurringPaymentsProfileResponseDetailsType extends AbstractStructBa public $ProfileID; /** * The ProfileStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Recurring Billing Profile Status * - maxOccurs: 1 * - minOccurs: 0 @@ -32,7 +32,7 @@ class CreateRecurringPaymentsProfileResponseDetailsType extends AbstractStructBa public $ProfileStatus; /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Transaction id from DCC initial payment * - maxOccurs: 1 * - minOccurs: 0 @@ -41,7 +41,7 @@ class CreateRecurringPaymentsProfileResponseDetailsType extends AbstractStructBa public $TransactionID; /** * The DCCProcessorResponse - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Response from DCC initial payment * - maxOccurs: 1 * - minOccurs: 0 @@ -50,7 +50,7 @@ class CreateRecurringPaymentsProfileResponseDetailsType extends AbstractStructBa public $DCCProcessorResponse; /** * The DCCReturnCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Return code if DCC initial payment fails * - maxOccurs: 1 * - minOccurs: 0 @@ -59,7 +59,7 @@ class CreateRecurringPaymentsProfileResponseDetailsType extends AbstractStructBa public $DCCReturnCode; /** * The PendingReason - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Interchange Plus Pricing pending reason * - maxOccurs: 1 * - minOccurs: 0 @@ -108,7 +108,7 @@ public function setProfileID($profileID = null) { // validation for constraint: string if (!is_null($profileID) && !is_string($profileID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileID, true), gettype($profileID)), __LINE__); } $this->ProfileID = $profileID; return $this; @@ -133,7 +133,7 @@ public function setProfileStatus($profileStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\RecurringPaymentsProfileStatusType::valueIsValid($profileStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $profileStatus, implode(', ', \PayPal\EnumType\RecurringPaymentsProfileStatusType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\RecurringPaymentsProfileStatusType', is_array($profileStatus) ? implode(', ', $profileStatus) : var_export($profileStatus, true), implode(', ', \PayPal\EnumType\RecurringPaymentsProfileStatusType::getValidValues())), __LINE__); } $this->ProfileStatus = $profileStatus; return $this; @@ -155,7 +155,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -177,7 +177,7 @@ public function setDCCProcessorResponse($dCCProcessorResponse = null) { // validation for constraint: string if (!is_null($dCCProcessorResponse) && !is_string($dCCProcessorResponse)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($dCCProcessorResponse)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($dCCProcessorResponse, true), gettype($dCCProcessorResponse)), __LINE__); } $this->DCCProcessorResponse = $dCCProcessorResponse; return $this; @@ -199,7 +199,7 @@ public function setDCCReturnCode($dCCReturnCode = null) { // validation for constraint: string if (!is_null($dCCReturnCode) && !is_string($dCCReturnCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($dCCReturnCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($dCCReturnCode, true), gettype($dCCReturnCode)), __LINE__); } $this->DCCReturnCode = $dCCReturnCode; return $this; @@ -221,7 +221,7 @@ public function setPendingReason($pendingReason = null) { // validation for constraint: string if (!is_null($pendingReason) && !is_string($pendingReason)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pendingReason)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pendingReason, true), gettype($pendingReason)), __LINE__); } $this->PendingReason = $pendingReason; return $this; diff --git a/src/StructType/CreateRecurringPaymentsProfileResponseType.php b/src/StructType/CreateRecurringPaymentsProfileResponseType.php index 6dfb65c..c3ccc7c 100644 --- a/src/StructType/CreateRecurringPaymentsProfileResponseType.php +++ b/src/StructType/CreateRecurringPaymentsProfileResponseType.php @@ -13,7 +13,7 @@ class CreateRecurringPaymentsProfileResponseType extends AbstractResponseType { /** * The CreateRecurringPaymentsProfileResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:CreateRecurringPaymentsProfileResponseDetails * @var \PayPal\StructType\CreateRecurringPaymentsProfileResponseDetailsType */ diff --git a/src/StructType/CreditCardDetailsType.php b/src/StructType/CreditCardDetailsType.php index 51e48ac..023d46c 100644 --- a/src/StructType/CreditCardDetailsType.php +++ b/src/StructType/CreditCardDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for CreditCardDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: CreditCardDetailsType Information about a Credit Card. * @subpackage Structs * @author WsdlToPhp @@ -15,70 +15,70 @@ class CreditCardDetailsType extends AbstractStructBase { /** * The CreditCardType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $CreditCardType; /** * The CreditCardNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $CreditCardNumber; /** * The ExpMonth - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ public $ExpMonth; /** * The ExpYear - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ public $ExpYear; /** * The CardOwner - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\PayerInfoType */ public $CardOwner; /** * The CVV2 - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $CVV2; /** * The StartMonth - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ public $StartMonth; /** * The StartYear - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ public $StartYear; /** * The IssueNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $IssueNumber; /** * The ThreeDSecureRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\ThreeDSecureRequestType */ @@ -140,7 +140,7 @@ public function setCreditCardType($creditCardType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CreditCardTypeType::valueIsValid($creditCardType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $creditCardType, implode(', ', \PayPal\EnumType\CreditCardTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CreditCardTypeType', is_array($creditCardType) ? implode(', ', $creditCardType) : var_export($creditCardType, true), implode(', ', \PayPal\EnumType\CreditCardTypeType::getValidValues())), __LINE__); } $this->CreditCardType = $creditCardType; return $this; @@ -162,7 +162,7 @@ public function setCreditCardNumber($creditCardNumber = null) { // validation for constraint: string if (!is_null($creditCardNumber) && !is_string($creditCardNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($creditCardNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($creditCardNumber, true), gettype($creditCardNumber)), __LINE__); } $this->CreditCardNumber = $creditCardNumber; return $this; @@ -183,8 +183,8 @@ public function getExpMonth() public function setExpMonth($expMonth = null) { // validation for constraint: int - if (!is_null($expMonth) && !is_numeric($expMonth)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($expMonth)), __LINE__); + if (!is_null($expMonth) && !(is_int($expMonth) || ctype_digit($expMonth))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($expMonth, true), gettype($expMonth)), __LINE__); } $this->ExpMonth = $expMonth; return $this; @@ -205,8 +205,8 @@ public function getExpYear() public function setExpYear($expYear = null) { // validation for constraint: int - if (!is_null($expYear) && !is_numeric($expYear)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($expYear)), __LINE__); + if (!is_null($expYear) && !(is_int($expYear) || ctype_digit($expYear))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($expYear, true), gettype($expYear)), __LINE__); } $this->ExpYear = $expYear; return $this; @@ -246,7 +246,7 @@ public function setCVV2($cVV2 = null) { // validation for constraint: string if (!is_null($cVV2) && !is_string($cVV2)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cVV2)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cVV2, true), gettype($cVV2)), __LINE__); } $this->CVV2 = $cVV2; return $this; @@ -267,8 +267,8 @@ public function getStartMonth() public function setStartMonth($startMonth = null) { // validation for constraint: int - if (!is_null($startMonth) && !is_numeric($startMonth)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($startMonth)), __LINE__); + if (!is_null($startMonth) && !(is_int($startMonth) || ctype_digit($startMonth))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($startMonth, true), gettype($startMonth)), __LINE__); } $this->StartMonth = $startMonth; return $this; @@ -289,8 +289,8 @@ public function getStartYear() public function setStartYear($startYear = null) { // validation for constraint: int - if (!is_null($startYear) && !is_numeric($startYear)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($startYear)), __LINE__); + if (!is_null($startYear) && !(is_int($startYear) || ctype_digit($startYear))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($startYear, true), gettype($startYear)), __LINE__); } $this->StartYear = $startYear; return $this; @@ -312,7 +312,7 @@ public function setIssueNumber($issueNumber = null) { // validation for constraint: string if (!is_null($issueNumber) && !is_string($issueNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($issueNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($issueNumber, true), gettype($issueNumber)), __LINE__); } $this->IssueNumber = $issueNumber; return $this; diff --git a/src/StructType/CreditCardNumberTypeType.php b/src/StructType/CreditCardNumberTypeType.php index cfcab44..595297e 100644 --- a/src/StructType/CreditCardNumberTypeType.php +++ b/src/StructType/CreditCardNumberTypeType.php @@ -13,7 +13,7 @@ class CreditCardNumberTypeType extends AbstractStructBase { /** * The CreditCardType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class CreditCardNumberTypeType extends AbstractStructBase public $CreditCardType; /** * The CreditCardNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -60,7 +60,7 @@ public function setCreditCardType($creditCardType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CreditCardTypeType::valueIsValid($creditCardType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $creditCardType, implode(', ', \PayPal\EnumType\CreditCardTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CreditCardTypeType', is_array($creditCardType) ? implode(', ', $creditCardType) : var_export($creditCardType, true), implode(', ', \PayPal\EnumType\CreditCardTypeType::getValidValues())), __LINE__); } $this->CreditCardType = $creditCardType; return $this; @@ -82,7 +82,7 @@ public function setCreditCardNumber($creditCardNumber = null) { // validation for constraint: string if (!is_null($creditCardNumber) && !is_string($creditCardNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($creditCardNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($creditCardNumber, true), gettype($creditCardNumber)), __LINE__); } $this->CreditCardNumber = $creditCardNumber; return $this; diff --git a/src/StructType/CrossPromotionsType.php b/src/StructType/CrossPromotionsType.php index bc33b75..815f8c4 100644 --- a/src/StructType/CrossPromotionsType.php +++ b/src/StructType/CrossPromotionsType.php @@ -6,7 +6,7 @@ /** * This class stands for CrossPromotionsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchandizing info for an Item. This contains a list of crosssell or upsell items. PrimaryScheme, PromotionMethod,SellerId,ItemId, ShippingDiscount do not have be min occur 0 * @subpackage Structs * @author WsdlToPhp @@ -15,8 +15,9 @@ class CrossPromotionsType extends AbstractStructBase { /** * The ItemID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item ID for the base item. Based on this item other items are promoted. | Represents the unique identifier for an item. To be used to specify the elements that represents an ItemID. + * - base: xs:string * @var string */ public $ItemID; @@ -32,21 +33,21 @@ class CrossPromotionsType extends AbstractStructBase public $PromotionMethod; /** * The SellerID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Id of the Seller who is promoting this item. * @var string */ public $SellerID; /** * The ShippingDiscount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Shipping Discount offered or not by the seller. * @var bool */ public $ShippingDiscount; /** * The SellerKey - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Key of the Seller who is promoting this item. * - minOccurs: 0 * @var string @@ -54,7 +55,7 @@ class CrossPromotionsType extends AbstractStructBase public $SellerKey; /** * The StoreName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Store Name for the seller. * - minOccurs: 0 * @var string @@ -62,7 +63,7 @@ class CrossPromotionsType extends AbstractStructBase public $StoreName; /** * The PromotedItem - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * @var \PayPal\StructType\PromotedItemType[] */ @@ -115,7 +116,7 @@ public function setItemID($itemID = null) { // validation for constraint: string if (!is_null($itemID) && !is_string($itemID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemID, true), gettype($itemID)), __LINE__); } $this->ItemID = $itemID; return $this; @@ -140,7 +141,7 @@ public function setPrimaryScheme($primaryScheme = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PromotionSchemeCodeType::valueIsValid($primaryScheme)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $primaryScheme, implode(', ', \PayPal\EnumType\PromotionSchemeCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PromotionSchemeCodeType', is_array($primaryScheme) ? implode(', ', $primaryScheme) : var_export($primaryScheme, true), implode(', ', \PayPal\EnumType\PromotionSchemeCodeType::getValidValues())), __LINE__); } $this->PrimaryScheme = $primaryScheme; return $this; @@ -165,7 +166,7 @@ public function setPromotionMethod($promotionMethod = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PromotionMethodCodeType::valueIsValid($promotionMethod)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $promotionMethod, implode(', ', \PayPal\EnumType\PromotionMethodCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PromotionMethodCodeType', is_array($promotionMethod) ? implode(', ', $promotionMethod) : var_export($promotionMethod, true), implode(', ', \PayPal\EnumType\PromotionMethodCodeType::getValidValues())), __LINE__); } $this->PromotionMethod = $promotionMethod; return $this; @@ -187,7 +188,7 @@ public function setSellerID($sellerID = null) { // validation for constraint: string if (!is_null($sellerID) && !is_string($sellerID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sellerID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerID, true), gettype($sellerID)), __LINE__); } $this->SellerID = $sellerID; return $this; @@ -209,7 +210,7 @@ public function setShippingDiscount($shippingDiscount = null) { // validation for constraint: boolean if (!is_null($shippingDiscount) && !is_bool($shippingDiscount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($shippingDiscount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($shippingDiscount, true), gettype($shippingDiscount)), __LINE__); } $this->ShippingDiscount = $shippingDiscount; return $this; @@ -231,7 +232,7 @@ public function setSellerKey($sellerKey = null) { // validation for constraint: string if (!is_null($sellerKey) && !is_string($sellerKey)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sellerKey)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerKey, true), gettype($sellerKey)), __LINE__); } $this->SellerKey = $sellerKey; return $this; @@ -253,7 +254,7 @@ public function setStoreName($storeName = null) { // validation for constraint: string if (!is_null($storeName) && !is_string($storeName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($storeName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($storeName, true), gettype($storeName)), __LINE__); } $this->StoreName = $storeName; return $this; @@ -266,6 +267,28 @@ public function getPromotedItem() { return $this->PromotedItem; } + /** + * This method is responsible for validating the values passed to the setPromotedItem method + * This method is willingly generated in order to preserve the one-line inline validation within the setPromotedItem method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePromotedItemForArrayConstraintsFromSetPromotedItem(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $crossPromotionsTypePromotedItemItem) { + // validation for constraint: itemType + if (!$crossPromotionsTypePromotedItemItem instanceof \PayPal\StructType\PromotedItemType) { + $invalidValues[] = is_object($crossPromotionsTypePromotedItemItem) ? get_class($crossPromotionsTypePromotedItemItem) : sprintf('%s(%s)', gettype($crossPromotionsTypePromotedItemItem), var_export($crossPromotionsTypePromotedItemItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The PromotedItem property can only contain items of type \PayPal\StructType\PromotedItemType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set PromotedItem value * @throws \InvalidArgumentException @@ -274,11 +297,9 @@ public function getPromotedItem() */ public function setPromotedItem(array $promotedItem = array()) { - foreach ($promotedItem as $crossPromotionsTypePromotedItemItem) { - // validation for constraint: itemType - if (!$crossPromotionsTypePromotedItemItem instanceof \PayPal\StructType\PromotedItemType) { - throw new \InvalidArgumentException(sprintf('The PromotedItem property can only contain items of \PayPal\StructType\PromotedItemType, "%s" given', is_object($crossPromotionsTypePromotedItemItem) ? get_class($crossPromotionsTypePromotedItemItem) : gettype($crossPromotionsTypePromotedItemItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($promotedItemArrayErrorMessage = self::validatePromotedItemForArrayConstraintsFromSetPromotedItem($promotedItem))) { + throw new \InvalidArgumentException($promotedItemArrayErrorMessage, __LINE__); } $this->PromotedItem = $promotedItem; return $this; @@ -293,7 +314,7 @@ public function addToPromotedItem(\PayPal\StructType\PromotedItemType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PromotedItemType) { - throw new \InvalidArgumentException(sprintf('The PromotedItem property can only contain items of \PayPal\StructType\PromotedItemType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The PromotedItem property can only contain items of type \PayPal\StructType\PromotedItemType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->PromotedItem[] = $item; return $this; diff --git a/src/StructType/CustomSecurityHeaderType.php b/src/StructType/CustomSecurityHeaderType.php index 9bf6da4..a03a387 100644 --- a/src/StructType/CustomSecurityHeaderType.php +++ b/src/StructType/CustomSecurityHeaderType.php @@ -6,7 +6,7 @@ /** * This class stands for CustomSecurityHeaderType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Custom Securiy Header. * @subpackage Structs * @author WsdlToPhp @@ -15,21 +15,21 @@ class CustomSecurityHeaderType extends AbstractStructBase { /** * The eBayAuthToken - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $eBayAuthToken; /** * The HardExpirationWarning - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $HardExpirationWarning; /** * The Credentials - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\UserIdPasswordType */ @@ -67,7 +67,7 @@ public function setEBayAuthToken($eBayAuthToken = null) { // validation for constraint: string if (!is_null($eBayAuthToken) && !is_string($eBayAuthToken)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($eBayAuthToken)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($eBayAuthToken, true), gettype($eBayAuthToken)), __LINE__); } $this->eBayAuthToken = $eBayAuthToken; return $this; @@ -89,7 +89,7 @@ public function setHardExpirationWarning($hardExpirationWarning = null) { // validation for constraint: string if (!is_null($hardExpirationWarning) && !is_string($hardExpirationWarning)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($hardExpirationWarning)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hardExpirationWarning, true), gettype($hardExpirationWarning)), __LINE__); } $this->HardExpirationWarning = $hardExpirationWarning; return $this; diff --git a/src/StructType/DeviceDetailsType.php b/src/StructType/DeviceDetailsType.php index e2c3dd4..cd6f331 100644 --- a/src/StructType/DeviceDetailsType.php +++ b/src/StructType/DeviceDetailsType.php @@ -13,7 +13,7 @@ class DeviceDetailsType extends AbstractStructBase { /** * The DeviceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Device ID Optional Character length and limits: 256 single-byte characters DeviceID length morethan 256 is truncated * - minOccurs: 0 * @var string @@ -46,7 +46,7 @@ public function setDeviceID($deviceID = null) { // validation for constraint: string if (!is_null($deviceID) && !is_string($deviceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($deviceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($deviceID, true), gettype($deviceID)), __LINE__); } $this->DeviceID = $deviceID; return $this; diff --git a/src/StructType/DiscountInfoType.php b/src/StructType/DiscountInfoType.php index d9cb785..4f3eef9 100644 --- a/src/StructType/DiscountInfoType.php +++ b/src/StructType/DiscountInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for DiscountInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Describes discount information. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class DiscountInfoType extends AbstractStructBase { /** * The Name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: (Optional)Item name. Character length and limits: 127 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class DiscountInfoType extends AbstractStructBase public $Name; /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: (Optional)Description of the discount. Character length and limits: 127 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -33,7 +33,7 @@ class DiscountInfoType extends AbstractStructBase public $Description; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: (Optional)Amount discounted. The value includes an amount and a 3-character currency code. * - maxOccurs: 1 * - minOccurs: 0 @@ -42,7 +42,7 @@ class DiscountInfoType extends AbstractStructBase public $Amount; /** * The RedeemedOfferType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: (Optional)Offer type. * - maxOccurs: 1 * - minOccurs: 0 @@ -51,7 +51,7 @@ class DiscountInfoType extends AbstractStructBase public $RedeemedOfferType; /** * The RedeemedOfferId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: (Optional)Offer ID. Character length and limits: 64 single-byte characters. * - maxOccurs: 1 * - minOccurs: 0 @@ -60,7 +60,7 @@ class DiscountInfoType extends AbstractStructBase public $RedeemedOfferId; /** * The PointsAccrued - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: (Optional)Loyalty points accrued. * - maxOccurs: 1 * - minOccurs: 0 @@ -109,7 +109,7 @@ public function setName($name = null) { // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); } $this->Name = $name; return $this; @@ -131,7 +131,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this; @@ -174,7 +174,7 @@ public function setRedeemedOfferType($redeemedOfferType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\RedeemedOfferType::valueIsValid($redeemedOfferType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $redeemedOfferType, implode(', ', \PayPal\EnumType\RedeemedOfferType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\RedeemedOfferType', is_array($redeemedOfferType) ? implode(', ', $redeemedOfferType) : var_export($redeemedOfferType, true), implode(', ', \PayPal\EnumType\RedeemedOfferType::getValidValues())), __LINE__); } $this->RedeemedOfferType = $redeemedOfferType; return $this; @@ -196,7 +196,7 @@ public function setRedeemedOfferId($redeemedOfferId = null) { // validation for constraint: string if (!is_null($redeemedOfferId) && !is_string($redeemedOfferId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($redeemedOfferId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redeemedOfferId, true), gettype($redeemedOfferId)), __LINE__); } $this->RedeemedOfferId = $redeemedOfferId; return $this; @@ -216,6 +216,10 @@ public function getPointsAccrued() */ public function setPointsAccrued($pointsAccrued = null) { + // validation for constraint: float + if (!is_null($pointsAccrued) && !(is_float($pointsAccrued) || is_numeric($pointsAccrued))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($pointsAccrued, true), gettype($pointsAccrued)), __LINE__); + } $this->PointsAccrued = $pointsAccrued; return $this; } diff --git a/src/StructType/DiscountType.php b/src/StructType/DiscountType.php index 3b2af7c..ac33aa7 100644 --- a/src/StructType/DiscountType.php +++ b/src/StructType/DiscountType.php @@ -6,7 +6,7 @@ /** * This class stands for DiscountType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Describes discount information * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class DiscountType extends AbstractStructBase { /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: amount discountedOptional * - maxOccurs: 1 * - minOccurs: 1 @@ -24,7 +24,7 @@ class DiscountType extends AbstractStructBase public $Amount; /** * The Name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item nameOptional Character length and limits: 127 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -33,7 +33,7 @@ class DiscountType extends AbstractStructBase public $Name; /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: description of the discountOptional Character length and limits: 127 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -42,7 +42,7 @@ class DiscountType extends AbstractStructBase public $Description; /** * The RedeemedOfferType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: offer typeOptional * - maxOccurs: 1 * - minOccurs: 0 @@ -51,7 +51,7 @@ class DiscountType extends AbstractStructBase public $RedeemedOfferType; /** * The RedeemedOfferID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: offer IDOptional Character length and limits: 64 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -115,7 +115,7 @@ public function setName($name = null) { // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); } $this->Name = $name; return $this; @@ -137,7 +137,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this; @@ -162,7 +162,7 @@ public function setRedeemedOfferType($redeemedOfferType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\RedeemedOfferType::valueIsValid($redeemedOfferType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $redeemedOfferType, implode(', ', \PayPal\EnumType\RedeemedOfferType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\RedeemedOfferType', is_array($redeemedOfferType) ? implode(', ', $redeemedOfferType) : var_export($redeemedOfferType, true), implode(', ', \PayPal\EnumType\RedeemedOfferType::getValidValues())), __LINE__); } $this->RedeemedOfferType = $redeemedOfferType; return $this; @@ -184,7 +184,7 @@ public function setRedeemedOfferID($redeemedOfferID = null) { // validation for constraint: string if (!is_null($redeemedOfferID) && !is_string($redeemedOfferID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($redeemedOfferID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redeemedOfferID, true), gettype($redeemedOfferID)), __LINE__); } $this->RedeemedOfferID = $redeemedOfferID; return $this; diff --git a/src/StructType/DisplayControlDetailsType.php b/src/StructType/DisplayControlDetailsType.php index f9cb396..e14d534 100644 --- a/src/StructType/DisplayControlDetailsType.php +++ b/src/StructType/DisplayControlDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for DisplayControlDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains elements that allows customization of display (user interface) elements. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class DisplayControlDetailsType extends AbstractStructBase { /** * The InContextPaymentButtonImage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Optional URL to pay button image for the inline checkout flow. Currently applicable only to the inline checkout flow when the FlowControlDetails/InlineReturnURL is present. * - maxOccurs: 1 * - minOccurs: 0 @@ -49,7 +49,7 @@ public function setInContextPaymentButtonImage($inContextPaymentButtonImage = nu { // validation for constraint: string if (!is_null($inContextPaymentButtonImage) && !is_string($inContextPaymentButtonImage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($inContextPaymentButtonImage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($inContextPaymentButtonImage, true), gettype($inContextPaymentButtonImage)), __LINE__); } $this->InContextPaymentButtonImage = $inContextPaymentButtonImage; return $this; diff --git a/src/StructType/DoAuthorizationReq.php b/src/StructType/DoAuthorizationReq.php index 7b4cd0a..db8faad 100644 --- a/src/StructType/DoAuthorizationReq.php +++ b/src/StructType/DoAuthorizationReq.php @@ -13,7 +13,7 @@ class DoAuthorizationReq extends AbstractStructBase { /** * The DoAuthorizationRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoAuthorizationRequest * @var \PayPal\StructType\DoAuthorizationRequestType */ diff --git a/src/StructType/DoAuthorizationRequestType.php b/src/StructType/DoAuthorizationRequestType.php index 7adfa11..c746394 100644 --- a/src/StructType/DoAuthorizationRequestType.php +++ b/src/StructType/DoAuthorizationRequestType.php @@ -6,8 +6,8 @@ /** * This class stands for DoAuthorizationRequestType StructType - * Meta informations extracted from the WSDL - * - documentation: Address the order will be shipped to. Optional | Information about the individual purchased items + * Meta information extracted from the WSDL + * - documentation: Information about the individual purchased items | Address the order will be shipped to. Optional * @subpackage Structs * @author WsdlToPhp */ @@ -15,7 +15,7 @@ class DoAuthorizationRequestType extends AbstractRequestType { /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value of the order’s transaction identification number returned by a PayPal product. Required Character length and limits: 19 single-byte characters maximum * - maxOccurs: 1 * - minOccurs: 1 @@ -24,7 +24,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $TransactionID; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount to authorize. Required Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - maxOccurs: 1 * - minOccurs: 1 @@ -33,7 +33,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $Amount; /** * The TransactionEntity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of transaction to authorize. The only allowable value is Order, which means that the transaction represents a customer order that can be fulfilled over 29 days. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -42,7 +42,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $TransactionEntity; /** * The ShipToAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:ShipToAddress @@ -51,7 +51,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $ShipToAddress; /** * The PaymentDetailsItem - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * - ref: ebl:PaymentDetailsItem @@ -60,7 +60,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $PaymentDetailsItem; /** * The ItemTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sum of cost of all items in this order. You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional Limitations: Must not exceed $10,000 USD in any currency. * No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - maxOccurs: 1 @@ -70,7 +70,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $ItemTotal; /** * The ShippingTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total shipping costs for this order. You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional Limitations: Must not exceed $10,000 USD in any currency. No * currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - maxOccurs: 1 @@ -80,7 +80,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $ShippingTotal; /** * The HandlingTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total handling costs for this order. You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional Limitations: Must not exceed $10,000 USD in any currency. No * currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - maxOccurs: 1 @@ -90,7 +90,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $HandlingTotal; /** * The TaxTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sum of tax for all items in this order. You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional Limitations: Must not exceed $10,000 USD in any currency. * No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - maxOccurs: 1 @@ -100,7 +100,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $TaxTotal; /** * The InsuranceTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total shipping insurance costs for this order. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -109,7 +109,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $InsuranceTotal; /** * The ShippingDiscount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Shipping discount for this order, specified as a negative number. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -118,7 +118,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $ShippingDiscount; /** * The OrderDescription - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Description of items the customer is purchasing. Optional Character length and limitations: 127 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -127,7 +127,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $OrderDescription; /** * The Custom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A free-form field for your own use. Optional Character length and limitations: 256 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -136,7 +136,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $Custom; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id for each API request to prevent duplicate payments. Optional Character length and limits: 38 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -145,7 +145,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $MsgSubID; /** * The IPAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IP Address of the buyer * - maxOccurs: 1 * - minOccurs: 0 @@ -154,7 +154,7 @@ class DoAuthorizationRequestType extends AbstractRequestType public $IPAddress; /** * The ShipToStore - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A flag indicating that this transaction is a Ship to Store transaction. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -233,7 +233,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -276,7 +276,7 @@ public function setTransactionEntity($transactionEntity = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\TransactionEntityType::valueIsValid($transactionEntity)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $transactionEntity, implode(', ', \PayPal\EnumType\TransactionEntityType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\TransactionEntityType', is_array($transactionEntity) ? implode(', ', $transactionEntity) : var_export($transactionEntity, true), implode(', ', \PayPal\EnumType\TransactionEntityType::getValidValues())), __LINE__); } $this->TransactionEntity = $transactionEntity; return $this; @@ -307,6 +307,28 @@ public function getPaymentDetailsItem() { return $this->PaymentDetailsItem; } + /** + * This method is responsible for validating the values passed to the setPaymentDetailsItem method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentDetailsItem method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentDetailsItemForArrayConstraintsFromSetPaymentDetailsItem(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $doAuthorizationRequestTypePaymentDetailsItemItem) { + // validation for constraint: itemType + if (!$doAuthorizationRequestTypePaymentDetailsItemItem instanceof \PayPal\StructType\PaymentDetailsItemType) { + $invalidValues[] = is_object($doAuthorizationRequestTypePaymentDetailsItemItem) ? get_class($doAuthorizationRequestTypePaymentDetailsItemItem) : sprintf('%s(%s)', gettype($doAuthorizationRequestTypePaymentDetailsItemItem), var_export($doAuthorizationRequestTypePaymentDetailsItemItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The PaymentDetailsItem property can only contain items of type \PayPal\StructType\PaymentDetailsItemType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentDetailsItem value * @throws \InvalidArgumentException @@ -315,11 +337,9 @@ public function getPaymentDetailsItem() */ public function setPaymentDetailsItem(array $paymentDetailsItem = array()) { - foreach ($paymentDetailsItem as $doAuthorizationRequestTypePaymentDetailsItemItem) { - // validation for constraint: itemType - if (!$doAuthorizationRequestTypePaymentDetailsItemItem instanceof \PayPal\StructType\PaymentDetailsItemType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetailsItem property can only contain items of \PayPal\StructType\PaymentDetailsItemType, "%s" given', is_object($doAuthorizationRequestTypePaymentDetailsItemItem) ? get_class($doAuthorizationRequestTypePaymentDetailsItemItem) : gettype($doAuthorizationRequestTypePaymentDetailsItemItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentDetailsItemArrayErrorMessage = self::validatePaymentDetailsItemForArrayConstraintsFromSetPaymentDetailsItem($paymentDetailsItem))) { + throw new \InvalidArgumentException($paymentDetailsItemArrayErrorMessage, __LINE__); } $this->PaymentDetailsItem = $paymentDetailsItem; return $this; @@ -334,7 +354,7 @@ public function addToPaymentDetailsItem(\PayPal\StructType\PaymentDetailsItemTyp { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentDetailsItemType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetailsItem property can only contain items of \PayPal\StructType\PaymentDetailsItemType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The PaymentDetailsItem property can only contain items of type \PayPal\StructType\PaymentDetailsItemType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->PaymentDetailsItem[] = $item; return $this; @@ -464,7 +484,7 @@ public function setOrderDescription($orderDescription = null) { // validation for constraint: string if (!is_null($orderDescription) && !is_string($orderDescription)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($orderDescription)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($orderDescription, true), gettype($orderDescription)), __LINE__); } $this->OrderDescription = $orderDescription; return $this; @@ -486,7 +506,7 @@ public function setCustom($custom = null) { // validation for constraint: string if (!is_null($custom) && !is_string($custom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($custom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); } $this->Custom = $custom; return $this; @@ -508,7 +528,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; @@ -530,7 +550,7 @@ public function setIPAddress($iPAddress = null) { // validation for constraint: string if (!is_null($iPAddress) && !is_string($iPAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($iPAddress)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($iPAddress, true), gettype($iPAddress)), __LINE__); } $this->IPAddress = $iPAddress; return $this; @@ -552,7 +572,7 @@ public function setShipToStore($shipToStore = null) { // validation for constraint: string if (!is_null($shipToStore) && !is_string($shipToStore)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shipToStore)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shipToStore, true), gettype($shipToStore)), __LINE__); } $this->ShipToStore = $shipToStore; return $this; diff --git a/src/StructType/DoAuthorizationResponseType.php b/src/StructType/DoAuthorizationResponseType.php index 63615da..2fce9f9 100644 --- a/src/StructType/DoAuthorizationResponseType.php +++ b/src/StructType/DoAuthorizationResponseType.php @@ -13,7 +13,7 @@ class DoAuthorizationResponseType extends AbstractResponseType { /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An authorization identification number. Character length and limits: 19 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class DoAuthorizationResponseType extends AbstractResponseType public $TransactionID; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The amount and currency you specified in the request. * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class DoAuthorizationResponseType extends AbstractResponseType public $Amount; /** * The AuthorizationInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:AuthorizationInfo @@ -40,7 +40,7 @@ class DoAuthorizationResponseType extends AbstractResponseType public $AuthorizationInfo; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Return msgsubid back to merchant * - maxOccurs: 1 * - minOccurs: 0 @@ -83,7 +83,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -141,7 +141,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/DoCancelReq.php b/src/StructType/DoCancelReq.php index bfcb2b0..a957ee8 100644 --- a/src/StructType/DoCancelReq.php +++ b/src/StructType/DoCancelReq.php @@ -13,7 +13,7 @@ class DoCancelReq extends AbstractStructBase { /** * The DoCancelRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoCancelRequest * @var \PayPal\StructType\DoCancelRequestType */ diff --git a/src/StructType/DoCancelRequestType.php b/src/StructType/DoCancelRequestType.php index a36edc8..864c7ef 100644 --- a/src/StructType/DoCancelRequestType.php +++ b/src/StructType/DoCancelRequestType.php @@ -13,7 +13,7 @@ class DoCancelRequestType extends AbstractRequestType { /** * The CancelMsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Msg Sub Id that was used for the orginal operation. * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class DoCancelRequestType extends AbstractRequestType public $CancelMsgSubID; /** * The APIType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Original API's type * - maxOccurs: 1 * - minOccurs: 1 @@ -31,7 +31,7 @@ class DoCancelRequestType extends AbstractRequestType public $APIType; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id for each API request to prevent duplicate payments. Optional Character length and limits: 38 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -71,7 +71,7 @@ public function setCancelMsgSubID($cancelMsgSubID = null) { // validation for constraint: string if (!is_null($cancelMsgSubID) && !is_string($cancelMsgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cancelMsgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cancelMsgSubID, true), gettype($cancelMsgSubID)), __LINE__); } $this->CancelMsgSubID = $cancelMsgSubID; return $this; @@ -96,7 +96,7 @@ public function setAPIType($aPIType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\APIType::valueIsValid($aPIType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $aPIType, implode(', ', \PayPal\EnumType\APIType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\APIType', is_array($aPIType) ? implode(', ', $aPIType) : var_export($aPIType, true), implode(', ', \PayPal\EnumType\APIType::getValidValues())), __LINE__); } $this->APIType = $aPIType; return $this; @@ -118,7 +118,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/DoCancelResponseType.php b/src/StructType/DoCancelResponseType.php index 5e04290..d117adc 100644 --- a/src/StructType/DoCancelResponseType.php +++ b/src/StructType/DoCancelResponseType.php @@ -13,7 +13,7 @@ class DoCancelResponseType extends AbstractResponseType { /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Return msgsubid back to merchant * - maxOccurs: 1 * - minOccurs: 0 @@ -47,7 +47,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/DoCaptureReq.php b/src/StructType/DoCaptureReq.php index 9e456ec..be75536 100644 --- a/src/StructType/DoCaptureReq.php +++ b/src/StructType/DoCaptureReq.php @@ -13,7 +13,7 @@ class DoCaptureReq extends AbstractStructBase { /** * The DoCaptureRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoCaptureRequest * @var \PayPal\StructType\DoCaptureRequestType */ diff --git a/src/StructType/DoCaptureRequestType.php b/src/StructType/DoCaptureRequestType.php index ee10050..ca0e6d1 100644 --- a/src/StructType/DoCaptureRequestType.php +++ b/src/StructType/DoCaptureRequestType.php @@ -6,8 +6,8 @@ /** * This class stands for DoCaptureRequestType StructType - * Meta informations extracted from the WSDL - * - documentation: Contains enhanced data like airline itinerary information. Not Required | To pass the Merchant store informationOptional | This holds key-value pair which merchants wants to pass it to the open wallet-PLCC processorOptional + * Meta information extracted from the WSDL + * - documentation: This holds key-value pair which merchants wants to pass it to the open wallet-PLCC processorOptional | To pass the Merchant store informationOptional | Contains enhanced data like airline itinerary information. Not Required * @subpackage Structs * @author WsdlToPhp */ @@ -15,8 +15,9 @@ class DoCaptureRequestType extends AbstractRequestType { /** * The AuthorizationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The authorization identification number of the payment you want to capture. Required Character length and limits: 19 single-byte characters maximum | AuthorizationId - Type for a PayPal Authorization ID. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -24,7 +25,7 @@ class DoCaptureRequestType extends AbstractRequestType public $AuthorizationID; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount to authorize. You must set the currencyID attribute to USD. Required Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a * comma (,) * - maxOccurs: 1 @@ -34,7 +35,7 @@ class DoCaptureRequestType extends AbstractRequestType public $Amount; /** * The CompleteType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates if this capture is the last capture you intend to make. The default is Complete. If CompleteType is Complete, any remaining amount of the original reauthorized transaction is automatically voided. Required Character length * and limits: 12 single-byte alphanumeric characters * - maxOccurs: 1 @@ -44,7 +45,7 @@ class DoCaptureRequestType extends AbstractRequestType public $CompleteType; /** * The Note - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An informational note about this settlement that is displayed to the payer in email and in transaction history. Optional Character length and limits: 255 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -53,7 +54,7 @@ class DoCaptureRequestType extends AbstractRequestType public $Note; /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Your invoice number or other identification number. The InvoiceID value is recorded only if the authorization you are capturing is an order authorization, not a basic authorization. Optional Character length and limits: 127 * single-byte alphanumeric characters * - maxOccurs: 1 @@ -63,7 +64,7 @@ class DoCaptureRequestType extends AbstractRequestType public $InvoiceID; /** * The EnhancedData - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:EnhancedData @@ -72,7 +73,7 @@ class DoCaptureRequestType extends AbstractRequestType public $EnhancedData; /** * The Descriptor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: dynamic descriptor Dynamic descriptor is used for merchant to provide detail of a transaction appears on statement Optional Character length and limits: <18 characters alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -81,7 +82,7 @@ class DoCaptureRequestType extends AbstractRequestType public $Descriptor; /** * The MerchantStoreDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:MerchantStoreDetails @@ -90,7 +91,7 @@ class DoCaptureRequestType extends AbstractRequestType public $MerchantStoreDetails; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id for each API request to prevent duplicate payments. Optional Character length and limits: 38 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -99,7 +100,7 @@ class DoCaptureRequestType extends AbstractRequestType public $MsgSubID; /** * The MerchantData - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:MerchantData @@ -160,7 +161,7 @@ public function setAuthorizationID($authorizationID = null) { // validation for constraint: string if (!is_null($authorizationID) && !is_string($authorizationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authorizationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authorizationID, true), gettype($authorizationID)), __LINE__); } $this->AuthorizationID = $authorizationID; return $this; @@ -203,7 +204,7 @@ public function setCompleteType($completeType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CompleteCodeType::valueIsValid($completeType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $completeType, implode(', ', \PayPal\EnumType\CompleteCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CompleteCodeType', is_array($completeType) ? implode(', ', $completeType) : var_export($completeType, true), implode(', ', \PayPal\EnumType\CompleteCodeType::getValidValues())), __LINE__); } $this->CompleteType = $completeType; return $this; @@ -225,7 +226,7 @@ public function setNote($note = null) { // validation for constraint: string if (!is_null($note) && !is_string($note)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($note)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); } $this->Note = $note; return $this; @@ -247,7 +248,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; @@ -287,7 +288,7 @@ public function setDescriptor($descriptor = null) { // validation for constraint: string if (!is_null($descriptor) && !is_string($descriptor)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($descriptor)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($descriptor, true), gettype($descriptor)), __LINE__); } $this->Descriptor = $descriptor; return $this; @@ -327,7 +328,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/DoCaptureResponseDetailsType.php b/src/StructType/DoCaptureResponseDetailsType.php index ef61082..5e4ca52 100644 --- a/src/StructType/DoCaptureResponseDetailsType.php +++ b/src/StructType/DoCaptureResponseDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for DoCaptureResponseDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The authorization identification number you specified in the request. Character length and limits: 19 single-byte characters maximum * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class DoCaptureResponseDetailsType extends AbstractStructBase { /** * The AuthorizationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:AuthorizationID * @var string @@ -23,14 +23,14 @@ class DoCaptureResponseDetailsType extends AbstractStructBase public $AuthorizationID; /** * The PaymentInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the transaction * @var \PayPal\StructType\PaymentInfoType */ public $PaymentInfo; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Return msgsubid back to merchant * - maxOccurs: 1 * - minOccurs: 0 @@ -39,7 +39,7 @@ class DoCaptureResponseDetailsType extends AbstractStructBase public $MsgSubID; /** * The PartnerFundingSourceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Partner funding source id corresponding to the FS used in authorization. * - maxOccurs: 1 * - minOccurs: 0 @@ -82,7 +82,7 @@ public function setAuthorizationID($authorizationID = null) { // validation for constraint: string if (!is_null($authorizationID) && !is_string($authorizationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authorizationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authorizationID, true), gettype($authorizationID)), __LINE__); } $this->AuthorizationID = $authorizationID; return $this; @@ -122,7 +122,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; @@ -144,7 +144,7 @@ public function setPartnerFundingSourceID($partnerFundingSourceID = null) { // validation for constraint: string if (!is_null($partnerFundingSourceID) && !is_string($partnerFundingSourceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($partnerFundingSourceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($partnerFundingSourceID, true), gettype($partnerFundingSourceID)), __LINE__); } $this->PartnerFundingSourceID = $partnerFundingSourceID; return $this; diff --git a/src/StructType/DoCaptureResponseType.php b/src/StructType/DoCaptureResponseType.php index 771842c..6db5a33 100644 --- a/src/StructType/DoCaptureResponseType.php +++ b/src/StructType/DoCaptureResponseType.php @@ -13,7 +13,7 @@ class DoCaptureResponseType extends AbstractResponseType { /** * The DoCaptureResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:DoCaptureResponseDetails diff --git a/src/StructType/DoDirectPaymentReq.php b/src/StructType/DoDirectPaymentReq.php index 6a9e14e..e1b8eb1 100644 --- a/src/StructType/DoDirectPaymentReq.php +++ b/src/StructType/DoDirectPaymentReq.php @@ -13,7 +13,7 @@ class DoDirectPaymentReq extends AbstractStructBase { /** * The DoDirectPaymentRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoDirectPaymentRequest * @var \PayPal\StructType\DoDirectPaymentRequestType */ diff --git a/src/StructType/DoDirectPaymentRequestDetailsType.php b/src/StructType/DoDirectPaymentRequestDetailsType.php index e514456..7f0d963 100644 --- a/src/StructType/DoDirectPaymentRequestDetailsType.php +++ b/src/StructType/DoDirectPaymentRequestDetailsType.php @@ -13,7 +13,7 @@ class DoDirectPaymentRequestDetailsType extends AbstractStructBase { /** * The PaymentAction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: How you want to obtain payment. Required Authorization indicates that this payment is a basic authorization subject to settlement with PayPal Authorization and Capture. Sale indicates that this is a final sale for which you are * requesting payment. NOTE: Order is not allowed for Direct Payment. Character length and limit: Up to 13 single-byte alphabetic characters * @var string @@ -21,21 +21,21 @@ class DoDirectPaymentRequestDetailsType extends AbstractStructBase public $PaymentAction; /** * The PaymentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the payment Required * @var \PayPal\StructType\PaymentDetailsType */ public $PaymentDetails; /** * The CreditCard - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the credit card to be charged. Required * @var \PayPal\StructType\CreditCardDetailsType */ public $CreditCard; /** * The IPAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IP address of the payer's browser as recorded in its HTTP request to your website. PayPal records this IP addresses as a means to detect possible fraud. Required Character length and limitations: 15 single-byte characters, including * periods, in dotted-quad format: ???.???.???.??? * @var string @@ -43,7 +43,7 @@ class DoDirectPaymentRequestDetailsType extends AbstractStructBase public $IPAddress; /** * The MerchantSessionId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Your customer session identification token. PayPal records this optional session identification token as an additional means to detect possible fraud. Optional Character length and limitations: 64 single-byte numeric characters * - minOccurs: 0 * @var string @@ -51,7 +51,7 @@ class DoDirectPaymentRequestDetailsType extends AbstractStructBase public $MerchantSessionId; /** * The ReturnFMFDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var bool @@ -59,7 +59,7 @@ class DoDirectPaymentRequestDetailsType extends AbstractStructBase public $ReturnFMFDetails; /** * The SoftDescriptor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Use this optional parameter to pass in your business name and other data describing the transaction. Optional This information is usually displayed in the account holder's statement. Example: RedCross Haiti, RedCross Uganda, * Realtor.com dues, Realtor.com list fee Length 25 characters. Alphanumeric characters and dash(-), dot(.), asterisk(*), space( ) On the customer's statement, an asterisk is used to separate the DBA name and product name. The asterisk delimiter can * appear in position 4, 8, or 13. @@ -70,7 +70,7 @@ class DoDirectPaymentRequestDetailsType extends AbstractStructBase public $SoftDescriptor; /** * The SoftDescriptorCity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Use this optional parameter to pass information about how consumer should contact the merchant. Optional This information is usually displayed in the account holder's statement. For Ecom trx: phone, email or URL is allowed For Retail * trx: only the actual city is allowed For details on allowed characters in Soft Descriptor City refer to the API documentation. * - maxOccurs: 1 @@ -129,7 +129,7 @@ public function setPaymentAction($paymentAction = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentActionCodeType::valueIsValid($paymentAction)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentAction, implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentActionCodeType', is_array($paymentAction) ? implode(', ', $paymentAction) : var_export($paymentAction, true), implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); } $this->PaymentAction = $paymentAction; return $this; @@ -187,7 +187,7 @@ public function setIPAddress($iPAddress = null) { // validation for constraint: string if (!is_null($iPAddress) && !is_string($iPAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($iPAddress)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($iPAddress, true), gettype($iPAddress)), __LINE__); } $this->IPAddress = $iPAddress; return $this; @@ -209,7 +209,7 @@ public function setMerchantSessionId($merchantSessionId = null) { // validation for constraint: string if (!is_null($merchantSessionId) && !is_string($merchantSessionId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($merchantSessionId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($merchantSessionId, true), gettype($merchantSessionId)), __LINE__); } $this->MerchantSessionId = $merchantSessionId; return $this; @@ -231,7 +231,7 @@ public function setReturnFMFDetails($returnFMFDetails = null) { // validation for constraint: boolean if (!is_null($returnFMFDetails) && !is_bool($returnFMFDetails)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($returnFMFDetails)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($returnFMFDetails, true), gettype($returnFMFDetails)), __LINE__); } $this->ReturnFMFDetails = $returnFMFDetails; return $this; @@ -253,7 +253,7 @@ public function setSoftDescriptor($softDescriptor = null) { // validation for constraint: string if (!is_null($softDescriptor) && !is_string($softDescriptor)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptor)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptor, true), gettype($softDescriptor)), __LINE__); } $this->SoftDescriptor = $softDescriptor; return $this; @@ -275,7 +275,7 @@ public function setSoftDescriptorCity($softDescriptorCity = null) { // validation for constraint: string if (!is_null($softDescriptorCity) && !is_string($softDescriptorCity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptorCity)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptorCity, true), gettype($softDescriptorCity)), __LINE__); } $this->SoftDescriptorCity = $softDescriptorCity; return $this; diff --git a/src/StructType/DoDirectPaymentRequestType.php b/src/StructType/DoDirectPaymentRequestType.php index 5674d68..3c2473f 100644 --- a/src/StructType/DoDirectPaymentRequestType.php +++ b/src/StructType/DoDirectPaymentRequestType.php @@ -13,7 +13,7 @@ class DoDirectPaymentRequestType extends AbstractRequestType { /** * The DoDirectPaymentRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:DoDirectPaymentRequestDetails @@ -22,7 +22,7 @@ class DoDirectPaymentRequestType extends AbstractRequestType public $DoDirectPaymentRequestDetails; /** * The ReturnFMFDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This flag indicates that the response should include FMFDetails * - maxOccurs: 1 * - minOccurs: 0 @@ -76,8 +76,8 @@ public function getReturnFMFDetails() public function setReturnFMFDetails($returnFMFDetails = null) { // validation for constraint: int - if (!is_null($returnFMFDetails) && !is_numeric($returnFMFDetails)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($returnFMFDetails)), __LINE__); + if (!is_null($returnFMFDetails) && !(is_int($returnFMFDetails) || ctype_digit($returnFMFDetails))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($returnFMFDetails, true), gettype($returnFMFDetails)), __LINE__); } $this->ReturnFMFDetails = $returnFMFDetails; return $this; diff --git a/src/StructType/DoDirectPaymentResponseType.php b/src/StructType/DoDirectPaymentResponseType.php index 8df92db..44382c6 100644 --- a/src/StructType/DoDirectPaymentResponseType.php +++ b/src/StructType/DoDirectPaymentResponseType.php @@ -13,7 +13,7 @@ class DoDirectPaymentResponseType extends AbstractResponseType { /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The amount of the payment as specified by you on DoDirectPaymentRequest. * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class DoDirectPaymentResponseType extends AbstractResponseType public $Amount; /** * The AVSCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Address Verification System response code. Character limit: One single-byte alphanumeric character AVS CodeMeaningMatched Details A AddressAddress only (no ZIP) B International “A”Address only (no ZIP) CInternational “N” None * DInternational “X” Address and Postal Code E Not allowed for MOTO (Internet/Phone) transactions Not applicable F UK-specific “X”Address and Postal Code G Global Unavailable Not applicable I International UnavailableNot applicable N NoNone * PPostal (International “Z”)Postal Code only (no Address) RRetryNot applicable S Service not Supported Not applicable U UnavailableNot applicable W Whole ZIPNine-digit ZIP code (no Address) X Exact match Address and nine-digit ZIP code Y @@ -34,7 +34,7 @@ class DoDirectPaymentResponseType extends AbstractResponseType public $AVSCode; /** * The CVV2Code - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Result of the CVV2 check by PayPal. CVV2 CodeMeaningMatched Details M MatchCVV2 N No match None P Not ProcessedNot applicable SService not SupportedNot applicable U UnavailableNot applicable XNo response Not applicable All others * ErrorNot applicable * - maxOccurs: 1 @@ -44,8 +44,9 @@ class DoDirectPaymentResponseType extends AbstractResponseType public $CVV2Code; /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Transaction identification number. Character length and limitations: 19 characters maximum. | TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -53,7 +54,7 @@ class DoDirectPaymentResponseType extends AbstractResponseType public $TransactionID; /** * The TransactionPendingReason - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: pending reason for IC+ interchange plus * - maxOccurs: 1 * - minOccurs: 0 @@ -62,7 +63,7 @@ class DoDirectPaymentResponseType extends AbstractResponseType public $TransactionPendingReason; /** * The PendingReason - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The reason why a particular transaction went in pending. * - minOccurs: 0 * @var string @@ -70,7 +71,7 @@ class DoDirectPaymentResponseType extends AbstractResponseType public $PendingReason; /** * The PaymentStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This will identify the actual transaction status. * - minOccurs: 0 * @var string @@ -78,7 +79,7 @@ class DoDirectPaymentResponseType extends AbstractResponseType public $PaymentStatus; /** * The FMFDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\FMFDetailsType @@ -86,7 +87,7 @@ class DoDirectPaymentResponseType extends AbstractResponseType public $FMFDetails; /** * The ThreeDSecureResponse - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\ThreeDSecureResponseType @@ -94,7 +95,7 @@ class DoDirectPaymentResponseType extends AbstractResponseType public $ThreeDSecureResponse; /** * The PaymentAdviceCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Response code from the processor when a recurring transaction is declined. * - maxOccurs: 1 * - minOccurs: 0 @@ -173,7 +174,7 @@ public function setAVSCode($aVSCode = null) { // validation for constraint: string if (!is_null($aVSCode) && !is_string($aVSCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($aVSCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($aVSCode, true), gettype($aVSCode)), __LINE__); } $this->AVSCode = $aVSCode; return $this; @@ -195,7 +196,7 @@ public function setCVV2Code($cVV2Code = null) { // validation for constraint: string if (!is_null($cVV2Code) && !is_string($cVV2Code)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cVV2Code)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cVV2Code, true), gettype($cVV2Code)), __LINE__); } $this->CVV2Code = $cVV2Code; return $this; @@ -217,7 +218,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -239,7 +240,7 @@ public function setTransactionPendingReason($transactionPendingReason = null) { // validation for constraint: string if (!is_null($transactionPendingReason) && !is_string($transactionPendingReason)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionPendingReason)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionPendingReason, true), gettype($transactionPendingReason)), __LINE__); } $this->TransactionPendingReason = $transactionPendingReason; return $this; @@ -264,7 +265,7 @@ public function setPendingReason($pendingReason = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PendingStatusCodeType::valueIsValid($pendingReason)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $pendingReason, implode(', ', \PayPal\EnumType\PendingStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PendingStatusCodeType', is_array($pendingReason) ? implode(', ', $pendingReason) : var_export($pendingReason, true), implode(', ', \PayPal\EnumType\PendingStatusCodeType::getValidValues())), __LINE__); } $this->PendingReason = $pendingReason; return $this; @@ -289,7 +290,7 @@ public function setPaymentStatus($paymentStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentStatusCodeType::valueIsValid($paymentStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentStatus, implode(', ', \PayPal\EnumType\PaymentStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentStatusCodeType', is_array($paymentStatus) ? implode(', ', $paymentStatus) : var_export($paymentStatus, true), implode(', ', \PayPal\EnumType\PaymentStatusCodeType::getValidValues())), __LINE__); } $this->PaymentStatus = $paymentStatus; return $this; @@ -347,7 +348,7 @@ public function setPaymentAdviceCode($paymentAdviceCode = null) { // validation for constraint: string if (!is_null($paymentAdviceCode) && !is_string($paymentAdviceCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentAdviceCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paymentAdviceCode, true), gettype($paymentAdviceCode)), __LINE__); } $this->PaymentAdviceCode = $paymentAdviceCode; return $this; diff --git a/src/StructType/DoExpressCheckoutPaymentReq.php b/src/StructType/DoExpressCheckoutPaymentReq.php index aea7ccd..82ce219 100644 --- a/src/StructType/DoExpressCheckoutPaymentReq.php +++ b/src/StructType/DoExpressCheckoutPaymentReq.php @@ -13,7 +13,7 @@ class DoExpressCheckoutPaymentReq extends AbstractStructBase { /** * The DoExpressCheckoutPaymentRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoExpressCheckoutPaymentRequest * @var \PayPal\StructType\DoExpressCheckoutPaymentRequestType */ diff --git a/src/StructType/DoExpressCheckoutPaymentRequestDetailsType.php b/src/StructType/DoExpressCheckoutPaymentRequestDetailsType.php index 7829306..577066e 100644 --- a/src/StructType/DoExpressCheckoutPaymentRequestDetailsType.php +++ b/src/StructType/DoExpressCheckoutPaymentRequestDetailsType.php @@ -13,7 +13,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase { /** * The PaymentAction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: How you want to obtain payment. Required Authorization indicates that this payment is a basic authorization subject to settlement with PayPal Authorization and Capture. Order indicates that this payment is is an order authorization * subject to settlement with PayPal Authorization and Capture. Sale indicates that this is a final sale for which you are requesting payment. IMPORTANT: You cannot set PaymentAction to Sale on SetExpressCheckoutRequest and then change PaymentAction to * Authorization on the final Express Checkout API, DoExpressCheckoutPaymentRequest. Character length and limit: Up to 13 single-byte alphabetic characters @@ -24,22 +24,24 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $PaymentAction; /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The timestamped token value that was returned by SetExpressCheckoutResponse and passed on GetExpressCheckoutDetailsRequest. Required Character length and limitations: 20 single-byte characters + * - base: xs:string * @var string */ public $Token; /** * The PayerID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Encrypted PayPal customer account identification number as returned by GetExpressCheckoutDetailsResponse. Required Character length and limitations: 127 single-byte characters. + * - base: xs:string * - maxLength: 127 * @var string */ public $PayerID; /** * The OrderURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL on Merchant site pertaining to this invoice. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -48,7 +50,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $OrderURL; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id for each API request to prevent duplicate payments on merchant side. Passed directly back to merchant in response. Optional Character length and limits: 38 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -57,7 +59,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $MsgSubID; /** * The PaymentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the payment Required * - maxOccurs: 10 * - minOccurs: 0 @@ -66,7 +68,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $PaymentDetails; /** * The PromoOverrideFlag - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Flag to indicate if previously set promoCode shall be overriden. Value 1 indicates overriding. * - maxOccurs: 1 * - minOccurs: 0 @@ -75,7 +77,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $PromoOverrideFlag; /** * The PromoCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Promotional financing code for item. Overrides any previous PromoCode setting. * - maxOccurs: 1 * - minOccurs: 0 @@ -84,7 +86,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $PromoCode; /** * The EnhancedData - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains data for enhanced data like Airline Itinerary Data. This tag became Obsolete on or after 62 version, use EnhancedPaymentData instead. * - maxOccurs: 1 * - minOccurs: 0 @@ -93,7 +95,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $EnhancedData; /** * The SoftDescriptor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Soft Descriptor supported for Sale and Auth in DEC only. For Order this will be ignored. * - minOccurs: 0 * @var string @@ -101,7 +103,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $SoftDescriptor; /** * The UserSelectedOptions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the user selected options. * - maxOccurs: 1 * - minOccurs: 0 @@ -110,7 +112,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $UserSelectedOptions; /** * The GiftMessage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift message. * - maxOccurs: 1 * - minOccurs: 0 @@ -119,7 +121,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $GiftMessage; /** * The GiftReceiptEnable - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift receipt enable. * - maxOccurs: 1 * - minOccurs: 0 @@ -128,7 +130,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $GiftReceiptEnable; /** * The GiftWrapName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift Wrap name. * - maxOccurs: 1 * - minOccurs: 0 @@ -137,7 +139,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $GiftWrapName; /** * The GiftWrapAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift Wrap amount. * - maxOccurs: 1 * - minOccurs: 0 @@ -146,7 +148,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $GiftWrapAmount; /** * The BuyerMarketingEmail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Buyer marketing email. * - maxOccurs: 1 * - minOccurs: 0 @@ -155,7 +157,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $BuyerMarketingEmail; /** * The SurveyQuestion - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the survey question. * - maxOccurs: 1 * - minOccurs: 0 @@ -164,7 +166,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $SurveyQuestion; /** * The SurveyChoiceSelected - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the survey choice selected by the user. * - maxOccurs: unbounded * - minOccurs: 0 @@ -173,7 +175,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $SurveyChoiceSelected; /** * The ButtonSource - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An identification code for use by third-party applications to identify transactions. Optional Character length and limitations: 32 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -181,7 +183,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $ButtonSource; /** * The SkipBACreation - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchant specified flag which indicates whether to create billing agreement as part of DoEC or not. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -190,7 +192,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $SkipBACreation; /** * The UseSessionPaymentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchant specified flag which indicates to use payment details from session if available. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -199,7 +201,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $UseSessionPaymentDetails; /** * The CoupledBuckets - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Optional element that defines relationship between buckets * - maxOccurs: 5 * - minOccurs: 0 @@ -208,7 +210,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $CoupledBuckets; /** * The ClientID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Optional element for the passing client id * - maxOccurs: 1 * - minOccurs: 0 @@ -217,7 +219,7 @@ class DoExpressCheckoutPaymentRequestDetailsType extends AbstractStructBase public $ClientID; /** * The ProductLine - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Optional element for the passing product lines * - maxOccurs: 1 * - minOccurs: 0 @@ -323,7 +325,7 @@ public function setPaymentAction($paymentAction = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentActionCodeType::valueIsValid($paymentAction)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentAction, implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentActionCodeType', is_array($paymentAction) ? implode(', ', $paymentAction) : var_export($paymentAction, true), implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); } $this->PaymentAction = $paymentAction; return $this; @@ -345,7 +347,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; @@ -365,13 +367,13 @@ public function getPayerID() */ public function setPayerID($payerID = null) { - // validation for constraint: maxLength - if ((is_scalar($payerID) && strlen($payerID) > 127) || (is_array($payerID) && count($payerID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($payerID) ? strlen($payerID) : count($payerID)), __LINE__); - } // validation for constraint: string if (!is_null($payerID) && !is_string($payerID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payerID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payerID, true), gettype($payerID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($payerID) && mb_strlen($payerID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($payerID)), __LINE__); } $this->PayerID = $payerID; return $this; @@ -393,7 +395,7 @@ public function setOrderURL($orderURL = null) { // validation for constraint: string if (!is_null($orderURL) && !is_string($orderURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($orderURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($orderURL, true), gettype($orderURL)), __LINE__); } $this->OrderURL = $orderURL; return $this; @@ -415,7 +417,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; @@ -428,6 +430,28 @@ public function getPaymentDetails() { return $this->PaymentDetails; } + /** + * This method is responsible for validating the values passed to the setPaymentDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentDetailsForArrayConstraintsFromSetPaymentDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem) { + // validation for constraint: itemType + if (!$doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem instanceof \PayPal\StructType\PaymentDetailsType) { + $invalidValues[] = is_object($doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem) ? get_class($doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem) : sprintf('%s(%s)', gettype($doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem), var_export($doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentDetails value * @throws \InvalidArgumentException @@ -436,11 +460,13 @@ public function getPaymentDetails() */ public function setPaymentDetails(array $paymentDetails = array()) { - foreach ($paymentDetails as $doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem) { - // validation for constraint: itemType - if (!$doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem instanceof \PayPal\StructType\PaymentDetailsType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetails property can only contain items of \PayPal\StructType\PaymentDetailsType, "%s" given', is_object($doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem) ? get_class($doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem) : gettype($doExpressCheckoutPaymentRequestDetailsTypePaymentDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentDetailsArrayErrorMessage = self::validatePaymentDetailsForArrayConstraintsFromSetPaymentDetails($paymentDetails))) { + throw new \InvalidArgumentException($paymentDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($paymentDetails) && count($paymentDetails) > 10) { + 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__); } $this->PaymentDetails = $paymentDetails; return $this; @@ -455,7 +481,11 @@ public function addToPaymentDetails(\PayPal\StructType\PaymentDetailsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentDetailsType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetails property can only contain items of \PayPal\StructType\PaymentDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->PaymentDetails) && count($this->PaymentDetails) >= 10) { + 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__); } $this->PaymentDetails[] = $item; return $this; @@ -477,7 +507,7 @@ public function setPromoOverrideFlag($promoOverrideFlag = null) { // validation for constraint: string if (!is_null($promoOverrideFlag) && !is_string($promoOverrideFlag)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($promoOverrideFlag)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($promoOverrideFlag, true), gettype($promoOverrideFlag)), __LINE__); } $this->PromoOverrideFlag = $promoOverrideFlag; return $this; @@ -499,7 +529,7 @@ public function setPromoCode($promoCode = null) { // validation for constraint: string if (!is_null($promoCode) && !is_string($promoCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($promoCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($promoCode, true), gettype($promoCode)), __LINE__); } $this->PromoCode = $promoCode; return $this; @@ -539,7 +569,7 @@ public function setSoftDescriptor($softDescriptor = null) { // validation for constraint: string if (!is_null($softDescriptor) && !is_string($softDescriptor)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptor)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptor, true), gettype($softDescriptor)), __LINE__); } $this->SoftDescriptor = $softDescriptor; return $this; @@ -579,7 +609,7 @@ public function setGiftMessage($giftMessage = null) { // validation for constraint: string if (!is_null($giftMessage) && !is_string($giftMessage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftMessage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftMessage, true), gettype($giftMessage)), __LINE__); } $this->GiftMessage = $giftMessage; return $this; @@ -601,7 +631,7 @@ public function setGiftReceiptEnable($giftReceiptEnable = null) { // validation for constraint: string if (!is_null($giftReceiptEnable) && !is_string($giftReceiptEnable)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftReceiptEnable)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftReceiptEnable, true), gettype($giftReceiptEnable)), __LINE__); } $this->GiftReceiptEnable = $giftReceiptEnable; return $this; @@ -623,7 +653,7 @@ public function setGiftWrapName($giftWrapName = null) { // validation for constraint: string if (!is_null($giftWrapName) && !is_string($giftWrapName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftWrapName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftWrapName, true), gettype($giftWrapName)), __LINE__); } $this->GiftWrapName = $giftWrapName; return $this; @@ -663,7 +693,7 @@ public function setBuyerMarketingEmail($buyerMarketingEmail = null) { // validation for constraint: string if (!is_null($buyerMarketingEmail) && !is_string($buyerMarketingEmail)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerMarketingEmail)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerMarketingEmail, true), gettype($buyerMarketingEmail)), __LINE__); } $this->BuyerMarketingEmail = $buyerMarketingEmail; return $this; @@ -685,7 +715,7 @@ public function setSurveyQuestion($surveyQuestion = null) { // validation for constraint: string if (!is_null($surveyQuestion) && !is_string($surveyQuestion)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($surveyQuestion)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($surveyQuestion, true), gettype($surveyQuestion)), __LINE__); } $this->SurveyQuestion = $surveyQuestion; return $this; @@ -698,6 +728,28 @@ public function getSurveyChoiceSelected() { return $this->SurveyChoiceSelected; } + /** + * This method is responsible for validating the values passed to the setSurveyChoiceSelected method + * This method is willingly generated in order to preserve the one-line inline validation within the setSurveyChoiceSelected method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateSurveyChoiceSelectedForArrayConstraintsFromSetSurveyChoiceSelected(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem) { + // validation for constraint: itemType + if (!is_string($doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem)) { + $invalidValues[] = is_object($doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem) ? get_class($doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem) : sprintf('%s(%s)', gettype($doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem), var_export($doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set SurveyChoiceSelected value * @throws \InvalidArgumentException @@ -706,11 +758,9 @@ public function getSurveyChoiceSelected() */ public function setSurveyChoiceSelected(array $surveyChoiceSelected = array()) { - foreach ($surveyChoiceSelected as $doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem) { - // validation for constraint: itemType - if (!is_string($doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem)) { - throw new \InvalidArgumentException(sprintf('The SurveyChoiceSelected property can only contain items of string, "%s" given', is_object($doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem) ? get_class($doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem) : gettype($doExpressCheckoutPaymentRequestDetailsTypeSurveyChoiceSelectedItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($surveyChoiceSelectedArrayErrorMessage = self::validateSurveyChoiceSelectedForArrayConstraintsFromSetSurveyChoiceSelected($surveyChoiceSelected))) { + throw new \InvalidArgumentException($surveyChoiceSelectedArrayErrorMessage, __LINE__); } $this->SurveyChoiceSelected = $surveyChoiceSelected; return $this; @@ -725,7 +775,7 @@ public function addToSurveyChoiceSelected($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The SurveyChoiceSelected property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); } $this->SurveyChoiceSelected[] = $item; return $this; @@ -747,7 +797,7 @@ public function setButtonSource($buttonSource = null) { // validation for constraint: string if (!is_null($buttonSource) && !is_string($buttonSource)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonSource)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonSource, true), gettype($buttonSource)), __LINE__); } $this->ButtonSource = $buttonSource; return $this; @@ -769,7 +819,7 @@ public function setSkipBACreation($skipBACreation = null) { // validation for constraint: boolean if (!is_null($skipBACreation) && !is_bool($skipBACreation)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($skipBACreation)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($skipBACreation, true), gettype($skipBACreation)), __LINE__); } $this->SkipBACreation = $skipBACreation; return $this; @@ -791,7 +841,7 @@ public function setUseSessionPaymentDetails($useSessionPaymentDetails = null) { // validation for constraint: string if (!is_null($useSessionPaymentDetails) && !is_string($useSessionPaymentDetails)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($useSessionPaymentDetails)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($useSessionPaymentDetails, true), gettype($useSessionPaymentDetails)), __LINE__); } $this->UseSessionPaymentDetails = $useSessionPaymentDetails; return $this; @@ -804,6 +854,28 @@ public function getCoupledBuckets() { return $this->CoupledBuckets; } + /** + * This method is responsible for validating the values passed to the setCoupledBuckets method + * This method is willingly generated in order to preserve the one-line inline validation within the setCoupledBuckets method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateCoupledBucketsForArrayConstraintsFromSetCoupledBuckets(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem) { + // validation for constraint: itemType + if (!$doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem instanceof \PayPal\StructType\CoupledBucketsType) { + $invalidValues[] = is_object($doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem) ? get_class($doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem) : sprintf('%s(%s)', gettype($doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem), var_export($doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The CoupledBuckets property can only contain items of type \PayPal\StructType\CoupledBucketsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set CoupledBuckets value * @throws \InvalidArgumentException @@ -812,11 +884,13 @@ public function getCoupledBuckets() */ public function setCoupledBuckets(array $coupledBuckets = array()) { - foreach ($coupledBuckets as $doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem) { - // validation for constraint: itemType - if (!$doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem instanceof \PayPal\StructType\CoupledBucketsType) { - throw new \InvalidArgumentException(sprintf('The CoupledBuckets property can only contain items of \PayPal\StructType\CoupledBucketsType, "%s" given', is_object($doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem) ? get_class($doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem) : gettype($doExpressCheckoutPaymentRequestDetailsTypeCoupledBucketsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($coupledBucketsArrayErrorMessage = self::validateCoupledBucketsForArrayConstraintsFromSetCoupledBuckets($coupledBuckets))) { + throw new \InvalidArgumentException($coupledBucketsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($coupledBuckets) && count($coupledBuckets) > 5) { + 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($coupledBuckets)), __LINE__); } $this->CoupledBuckets = $coupledBuckets; return $this; @@ -831,7 +905,11 @@ public function addToCoupledBuckets(\PayPal\StructType\CoupledBucketsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\CoupledBucketsType) { - throw new \InvalidArgumentException(sprintf('The CoupledBuckets property can only contain items of \PayPal\StructType\CoupledBucketsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The CoupledBuckets property can only contain items of type \PayPal\StructType\CoupledBucketsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($this->CoupledBuckets) && count($this->CoupledBuckets) >= 5) { + 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->CoupledBuckets)), __LINE__); } $this->CoupledBuckets[] = $item; return $this; @@ -853,7 +931,7 @@ public function setClientID($clientID = null) { // validation for constraint: string if (!is_null($clientID) && !is_string($clientID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($clientID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($clientID, true), gettype($clientID)), __LINE__); } $this->ClientID = $clientID; return $this; @@ -875,7 +953,7 @@ public function setProductLine($productLine = null) { // validation for constraint: string if (!is_null($productLine) && !is_string($productLine)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($productLine)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($productLine, true), gettype($productLine)), __LINE__); } $this->ProductLine = $productLine; return $this; diff --git a/src/StructType/DoExpressCheckoutPaymentRequestType.php b/src/StructType/DoExpressCheckoutPaymentRequestType.php index 6542eff..0a58bb4 100644 --- a/src/StructType/DoExpressCheckoutPaymentRequestType.php +++ b/src/StructType/DoExpressCheckoutPaymentRequestType.php @@ -13,7 +13,7 @@ class DoExpressCheckoutPaymentRequestType extends AbstractRequestType { /** * The DoExpressCheckoutPaymentRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:DoExpressCheckoutPaymentRequestDetails @@ -22,7 +22,7 @@ class DoExpressCheckoutPaymentRequestType extends AbstractRequestType public $DoExpressCheckoutPaymentRequestDetails; /** * The ReturnFMFDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This flag indicates that the response should include FMFDetails * - maxOccurs: 1 * - minOccurs: 0 @@ -76,8 +76,8 @@ public function getReturnFMFDetails() public function setReturnFMFDetails($returnFMFDetails = null) { // validation for constraint: int - if (!is_null($returnFMFDetails) && !is_numeric($returnFMFDetails)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($returnFMFDetails)), __LINE__); + if (!is_null($returnFMFDetails) && !(is_int($returnFMFDetails) || ctype_digit($returnFMFDetails))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($returnFMFDetails, true), gettype($returnFMFDetails)), __LINE__); } $this->ReturnFMFDetails = $returnFMFDetails; return $this; diff --git a/src/StructType/DoExpressCheckoutPaymentResponseDetailsType.php b/src/StructType/DoExpressCheckoutPaymentResponseDetailsType.php index 6cf95fc..85c8bb1 100644 --- a/src/StructType/DoExpressCheckoutPaymentResponseDetailsType.php +++ b/src/StructType/DoExpressCheckoutPaymentResponseDetailsType.php @@ -13,14 +13,15 @@ class DoExpressCheckoutPaymentResponseDetailsType extends AbstractStructBase { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The timestamped token value that was returned by SetExpressCheckoutResponse and passed on GetExpressCheckoutDetailsRequest. Character length and limitations:20 single-byte characters + * - base: xs:string * @var string */ public $Token; /** * The PaymentInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the transaction * - maxOccurs: 10 * - minOccurs: 0 @@ -29,7 +30,7 @@ class DoExpressCheckoutPaymentResponseDetailsType extends AbstractStructBase public $PaymentInfo; /** * The BillingAgreementID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -37,7 +38,7 @@ class DoExpressCheckoutPaymentResponseDetailsType extends AbstractStructBase public $BillingAgreementID; /** * The RedirectRequired - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -45,7 +46,7 @@ class DoExpressCheckoutPaymentResponseDetailsType extends AbstractStructBase public $RedirectRequired; /** * The Note - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Memo entered by sender in PayPal Review Page note field. Optional Character length and limitations: 255 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -54,7 +55,7 @@ class DoExpressCheckoutPaymentResponseDetailsType extends AbstractStructBase public $Note; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id passed in the DoEC call. * - maxOccurs: 1 * - minOccurs: 0 @@ -63,7 +64,7 @@ class DoExpressCheckoutPaymentResponseDetailsType extends AbstractStructBase public $MsgSubID; /** * The SuccessPageRedirectRequested - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Redirect back to PayPal, PayPal can host the success page. * - maxOccurs: 1 * - minOccurs: 0 @@ -72,7 +73,7 @@ class DoExpressCheckoutPaymentResponseDetailsType extends AbstractStructBase public $SuccessPageRedirectRequested; /** * The UserSelectedOptions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the user selected options. * - maxOccurs: 1 * - minOccurs: 0 @@ -81,7 +82,7 @@ class DoExpressCheckoutPaymentResponseDetailsType extends AbstractStructBase public $UserSelectedOptions; /** * The CoupledPaymentInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about Coupled Payment transactions. * - maxOccurs: 5 * - minOccurs: 0 @@ -139,7 +140,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; @@ -152,6 +153,28 @@ public function getPaymentInfo() { return $this->PaymentInfo; } + /** + * This method is responsible for validating the values passed to the setPaymentInfo method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentInfo method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentInfoForArrayConstraintsFromSetPaymentInfo(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem) { + // validation for constraint: itemType + if (!$doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem instanceof \PayPal\StructType\PaymentInfoType) { + $invalidValues[] = is_object($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem) ? get_class($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem) : sprintf('%s(%s)', gettype($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem), var_export($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentInfo value * @throws \InvalidArgumentException @@ -160,11 +183,13 @@ public function getPaymentInfo() */ public function setPaymentInfo(array $paymentInfo = array()) { - foreach ($paymentInfo as $doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem) { - // validation for constraint: itemType - if (!$doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem instanceof \PayPal\StructType\PaymentInfoType) { - throw new \InvalidArgumentException(sprintf('The PaymentInfo property can only contain items of \PayPal\StructType\PaymentInfoType, "%s" given', is_object($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem) ? get_class($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem) : gettype($doExpressCheckoutPaymentResponseDetailsTypePaymentInfoItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentInfoArrayErrorMessage = self::validatePaymentInfoForArrayConstraintsFromSetPaymentInfo($paymentInfo))) { + throw new \InvalidArgumentException($paymentInfoArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($paymentInfo) && count($paymentInfo) > 10) { + 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__); } $this->PaymentInfo = $paymentInfo; return $this; @@ -179,7 +204,11 @@ public function addToPaymentInfo(\PayPal\StructType\PaymentInfoType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentInfoType) { - throw new \InvalidArgumentException(sprintf('The PaymentInfo property can only contain items of \PayPal\StructType\PaymentInfoType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->PaymentInfo) && count($this->PaymentInfo) >= 10) { + 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__); } $this->PaymentInfo[] = $item; return $this; @@ -201,7 +230,7 @@ public function setBillingAgreementID($billingAgreementID = null) { // validation for constraint: string if (!is_null($billingAgreementID) && !is_string($billingAgreementID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingAgreementID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementID, true), gettype($billingAgreementID)), __LINE__); } $this->BillingAgreementID = $billingAgreementID; return $this; @@ -223,7 +252,7 @@ public function setRedirectRequired($redirectRequired = null) { // validation for constraint: string if (!is_null($redirectRequired) && !is_string($redirectRequired)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($redirectRequired)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redirectRequired, true), gettype($redirectRequired)), __LINE__); } $this->RedirectRequired = $redirectRequired; return $this; @@ -245,7 +274,7 @@ public function setNote($note = null) { // validation for constraint: string if (!is_null($note) && !is_string($note)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($note)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); } $this->Note = $note; return $this; @@ -267,7 +296,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; @@ -289,7 +318,7 @@ public function setSuccessPageRedirectRequested($successPageRedirectRequested = { // validation for constraint: string if (!is_null($successPageRedirectRequested) && !is_string($successPageRedirectRequested)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($successPageRedirectRequested)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($successPageRedirectRequested, true), gettype($successPageRedirectRequested)), __LINE__); } $this->SuccessPageRedirectRequested = $successPageRedirectRequested; return $this; @@ -320,6 +349,28 @@ public function getCoupledPaymentInfo() { return $this->CoupledPaymentInfo; } + /** + * This method is responsible for validating the values passed to the setCoupledPaymentInfo method + * This method is willingly generated in order to preserve the one-line inline validation within the setCoupledPaymentInfo method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateCoupledPaymentInfoForArrayConstraintsFromSetCoupledPaymentInfo(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem) { + // validation for constraint: itemType + if (!$doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem instanceof \PayPal\StructType\CoupledPaymentInfoType) { + $invalidValues[] = is_object($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem) ? get_class($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem) : sprintf('%s(%s)', gettype($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem), var_export($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set CoupledPaymentInfo value * @throws \InvalidArgumentException @@ -328,11 +379,13 @@ public function getCoupledPaymentInfo() */ public function setCoupledPaymentInfo(array $coupledPaymentInfo = array()) { - foreach ($coupledPaymentInfo as $doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem) { - // validation for constraint: itemType - if (!$doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem instanceof \PayPal\StructType\CoupledPaymentInfoType) { - throw new \InvalidArgumentException(sprintf('The CoupledPaymentInfo property can only contain items of \PayPal\StructType\CoupledPaymentInfoType, "%s" given', is_object($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem) ? get_class($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem) : gettype($doExpressCheckoutPaymentResponseDetailsTypeCoupledPaymentInfoItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($coupledPaymentInfoArrayErrorMessage = self::validateCoupledPaymentInfoForArrayConstraintsFromSetCoupledPaymentInfo($coupledPaymentInfo))) { + throw new \InvalidArgumentException($coupledPaymentInfoArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($coupledPaymentInfo) && count($coupledPaymentInfo) > 5) { + 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__); } $this->CoupledPaymentInfo = $coupledPaymentInfo; return $this; @@ -347,7 +400,11 @@ public function addToCoupledPaymentInfo(\PayPal\StructType\CoupledPaymentInfoTyp { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\CoupledPaymentInfoType) { - throw new \InvalidArgumentException(sprintf('The CoupledPaymentInfo property can only contain items of \PayPal\StructType\CoupledPaymentInfoType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); + } + // validation for constraint: maxOccurs(5) + if (is_array($this->CoupledPaymentInfo) && count($this->CoupledPaymentInfo) >= 5) { + 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__); } $this->CoupledPaymentInfo[] = $item; return $this; diff --git a/src/StructType/DoExpressCheckoutPaymentResponseType.php b/src/StructType/DoExpressCheckoutPaymentResponseType.php index 781ea51..8654e3a 100644 --- a/src/StructType/DoExpressCheckoutPaymentResponseType.php +++ b/src/StructType/DoExpressCheckoutPaymentResponseType.php @@ -13,7 +13,7 @@ class DoExpressCheckoutPaymentResponseType extends AbstractResponseType { /** * The DoExpressCheckoutPaymentResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:DoExpressCheckoutPaymentResponseDetails @@ -22,7 +22,7 @@ class DoExpressCheckoutPaymentResponseType extends AbstractResponseType public $DoExpressCheckoutPaymentResponseDetails; /** * The FMFDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\FMFDetailsType diff --git a/src/StructType/DoMobileCheckoutPaymentReq.php b/src/StructType/DoMobileCheckoutPaymentReq.php index dceaa99..de24611 100644 --- a/src/StructType/DoMobileCheckoutPaymentReq.php +++ b/src/StructType/DoMobileCheckoutPaymentReq.php @@ -13,7 +13,7 @@ class DoMobileCheckoutPaymentReq extends AbstractStructBase { /** * The DoMobileCheckoutPaymentRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoMobileCheckoutPaymentRequest * @var \PayPal\StructType\DoMobileCheckoutPaymentRequestType */ diff --git a/src/StructType/DoMobileCheckoutPaymentRequestType.php b/src/StructType/DoMobileCheckoutPaymentRequestType.php index 2611b8e..617e97f 100644 --- a/src/StructType/DoMobileCheckoutPaymentRequestType.php +++ b/src/StructType/DoMobileCheckoutPaymentRequestType.php @@ -13,7 +13,7 @@ class DoMobileCheckoutPaymentRequestType extends AbstractRequestType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A timestamped token, the value of which was returned by SetMobileCheckoutResponse. RequiredCharacter length and limitations: 20 single-byte characters * - maxOccurs: 1 * - minOccurs: 1 @@ -47,7 +47,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/DoMobileCheckoutPaymentResponseDetailsType.php b/src/StructType/DoMobileCheckoutPaymentResponseDetailsType.php index 85d30a2..a778b7b 100644 --- a/src/StructType/DoMobileCheckoutPaymentResponseDetailsType.php +++ b/src/StructType/DoMobileCheckoutPaymentResponseDetailsType.php @@ -13,7 +13,7 @@ class DoMobileCheckoutPaymentResponseDetailsType extends AbstractStructBase { /** * The Custom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A free-form field for your own use, such as a tracking number or other value you want returned to you in IPN. Optional Character length and limitations: 256 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class DoMobileCheckoutPaymentResponseDetailsType extends AbstractStructBase public $Custom; /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Your own unique invoice or tracking number. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -29,14 +29,14 @@ class DoMobileCheckoutPaymentResponseDetailsType extends AbstractStructBase public $InvoiceID; /** * The PayerInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the payer * @var \PayPal\StructType\PayerInfoType */ public $PayerInfo; /** * The PaymentInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the transaction * @var \PayPal\StructType\PaymentInfoType */ @@ -77,7 +77,7 @@ public function setCustom($custom = null) { // validation for constraint: string if (!is_null($custom) && !is_string($custom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($custom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); } $this->Custom = $custom; return $this; @@ -99,7 +99,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; diff --git a/src/StructType/DoMobileCheckoutPaymentResponseType.php b/src/StructType/DoMobileCheckoutPaymentResponseType.php index 9cc1d70..a03da10 100644 --- a/src/StructType/DoMobileCheckoutPaymentResponseType.php +++ b/src/StructType/DoMobileCheckoutPaymentResponseType.php @@ -13,7 +13,7 @@ class DoMobileCheckoutPaymentResponseType extends AbstractResponseType { /** * The DoMobileCheckoutPaymentResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:DoMobileCheckoutPaymentResponseDetails diff --git a/src/StructType/DoNonReferencedCreditReq.php b/src/StructType/DoNonReferencedCreditReq.php index 4ddf650..b9177ab 100644 --- a/src/StructType/DoNonReferencedCreditReq.php +++ b/src/StructType/DoNonReferencedCreditReq.php @@ -13,7 +13,7 @@ class DoNonReferencedCreditReq extends AbstractStructBase { /** * The DoNonReferencedCreditRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoNonReferencedCreditRequest * @var \PayPal\StructType\DoNonReferencedCreditRequestType */ diff --git a/src/StructType/DoNonReferencedCreditRequestDetailsType.php b/src/StructType/DoNonReferencedCreditRequestDetailsType.php index ae71092..bf10c7a 100644 --- a/src/StructType/DoNonReferencedCreditRequestDetailsType.php +++ b/src/StructType/DoNonReferencedCreditRequestDetailsType.php @@ -18,21 +18,21 @@ class DoNonReferencedCreditRequestDetailsType extends AbstractStructBase public $Amount; /** * The NetAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $NetAmount; /** * The TaxAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $TaxAmount; /** * The ShippingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ @@ -44,14 +44,14 @@ class DoNonReferencedCreditRequestDetailsType extends AbstractStructBase public $CreditCard; /** * The ReceiverEmail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ReceiverEmail; /** * The Comment - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -191,7 +191,7 @@ public function setReceiverEmail($receiverEmail = null) { // validation for constraint: string if (!is_null($receiverEmail) && !is_string($receiverEmail)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiverEmail)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiverEmail, true), gettype($receiverEmail)), __LINE__); } $this->ReceiverEmail = $receiverEmail; return $this; @@ -213,7 +213,7 @@ public function setComment($comment = null) { // validation for constraint: string if (!is_null($comment) && !is_string($comment)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($comment)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($comment, true), gettype($comment)), __LINE__); } $this->Comment = $comment; return $this; diff --git a/src/StructType/DoNonReferencedCreditRequestType.php b/src/StructType/DoNonReferencedCreditRequestType.php index 7b5e5c6..1fee23d 100644 --- a/src/StructType/DoNonReferencedCreditRequestType.php +++ b/src/StructType/DoNonReferencedCreditRequestType.php @@ -13,7 +13,7 @@ class DoNonReferencedCreditRequestType extends AbstractRequestType { /** * The DoNonReferencedCreditRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:DoNonReferencedCreditRequestDetails diff --git a/src/StructType/DoNonReferencedCreditResponseDetailsType.php b/src/StructType/DoNonReferencedCreditResponseDetailsType.php index 0350200..e006427 100644 --- a/src/StructType/DoNonReferencedCreditResponseDetailsType.php +++ b/src/StructType/DoNonReferencedCreditResponseDetailsType.php @@ -18,8 +18,9 @@ class DoNonReferencedCreditResponseDetailsType extends AbstractStructBase public $Amount; /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * @var string */ public $TransactionID; @@ -71,7 +72,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; diff --git a/src/StructType/DoNonReferencedCreditResponseType.php b/src/StructType/DoNonReferencedCreditResponseType.php index 77caf4b..1bb0771 100644 --- a/src/StructType/DoNonReferencedCreditResponseType.php +++ b/src/StructType/DoNonReferencedCreditResponseType.php @@ -13,7 +13,7 @@ class DoNonReferencedCreditResponseType extends AbstractResponseType { /** * The DoNonReferencedCreditResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:DoNonReferencedCreditResponseDetails diff --git a/src/StructType/DoReauthorizationReq.php b/src/StructType/DoReauthorizationReq.php index 71c299e..b9ff15f 100644 --- a/src/StructType/DoReauthorizationReq.php +++ b/src/StructType/DoReauthorizationReq.php @@ -13,7 +13,7 @@ class DoReauthorizationReq extends AbstractStructBase { /** * The DoReauthorizationRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoReauthorizationRequest * @var \PayPal\StructType\DoReauthorizationRequestType */ diff --git a/src/StructType/DoReauthorizationRequestType.php b/src/StructType/DoReauthorizationRequestType.php index 6f8c08d..6cedc74 100644 --- a/src/StructType/DoReauthorizationRequestType.php +++ b/src/StructType/DoReauthorizationRequestType.php @@ -13,7 +13,7 @@ class DoReauthorizationRequestType extends AbstractRequestType { /** * The AuthorizationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value of a previously authorized transaction identification number returned by a PayPal product. You can obtain a buyer's transaction number from the TransactionID element of the PayerInfo structure returned by * GetTransactionDetailsResponse. Required Character length and limits: 19 single-byte characters maximum * - maxOccurs: 1 @@ -23,7 +23,7 @@ class DoReauthorizationRequestType extends AbstractRequestType public $AuthorizationID; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount to reauthorize. Required Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - maxOccurs: 1 * - minOccurs: 1 @@ -32,7 +32,7 @@ class DoReauthorizationRequestType extends AbstractRequestType public $Amount; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id for each API request to prevent duplicate payments. Optional Character length and limits: 38 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -72,7 +72,7 @@ public function setAuthorizationID($authorizationID = null) { // validation for constraint: string if (!is_null($authorizationID) && !is_string($authorizationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authorizationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authorizationID, true), gettype($authorizationID)), __LINE__); } $this->AuthorizationID = $authorizationID; return $this; @@ -112,7 +112,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/DoReauthorizationResponseType.php b/src/StructType/DoReauthorizationResponseType.php index fc913b9..1a93a58 100644 --- a/src/StructType/DoReauthorizationResponseType.php +++ b/src/StructType/DoReauthorizationResponseType.php @@ -13,7 +13,7 @@ class DoReauthorizationResponseType extends AbstractResponseType { /** * The AuthorizationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A new authorization identification number. Character length and limits: 19 single-byte characters * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class DoReauthorizationResponseType extends AbstractResponseType public $AuthorizationID; /** * The AuthorizationInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:AuthorizationInfo @@ -31,7 +31,7 @@ class DoReauthorizationResponseType extends AbstractResponseType public $AuthorizationInfo; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Return msgsubid back to merchant * - maxOccurs: 1 * - minOccurs: 0 @@ -71,7 +71,7 @@ public function setAuthorizationID($authorizationID = null) { // validation for constraint: string if (!is_null($authorizationID) && !is_string($authorizationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authorizationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authorizationID, true), gettype($authorizationID)), __LINE__); } $this->AuthorizationID = $authorizationID; return $this; @@ -111,7 +111,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/DoReferenceTransactionReq.php b/src/StructType/DoReferenceTransactionReq.php index 6eb2acb..14d32b6 100644 --- a/src/StructType/DoReferenceTransactionReq.php +++ b/src/StructType/DoReferenceTransactionReq.php @@ -13,7 +13,7 @@ class DoReferenceTransactionReq extends AbstractStructBase { /** * The DoReferenceTransactionRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoReferenceTransactionRequest * @var \PayPal\StructType\DoReferenceTransactionRequestType */ diff --git a/src/StructType/DoReferenceTransactionRequestDetailsType.php b/src/StructType/DoReferenceTransactionRequestDetailsType.php index 5c55f67..73efb55 100644 --- a/src/StructType/DoReferenceTransactionRequestDetailsType.php +++ b/src/StructType/DoReferenceTransactionRequestDetailsType.php @@ -13,7 +13,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase { /** * The ReferenceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $ReferenceID; /** * The PaymentAction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -29,7 +29,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $PaymentAction; /** * The PaymentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var \PayPal\StructType\PaymentDetailsType @@ -37,7 +37,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $PaymentDetails; /** * The PaymentType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -45,7 +45,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $PaymentType; /** * The CreditCard - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\ReferenceCreditCardDetailsType @@ -53,7 +53,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $CreditCard; /** * The IPAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -61,7 +61,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $IPAddress; /** * The RiskSessionCorrelationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Correlation id related to risk process done for the device. Max length is 36 Chars. * - maxOccurs: 1 * - minOccurs: 0 @@ -70,7 +70,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $RiskSessionCorrelationID; /** * The MerchantSessionId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -78,7 +78,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $MerchantSessionId; /** * The ReqConfirmShipping - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -86,7 +86,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $ReqConfirmShipping; /** * The SoftDescriptor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -94,7 +94,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $SoftDescriptor; /** * The SoftDescriptorCity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -102,7 +102,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $SoftDescriptorCity; /** * The SenderDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\SenderDetailsType @@ -110,7 +110,7 @@ class DoReferenceTransactionRequestDetailsType extends AbstractStructBase public $SenderDetails; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id for each API request to prevent duplicate payments. Optional Character length and limits: 38 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -180,7 +180,7 @@ public function setReferenceID($referenceID = null) { // validation for constraint: string if (!is_null($referenceID) && !is_string($referenceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($referenceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($referenceID, true), gettype($referenceID)), __LINE__); } $this->ReferenceID = $referenceID; return $this; @@ -205,7 +205,7 @@ public function setPaymentAction($paymentAction = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentActionCodeType::valueIsValid($paymentAction)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentAction, implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentActionCodeType', is_array($paymentAction) ? implode(', ', $paymentAction) : var_export($paymentAction, true), implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); } $this->PaymentAction = $paymentAction; return $this; @@ -248,7 +248,7 @@ public function setPaymentType($paymentType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MerchantPullPaymentCodeType::valueIsValid($paymentType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentType, implode(', ', \PayPal\EnumType\MerchantPullPaymentCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MerchantPullPaymentCodeType', is_array($paymentType) ? implode(', ', $paymentType) : var_export($paymentType, true), implode(', ', \PayPal\EnumType\MerchantPullPaymentCodeType::getValidValues())), __LINE__); } $this->PaymentType = $paymentType; return $this; @@ -288,7 +288,7 @@ public function setIPAddress($iPAddress = null) { // validation for constraint: string if (!is_null($iPAddress) && !is_string($iPAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($iPAddress)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($iPAddress, true), gettype($iPAddress)), __LINE__); } $this->IPAddress = $iPAddress; return $this; @@ -310,7 +310,7 @@ public function setRiskSessionCorrelationID($riskSessionCorrelationID = null) { // validation for constraint: string if (!is_null($riskSessionCorrelationID) && !is_string($riskSessionCorrelationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($riskSessionCorrelationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($riskSessionCorrelationID, true), gettype($riskSessionCorrelationID)), __LINE__); } $this->RiskSessionCorrelationID = $riskSessionCorrelationID; return $this; @@ -332,7 +332,7 @@ public function setMerchantSessionId($merchantSessionId = null) { // validation for constraint: string if (!is_null($merchantSessionId) && !is_string($merchantSessionId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($merchantSessionId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($merchantSessionId, true), gettype($merchantSessionId)), __LINE__); } $this->MerchantSessionId = $merchantSessionId; return $this; @@ -354,7 +354,7 @@ public function setReqConfirmShipping($reqConfirmShipping = null) { // validation for constraint: string if (!is_null($reqConfirmShipping) && !is_string($reqConfirmShipping)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reqConfirmShipping)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reqConfirmShipping, true), gettype($reqConfirmShipping)), __LINE__); } $this->ReqConfirmShipping = $reqConfirmShipping; return $this; @@ -376,7 +376,7 @@ public function setSoftDescriptor($softDescriptor = null) { // validation for constraint: string if (!is_null($softDescriptor) && !is_string($softDescriptor)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptor)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptor, true), gettype($softDescriptor)), __LINE__); } $this->SoftDescriptor = $softDescriptor; return $this; @@ -398,7 +398,7 @@ public function setSoftDescriptorCity($softDescriptorCity = null) { // validation for constraint: string if (!is_null($softDescriptorCity) && !is_string($softDescriptorCity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptorCity)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptorCity, true), gettype($softDescriptorCity)), __LINE__); } $this->SoftDescriptorCity = $softDescriptorCity; return $this; @@ -438,7 +438,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/DoReferenceTransactionRequestType.php b/src/StructType/DoReferenceTransactionRequestType.php index 77faeb5..8ca0207 100644 --- a/src/StructType/DoReferenceTransactionRequestType.php +++ b/src/StructType/DoReferenceTransactionRequestType.php @@ -13,7 +13,7 @@ class DoReferenceTransactionRequestType extends AbstractRequestType { /** * The DoReferenceTransactionRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:DoReferenceTransactionRequestDetails @@ -22,7 +22,7 @@ class DoReferenceTransactionRequestType extends AbstractRequestType public $DoReferenceTransactionRequestDetails; /** * The ReturnFMFDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This flag indicates that the response should include FMFDetails * - maxOccurs: 1 * - minOccurs: 0 @@ -76,8 +76,8 @@ public function getReturnFMFDetails() public function setReturnFMFDetails($returnFMFDetails = null) { // validation for constraint: int - if (!is_null($returnFMFDetails) && !is_numeric($returnFMFDetails)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($returnFMFDetails)), __LINE__); + if (!is_null($returnFMFDetails) && !(is_int($returnFMFDetails) || ctype_digit($returnFMFDetails))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($returnFMFDetails, true), gettype($returnFMFDetails)), __LINE__); } $this->ReturnFMFDetails = $returnFMFDetails; return $this; diff --git a/src/StructType/DoReferenceTransactionResponseDetailsType.php b/src/StructType/DoReferenceTransactionResponseDetailsType.php index 608692c..8694e52 100644 --- a/src/StructType/DoReferenceTransactionResponseDetailsType.php +++ b/src/StructType/DoReferenceTransactionResponseDetailsType.php @@ -13,7 +13,7 @@ class DoReferenceTransactionResponseDetailsType extends AbstractStructBase { /** * The BillingAgreementID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class DoReferenceTransactionResponseDetailsType extends AbstractStructBase public $BillingAgreementID; /** * The PaymentInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\PaymentInfoType @@ -29,7 +29,7 @@ class DoReferenceTransactionResponseDetailsType extends AbstractStructBase public $PaymentInfo; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -37,7 +37,7 @@ class DoReferenceTransactionResponseDetailsType extends AbstractStructBase public $Amount; /** * The AVSCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -45,7 +45,7 @@ class DoReferenceTransactionResponseDetailsType extends AbstractStructBase public $AVSCode; /** * The CVV2Code - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -53,16 +53,17 @@ class DoReferenceTransactionResponseDetailsType extends AbstractStructBase public $CVV2Code; /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - documentation: TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 - * - documentation: TransactionId - Type for a PayPal Transaction ID. * @var string */ public $TransactionID; /** * The PaymentAdviceCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Response code from the processor when a recurring transaction is declined * - maxOccurs: 1 * - minOccurs: 0 @@ -71,7 +72,7 @@ class DoReferenceTransactionResponseDetailsType extends AbstractStructBase public $PaymentAdviceCode; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Return msgsubid back to merchant * - maxOccurs: 1 * - minOccurs: 0 @@ -80,7 +81,7 @@ class DoReferenceTransactionResponseDetailsType extends AbstractStructBase public $MsgSubID; /** * The PendingReason - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: pending reason for IC+ interchange plus * - maxOccurs: 1 * - minOccurs: 0 @@ -138,7 +139,7 @@ public function setBillingAgreementID($billingAgreementID = null) { // validation for constraint: string if (!is_null($billingAgreementID) && !is_string($billingAgreementID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingAgreementID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingAgreementID, true), gettype($billingAgreementID)), __LINE__); } $this->BillingAgreementID = $billingAgreementID; return $this; @@ -196,7 +197,7 @@ public function setAVSCode($aVSCode = null) { // validation for constraint: string if (!is_null($aVSCode) && !is_string($aVSCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($aVSCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($aVSCode, true), gettype($aVSCode)), __LINE__); } $this->AVSCode = $aVSCode; return $this; @@ -218,7 +219,7 @@ public function setCVV2Code($cVV2Code = null) { // validation for constraint: string if (!is_null($cVV2Code) && !is_string($cVV2Code)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cVV2Code)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cVV2Code, true), gettype($cVV2Code)), __LINE__); } $this->CVV2Code = $cVV2Code; return $this; @@ -240,7 +241,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -262,7 +263,7 @@ public function setPaymentAdviceCode($paymentAdviceCode = null) { // validation for constraint: string if (!is_null($paymentAdviceCode) && !is_string($paymentAdviceCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentAdviceCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paymentAdviceCode, true), gettype($paymentAdviceCode)), __LINE__); } $this->PaymentAdviceCode = $paymentAdviceCode; return $this; @@ -284,7 +285,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; @@ -306,7 +307,7 @@ public function setPendingReason($pendingReason = null) { // validation for constraint: string if (!is_null($pendingReason) && !is_string($pendingReason)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pendingReason)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pendingReason, true), gettype($pendingReason)), __LINE__); } $this->PendingReason = $pendingReason; return $this; diff --git a/src/StructType/DoReferenceTransactionResponseType.php b/src/StructType/DoReferenceTransactionResponseType.php index c324029..d2b6aff 100644 --- a/src/StructType/DoReferenceTransactionResponseType.php +++ b/src/StructType/DoReferenceTransactionResponseType.php @@ -13,7 +13,7 @@ class DoReferenceTransactionResponseType extends AbstractResponseType { /** * The DoReferenceTransactionResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:DoReferenceTransactionResponseDetails @@ -22,7 +22,7 @@ class DoReferenceTransactionResponseType extends AbstractResponseType public $DoReferenceTransactionResponseDetails; /** * The FMFDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\FMFDetailsType diff --git a/src/StructType/DoUATPAuthorizationReq.php b/src/StructType/DoUATPAuthorizationReq.php index d94b69e..17e3d3c 100644 --- a/src/StructType/DoUATPAuthorizationReq.php +++ b/src/StructType/DoUATPAuthorizationReq.php @@ -13,7 +13,7 @@ class DoUATPAuthorizationReq extends AbstractStructBase { /** * The DoUATPAuthorizationRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoUATPAuthorizationRequest * @var \PayPal\StructType\DoUATPAuthorizationRequestType */ diff --git a/src/StructType/DoUATPAuthorizationRequestType.php b/src/StructType/DoUATPAuthorizationRequestType.php index 5bf80ad..490173d 100644 --- a/src/StructType/DoUATPAuthorizationRequestType.php +++ b/src/StructType/DoUATPAuthorizationRequestType.php @@ -6,7 +6,7 @@ /** * This class stands for DoUATPAuthorizationRequestType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: UATP card details Required * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class DoUATPAuthorizationRequestType extends AbstractRequestType { /** * The UATPDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:UATPDetails @@ -24,7 +24,7 @@ class DoUATPAuthorizationRequestType extends AbstractRequestType public $UATPDetails; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount to authorize. Required Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - maxOccurs: 1 * - minOccurs: 1 @@ -33,7 +33,7 @@ class DoUATPAuthorizationRequestType extends AbstractRequestType public $Amount; /** * The TransactionEntity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of transaction to authorize. The only allowable value is Order, which means that the transaction represents a customer order that can be fulfilled over 29 days. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -42,7 +42,7 @@ class DoUATPAuthorizationRequestType extends AbstractRequestType public $TransactionEntity; /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Invoice ID. A pass through. * - maxOccurs: 1 * - minOccurs: 0 @@ -51,7 +51,7 @@ class DoUATPAuthorizationRequestType extends AbstractRequestType public $InvoiceID; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id for each API request to prevent duplicate payments. Optional Character length and limits: 38 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -136,7 +136,7 @@ public function setTransactionEntity($transactionEntity = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\TransactionEntityType::valueIsValid($transactionEntity)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $transactionEntity, implode(', ', \PayPal\EnumType\TransactionEntityType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\TransactionEntityType', is_array($transactionEntity) ? implode(', ', $transactionEntity) : var_export($transactionEntity, true), implode(', ', \PayPal\EnumType\TransactionEntityType::getValidValues())), __LINE__); } $this->TransactionEntity = $transactionEntity; return $this; @@ -158,7 +158,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; @@ -180,7 +180,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/DoUATPAuthorizationResponseType.php b/src/StructType/DoUATPAuthorizationResponseType.php index 48daea3..b52de62 100644 --- a/src/StructType/DoUATPAuthorizationResponseType.php +++ b/src/StructType/DoUATPAuthorizationResponseType.php @@ -13,7 +13,7 @@ class DoUATPAuthorizationResponseType extends DoAuthorizationResponseType { /** * The UATPDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:UATPDetails @@ -22,7 +22,7 @@ class DoUATPAuthorizationResponseType extends DoAuthorizationResponseType public $UATPDetails; /** * The AuthorizationCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Auth Authorization Code. * - maxOccurs: 1 * - minOccurs: 1 @@ -31,7 +31,7 @@ class DoUATPAuthorizationResponseType extends DoAuthorizationResponseType public $AuthorizationCode; /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Invoice ID. A pass through. * - maxOccurs: 1 * - minOccurs: 0 @@ -40,7 +40,7 @@ class DoUATPAuthorizationResponseType extends DoAuthorizationResponseType public $InvoiceID; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id for each API request to prevent duplicate payments. Optional Character length and limits: 38 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -101,7 +101,7 @@ public function setAuthorizationCode($authorizationCode = null) { // validation for constraint: string if (!is_null($authorizationCode) && !is_string($authorizationCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authorizationCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authorizationCode, true), gettype($authorizationCode)), __LINE__); } $this->AuthorizationCode = $authorizationCode; return $this; @@ -123,7 +123,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; @@ -145,7 +145,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/DoUATPExpressCheckoutPaymentReq.php b/src/StructType/DoUATPExpressCheckoutPaymentReq.php index f0177e2..dca6772 100644 --- a/src/StructType/DoUATPExpressCheckoutPaymentReq.php +++ b/src/StructType/DoUATPExpressCheckoutPaymentReq.php @@ -13,7 +13,7 @@ class DoUATPExpressCheckoutPaymentReq extends AbstractStructBase { /** * The DoUATPExpressCheckoutPaymentRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoUATPExpressCheckoutPaymentRequest * @var \PayPal\StructType\DoUATPExpressCheckoutPaymentRequestType */ diff --git a/src/StructType/DoUATPExpressCheckoutPaymentRequestType.php b/src/StructType/DoUATPExpressCheckoutPaymentRequestType.php index 06ae555..705a313 100644 --- a/src/StructType/DoUATPExpressCheckoutPaymentRequestType.php +++ b/src/StructType/DoUATPExpressCheckoutPaymentRequestType.php @@ -11,12 +11,6 @@ */ class DoUATPExpressCheckoutPaymentRequestType extends DoExpressCheckoutPaymentRequestType { - /** - * Constructor method for DoUATPExpressCheckoutPaymentRequestType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/DoUATPExpressCheckoutPaymentResponseType.php b/src/StructType/DoUATPExpressCheckoutPaymentResponseType.php index ccf683d..7998bab 100644 --- a/src/StructType/DoUATPExpressCheckoutPaymentResponseType.php +++ b/src/StructType/DoUATPExpressCheckoutPaymentResponseType.php @@ -13,7 +13,7 @@ class DoUATPExpressCheckoutPaymentResponseType extends DoExpressCheckoutPaymentR { /** * The UATPDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:UATPDetails diff --git a/src/StructType/DoVoidReq.php b/src/StructType/DoVoidReq.php index b2353dc..cd49d07 100644 --- a/src/StructType/DoVoidReq.php +++ b/src/StructType/DoVoidReq.php @@ -13,7 +13,7 @@ class DoVoidReq extends AbstractStructBase { /** * The DoVoidRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:DoVoidRequest * @var \PayPal\StructType\DoVoidRequestType */ diff --git a/src/StructType/DoVoidRequestType.php b/src/StructType/DoVoidRequestType.php index 3b8186c..ff23c86 100644 --- a/src/StructType/DoVoidRequestType.php +++ b/src/StructType/DoVoidRequestType.php @@ -13,7 +13,7 @@ class DoVoidRequestType extends AbstractRequestType { /** * The AuthorizationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value of the original authorization identification number returned by a PayPal product. If you are voiding a transaction that has been reauthorized, use the ID from the original authorization, and not the reauthorization. * Required Character length and limits: 19 single-byte characters * - maxOccurs: 1 @@ -23,7 +23,7 @@ class DoVoidRequestType extends AbstractRequestType public $AuthorizationID; /** * The Note - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An informational note about this settlement that is displayed to the payer in email and in transaction history. Optional Character length and limits: 255 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -32,7 +32,7 @@ class DoVoidRequestType extends AbstractRequestType public $Note; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id for each API request to prevent duplicate payments. Optional Character length and limits: 38 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -72,7 +72,7 @@ public function setAuthorizationID($authorizationID = null) { // validation for constraint: string if (!is_null($authorizationID) && !is_string($authorizationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authorizationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authorizationID, true), gettype($authorizationID)), __LINE__); } $this->AuthorizationID = $authorizationID; return $this; @@ -94,7 +94,7 @@ public function setNote($note = null) { // validation for constraint: string if (!is_null($note) && !is_string($note)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($note)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); } $this->Note = $note; return $this; @@ -116,7 +116,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/DoVoidResponseType.php b/src/StructType/DoVoidResponseType.php index 36a239f..f0f0283 100644 --- a/src/StructType/DoVoidResponseType.php +++ b/src/StructType/DoVoidResponseType.php @@ -13,7 +13,7 @@ class DoVoidResponseType extends AbstractResponseType { /** * The AuthorizationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The authorization identification number you specified in the request. Character length and limits: 19 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class DoVoidResponseType extends AbstractResponseType public $AuthorizationID; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Return msgsubid back to merchant * - maxOccurs: 1 * - minOccurs: 0 @@ -59,7 +59,7 @@ public function setAuthorizationID($authorizationID = null) { // validation for constraint: string if (!is_null($authorizationID) && !is_string($authorizationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authorizationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authorizationID, true), gettype($authorizationID)), __LINE__); } $this->AuthorizationID = $authorizationID; return $this; @@ -81,7 +81,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/EbayItemPaymentDetailsItemType.php b/src/StructType/EbayItemPaymentDetailsItemType.php index eb3cf69..2b67ea0 100644 --- a/src/StructType/EbayItemPaymentDetailsItemType.php +++ b/src/StructType/EbayItemPaymentDetailsItemType.php @@ -6,7 +6,7 @@ /** * This class stands for EbayItemPaymentDetailsItemType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: EbayItemPaymentDetailsItemType - Type declaration to be used by other schemas. Information about an Ebay Payment Item. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class EbayItemPaymentDetailsItemType extends AbstractStructBase { /** * The ItemNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Auction ItemNumber. Optional Character length and limitations: 765 single-byte characters * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class EbayItemPaymentDetailsItemType extends AbstractStructBase public $ItemNumber; /** * The AuctionTransactionId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Auction Transaction ID. Optional Character length and limitations: 255 single-byte characters * - minOccurs: 0 * @var string @@ -31,7 +31,7 @@ class EbayItemPaymentDetailsItemType extends AbstractStructBase public $AuctionTransactionId; /** * The OrderId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Ebay Order ID. Optional Character length and limitations: 64 single-byte characters * - minOccurs: 0 * @var string @@ -39,7 +39,7 @@ class EbayItemPaymentDetailsItemType extends AbstractStructBase public $OrderId; /** * The CartID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Ebay Cart ID. Optional Character length and limitations: 64 single-byte characters * - minOccurs: 0 * @var string @@ -81,7 +81,7 @@ public function setItemNumber($itemNumber = null) { // validation for constraint: string if (!is_null($itemNumber) && !is_string($itemNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemNumber, true), gettype($itemNumber)), __LINE__); } $this->ItemNumber = $itemNumber; return $this; @@ -103,7 +103,7 @@ public function setAuctionTransactionId($auctionTransactionId = null) { // validation for constraint: string if (!is_null($auctionTransactionId) && !is_string($auctionTransactionId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($auctionTransactionId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($auctionTransactionId, true), gettype($auctionTransactionId)), __LINE__); } $this->AuctionTransactionId = $auctionTransactionId; return $this; @@ -125,7 +125,7 @@ public function setOrderId($orderId = null) { // validation for constraint: string if (!is_null($orderId) && !is_string($orderId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($orderId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($orderId, true), gettype($orderId)), __LINE__); } $this->OrderId = $orderId; return $this; @@ -147,7 +147,7 @@ public function setCartID($cartID = null) { // validation for constraint: string if (!is_null($cartID) && !is_string($cartID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cartID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cartID, true), gettype($cartID)), __LINE__); } $this->CartID = $cartID; return $this; diff --git a/src/StructType/EnhancedCancelRecoupRequestDetailsType.php b/src/StructType/EnhancedCancelRecoupRequestDetailsType.php index fb064d4..b8f470b 100644 --- a/src/StructType/EnhancedCancelRecoupRequestDetailsType.php +++ b/src/StructType/EnhancedCancelRecoupRequestDetailsType.php @@ -11,12 +11,6 @@ */ class EnhancedCancelRecoupRequestDetailsType extends AbstractStructBase { - /** - * Constructor method for EnhancedCancelRecoupRequestDetailsType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/EnhancedCheckoutDataType.php b/src/StructType/EnhancedCheckoutDataType.php index 28f0a69..d771f36 100644 --- a/src/StructType/EnhancedCheckoutDataType.php +++ b/src/StructType/EnhancedCheckoutDataType.php @@ -11,12 +11,6 @@ */ class EnhancedCheckoutDataType extends AbstractStructBase { - /** - * Constructor method for EnhancedCheckoutDataType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/EnhancedCompleteRecoupRequestDetailsType.php b/src/StructType/EnhancedCompleteRecoupRequestDetailsType.php index da5e1bb..b6a9b8d 100644 --- a/src/StructType/EnhancedCompleteRecoupRequestDetailsType.php +++ b/src/StructType/EnhancedCompleteRecoupRequestDetailsType.php @@ -11,12 +11,6 @@ */ class EnhancedCompleteRecoupRequestDetailsType extends AbstractStructBase { - /** - * Constructor method for EnhancedCompleteRecoupRequestDetailsType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/EnhancedCompleteRecoupResponseDetailsType.php b/src/StructType/EnhancedCompleteRecoupResponseDetailsType.php index 027e759..ce8af97 100644 --- a/src/StructType/EnhancedCompleteRecoupResponseDetailsType.php +++ b/src/StructType/EnhancedCompleteRecoupResponseDetailsType.php @@ -11,12 +11,6 @@ */ class EnhancedCompleteRecoupResponseDetailsType extends AbstractStructBase { - /** - * Constructor method for EnhancedCompleteRecoupResponseDetailsType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/EnhancedDataType.php b/src/StructType/EnhancedDataType.php index 6c40313..835a690 100644 --- a/src/StructType/EnhancedDataType.php +++ b/src/StructType/EnhancedDataType.php @@ -6,7 +6,7 @@ /** * This class stands for EnhancedDataType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Enhanced Data Information. Example: AID for Airlines * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class EnhancedDataType extends AbstractStructBase { /** * The AirlineItinerary - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\AirlineItineraryType diff --git a/src/StructType/EnhancedInitiateRecoupRequestDetailsType.php b/src/StructType/EnhancedInitiateRecoupRequestDetailsType.php index e3cc5ab..a7b5d83 100644 --- a/src/StructType/EnhancedInitiateRecoupRequestDetailsType.php +++ b/src/StructType/EnhancedInitiateRecoupRequestDetailsType.php @@ -11,12 +11,6 @@ */ class EnhancedInitiateRecoupRequestDetailsType extends AbstractStructBase { - /** - * Constructor method for EnhancedInitiateRecoupRequestDetailsType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/EnhancedItemDataType.php b/src/StructType/EnhancedItemDataType.php index 086f49e..63e5507 100644 --- a/src/StructType/EnhancedItemDataType.php +++ b/src/StructType/EnhancedItemDataType.php @@ -11,12 +11,6 @@ */ class EnhancedItemDataType extends AbstractStructBase { - /** - * Constructor method for EnhancedItemDataType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/EnhancedPayerInfoType.php b/src/StructType/EnhancedPayerInfoType.php index 8215f13..d73cac3 100644 --- a/src/StructType/EnhancedPayerInfoType.php +++ b/src/StructType/EnhancedPayerInfoType.php @@ -11,12 +11,6 @@ */ class EnhancedPayerInfoType extends AbstractStructBase { - /** - * Constructor method for EnhancedPayerInfoType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/EnhancedPaymentDataType.php b/src/StructType/EnhancedPaymentDataType.php index 27fb9e4..d51e6ba 100644 --- a/src/StructType/EnhancedPaymentDataType.php +++ b/src/StructType/EnhancedPaymentDataType.php @@ -6,8 +6,8 @@ /** * This class stands for EnhancedPaymentDataType StructType - * Meta informations extracted from the WSDL - * - documentation: Enhanced data for different transactions. | AID for Airlines + * Meta information extracted from the WSDL + * - documentation: AID for Airlines | Enhanced data for different transactions. * @subpackage Structs * @author WsdlToPhp */ @@ -15,7 +15,7 @@ class EnhancedPaymentDataType extends AbstractStructBase { /** * The AirlineItinerary - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:AirlineItinerary diff --git a/src/StructType/EnhancedPaymentInfoType.php b/src/StructType/EnhancedPaymentInfoType.php index 1b14b30..d1822a5 100644 --- a/src/StructType/EnhancedPaymentInfoType.php +++ b/src/StructType/EnhancedPaymentInfoType.php @@ -11,12 +11,6 @@ */ class EnhancedPaymentInfoType extends AbstractStructBase { - /** - * Constructor method for EnhancedPaymentInfoType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/EnterBoardingReq.php b/src/StructType/EnterBoardingReq.php index e584d2d..b143dd1 100644 --- a/src/StructType/EnterBoardingReq.php +++ b/src/StructType/EnterBoardingReq.php @@ -13,7 +13,7 @@ class EnterBoardingReq extends AbstractStructBase { /** * The EnterBoardingRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:EnterBoardingRequest * @var \PayPal\StructType\EnterBoardingRequestType */ diff --git a/src/StructType/EnterBoardingRequestDetailsType.php b/src/StructType/EnterBoardingRequestDetailsType.php index aee1c12..f702b5f 100644 --- a/src/StructType/EnterBoardingRequestDetailsType.php +++ b/src/StructType/EnterBoardingRequestDetailsType.php @@ -13,14 +13,14 @@ class EnterBoardingRequestDetailsType extends AbstractStructBase { /** * The ProgramCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Onboarding program code given to you by PayPal. Required Character length and limitations: 64 alphanumeric characters * @var string */ public $ProgramCode; /** * The ProductList - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A list of comma-separated values that indicate the PayPal products you are implementing for this merchant: Direct Payment (dp) allows payments by credit card without requiring the customer to have a PayPal account. Express Checkout * (ec) allows customers to fund transactions with their PayPal account. Authorization and Capture (auth_settle) allows merchants to verify availability of funds in a PayPal account, but capture them at a later time. Administrative APIs (admin_api) is a * collection of the PayPal APIs for transaction searching, getting transaction details, refunding, and mass payments. Required Character length and limitations: 64 alphanumeric characters @@ -29,7 +29,7 @@ class EnterBoardingRequestDetailsType extends AbstractStructBase public $ProductList; /** * The PartnerCustom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Any custom information you want to store for this partner Optional Character length and limitations: 256 alphanumeric characters * - minOccurs: 0 * @var string @@ -37,7 +37,7 @@ class EnterBoardingRequestDetailsType extends AbstractStructBase public $PartnerCustom; /** * The ImageUrl - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The URL for the logo displayed on the PayPal Partner Welcome Page. Optional Character length and limitations: 2,048 alphanumeric characters * - minOccurs: 0 * @var string @@ -45,7 +45,7 @@ class EnterBoardingRequestDetailsType extends AbstractStructBase public $ImageUrl; /** * The MarketingCategory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Marketing category tha configures the graphic displayed n the PayPal Partner Welcome page. * - minOccurs: 0 * @var string @@ -53,7 +53,7 @@ class EnterBoardingRequestDetailsType extends AbstractStructBase public $MarketingCategory; /** * The BusinessInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the merchantâs business * - minOccurs: 0 * @var \PayPal\StructType\BusinessInfoType @@ -61,7 +61,7 @@ class EnterBoardingRequestDetailsType extends AbstractStructBase public $BusinessInfo; /** * The OwnerInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the merchant (the business owner) * - minOccurs: 0 * @var \PayPal\StructType\BusinessOwnerInfoType @@ -69,7 +69,7 @@ class EnterBoardingRequestDetailsType extends AbstractStructBase public $OwnerInfo; /** * The BankAccount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the merchant's bank account * - minOccurs: 0 * @var \PayPal\StructType\BankAccountDetailsType @@ -123,7 +123,7 @@ public function setProgramCode($programCode = null) { // validation for constraint: string if (!is_null($programCode) && !is_string($programCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($programCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($programCode, true), gettype($programCode)), __LINE__); } $this->ProgramCode = $programCode; return $this; @@ -145,7 +145,7 @@ public function setProductList($productList = null) { // validation for constraint: string if (!is_null($productList) && !is_string($productList)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($productList)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($productList, true), gettype($productList)), __LINE__); } $this->ProductList = $productList; return $this; @@ -167,7 +167,7 @@ public function setPartnerCustom($partnerCustom = null) { // validation for constraint: string if (!is_null($partnerCustom) && !is_string($partnerCustom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($partnerCustom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($partnerCustom, true), gettype($partnerCustom)), __LINE__); } $this->PartnerCustom = $partnerCustom; return $this; @@ -189,7 +189,7 @@ public function setImageUrl($imageUrl = null) { // validation for constraint: string if (!is_null($imageUrl) && !is_string($imageUrl)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($imageUrl)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($imageUrl, true), gettype($imageUrl)), __LINE__); } $this->ImageUrl = $imageUrl; return $this; @@ -214,7 +214,7 @@ public function setMarketingCategory($marketingCategory = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MarketingCategoryType::valueIsValid($marketingCategory)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $marketingCategory, implode(', ', \PayPal\EnumType\MarketingCategoryType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MarketingCategoryType', is_array($marketingCategory) ? implode(', ', $marketingCategory) : var_export($marketingCategory, true), implode(', ', \PayPal\EnumType\MarketingCategoryType::getValidValues())), __LINE__); } $this->MarketingCategory = $marketingCategory; return $this; diff --git a/src/StructType/EnterBoardingRequestType.php b/src/StructType/EnterBoardingRequestType.php index 9a3c5ef..36bad37 100644 --- a/src/StructType/EnterBoardingRequestType.php +++ b/src/StructType/EnterBoardingRequestType.php @@ -13,7 +13,7 @@ class EnterBoardingRequestType extends AbstractRequestType { /** * The EnterBoardingRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:EnterBoardingRequestDetails diff --git a/src/StructType/EnterBoardingResponseType.php b/src/StructType/EnterBoardingResponseType.php index 7e975a8..9a7e121 100644 --- a/src/StructType/EnterBoardingResponseType.php +++ b/src/StructType/EnterBoardingResponseType.php @@ -13,8 +13,9 @@ class EnterBoardingResponseType extends AbstractResponseType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A unique token that identifies this boarding session. Use this token with the GetBoarding Details API call.Character length and limitations: 64 alphanumeric characters. The token has the following format:OB-61characterstring + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -47,7 +48,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/ErrorParameterType.php b/src/StructType/ErrorParameterType.php index e824d07..ae2d44b 100644 --- a/src/StructType/ErrorParameterType.php +++ b/src/StructType/ErrorParameterType.php @@ -13,14 +13,14 @@ class ErrorParameterType extends AbstractStructBase { /** * The Value - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Value of the application-specific error parameter. * @var string */ public $Value; /** * The ParamID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Specifies application-specific error parameter name. * @var string */ @@ -55,7 +55,7 @@ public function setValue($value = null) { // validation for constraint: string if (!is_null($value) && !is_string($value)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($value)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($value, true), gettype($value)), __LINE__); } $this->Value = $value; return $this; @@ -77,7 +77,7 @@ public function setParamID($paramID = null) { // validation for constraint: string if (!is_null($paramID) && !is_string($paramID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paramID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paramID, true), gettype($paramID)), __LINE__); } $this->ParamID = $paramID; return $this; diff --git a/src/StructType/ErrorType.php b/src/StructType/ErrorType.php index 2382dfa..41d532e 100644 --- a/src/StructType/ErrorType.php +++ b/src/StructType/ErrorType.php @@ -18,28 +18,28 @@ class ErrorType extends AbstractStructBase public $ShortMessage; /** * The LongMessage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $LongMessage; /** * The ErrorCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Error code can be used by a receiving application to debugging a response message. These codes will need to be uniquely defined for each application. * @var string */ public $ErrorCode; /** * The SeverityCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: SeverityCode indicates whether the error is an application level error or if it is informational error, i.e., warning. * @var string */ public $SeverityCode; /** * The ErrorParameters - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This optional element may carry additional application-specific error variables that indicate specific information about the error condition particularly in the cases where there are multiple instances of the ErrorType which require * additional context. * - maxOccurs: unbounded @@ -86,7 +86,7 @@ public function setShortMessage($shortMessage = null) { // validation for constraint: string if (!is_null($shortMessage) && !is_string($shortMessage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shortMessage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shortMessage, true), gettype($shortMessage)), __LINE__); } $this->ShortMessage = $shortMessage; return $this; @@ -108,7 +108,7 @@ public function setLongMessage($longMessage = null) { // validation for constraint: string if (!is_null($longMessage) && !is_string($longMessage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($longMessage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($longMessage, true), gettype($longMessage)), __LINE__); } $this->LongMessage = $longMessage; return $this; @@ -130,7 +130,7 @@ public function setErrorCode($errorCode = null) { // validation for constraint: string if (!is_null($errorCode) && !is_string($errorCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($errorCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($errorCode, true), gettype($errorCode)), __LINE__); } $this->ErrorCode = $errorCode; return $this; @@ -155,7 +155,7 @@ public function setSeverityCode($severityCode = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SeverityCodeType::valueIsValid($severityCode)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $severityCode, implode(', ', \PayPal\EnumType\SeverityCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SeverityCodeType', is_array($severityCode) ? implode(', ', $severityCode) : var_export($severityCode, true), implode(', ', \PayPal\EnumType\SeverityCodeType::getValidValues())), __LINE__); } $this->SeverityCode = $severityCode; return $this; @@ -168,6 +168,28 @@ public function getErrorParameters() { return $this->ErrorParameters; } + /** + * This method is responsible for validating the values passed to the setErrorParameters method + * This method is willingly generated in order to preserve the one-line inline validation within the setErrorParameters method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateErrorParametersForArrayConstraintsFromSetErrorParameters(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $errorTypeErrorParametersItem) { + // validation for constraint: itemType + if (!$errorTypeErrorParametersItem instanceof \PayPal\StructType\ErrorParameterType) { + $invalidValues[] = is_object($errorTypeErrorParametersItem) ? get_class($errorTypeErrorParametersItem) : sprintf('%s(%s)', gettype($errorTypeErrorParametersItem), var_export($errorTypeErrorParametersItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The ErrorParameters property can only contain items of type \PayPal\StructType\ErrorParameterType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set ErrorParameters value * @throws \InvalidArgumentException @@ -176,11 +198,9 @@ public function getErrorParameters() */ public function setErrorParameters(array $errorParameters = array()) { - foreach ($errorParameters as $errorTypeErrorParametersItem) { - // validation for constraint: itemType - if (!$errorTypeErrorParametersItem instanceof \PayPal\StructType\ErrorParameterType) { - throw new \InvalidArgumentException(sprintf('The ErrorParameters property can only contain items of \PayPal\StructType\ErrorParameterType, "%s" given', is_object($errorTypeErrorParametersItem) ? get_class($errorTypeErrorParametersItem) : gettype($errorTypeErrorParametersItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($errorParametersArrayErrorMessage = self::validateErrorParametersForArrayConstraintsFromSetErrorParameters($errorParameters))) { + throw new \InvalidArgumentException($errorParametersArrayErrorMessage, __LINE__); } $this->ErrorParameters = $errorParameters; return $this; @@ -195,7 +215,7 @@ public function addToErrorParameters(\PayPal\StructType\ErrorParameterType $item { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\ErrorParameterType) { - throw new \InvalidArgumentException(sprintf('The ErrorParameters property can only contain items of \PayPal\StructType\ErrorParameterType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The ErrorParameters property can only contain items of type \PayPal\StructType\ErrorParameterType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->ErrorParameters[] = $item; return $this; diff --git a/src/StructType/ExecuteCheckoutOperationsReq.php b/src/StructType/ExecuteCheckoutOperationsReq.php index a06c694..458633f 100644 --- a/src/StructType/ExecuteCheckoutOperationsReq.php +++ b/src/StructType/ExecuteCheckoutOperationsReq.php @@ -13,7 +13,7 @@ class ExecuteCheckoutOperationsReq extends AbstractStructBase { /** * The ExecuteCheckoutOperationsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:ExecuteCheckoutOperationsRequest * @var \PayPal\StructType\ExecuteCheckoutOperationsRequestType */ diff --git a/src/StructType/ExecuteCheckoutOperationsRequestDetailsType.php b/src/StructType/ExecuteCheckoutOperationsRequestDetailsType.php index 8a8b84b..51d9482 100644 --- a/src/StructType/ExecuteCheckoutOperationsRequestDetailsType.php +++ b/src/StructType/ExecuteCheckoutOperationsRequestDetailsType.php @@ -13,7 +13,7 @@ class ExecuteCheckoutOperationsRequestDetailsType extends AbstractStructBase { /** * The SetDataRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: All the Data required to initiate the checkout session is passed in this element. * - maxOccurs: 1 * - minOccurs: 1 @@ -22,16 +22,17 @@ class ExecuteCheckoutOperationsRequestDetailsType extends AbstractStructBase public $SetDataRequest; /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: On your first invocation of ExecuteCheckoutOperationsRequest, the value of this token is returned by ExecuteCheckoutOperationsResponse. Optional Include this element and its value only if you want to modify an existing checkout * session with another invocation of ExecuteCheckoutOperationsRequest; for example, if you want the customer to edit his shipping address on PayPal. Character length and limitations: 20 single-byte characters + * - base: xs:string * - minOccurs: 0 * @var string */ public $Token; /** * The AuthorizationRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If auto authorization is required, this should be passed in with IsRequested set to yes. * - maxOccurs: 1 * - minOccurs: 0 @@ -89,7 +90,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/ExecuteCheckoutOperationsRequestType.php b/src/StructType/ExecuteCheckoutOperationsRequestType.php index a6297b6..2da448d 100644 --- a/src/StructType/ExecuteCheckoutOperationsRequestType.php +++ b/src/StructType/ExecuteCheckoutOperationsRequestType.php @@ -13,7 +13,7 @@ class ExecuteCheckoutOperationsRequestType extends AbstractRequestType { /** * The ExecuteCheckoutOperationsRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:ExecuteCheckoutOperationsRequestDetails diff --git a/src/StructType/ExecuteCheckoutOperationsResponseDetailsType.php b/src/StructType/ExecuteCheckoutOperationsResponseDetailsType.php index 530b325..baeb90e 100644 --- a/src/StructType/ExecuteCheckoutOperationsResponseDetailsType.php +++ b/src/StructType/ExecuteCheckoutOperationsResponseDetailsType.php @@ -13,14 +13,14 @@ class ExecuteCheckoutOperationsResponseDetailsType extends AbstractStructBase { /** * The SetDataResponse - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 1 * @var \PayPal\StructType\SetDataResponseType */ public $SetDataResponse; /** * The AuthorizationResponse - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\AuthorizationResponseType */ diff --git a/src/StructType/ExecuteCheckoutOperationsResponseType.php b/src/StructType/ExecuteCheckoutOperationsResponseType.php index d5d7e08..4f40a33 100644 --- a/src/StructType/ExecuteCheckoutOperationsResponseType.php +++ b/src/StructType/ExecuteCheckoutOperationsResponseType.php @@ -13,7 +13,7 @@ class ExecuteCheckoutOperationsResponseType extends AbstractResponseType { /** * The ExecuteCheckoutOperationsResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:ExecuteCheckoutOperationsResponseDetails diff --git a/src/StructType/ExternalPartnerTrackingDetailsType.php b/src/StructType/ExternalPartnerTrackingDetailsType.php index 3644b06..54c6872 100644 --- a/src/StructType/ExternalPartnerTrackingDetailsType.php +++ b/src/StructType/ExternalPartnerTrackingDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for ExternalPartnerTrackingDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains elements that allow tracking for an external partner. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class ExternalPartnerTrackingDetailsType extends AbstractStructBase { /** * The ExternalPartnerSegmentID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PayPal will just log this string. There will NOT be any business logic around it, nor any decisions made based on the value of the string that is passed in. From a tracking/analytical perspective, PayPal would not infer any meaning * to any specific value. We would just segment the traffic based on the value passed (Cart and None as an example) and track different metrics like risk/conversion etc based on these segments. The external partner would control the value of what gets * passed and we take that value as is and generate data based on it. Optional @@ -51,7 +51,7 @@ public function setExternalPartnerSegmentID($externalPartnerSegmentID = null) { // validation for constraint: string if (!is_null($externalPartnerSegmentID) && !is_string($externalPartnerSegmentID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalPartnerSegmentID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalPartnerSegmentID, true), gettype($externalPartnerSegmentID)), __LINE__); } $this->ExternalPartnerSegmentID = $externalPartnerSegmentID; return $this; diff --git a/src/StructType/ExternalRememberMeOptInDetailsType.php b/src/StructType/ExternalRememberMeOptInDetailsType.php index e0c1945..ad4a8ae 100644 --- a/src/StructType/ExternalRememberMeOptInDetailsType.php +++ b/src/StructType/ExternalRememberMeOptInDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for ExternalRememberMeOptInDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This element contains information that allows the merchant to request to opt into external remember me on behalf of the buyer or to request login bypass using external remember me. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class ExternalRememberMeOptInDetailsType extends AbstractStructBase { /** * The ExternalRememberMeOptIn - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: 1 = opt in to external remember me. 0 or omitted = no opt-in Other values are invalid * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class ExternalRememberMeOptInDetailsType extends AbstractStructBase public $ExternalRememberMeOptIn; /** * The ExternalRememberMeOwnerDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: E-mail address or secure merchant account ID of merchant to associate with new external remember-me. Currently, the owner must be either the API actor or omitted/none. In the future, we may allow the owner to be a 3rd party merchant * account. * - maxOccurs: 1 @@ -62,7 +62,7 @@ public function setExternalRememberMeOptIn($externalRememberMeOptIn = null) { // validation for constraint: string if (!is_null($externalRememberMeOptIn) && !is_string($externalRememberMeOptIn)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalRememberMeOptIn)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalRememberMeOptIn, true), gettype($externalRememberMeOptIn)), __LINE__); } $this->ExternalRememberMeOptIn = $externalRememberMeOptIn; return $this; diff --git a/src/StructType/ExternalRememberMeOptOutReq.php b/src/StructType/ExternalRememberMeOptOutReq.php index da9697a..7d10089 100644 --- a/src/StructType/ExternalRememberMeOptOutReq.php +++ b/src/StructType/ExternalRememberMeOptOutReq.php @@ -13,7 +13,7 @@ class ExternalRememberMeOptOutReq extends AbstractStructBase { /** * The ExternalRememberMeOptOutRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:ExternalRememberMeOptOutRequest * @var \PayPal\StructType\ExternalRememberMeOptOutRequestType */ diff --git a/src/StructType/ExternalRememberMeOptOutRequestType.php b/src/StructType/ExternalRememberMeOptOutRequestType.php index b7c4814..1555e25 100644 --- a/src/StructType/ExternalRememberMeOptOutRequestType.php +++ b/src/StructType/ExternalRememberMeOptOutRequestType.php @@ -13,7 +13,7 @@ class ExternalRememberMeOptOutRequestType extends AbstractRequestType { /** * The ExternalRememberMeID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The merchant passes in the ExternalRememberMeID to identify the user to opt out. This is a 17-character alphanumeric (encrypted) string that identifies the buyer's remembered login with a merchant and has meaning only to the * merchant. Required * - maxOccurs: 1 @@ -23,7 +23,7 @@ class ExternalRememberMeOptOutRequestType extends AbstractRequestType public $ExternalRememberMeID; /** * The ExternalRememberMeOwnerDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: E-mail address or secure merchant account ID of merchant to associate with external remember-me. * - maxOccurs: 1 * - minOccurs: 0 @@ -60,7 +60,7 @@ public function setExternalRememberMeID($externalRememberMeID = null) { // validation for constraint: string if (!is_null($externalRememberMeID) && !is_string($externalRememberMeID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalRememberMeID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalRememberMeID, true), gettype($externalRememberMeID)), __LINE__); } $this->ExternalRememberMeID = $externalRememberMeID; return $this; diff --git a/src/StructType/ExternalRememberMeOptOutResponseType.php b/src/StructType/ExternalRememberMeOptOutResponseType.php index 029fd26..37100de 100644 --- a/src/StructType/ExternalRememberMeOptOutResponseType.php +++ b/src/StructType/ExternalRememberMeOptOutResponseType.php @@ -11,12 +11,6 @@ */ class ExternalRememberMeOptOutResponseType extends AbstractResponseType { - /** - * Constructor method for ExternalRememberMeOptOutResponseType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/ExternalRememberMeOwnerDetailsType.php b/src/StructType/ExternalRememberMeOwnerDetailsType.php index 64c4b38..101d6ee 100644 --- a/src/StructType/ExternalRememberMeOwnerDetailsType.php +++ b/src/StructType/ExternalRememberMeOwnerDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for ExternalRememberMeOwnerDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: E-mail address or secure merchant account ID of merchant to associate with new external remember-me. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class ExternalRememberMeOwnerDetailsType extends AbstractStructBase { /** * The ExternalRememberMeOwnerIDType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A discriminant that tells SetEC what kind of data the ExternalRememberMeOwnerID parameter contains. Currently, the owner must be either the API actor or omitted/none. In the future, we may allow the owner to be a 3rd party merchant * account. Possible values are: None, ignore the ExternalRememberMeOwnerID. An empty value for this field also signifies None. Email, the owner ID is an email address SecureMerchantAccountID, the owner id is a string representing the secure merchant * account ID @@ -26,7 +26,7 @@ class ExternalRememberMeOwnerDetailsType extends AbstractStructBase public $ExternalRememberMeOwnerIDType; /** * The ExternalRememberMeOwnerID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: When opting in to bypass login via remember me, this parameter specifies the merchant account associated with the remembered login. Currentl, the owner must be either the API actor or omitted/none. In the future, we may allow the * owner to be a 3rd party merchant account. If the Owner ID Type field is not present or "None", this parameter is ignored. * - maxOccurs: 1 @@ -64,7 +64,7 @@ public function setExternalRememberMeOwnerIDType($externalRememberMeOwnerIDType { // validation for constraint: string if (!is_null($externalRememberMeOwnerIDType) && !is_string($externalRememberMeOwnerIDType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalRememberMeOwnerIDType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalRememberMeOwnerIDType, true), gettype($externalRememberMeOwnerIDType)), __LINE__); } $this->ExternalRememberMeOwnerIDType = $externalRememberMeOwnerIDType; return $this; @@ -86,7 +86,7 @@ public function setExternalRememberMeOwnerID($externalRememberMeOwnerID = null) { // validation for constraint: string if (!is_null($externalRememberMeOwnerID) && !is_string($externalRememberMeOwnerID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalRememberMeOwnerID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalRememberMeOwnerID, true), gettype($externalRememberMeOwnerID)), __LINE__); } $this->ExternalRememberMeOwnerID = $externalRememberMeOwnerID; return $this; diff --git a/src/StructType/ExternalRememberMeStatusDetailsType.php b/src/StructType/ExternalRememberMeStatusDetailsType.php index 6a25327..db09102 100644 --- a/src/StructType/ExternalRememberMeStatusDetailsType.php +++ b/src/StructType/ExternalRememberMeStatusDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for ExternalRememberMeStatusDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Response information resulting from opt-in operation or current login bypass status. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class ExternalRememberMeStatusDetailsType extends AbstractStructBase { /** * The ExternalRememberMeStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Required field that reports status of opt-in or login bypass attempt. 0 = Success - successful opt-in or ExternalRememberMeID specified in SetExpressCheckout is valid. 1 = Invalid ID - ExternalRememberMeID specified in * SetExpressCheckout is invalid. 2 = Internal Error - System error or outage during opt-in or login bypass. Can retry opt-in or login bypass next time. Flow will force full authentication and allow buyer to complete transaction. -1 = None - the return * value does not signify any valid remember me status. @@ -26,7 +26,7 @@ class ExternalRememberMeStatusDetailsType extends AbstractStructBase public $ExternalRememberMeStatus; /** * The ExternalRememberMeID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Identifier returned on external-remember-me-opt-in to allow the merchant to request bypass of PayPal login through external remember me on behalf of the buyer in future transactions. The ExternalRememberMeID is a 17-character * alphanumeric (encrypted) string. This field has meaning only to the merchant. * - maxOccurs: 1 @@ -63,8 +63,8 @@ public function getExternalRememberMeStatus() public function setExternalRememberMeStatus($externalRememberMeStatus = null) { // validation for constraint: int - if (!is_null($externalRememberMeStatus) && !is_numeric($externalRememberMeStatus)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($externalRememberMeStatus)), __LINE__); + if (!is_null($externalRememberMeStatus) && !(is_int($externalRememberMeStatus) || ctype_digit($externalRememberMeStatus))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($externalRememberMeStatus, true), gettype($externalRememberMeStatus)), __LINE__); } $this->ExternalRememberMeStatus = $externalRememberMeStatus; return $this; @@ -86,7 +86,7 @@ public function setExternalRememberMeID($externalRememberMeID = null) { // validation for constraint: string if (!is_null($externalRememberMeID) && !is_string($externalRememberMeID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalRememberMeID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalRememberMeID, true), gettype($externalRememberMeID)), __LINE__); } $this->ExternalRememberMeID = $externalRememberMeID; return $this; diff --git a/src/StructType/FMFDetailsType.php b/src/StructType/FMFDetailsType.php index f6f7330..f39203d 100644 --- a/src/StructType/FMFDetailsType.php +++ b/src/StructType/FMFDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for FMFDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Thes are filters that could result in accept/deny/pending action. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class FMFDetailsType extends AbstractStructBase { /** * The AcceptFilters - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\RiskFilterListType @@ -23,7 +23,7 @@ class FMFDetailsType extends AbstractStructBase public $AcceptFilters; /** * The PendingFilters - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\RiskFilterListType @@ -31,7 +31,7 @@ class FMFDetailsType extends AbstractStructBase public $PendingFilters; /** * The DenyFilters - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\RiskFilterListType @@ -39,7 +39,7 @@ class FMFDetailsType extends AbstractStructBase public $DenyFilters; /** * The ReportFilters - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\RiskFilterListType diff --git a/src/StructType/FaultDetailsType.php b/src/StructType/FaultDetailsType.php index 16c7621..e6e0032 100644 --- a/src/StructType/FaultDetailsType.php +++ b/src/StructType/FaultDetailsType.php @@ -13,7 +13,7 @@ class FaultDetailsType extends AbstractStructBase { /** * The ErrorCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Error code can be used by a receiving application to debugging a SOAP response message that contain one or more SOAP Fault detail objects, i.e., fault detail sub-elements. These codes will need to be uniquely defined for each fault * scenario. * @var string @@ -21,14 +21,14 @@ class FaultDetailsType extends AbstractStructBase public $ErrorCode; /** * The Severity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Severity indicates whether the error is a serious fault or if it is informational error, i.e., warning. * @var string */ public $Severity; /** * The DetailedMessage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -66,7 +66,7 @@ public function setErrorCode($errorCode = null) { // validation for constraint: string if (!is_null($errorCode) && !is_string($errorCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($errorCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($errorCode, true), gettype($errorCode)), __LINE__); } $this->ErrorCode = $errorCode; return $this; @@ -88,7 +88,7 @@ public function setSeverity($severity = null) { // validation for constraint: string if (!is_null($severity) && !is_string($severity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($severity)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($severity, true), gettype($severity)), __LINE__); } $this->Severity = $severity; return $this; @@ -110,7 +110,7 @@ public function setDetailedMessage($detailedMessage = null) { // validation for constraint: string if (!is_null($detailedMessage) && !is_string($detailedMessage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($detailedMessage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($detailedMessage, true), gettype($detailedMessage)), __LINE__); } $this->DetailedMessage = $detailedMessage; return $this; diff --git a/src/StructType/FeeType.php b/src/StructType/FeeType.php index b1f91ef..773dbdb 100644 --- a/src/StructType/FeeType.php +++ b/src/StructType/FeeType.php @@ -6,7 +6,7 @@ /** * This class stands for FeeType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Definition of an eBay Fee type. * @subpackage Structs * @author WsdlToPhp @@ -15,14 +15,14 @@ class FeeType extends AbstractStructBase { /** * The Name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $Name; /** * The Fee - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\AmountType */ @@ -57,7 +57,7 @@ public function setName($name = null) { // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); } $this->Name = $name; return $this; diff --git a/src/StructType/FeesType.php b/src/StructType/FeesType.php index 8a145fe..30779f1 100644 --- a/src/StructType/FeesType.php +++ b/src/StructType/FeesType.php @@ -6,7 +6,7 @@ /** * This class stands for FeesType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Following are the current set of eBay fee types AuctionLengthFee BoldFee BuyItNowFee CategoryFeaturedFee FeaturedFee FeaturedGalleryFee FixedPriceDurationFee GalleryFee GiftIconFee HighLightFee InsertionFee ListingDesignerFee * ListingFee PhotoDisplayFee PhotoFee ReserveFee SchedulingFee ThirtyDaysAucFee Instances of this type could hold one or more supported types of fee. * @subpackage Structs @@ -16,7 +16,7 @@ class FeesType extends AbstractStructBase { /** * The Fee - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * @var \PayPal\StructType\FeeType[] */ @@ -39,6 +39,28 @@ public function getFee() { return $this->Fee; } + /** + * This method is responsible for validating the values passed to the setFee method + * This method is willingly generated in order to preserve the one-line inline validation within the setFee method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateFeeForArrayConstraintsFromSetFee(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $feesTypeFeeItem) { + // validation for constraint: itemType + if (!$feesTypeFeeItem instanceof \PayPal\StructType\FeeType) { + $invalidValues[] = is_object($feesTypeFeeItem) ? get_class($feesTypeFeeItem) : sprintf('%s(%s)', gettype($feesTypeFeeItem), var_export($feesTypeFeeItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Fee property can only contain items of type \PayPal\StructType\FeeType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Fee value * @throws \InvalidArgumentException @@ -47,11 +69,9 @@ public function getFee() */ public function setFee(array $fee = array()) { - foreach ($fee as $feesTypeFeeItem) { - // validation for constraint: itemType - if (!$feesTypeFeeItem instanceof \PayPal\StructType\FeeType) { - throw new \InvalidArgumentException(sprintf('The Fee property can only contain items of \PayPal\StructType\FeeType, "%s" given', is_object($feesTypeFeeItem) ? get_class($feesTypeFeeItem) : gettype($feesTypeFeeItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($feeArrayErrorMessage = self::validateFeeForArrayConstraintsFromSetFee($fee))) { + throw new \InvalidArgumentException($feeArrayErrorMessage, __LINE__); } $this->Fee = $fee; return $this; @@ -66,7 +86,7 @@ public function addToFee(\PayPal\StructType\FeeType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\FeeType) { - throw new \InvalidArgumentException(sprintf('The Fee property can only contain items of \PayPal\StructType\FeeType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Fee property can only contain items of type \PayPal\StructType\FeeType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Fee[] = $item; return $this; diff --git a/src/StructType/FlatShippingRateType.php b/src/StructType/FlatShippingRateType.php index 4c57da2..941723c 100644 --- a/src/StructType/FlatShippingRateType.php +++ b/src/StructType/FlatShippingRateType.php @@ -13,7 +13,7 @@ class FlatShippingRateType extends AbstractStructBase { /** * The AdditionalShippingCosts - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Any additional shipping costs for the item. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -21,14 +21,14 @@ class FlatShippingRateType extends AbstractStructBase public $AdditionalShippingCosts; /** * The FlatShippingHandlingCosts - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\AmountType */ public $FlatShippingHandlingCosts; /** * The InsuranceFee - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:InsuranceFee * @var \PayPal\StructType\AmountType @@ -36,7 +36,7 @@ class FlatShippingRateType extends AbstractStructBase public $InsuranceFee; /** * The InsuranceOption - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:InsuranceOption * @var string @@ -44,7 +44,7 @@ class FlatShippingRateType extends AbstractStructBase public $InsuranceOption; /** * The ShippingService - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:ShippingService * @var string @@ -146,7 +146,7 @@ public function setInsuranceOption($insuranceOption = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\InsuranceOptionCodeType::valueIsValid($insuranceOption)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $insuranceOption, implode(', ', \PayPal\EnumType\InsuranceOptionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\InsuranceOptionCodeType', is_array($insuranceOption) ? implode(', ', $insuranceOption) : var_export($insuranceOption, true), implode(', ', \PayPal\EnumType\InsuranceOptionCodeType::getValidValues())), __LINE__); } $this->InsuranceOption = $insuranceOption; return $this; @@ -171,7 +171,7 @@ public function setShippingService($shippingService = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ShippingServiceCodeType::valueIsValid($shippingService)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $shippingService, implode(', ', \PayPal\EnumType\ShippingServiceCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ShippingServiceCodeType', is_array($shippingService) ? implode(', ', $shippingService) : var_export($shippingService, true), implode(', ', \PayPal\EnumType\ShippingServiceCodeType::getValidValues())), __LINE__); } $this->ShippingService = $shippingService; return $this; diff --git a/src/StructType/FlightDetailsType.php b/src/StructType/FlightDetailsType.php index 30af468..1d951c5 100644 --- a/src/StructType/FlightDetailsType.php +++ b/src/StructType/FlightDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for FlightDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details of leg information * @subpackage Structs * @author WsdlToPhp @@ -15,119 +15,119 @@ class FlightDetailsType extends AbstractStructBase { /** * The ConjuctionTicket - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ConjuctionTicket; /** * The ExchangeTicket - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ExchangeTicket; /** * The CouponNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $CouponNumber; /** * The ServiceClass - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ServiceClass; /** * The TravelDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $TravelDate; /** * The CarrierCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $CarrierCode; /** * The StopOverPermitted - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $StopOverPermitted; /** * The DepartureAirport - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $DepartureAirport; /** * The ArrivalAirport - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ArrivalAirport; /** * The FlightNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $FlightNumber; /** * The DepartureTime - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $DepartureTime; /** * The ArrivalTime - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ArrivalTime; /** * The FareBasisCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $FareBasisCode; /** * The Fare - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $Fare; /** * The Taxes - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $Taxes; /** * The Fee - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $Fee; /** * The EndorsementOrRestrictions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -207,7 +207,7 @@ public function setConjuctionTicket($conjuctionTicket = null) { // validation for constraint: string if (!is_null($conjuctionTicket) && !is_string($conjuctionTicket)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($conjuctionTicket)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($conjuctionTicket, true), gettype($conjuctionTicket)), __LINE__); } $this->ConjuctionTicket = $conjuctionTicket; return $this; @@ -229,7 +229,7 @@ public function setExchangeTicket($exchangeTicket = null) { // validation for constraint: string if (!is_null($exchangeTicket) && !is_string($exchangeTicket)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($exchangeTicket)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($exchangeTicket, true), gettype($exchangeTicket)), __LINE__); } $this->ExchangeTicket = $exchangeTicket; return $this; @@ -251,7 +251,7 @@ public function setCouponNumber($couponNumber = null) { // validation for constraint: string if (!is_null($couponNumber) && !is_string($couponNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($couponNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($couponNumber, true), gettype($couponNumber)), __LINE__); } $this->CouponNumber = $couponNumber; return $this; @@ -273,7 +273,7 @@ public function setServiceClass($serviceClass = null) { // validation for constraint: string if (!is_null($serviceClass) && !is_string($serviceClass)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($serviceClass)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($serviceClass, true), gettype($serviceClass)), __LINE__); } $this->ServiceClass = $serviceClass; return $this; @@ -295,7 +295,7 @@ public function setTravelDate($travelDate = null) { // validation for constraint: string if (!is_null($travelDate) && !is_string($travelDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($travelDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($travelDate, true), gettype($travelDate)), __LINE__); } $this->TravelDate = $travelDate; return $this; @@ -317,7 +317,7 @@ public function setCarrierCode($carrierCode = null) { // validation for constraint: string if (!is_null($carrierCode) && !is_string($carrierCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($carrierCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($carrierCode, true), gettype($carrierCode)), __LINE__); } $this->CarrierCode = $carrierCode; return $this; @@ -339,7 +339,7 @@ public function setStopOverPermitted($stopOverPermitted = null) { // validation for constraint: string if (!is_null($stopOverPermitted) && !is_string($stopOverPermitted)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($stopOverPermitted)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($stopOverPermitted, true), gettype($stopOverPermitted)), __LINE__); } $this->StopOverPermitted = $stopOverPermitted; return $this; @@ -361,7 +361,7 @@ public function setDepartureAirport($departureAirport = null) { // validation for constraint: string if (!is_null($departureAirport) && !is_string($departureAirport)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($departureAirport)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($departureAirport, true), gettype($departureAirport)), __LINE__); } $this->DepartureAirport = $departureAirport; return $this; @@ -383,7 +383,7 @@ public function setArrivalAirport($arrivalAirport = null) { // validation for constraint: string if (!is_null($arrivalAirport) && !is_string($arrivalAirport)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($arrivalAirport)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($arrivalAirport, true), gettype($arrivalAirport)), __LINE__); } $this->ArrivalAirport = $arrivalAirport; return $this; @@ -405,7 +405,7 @@ public function setFlightNumber($flightNumber = null) { // validation for constraint: string if (!is_null($flightNumber) && !is_string($flightNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($flightNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($flightNumber, true), gettype($flightNumber)), __LINE__); } $this->FlightNumber = $flightNumber; return $this; @@ -427,7 +427,7 @@ public function setDepartureTime($departureTime = null) { // validation for constraint: string if (!is_null($departureTime) && !is_string($departureTime)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($departureTime)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($departureTime, true), gettype($departureTime)), __LINE__); } $this->DepartureTime = $departureTime; return $this; @@ -449,7 +449,7 @@ public function setArrivalTime($arrivalTime = null) { // validation for constraint: string if (!is_null($arrivalTime) && !is_string($arrivalTime)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($arrivalTime)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($arrivalTime, true), gettype($arrivalTime)), __LINE__); } $this->ArrivalTime = $arrivalTime; return $this; @@ -471,7 +471,7 @@ public function setFareBasisCode($fareBasisCode = null) { // validation for constraint: string if (!is_null($fareBasisCode) && !is_string($fareBasisCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($fareBasisCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fareBasisCode, true), gettype($fareBasisCode)), __LINE__); } $this->FareBasisCode = $fareBasisCode; return $this; @@ -547,7 +547,7 @@ public function setEndorsementOrRestrictions($endorsementOrRestrictions = null) { // validation for constraint: string if (!is_null($endorsementOrRestrictions) && !is_string($endorsementOrRestrictions)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($endorsementOrRestrictions)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($endorsementOrRestrictions, true), gettype($endorsementOrRestrictions)), __LINE__); } $this->EndorsementOrRestrictions = $endorsementOrRestrictions; return $this; diff --git a/src/StructType/FlowControlDetailsType.php b/src/StructType/FlowControlDetailsType.php index 11573ee..4b3d0d5 100644 --- a/src/StructType/FlowControlDetailsType.php +++ b/src/StructType/FlowControlDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for FlowControlDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An optional set of values related to flow-specific details. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class FlowControlDetailsType extends AbstractStructBase { /** * The ErrorURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The URL to redirect to for an unpayable transaction. This field is currently used only for the inline checkout flow. * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class FlowControlDetailsType extends AbstractStructBase public $ErrorURL; /** * The InContextReturnURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The URL to redirect to after a user clicks the "Pay" or "Continue" button on the merchant's site. This field is currently used only for the inline checkout flow. * - maxOccurs: 1 * - minOccurs: 0 @@ -61,7 +61,7 @@ public function setErrorURL($errorURL = null) { // validation for constraint: string if (!is_null($errorURL) && !is_string($errorURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($errorURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($errorURL, true), gettype($errorURL)), __LINE__); } $this->ErrorURL = $errorURL; return $this; @@ -83,7 +83,7 @@ public function setInContextReturnURL($inContextReturnURL = null) { // validation for constraint: string if (!is_null($inContextReturnURL) && !is_string($inContextReturnURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($inContextReturnURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($inContextReturnURL, true), gettype($inContextReturnURL)), __LINE__); } $this->InContextReturnURL = $inContextReturnURL; return $this; diff --git a/src/StructType/FundingSourceDetailsType.php b/src/StructType/FundingSourceDetailsType.php index aaec2c4..05dfacf 100644 --- a/src/StructType/FundingSourceDetailsType.php +++ b/src/StructType/FundingSourceDetailsType.php @@ -13,7 +13,7 @@ class FundingSourceDetailsType extends AbstractStructBase { /** * The AllowPushFunding - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Allowable values: 0,1 The value 1 indicates that the customer can accept push funding, and 0 means they cannot. Optional Character length and limitations: One single-byte numeric character. * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class FundingSourceDetailsType extends AbstractStructBase public $AllowPushFunding; /** * The UserSelectedFundingSource - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Allowable values: ELV, CreditCard, ChinaUnionPay, BML, Finance, Qiwi This element could be used to specify the perered funding option for a guest users. It has effect only if LandingPage element is set to Billing. Otherwise it will * be ignored. * - maxOccurs: 1 @@ -60,7 +60,7 @@ public function setAllowPushFunding($allowPushFunding = null) { // validation for constraint: string if (!is_null($allowPushFunding) && !is_string($allowPushFunding)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($allowPushFunding)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($allowPushFunding, true), gettype($allowPushFunding)), __LINE__); } $this->AllowPushFunding = $allowPushFunding; return $this; @@ -85,7 +85,7 @@ public function setUserSelectedFundingSource($userSelectedFundingSource = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\UserSelectedFundingSourceType::valueIsValid($userSelectedFundingSource)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $userSelectedFundingSource, implode(', ', \PayPal\EnumType\UserSelectedFundingSourceType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\UserSelectedFundingSourceType', is_array($userSelectedFundingSource) ? implode(', ', $userSelectedFundingSource) : var_export($userSelectedFundingSource, true), implode(', ', \PayPal\EnumType\UserSelectedFundingSourceType::getValidValues())), __LINE__); } $this->UserSelectedFundingSource = $userSelectedFundingSource; return $this; diff --git a/src/StructType/GetAccessPermissionDetailsReq.php b/src/StructType/GetAccessPermissionDetailsReq.php index 2766757..910b771 100644 --- a/src/StructType/GetAccessPermissionDetailsReq.php +++ b/src/StructType/GetAccessPermissionDetailsReq.php @@ -13,7 +13,7 @@ class GetAccessPermissionDetailsReq extends AbstractStructBase { /** * The GetAccessPermissionDetailsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetAccessPermissionDetailsRequest * @var \PayPal\StructType\GetAccessPermissionDetailsRequestType */ diff --git a/src/StructType/GetAccessPermissionDetailsRequestType.php b/src/StructType/GetAccessPermissionDetailsRequestType.php index ab1c770..cd0a9f7 100644 --- a/src/StructType/GetAccessPermissionDetailsRequestType.php +++ b/src/StructType/GetAccessPermissionDetailsRequestType.php @@ -13,8 +13,9 @@ class GetAccessPermissionDetailsRequestType extends AbstractRequestType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A timestamped token, the value of which was returned by SetAuthFlowParam Response. Required Character length and limitations: 20 single-byte characters + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -47,7 +48,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/GetAccessPermissionDetailsResponseDetailsType.php b/src/StructType/GetAccessPermissionDetailsResponseDetailsType.php index 79c03c2..0d43cea 100644 --- a/src/StructType/GetAccessPermissionDetailsResponseDetailsType.php +++ b/src/StructType/GetAccessPermissionDetailsResponseDetailsType.php @@ -13,7 +13,7 @@ class GetAccessPermissionDetailsResponseDetailsType extends AbstractStructBase { /** * The FirstName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The first name of the User. Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class GetAccessPermissionDetailsResponseDetailsType extends AbstractStructBase public $FirstName; /** * The LastName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The Last name of the user. Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -29,7 +29,7 @@ class GetAccessPermissionDetailsResponseDetailsType extends AbstractStructBase public $LastName; /** * The Email - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The email address of the user. Character length and limitations: 256 single-byte alphanumeric characters. * - minOccurs: 0 * @var string @@ -37,7 +37,7 @@ class GetAccessPermissionDetailsResponseDetailsType extends AbstractStructBase public $Email; /** * The AccessPermissionName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: contains information about API Services * - maxOccurs: unbounded * - minOccurs: 0 @@ -46,7 +46,7 @@ class GetAccessPermissionDetailsResponseDetailsType extends AbstractStructBase public $AccessPermissionName; /** * The AccessPermissionStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: contains information about API Services * - maxOccurs: unbounded * - minOccurs: 0 @@ -55,8 +55,9 @@ class GetAccessPermissionDetailsResponseDetailsType extends AbstractStructBase public $AccessPermissionStatus; /** * The PayerID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Encrypted PayPal customer account identification number. Required Character length and limitations: 127 single-byte characters. + * - base: xs:string * - maxLength: 127 * @var string */ @@ -103,7 +104,7 @@ public function setFirstName($firstName = null) { // validation for constraint: string if (!is_null($firstName) && !is_string($firstName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($firstName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($firstName, true), gettype($firstName)), __LINE__); } $this->FirstName = $firstName; return $this; @@ -125,7 +126,7 @@ public function setLastName($lastName = null) { // validation for constraint: string if (!is_null($lastName) && !is_string($lastName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastName, true), gettype($lastName)), __LINE__); } $this->LastName = $lastName; return $this; @@ -147,7 +148,7 @@ public function setEmail($email = null) { // validation for constraint: string if (!is_null($email) && !is_string($email)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($email)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($email, true), gettype($email)), __LINE__); } $this->Email = $email; return $this; @@ -160,6 +161,28 @@ public function getAccessPermissionName() { return $this->AccessPermissionName; } + /** + * This method is responsible for validating the values passed to the setAccessPermissionName method + * This method is willingly generated in order to preserve the one-line inline validation within the setAccessPermissionName method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateAccessPermissionNameForArrayConstraintsFromSetAccessPermissionName(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem) { + // validation for constraint: itemType + if (!is_string($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem)) { + $invalidValues[] = is_object($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem) ? get_class($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem) : sprintf('%s(%s)', gettype($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem), var_export($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The AccessPermissionName property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set AccessPermissionName value * @throws \InvalidArgumentException @@ -168,11 +191,9 @@ public function getAccessPermissionName() */ public function setAccessPermissionName(array $accessPermissionName = array()) { - foreach ($accessPermissionName as $getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem) { - // validation for constraint: itemType - if (!is_string($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem)) { - throw new \InvalidArgumentException(sprintf('The AccessPermissionName property can only contain items of string, "%s" given', is_object($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem) ? get_class($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem) : gettype($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionNameItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($accessPermissionNameArrayErrorMessage = self::validateAccessPermissionNameForArrayConstraintsFromSetAccessPermissionName($accessPermissionName))) { + throw new \InvalidArgumentException($accessPermissionNameArrayErrorMessage, __LINE__); } $this->AccessPermissionName = $accessPermissionName; return $this; @@ -187,7 +208,7 @@ public function addToAccessPermissionName($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The AccessPermissionName property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The AccessPermissionName property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->AccessPermissionName[] = $item; return $this; @@ -200,6 +221,28 @@ public function getAccessPermissionStatus() { return $this->AccessPermissionStatus; } + /** + * This method is responsible for validating the values passed to the setAccessPermissionStatus method + * This method is willingly generated in order to preserve the one-line inline validation within the setAccessPermissionStatus method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateAccessPermissionStatusForArrayConstraintsFromSetAccessPermissionStatus(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem) { + // validation for constraint: itemType + if (!is_string($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem)) { + $invalidValues[] = is_object($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem) ? get_class($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem) : sprintf('%s(%s)', gettype($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem), var_export($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The AccessPermissionStatus property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set AccessPermissionStatus value * @throws \InvalidArgumentException @@ -208,11 +251,9 @@ public function getAccessPermissionStatus() */ public function setAccessPermissionStatus(array $accessPermissionStatus = array()) { - foreach ($accessPermissionStatus as $getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem) { - // validation for constraint: itemType - if (!is_string($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem)) { - throw new \InvalidArgumentException(sprintf('The AccessPermissionStatus property can only contain items of string, "%s" given', is_object($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem) ? get_class($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem) : gettype($getAccessPermissionDetailsResponseDetailsTypeAccessPermissionStatusItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($accessPermissionStatusArrayErrorMessage = self::validateAccessPermissionStatusForArrayConstraintsFromSetAccessPermissionStatus($accessPermissionStatus))) { + throw new \InvalidArgumentException($accessPermissionStatusArrayErrorMessage, __LINE__); } $this->AccessPermissionStatus = $accessPermissionStatus; return $this; @@ -227,7 +268,7 @@ public function addToAccessPermissionStatus($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The AccessPermissionStatus property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The AccessPermissionStatus property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->AccessPermissionStatus[] = $item; return $this; @@ -247,13 +288,13 @@ public function getPayerID() */ public function setPayerID($payerID = null) { - // validation for constraint: maxLength - if ((is_scalar($payerID) && strlen($payerID) > 127) || (is_array($payerID) && count($payerID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($payerID) ? strlen($payerID) : count($payerID)), __LINE__); - } // validation for constraint: string if (!is_null($payerID) && !is_string($payerID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payerID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payerID, true), gettype($payerID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($payerID) && mb_strlen($payerID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($payerID)), __LINE__); } $this->PayerID = $payerID; return $this; diff --git a/src/StructType/GetAccessPermissionDetailsResponseType.php b/src/StructType/GetAccessPermissionDetailsResponseType.php index 14a1f42..c07aaee 100644 --- a/src/StructType/GetAccessPermissionDetailsResponseType.php +++ b/src/StructType/GetAccessPermissionDetailsResponseType.php @@ -13,7 +13,7 @@ class GetAccessPermissionDetailsResponseType extends AbstractResponseType { /** * The GetAccessPermissionDetailsResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:GetAccessPermissionDetailsResponseDetails diff --git a/src/StructType/GetAuthDetailsReq.php b/src/StructType/GetAuthDetailsReq.php index 8c29e9a..d76c885 100644 --- a/src/StructType/GetAuthDetailsReq.php +++ b/src/StructType/GetAuthDetailsReq.php @@ -13,7 +13,7 @@ class GetAuthDetailsReq extends AbstractStructBase { /** * The GetAuthDetailsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetAuthDetailsRequest * @var \PayPal\StructType\GetAuthDetailsRequestType */ diff --git a/src/StructType/GetAuthDetailsRequestType.php b/src/StructType/GetAuthDetailsRequestType.php index e3de781..7b34536 100644 --- a/src/StructType/GetAuthDetailsRequestType.php +++ b/src/StructType/GetAuthDetailsRequestType.php @@ -13,8 +13,9 @@ class GetAuthDetailsRequestType extends AbstractRequestType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A timestamped token, the value of which was returned by SetAuthFlowParam Response. RequiredCharacter length and limitations: 20 single-byte characters + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -47,7 +48,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/GetAuthDetailsResponseDetailsType.php b/src/StructType/GetAuthDetailsResponseDetailsType.php index 83c0009..3b31cfe 100644 --- a/src/StructType/GetAuthDetailsResponseDetailsType.php +++ b/src/StructType/GetAuthDetailsResponseDetailsType.php @@ -13,7 +13,7 @@ class GetAuthDetailsResponseDetailsType extends AbstractStructBase { /** * The FirstName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The first name of the User. Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class GetAuthDetailsResponseDetailsType extends AbstractStructBase public $FirstName; /** * The LastName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The Last name of the user. Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -29,7 +29,7 @@ class GetAuthDetailsResponseDetailsType extends AbstractStructBase public $LastName; /** * The Email - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The email address of the user. Character length and limitations: 256 single-byte alphanumeric characters. * - minOccurs: 0 * @var string @@ -37,8 +37,9 @@ class GetAuthDetailsResponseDetailsType extends AbstractStructBase public $Email; /** * The PayerID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Encrypted PayPal customer account identification number. Required Character length and limitations: 127 single-byte characters. + * - base: xs:string * - maxLength: 127 * @var string */ @@ -79,7 +80,7 @@ public function setFirstName($firstName = null) { // validation for constraint: string if (!is_null($firstName) && !is_string($firstName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($firstName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($firstName, true), gettype($firstName)), __LINE__); } $this->FirstName = $firstName; return $this; @@ -101,7 +102,7 @@ public function setLastName($lastName = null) { // validation for constraint: string if (!is_null($lastName) && !is_string($lastName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastName, true), gettype($lastName)), __LINE__); } $this->LastName = $lastName; return $this; @@ -123,7 +124,7 @@ public function setEmail($email = null) { // validation for constraint: string if (!is_null($email) && !is_string($email)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($email)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($email, true), gettype($email)), __LINE__); } $this->Email = $email; return $this; @@ -143,13 +144,13 @@ public function getPayerID() */ public function setPayerID($payerID = null) { - // validation for constraint: maxLength - if ((is_scalar($payerID) && strlen($payerID) > 127) || (is_array($payerID) && count($payerID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($payerID) ? strlen($payerID) : count($payerID)), __LINE__); - } // validation for constraint: string if (!is_null($payerID) && !is_string($payerID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payerID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payerID, true), gettype($payerID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($payerID) && mb_strlen($payerID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($payerID)), __LINE__); } $this->PayerID = $payerID; return $this; diff --git a/src/StructType/GetAuthDetailsResponseType.php b/src/StructType/GetAuthDetailsResponseType.php index 731e977..55d3e6a 100644 --- a/src/StructType/GetAuthDetailsResponseType.php +++ b/src/StructType/GetAuthDetailsResponseType.php @@ -13,7 +13,7 @@ class GetAuthDetailsResponseType extends AbstractResponseType { /** * The GetAuthDetailsResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:GetAuthDetailsResponseDetails diff --git a/src/StructType/GetBalanceReq.php b/src/StructType/GetBalanceReq.php index c7f0bd9..84c1c34 100644 --- a/src/StructType/GetBalanceReq.php +++ b/src/StructType/GetBalanceReq.php @@ -13,7 +13,7 @@ class GetBalanceReq extends AbstractStructBase { /** * The GetBalanceRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetBalanceRequest * @var \PayPal\StructType\GetBalanceRequestType */ diff --git a/src/StructType/GetBalanceRequestType.php b/src/StructType/GetBalanceRequestType.php index a1382b3..858af8c 100644 --- a/src/StructType/GetBalanceRequestType.php +++ b/src/StructType/GetBalanceRequestType.php @@ -13,7 +13,7 @@ class GetBalanceRequestType extends AbstractRequestType { /** * The ReturnAllCurrencies - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -46,7 +46,7 @@ public function setReturnAllCurrencies($returnAllCurrencies = null) { // validation for constraint: string if (!is_null($returnAllCurrencies) && !is_string($returnAllCurrencies)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($returnAllCurrencies)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($returnAllCurrencies, true), gettype($returnAllCurrencies)), __LINE__); } $this->ReturnAllCurrencies = $returnAllCurrencies; return $this; diff --git a/src/StructType/GetBalanceResponseType.php b/src/StructType/GetBalanceResponseType.php index 7c2864b..b273f88 100644 --- a/src/StructType/GetBalanceResponseType.php +++ b/src/StructType/GetBalanceResponseType.php @@ -13,7 +13,7 @@ class GetBalanceResponseType extends AbstractResponseType { /** * The Balance - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var \PayPal\StructType\BasicAmountType @@ -21,7 +21,7 @@ class GetBalanceResponseType extends AbstractResponseType public $Balance; /** * The BalanceTimeStamp - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -29,7 +29,7 @@ class GetBalanceResponseType extends AbstractResponseType public $BalanceTimeStamp; /** * The BalanceHoldings - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType[] @@ -86,7 +86,7 @@ public function setBalanceTimeStamp($balanceTimeStamp = null) { // validation for constraint: string if (!is_null($balanceTimeStamp) && !is_string($balanceTimeStamp)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($balanceTimeStamp)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($balanceTimeStamp, true), gettype($balanceTimeStamp)), __LINE__); } $this->BalanceTimeStamp = $balanceTimeStamp; return $this; @@ -99,6 +99,28 @@ public function getBalanceHoldings() { return $this->BalanceHoldings; } + /** + * This method is responsible for validating the values passed to the setBalanceHoldings method + * This method is willingly generated in order to preserve the one-line inline validation within the setBalanceHoldings method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateBalanceHoldingsForArrayConstraintsFromSetBalanceHoldings(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getBalanceResponseTypeBalanceHoldingsItem) { + // validation for constraint: itemType + if (!$getBalanceResponseTypeBalanceHoldingsItem instanceof \PayPal\StructType\BasicAmountType) { + $invalidValues[] = is_object($getBalanceResponseTypeBalanceHoldingsItem) ? get_class($getBalanceResponseTypeBalanceHoldingsItem) : sprintf('%s(%s)', gettype($getBalanceResponseTypeBalanceHoldingsItem), var_export($getBalanceResponseTypeBalanceHoldingsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The BalanceHoldings property can only contain items of type \PayPal\StructType\BasicAmountType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set BalanceHoldings value * @throws \InvalidArgumentException @@ -107,11 +129,9 @@ public function getBalanceHoldings() */ public function setBalanceHoldings(array $balanceHoldings = array()) { - foreach ($balanceHoldings as $getBalanceResponseTypeBalanceHoldingsItem) { - // validation for constraint: itemType - if (!$getBalanceResponseTypeBalanceHoldingsItem instanceof \PayPal\StructType\BasicAmountType) { - throw new \InvalidArgumentException(sprintf('The BalanceHoldings property can only contain items of \PayPal\StructType\BasicAmountType, "%s" given', is_object($getBalanceResponseTypeBalanceHoldingsItem) ? get_class($getBalanceResponseTypeBalanceHoldingsItem) : gettype($getBalanceResponseTypeBalanceHoldingsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($balanceHoldingsArrayErrorMessage = self::validateBalanceHoldingsForArrayConstraintsFromSetBalanceHoldings($balanceHoldings))) { + throw new \InvalidArgumentException($balanceHoldingsArrayErrorMessage, __LINE__); } $this->BalanceHoldings = $balanceHoldings; return $this; @@ -126,7 +146,7 @@ public function addToBalanceHoldings(\PayPal\StructType\BasicAmountType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\BasicAmountType) { - throw new \InvalidArgumentException(sprintf('The BalanceHoldings property can only contain items of \PayPal\StructType\BasicAmountType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The BalanceHoldings property can only contain items of type \PayPal\StructType\BasicAmountType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->BalanceHoldings[] = $item; return $this; diff --git a/src/StructType/GetBillingAgreementCustomerDetailsReq.php b/src/StructType/GetBillingAgreementCustomerDetailsReq.php index 4df712b..0b59cf2 100644 --- a/src/StructType/GetBillingAgreementCustomerDetailsReq.php +++ b/src/StructType/GetBillingAgreementCustomerDetailsReq.php @@ -13,7 +13,7 @@ class GetBillingAgreementCustomerDetailsReq extends AbstractStructBase { /** * The GetBillingAgreementCustomerDetailsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetBillingAgreementCustomerDetailsRequest * @var \PayPal\StructType\GetBillingAgreementCustomerDetailsRequestType */ diff --git a/src/StructType/GetBillingAgreementCustomerDetailsRequestType.php b/src/StructType/GetBillingAgreementCustomerDetailsRequestType.php index f529f70..e69e592 100644 --- a/src/StructType/GetBillingAgreementCustomerDetailsRequestType.php +++ b/src/StructType/GetBillingAgreementCustomerDetailsRequestType.php @@ -13,7 +13,8 @@ class GetBillingAgreementCustomerDetailsRequestType extends AbstractRequestType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -46,7 +47,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/GetBillingAgreementCustomerDetailsResponseDetailsType.php b/src/StructType/GetBillingAgreementCustomerDetailsResponseDetailsType.php index 95a4991..5160c56 100644 --- a/src/StructType/GetBillingAgreementCustomerDetailsResponseDetailsType.php +++ b/src/StructType/GetBillingAgreementCustomerDetailsResponseDetailsType.php @@ -14,7 +14,7 @@ class GetBillingAgreementCustomerDetailsResponseDetailsType extends AbstractStru { /** * The PayerInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var \PayPal\StructType\PayerInfoType @@ -22,7 +22,7 @@ class GetBillingAgreementCustomerDetailsResponseDetailsType extends AbstractStru public $PayerInfo; /** * The BillingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Customer's billing address. Optional If you have a credit card mapped in your PayPal account, PayPal returns the billing address of the credit billing address otherwise your primary address as billing address in * GetBillingAgreementCustomerDetails. * - minOccurs: 0 diff --git a/src/StructType/GetBillingAgreementCustomerDetailsResponseType.php b/src/StructType/GetBillingAgreementCustomerDetailsResponseType.php index ff746d2..0208ccb 100644 --- a/src/StructType/GetBillingAgreementCustomerDetailsResponseType.php +++ b/src/StructType/GetBillingAgreementCustomerDetailsResponseType.php @@ -13,7 +13,7 @@ class GetBillingAgreementCustomerDetailsResponseType extends AbstractResponseTyp { /** * The GetBillingAgreementCustomerDetailsResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:GetBillingAgreementCustomerDetailsResponseDetails diff --git a/src/StructType/GetBoardingDetailsReq.php b/src/StructType/GetBoardingDetailsReq.php index 122d806..2fa3707 100644 --- a/src/StructType/GetBoardingDetailsReq.php +++ b/src/StructType/GetBoardingDetailsReq.php @@ -13,7 +13,7 @@ class GetBoardingDetailsReq extends AbstractStructBase { /** * The GetBoardingDetailsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetBoardingDetailsRequest * @var \PayPal\StructType\GetBoardingDetailsRequestType */ diff --git a/src/StructType/GetBoardingDetailsRequestType.php b/src/StructType/GetBoardingDetailsRequestType.php index 70b7b41..f2ebab1 100644 --- a/src/StructType/GetBoardingDetailsRequestType.php +++ b/src/StructType/GetBoardingDetailsRequestType.php @@ -13,8 +13,9 @@ class GetBoardingDetailsRequestType extends AbstractRequestType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A unique token returned by the EnterBoarding API call that identifies this boarding session. RequiredCharacter length and limitations: 64 alphanumeric characters. The token has the following format:OB-61characterstring + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -47,7 +48,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/GetBoardingDetailsResponseDetailsType.php b/src/StructType/GetBoardingDetailsResponseDetailsType.php index 091edca..bffd561 100644 --- a/src/StructType/GetBoardingDetailsResponseDetailsType.php +++ b/src/StructType/GetBoardingDetailsResponseDetailsType.php @@ -13,28 +13,28 @@ class GetBoardingDetailsResponseDetailsType extends AbstractStructBase { /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Status of merchant's onboarding process: CompletedCancelledPending Character length and limitations: Eight alphabetic characters * @var string */ public $Status; /** * The StartDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date the boarding process started * @var string */ public $StartDate; /** * The LastUpdated - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date the merchantâs status or progress was last updated * @var string */ public $LastUpdated; /** * The Reason - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Reason for merchantâs cancellation of sign-up. Character length and limitations: 1,024 alphanumeric characters * - minOccurs: 0 * @var string @@ -52,14 +52,14 @@ class GetBoardingDetailsResponseDetailsType extends AbstractStructBase public $ProgramCode; /** * The CampaignID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $CampaignID; /** * The UserWithdrawalLimit - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates if there is a limitation on the amount of money the business can withdraw from PayPal * - minOccurs: 0 * @var string @@ -67,7 +67,7 @@ class GetBoardingDetailsResponseDetailsType extends AbstractStructBase public $UserWithdrawalLimit; /** * The PartnerCustom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Custom information you set on the EnterBoarding API call Character length and limitations: 256 alphanumeric characters * - minOccurs: 0 * @var string @@ -75,7 +75,7 @@ class GetBoardingDetailsResponseDetailsType extends AbstractStructBase public $PartnerCustom; /** * The AccountOwner - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about the owner of the account * - minOccurs: 0 * @var \PayPal\StructType\PayerInfoType @@ -83,7 +83,7 @@ class GetBoardingDetailsResponseDetailsType extends AbstractStructBase public $AccountOwner; /** * The Credentials - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchantâs PayPal API credentials * - minOccurs: 0 * @var \PayPal\StructType\APICredentialsType @@ -91,7 +91,7 @@ class GetBoardingDetailsResponseDetailsType extends AbstractStructBase public $Credentials; /** * The ConfigureAPIs - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The APIs that this merchant has granted the business partner permission to call on his behalf. For example: SetExpressCheckout,GetExpressCheckoutDetails,DoExpressCheckoutPayment * - minOccurs: 0 * @var string @@ -99,7 +99,7 @@ class GetBoardingDetailsResponseDetailsType extends AbstractStructBase public $ConfigureAPIs; /** * The EmailVerificationStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Primary email verification status. Confirmed, Unconfirmed * - minOccurs: 0 * @var string @@ -107,7 +107,7 @@ class GetBoardingDetailsResponseDetailsType extends AbstractStructBase public $EmailVerificationStatus; /** * The VettingStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Gives VettingStatus - Pending, Cancelled, Approved, UnderReview Character length and limitations: 256 alphanumeric characters * - minOccurs: 0 * @var string @@ -115,7 +115,7 @@ class GetBoardingDetailsResponseDetailsType extends AbstractStructBase public $VettingStatus; /** * The BankAccountVerificationStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Gives BankAccountVerificationStatus - Added, Confirmed Character length and limitations: 256 alphanumeric characters * - minOccurs: 0 * @var string @@ -193,7 +193,7 @@ public function setStatus($status = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BoardingStatusType::valueIsValid($status)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $status, implode(', ', \PayPal\EnumType\BoardingStatusType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BoardingStatusType', is_array($status) ? implode(', ', $status) : var_export($status, true), implode(', ', \PayPal\EnumType\BoardingStatusType::getValidValues())), __LINE__); } $this->Status = $status; return $this; @@ -215,7 +215,7 @@ public function setStartDate($startDate = null) { // validation for constraint: string if (!is_null($startDate) && !is_string($startDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($startDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($startDate, true), gettype($startDate)), __LINE__); } $this->StartDate = $startDate; return $this; @@ -237,7 +237,7 @@ public function setLastUpdated($lastUpdated = null) { // validation for constraint: string if (!is_null($lastUpdated) && !is_string($lastUpdated)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastUpdated)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastUpdated, true), gettype($lastUpdated)), __LINE__); } $this->LastUpdated = $lastUpdated; return $this; @@ -259,7 +259,7 @@ public function setReason($reason = null) { // validation for constraint: string if (!is_null($reason) && !is_string($reason)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reason)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reason, true), gettype($reason)), __LINE__); } $this->Reason = $reason; return $this; @@ -281,7 +281,7 @@ public function setProgramName($programName = null) { // validation for constraint: string if (!is_null($programName) && !is_string($programName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($programName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($programName, true), gettype($programName)), __LINE__); } $this->ProgramName = $programName; return $this; @@ -303,7 +303,7 @@ public function setProgramCode($programCode = null) { // validation for constraint: string if (!is_null($programCode) && !is_string($programCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($programCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($programCode, true), gettype($programCode)), __LINE__); } $this->ProgramCode = $programCode; return $this; @@ -325,7 +325,7 @@ public function setCampaignID($campaignID = null) { // validation for constraint: string if (!is_null($campaignID) && !is_string($campaignID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($campaignID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($campaignID, true), gettype($campaignID)), __LINE__); } $this->CampaignID = $campaignID; return $this; @@ -350,7 +350,7 @@ public function setUserWithdrawalLimit($userWithdrawalLimit = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\UserWithdrawalLimitTypeType::valueIsValid($userWithdrawalLimit)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $userWithdrawalLimit, implode(', ', \PayPal\EnumType\UserWithdrawalLimitTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\UserWithdrawalLimitTypeType', is_array($userWithdrawalLimit) ? implode(', ', $userWithdrawalLimit) : var_export($userWithdrawalLimit, true), implode(', ', \PayPal\EnumType\UserWithdrawalLimitTypeType::getValidValues())), __LINE__); } $this->UserWithdrawalLimit = $userWithdrawalLimit; return $this; @@ -372,7 +372,7 @@ public function setPartnerCustom($partnerCustom = null) { // validation for constraint: string if (!is_null($partnerCustom) && !is_string($partnerCustom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($partnerCustom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($partnerCustom, true), gettype($partnerCustom)), __LINE__); } $this->PartnerCustom = $partnerCustom; return $this; @@ -430,7 +430,7 @@ public function setConfigureAPIs($configureAPIs = null) { // validation for constraint: string if (!is_null($configureAPIs) && !is_string($configureAPIs)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($configureAPIs)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($configureAPIs, true), gettype($configureAPIs)), __LINE__); } $this->ConfigureAPIs = $configureAPIs; return $this; @@ -452,7 +452,7 @@ public function setEmailVerificationStatus($emailVerificationStatus = null) { // validation for constraint: string if (!is_null($emailVerificationStatus) && !is_string($emailVerificationStatus)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($emailVerificationStatus)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($emailVerificationStatus, true), gettype($emailVerificationStatus)), __LINE__); } $this->EmailVerificationStatus = $emailVerificationStatus; return $this; @@ -474,7 +474,7 @@ public function setVettingStatus($vettingStatus = null) { // validation for constraint: string if (!is_null($vettingStatus) && !is_string($vettingStatus)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($vettingStatus)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($vettingStatus, true), gettype($vettingStatus)), __LINE__); } $this->VettingStatus = $vettingStatus; return $this; @@ -496,7 +496,7 @@ public function setBankAccountVerificationStatus($bankAccountVerificationStatus { // validation for constraint: string if (!is_null($bankAccountVerificationStatus) && !is_string($bankAccountVerificationStatus)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($bankAccountVerificationStatus)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bankAccountVerificationStatus, true), gettype($bankAccountVerificationStatus)), __LINE__); } $this->BankAccountVerificationStatus = $bankAccountVerificationStatus; return $this; diff --git a/src/StructType/GetBoardingDetailsResponseType.php b/src/StructType/GetBoardingDetailsResponseType.php index aa272ca..2c92851 100644 --- a/src/StructType/GetBoardingDetailsResponseType.php +++ b/src/StructType/GetBoardingDetailsResponseType.php @@ -13,7 +13,7 @@ class GetBoardingDetailsResponseType extends AbstractResponseType { /** * The GetBoardingDetailsResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:GetBoardingDetailsResponseDetails diff --git a/src/StructType/GetExpressCheckoutDetailsReq.php b/src/StructType/GetExpressCheckoutDetailsReq.php index ab07986..a4aa82b 100644 --- a/src/StructType/GetExpressCheckoutDetailsReq.php +++ b/src/StructType/GetExpressCheckoutDetailsReq.php @@ -13,7 +13,7 @@ class GetExpressCheckoutDetailsReq extends AbstractStructBase { /** * The GetExpressCheckoutDetailsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetExpressCheckoutDetailsRequest * @var \PayPal\StructType\GetExpressCheckoutDetailsRequestType */ diff --git a/src/StructType/GetExpressCheckoutDetailsRequestType.php b/src/StructType/GetExpressCheckoutDetailsRequestType.php index 9859a00..c1cbaba 100644 --- a/src/StructType/GetExpressCheckoutDetailsRequestType.php +++ b/src/StructType/GetExpressCheckoutDetailsRequestType.php @@ -13,8 +13,9 @@ class GetExpressCheckoutDetailsRequestType extends AbstractRequestType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A timestamped token, the value of which was returned by SetExpressCheckoutResponse. RequiredCharacter length and limitations: 20 single-byte characters + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -47,7 +48,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/GetExpressCheckoutDetailsResponseDetailsType.php b/src/StructType/GetExpressCheckoutDetailsResponseDetailsType.php index 0a041bb..434a122 100644 --- a/src/StructType/GetExpressCheckoutDetailsResponseDetailsType.php +++ b/src/StructType/GetExpressCheckoutDetailsResponseDetailsType.php @@ -13,21 +13,22 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The timestamped token value that was returned by SetExpressCheckoutResponse and passed on GetExpressCheckoutDetailsRequest. Character length and limitations: 20 single-byte characters + * - base: xs:string * @var string */ public $Token; /** * The PayerInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the payer * @var \PayPal\StructType\PayerInfoType */ public $PayerInfo; /** * The Custom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - 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 * - minOccurs: 0 * @var string @@ -35,7 +36,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $Custom; /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - 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 * - minOccurs: 0 * @var string @@ -43,7 +44,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $InvoiceID; /** * The ContactPhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - 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. * - minOccurs: 0 * @var string @@ -51,7 +52,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $ContactPhone; /** * The BillingAgreementAcceptedStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var bool @@ -59,7 +60,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $BillingAgreementAcceptedStatus; /** * The RedirectRequired - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -67,7 +68,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $RedirectRequired; /** * The BillingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - 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 * GetExpressCheckoutDetailsResponse. * - minOccurs: 0 @@ -76,7 +77,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $BillingAddress; /** * The Note - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Text note entered by the buyer in PayPal flow. * - maxOccurs: 1 * - minOccurs: 0 @@ -85,7 +86,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $Note; /** * The CheckoutStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Returns the status of the EC checkout session. Values include 'PaymentActionNotInitiated', 'PaymentActionFailed', 'PaymentActionInProgress', 'PaymentCompleted'. * - maxOccurs: 1 * - minOccurs: 0 @@ -94,7 +95,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $CheckoutStatus; /** * The PayPalAdjustment - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - 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 * positive amount. * - maxOccurs: 1 @@ -104,7 +105,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $PayPalAdjustment; /** * The PaymentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the individual purchased items. * - maxOccurs: 10 * - minOccurs: 0 @@ -113,7 +114,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $PaymentDetails; /** * The UserSelectedOptions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the user selected options. * - maxOccurs: 1 * - minOccurs: 0 @@ -122,7 +123,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $UserSelectedOptions; /** * The IncentiveDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the incentives that were applied from Ebay RYP page and PayPal RYP page. * - maxOccurs: unbounded * - minOccurs: 0 @@ -131,7 +132,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $IncentiveDetails; /** * The GiftMessage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift message. * - maxOccurs: 1 * - minOccurs: 0 @@ -140,7 +141,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $GiftMessage; /** * The GiftReceiptEnable - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift receipt enable. * - maxOccurs: 1 * - minOccurs: 0 @@ -149,7 +150,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $GiftReceiptEnable; /** * The GiftWrapName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift Wrap name. * - maxOccurs: 1 * - minOccurs: 0 @@ -158,7 +159,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $GiftWrapName; /** * The GiftWrapAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift Wrap amount. * - maxOccurs: 1 * - minOccurs: 0 @@ -167,7 +168,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $GiftWrapAmount; /** * The BuyerMarketingEmail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Buyer marketing email. * - maxOccurs: 1 * - minOccurs: 0 @@ -176,7 +177,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $BuyerMarketingEmail; /** * The SurveyQuestion - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the survey question. * - maxOccurs: 1 * - minOccurs: 0 @@ -185,7 +186,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $SurveyQuestion; /** * The SurveyChoiceSelected - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the survey choice selected by the user. * - maxOccurs: unbounded * - minOccurs: 0 @@ -194,7 +195,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $SurveyChoiceSelected; /** * The PaymentRequestInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains payment request information about each bucket in the cart. * - maxOccurs: 10 * - minOccurs: 0 @@ -203,7 +204,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $PaymentRequestInfo; /** * The ExternalRememberMeStatusDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Response information resulting from opt-in operation or current login bypass status. * - maxOccurs: 1 * - minOccurs: 0 @@ -212,7 +213,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $ExternalRememberMeStatusDetails; /** * The RefreshTokenStatusDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Response information resulting from opt-in operation or current login bypass status. * - maxOccurs: 1 * - minOccurs: 0 @@ -221,7 +222,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $RefreshTokenStatusDetails; /** * The PaymentInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the transaction * - maxOccurs: 10 * - minOccurs: 0 @@ -230,7 +231,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $PaymentInfo; /** * The CartChangeTolerance - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - 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 * modified. * - maxOccurs: 1 @@ -240,7 +241,7 @@ class GetExpressCheckoutDetailsResponseDetailsType extends AbstractStructBase public $CartChangeTolerance; /** * The InstrumentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of the payment instrument. * - minOccurs: 0 * @var \PayPal\StructType\InstrumentDetailsType @@ -351,7 +352,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; @@ -391,7 +392,7 @@ public function setCustom($custom = null) { // validation for constraint: string if (!is_null($custom) && !is_string($custom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($custom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); } $this->Custom = $custom; return $this; @@ -413,7 +414,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; @@ -435,7 +436,7 @@ public function setContactPhone($contactPhone = null) { // validation for constraint: string if (!is_null($contactPhone) && !is_string($contactPhone)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($contactPhone)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($contactPhone, true), gettype($contactPhone)), __LINE__); } $this->ContactPhone = $contactPhone; return $this; @@ -457,7 +458,7 @@ public function setBillingAgreementAcceptedStatus($billingAgreementAcceptedStatu { // validation for constraint: boolean if (!is_null($billingAgreementAcceptedStatus) && !is_bool($billingAgreementAcceptedStatus)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($billingAgreementAcceptedStatus)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($billingAgreementAcceptedStatus, true), gettype($billingAgreementAcceptedStatus)), __LINE__); } $this->BillingAgreementAcceptedStatus = $billingAgreementAcceptedStatus; return $this; @@ -479,7 +480,7 @@ public function setRedirectRequired($redirectRequired = null) { // validation for constraint: string if (!is_null($redirectRequired) && !is_string($redirectRequired)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($redirectRequired)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redirectRequired, true), gettype($redirectRequired)), __LINE__); } $this->RedirectRequired = $redirectRequired; return $this; @@ -519,7 +520,7 @@ public function setNote($note = null) { // validation for constraint: string if (!is_null($note) && !is_string($note)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($note)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); } $this->Note = $note; return $this; @@ -541,7 +542,7 @@ public function setCheckoutStatus($checkoutStatus = null) { // validation for constraint: string if (!is_null($checkoutStatus) && !is_string($checkoutStatus)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($checkoutStatus)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($checkoutStatus, true), gettype($checkoutStatus)), __LINE__); } $this->CheckoutStatus = $checkoutStatus; return $this; @@ -572,6 +573,28 @@ public function getPaymentDetails() { return $this->PaymentDetails; } + /** + * This method is responsible for validating the values passed to the setPaymentDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentDetailsForArrayConstraintsFromSetPaymentDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem) { + // validation for constraint: itemType + if (!$getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem instanceof \PayPal\StructType\PaymentDetailsType) { + $invalidValues[] = is_object($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem) : sprintf('%s(%s)', gettype($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem), var_export($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentDetails value * @throws \InvalidArgumentException @@ -580,11 +603,13 @@ public function getPaymentDetails() */ public function setPaymentDetails(array $paymentDetails = array()) { - foreach ($paymentDetails as $getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem) { - // validation for constraint: itemType - if (!$getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem instanceof \PayPal\StructType\PaymentDetailsType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetails property can only contain items of \PayPal\StructType\PaymentDetailsType, "%s" given', is_object($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem) : gettype($getExpressCheckoutDetailsResponseDetailsTypePaymentDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentDetailsArrayErrorMessage = self::validatePaymentDetailsForArrayConstraintsFromSetPaymentDetails($paymentDetails))) { + throw new \InvalidArgumentException($paymentDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($paymentDetails) && count($paymentDetails) > 10) { + 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__); } $this->PaymentDetails = $paymentDetails; return $this; @@ -599,7 +624,11 @@ public function addToPaymentDetails(\PayPal\StructType\PaymentDetailsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentDetailsType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetails property can only contain items of \PayPal\StructType\PaymentDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->PaymentDetails) && count($this->PaymentDetails) >= 10) { + 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__); } $this->PaymentDetails[] = $item; return $this; @@ -630,6 +659,28 @@ public function getIncentiveDetails() { return $this->IncentiveDetails; } + /** + * This method is responsible for validating the values passed to the setIncentiveDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setIncentiveDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateIncentiveDetailsForArrayConstraintsFromSetIncentiveDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem) { + // validation for constraint: itemType + if (!$getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem instanceof \PayPal\StructType\IncentiveDetailsType) { + $invalidValues[] = is_object($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem) : sprintf('%s(%s)', gettype($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem), var_export($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set IncentiveDetails value * @throws \InvalidArgumentException @@ -638,11 +689,9 @@ public function getIncentiveDetails() */ public function setIncentiveDetails(array $incentiveDetails = array()) { - foreach ($incentiveDetails as $getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem) { - // validation for constraint: itemType - if (!$getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem instanceof \PayPal\StructType\IncentiveDetailsType) { - throw new \InvalidArgumentException(sprintf('The IncentiveDetails property can only contain items of \PayPal\StructType\IncentiveDetailsType, "%s" given', is_object($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem) : gettype($getExpressCheckoutDetailsResponseDetailsTypeIncentiveDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($incentiveDetailsArrayErrorMessage = self::validateIncentiveDetailsForArrayConstraintsFromSetIncentiveDetails($incentiveDetails))) { + throw new \InvalidArgumentException($incentiveDetailsArrayErrorMessage, __LINE__); } $this->IncentiveDetails = $incentiveDetails; return $this; @@ -657,7 +706,7 @@ public function addToIncentiveDetails(\PayPal\StructType\IncentiveDetailsType $i { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\IncentiveDetailsType) { - throw new \InvalidArgumentException(sprintf('The IncentiveDetails property can only contain items of \PayPal\StructType\IncentiveDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); } $this->IncentiveDetails[] = $item; return $this; @@ -679,7 +728,7 @@ public function setGiftMessage($giftMessage = null) { // validation for constraint: string if (!is_null($giftMessage) && !is_string($giftMessage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftMessage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftMessage, true), gettype($giftMessage)), __LINE__); } $this->GiftMessage = $giftMessage; return $this; @@ -701,7 +750,7 @@ public function setGiftReceiptEnable($giftReceiptEnable = null) { // validation for constraint: string if (!is_null($giftReceiptEnable) && !is_string($giftReceiptEnable)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftReceiptEnable)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftReceiptEnable, true), gettype($giftReceiptEnable)), __LINE__); } $this->GiftReceiptEnable = $giftReceiptEnable; return $this; @@ -723,7 +772,7 @@ public function setGiftWrapName($giftWrapName = null) { // validation for constraint: string if (!is_null($giftWrapName) && !is_string($giftWrapName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftWrapName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftWrapName, true), gettype($giftWrapName)), __LINE__); } $this->GiftWrapName = $giftWrapName; return $this; @@ -763,7 +812,7 @@ public function setBuyerMarketingEmail($buyerMarketingEmail = null) { // validation for constraint: string if (!is_null($buyerMarketingEmail) && !is_string($buyerMarketingEmail)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerMarketingEmail)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerMarketingEmail, true), gettype($buyerMarketingEmail)), __LINE__); } $this->BuyerMarketingEmail = $buyerMarketingEmail; return $this; @@ -785,7 +834,7 @@ public function setSurveyQuestion($surveyQuestion = null) { // validation for constraint: string if (!is_null($surveyQuestion) && !is_string($surveyQuestion)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($surveyQuestion)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($surveyQuestion, true), gettype($surveyQuestion)), __LINE__); } $this->SurveyQuestion = $surveyQuestion; return $this; @@ -798,6 +847,28 @@ public function getSurveyChoiceSelected() { return $this->SurveyChoiceSelected; } + /** + * This method is responsible for validating the values passed to the setSurveyChoiceSelected method + * This method is willingly generated in order to preserve the one-line inline validation within the setSurveyChoiceSelected method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateSurveyChoiceSelectedForArrayConstraintsFromSetSurveyChoiceSelected(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem) { + // validation for constraint: itemType + if (!is_string($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem)) { + $invalidValues[] = is_object($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem) : sprintf('%s(%s)', gettype($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem), var_export($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set SurveyChoiceSelected value * @throws \InvalidArgumentException @@ -806,11 +877,9 @@ public function getSurveyChoiceSelected() */ public function setSurveyChoiceSelected(array $surveyChoiceSelected = array()) { - foreach ($surveyChoiceSelected as $getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem) { - // validation for constraint: itemType - if (!is_string($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem)) { - throw new \InvalidArgumentException(sprintf('The SurveyChoiceSelected property can only contain items of string, "%s" given', is_object($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem) : gettype($getExpressCheckoutDetailsResponseDetailsTypeSurveyChoiceSelectedItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($surveyChoiceSelectedArrayErrorMessage = self::validateSurveyChoiceSelectedForArrayConstraintsFromSetSurveyChoiceSelected($surveyChoiceSelected))) { + throw new \InvalidArgumentException($surveyChoiceSelectedArrayErrorMessage, __LINE__); } $this->SurveyChoiceSelected = $surveyChoiceSelected; return $this; @@ -825,7 +894,7 @@ public function addToSurveyChoiceSelected($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The SurveyChoiceSelected property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); } $this->SurveyChoiceSelected[] = $item; return $this; @@ -838,6 +907,28 @@ public function getPaymentRequestInfo() { return $this->PaymentRequestInfo; } + /** + * This method is responsible for validating the values passed to the setPaymentRequestInfo method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentRequestInfo method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentRequestInfoForArrayConstraintsFromSetPaymentRequestInfo(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem) { + // validation for constraint: itemType + if (!$getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem instanceof \PayPal\StructType\PaymentRequestInfoType) { + $invalidValues[] = is_object($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem) : sprintf('%s(%s)', gettype($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem), var_export($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentRequestInfo value * @throws \InvalidArgumentException @@ -846,11 +937,13 @@ public function getPaymentRequestInfo() */ public function setPaymentRequestInfo(array $paymentRequestInfo = array()) { - foreach ($paymentRequestInfo as $getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem) { - // validation for constraint: itemType - if (!$getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem instanceof \PayPal\StructType\PaymentRequestInfoType) { - throw new \InvalidArgumentException(sprintf('The PaymentRequestInfo property can only contain items of \PayPal\StructType\PaymentRequestInfoType, "%s" given', is_object($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem) : gettype($getExpressCheckoutDetailsResponseDetailsTypePaymentRequestInfoItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentRequestInfoArrayErrorMessage = self::validatePaymentRequestInfoForArrayConstraintsFromSetPaymentRequestInfo($paymentRequestInfo))) { + throw new \InvalidArgumentException($paymentRequestInfoArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($paymentRequestInfo) && count($paymentRequestInfo) > 10) { + 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($paymentRequestInfo)), __LINE__); } $this->PaymentRequestInfo = $paymentRequestInfo; return $this; @@ -865,7 +958,11 @@ public function addToPaymentRequestInfo(\PayPal\StructType\PaymentRequestInfoTyp { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentRequestInfoType) { - throw new \InvalidArgumentException(sprintf('The PaymentRequestInfo property can only contain items of \PayPal\StructType\PaymentRequestInfoType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->PaymentRequestInfo) && count($this->PaymentRequestInfo) >= 10) { + 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__); } $this->PaymentRequestInfo[] = $item; return $this; @@ -914,6 +1011,28 @@ public function getPaymentInfo() { return $this->PaymentInfo; } + /** + * This method is responsible for validating the values passed to the setPaymentInfo method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentInfo method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentInfoForArrayConstraintsFromSetPaymentInfo(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem) { + // validation for constraint: itemType + if (!$getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem instanceof \PayPal\StructType\PaymentInfoType) { + $invalidValues[] = is_object($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem) : sprintf('%s(%s)', gettype($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem), var_export($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentInfo value * @throws \InvalidArgumentException @@ -922,11 +1041,13 @@ public function getPaymentInfo() */ public function setPaymentInfo(array $paymentInfo = array()) { - foreach ($paymentInfo as $getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem) { - // validation for constraint: itemType - if (!$getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem instanceof \PayPal\StructType\PaymentInfoType) { - throw new \InvalidArgumentException(sprintf('The PaymentInfo property can only contain items of \PayPal\StructType\PaymentInfoType, "%s" given', is_object($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem) ? get_class($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem) : gettype($getExpressCheckoutDetailsResponseDetailsTypePaymentInfoItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentInfoArrayErrorMessage = self::validatePaymentInfoForArrayConstraintsFromSetPaymentInfo($paymentInfo))) { + throw new \InvalidArgumentException($paymentInfoArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($paymentInfo) && count($paymentInfo) > 10) { + 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__); } $this->PaymentInfo = $paymentInfo; return $this; @@ -941,7 +1062,11 @@ public function addToPaymentInfo(\PayPal\StructType\PaymentInfoType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentInfoType) { - throw new \InvalidArgumentException(sprintf('The PaymentInfo property can only contain items of \PayPal\StructType\PaymentInfoType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->PaymentInfo) && count($this->PaymentInfo) >= 10) { + 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__); } $this->PaymentInfo[] = $item; return $this; @@ -963,7 +1088,7 @@ public function setCartChangeTolerance($cartChangeTolerance = null) { // validation for constraint: string if (!is_null($cartChangeTolerance) && !is_string($cartChangeTolerance)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cartChangeTolerance)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cartChangeTolerance, true), gettype($cartChangeTolerance)), __LINE__); } $this->CartChangeTolerance = $cartChangeTolerance; return $this; diff --git a/src/StructType/GetExpressCheckoutDetailsResponseType.php b/src/StructType/GetExpressCheckoutDetailsResponseType.php index 0c7b32b..8893bd3 100644 --- a/src/StructType/GetExpressCheckoutDetailsResponseType.php +++ b/src/StructType/GetExpressCheckoutDetailsResponseType.php @@ -13,7 +13,7 @@ class GetExpressCheckoutDetailsResponseType extends AbstractResponseType { /** * The GetExpressCheckoutDetailsResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:GetExpressCheckoutDetailsResponseDetails diff --git a/src/StructType/GetIncentiveEvaluationReq.php b/src/StructType/GetIncentiveEvaluationReq.php index 6360359..76107e5 100644 --- a/src/StructType/GetIncentiveEvaluationReq.php +++ b/src/StructType/GetIncentiveEvaluationReq.php @@ -13,7 +13,7 @@ class GetIncentiveEvaluationReq extends AbstractStructBase { /** * The GetIncentiveEvaluationRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetIncentiveEvaluationRequest * @var \PayPal\StructType\GetIncentiveEvaluationRequestType */ diff --git a/src/StructType/GetIncentiveEvaluationRequestDetailsType.php b/src/StructType/GetIncentiveEvaluationRequestDetailsType.php index d0bdeee..26efeec 100644 --- a/src/StructType/GetIncentiveEvaluationRequestDetailsType.php +++ b/src/StructType/GetIncentiveEvaluationRequestDetailsType.php @@ -13,7 +13,7 @@ class GetIncentiveEvaluationRequestDetailsType extends AbstractStructBase { /** * The ExternalBuyerId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class GetIncentiveEvaluationRequestDetailsType extends AbstractStructBase public $ExternalBuyerId; /** * The IncentiveCodes - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1000 * - minOccurs: 0 * @var string[] @@ -29,7 +29,7 @@ class GetIncentiveEvaluationRequestDetailsType extends AbstractStructBase public $IncentiveCodes; /** * The ApplyIndication - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1000 * - minOccurs: 0 * @var \PayPal\StructType\IncentiveApplyIndicationType[] @@ -37,7 +37,7 @@ class GetIncentiveEvaluationRequestDetailsType extends AbstractStructBase public $ApplyIndication; /** * The Buckets - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 100 * - minOccurs: 0 * @var \PayPal\StructType\IncentiveBucketType[] @@ -45,7 +45,7 @@ class GetIncentiveEvaluationRequestDetailsType extends AbstractStructBase public $Buckets; /** * The CartTotalAmt - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -53,7 +53,7 @@ class GetIncentiveEvaluationRequestDetailsType extends AbstractStructBase public $CartTotalAmt; /** * The RequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\IncentiveRequestDetailsType @@ -101,7 +101,7 @@ public function setExternalBuyerId($externalBuyerId = null) { // validation for constraint: string if (!is_null($externalBuyerId) && !is_string($externalBuyerId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalBuyerId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalBuyerId, true), gettype($externalBuyerId)), __LINE__); } $this->ExternalBuyerId = $externalBuyerId; return $this; @@ -114,6 +114,28 @@ public function getIncentiveCodes() { return $this->IncentiveCodes; } + /** + * This method is responsible for validating the values passed to the setIncentiveCodes method + * This method is willingly generated in order to preserve the one-line inline validation within the setIncentiveCodes method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateIncentiveCodesForArrayConstraintsFromSetIncentiveCodes(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem) { + // validation for constraint: itemType + if (!is_string($getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem)) { + $invalidValues[] = is_object($getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem) ? get_class($getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem) : sprintf('%s(%s)', gettype($getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem), var_export($getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The IncentiveCodes property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set IncentiveCodes value * @throws \InvalidArgumentException @@ -122,11 +144,13 @@ public function getIncentiveCodes() */ public function setIncentiveCodes(array $incentiveCodes = array()) { - foreach ($incentiveCodes as $getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem) { - // validation for constraint: itemType - if (!is_string($getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem)) { - throw new \InvalidArgumentException(sprintf('The IncentiveCodes property can only contain items of string, "%s" given', is_object($getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem) ? get_class($getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem) : gettype($getIncentiveEvaluationRequestDetailsTypeIncentiveCodesItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($incentiveCodesArrayErrorMessage = self::validateIncentiveCodesForArrayConstraintsFromSetIncentiveCodes($incentiveCodes))) { + throw new \InvalidArgumentException($incentiveCodesArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($incentiveCodes) && count($incentiveCodes) > 1000) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 1000', count($incentiveCodes)), __LINE__); } $this->IncentiveCodes = $incentiveCodes; return $this; @@ -141,7 +165,11 @@ public function addToIncentiveCodes($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The IncentiveCodes property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The IncentiveCodes property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($this->IncentiveCodes) && count($this->IncentiveCodes) >= 1000) { + 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 1000', count($this->IncentiveCodes)), __LINE__); } $this->IncentiveCodes[] = $item; return $this; @@ -154,6 +182,28 @@ public function getApplyIndication() { return $this->ApplyIndication; } + /** + * This method is responsible for validating the values passed to the setApplyIndication method + * This method is willingly generated in order to preserve the one-line inline validation within the setApplyIndication method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateApplyIndicationForArrayConstraintsFromSetApplyIndication(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem) { + // validation for constraint: itemType + if (!$getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem instanceof \PayPal\StructType\IncentiveApplyIndicationType) { + $invalidValues[] = is_object($getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem) ? get_class($getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem) : sprintf('%s(%s)', gettype($getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem), var_export($getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The ApplyIndication property can only contain items of type \PayPal\StructType\IncentiveApplyIndicationType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set ApplyIndication value * @throws \InvalidArgumentException @@ -162,11 +212,13 @@ public function getApplyIndication() */ public function setApplyIndication(array $applyIndication = array()) { - foreach ($applyIndication as $getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem) { - // validation for constraint: itemType - if (!$getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem instanceof \PayPal\StructType\IncentiveApplyIndicationType) { - throw new \InvalidArgumentException(sprintf('The ApplyIndication property can only contain items of \PayPal\StructType\IncentiveApplyIndicationType, "%s" given', is_object($getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem) ? get_class($getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem) : gettype($getIncentiveEvaluationRequestDetailsTypeApplyIndicationItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($applyIndicationArrayErrorMessage = self::validateApplyIndicationForArrayConstraintsFromSetApplyIndication($applyIndication))) { + throw new \InvalidArgumentException($applyIndicationArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($applyIndication) && count($applyIndication) > 1000) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 1000', count($applyIndication)), __LINE__); } $this->ApplyIndication = $applyIndication; return $this; @@ -181,7 +233,11 @@ public function addToApplyIndication(\PayPal\StructType\IncentiveApplyIndication { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\IncentiveApplyIndicationType) { - throw new \InvalidArgumentException(sprintf('The ApplyIndication property can only contain items of \PayPal\StructType\IncentiveApplyIndicationType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The ApplyIndication property can only contain items of type \PayPal\StructType\IncentiveApplyIndicationType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($this->ApplyIndication) && count($this->ApplyIndication) >= 1000) { + 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 1000', count($this->ApplyIndication)), __LINE__); } $this->ApplyIndication[] = $item; return $this; @@ -194,6 +250,28 @@ public function getBuckets() { return $this->Buckets; } + /** + * This method is responsible for validating the values passed to the setBuckets method + * This method is willingly generated in order to preserve the one-line inline validation within the setBuckets method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateBucketsForArrayConstraintsFromSetBuckets(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getIncentiveEvaluationRequestDetailsTypeBucketsItem) { + // validation for constraint: itemType + if (!$getIncentiveEvaluationRequestDetailsTypeBucketsItem instanceof \PayPal\StructType\IncentiveBucketType) { + $invalidValues[] = is_object($getIncentiveEvaluationRequestDetailsTypeBucketsItem) ? get_class($getIncentiveEvaluationRequestDetailsTypeBucketsItem) : sprintf('%s(%s)', gettype($getIncentiveEvaluationRequestDetailsTypeBucketsItem), var_export($getIncentiveEvaluationRequestDetailsTypeBucketsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Buckets property can only contain items of type \PayPal\StructType\IncentiveBucketType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Buckets value * @throws \InvalidArgumentException @@ -202,11 +280,13 @@ public function getBuckets() */ public function setBuckets(array $buckets = array()) { - foreach ($buckets as $getIncentiveEvaluationRequestDetailsTypeBucketsItem) { - // validation for constraint: itemType - if (!$getIncentiveEvaluationRequestDetailsTypeBucketsItem instanceof \PayPal\StructType\IncentiveBucketType) { - throw new \InvalidArgumentException(sprintf('The Buckets property can only contain items of \PayPal\StructType\IncentiveBucketType, "%s" given', is_object($getIncentiveEvaluationRequestDetailsTypeBucketsItem) ? get_class($getIncentiveEvaluationRequestDetailsTypeBucketsItem) : gettype($getIncentiveEvaluationRequestDetailsTypeBucketsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($bucketsArrayErrorMessage = self::validateBucketsForArrayConstraintsFromSetBuckets($buckets))) { + throw new \InvalidArgumentException($bucketsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(100) + if (is_array($buckets) && count($buckets) > 100) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 100', count($buckets)), __LINE__); } $this->Buckets = $buckets; return $this; @@ -221,7 +301,11 @@ public function addToBuckets(\PayPal\StructType\IncentiveBucketType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\IncentiveBucketType) { - throw new \InvalidArgumentException(sprintf('The Buckets property can only contain items of \PayPal\StructType\IncentiveBucketType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Buckets property can only contain items of type \PayPal\StructType\IncentiveBucketType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(100) + if (is_array($this->Buckets) && count($this->Buckets) >= 100) { + 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 100', count($this->Buckets)), __LINE__); } $this->Buckets[] = $item; return $this; diff --git a/src/StructType/GetIncentiveEvaluationRequestType.php b/src/StructType/GetIncentiveEvaluationRequestType.php index 3a2816d..702fa3b 100644 --- a/src/StructType/GetIncentiveEvaluationRequestType.php +++ b/src/StructType/GetIncentiveEvaluationRequestType.php @@ -13,7 +13,7 @@ class GetIncentiveEvaluationRequestType extends AbstractRequestType { /** * The GetIncentiveEvaluationRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:GetIncentiveEvaluationRequestDetails diff --git a/src/StructType/GetIncentiveEvaluationResponseDetailsType.php b/src/StructType/GetIncentiveEvaluationResponseDetailsType.php index dd0b811..1338d08 100644 --- a/src/StructType/GetIncentiveEvaluationResponseDetailsType.php +++ b/src/StructType/GetIncentiveEvaluationResponseDetailsType.php @@ -13,7 +13,7 @@ class GetIncentiveEvaluationResponseDetailsType extends AbstractStructBase { /** * The IncentiveDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1000 * - minOccurs: 0 * @var \PayPal\StructType\IncentiveDetailType[] @@ -21,7 +21,7 @@ class GetIncentiveEvaluationResponseDetailsType extends AbstractStructBase public $IncentiveDetails; /** * The RequestId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -48,6 +48,28 @@ public function getIncentiveDetails() { return $this->IncentiveDetails; } + /** + * This method is responsible for validating the values passed to the setIncentiveDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setIncentiveDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateIncentiveDetailsForArrayConstraintsFromSetIncentiveDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem) { + // validation for constraint: itemType + if (!$getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem instanceof \PayPal\StructType\IncentiveDetailType) { + $invalidValues[] = is_object($getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem) ? get_class($getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem) : sprintf('%s(%s)', gettype($getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem), var_export($getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The IncentiveDetails property can only contain items of type \PayPal\StructType\IncentiveDetailType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set IncentiveDetails value * @throws \InvalidArgumentException @@ -56,11 +78,13 @@ public function getIncentiveDetails() */ public function setIncentiveDetails(array $incentiveDetails = array()) { - foreach ($incentiveDetails as $getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem) { - // validation for constraint: itemType - if (!$getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem instanceof \PayPal\StructType\IncentiveDetailType) { - throw new \InvalidArgumentException(sprintf('The IncentiveDetails property can only contain items of \PayPal\StructType\IncentiveDetailType, "%s" given', is_object($getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem) ? get_class($getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem) : gettype($getIncentiveEvaluationResponseDetailsTypeIncentiveDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($incentiveDetailsArrayErrorMessage = self::validateIncentiveDetailsForArrayConstraintsFromSetIncentiveDetails($incentiveDetails))) { + throw new \InvalidArgumentException($incentiveDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($incentiveDetails) && count($incentiveDetails) > 1000) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 1000', count($incentiveDetails)), __LINE__); } $this->IncentiveDetails = $incentiveDetails; return $this; @@ -75,7 +99,11 @@ public function addToIncentiveDetails(\PayPal\StructType\IncentiveDetailType $it { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\IncentiveDetailType) { - throw new \InvalidArgumentException(sprintf('The IncentiveDetails property can only contain items of \PayPal\StructType\IncentiveDetailType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The IncentiveDetails property can only contain items of type \PayPal\StructType\IncentiveDetailType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(1000) + if (is_array($this->IncentiveDetails) && count($this->IncentiveDetails) >= 1000) { + 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 1000', count($this->IncentiveDetails)), __LINE__); } $this->IncentiveDetails[] = $item; return $this; @@ -97,7 +125,7 @@ public function setRequestId($requestId = null) { // validation for constraint: string if (!is_null($requestId) && !is_string($requestId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($requestId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($requestId, true), gettype($requestId)), __LINE__); } $this->RequestId = $requestId; return $this; diff --git a/src/StructType/GetIncentiveEvaluationResponseType.php b/src/StructType/GetIncentiveEvaluationResponseType.php index 336ac2a..5bd2066 100644 --- a/src/StructType/GetIncentiveEvaluationResponseType.php +++ b/src/StructType/GetIncentiveEvaluationResponseType.php @@ -13,7 +13,7 @@ class GetIncentiveEvaluationResponseType extends AbstractResponseType { /** * The GetIncentiveEvaluationResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:GetIncentiveEvaluationResponseDetails diff --git a/src/StructType/GetMobileStatusReq.php b/src/StructType/GetMobileStatusReq.php index cfc51c9..cfbc9fc 100644 --- a/src/StructType/GetMobileStatusReq.php +++ b/src/StructType/GetMobileStatusReq.php @@ -13,7 +13,7 @@ class GetMobileStatusReq extends AbstractStructBase { /** * The GetMobileStatusRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetMobileStatusRequest * @var \PayPal\StructType\GetMobileStatusRequestType */ diff --git a/src/StructType/GetMobileStatusRequestDetailsType.php b/src/StructType/GetMobileStatusRequestDetailsType.php index 6ea67f0..1a2058c 100644 --- a/src/StructType/GetMobileStatusRequestDetailsType.php +++ b/src/StructType/GetMobileStatusRequestDetailsType.php @@ -13,7 +13,7 @@ class GetMobileStatusRequestDetailsType extends AbstractStructBase { /** * The Phone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Phone number for status inquiry * @var \PayPal\StructType\PhoneNumberType */ diff --git a/src/StructType/GetMobileStatusRequestType.php b/src/StructType/GetMobileStatusRequestType.php index 7ef226a..f4efc96 100644 --- a/src/StructType/GetMobileStatusRequestType.php +++ b/src/StructType/GetMobileStatusRequestType.php @@ -13,7 +13,7 @@ class GetMobileStatusRequestType extends AbstractRequestType { /** * The GetMobileStatusRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:GetMobileStatusRequestDetails diff --git a/src/StructType/GetMobileStatusResponseType.php b/src/StructType/GetMobileStatusResponseType.php index dfbb4f9..10fc176 100644 --- a/src/StructType/GetMobileStatusResponseType.php +++ b/src/StructType/GetMobileStatusResponseType.php @@ -13,7 +13,7 @@ class GetMobileStatusResponseType extends AbstractResponseType { /** * The IsActivated - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether the phone is activated for mobile payments * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class GetMobileStatusResponseType extends AbstractResponseType public $IsActivated; /** * The IsPasswordSet - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether the password is enabled for particular account * - maxOccurs: 1 * - minOccurs: 1 @@ -31,7 +31,7 @@ class GetMobileStatusResponseType extends AbstractResponseType public $IsPasswordSet; /** * The PaymentPending - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether there is a payment pending from the phone * - maxOccurs: 1 * - minOccurs: 1 @@ -70,8 +70,8 @@ public function getIsActivated() public function setIsActivated($isActivated = null) { // validation for constraint: int - if (!is_null($isActivated) && !is_numeric($isActivated)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($isActivated)), __LINE__); + if (!is_null($isActivated) && !(is_int($isActivated) || ctype_digit($isActivated))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isActivated, true), gettype($isActivated)), __LINE__); } $this->IsActivated = $isActivated; return $this; @@ -92,8 +92,8 @@ public function getIsPasswordSet() public function setIsPasswordSet($isPasswordSet = null) { // validation for constraint: int - if (!is_null($isPasswordSet) && !is_numeric($isPasswordSet)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($isPasswordSet)), __LINE__); + if (!is_null($isPasswordSet) && !(is_int($isPasswordSet) || ctype_digit($isPasswordSet))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isPasswordSet, true), gettype($isPasswordSet)), __LINE__); } $this->IsPasswordSet = $isPasswordSet; return $this; @@ -114,8 +114,8 @@ public function getPaymentPending() public function setPaymentPending($paymentPending = null) { // validation for constraint: int - if (!is_null($paymentPending) && !is_numeric($paymentPending)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($paymentPending)), __LINE__); + if (!is_null($paymentPending) && !(is_int($paymentPending) || ctype_digit($paymentPending))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($paymentPending, true), gettype($paymentPending)), __LINE__); } $this->PaymentPending = $paymentPending; return $this; diff --git a/src/StructType/GetPalDetailsReq.php b/src/StructType/GetPalDetailsReq.php index b345990..d8158a9 100644 --- a/src/StructType/GetPalDetailsReq.php +++ b/src/StructType/GetPalDetailsReq.php @@ -13,7 +13,7 @@ class GetPalDetailsReq extends AbstractStructBase { /** * The GetPalDetailsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetPalDetailsRequest * @var \PayPal\StructType\GetPalDetailsRequestType */ diff --git a/src/StructType/GetPalDetailsRequestType.php b/src/StructType/GetPalDetailsRequestType.php index 3458ad5..f91dc79 100644 --- a/src/StructType/GetPalDetailsRequestType.php +++ b/src/StructType/GetPalDetailsRequestType.php @@ -11,12 +11,6 @@ */ class GetPalDetailsRequestType extends AbstractRequestType { - /** - * Constructor method for GetPalDetailsRequestType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/GetPalDetailsResponseType.php b/src/StructType/GetPalDetailsResponseType.php index c4d8309..dc81c09 100644 --- a/src/StructType/GetPalDetailsResponseType.php +++ b/src/StructType/GetPalDetailsResponseType.php @@ -13,7 +13,7 @@ class GetPalDetailsResponseType extends AbstractResponseType { /** * The Pal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -21,7 +21,7 @@ class GetPalDetailsResponseType extends AbstractResponseType public $Pal; /** * The Locale - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -57,7 +57,7 @@ public function setPal($pal = null) { // validation for constraint: string if (!is_null($pal) && !is_string($pal)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pal)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pal, true), gettype($pal)), __LINE__); } $this->Pal = $pal; return $this; @@ -79,7 +79,7 @@ public function setLocale($locale = null) { // validation for constraint: string if (!is_null($locale) && !is_string($locale)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($locale)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($locale, true), gettype($locale)), __LINE__); } $this->Locale = $locale; return $this; diff --git a/src/StructType/GetRecurringPaymentsProfileDetailsReq.php b/src/StructType/GetRecurringPaymentsProfileDetailsReq.php index 1979c01..1bdae0c 100644 --- a/src/StructType/GetRecurringPaymentsProfileDetailsReq.php +++ b/src/StructType/GetRecurringPaymentsProfileDetailsReq.php @@ -13,7 +13,7 @@ class GetRecurringPaymentsProfileDetailsReq extends AbstractStructBase { /** * The GetRecurringPaymentsProfileDetailsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetRecurringPaymentsProfileDetailsRequest * @var \PayPal\StructType\GetRecurringPaymentsProfileDetailsRequestType */ diff --git a/src/StructType/GetRecurringPaymentsProfileDetailsRequestType.php b/src/StructType/GetRecurringPaymentsProfileDetailsRequestType.php index b66c08a..23ebc29 100644 --- a/src/StructType/GetRecurringPaymentsProfileDetailsRequestType.php +++ b/src/StructType/GetRecurringPaymentsProfileDetailsRequestType.php @@ -13,7 +13,7 @@ class GetRecurringPaymentsProfileDetailsRequestType extends AbstractRequestType { /** * The ProfileID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -46,7 +46,7 @@ public function setProfileID($profileID = null) { // validation for constraint: string if (!is_null($profileID) && !is_string($profileID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileID, true), gettype($profileID)), __LINE__); } $this->ProfileID = $profileID; return $this; diff --git a/src/StructType/GetRecurringPaymentsProfileDetailsResponseDetailsType.php b/src/StructType/GetRecurringPaymentsProfileDetailsResponseDetailsType.php index 16a4a4e..aa8af7b 100644 --- a/src/StructType/GetRecurringPaymentsProfileDetailsResponseDetailsType.php +++ b/src/StructType/GetRecurringPaymentsProfileDetailsResponseDetailsType.php @@ -14,7 +14,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru { /** * The ProfileID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Recurring Billing Profile ID * - maxOccurs: 1 * - minOccurs: 1 @@ -23,7 +23,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $ProfileID; /** * The ProfileStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -31,7 +31,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $ProfileStatus; /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -39,7 +39,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $Description; /** * The AutoBillOutstandingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -47,7 +47,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $AutoBillOutstandingAmount; /** * The MaxFailedPayments - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var int @@ -55,7 +55,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $MaxFailedPayments; /** * The RecurringPaymentsProfileDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var \PayPal\StructType\RecurringPaymentsProfileDetailsType @@ -63,7 +63,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $RecurringPaymentsProfileDetails; /** * The RecurringPaymentsSummary - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var \PayPal\StructType\RecurringPaymentsSummaryType @@ -71,7 +71,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $RecurringPaymentsSummary; /** * The CurrentRecurringPaymentsPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BillingPeriodDetailsType @@ -79,7 +79,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $CurrentRecurringPaymentsPeriod; /** * The CreditCard - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\CreditCardDetailsType @@ -87,7 +87,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $CreditCard; /** * The TrialRecurringPaymentsPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BillingPeriodDetailsType @@ -95,7 +95,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $TrialRecurringPaymentsPeriod; /** * The RegularRecurringPaymentsPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BillingPeriodDetailsType @@ -103,7 +103,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $RegularRecurringPaymentsPeriod; /** * The TrialAmountPaid - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -111,7 +111,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $TrialAmountPaid; /** * The RegularAmountPaid - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -119,7 +119,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $RegularAmountPaid; /** * The AggregateAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -127,7 +127,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $AggregateAmount; /** * The AggregateOptionalAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -135,7 +135,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $AggregateOptionalAmount; /** * The FinalPaymentDueDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -143,7 +143,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $FinalPaymentDueDate; /** * The SoftDescriptor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Use this optional parameter to pass in your business name and other data describing the transaction. Optional This information is usually displayed in the account holder's statement. Example: RedCross Haiti, RedCross Uganda, * Realtor.com dues, Realtor.com list fee Length 25 characters. Alphanumeric characters and dash(-), dot(.), asterisk(*), space( ) On the customer's statement, an asterisk is used to separate the DBA name and product name. The asterisk delimiter can * appear in position 4, 8, or 13. @@ -154,7 +154,7 @@ class GetRecurringPaymentsProfileDetailsResponseDetailsType extends AbstractStru public $SoftDescriptor; /** * The SoftDescriptorCity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Use this optional parameter to pass information about how consumer should contact the merchant. Optional This information is usually displayed in the account holder's statement. For Ecom trx: phone, email or URL is allowed For Retail * trx: only the actual city is allowed For details on allowed characters in Soft Descriptor City refer to the API documentation. * - maxOccurs: 1 @@ -240,7 +240,7 @@ public function setProfileID($profileID = null) { // validation for constraint: string if (!is_null($profileID) && !is_string($profileID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileID, true), gettype($profileID)), __LINE__); } $this->ProfileID = $profileID; return $this; @@ -265,7 +265,7 @@ public function setProfileStatus($profileStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\RecurringPaymentsProfileStatusType::valueIsValid($profileStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $profileStatus, implode(', ', \PayPal\EnumType\RecurringPaymentsProfileStatusType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\RecurringPaymentsProfileStatusType', is_array($profileStatus) ? implode(', ', $profileStatus) : var_export($profileStatus, true), implode(', ', \PayPal\EnumType\RecurringPaymentsProfileStatusType::getValidValues())), __LINE__); } $this->ProfileStatus = $profileStatus; return $this; @@ -287,7 +287,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this; @@ -312,7 +312,7 @@ public function setAutoBillOutstandingAmount($autoBillOutstandingAmount = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AutoBillType::valueIsValid($autoBillOutstandingAmount)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $autoBillOutstandingAmount, implode(', ', \PayPal\EnumType\AutoBillType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AutoBillType', is_array($autoBillOutstandingAmount) ? implode(', ', $autoBillOutstandingAmount) : var_export($autoBillOutstandingAmount, true), implode(', ', \PayPal\EnumType\AutoBillType::getValidValues())), __LINE__); } $this->AutoBillOutstandingAmount = $autoBillOutstandingAmount; return $this; @@ -333,8 +333,8 @@ public function getMaxFailedPayments() public function setMaxFailedPayments($maxFailedPayments = null) { // validation for constraint: int - if (!is_null($maxFailedPayments) && !is_numeric($maxFailedPayments)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($maxFailedPayments)), __LINE__); + if (!is_null($maxFailedPayments) && !(is_int($maxFailedPayments) || ctype_digit($maxFailedPayments))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($maxFailedPayments, true), gettype($maxFailedPayments)), __LINE__); } $this->MaxFailedPayments = $maxFailedPayments; return $this; @@ -536,7 +536,7 @@ public function setFinalPaymentDueDate($finalPaymentDueDate = null) { // validation for constraint: string if (!is_null($finalPaymentDueDate) && !is_string($finalPaymentDueDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($finalPaymentDueDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($finalPaymentDueDate, true), gettype($finalPaymentDueDate)), __LINE__); } $this->FinalPaymentDueDate = $finalPaymentDueDate; return $this; @@ -558,7 +558,7 @@ public function setSoftDescriptor($softDescriptor = null) { // validation for constraint: string if (!is_null($softDescriptor) && !is_string($softDescriptor)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptor)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptor, true), gettype($softDescriptor)), __LINE__); } $this->SoftDescriptor = $softDescriptor; return $this; @@ -580,7 +580,7 @@ public function setSoftDescriptorCity($softDescriptorCity = null) { // validation for constraint: string if (!is_null($softDescriptorCity) && !is_string($softDescriptorCity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptorCity)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptorCity, true), gettype($softDescriptorCity)), __LINE__); } $this->SoftDescriptorCity = $softDescriptorCity; return $this; diff --git a/src/StructType/GetRecurringPaymentsProfileDetailsResponseType.php b/src/StructType/GetRecurringPaymentsProfileDetailsResponseType.php index 19fd3b0..c4545f2 100644 --- a/src/StructType/GetRecurringPaymentsProfileDetailsResponseType.php +++ b/src/StructType/GetRecurringPaymentsProfileDetailsResponseType.php @@ -13,7 +13,7 @@ class GetRecurringPaymentsProfileDetailsResponseType extends AbstractResponseTyp { /** * The GetRecurringPaymentsProfileDetailsResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:GetRecurringPaymentsProfileDetailsResponseDetails * @var \PayPal\StructType\GetRecurringPaymentsProfileDetailsResponseDetailsType */ diff --git a/src/StructType/GetTransactionDetailsReq.php b/src/StructType/GetTransactionDetailsReq.php index 94703e1..8a813c9 100644 --- a/src/StructType/GetTransactionDetailsReq.php +++ b/src/StructType/GetTransactionDetailsReq.php @@ -13,7 +13,7 @@ class GetTransactionDetailsReq extends AbstractStructBase { /** * The GetTransactionDetailsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:GetTransactionDetailsRequest * @var \PayPal\StructType\GetTransactionDetailsRequestType */ diff --git a/src/StructType/GetTransactionDetailsRequestType.php b/src/StructType/GetTransactionDetailsRequestType.php index f94dcbf..bbc8475 100644 --- a/src/StructType/GetTransactionDetailsRequestType.php +++ b/src/StructType/GetTransactionDetailsRequestType.php @@ -13,9 +13,10 @@ class GetTransactionDetailsRequestType extends AbstractRequestType { /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique identifier of a transaction. RequiredThe details for some kinds of transactions cannot be retrieved with GetTransactionDetailsRequest. You cannot obtain details of bank transfer withdrawals, for example. Character length and * limitations: 17 single-byte alphanumeric characters | TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * @var string */ public $TransactionID; @@ -46,7 +47,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; diff --git a/src/StructType/GetTransactionDetailsResponseType.php b/src/StructType/GetTransactionDetailsResponseType.php index fb42473..693925a 100644 --- a/src/StructType/GetTransactionDetailsResponseType.php +++ b/src/StructType/GetTransactionDetailsResponseType.php @@ -13,14 +13,14 @@ class GetTransactionDetailsResponseType extends AbstractResponseType { /** * The PaymentTransactionDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:PaymentTransactionDetails * @var \PayPal\StructType\PaymentTransactionType */ public $PaymentTransactionDetails; /** * The ThreeDSecureDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:ThreeDSecureDetails * @var \PayPal\StructType\ThreeDSecureInfoType */ diff --git a/src/StructType/IdentificationInfoType.php b/src/StructType/IdentificationInfoType.php index 403cdbd..95e364b 100644 --- a/src/StructType/IdentificationInfoType.php +++ b/src/StructType/IdentificationInfoType.php @@ -13,7 +13,7 @@ class IdentificationInfoType extends AbstractStructBase { /** * The MobileIDInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Mobile specific buyer identification. * - minOccurs: 0 * @var \PayPal\StructType\MobileIDInfoType @@ -21,7 +21,7 @@ class IdentificationInfoType extends AbstractStructBase public $MobileIDInfo; /** * The RememberMeIDInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains login bypass information. * - maxOccurs: 1 * - minOccurs: 0 @@ -30,7 +30,7 @@ class IdentificationInfoType extends AbstractStructBase public $RememberMeIDInfo; /** * The IdentityTokenInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Identity Access Token. * - maxOccurs: 1 * - minOccurs: 0 diff --git a/src/StructType/IdentityTokenInfoType.php b/src/StructType/IdentityTokenInfoType.php index f588301..27e588f 100644 --- a/src/StructType/IdentityTokenInfoType.php +++ b/src/StructType/IdentityTokenInfoType.php @@ -13,7 +13,7 @@ class IdentityTokenInfoType extends AbstractStructBase { /** * The AccessToken - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Identity Access token from merchant * - maxOccurs: 1 * - minOccurs: 1 @@ -47,7 +47,7 @@ public function setAccessToken($accessToken = null) { // validation for constraint: string if (!is_null($accessToken) && !is_string($accessToken)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($accessToken)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($accessToken, true), gettype($accessToken)), __LINE__); } $this->AccessToken = $accessToken; return $this; diff --git a/src/StructType/IncentiveAppliedDetailsType.php b/src/StructType/IncentiveAppliedDetailsType.php index d0b240a..cbb4d40 100644 --- a/src/StructType/IncentiveAppliedDetailsType.php +++ b/src/StructType/IncentiveAppliedDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for IncentiveAppliedDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details of incentive application on individual bucket/item. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class IncentiveAppliedDetailsType extends AbstractStructBase { /** * The PaymentRequestID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentRequestID uniquely identifies a bucket. It is the "bucket id" in the world of EC API. * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class IncentiveAppliedDetailsType extends AbstractStructBase public $PaymentRequestID; /** * The ItemId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The item id passed through by the merchant. * - maxOccurs: 1 * - minOccurs: 0 @@ -33,7 +33,7 @@ class IncentiveAppliedDetailsType extends AbstractStructBase public $ItemId; /** * The ExternalTxnId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The item transaction id passed through by the merchant. * - maxOccurs: 1 * - minOccurs: 0 @@ -42,7 +42,7 @@ class IncentiveAppliedDetailsType extends AbstractStructBase public $ExternalTxnId; /** * The DiscountAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Discount offerred for this bucket or item. * - maxOccurs: 1 * - minOccurs: 0 @@ -51,7 +51,7 @@ class IncentiveAppliedDetailsType extends AbstractStructBase public $DiscountAmount; /** * The SubType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: SubType for coupon. * - minOccurs: 0 * @var string @@ -96,7 +96,7 @@ public function setPaymentRequestID($paymentRequestID = null) { // validation for constraint: string if (!is_null($paymentRequestID) && !is_string($paymentRequestID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentRequestID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paymentRequestID, true), gettype($paymentRequestID)), __LINE__); } $this->PaymentRequestID = $paymentRequestID; return $this; @@ -118,7 +118,7 @@ public function setItemId($itemId = null) { // validation for constraint: string if (!is_null($itemId) && !is_string($itemId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemId, true), gettype($itemId)), __LINE__); } $this->ItemId = $itemId; return $this; @@ -140,7 +140,7 @@ public function setExternalTxnId($externalTxnId = null) { // validation for constraint: string if (!is_null($externalTxnId) && !is_string($externalTxnId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalTxnId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalTxnId, true), gettype($externalTxnId)), __LINE__); } $this->ExternalTxnId = $externalTxnId; return $this; @@ -180,7 +180,7 @@ public function setSubType($subType = null) { // validation for constraint: string if (!is_null($subType) && !is_string($subType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($subType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subType, true), gettype($subType)), __LINE__); } $this->SubType = $subType; return $this; diff --git a/src/StructType/IncentiveAppliedToType.php b/src/StructType/IncentiveAppliedToType.php index e1dd51c..d32c599 100644 --- a/src/StructType/IncentiveAppliedToType.php +++ b/src/StructType/IncentiveAppliedToType.php @@ -13,28 +13,28 @@ class IncentiveAppliedToType extends AbstractStructBase { /** * The BucketId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $BucketId; /** * The ItemId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ItemId; /** * The IncentiveAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $IncentiveAmount; /** * The SubType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -75,7 +75,7 @@ public function setBucketId($bucketId = null) { // validation for constraint: string if (!is_null($bucketId) && !is_string($bucketId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($bucketId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bucketId, true), gettype($bucketId)), __LINE__); } $this->BucketId = $bucketId; return $this; @@ -97,7 +97,7 @@ public function setItemId($itemId = null) { // validation for constraint: string if (!is_null($itemId) && !is_string($itemId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemId, true), gettype($itemId)), __LINE__); } $this->ItemId = $itemId; return $this; @@ -137,7 +137,7 @@ public function setSubType($subType = null) { // validation for constraint: string if (!is_null($subType) && !is_string($subType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($subType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subType, true), gettype($subType)), __LINE__); } $this->SubType = $subType; return $this; diff --git a/src/StructType/IncentiveApplyIndicationType.php b/src/StructType/IncentiveApplyIndicationType.php index 5192ae6..2085a02 100644 --- a/src/StructType/IncentiveApplyIndicationType.php +++ b/src/StructType/IncentiveApplyIndicationType.php @@ -6,7 +6,7 @@ /** * This class stands for IncentiveApplyIndicationType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Defines which bucket or item that the incentive should be applied to. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class IncentiveApplyIndicationType extends AbstractStructBase { /** * The PaymentRequestID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The Bucket ID that the incentive is applied to. * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class IncentiveApplyIndicationType extends AbstractStructBase public $PaymentRequestID; /** * The ItemId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The item that the incentive is applied to. * - maxOccurs: 1 * - minOccurs: 0 @@ -61,7 +61,7 @@ public function setPaymentRequestID($paymentRequestID = null) { // validation for constraint: string if (!is_null($paymentRequestID) && !is_string($paymentRequestID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentRequestID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paymentRequestID, true), gettype($paymentRequestID)), __LINE__); } $this->PaymentRequestID = $paymentRequestID; return $this; @@ -83,7 +83,7 @@ public function setItemId($itemId = null) { // validation for constraint: string if (!is_null($itemId) && !is_string($itemId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemId, true), gettype($itemId)), __LINE__); } $this->ItemId = $itemId; return $this; diff --git a/src/StructType/IncentiveBucketType.php b/src/StructType/IncentiveBucketType.php index 45e5e81..9d0b9a2 100644 --- a/src/StructType/IncentiveBucketType.php +++ b/src/StructType/IncentiveBucketType.php @@ -13,7 +13,7 @@ class IncentiveBucketType extends AbstractStructBase { /** * The Items - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var \PayPal\StructType\IncentiveItemType[] @@ -21,56 +21,56 @@ class IncentiveBucketType extends AbstractStructBase public $Items; /** * The BucketId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $BucketId; /** * The SellerId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $SellerId; /** * The ExternalSellerId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ExternalSellerId; /** * The BucketSubtotalAmt - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $BucketSubtotalAmt; /** * The BucketShippingAmt - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $BucketShippingAmt; /** * The BucketInsuranceAmt - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $BucketInsuranceAmt; /** * The BucketSalesTaxAmt - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $BucketSalesTaxAmt; /** * The BucketTotalAmt - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ @@ -117,6 +117,28 @@ public function getItems() { return $this->Items; } + /** + * This method is responsible for validating the values passed to the setItems method + * This method is willingly generated in order to preserve the one-line inline validation within the setItems method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateItemsForArrayConstraintsFromSetItems(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $incentiveBucketTypeItemsItem) { + // validation for constraint: itemType + if (!$incentiveBucketTypeItemsItem instanceof \PayPal\StructType\IncentiveItemType) { + $invalidValues[] = is_object($incentiveBucketTypeItemsItem) ? get_class($incentiveBucketTypeItemsItem) : sprintf('%s(%s)', gettype($incentiveBucketTypeItemsItem), var_export($incentiveBucketTypeItemsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Items property can only contain items of type \PayPal\StructType\IncentiveItemType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Items value * @throws \InvalidArgumentException @@ -125,11 +147,9 @@ public function getItems() */ public function setItems(array $items = array()) { - foreach ($items as $incentiveBucketTypeItemsItem) { - // validation for constraint: itemType - if (!$incentiveBucketTypeItemsItem instanceof \PayPal\StructType\IncentiveItemType) { - throw new \InvalidArgumentException(sprintf('The Items property can only contain items of \PayPal\StructType\IncentiveItemType, "%s" given', is_object($incentiveBucketTypeItemsItem) ? get_class($incentiveBucketTypeItemsItem) : gettype($incentiveBucketTypeItemsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($itemsArrayErrorMessage = self::validateItemsForArrayConstraintsFromSetItems($items))) { + throw new \InvalidArgumentException($itemsArrayErrorMessage, __LINE__); } $this->Items = $items; return $this; @@ -144,7 +164,7 @@ public function addToItems(\PayPal\StructType\IncentiveItemType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\IncentiveItemType) { - throw new \InvalidArgumentException(sprintf('The Items property can only contain items of \PayPal\StructType\IncentiveItemType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Items property can only contain items of type \PayPal\StructType\IncentiveItemType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Items[] = $item; return $this; @@ -166,7 +186,7 @@ public function setBucketId($bucketId = null) { // validation for constraint: string if (!is_null($bucketId) && !is_string($bucketId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($bucketId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($bucketId, true), gettype($bucketId)), __LINE__); } $this->BucketId = $bucketId; return $this; @@ -188,7 +208,7 @@ public function setSellerId($sellerId = null) { // validation for constraint: string if (!is_null($sellerId) && !is_string($sellerId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sellerId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerId, true), gettype($sellerId)), __LINE__); } $this->SellerId = $sellerId; return $this; @@ -210,7 +230,7 @@ public function setExternalSellerId($externalSellerId = null) { // validation for constraint: string if (!is_null($externalSellerId) && !is_string($externalSellerId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalSellerId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalSellerId, true), gettype($externalSellerId)), __LINE__); } $this->ExternalSellerId = $externalSellerId; return $this; diff --git a/src/StructType/IncentiveDetailType.php b/src/StructType/IncentiveDetailType.php index 56b5802..a0a524c 100644 --- a/src/StructType/IncentiveDetailType.php +++ b/src/StructType/IncentiveDetailType.php @@ -13,42 +13,42 @@ class IncentiveDetailType extends AbstractStructBase { /** * The RedemptionCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $RedemptionCode; /** * The DisplayCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $DisplayCode; /** * The ProgramId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ProgramId; /** * The IncentiveType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $IncentiveType; /** * The IncentiveDescription - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $IncentiveDescription; /** * The AppliedTo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var \PayPal\StructType\IncentiveAppliedToType[] @@ -56,14 +56,14 @@ class IncentiveDetailType extends AbstractStructBase public $AppliedTo; /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $Status; /** * The ErrorCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -116,7 +116,7 @@ public function setRedemptionCode($redemptionCode = null) { // validation for constraint: string if (!is_null($redemptionCode) && !is_string($redemptionCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($redemptionCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redemptionCode, true), gettype($redemptionCode)), __LINE__); } $this->RedemptionCode = $redemptionCode; return $this; @@ -138,7 +138,7 @@ public function setDisplayCode($displayCode = null) { // validation for constraint: string if (!is_null($displayCode) && !is_string($displayCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($displayCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($displayCode, true), gettype($displayCode)), __LINE__); } $this->DisplayCode = $displayCode; return $this; @@ -160,7 +160,7 @@ public function setProgramId($programId = null) { // validation for constraint: string if (!is_null($programId) && !is_string($programId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($programId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($programId, true), gettype($programId)), __LINE__); } $this->ProgramId = $programId; return $this; @@ -185,7 +185,7 @@ public function setIncentiveType($incentiveType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\IncentiveTypeCodeType::valueIsValid($incentiveType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $incentiveType, implode(', ', \PayPal\EnumType\IncentiveTypeCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\IncentiveTypeCodeType', is_array($incentiveType) ? implode(', ', $incentiveType) : var_export($incentiveType, true), implode(', ', \PayPal\EnumType\IncentiveTypeCodeType::getValidValues())), __LINE__); } $this->IncentiveType = $incentiveType; return $this; @@ -207,7 +207,7 @@ public function setIncentiveDescription($incentiveDescription = null) { // validation for constraint: string if (!is_null($incentiveDescription) && !is_string($incentiveDescription)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($incentiveDescription)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($incentiveDescription, true), gettype($incentiveDescription)), __LINE__); } $this->IncentiveDescription = $incentiveDescription; return $this; @@ -220,6 +220,28 @@ public function getAppliedTo() { return $this->AppliedTo; } + /** + * This method is responsible for validating the values passed to the setAppliedTo method + * This method is willingly generated in order to preserve the one-line inline validation within the setAppliedTo method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateAppliedToForArrayConstraintsFromSetAppliedTo(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $incentiveDetailTypeAppliedToItem) { + // validation for constraint: itemType + if (!$incentiveDetailTypeAppliedToItem instanceof \PayPal\StructType\IncentiveAppliedToType) { + $invalidValues[] = is_object($incentiveDetailTypeAppliedToItem) ? get_class($incentiveDetailTypeAppliedToItem) : sprintf('%s(%s)', gettype($incentiveDetailTypeAppliedToItem), var_export($incentiveDetailTypeAppliedToItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The AppliedTo property can only contain items of type \PayPal\StructType\IncentiveAppliedToType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set AppliedTo value * @throws \InvalidArgumentException @@ -228,11 +250,9 @@ public function getAppliedTo() */ public function setAppliedTo(array $appliedTo = array()) { - foreach ($appliedTo as $incentiveDetailTypeAppliedToItem) { - // validation for constraint: itemType - if (!$incentiveDetailTypeAppliedToItem instanceof \PayPal\StructType\IncentiveAppliedToType) { - throw new \InvalidArgumentException(sprintf('The AppliedTo property can only contain items of \PayPal\StructType\IncentiveAppliedToType, "%s" given', is_object($incentiveDetailTypeAppliedToItem) ? get_class($incentiveDetailTypeAppliedToItem) : gettype($incentiveDetailTypeAppliedToItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($appliedToArrayErrorMessage = self::validateAppliedToForArrayConstraintsFromSetAppliedTo($appliedTo))) { + throw new \InvalidArgumentException($appliedToArrayErrorMessage, __LINE__); } $this->AppliedTo = $appliedTo; return $this; @@ -247,7 +267,7 @@ public function addToAppliedTo(\PayPal\StructType\IncentiveAppliedToType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\IncentiveAppliedToType) { - throw new \InvalidArgumentException(sprintf('The AppliedTo property can only contain items of \PayPal\StructType\IncentiveAppliedToType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The AppliedTo property can only contain items of type \PayPal\StructType\IncentiveAppliedToType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->AppliedTo[] = $item; return $this; @@ -269,7 +289,7 @@ public function setStatus($status = null) { // validation for constraint: string if (!is_null($status) && !is_string($status)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($status)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($status, true), gettype($status)), __LINE__); } $this->Status = $status; return $this; @@ -291,7 +311,7 @@ public function setErrorCode($errorCode = null) { // validation for constraint: string if (!is_null($errorCode) && !is_string($errorCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($errorCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($errorCode, true), gettype($errorCode)), __LINE__); } $this->ErrorCode = $errorCode; return $this; diff --git a/src/StructType/IncentiveDetailsType.php b/src/StructType/IncentiveDetailsType.php index e2763a3..cd25d2f 100644 --- a/src/StructType/IncentiveDetailsType.php +++ b/src/StructType/IncentiveDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for IncentiveDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the incentives that were applied from Ebay RYP page and PayPal RYP page. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class IncentiveDetailsType extends AbstractStructBase { /** * The UniqueIdentifier - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique Identifier consisting of redemption code, user friendly descripotion, incentive type, campaign code, incenitve application order and site redeemed on. * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class IncentiveDetailsType extends AbstractStructBase public $UniqueIdentifier; /** * The SiteAppliedOn - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Defines if the incentive has been applied on Ebay or PayPal. * - maxOccurs: 1 * - minOccurs: 0 @@ -33,7 +33,7 @@ class IncentiveDetailsType extends AbstractStructBase public $SiteAppliedOn; /** * The TotalDiscountAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The total discount amount for the incentive, summation of discounts up across all the buckets/items. * - maxOccurs: 1 * - minOccurs: 0 @@ -42,7 +42,7 @@ class IncentiveDetailsType extends AbstractStructBase public $TotalDiscountAmount; /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Status of incentive processing. Sussess or Error. * - maxOccurs: 1 * - minOccurs: 0 @@ -51,7 +51,7 @@ class IncentiveDetailsType extends AbstractStructBase public $Status; /** * The ErrorCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Error code if there are any errors. Zero otherwise. * - maxOccurs: 1 * - minOccurs: 0 @@ -60,7 +60,7 @@ class IncentiveDetailsType extends AbstractStructBase public $ErrorCode; /** * The IncentiveAppliedDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details of incentive application on individual bucket/item. * - maxOccurs: unbounded * - minOccurs: 0 @@ -109,7 +109,7 @@ public function setUniqueIdentifier($uniqueIdentifier = null) { // validation for constraint: string if (!is_null($uniqueIdentifier) && !is_string($uniqueIdentifier)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($uniqueIdentifier)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($uniqueIdentifier, true), gettype($uniqueIdentifier)), __LINE__); } $this->UniqueIdentifier = $uniqueIdentifier; return $this; @@ -134,7 +134,7 @@ public function setSiteAppliedOn($siteAppliedOn = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\IncentiveSiteAppliedOnType::valueIsValid($siteAppliedOn)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $siteAppliedOn, implode(', ', \PayPal\EnumType\IncentiveSiteAppliedOnType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\IncentiveSiteAppliedOnType', is_array($siteAppliedOn) ? implode(', ', $siteAppliedOn) : var_export($siteAppliedOn, true), implode(', ', \PayPal\EnumType\IncentiveSiteAppliedOnType::getValidValues())), __LINE__); } $this->SiteAppliedOn = $siteAppliedOn; return $this; @@ -177,7 +177,7 @@ public function setStatus($status = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\IncentiveAppliedStatusType::valueIsValid($status)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $status, implode(', ', \PayPal\EnumType\IncentiveAppliedStatusType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\IncentiveAppliedStatusType', is_array($status) ? implode(', ', $status) : var_export($status, true), implode(', ', \PayPal\EnumType\IncentiveAppliedStatusType::getValidValues())), __LINE__); } $this->Status = $status; return $this; @@ -198,8 +198,8 @@ public function getErrorCode() public function setErrorCode($errorCode = null) { // validation for constraint: int - if (!is_null($errorCode) && !is_numeric($errorCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($errorCode)), __LINE__); + if (!is_null($errorCode) && !(is_int($errorCode) || ctype_digit($errorCode))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($errorCode, true), gettype($errorCode)), __LINE__); } $this->ErrorCode = $errorCode; return $this; @@ -212,6 +212,28 @@ public function getIncentiveAppliedDetails() { return $this->IncentiveAppliedDetails; } + /** + * This method is responsible for validating the values passed to the setIncentiveAppliedDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setIncentiveAppliedDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateIncentiveAppliedDetailsForArrayConstraintsFromSetIncentiveAppliedDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $incentiveDetailsTypeIncentiveAppliedDetailsItem) { + // validation for constraint: itemType + if (!$incentiveDetailsTypeIncentiveAppliedDetailsItem instanceof \PayPal\StructType\IncentiveAppliedDetailsType) { + $invalidValues[] = is_object($incentiveDetailsTypeIncentiveAppliedDetailsItem) ? get_class($incentiveDetailsTypeIncentiveAppliedDetailsItem) : sprintf('%s(%s)', gettype($incentiveDetailsTypeIncentiveAppliedDetailsItem), var_export($incentiveDetailsTypeIncentiveAppliedDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The IncentiveAppliedDetails property can only contain items of type \PayPal\StructType\IncentiveAppliedDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set IncentiveAppliedDetails value * @throws \InvalidArgumentException @@ -220,11 +242,9 @@ public function getIncentiveAppliedDetails() */ public function setIncentiveAppliedDetails(array $incentiveAppliedDetails = array()) { - foreach ($incentiveAppliedDetails as $incentiveDetailsTypeIncentiveAppliedDetailsItem) { - // validation for constraint: itemType - if (!$incentiveDetailsTypeIncentiveAppliedDetailsItem instanceof \PayPal\StructType\IncentiveAppliedDetailsType) { - throw new \InvalidArgumentException(sprintf('The IncentiveAppliedDetails property can only contain items of \PayPal\StructType\IncentiveAppliedDetailsType, "%s" given', is_object($incentiveDetailsTypeIncentiveAppliedDetailsItem) ? get_class($incentiveDetailsTypeIncentiveAppliedDetailsItem) : gettype($incentiveDetailsTypeIncentiveAppliedDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($incentiveAppliedDetailsArrayErrorMessage = self::validateIncentiveAppliedDetailsForArrayConstraintsFromSetIncentiveAppliedDetails($incentiveAppliedDetails))) { + throw new \InvalidArgumentException($incentiveAppliedDetailsArrayErrorMessage, __LINE__); } $this->IncentiveAppliedDetails = $incentiveAppliedDetails; return $this; @@ -239,7 +259,7 @@ public function addToIncentiveAppliedDetails(\PayPal\StructType\IncentiveApplied { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\IncentiveAppliedDetailsType) { - throw new \InvalidArgumentException(sprintf('The IncentiveAppliedDetails property can only contain items of \PayPal\StructType\IncentiveAppliedDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The IncentiveAppliedDetails property can only contain items of type \PayPal\StructType\IncentiveAppliedDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->IncentiveAppliedDetails[] = $item; return $this; diff --git a/src/StructType/IncentiveInfoType.php b/src/StructType/IncentiveInfoType.php index 3a8d2ec..9cad2c3 100644 --- a/src/StructType/IncentiveInfoType.php +++ b/src/StructType/IncentiveInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for IncentiveInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details of incentive application on individual bucket. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class IncentiveInfoType extends AbstractStructBase { /** * The IncentiveCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Incentive redemption code. * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class IncentiveInfoType extends AbstractStructBase public $IncentiveCode; /** * The ApplyIndication - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Defines which bucket or item that the incentive should be applied to. * - maxOccurs: unbounded * - minOccurs: 0 @@ -61,7 +61,7 @@ public function setIncentiveCode($incentiveCode = null) { // validation for constraint: string if (!is_null($incentiveCode) && !is_string($incentiveCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($incentiveCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($incentiveCode, true), gettype($incentiveCode)), __LINE__); } $this->IncentiveCode = $incentiveCode; return $this; @@ -74,6 +74,28 @@ public function getApplyIndication() { return $this->ApplyIndication; } + /** + * This method is responsible for validating the values passed to the setApplyIndication method + * This method is willingly generated in order to preserve the one-line inline validation within the setApplyIndication method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateApplyIndicationForArrayConstraintsFromSetApplyIndication(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $incentiveInfoTypeApplyIndicationItem) { + // validation for constraint: itemType + if (!$incentiveInfoTypeApplyIndicationItem instanceof \PayPal\StructType\IncentiveApplyIndicationType) { + $invalidValues[] = is_object($incentiveInfoTypeApplyIndicationItem) ? get_class($incentiveInfoTypeApplyIndicationItem) : sprintf('%s(%s)', gettype($incentiveInfoTypeApplyIndicationItem), var_export($incentiveInfoTypeApplyIndicationItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The ApplyIndication property can only contain items of type \PayPal\StructType\IncentiveApplyIndicationType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set ApplyIndication value * @throws \InvalidArgumentException @@ -82,11 +104,9 @@ public function getApplyIndication() */ public function setApplyIndication(array $applyIndication = array()) { - foreach ($applyIndication as $incentiveInfoTypeApplyIndicationItem) { - // validation for constraint: itemType - if (!$incentiveInfoTypeApplyIndicationItem instanceof \PayPal\StructType\IncentiveApplyIndicationType) { - throw new \InvalidArgumentException(sprintf('The ApplyIndication property can only contain items of \PayPal\StructType\IncentiveApplyIndicationType, "%s" given', is_object($incentiveInfoTypeApplyIndicationItem) ? get_class($incentiveInfoTypeApplyIndicationItem) : gettype($incentiveInfoTypeApplyIndicationItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($applyIndicationArrayErrorMessage = self::validateApplyIndicationForArrayConstraintsFromSetApplyIndication($applyIndication))) { + throw new \InvalidArgumentException($applyIndicationArrayErrorMessage, __LINE__); } $this->ApplyIndication = $applyIndication; return $this; @@ -101,7 +121,7 @@ public function addToApplyIndication(\PayPal\StructType\IncentiveApplyIndication { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\IncentiveApplyIndicationType) { - throw new \InvalidArgumentException(sprintf('The ApplyIndication property can only contain items of \PayPal\StructType\IncentiveApplyIndicationType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The ApplyIndication property can only contain items of type \PayPal\StructType\IncentiveApplyIndicationType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->ApplyIndication[] = $item; return $this; diff --git a/src/StructType/IncentiveItemType.php b/src/StructType/IncentiveItemType.php index c8a7b31..73e04b5 100644 --- a/src/StructType/IncentiveItemType.php +++ b/src/StructType/IncentiveItemType.php @@ -13,35 +13,35 @@ class IncentiveItemType extends AbstractStructBase { /** * The ItemId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ItemId; /** * The PurchaseTime - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $PurchaseTime; /** * The ItemCategoryList - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ItemCategoryList; /** * The ItemPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType */ public $ItemPrice; /** * The ItemQuantity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ @@ -85,7 +85,7 @@ public function setItemId($itemId = null) { // validation for constraint: string if (!is_null($itemId) && !is_string($itemId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemId, true), gettype($itemId)), __LINE__); } $this->ItemId = $itemId; return $this; @@ -107,7 +107,7 @@ public function setPurchaseTime($purchaseTime = null) { // validation for constraint: string if (!is_null($purchaseTime) && !is_string($purchaseTime)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($purchaseTime)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($purchaseTime, true), gettype($purchaseTime)), __LINE__); } $this->PurchaseTime = $purchaseTime; return $this; @@ -129,7 +129,7 @@ public function setItemCategoryList($itemCategoryList = null) { // validation for constraint: string if (!is_null($itemCategoryList) && !is_string($itemCategoryList)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemCategoryList)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemCategoryList, true), gettype($itemCategoryList)), __LINE__); } $this->ItemCategoryList = $itemCategoryList; return $this; @@ -168,8 +168,8 @@ public function getItemQuantity() public function setItemQuantity($itemQuantity = null) { // validation for constraint: int - if (!is_null($itemQuantity) && !is_numeric($itemQuantity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($itemQuantity)), __LINE__); + if (!is_null($itemQuantity) && !(is_int($itemQuantity) || ctype_digit($itemQuantity))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($itemQuantity, true), gettype($itemQuantity)), __LINE__); } $this->ItemQuantity = $itemQuantity; return $this; diff --git a/src/StructType/IncentiveRequestDetailsType.php b/src/StructType/IncentiveRequestDetailsType.php index ce69920..0035baf 100644 --- a/src/StructType/IncentiveRequestDetailsType.php +++ b/src/StructType/IncentiveRequestDetailsType.php @@ -13,21 +13,21 @@ class IncentiveRequestDetailsType extends AbstractStructBase { /** * The RequestId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $RequestId; /** * The RequestType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $RequestType; /** * The RequestDetailLevel - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -65,7 +65,7 @@ public function setRequestId($requestId = null) { // validation for constraint: string if (!is_null($requestId) && !is_string($requestId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($requestId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($requestId, true), gettype($requestId)), __LINE__); } $this->RequestId = $requestId; return $this; @@ -90,7 +90,7 @@ public function setRequestType($requestType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\IncentiveRequestCodeType::valueIsValid($requestType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $requestType, implode(', ', \PayPal\EnumType\IncentiveRequestCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\IncentiveRequestCodeType', is_array($requestType) ? implode(', ', $requestType) : var_export($requestType, true), implode(', ', \PayPal\EnumType\IncentiveRequestCodeType::getValidValues())), __LINE__); } $this->RequestType = $requestType; return $this; @@ -115,7 +115,7 @@ public function setRequestDetailLevel($requestDetailLevel = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\IncentiveRequestDetailLevelCodeType::valueIsValid($requestDetailLevel)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $requestDetailLevel, implode(', ', \PayPal\EnumType\IncentiveRequestDetailLevelCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\IncentiveRequestDetailLevelCodeType', is_array($requestDetailLevel) ? implode(', ', $requestDetailLevel) : var_export($requestDetailLevel, true), implode(', ', \PayPal\EnumType\IncentiveRequestDetailLevelCodeType::getValidValues())), __LINE__); } $this->RequestDetailLevel = $requestDetailLevel; return $this; diff --git a/src/StructType/InfoSharingDirectivesType.php b/src/StructType/InfoSharingDirectivesType.php index 8979a69..5a3e7bb 100644 --- a/src/StructType/InfoSharingDirectivesType.php +++ b/src/StructType/InfoSharingDirectivesType.php @@ -13,7 +13,7 @@ class InfoSharingDirectivesType extends AbstractStructBase { /** * The ReqBillingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If Billing Address should be returned in GetExpressCheckoutDetails response, this parameter should be set to yes here * - minOccurs: 0 * @var string @@ -46,7 +46,7 @@ public function setReqBillingAddress($reqBillingAddress = null) { // validation for constraint: string if (!is_null($reqBillingAddress) && !is_string($reqBillingAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reqBillingAddress)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reqBillingAddress, true), gettype($reqBillingAddress)), __LINE__); } $this->ReqBillingAddress = $reqBillingAddress; return $this; diff --git a/src/StructType/InitiateRecoupReq.php b/src/StructType/InitiateRecoupReq.php index 0e7ff52..2fbaa14 100644 --- a/src/StructType/InitiateRecoupReq.php +++ b/src/StructType/InitiateRecoupReq.php @@ -13,7 +13,7 @@ class InitiateRecoupReq extends AbstractStructBase { /** * The InitiateRecoupRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:InitiateRecoupRequest * @var \PayPal\StructType\InitiateRecoupRequestType */ diff --git a/src/StructType/InitiateRecoupRequestType.php b/src/StructType/InitiateRecoupRequestType.php index d76ec6e..1922ff9 100644 --- a/src/StructType/InitiateRecoupRequestType.php +++ b/src/StructType/InitiateRecoupRequestType.php @@ -13,7 +13,7 @@ class InitiateRecoupRequestType extends AbstractRequestType { /** * The EnhancedInitiateRecoupRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ed:EnhancedInitiateRecoupRequestDetails diff --git a/src/StructType/InitiateRecoupResponseType.php b/src/StructType/InitiateRecoupResponseType.php index a7954d3..5dbbd26 100644 --- a/src/StructType/InitiateRecoupResponseType.php +++ b/src/StructType/InitiateRecoupResponseType.php @@ -11,12 +11,6 @@ */ class InitiateRecoupResponseType extends AbstractResponseType { - /** - * Constructor method for InitiateRecoupResponseType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/InstallmentDetailsType.php b/src/StructType/InstallmentDetailsType.php index e6622ae..fa9d775 100644 --- a/src/StructType/InstallmentDetailsType.php +++ b/src/StructType/InstallmentDetailsType.php @@ -13,7 +13,7 @@ class InstallmentDetailsType extends AbstractStructBase { /** * The BillingPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Installment Period. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class InstallmentDetailsType extends AbstractStructBase public $BillingPeriod; /** * The BillingFrequency - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Installment Frequency. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class InstallmentDetailsType extends AbstractStructBase public $BillingFrequency; /** * The TotalBillingCycles - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Installment Cycles. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -40,7 +40,7 @@ class InstallmentDetailsType extends AbstractStructBase public $TotalBillingCycles; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Installment Amount. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -49,7 +49,7 @@ class InstallmentDetailsType extends AbstractStructBase public $Amount; /** * The ShippingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Installment Amount. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -58,7 +58,7 @@ class InstallmentDetailsType extends AbstractStructBase public $ShippingAmount; /** * The TaxAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Installment Amount. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -110,7 +110,7 @@ public function setBillingPeriod($billingPeriod = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BillingPeriodType::valueIsValid($billingPeriod)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $billingPeriod, implode(', ', \PayPal\EnumType\BillingPeriodType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BillingPeriodType', is_array($billingPeriod) ? implode(', ', $billingPeriod) : var_export($billingPeriod, true), implode(', ', \PayPal\EnumType\BillingPeriodType::getValidValues())), __LINE__); } $this->BillingPeriod = $billingPeriod; return $this; @@ -131,8 +131,8 @@ public function getBillingFrequency() public function setBillingFrequency($billingFrequency = null) { // validation for constraint: int - if (!is_null($billingFrequency) && !is_numeric($billingFrequency)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($billingFrequency)), __LINE__); + if (!is_null($billingFrequency) && !(is_int($billingFrequency) || ctype_digit($billingFrequency))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($billingFrequency, true), gettype($billingFrequency)), __LINE__); } $this->BillingFrequency = $billingFrequency; return $this; @@ -153,8 +153,8 @@ public function getTotalBillingCycles() public function setTotalBillingCycles($totalBillingCycles = null) { // validation for constraint: int - if (!is_null($totalBillingCycles) && !is_numeric($totalBillingCycles)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($totalBillingCycles)), __LINE__); + if (!is_null($totalBillingCycles) && !(is_int($totalBillingCycles) || ctype_digit($totalBillingCycles))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($totalBillingCycles, true), gettype($totalBillingCycles)), __LINE__); } $this->TotalBillingCycles = $totalBillingCycles; return $this; @@ -176,7 +176,7 @@ public function setAmount($amount = null) { // validation for constraint: string if (!is_null($amount) && !is_string($amount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($amount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($amount, true), gettype($amount)), __LINE__); } $this->Amount = $amount; return $this; @@ -198,7 +198,7 @@ public function setShippingAmount($shippingAmount = null) { // validation for constraint: string if (!is_null($shippingAmount) && !is_string($shippingAmount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingAmount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingAmount, true), gettype($shippingAmount)), __LINE__); } $this->ShippingAmount = $shippingAmount; return $this; @@ -220,7 +220,7 @@ public function setTaxAmount($taxAmount = null) { // validation for constraint: string if (!is_null($taxAmount) && !is_string($taxAmount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($taxAmount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($taxAmount, true), gettype($taxAmount)), __LINE__); } $this->TaxAmount = $taxAmount; return $this; diff --git a/src/StructType/InstrumentDetailsType.php b/src/StructType/InstrumentDetailsType.php index 65a9bff..8881284 100644 --- a/src/StructType/InstrumentDetailsType.php +++ b/src/StructType/InstrumentDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for InstrumentDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: InstrumentDetailsType Promotional Instrument Information. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class InstrumentDetailsType extends AbstractStructBase { /** * The InstrumentCategory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This field holds the category of the instrument only when it is promotional. Return value 1 represents BML, 2 reprasents PLCC/Cobranded. * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class InstrumentDetailsType extends AbstractStructBase public $InstrumentCategory; /** * The InstrumentID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This field holds the InstrumentID issued by external party corresponding to the funding source used in payment. * - minOccurs: 0 * @var string @@ -59,7 +59,7 @@ public function setInstrumentCategory($instrumentCategory = null) { // validation for constraint: string if (!is_null($instrumentCategory) && !is_string($instrumentCategory)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($instrumentCategory)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($instrumentCategory, true), gettype($instrumentCategory)), __LINE__); } $this->InstrumentCategory = $instrumentCategory; return $this; @@ -81,7 +81,7 @@ public function setInstrumentID($instrumentID = null) { // validation for constraint: string if (!is_null($instrumentID) && !is_string($instrumentID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($instrumentID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($instrumentID, true), gettype($instrumentID)), __LINE__); } $this->InstrumentID = $instrumentID; return $this; diff --git a/src/StructType/InvoiceItemType.php b/src/StructType/InvoiceItemType.php index 2f5662b..97bd205 100644 --- a/src/StructType/InvoiceItemType.php +++ b/src/StructType/InvoiceItemType.php @@ -6,7 +6,7 @@ /** * This class stands for InvoiceItemType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Describes an individual item for an invoice. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class InvoiceItemType extends AbstractStructBase { /** * The Name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: a human readable item nameOptional Character length and limits: 127 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class InvoiceItemType extends AbstractStructBase public $Name; /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: a human readable item descriptionOptional Character length and limits: 127 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -33,7 +33,7 @@ class InvoiceItemType extends AbstractStructBase public $Description; /** * The EAN - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The International Article Number or Universal Product Code (UPC) for the item. Empty string is allowed. Character length and limits: 17 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -42,7 +42,7 @@ class InvoiceItemType extends AbstractStructBase public $EAN; /** * The SKU - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The Stock-Keeping Unit or other identification code assigned to the item. Character length and limits: 64 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -51,7 +51,7 @@ class InvoiceItemType extends AbstractStructBase public $SKU; /** * The ReturnPolicyIdentifier - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A retailer could apply different return policies on different items. Each return policy would be identified using a label or identifier. This return policy identifier should be set here. This identifier will be displayed next to the * item in the e-Receipt. Character length and limits: 8 single-byte characters * - maxOccurs: 1 @@ -61,7 +61,7 @@ class InvoiceItemType extends AbstractStructBase public $ReturnPolicyIdentifier; /** * The Price - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: total price of this item * - maxOccurs: 1 * - minOccurs: 0 @@ -70,7 +70,7 @@ class InvoiceItemType extends AbstractStructBase public $Price; /** * The ItemPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: price per item quantity * - maxOccurs: 1 * - minOccurs: 0 @@ -79,7 +79,7 @@ class InvoiceItemType extends AbstractStructBase public $ItemPrice; /** * The ItemCount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: quantity of the item (non-negative) * - maxOccurs: 1 * - minOccurs: 0 @@ -88,7 +88,7 @@ class InvoiceItemType extends AbstractStructBase public $ItemCount; /** * The ItemCountUnit - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unit of measure for the itemCount * - maxOccurs: 1 * - minOccurs: 0 @@ -97,7 +97,7 @@ class InvoiceItemType extends AbstractStructBase public $ItemCountUnit; /** * The Discount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: discount applied to this item * - maxOccurs: unbounded * - minOccurs: 0 @@ -106,7 +106,7 @@ class InvoiceItemType extends AbstractStructBase public $Discount; /** * The Taxable - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: identifies whether this item is taxable or not. If not passed, this will be assumed to be true. * - maxOccurs: 1 * - minOccurs: 0 @@ -115,7 +115,7 @@ class InvoiceItemType extends AbstractStructBase public $Taxable; /** * The TaxRate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The tax percentage applied to the item. This is only used for displaying in the receipt, it is not used in pricing calculations. Note: we have totalTax at invoice level. It's up to the caller to do the calculations for setting that * other element. * - maxOccurs: 1 @@ -125,7 +125,7 @@ class InvoiceItemType extends AbstractStructBase public $TaxRate; /** * The AdditionalFees - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Additional fees to this item * - maxOccurs: unbounded * - minOccurs: 0 @@ -134,7 +134,7 @@ class InvoiceItemType extends AbstractStructBase public $AdditionalFees; /** * The Reimbursable - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: identifies whether this is reimbursable or not. If not pass, this will be assumed to be true. * - maxOccurs: 1 * - minOccurs: 0 @@ -143,7 +143,7 @@ class InvoiceItemType extends AbstractStructBase public $Reimbursable; /** * The MPN - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Manufacturer part number. * - maxOccurs: 1 * - minOccurs: 0 @@ -152,7 +152,7 @@ class InvoiceItemType extends AbstractStructBase public $MPN; /** * The ISBN - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: International Standard Book Number. Reference http://en.wikipedia.org/wiki/ISBN Character length and limits: 32 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -161,7 +161,7 @@ class InvoiceItemType extends AbstractStructBase public $ISBN; /** * The PLU - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Price Look-Up code Reference http://en.wikipedia.org/wiki/Price_Look-Up_code Character length and limits: 5 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -170,7 +170,7 @@ class InvoiceItemType extends AbstractStructBase public $PLU; /** * The ModelNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Character length and limits: 32 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -179,7 +179,7 @@ class InvoiceItemType extends AbstractStructBase public $ModelNumber; /** * The StyleNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Character length and limits: 32 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -267,7 +267,7 @@ public function setName($name = null) { // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); } $this->Name = $name; return $this; @@ -289,7 +289,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this; @@ -311,7 +311,7 @@ public function setEAN($eAN = null) { // validation for constraint: string if (!is_null($eAN) && !is_string($eAN)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($eAN)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($eAN, true), gettype($eAN)), __LINE__); } $this->EAN = $eAN; return $this; @@ -333,7 +333,7 @@ public function setSKU($sKU = null) { // validation for constraint: string if (!is_null($sKU) && !is_string($sKU)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sKU)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sKU, true), gettype($sKU)), __LINE__); } $this->SKU = $sKU; return $this; @@ -355,7 +355,7 @@ public function setReturnPolicyIdentifier($returnPolicyIdentifier = null) { // validation for constraint: string if (!is_null($returnPolicyIdentifier) && !is_string($returnPolicyIdentifier)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($returnPolicyIdentifier)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($returnPolicyIdentifier, true), gettype($returnPolicyIdentifier)), __LINE__); } $this->ReturnPolicyIdentifier = $returnPolicyIdentifier; return $this; @@ -411,6 +411,10 @@ public function getItemCount() */ public function setItemCount($itemCount = null) { + // validation for constraint: float + if (!is_null($itemCount) && !(is_float($itemCount) || is_numeric($itemCount))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($itemCount, true), gettype($itemCount)), __LINE__); + } $this->ItemCount = $itemCount; return $this; } @@ -434,7 +438,7 @@ public function setItemCountUnit($itemCountUnit = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\UnitOfMeasure::valueIsValid($itemCountUnit)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $itemCountUnit, implode(', ', \PayPal\EnumType\UnitOfMeasure::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\UnitOfMeasure', is_array($itemCountUnit) ? implode(', ', $itemCountUnit) : var_export($itemCountUnit, true), implode(', ', \PayPal\EnumType\UnitOfMeasure::getValidValues())), __LINE__); } $this->ItemCountUnit = $itemCountUnit; return $this; @@ -447,6 +451,28 @@ public function getDiscount() { return $this->Discount; } + /** + * This method is responsible for validating the values passed to the setDiscount method + * This method is willingly generated in order to preserve the one-line inline validation within the setDiscount method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateDiscountForArrayConstraintsFromSetDiscount(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $invoiceItemTypeDiscountItem) { + // validation for constraint: itemType + if (!$invoiceItemTypeDiscountItem instanceof \PayPal\StructType\DiscountType) { + $invalidValues[] = is_object($invoiceItemTypeDiscountItem) ? get_class($invoiceItemTypeDiscountItem) : sprintf('%s(%s)', gettype($invoiceItemTypeDiscountItem), var_export($invoiceItemTypeDiscountItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Discount property can only contain items of type \PayPal\StructType\DiscountType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Discount value * @throws \InvalidArgumentException @@ -455,11 +481,9 @@ public function getDiscount() */ public function setDiscount(array $discount = array()) { - foreach ($discount as $invoiceItemTypeDiscountItem) { - // validation for constraint: itemType - if (!$invoiceItemTypeDiscountItem instanceof \PayPal\StructType\DiscountType) { - throw new \InvalidArgumentException(sprintf('The Discount property can only contain items of \PayPal\StructType\DiscountType, "%s" given', is_object($invoiceItemTypeDiscountItem) ? get_class($invoiceItemTypeDiscountItem) : gettype($invoiceItemTypeDiscountItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($discountArrayErrorMessage = self::validateDiscountForArrayConstraintsFromSetDiscount($discount))) { + throw new \InvalidArgumentException($discountArrayErrorMessage, __LINE__); } $this->Discount = $discount; return $this; @@ -474,7 +498,7 @@ public function addToDiscount(\PayPal\StructType\DiscountType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\DiscountType) { - throw new \InvalidArgumentException(sprintf('The Discount property can only contain items of \PayPal\StructType\DiscountType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Discount property can only contain items of type \PayPal\StructType\DiscountType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Discount[] = $item; return $this; @@ -496,7 +520,7 @@ public function setTaxable($taxable = null) { // validation for constraint: boolean if (!is_null($taxable) && !is_bool($taxable)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($taxable)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($taxable, true), gettype($taxable)), __LINE__); } $this->Taxable = $taxable; return $this; @@ -516,6 +540,10 @@ public function getTaxRate() */ public function setTaxRate($taxRate = null) { + // validation for constraint: float + if (!is_null($taxRate) && !(is_float($taxRate) || is_numeric($taxRate))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($taxRate, true), gettype($taxRate)), __LINE__); + } $this->TaxRate = $taxRate; return $this; } @@ -527,6 +555,28 @@ public function getAdditionalFees() { return $this->AdditionalFees; } + /** + * This method is responsible for validating the values passed to the setAdditionalFees method + * This method is willingly generated in order to preserve the one-line inline validation within the setAdditionalFees method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateAdditionalFeesForArrayConstraintsFromSetAdditionalFees(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $invoiceItemTypeAdditionalFeesItem) { + // validation for constraint: itemType + if (!$invoiceItemTypeAdditionalFeesItem instanceof \PayPal\StructType\AdditionalFeeType) { + $invalidValues[] = is_object($invoiceItemTypeAdditionalFeesItem) ? get_class($invoiceItemTypeAdditionalFeesItem) : sprintf('%s(%s)', gettype($invoiceItemTypeAdditionalFeesItem), var_export($invoiceItemTypeAdditionalFeesItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The AdditionalFees property can only contain items of type \PayPal\StructType\AdditionalFeeType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set AdditionalFees value * @throws \InvalidArgumentException @@ -535,11 +585,9 @@ public function getAdditionalFees() */ public function setAdditionalFees(array $additionalFees = array()) { - foreach ($additionalFees as $invoiceItemTypeAdditionalFeesItem) { - // validation for constraint: itemType - if (!$invoiceItemTypeAdditionalFeesItem instanceof \PayPal\StructType\AdditionalFeeType) { - throw new \InvalidArgumentException(sprintf('The AdditionalFees property can only contain items of \PayPal\StructType\AdditionalFeeType, "%s" given', is_object($invoiceItemTypeAdditionalFeesItem) ? get_class($invoiceItemTypeAdditionalFeesItem) : gettype($invoiceItemTypeAdditionalFeesItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($additionalFeesArrayErrorMessage = self::validateAdditionalFeesForArrayConstraintsFromSetAdditionalFees($additionalFees))) { + throw new \InvalidArgumentException($additionalFeesArrayErrorMessage, __LINE__); } $this->AdditionalFees = $additionalFees; return $this; @@ -554,7 +602,7 @@ public function addToAdditionalFees(\PayPal\StructType\AdditionalFeeType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\AdditionalFeeType) { - throw new \InvalidArgumentException(sprintf('The AdditionalFees property can only contain items of \PayPal\StructType\AdditionalFeeType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The AdditionalFees property can only contain items of type \PayPal\StructType\AdditionalFeeType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->AdditionalFees[] = $item; return $this; @@ -576,7 +624,7 @@ public function setReimbursable($reimbursable = null) { // validation for constraint: boolean if (!is_null($reimbursable) && !is_bool($reimbursable)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($reimbursable)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($reimbursable, true), gettype($reimbursable)), __LINE__); } $this->Reimbursable = $reimbursable; return $this; @@ -598,7 +646,7 @@ public function setMPN($mPN = null) { // validation for constraint: string if (!is_null($mPN) && !is_string($mPN)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($mPN)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mPN, true), gettype($mPN)), __LINE__); } $this->MPN = $mPN; return $this; @@ -620,7 +668,7 @@ public function setISBN($iSBN = null) { // validation for constraint: string if (!is_null($iSBN) && !is_string($iSBN)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($iSBN)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($iSBN, true), gettype($iSBN)), __LINE__); } $this->ISBN = $iSBN; return $this; @@ -642,7 +690,7 @@ public function setPLU($pLU = null) { // validation for constraint: string if (!is_null($pLU) && !is_string($pLU)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pLU)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pLU, true), gettype($pLU)), __LINE__); } $this->PLU = $pLU; return $this; @@ -664,7 +712,7 @@ public function setModelNumber($modelNumber = null) { // validation for constraint: string if (!is_null($modelNumber) && !is_string($modelNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($modelNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($modelNumber, true), gettype($modelNumber)), __LINE__); } $this->ModelNumber = $modelNumber; return $this; @@ -686,7 +734,7 @@ public function setStyleNumber($styleNumber = null) { // validation for constraint: string if (!is_null($styleNumber) && !is_string($styleNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($styleNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($styleNumber, true), gettype($styleNumber)), __LINE__); } $this->StyleNumber = $styleNumber; return $this; diff --git a/src/StructType/ItemTrackingDetailsType.php b/src/StructType/ItemTrackingDetailsType.php index 0e44f41..ac3a7a3 100644 --- a/src/StructType/ItemTrackingDetailsType.php +++ b/src/StructType/ItemTrackingDetailsType.php @@ -13,7 +13,7 @@ class ItemTrackingDetailsType extends AbstractStructBase { /** * The ItemNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item Number. Required * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class ItemTrackingDetailsType extends AbstractStructBase public $ItemNumber; /** * The ItemQty - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Quantity. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class ItemTrackingDetailsType extends AbstractStructBase public $ItemQty; /** * The ItemQtyDelta - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item Quantity Delta. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -40,7 +40,7 @@ class ItemTrackingDetailsType extends AbstractStructBase public $ItemQtyDelta; /** * The ItemAlert - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item Alert. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -49,7 +49,7 @@ class ItemTrackingDetailsType extends AbstractStructBase public $ItemAlert; /** * The ItemCost - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item Cost. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -95,7 +95,7 @@ public function setItemNumber($itemNumber = null) { // validation for constraint: string if (!is_null($itemNumber) && !is_string($itemNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemNumber, true), gettype($itemNumber)), __LINE__); } $this->ItemNumber = $itemNumber; return $this; @@ -117,7 +117,7 @@ public function setItemQty($itemQty = null) { // validation for constraint: string if (!is_null($itemQty) && !is_string($itemQty)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemQty)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemQty, true), gettype($itemQty)), __LINE__); } $this->ItemQty = $itemQty; return $this; @@ -139,7 +139,7 @@ public function setItemQtyDelta($itemQtyDelta = null) { // validation for constraint: string if (!is_null($itemQtyDelta) && !is_string($itemQtyDelta)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemQtyDelta)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemQtyDelta, true), gettype($itemQtyDelta)), __LINE__); } $this->ItemQtyDelta = $itemQtyDelta; return $this; @@ -161,7 +161,7 @@ public function setItemAlert($itemAlert = null) { // validation for constraint: string if (!is_null($itemAlert) && !is_string($itemAlert)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemAlert)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemAlert, true), gettype($itemAlert)), __LINE__); } $this->ItemAlert = $itemAlert; return $this; @@ -183,7 +183,7 @@ public function setItemCost($itemCost = null) { // validation for constraint: string if (!is_null($itemCost) && !is_string($itemCost)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemCost)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemCost, true), gettype($itemCost)), __LINE__); } $this->ItemCost = $itemCost; return $this; diff --git a/src/StructType/ItemType.php b/src/StructType/ItemType.php index d8dab50..2e7721b 100644 --- a/src/StructType/ItemType.php +++ b/src/StructType/ItemType.php @@ -6,11 +6,11 @@ /** * This class stands for ItemType StructType - * Meta informations extracted from the WSDL - * - documentation: 2-letter ISO 3166 Country Code. | 3-letter ISO Currency Code. | The ID that uniquely identifies the item listing. | Describes the number of days the auction will be active. | List of payment methods accepted by a seller from a buyer - * for a (checkout) transaction. | Region where the item is listed. See Region Table for values. If the item is listed with a Region of 0 (zero), then this return field denotes no region association with the item, meaning that it is not listing the item - * regionally. | Revise Status contains information about the item being revised. | Seller user. | Container for for selling status information (e.g., BidCount, BidIncrement, HighBidder, MinimimumToBid, etc). | Contains the shipping payment related - * information for the listed item. | Regions that seller will ship to. | eBay site on which item is listed. | Universally unique constraint tag. The UUID is unique to a category. + * Meta information extracted from the WSDL + * - documentation: Universally unique constraint tag. The UUID is unique to a category. | eBay site on which item is listed. | Regions that seller will ship to. | Contains the shipping payment related information for the listed item. | Container for + * for selling status information (e.g., BidCount, BidIncrement, HighBidder, MinimimumToBid, etc). | Seller user. | Revise Status contains information about the item being revised. | Region where the item is listed. See Region Table for values. If the + * item is listed with a Region of 0 (zero), then this return field denotes no region association with the item, meaning that it is not listing the item regionally. | List of payment methods accepted by a seller from a buyer for a (checkout) + * transaction. | Describes the number of days the auction will be active. | The ID that uniquely identifies the item listing. | 3-letter ISO Currency Code. | 2-letter ISO 3166 Country Code. * @subpackage Structs * @author WsdlToPhp */ @@ -18,7 +18,7 @@ class ItemType extends AbstractStructBase { /** * The ApplicationData - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Returns custom, application-specific data associated with the item. The data in this field is stored with the item in the items table at eBay, but is not used in any way by eBay. Use ApplicationData to store such special information * as a part or SKU number. Maximum 32 characters in length. * - minOccurs: 0 @@ -27,7 +27,7 @@ class ItemType extends AbstractStructBase public $ApplicationData; /** * The ListOfAttributeSets - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Carries one or more instances of the AttributeSet in a list. * - minOccurs: 0 * @var \PayPal\StructType\ListOfAttributeSetType @@ -35,7 +35,7 @@ class ItemType extends AbstractStructBase public $ListOfAttributeSets; /** * The AutoPay - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If true (1), indicates that the seller requested immediate payment for the item. False (0) if immediate payment was not requested. (Does not indicate whether the item is still a candidate for puchase via immediate payment.) Only * applicable for items listed on US and UK sites in categories that support immediate payment, when seller has a Premier or Business PayPal account. * - minOccurs: 0 @@ -44,7 +44,7 @@ class ItemType extends AbstractStructBase public $AutoPay; /** * The BuyerProtection - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates the status of the item's eligibility for the Buyer Protection Program. Possible values: ItemIneligible - Item is ineligible (e.g., category not applicable) ItemEligible - Item is eligible per standard criteria * ItemMarkedIneligible - Item marked ineligible per special criteria (e.g., seller's account closed) ItemMarkedIneligible - Item marked elegible per other criteria Applicable for items listed to the US site and for the Parts and Accessories category * (6028) or Everything Else category (10368) (or their subcategories) on the eBay Motors site. @@ -54,7 +54,7 @@ class ItemType extends AbstractStructBase public $BuyerProtection; /** * The BuyItNowPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount a Buyer would need to bid to take advantage of the Buy It Now feature. Not applicable to Fixed-Price items (Type = 7 or 9) or AdFormat-type listings. For Fixed-Price items, see StartPrice instead. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -62,7 +62,7 @@ class ItemType extends AbstractStructBase public $BuyItNowPrice; /** * The Charity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Charity listing container. * - minOccurs: 0 * @var \PayPal\StructType\CharityType @@ -70,7 +70,7 @@ class ItemType extends AbstractStructBase public $Charity; /** * The Country - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:Country * @var string @@ -78,7 +78,7 @@ class ItemType extends AbstractStructBase public $Country; /** * The CrossPromotion - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: CrossPromotions container, if applicable shows promoted items * - minOccurs: 0 * @var \PayPal\StructType\CrossPromotionsType @@ -86,7 +86,7 @@ class ItemType extends AbstractStructBase public $CrossPromotion; /** * The Currency - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:Currency * @var string @@ -94,7 +94,7 @@ class ItemType extends AbstractStructBase public $Currency; /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item Description. * - minOccurs: 0 * @var string @@ -102,7 +102,7 @@ class ItemType extends AbstractStructBase public $Description; /** * The Escrow - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Online Escrow paid for by buyer or seller. Cannot use with real estate auctions. Escrow is recommended for for transactions over $500. Escrow service, available via Escrow.com, protects both buyer and seller by acting as a trusted * third-party during the transaction and managing the payment process from start to finish. Also, if escrow by seller option used, then for Motors, this means that Escrow will be negotiated at the end of the auction. * - minOccurs: 0 @@ -111,7 +111,7 @@ class ItemType extends AbstractStructBase public $Escrow; /** * The GiftIcon - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If set, a generic gift icon displays in the listing's Title. GiftIcon must be set to to be able to use GiftServices options (e.g., GiftExpressShipping, GiftShipToRecipient, or GiftWrap). * - minOccurs: 0 * @var int @@ -119,7 +119,7 @@ class ItemType extends AbstractStructBase public $GiftIcon; /** * The GiftServices - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Gift service options offered by the seller of the listed item. * - maxOccurs: unbounded * - minOccurs: 0 @@ -128,7 +128,7 @@ class ItemType extends AbstractStructBase public $GiftServices; /** * The HitCounter - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Optional hit counter for the item's listing page. Possible values are: "NoHitCounter" "HonestyStyle" "GreenLED" "Hidden" * - minOccurs: 0 * @var string @@ -136,16 +136,17 @@ class ItemType extends AbstractStructBase public $HitCounter; /** * The ItemID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - documentation: Represents the unique identifier for an item. To be used to specify the elements that represents an ItemID. + * - base: xs:string * - minOccurs: 0 * - ref: ns:ItemID - * - documentation: Represents the unique identifier for an item. To be used to specify the elements that represents an ItemID. * @var string */ public $ItemID; /** * The ListingDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Includes listing details in terms of start and end time of listing (in GMT) as well as other details (e.g., orginal item for second chance, converted start price, etc.). * - minOccurs: 0 * @var \PayPal\StructType\ListingDetailsType @@ -153,7 +154,7 @@ class ItemType extends AbstractStructBase public $ListingDetails; /** * The ListingDesigner - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: When an item is first listed (using AddItem), a Layout template or a Theme template (or both) can be assigned to the item. A Layout template is assigned to a new item by specifying the Layout template ID (in the AddItem input * argument LayoutID). Similarly, a Theme template is assigned to the item using the ThemeID argument. * - minOccurs: 0 @@ -162,7 +163,7 @@ class ItemType extends AbstractStructBase public $ListingDesigner; /** * The ListingDuration - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:ListingDuration * @var string @@ -170,7 +171,7 @@ class ItemType extends AbstractStructBase public $ListingDuration; /** * The ListingEnhancement - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Describes the types of enhancment supported for the item's listing. * - maxOccurs: unbounded * - minOccurs: 0 @@ -179,7 +180,7 @@ class ItemType extends AbstractStructBase public $ListingEnhancement; /** * The ListingType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Describes the type of listing for the item a seller has chosen (e.g., Chinese, Dutch, FixedPrice, etc.). * - minOccurs: 0 * @var string @@ -187,7 +188,7 @@ class ItemType extends AbstractStructBase public $ListingType; /** * The Location - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates the geographical location of the item. * - minOccurs: 0 * @var string @@ -195,7 +196,7 @@ class ItemType extends AbstractStructBase public $Location; /** * The PartnerCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Needed for add item only for partners. * - minOccurs: 0 * @var string @@ -203,7 +204,7 @@ class ItemType extends AbstractStructBase public $PartnerCode; /** * The PartnerName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Needed for add item only for partners. * - minOccurs: 0 * @var string @@ -211,7 +212,7 @@ class ItemType extends AbstractStructBase public $PartnerName; /** * The PaymentMethods - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * - ref: ns:PaymentMethods @@ -220,7 +221,7 @@ class ItemType extends AbstractStructBase public $PaymentMethods; /** * The PayPalEmailAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Valid PayPal e-mail address if seller has chosen PayPal as a payment method for the listed item. * - minOccurs: 0 * @var string @@ -228,7 +229,7 @@ class ItemType extends AbstractStructBase public $PayPalEmailAddress; /** * The PrimaryCategory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Container for data on the primary category of listing. * - minOccurs: 0 * @var \PayPal\StructType\CategoryType @@ -236,7 +237,7 @@ class ItemType extends AbstractStructBase public $PrimaryCategory; /** * The PrivateListing - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Private auction. Not applicable to Fixed Price items. * - minOccurs: 0 * @var bool @@ -244,7 +245,7 @@ class ItemType extends AbstractStructBase public $PrivateListing; /** * The Quantity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Number of items being sold in the auction. * - minOccurs: 0 * @var int @@ -252,7 +253,7 @@ class ItemType extends AbstractStructBase public $Quantity; /** * The RegionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:RegionID * @var string @@ -260,7 +261,7 @@ class ItemType extends AbstractStructBase public $RegionID; /** * The RelistLink - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If true, creates a link from the old listing for the item to the new relist page, which accommodates users who might still look for the item under its old item ID. Also adds the relist ID to the old listing's record in the eBay * database, which can be returned by calling GetItem for the old ItemId. If your application creates the listing page for the user, you need to add the relist link option to your application for your users. * - minOccurs: 0 @@ -269,7 +270,7 @@ class ItemType extends AbstractStructBase public $RelistLink; /** * The ReservePrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates the reserve price for a reserve auction. Returned only if DetailLevel = 4. ReservePrice is only returned for auctions with a reserve price where the user calling GetItem is the item's seller. Returned as null for * International Fixed Price items. For more information on reserve price auctions, see http://pages.ebay.com/help/basics/f-format.html#1. * - minOccurs: 0 @@ -278,7 +279,7 @@ class ItemType extends AbstractStructBase public $ReservePrice; /** * The ReviseStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:ReviseStatus * @var \PayPal\StructType\ReviseStatusType @@ -286,14 +287,14 @@ class ItemType extends AbstractStructBase public $ReviseStatus; /** * The ScheduleTime - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ScheduleTime; /** * The SecondaryCategory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Container for data on the secondary category of listing. Secondary category is optional. * - minOccurs: 0 * @var \PayPal\StructType\CategoryType @@ -301,7 +302,7 @@ class ItemType extends AbstractStructBase public $SecondaryCategory; /** * The SiteHostedPicture - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item picture information for pictures hosted at eBay site. * - minOccurs: 0 * @var \PayPal\StructType\SiteHostedPictureType @@ -309,7 +310,7 @@ class ItemType extends AbstractStructBase public $SiteHostedPicture; /** * The Seller - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:Seller * @var \PayPal\StructType\UserType @@ -317,7 +318,7 @@ class ItemType extends AbstractStructBase public $Seller; /** * The SellingStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:SellingStatus * @var \PayPal\StructType\SellingStatusType @@ -325,7 +326,7 @@ class ItemType extends AbstractStructBase public $SellingStatus; /** * The ShippingOption - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Specifies where the seller is willing to ship the item. Default "SiteOnly". Valid values are: SiteOnly (the default) WorldWide SitePlusRegions WillNotShip If SitePlusRegions is selected, then at least one regions argument * (ShipToNorthAmerica, ShipToEurope, etc.) must also be set. * - minOccurs: 0 @@ -334,7 +335,7 @@ class ItemType extends AbstractStructBase public $ShippingOption; /** * The ShippingDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:ShippingDetails * @var \PayPal\StructType\ShippingDetailsType @@ -342,7 +343,7 @@ class ItemType extends AbstractStructBase public $ShippingDetails; /** * The ShippingRegions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * - ref: ns:ShippingRegions @@ -351,7 +352,7 @@ class ItemType extends AbstractStructBase public $ShippingRegions; /** * The ShippingTerms - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Describes who pays for the delivery of an item (e.g., buyer or seller). * - minOccurs: 0 * @var string @@ -359,7 +360,7 @@ class ItemType extends AbstractStructBase public $ShippingTerms; /** * The Site - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:Site * @var string @@ -367,7 +368,7 @@ class ItemType extends AbstractStructBase public $Site; /** * The StartPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Starting price for the item. For Type=7 or Type=9 (Fixed Price) items, if the item price (MinimumBid) is revised, this field returns the new price. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -375,7 +376,7 @@ class ItemType extends AbstractStructBase public $StartPrice; /** * The Storefront - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Storefront is shown for any item that belongs to an eBay Store owner, regardless of whether it is fixed price or auction type. Not returned for International Fixed Price items. * - minOccurs: 0 * @var \PayPal\StructType\StorefrontType @@ -383,7 +384,7 @@ class ItemType extends AbstractStructBase public $Storefront; /** * The SubTitle - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Subtitle to use in addition to the title. Provides more keywords when buyers search in titles and descriptions. * - minOccurs: 0 * @var string @@ -391,7 +392,7 @@ class ItemType extends AbstractStructBase public $SubTitle; /** * The TimeLeft - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Time until the the end of the listing (e.g., the amount of time left in an active auction). * - minOccurs: 0 * @var string @@ -399,7 +400,7 @@ class ItemType extends AbstractStructBase public $TimeLeft; /** * The Title - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Name of the item as it appears for auctions. * - minOccurs: 0 * @var string @@ -407,17 +408,18 @@ class ItemType extends AbstractStructBase public $Title; /** * The UUID - * Meta informations extracted from the WSDL - * - minOccurs: 0 - * - ref: ns:UUID + * Meta information extracted from the WSDL * - documentation: Specifies a universally unique identifier. The UUID can only contain digits from 0-9 and letters from A-F. The UUID must be 32 characters long. For example, 1FB02B2-9D27-3acb-ABA2-9D539C374228 + * - base: xs:string * - length: 36 + * - minOccurs: 0 + * - ref: ns:UUID * @var string */ public $UUID; /** * The VATDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: VAT info container. * - minOccurs: 0 * @var \PayPal\StructType\VATDetailsType @@ -425,7 +427,7 @@ class ItemType extends AbstractStructBase public $VATDetails; /** * The VendorHostedPicture - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item picture information for pictures hosted at vendor (i.e., remote) site. * - minOccurs: 0 * @var \PayPal\StructType\VendorHostedPictureType @@ -605,7 +607,7 @@ public function setApplicationData($applicationData = null) { // validation for constraint: string if (!is_null($applicationData) && !is_string($applicationData)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($applicationData)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($applicationData, true), gettype($applicationData)), __LINE__); } $this->ApplicationData = $applicationData; return $this; @@ -645,7 +647,7 @@ public function setAutoPay($autoPay = null) { // validation for constraint: boolean if (!is_null($autoPay) && !is_bool($autoPay)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($autoPay)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($autoPay, true), gettype($autoPay)), __LINE__); } $this->AutoPay = $autoPay; return $this; @@ -670,7 +672,7 @@ public function setBuyerProtection($buyerProtection = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BuyerProtectionCodeType::valueIsValid($buyerProtection)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $buyerProtection, implode(', ', \PayPal\EnumType\BuyerProtectionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BuyerProtectionCodeType', is_array($buyerProtection) ? implode(', ', $buyerProtection) : var_export($buyerProtection, true), implode(', ', \PayPal\EnumType\BuyerProtectionCodeType::getValidValues())), __LINE__); } $this->BuyerProtection = $buyerProtection; return $this; @@ -731,7 +733,7 @@ public function setCountry($country = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CountryCodeType::valueIsValid($country)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $country, implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CountryCodeType', is_array($country) ? implode(', ', $country) : var_export($country, true), implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); } $this->Country = $country; return $this; @@ -774,7 +776,7 @@ public function setCurrency($currency = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CurrencyCodeType::valueIsValid($currency)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $currency, implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CurrencyCodeType', is_array($currency) ? implode(', ', $currency) : var_export($currency, true), implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); } $this->Currency = $currency; return $this; @@ -796,7 +798,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this; @@ -821,7 +823,7 @@ public function setEscrow($escrow = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\EscrowCodeType::valueIsValid($escrow)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $escrow, implode(', ', \PayPal\EnumType\EscrowCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\EscrowCodeType', is_array($escrow) ? implode(', ', $escrow) : var_export($escrow, true), implode(', ', \PayPal\EnumType\EscrowCodeType::getValidValues())), __LINE__); } $this->Escrow = $escrow; return $this; @@ -842,8 +844,8 @@ public function getGiftIcon() public function setGiftIcon($giftIcon = null) { // validation for constraint: int - if (!is_null($giftIcon) && !is_numeric($giftIcon)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($giftIcon)), __LINE__); + if (!is_null($giftIcon) && !(is_int($giftIcon) || ctype_digit($giftIcon))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($giftIcon, true), gettype($giftIcon)), __LINE__); } $this->GiftIcon = $giftIcon; return $this; @@ -856,6 +858,28 @@ public function getGiftServices() { return $this->GiftServices; } + /** + * This method is responsible for validating the values passed to the setGiftServices method + * This method is willingly generated in order to preserve the one-line inline validation within the setGiftServices method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateGiftServicesForArrayConstraintsFromSetGiftServices(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $itemTypeGiftServicesItem) { + // validation for constraint: enumeration + if (!\PayPal\EnumType\GiftServicesCodeType::valueIsValid($itemTypeGiftServicesItem)) { + $invalidValues[] = is_object($itemTypeGiftServicesItem) ? get_class($itemTypeGiftServicesItem) : sprintf('%s(%s)', gettype($itemTypeGiftServicesItem), var_export($itemTypeGiftServicesItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\GiftServicesCodeType', is_array($invalidValues) ? implode(', ', $invalidValues) : var_export($invalidValues, true), implode(', ', \PayPal\EnumType\GiftServicesCodeType::getValidValues())); + } + unset($invalidValues); + return $message; + } /** * Set GiftServices value * @uses \PayPal\EnumType\GiftServicesCodeType::valueIsValid() @@ -866,14 +890,9 @@ public function getGiftServices() */ public function setGiftServices(array $giftServices = array()) { - $invalidValues = array(); - foreach ($giftServices as $itemTypeGiftServicesItem) { - if (!\PayPal\EnumType\GiftServicesCodeType::valueIsValid($itemTypeGiftServicesItem)) { - $invalidValues[] = var_export($itemTypeGiftServicesItem, true); - } - } - if (!empty($invalidValues)) { - throw new \InvalidArgumentException(sprintf('Value(s) "%s" is/are invalid, please use one of: %s', implode(', ', $invalidValues), implode(', ', \PayPal\EnumType\GiftServicesCodeType::getValidValues())), __LINE__); + // validation for constraint: array + if ('' !== ($giftServicesArrayErrorMessage = self::validateGiftServicesForArrayConstraintsFromSetGiftServices($giftServices))) { + throw new \InvalidArgumentException($giftServicesArrayErrorMessage, __LINE__); } $this->GiftServices = $giftServices; return $this; @@ -890,7 +909,7 @@ public function addToGiftServices($item) { // validation for constraint: enumeration if (!\PayPal\EnumType\GiftServicesCodeType::valueIsValid($item)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $item, implode(', ', \PayPal\EnumType\GiftServicesCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\GiftServicesCodeType', is_array($item) ? implode(', ', $item) : var_export($item, true), implode(', ', \PayPal\EnumType\GiftServicesCodeType::getValidValues())), __LINE__); } $this->GiftServices[] = $item; return $this; @@ -915,7 +934,7 @@ public function setHitCounter($hitCounter = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\HitCounterCodeType::valueIsValid($hitCounter)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $hitCounter, implode(', ', \PayPal\EnumType\HitCounterCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\HitCounterCodeType', is_array($hitCounter) ? implode(', ', $hitCounter) : var_export($hitCounter, true), implode(', ', \PayPal\EnumType\HitCounterCodeType::getValidValues())), __LINE__); } $this->HitCounter = $hitCounter; return $this; @@ -937,7 +956,7 @@ public function setItemID($itemID = null) { // validation for constraint: string if (!is_null($itemID) && !is_string($itemID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemID, true), gettype($itemID)), __LINE__); } $this->ItemID = $itemID; return $this; @@ -998,7 +1017,7 @@ public function setListingDuration($listingDuration = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ListingDurationCodeType::valueIsValid($listingDuration)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $listingDuration, implode(', ', \PayPal\EnumType\ListingDurationCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ListingDurationCodeType', is_array($listingDuration) ? implode(', ', $listingDuration) : var_export($listingDuration, true), implode(', ', \PayPal\EnumType\ListingDurationCodeType::getValidValues())), __LINE__); } $this->ListingDuration = $listingDuration; return $this; @@ -1011,6 +1030,28 @@ public function getListingEnhancement() { return $this->ListingEnhancement; } + /** + * This method is responsible for validating the values passed to the setListingEnhancement method + * This method is willingly generated in order to preserve the one-line inline validation within the setListingEnhancement method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateListingEnhancementForArrayConstraintsFromSetListingEnhancement(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $itemTypeListingEnhancementItem) { + // validation for constraint: enumeration + if (!\PayPal\EnumType\ListingEnhancementsCodeType::valueIsValid($itemTypeListingEnhancementItem)) { + $invalidValues[] = is_object($itemTypeListingEnhancementItem) ? get_class($itemTypeListingEnhancementItem) : sprintf('%s(%s)', gettype($itemTypeListingEnhancementItem), var_export($itemTypeListingEnhancementItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ListingEnhancementsCodeType', is_array($invalidValues) ? implode(', ', $invalidValues) : var_export($invalidValues, true), implode(', ', \PayPal\EnumType\ListingEnhancementsCodeType::getValidValues())); + } + unset($invalidValues); + return $message; + } /** * Set ListingEnhancement value * @uses \PayPal\EnumType\ListingEnhancementsCodeType::valueIsValid() @@ -1021,14 +1062,9 @@ public function getListingEnhancement() */ public function setListingEnhancement(array $listingEnhancement = array()) { - $invalidValues = array(); - foreach ($listingEnhancement as $itemTypeListingEnhancementItem) { - if (!\PayPal\EnumType\ListingEnhancementsCodeType::valueIsValid($itemTypeListingEnhancementItem)) { - $invalidValues[] = var_export($itemTypeListingEnhancementItem, true); - } - } - if (!empty($invalidValues)) { - throw new \InvalidArgumentException(sprintf('Value(s) "%s" is/are invalid, please use one of: %s', implode(', ', $invalidValues), implode(', ', \PayPal\EnumType\ListingEnhancementsCodeType::getValidValues())), __LINE__); + // validation for constraint: array + if ('' !== ($listingEnhancementArrayErrorMessage = self::validateListingEnhancementForArrayConstraintsFromSetListingEnhancement($listingEnhancement))) { + throw new \InvalidArgumentException($listingEnhancementArrayErrorMessage, __LINE__); } $this->ListingEnhancement = $listingEnhancement; return $this; @@ -1045,7 +1081,7 @@ public function addToListingEnhancement($item) { // validation for constraint: enumeration if (!\PayPal\EnumType\ListingEnhancementsCodeType::valueIsValid($item)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $item, implode(', ', \PayPal\EnumType\ListingEnhancementsCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ListingEnhancementsCodeType', is_array($item) ? implode(', ', $item) : var_export($item, true), implode(', ', \PayPal\EnumType\ListingEnhancementsCodeType::getValidValues())), __LINE__); } $this->ListingEnhancement[] = $item; return $this; @@ -1070,7 +1106,7 @@ public function setListingType($listingType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ListingTypeCodeType::valueIsValid($listingType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $listingType, implode(', ', \PayPal\EnumType\ListingTypeCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ListingTypeCodeType', is_array($listingType) ? implode(', ', $listingType) : var_export($listingType, true), implode(', ', \PayPal\EnumType\ListingTypeCodeType::getValidValues())), __LINE__); } $this->ListingType = $listingType; return $this; @@ -1092,7 +1128,7 @@ public function setLocation($location = null) { // validation for constraint: string if (!is_null($location) && !is_string($location)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($location)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($location, true), gettype($location)), __LINE__); } $this->Location = $location; return $this; @@ -1114,7 +1150,7 @@ public function setPartnerCode($partnerCode = null) { // validation for constraint: string if (!is_null($partnerCode) && !is_string($partnerCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($partnerCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($partnerCode, true), gettype($partnerCode)), __LINE__); } $this->PartnerCode = $partnerCode; return $this; @@ -1136,7 +1172,7 @@ public function setPartnerName($partnerName = null) { // validation for constraint: string if (!is_null($partnerName) && !is_string($partnerName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($partnerName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($partnerName, true), gettype($partnerName)), __LINE__); } $this->PartnerName = $partnerName; return $this; @@ -1149,6 +1185,28 @@ public function getPaymentMethods() { return $this->PaymentMethods; } + /** + * This method is responsible for validating the values passed to the setPaymentMethods method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentMethods method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentMethodsForArrayConstraintsFromSetPaymentMethods(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $itemTypePaymentMethodsItem) { + // validation for constraint: enumeration + if (!\PayPal\EnumType\BuyerPaymentMethodCodeType::valueIsValid($itemTypePaymentMethodsItem)) { + $invalidValues[] = is_object($itemTypePaymentMethodsItem) ? get_class($itemTypePaymentMethodsItem) : sprintf('%s(%s)', gettype($itemTypePaymentMethodsItem), var_export($itemTypePaymentMethodsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BuyerPaymentMethodCodeType', is_array($invalidValues) ? implode(', ', $invalidValues) : var_export($invalidValues, true), implode(', ', \PayPal\EnumType\BuyerPaymentMethodCodeType::getValidValues())); + } + unset($invalidValues); + return $message; + } /** * Set PaymentMethods value * @uses \PayPal\EnumType\BuyerPaymentMethodCodeType::valueIsValid() @@ -1159,14 +1217,9 @@ public function getPaymentMethods() */ public function setPaymentMethods(array $paymentMethods = array()) { - $invalidValues = array(); - foreach ($paymentMethods as $itemTypePaymentMethodsItem) { - if (!\PayPal\EnumType\BuyerPaymentMethodCodeType::valueIsValid($itemTypePaymentMethodsItem)) { - $invalidValues[] = var_export($itemTypePaymentMethodsItem, true); - } - } - if (!empty($invalidValues)) { - throw new \InvalidArgumentException(sprintf('Value(s) "%s" is/are invalid, please use one of: %s', implode(', ', $invalidValues), implode(', ', \PayPal\EnumType\BuyerPaymentMethodCodeType::getValidValues())), __LINE__); + // validation for constraint: array + if ('' !== ($paymentMethodsArrayErrorMessage = self::validatePaymentMethodsForArrayConstraintsFromSetPaymentMethods($paymentMethods))) { + throw new \InvalidArgumentException($paymentMethodsArrayErrorMessage, __LINE__); } $this->PaymentMethods = $paymentMethods; return $this; @@ -1183,7 +1236,7 @@ public function addToPaymentMethods($item) { // validation for constraint: enumeration if (!\PayPal\EnumType\BuyerPaymentMethodCodeType::valueIsValid($item)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $item, implode(', ', \PayPal\EnumType\BuyerPaymentMethodCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BuyerPaymentMethodCodeType', is_array($item) ? implode(', ', $item) : var_export($item, true), implode(', ', \PayPal\EnumType\BuyerPaymentMethodCodeType::getValidValues())), __LINE__); } $this->PaymentMethods[] = $item; return $this; @@ -1205,7 +1258,7 @@ public function setPayPalEmailAddress($payPalEmailAddress = null) { // validation for constraint: string if (!is_null($payPalEmailAddress) && !is_string($payPalEmailAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payPalEmailAddress)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payPalEmailAddress, true), gettype($payPalEmailAddress)), __LINE__); } $this->PayPalEmailAddress = $payPalEmailAddress; return $this; @@ -1245,7 +1298,7 @@ public function setPrivateListing($privateListing = null) { // validation for constraint: boolean if (!is_null($privateListing) && !is_bool($privateListing)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($privateListing)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($privateListing, true), gettype($privateListing)), __LINE__); } $this->PrivateListing = $privateListing; return $this; @@ -1266,8 +1319,8 @@ public function getQuantity() public function setQuantity($quantity = null) { // validation for constraint: int - if (!is_null($quantity) && !is_numeric($quantity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($quantity)), __LINE__); + if (!is_null($quantity) && !(is_int($quantity) || ctype_digit($quantity))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($quantity, true), gettype($quantity)), __LINE__); } $this->Quantity = $quantity; return $this; @@ -1289,7 +1342,7 @@ public function setRegionID($regionID = null) { // validation for constraint: string if (!is_null($regionID) && !is_string($regionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($regionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($regionID, true), gettype($regionID)), __LINE__); } $this->RegionID = $regionID; return $this; @@ -1311,7 +1364,7 @@ public function setRelistLink($relistLink = null) { // validation for constraint: boolean if (!is_null($relistLink) && !is_bool($relistLink)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($relistLink)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($relistLink, true), gettype($relistLink)), __LINE__); } $this->RelistLink = $relistLink; return $this; @@ -1369,7 +1422,7 @@ public function setScheduleTime($scheduleTime = null) { // validation for constraint: string if (!is_null($scheduleTime) && !is_string($scheduleTime)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($scheduleTime)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($scheduleTime, true), gettype($scheduleTime)), __LINE__); } $this->ScheduleTime = $scheduleTime; return $this; @@ -1466,7 +1519,7 @@ public function setShippingOption($shippingOption = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ShippingOptionCodeType::valueIsValid($shippingOption)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $shippingOption, implode(', ', \PayPal\EnumType\ShippingOptionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ShippingOptionCodeType', is_array($shippingOption) ? implode(', ', $shippingOption) : var_export($shippingOption, true), implode(', ', \PayPal\EnumType\ShippingOptionCodeType::getValidValues())), __LINE__); } $this->ShippingOption = $shippingOption; return $this; @@ -1497,6 +1550,28 @@ public function getShippingRegions() { return $this->ShippingRegions; } + /** + * This method is responsible for validating the values passed to the setShippingRegions method + * This method is willingly generated in order to preserve the one-line inline validation within the setShippingRegions method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateShippingRegionsForArrayConstraintsFromSetShippingRegions(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $itemTypeShippingRegionsItem) { + // validation for constraint: enumeration + if (!\PayPal\EnumType\ShippingRegionCodeType::valueIsValid($itemTypeShippingRegionsItem)) { + $invalidValues[] = is_object($itemTypeShippingRegionsItem) ? get_class($itemTypeShippingRegionsItem) : sprintf('%s(%s)', gettype($itemTypeShippingRegionsItem), var_export($itemTypeShippingRegionsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ShippingRegionCodeType', is_array($invalidValues) ? implode(', ', $invalidValues) : var_export($invalidValues, true), implode(', ', \PayPal\EnumType\ShippingRegionCodeType::getValidValues())); + } + unset($invalidValues); + return $message; + } /** * Set ShippingRegions value * @uses \PayPal\EnumType\ShippingRegionCodeType::valueIsValid() @@ -1507,14 +1582,9 @@ public function getShippingRegions() */ public function setShippingRegions(array $shippingRegions = array()) { - $invalidValues = array(); - foreach ($shippingRegions as $itemTypeShippingRegionsItem) { - if (!\PayPal\EnumType\ShippingRegionCodeType::valueIsValid($itemTypeShippingRegionsItem)) { - $invalidValues[] = var_export($itemTypeShippingRegionsItem, true); - } - } - if (!empty($invalidValues)) { - throw new \InvalidArgumentException(sprintf('Value(s) "%s" is/are invalid, please use one of: %s', implode(', ', $invalidValues), implode(', ', \PayPal\EnumType\ShippingRegionCodeType::getValidValues())), __LINE__); + // validation for constraint: array + if ('' !== ($shippingRegionsArrayErrorMessage = self::validateShippingRegionsForArrayConstraintsFromSetShippingRegions($shippingRegions))) { + throw new \InvalidArgumentException($shippingRegionsArrayErrorMessage, __LINE__); } $this->ShippingRegions = $shippingRegions; return $this; @@ -1531,7 +1601,7 @@ public function addToShippingRegions($item) { // validation for constraint: enumeration if (!\PayPal\EnumType\ShippingRegionCodeType::valueIsValid($item)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $item, implode(', ', \PayPal\EnumType\ShippingRegionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ShippingRegionCodeType', is_array($item) ? implode(', ', $item) : var_export($item, true), implode(', ', \PayPal\EnumType\ShippingRegionCodeType::getValidValues())), __LINE__); } $this->ShippingRegions[] = $item; return $this; @@ -1556,7 +1626,7 @@ public function setShippingTerms($shippingTerms = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ShippingTermsCodeType::valueIsValid($shippingTerms)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $shippingTerms, implode(', ', \PayPal\EnumType\ShippingTermsCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ShippingTermsCodeType', is_array($shippingTerms) ? implode(', ', $shippingTerms) : var_export($shippingTerms, true), implode(', ', \PayPal\EnumType\ShippingTermsCodeType::getValidValues())), __LINE__); } $this->ShippingTerms = $shippingTerms; return $this; @@ -1581,7 +1651,7 @@ public function setSite($site = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SiteCodeType::valueIsValid($site)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $site, implode(', ', \PayPal\EnumType\SiteCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SiteCodeType', is_array($site) ? implode(', ', $site) : var_export($site, true), implode(', ', \PayPal\EnumType\SiteCodeType::getValidValues())), __LINE__); } $this->Site = $site; return $this; @@ -1639,7 +1709,7 @@ public function setSubTitle($subTitle = null) { // validation for constraint: string if (!is_null($subTitle) && !is_string($subTitle)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($subTitle)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subTitle, true), gettype($subTitle)), __LINE__); } $this->SubTitle = $subTitle; return $this; @@ -1661,7 +1731,7 @@ public function setTimeLeft($timeLeft = null) { // validation for constraint: string if (!is_null($timeLeft) && !is_string($timeLeft)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($timeLeft)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($timeLeft, true), gettype($timeLeft)), __LINE__); } $this->TimeLeft = $timeLeft; return $this; @@ -1683,7 +1753,7 @@ public function setTitle($title = null) { // validation for constraint: string if (!is_null($title) && !is_string($title)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($title)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($title, true), gettype($title)), __LINE__); } $this->Title = $title; return $this; @@ -1703,13 +1773,13 @@ public function getUUID() */ public function setUUID($uUID = null) { - // validation for constraint: length - if ((is_scalar($uUID) && strlen($uUID) !== 36) || (is_array($uUID) && count($uUID) !== 36)) { - throw new \InvalidArgumentException('Invalid length, please provide an array with 36 element(s) or a scalar of 36 character(s)', __LINE__); - } // validation for constraint: string if (!is_null($uUID) && !is_string($uUID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($uUID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($uUID, true), gettype($uUID)), __LINE__); + } + // validation for constraint: length(36) + if (!is_null($uUID) && mb_strlen($uUID) !== 36) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be equal to 36', mb_strlen($uUID)), __LINE__); } $this->UUID = $uUID; return $this; diff --git a/src/StructType/ListOfAttributeSetType.php b/src/StructType/ListOfAttributeSetType.php index 613c8dd..54a67a5 100644 --- a/src/StructType/ListOfAttributeSetType.php +++ b/src/StructType/ListOfAttributeSetType.php @@ -13,7 +13,7 @@ class ListOfAttributeSetType extends AbstractStructBase { /** * The AttributeSet - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * @var \PayPal\StructType\AttributeSetType[] */ @@ -36,6 +36,28 @@ public function getAttributeSet() { return $this->AttributeSet; } + /** + * This method is responsible for validating the values passed to the setAttributeSet method + * This method is willingly generated in order to preserve the one-line inline validation within the setAttributeSet method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateAttributeSetForArrayConstraintsFromSetAttributeSet(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $listOfAttributeSetTypeAttributeSetItem) { + // validation for constraint: itemType + if (!$listOfAttributeSetTypeAttributeSetItem instanceof \PayPal\StructType\AttributeSetType) { + $invalidValues[] = is_object($listOfAttributeSetTypeAttributeSetItem) ? get_class($listOfAttributeSetTypeAttributeSetItem) : sprintf('%s(%s)', gettype($listOfAttributeSetTypeAttributeSetItem), var_export($listOfAttributeSetTypeAttributeSetItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The AttributeSet property can only contain items of type \PayPal\StructType\AttributeSetType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set AttributeSet value * @throws \InvalidArgumentException @@ -44,11 +66,9 @@ public function getAttributeSet() */ public function setAttributeSet(array $attributeSet = array()) { - foreach ($attributeSet as $listOfAttributeSetTypeAttributeSetItem) { - // validation for constraint: itemType - if (!$listOfAttributeSetTypeAttributeSetItem instanceof \PayPal\StructType\AttributeSetType) { - throw new \InvalidArgumentException(sprintf('The AttributeSet property can only contain items of \PayPal\StructType\AttributeSetType, "%s" given', is_object($listOfAttributeSetTypeAttributeSetItem) ? get_class($listOfAttributeSetTypeAttributeSetItem) : gettype($listOfAttributeSetTypeAttributeSetItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($attributeSetArrayErrorMessage = self::validateAttributeSetForArrayConstraintsFromSetAttributeSet($attributeSet))) { + throw new \InvalidArgumentException($attributeSetArrayErrorMessage, __LINE__); } $this->AttributeSet = $attributeSet; return $this; @@ -63,7 +83,7 @@ public function addToAttributeSet(\PayPal\StructType\AttributeSetType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\AttributeSetType) { - throw new \InvalidArgumentException(sprintf('The AttributeSet property can only contain items of \PayPal\StructType\AttributeSetType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The AttributeSet property can only contain items of type \PayPal\StructType\AttributeSetType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->AttributeSet[] = $item; return $this; diff --git a/src/StructType/ListingDesignerType.php b/src/StructType/ListingDesignerType.php index f3f4f1f..387ce3a 100644 --- a/src/StructType/ListingDesignerType.php +++ b/src/StructType/ListingDesignerType.php @@ -6,7 +6,7 @@ /** * This class stands for ListingDesignerType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Identifies the Layout and the Theme template associated with the item. in case of revision - all data can be min occur = 0 * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class ListingDesignerType extends AbstractStructBase { /** * The LayoutID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Identifies the Layout template associated with the item. * - minOccurs: 0 * @var int @@ -23,7 +23,7 @@ class ListingDesignerType extends AbstractStructBase public $LayoutID; /** * The OptimalPictureSize - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A value of true for OptimalPictureSize indicates that the picture URL will be enlarged to fit description of the item. * - minOccurs: 0 * @var bool @@ -31,7 +31,7 @@ class ListingDesignerType extends AbstractStructBase public $OptimalPictureSize; /** * The ThemeID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Identifies the Theme template associated with the item. * - minOccurs: 0 * @var int @@ -69,8 +69,8 @@ public function getLayoutID() public function setLayoutID($layoutID = null) { // validation for constraint: int - if (!is_null($layoutID) && !is_numeric($layoutID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($layoutID)), __LINE__); + if (!is_null($layoutID) && !(is_int($layoutID) || ctype_digit($layoutID))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($layoutID, true), gettype($layoutID)), __LINE__); } $this->LayoutID = $layoutID; return $this; @@ -92,7 +92,7 @@ public function setOptimalPictureSize($optimalPictureSize = null) { // validation for constraint: boolean if (!is_null($optimalPictureSize) && !is_bool($optimalPictureSize)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($optimalPictureSize)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($optimalPictureSize, true), gettype($optimalPictureSize)), __LINE__); } $this->OptimalPictureSize = $optimalPictureSize; return $this; @@ -113,8 +113,8 @@ public function getThemeID() public function setThemeID($themeID = null) { // validation for constraint: int - if (!is_null($themeID) && !is_numeric($themeID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($themeID)), __LINE__); + if (!is_null($themeID) && !(is_int($themeID) || ctype_digit($themeID))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($themeID, true), gettype($themeID)), __LINE__); } $this->ThemeID = $themeID; return $this; diff --git a/src/StructType/ListingDetailsType.php b/src/StructType/ListingDetailsType.php index 98be766..1c261a2 100644 --- a/src/StructType/ListingDetailsType.php +++ b/src/StructType/ListingDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for ListingDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains the listed item details which consists of following information: . * @subpackage Structs * @author WsdlToPhp @@ -15,28 +15,28 @@ class ListingDetailsType extends AbstractStructBase { /** * The Adult - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $Adult; /** * The BindingAuction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $BindingAuction; /** * The CheckoutEnabled - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $CheckoutEnabled; /** * The ConvertedBuyItNowPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Converted value of the BuyItNowPrice in the currency indicated by SiteCurrency. This value must be refreshed every 24 hours to pick up the current conversion rates. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -44,7 +44,7 @@ class ListingDetailsType extends AbstractStructBase public $ConvertedBuyItNowPrice; /** * The ConvertedStartPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Converted value of the StartPrice field in the currency indicated by SiteCurrency. This value must be refreshed every 24 hours to pick up the current conversion rates. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -52,7 +52,7 @@ class ListingDetailsType extends AbstractStructBase public $ConvertedStartPrice; /** * The ConvertedReservePrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates the converted reserve price for a reserve auction. Returned only if DetailLevel = 4. ReservePrice is only returned for auctions with a reserve price where the user calling GetItem is the item's seller. Returned as null for * International Fixed Price items. For more information on reserve price auctions, see http://pages.ebay.com/help/basics/f-format.html#1. * - minOccurs: 0 @@ -61,38 +61,40 @@ class ListingDetailsType extends AbstractStructBase public $ConvertedReservePrice; /** * The HasReservePrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $HasReservePrice; /** * The RegionName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $RegionName; /** * The RelistedItemID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates the new ItemID for a relisted item. When an item is relisted, the old (expired) listing is annotated with the new (relist) ItemID. This field only appears when the old listing is retrieved. | Represents the unique * identifier for an item. To be used to specify the elements that represents an ItemID. + * - base: xs:string * - minOccurs: 0 * @var string */ public $RelistedItemID; /** * The SecondChanceOriginalItemID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The ItemID for the original listing (i.e., OriginalItemID specific to Second Chance Offer items). | Represents the unique identifier for an item. To be used to specify the elements that represents an ItemID. + * - base: xs:string * - minOccurs: 0 * @var string */ public $SecondChanceOriginalItemID; /** * The StartTime - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Time stamp for the start of the listing (in GMT). For regular items, StartTime is not sent in at listing time. * - minOccurs: 0 * @var string @@ -100,7 +102,7 @@ class ListingDetailsType extends AbstractStructBase public $StartTime; /** * The EndTime - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Time stamp for the end of the listing (in GMT). * - minOccurs: 0 * @var string @@ -108,7 +110,7 @@ class ListingDetailsType extends AbstractStructBase public $EndTime; /** * The ViewItemURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -176,7 +178,7 @@ public function setAdult($adult = null) { // validation for constraint: boolean if (!is_null($adult) && !is_bool($adult)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($adult)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($adult, true), gettype($adult)), __LINE__); } $this->Adult = $adult; return $this; @@ -198,7 +200,7 @@ public function setBindingAuction($bindingAuction = null) { // validation for constraint: boolean if (!is_null($bindingAuction) && !is_bool($bindingAuction)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($bindingAuction)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($bindingAuction, true), gettype($bindingAuction)), __LINE__); } $this->BindingAuction = $bindingAuction; return $this; @@ -220,7 +222,7 @@ public function setCheckoutEnabled($checkoutEnabled = null) { // validation for constraint: boolean if (!is_null($checkoutEnabled) && !is_bool($checkoutEnabled)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($checkoutEnabled)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($checkoutEnabled, true), gettype($checkoutEnabled)), __LINE__); } $this->CheckoutEnabled = $checkoutEnabled; return $this; @@ -296,7 +298,7 @@ public function setHasReservePrice($hasReservePrice = null) { // validation for constraint: boolean if (!is_null($hasReservePrice) && !is_bool($hasReservePrice)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($hasReservePrice)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($hasReservePrice, true), gettype($hasReservePrice)), __LINE__); } $this->HasReservePrice = $hasReservePrice; return $this; @@ -318,7 +320,7 @@ public function setRegionName($regionName = null) { // validation for constraint: string if (!is_null($regionName) && !is_string($regionName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($regionName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($regionName, true), gettype($regionName)), __LINE__); } $this->RegionName = $regionName; return $this; @@ -340,7 +342,7 @@ public function setRelistedItemID($relistedItemID = null) { // validation for constraint: string if (!is_null($relistedItemID) && !is_string($relistedItemID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($relistedItemID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($relistedItemID, true), gettype($relistedItemID)), __LINE__); } $this->RelistedItemID = $relistedItemID; return $this; @@ -362,7 +364,7 @@ public function setSecondChanceOriginalItemID($secondChanceOriginalItemID = null { // validation for constraint: string if (!is_null($secondChanceOriginalItemID) && !is_string($secondChanceOriginalItemID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($secondChanceOriginalItemID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($secondChanceOriginalItemID, true), gettype($secondChanceOriginalItemID)), __LINE__); } $this->SecondChanceOriginalItemID = $secondChanceOriginalItemID; return $this; @@ -384,7 +386,7 @@ public function setStartTime($startTime = null) { // validation for constraint: string if (!is_null($startTime) && !is_string($startTime)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($startTime)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($startTime, true), gettype($startTime)), __LINE__); } $this->StartTime = $startTime; return $this; @@ -406,7 +408,7 @@ public function setEndTime($endTime = null) { // validation for constraint: string if (!is_null($endTime) && !is_string($endTime)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($endTime)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($endTime, true), gettype($endTime)), __LINE__); } $this->EndTime = $endTime; return $this; @@ -428,7 +430,7 @@ public function setViewItemURL($viewItemURL = null) { // validation for constraint: string if (!is_null($viewItemURL) && !is_string($viewItemURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($viewItemURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($viewItemURL, true), gettype($viewItemURL)), __LINE__); } $this->ViewItemURL = $viewItemURL; return $this; diff --git a/src/StructType/ManagePendingTransactionStatusReq.php b/src/StructType/ManagePendingTransactionStatusReq.php index 4c57ccb..47ee9fb 100644 --- a/src/StructType/ManagePendingTransactionStatusReq.php +++ b/src/StructType/ManagePendingTransactionStatusReq.php @@ -13,7 +13,7 @@ class ManagePendingTransactionStatusReq extends AbstractStructBase { /** * The ManagePendingTransactionStatusRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:ManagePendingTransactionStatusRequest * @var \PayPal\StructType\ManagePendingTransactionStatusRequestType */ diff --git a/src/StructType/ManagePendingTransactionStatusRequestType.php b/src/StructType/ManagePendingTransactionStatusRequestType.php index cf211e7..c050730 100644 --- a/src/StructType/ManagePendingTransactionStatusRequestType.php +++ b/src/StructType/ManagePendingTransactionStatusRequestType.php @@ -13,16 +13,17 @@ class ManagePendingTransactionStatusRequestType extends AbstractRequestType { /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - documentation: TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 - * - documentation: TransactionId - Type for a PayPal Transaction ID. * @var string */ public $TransactionID; /** * The Action - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -58,7 +59,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -83,7 +84,7 @@ public function setAction($action = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\FMFPendingTransactionActionType::valueIsValid($action)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $action, implode(', ', \PayPal\EnumType\FMFPendingTransactionActionType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\FMFPendingTransactionActionType', is_array($action) ? implode(', ', $action) : var_export($action, true), implode(', ', \PayPal\EnumType\FMFPendingTransactionActionType::getValidValues())), __LINE__); } $this->Action = $action; return $this; diff --git a/src/StructType/ManagePendingTransactionStatusResponseType.php b/src/StructType/ManagePendingTransactionStatusResponseType.php index 88f2d49..dc490de 100644 --- a/src/StructType/ManagePendingTransactionStatusResponseType.php +++ b/src/StructType/ManagePendingTransactionStatusResponseType.php @@ -13,16 +13,17 @@ class ManagePendingTransactionStatusResponseType extends AbstractResponseType { /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - documentation: TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 - * - documentation: TransactionId - Type for a PayPal Transaction ID. * @var string */ public $TransactionID; /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -58,7 +59,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -80,7 +81,7 @@ public function setStatus($status = null) { // validation for constraint: string if (!is_null($status) && !is_string($status)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($status)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($status, true), gettype($status)), __LINE__); } $this->Status = $status; return $this; diff --git a/src/StructType/ManageRecurringPaymentsProfileStatusReq.php b/src/StructType/ManageRecurringPaymentsProfileStatusReq.php index 4dca976..0d6c7d4 100644 --- a/src/StructType/ManageRecurringPaymentsProfileStatusReq.php +++ b/src/StructType/ManageRecurringPaymentsProfileStatusReq.php @@ -13,7 +13,7 @@ class ManageRecurringPaymentsProfileStatusReq extends AbstractStructBase { /** * The ManageRecurringPaymentsProfileStatusRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:ManageRecurringPaymentsProfileStatusRequest * @var \PayPal\StructType\ManageRecurringPaymentsProfileStatusRequestType */ diff --git a/src/StructType/ManageRecurringPaymentsProfileStatusRequestDetailsType.php b/src/StructType/ManageRecurringPaymentsProfileStatusRequestDetailsType.php index b98fa53..caafe3a 100644 --- a/src/StructType/ManageRecurringPaymentsProfileStatusRequestDetailsType.php +++ b/src/StructType/ManageRecurringPaymentsProfileStatusRequestDetailsType.php @@ -14,7 +14,7 @@ class ManageRecurringPaymentsProfileStatusRequestDetailsType extends AbstractStr { /** * The ProfileID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -22,7 +22,7 @@ class ManageRecurringPaymentsProfileStatusRequestDetailsType extends AbstractStr public $ProfileID; /** * The Action - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -30,7 +30,7 @@ class ManageRecurringPaymentsProfileStatusRequestDetailsType extends AbstractStr public $Action; /** * The Note - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -69,7 +69,7 @@ public function setProfileID($profileID = null) { // validation for constraint: string if (!is_null($profileID) && !is_string($profileID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileID, true), gettype($profileID)), __LINE__); } $this->ProfileID = $profileID; return $this; @@ -94,7 +94,7 @@ public function setAction($action = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\StatusChangeActionType::valueIsValid($action)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $action, implode(', ', \PayPal\EnumType\StatusChangeActionType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\StatusChangeActionType', is_array($action) ? implode(', ', $action) : var_export($action, true), implode(', ', \PayPal\EnumType\StatusChangeActionType::getValidValues())), __LINE__); } $this->Action = $action; return $this; @@ -116,7 +116,7 @@ public function setNote($note = null) { // validation for constraint: string if (!is_null($note) && !is_string($note)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($note)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); } $this->Note = $note; return $this; diff --git a/src/StructType/ManageRecurringPaymentsProfileStatusRequestType.php b/src/StructType/ManageRecurringPaymentsProfileStatusRequestType.php index 62fd2e2..f03dc4b 100644 --- a/src/StructType/ManageRecurringPaymentsProfileStatusRequestType.php +++ b/src/StructType/ManageRecurringPaymentsProfileStatusRequestType.php @@ -13,7 +13,7 @@ class ManageRecurringPaymentsProfileStatusRequestType extends AbstractRequestTyp { /** * The ManageRecurringPaymentsProfileStatusRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:ManageRecurringPaymentsProfileStatusRequestDetails * @var \PayPal\StructType\ManageRecurringPaymentsProfileStatusRequestDetailsType */ diff --git a/src/StructType/ManageRecurringPaymentsProfileStatusResponseDetailsType.php b/src/StructType/ManageRecurringPaymentsProfileStatusResponseDetailsType.php index 45514b2..20d6215 100644 --- a/src/StructType/ManageRecurringPaymentsProfileStatusResponseDetailsType.php +++ b/src/StructType/ManageRecurringPaymentsProfileStatusResponseDetailsType.php @@ -14,7 +14,7 @@ class ManageRecurringPaymentsProfileStatusResponseDetailsType extends AbstractSt { /** * The ProfileID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -47,7 +47,7 @@ public function setProfileID($profileID = null) { // validation for constraint: string if (!is_null($profileID) && !is_string($profileID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileID, true), gettype($profileID)), __LINE__); } $this->ProfileID = $profileID; return $this; diff --git a/src/StructType/ManageRecurringPaymentsProfileStatusResponseType.php b/src/StructType/ManageRecurringPaymentsProfileStatusResponseType.php index 9e00e7e..a563df1 100644 --- a/src/StructType/ManageRecurringPaymentsProfileStatusResponseType.php +++ b/src/StructType/ManageRecurringPaymentsProfileStatusResponseType.php @@ -14,7 +14,7 @@ class ManageRecurringPaymentsProfileStatusResponseType extends AbstractResponseT { /** * The ManageRecurringPaymentsProfileStatusResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:ManageRecurringPaymentsProfileStatusResponseDetails * @var \PayPal\StructType\ManageRecurringPaymentsProfileStatusResponseDetailsType */ diff --git a/src/StructType/MassPayReq.php b/src/StructType/MassPayReq.php index e0e19a9..557595f 100644 --- a/src/StructType/MassPayReq.php +++ b/src/StructType/MassPayReq.php @@ -13,7 +13,7 @@ class MassPayReq extends AbstractStructBase { /** * The MassPayRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:MassPayRequest * @var \PayPal\StructType\MassPayRequestType */ diff --git a/src/StructType/MassPayRequestItemType.php b/src/StructType/MassPayRequestItemType.php index 3f65928..e77e4e2 100644 --- a/src/StructType/MassPayRequestItemType.php +++ b/src/StructType/MassPayRequestItemType.php @@ -6,7 +6,7 @@ /** * This class stands for MassPayRequestItemType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MassPayRequestItemType * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class MassPayRequestItemType extends AbstractStructBase { /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Payment amount. You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Required You cannot mix currencies in a single MassPayRequest. A single request must * include items that are of the same currency. * - maxOccurs: 1 @@ -25,9 +25,10 @@ class MassPayRequestItemType extends AbstractStructBase public $Amount; /** * The ReceiverEmail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Email address of recipient. Required You must specify ReceiverEmail, ReceiverPhone, or ReceiverID, but all MassPayItems in a request must use the same field to specify recipients. Character length and limitations: 127 single-byte * characters maximum. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -35,7 +36,7 @@ class MassPayRequestItemType extends AbstractStructBase public $ReceiverEmail; /** * The ReceiverPhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Phone number of recipient. Required You must specify ReceiverEmail, ReceiverPhone, or ReceiverID, but all MassPayItems in a request must use the same field to specify recipients. * - maxOccurs: 1 * - minOccurs: 0 @@ -44,18 +45,19 @@ class MassPayRequestItemType extends AbstractStructBase public $ReceiverPhone; /** * The ReceiverID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique PayPal customer account number. This value corresponds to the value of PayerID returned by GetTransactionDetails. Required You must specify ReceiverEmail, ReceiverPhone, or ReceiverID, but all MassPayItems in a request must * use the same field to specify recipients. Character length and limitations: 17 single-byte characters maximum. + * - base: xs:string + * - maxLength: 127 * - maxOccurs: 1 * - minOccurs: 0 - * - maxLength: 127 * @var string */ public $ReceiverID; /** * The UniqueId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Transaction-specific identification number for tracking in an accounting system. Optional Character length and limitations: 30 single-byte characters. No whitespace allowed. * - maxOccurs: 1 * - minOccurs: 0 @@ -64,7 +66,7 @@ class MassPayRequestItemType extends AbstractStructBase public $UniqueId; /** * The Note - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Custom note for each recipient. Optional Character length and limitations: 4,000 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -131,7 +133,7 @@ public function setReceiverEmail($receiverEmail = null) { // validation for constraint: string if (!is_null($receiverEmail) && !is_string($receiverEmail)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiverEmail)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiverEmail, true), gettype($receiverEmail)), __LINE__); } $this->ReceiverEmail = $receiverEmail; return $this; @@ -153,7 +155,7 @@ public function setReceiverPhone($receiverPhone = null) { // validation for constraint: string if (!is_null($receiverPhone) && !is_string($receiverPhone)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiverPhone)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiverPhone, true), gettype($receiverPhone)), __LINE__); } $this->ReceiverPhone = $receiverPhone; return $this; @@ -173,13 +175,13 @@ public function getReceiverID() */ public function setReceiverID($receiverID = null) { - // validation for constraint: maxLength - if ((is_scalar($receiverID) && strlen($receiverID) > 127) || (is_array($receiverID) && count($receiverID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($receiverID) ? strlen($receiverID) : count($receiverID)), __LINE__); - } // validation for constraint: string if (!is_null($receiverID) && !is_string($receiverID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiverID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiverID, true), gettype($receiverID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($receiverID) && mb_strlen($receiverID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($receiverID)), __LINE__); } $this->ReceiverID = $receiverID; return $this; @@ -201,7 +203,7 @@ public function setUniqueId($uniqueId = null) { // validation for constraint: string if (!is_null($uniqueId) && !is_string($uniqueId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($uniqueId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($uniqueId, true), gettype($uniqueId)), __LINE__); } $this->UniqueId = $uniqueId; return $this; @@ -223,7 +225,7 @@ public function setNote($note = null) { // validation for constraint: string if (!is_null($note) && !is_string($note)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($note)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); } $this->Note = $note; return $this; diff --git a/src/StructType/MassPayRequestType.php b/src/StructType/MassPayRequestType.php index 05762f9..86323e6 100644 --- a/src/StructType/MassPayRequestType.php +++ b/src/StructType/MassPayRequestType.php @@ -13,7 +13,7 @@ class MassPayRequestType extends AbstractRequestType { /** * The MassPayItem - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details of each payment. A single MassPayRequest can include up to 250 MassPayItems. Required * - maxOccurs: 250 * - minOccurs: 1 @@ -22,7 +22,7 @@ class MassPayRequestType extends AbstractRequestType public $MassPayItem; /** * The EmailSubject - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Subject line of the email sent to all recipients. This subject is not contained in the input file; you must create it with your application. Optional Character length and limitations: 255 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class MassPayRequestType extends AbstractRequestType public $EmailSubject; /** * The ReceiverType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates how you identify the recipients of payments in all MassPayItems: either by EmailAddress (ReceiverEmail in MassPayItem), PhoneNumber (ReceiverPhone in MassPayItem), or by UserID (ReceiverID in MassPayItem). Required. You * must specify one or the other of EmailAddress or UserID. * - maxOccurs: 1 @@ -41,7 +41,7 @@ class MassPayRequestType extends AbstractRequestType public $ReceiverType; /** * The ButtonSource - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Known as BN code, to track the partner referred merchant transactions. OptionalCharacter length and limitations: 32 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -75,6 +75,28 @@ public function getMassPayItem() { return $this->MassPayItem; } + /** + * This method is responsible for validating the values passed to the setMassPayItem method + * This method is willingly generated in order to preserve the one-line inline validation within the setMassPayItem method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateMassPayItemForArrayConstraintsFromSetMassPayItem(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $massPayRequestTypeMassPayItemItem) { + // validation for constraint: itemType + if (!$massPayRequestTypeMassPayItemItem instanceof \PayPal\StructType\MassPayRequestItemType) { + $invalidValues[] = is_object($massPayRequestTypeMassPayItemItem) ? get_class($massPayRequestTypeMassPayItemItem) : sprintf('%s(%s)', gettype($massPayRequestTypeMassPayItemItem), var_export($massPayRequestTypeMassPayItemItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The MassPayItem property can only contain items of type \PayPal\StructType\MassPayRequestItemType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set MassPayItem value * @throws \InvalidArgumentException @@ -83,11 +105,13 @@ public function getMassPayItem() */ public function setMassPayItem(array $massPayItem = array()) { - foreach ($massPayItem as $massPayRequestTypeMassPayItemItem) { - // validation for constraint: itemType - if (!$massPayRequestTypeMassPayItemItem instanceof \PayPal\StructType\MassPayRequestItemType) { - throw new \InvalidArgumentException(sprintf('The MassPayItem property can only contain items of \PayPal\StructType\MassPayRequestItemType, "%s" given', is_object($massPayRequestTypeMassPayItemItem) ? get_class($massPayRequestTypeMassPayItemItem) : gettype($massPayRequestTypeMassPayItemItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($massPayItemArrayErrorMessage = self::validateMassPayItemForArrayConstraintsFromSetMassPayItem($massPayItem))) { + throw new \InvalidArgumentException($massPayItemArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(250) + if (is_array($massPayItem) && count($massPayItem) > 250) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 250', count($massPayItem)), __LINE__); } $this->MassPayItem = $massPayItem; return $this; @@ -102,7 +126,11 @@ public function addToMassPayItem(\PayPal\StructType\MassPayRequestItemType $item { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\MassPayRequestItemType) { - throw new \InvalidArgumentException(sprintf('The MassPayItem property can only contain items of \PayPal\StructType\MassPayRequestItemType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The MassPayItem property can only contain items of type \PayPal\StructType\MassPayRequestItemType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(250) + if (is_array($this->MassPayItem) && count($this->MassPayItem) >= 250) { + 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 250', count($this->MassPayItem)), __LINE__); } $this->MassPayItem[] = $item; return $this; @@ -124,7 +152,7 @@ public function setEmailSubject($emailSubject = null) { // validation for constraint: string if (!is_null($emailSubject) && !is_string($emailSubject)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($emailSubject)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($emailSubject, true), gettype($emailSubject)), __LINE__); } $this->EmailSubject = $emailSubject; return $this; @@ -149,7 +177,7 @@ public function setReceiverType($receiverType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ReceiverInfoCodeType::valueIsValid($receiverType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $receiverType, implode(', ', \PayPal\EnumType\ReceiverInfoCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ReceiverInfoCodeType', is_array($receiverType) ? implode(', ', $receiverType) : var_export($receiverType, true), implode(', ', \PayPal\EnumType\ReceiverInfoCodeType::getValidValues())), __LINE__); } $this->ReceiverType = $receiverType; return $this; @@ -171,7 +199,7 @@ public function setButtonSource($buttonSource = null) { // validation for constraint: string if (!is_null($buttonSource) && !is_string($buttonSource)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonSource)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonSource, true), gettype($buttonSource)), __LINE__); } $this->ButtonSource = $buttonSource; return $this; diff --git a/src/StructType/MassPayResponseType.php b/src/StructType/MassPayResponseType.php index f4f9d7b..d2fcec6 100644 --- a/src/StructType/MassPayResponseType.php +++ b/src/StructType/MassPayResponseType.php @@ -11,12 +11,6 @@ */ class MassPayResponseType extends AbstractResponseType { - /** - * Constructor method for MassPayResponseType - */ - public function __construct() - { - } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/MeasureType.php b/src/StructType/MeasureType.php index 548ebdc..48bf4b4 100644 --- a/src/StructType/MeasureType.php +++ b/src/StructType/MeasureType.php @@ -13,7 +13,7 @@ class MeasureType extends AbstractStructBase { /** * The unit - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: required * @var string */ @@ -53,7 +53,7 @@ public function setUnit($unit = null) { // validation for constraint: string if (!is_null($unit) && !is_string($unit)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($unit)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($unit, true), gettype($unit)), __LINE__); } $this->unit = $unit; return $this; @@ -73,6 +73,10 @@ public function get_() */ public function set_($_ = null) { + // validation for constraint: float + if (!is_null($_) && !(is_float($_) || is_numeric($_))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($_, true), gettype($_)), __LINE__); + } $this->_ = $_; return $this; } diff --git a/src/StructType/MerchantDataType.php b/src/StructType/MerchantDataType.php index da98018..4139df5 100644 --- a/src/StructType/MerchantDataType.php +++ b/src/StructType/MerchantDataType.php @@ -6,7 +6,7 @@ /** * This class stands for MerchantDataType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This holds all key-value pairs which merchants wants to pass it to the open wallet(PLCC) processor. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class MerchantDataType extends AbstractStructBase { /** * The MerchantDataTuple - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 16 * - minOccurs: 0 * @var \PayPal\StructType\TupleType[] @@ -39,6 +39,28 @@ public function getMerchantDataTuple() { return $this->MerchantDataTuple; } + /** + * This method is responsible for validating the values passed to the setMerchantDataTuple method + * This method is willingly generated in order to preserve the one-line inline validation within the setMerchantDataTuple method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateMerchantDataTupleForArrayConstraintsFromSetMerchantDataTuple(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $merchantDataTypeMerchantDataTupleItem) { + // validation for constraint: itemType + if (!$merchantDataTypeMerchantDataTupleItem instanceof \PayPal\StructType\TupleType) { + $invalidValues[] = is_object($merchantDataTypeMerchantDataTupleItem) ? get_class($merchantDataTypeMerchantDataTupleItem) : sprintf('%s(%s)', gettype($merchantDataTypeMerchantDataTupleItem), var_export($merchantDataTypeMerchantDataTupleItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The MerchantDataTuple property can only contain items of type \PayPal\StructType\TupleType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set MerchantDataTuple value * @throws \InvalidArgumentException @@ -47,11 +69,13 @@ public function getMerchantDataTuple() */ public function setMerchantDataTuple(array $merchantDataTuple = array()) { - foreach ($merchantDataTuple as $merchantDataTypeMerchantDataTupleItem) { - // validation for constraint: itemType - if (!$merchantDataTypeMerchantDataTupleItem instanceof \PayPal\StructType\TupleType) { - throw new \InvalidArgumentException(sprintf('The MerchantDataTuple property can only contain items of \PayPal\StructType\TupleType, "%s" given', is_object($merchantDataTypeMerchantDataTupleItem) ? get_class($merchantDataTypeMerchantDataTupleItem) : gettype($merchantDataTypeMerchantDataTupleItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($merchantDataTupleArrayErrorMessage = self::validateMerchantDataTupleForArrayConstraintsFromSetMerchantDataTuple($merchantDataTuple))) { + throw new \InvalidArgumentException($merchantDataTupleArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(16) + if (is_array($merchantDataTuple) && count($merchantDataTuple) > 16) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 16', count($merchantDataTuple)), __LINE__); } $this->MerchantDataTuple = $merchantDataTuple; return $this; @@ -66,7 +90,11 @@ public function addToMerchantDataTuple(\PayPal\StructType\TupleType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\TupleType) { - throw new \InvalidArgumentException(sprintf('The MerchantDataTuple property can only contain items of \PayPal\StructType\TupleType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The MerchantDataTuple property can only contain items of type \PayPal\StructType\TupleType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(16) + if (is_array($this->MerchantDataTuple) && count($this->MerchantDataTuple) >= 16) { + 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 16', count($this->MerchantDataTuple)), __LINE__); } $this->MerchantDataTuple[] = $item; return $this; diff --git a/src/StructType/MerchantPullInfoType.php b/src/StructType/MerchantPullInfoType.php index f59c2dc..46625fc 100644 --- a/src/StructType/MerchantPullInfoType.php +++ b/src/StructType/MerchantPullInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for MerchantPullInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MerchantPullInfoType Information about the merchant pull. * @subpackage Structs * @author WsdlToPhp @@ -15,21 +15,21 @@ class MerchantPullInfoType extends AbstractStructBase { /** * The MpStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Current status of billing agreement * @var string */ public $MpStatus; /** * The MpMax - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Monthly maximum payment amount * @var \PayPal\StructType\BasicAmountType */ public $MpMax; /** * The MpCustom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value of the mp_custom variable that you specified in a FORM submission to PayPal during the creation or updating of a customer billing agreement * - minOccurs: 0 * @var string @@ -37,7 +37,7 @@ class MerchantPullInfoType extends AbstractStructBase public $MpCustom; /** * The Desc - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value of the mp_desc variable (description of goods or services) associated with the billing agreement * - minOccurs: 0 * @var string @@ -45,7 +45,7 @@ class MerchantPullInfoType extends AbstractStructBase public $Desc; /** * The Invoice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Invoice value as set by BillUserRequest API call * - minOccurs: 0 * @var string @@ -53,7 +53,7 @@ class MerchantPullInfoType extends AbstractStructBase public $Invoice; /** * The Custom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Custom field as set by BillUserRequest API call * - minOccurs: 0 * @var string @@ -61,7 +61,7 @@ class MerchantPullInfoType extends AbstractStructBase public $Custom; /** * The PaymentSourceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Note: This field is no longer used and is always empty. * - minOccurs: 0 * @var string @@ -115,7 +115,7 @@ public function setMpStatus($mpStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MerchantPullStatusCodeType::valueIsValid($mpStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $mpStatus, implode(', ', \PayPal\EnumType\MerchantPullStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MerchantPullStatusCodeType', is_array($mpStatus) ? implode(', ', $mpStatus) : var_export($mpStatus, true), implode(', ', \PayPal\EnumType\MerchantPullStatusCodeType::getValidValues())), __LINE__); } $this->MpStatus = $mpStatus; return $this; @@ -155,7 +155,7 @@ public function setMpCustom($mpCustom = null) { // validation for constraint: string if (!is_null($mpCustom) && !is_string($mpCustom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($mpCustom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mpCustom, true), gettype($mpCustom)), __LINE__); } $this->MpCustom = $mpCustom; return $this; @@ -177,7 +177,7 @@ public function setDesc($desc = null) { // validation for constraint: string if (!is_null($desc) && !is_string($desc)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($desc)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($desc, true), gettype($desc)), __LINE__); } $this->Desc = $desc; return $this; @@ -199,7 +199,7 @@ public function setInvoice($invoice = null) { // validation for constraint: string if (!is_null($invoice) && !is_string($invoice)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoice)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoice, true), gettype($invoice)), __LINE__); } $this->Invoice = $invoice; return $this; @@ -221,7 +221,7 @@ public function setCustom($custom = null) { // validation for constraint: string if (!is_null($custom) && !is_string($custom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($custom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); } $this->Custom = $custom; return $this; @@ -243,7 +243,7 @@ public function setPaymentSourceID($paymentSourceID = null) { // validation for constraint: string if (!is_null($paymentSourceID) && !is_string($paymentSourceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentSourceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paymentSourceID, true), gettype($paymentSourceID)), __LINE__); } $this->PaymentSourceID = $paymentSourceID; return $this; diff --git a/src/StructType/MerchantPullPaymentResponseType.php b/src/StructType/MerchantPullPaymentResponseType.php index 5f3b0a6..42b9bdd 100644 --- a/src/StructType/MerchantPullPaymentResponseType.php +++ b/src/StructType/MerchantPullPaymentResponseType.php @@ -6,7 +6,7 @@ /** * This class stands for MerchantPullPaymentResponseType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MerchantPullPaymentResponseType Response data from the merchant pull. * @subpackage Structs * @author WsdlToPhp @@ -15,21 +15,21 @@ class MerchantPullPaymentResponseType extends AbstractStructBase { /** * The PayerInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: information about the customer * @var \PayPal\StructType\PayerInfoType */ public $PayerInfo; /** * The PaymentInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the transaction * @var \PayPal\StructType\PaymentInfoType */ public $PaymentInfo; /** * The MerchantPullInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Specific information about the preapproved payment * @var \PayPal\StructType\MerchantPullInfoType */ diff --git a/src/StructType/MerchantPullPaymentType.php b/src/StructType/MerchantPullPaymentType.php index db3b273..153a91f 100644 --- a/src/StructType/MerchantPullPaymentType.php +++ b/src/StructType/MerchantPullPaymentType.php @@ -6,7 +6,7 @@ /** * This class stands for MerchantPullPaymentType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: MerchantPullPayment Parameters to make initiate a pull payment * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class MerchantPullPaymentType extends AbstractStructBase { /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The amount to charge to the customer. Required Only numeric characters and a decimal separator are allowed. Limit: 10 single-byte characters, including two for decimals You must set the currencyID attribute to one of the * three-character currency code for any of the supported PayPal currencies. * @var \PayPal\StructType\BasicAmountType @@ -23,15 +23,16 @@ class MerchantPullPaymentType extends AbstractStructBase public $Amount; /** * The MpID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Preapproved Payments billing agreement identification number between the PayPal customer and you. Required Character limit: 19 single-byte alphanumeric characters. The format of a billing agreement identification number is the * single-character prefix B, followed by a hyphen and an alphanumeric character string: B-unique_alphanumeric_string + * - base: xs:string * @var string */ public $MpID; /** * The PaymentType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Specifies type of PayPal payment you require Optional * - minOccurs: 0 * @var string @@ -39,7 +40,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $PaymentType; /** * The Memo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Text entered by the customer in the Note field during enrollment Optional * - minOccurs: 0 * @var string @@ -47,7 +48,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $Memo; /** * The EmailSubject - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Subject line of confirmation email sent to recipient Optional * - minOccurs: 0 * @var string @@ -55,7 +56,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $EmailSubject; /** * The Tax - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The tax charged on the transaction Optional * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -63,7 +64,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $Tax; /** * The Shipping - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Per-transaction shipping charge Optional * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -71,7 +72,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $Shipping; /** * The Handling - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Per-transaction handling charge Optional * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -79,7 +80,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $Handling; /** * The ItemName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Name of purchased item Optional * - minOccurs: 0 * @var string @@ -87,7 +88,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $ItemName; /** * The ItemNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Reference number of purchased item Optional * - minOccurs: 0 * @var string @@ -95,7 +96,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $ItemNumber; /** * The Invoice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Your invoice number Optional * - minOccurs: 0 * @var string @@ -103,7 +104,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $Invoice; /** * The Custom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Custom annotation field for tracking or other use Optional * - minOccurs: 0 * @var string @@ -111,7 +112,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $Custom; /** * The ButtonSource - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An identification code for use by third-party applications to identify transactions. Optional Character length and limitations: 32 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -119,7 +120,7 @@ class MerchantPullPaymentType extends AbstractStructBase public $ButtonSource; /** * The SoftDescriptor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Passed in soft descriptor string to be appended. Optional Character length and limitations: single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -209,7 +210,7 @@ public function setMpID($mpID = null) { // validation for constraint: string if (!is_null($mpID) && !is_string($mpID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($mpID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mpID, true), gettype($mpID)), __LINE__); } $this->MpID = $mpID; return $this; @@ -234,7 +235,7 @@ public function setPaymentType($paymentType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MerchantPullPaymentCodeType::valueIsValid($paymentType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentType, implode(', ', \PayPal\EnumType\MerchantPullPaymentCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MerchantPullPaymentCodeType', is_array($paymentType) ? implode(', ', $paymentType) : var_export($paymentType, true), implode(', ', \PayPal\EnumType\MerchantPullPaymentCodeType::getValidValues())), __LINE__); } $this->PaymentType = $paymentType; return $this; @@ -256,7 +257,7 @@ public function setMemo($memo = null) { // validation for constraint: string if (!is_null($memo) && !is_string($memo)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($memo)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($memo, true), gettype($memo)), __LINE__); } $this->Memo = $memo; return $this; @@ -278,7 +279,7 @@ public function setEmailSubject($emailSubject = null) { // validation for constraint: string if (!is_null($emailSubject) && !is_string($emailSubject)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($emailSubject)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($emailSubject, true), gettype($emailSubject)), __LINE__); } $this->EmailSubject = $emailSubject; return $this; @@ -354,7 +355,7 @@ public function setItemName($itemName = null) { // validation for constraint: string if (!is_null($itemName) && !is_string($itemName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemName, true), gettype($itemName)), __LINE__); } $this->ItemName = $itemName; return $this; @@ -376,7 +377,7 @@ public function setItemNumber($itemNumber = null) { // validation for constraint: string if (!is_null($itemNumber) && !is_string($itemNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemNumber, true), gettype($itemNumber)), __LINE__); } $this->ItemNumber = $itemNumber; return $this; @@ -398,7 +399,7 @@ public function setInvoice($invoice = null) { // validation for constraint: string if (!is_null($invoice) && !is_string($invoice)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoice)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoice, true), gettype($invoice)), __LINE__); } $this->Invoice = $invoice; return $this; @@ -420,7 +421,7 @@ public function setCustom($custom = null) { // validation for constraint: string if (!is_null($custom) && !is_string($custom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($custom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); } $this->Custom = $custom; return $this; @@ -442,7 +443,7 @@ public function setButtonSource($buttonSource = null) { // validation for constraint: string if (!is_null($buttonSource) && !is_string($buttonSource)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonSource)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonSource, true), gettype($buttonSource)), __LINE__); } $this->ButtonSource = $buttonSource; return $this; @@ -464,7 +465,7 @@ public function setSoftDescriptor($softDescriptor = null) { // validation for constraint: string if (!is_null($softDescriptor) && !is_string($softDescriptor)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptor)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptor, true), gettype($softDescriptor)), __LINE__); } $this->SoftDescriptor = $softDescriptor; return $this; diff --git a/src/StructType/MerchantStoreDetailsType.php b/src/StructType/MerchantStoreDetailsType.php index 6e9eb45..5a429a8 100644 --- a/src/StructType/MerchantStoreDetailsType.php +++ b/src/StructType/MerchantStoreDetailsType.php @@ -13,7 +13,7 @@ class MerchantStoreDetailsType extends AbstractStructBase { /** * The StoreID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Store IDOptional Character length and limits: 50 single-byte characters * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class MerchantStoreDetailsType extends AbstractStructBase public $StoreID; /** * The TerminalID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Terminal IDOptional Character length and limits: 50 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -59,7 +59,7 @@ public function setStoreID($storeID = null) { // validation for constraint: string if (!is_null($storeID) && !is_string($storeID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($storeID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($storeID, true), gettype($storeID)), __LINE__); } $this->StoreID = $storeID; return $this; @@ -81,7 +81,7 @@ public function setTerminalID($terminalID = null) { // validation for constraint: string if (!is_null($terminalID) && !is_string($terminalID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($terminalID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($terminalID, true), gettype($terminalID)), __LINE__); } $this->TerminalID = $terminalID; return $this; diff --git a/src/StructType/MobileIDInfoType.php b/src/StructType/MobileIDInfoType.php index 49cf111..b63c0cf 100644 --- a/src/StructType/MobileIDInfoType.php +++ b/src/StructType/MobileIDInfoType.php @@ -13,7 +13,7 @@ class MobileIDInfoType extends AbstractStructBase { /** * The SessionToken - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The Session token returned during buyer authentication. * @var string */ @@ -45,7 +45,7 @@ public function setSessionToken($sessionToken = null) { // validation for constraint: string if (!is_null($sessionToken) && !is_string($sessionToken)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sessionToken)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sessionToken, true), gettype($sessionToken)), __LINE__); } $this->SessionToken = $sessionToken; return $this; diff --git a/src/StructType/ModifiedFieldType.php b/src/StructType/ModifiedFieldType.php index f765da1..4e4642a 100644 --- a/src/StructType/ModifiedFieldType.php +++ b/src/StructType/ModifiedFieldType.php @@ -13,14 +13,14 @@ class ModifiedFieldType extends AbstractStructBase { /** * The Field - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $Field; /** * The ModifyType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -55,7 +55,7 @@ public function setField($field = null) { // validation for constraint: string if (!is_null($field) && !is_string($field)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($field)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($field, true), gettype($field)), __LINE__); } $this->Field = $field; return $this; @@ -80,7 +80,7 @@ public function setModifyType($modifyType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ModifyCodeType::valueIsValid($modifyType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $modifyType, implode(', ', \PayPal\EnumType\ModifyCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ModifyCodeType', is_array($modifyType) ? implode(', ', $modifyType) : var_export($modifyType, true), implode(', ', \PayPal\EnumType\ModifyCodeType::getValidValues())), __LINE__); } $this->ModifyType = $modifyType; return $this; diff --git a/src/StructType/OfferCouponInfoType.php b/src/StructType/OfferCouponInfoType.php index f3293fc..72d4b7d 100644 --- a/src/StructType/OfferCouponInfoType.php +++ b/src/StructType/OfferCouponInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for OfferCouponInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: OffersAndCouponsInfoType Information about a Offers and Coupons. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class OfferCouponInfoType extends AbstractStructBase { /** * The Type - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of the incentive * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class OfferCouponInfoType extends AbstractStructBase public $Type; /** * The ID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ID of the Incentive used in transaction * - minOccurs: 0 * @var string @@ -31,7 +31,7 @@ class OfferCouponInfoType extends AbstractStructBase public $ID; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount used on transaction * - minOccurs: 0 * @var string @@ -39,7 +39,7 @@ class OfferCouponInfoType extends AbstractStructBase public $Amount; /** * The AmountCurrency - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount Currency * - minOccurs: 0 * @var string @@ -81,7 +81,7 @@ public function setType($type = null) { // validation for constraint: string if (!is_null($type) && !is_string($type)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($type)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($type, true), gettype($type)), __LINE__); } $this->Type = $type; return $this; @@ -103,7 +103,7 @@ public function setID($iD = null) { // validation for constraint: string if (!is_null($iD) && !is_string($iD)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($iD)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($iD, true), gettype($iD)), __LINE__); } $this->ID = $iD; return $this; @@ -125,7 +125,7 @@ public function setAmount($amount = null) { // validation for constraint: string if (!is_null($amount) && !is_string($amount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($amount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($amount, true), gettype($amount)), __LINE__); } $this->Amount = $amount; return $this; @@ -147,7 +147,7 @@ public function setAmountCurrency($amountCurrency = null) { // validation for constraint: string if (!is_null($amountCurrency) && !is_string($amountCurrency)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($amountCurrency)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($amountCurrency, true), gettype($amountCurrency)), __LINE__); } $this->AmountCurrency = $amountCurrency; return $this; diff --git a/src/StructType/OfferDetailsType.php b/src/StructType/OfferDetailsType.php index b3bb6fc..6dade61 100644 --- a/src/StructType/OfferDetailsType.php +++ b/src/StructType/OfferDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for OfferDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: OfferDetailsType Specific information for an offer. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class OfferDetailsType extends AbstractStructBase { /** * The OfferCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Code used to identify the promotion offer. * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class OfferDetailsType extends AbstractStructBase public $OfferCode; /** * The BMLOfferInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Specific infromation for BML, Similar structure could be added for sepcific promotion needs like CrossPromotions * - minOccurs: 0 * @var \PayPal\StructType\BMLOfferInfoType @@ -59,7 +59,7 @@ public function setOfferCode($offerCode = null) { // validation for constraint: string if (!is_null($offerCode) && !is_string($offerCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($offerCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($offerCode, true), gettype($offerCode)), __LINE__); } $this->OfferCode = $offerCode; return $this; diff --git a/src/StructType/OptionDetailsType.php b/src/StructType/OptionDetailsType.php index bfc5a63..432652a 100644 --- a/src/StructType/OptionDetailsType.php +++ b/src/StructType/OptionDetailsType.php @@ -13,7 +13,7 @@ class OptionDetailsType extends AbstractStructBase { /** * The OptionName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Name. Optional * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class OptionDetailsType extends AbstractStructBase public $OptionName; /** * The OptionSelectionDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 100 * - minOccurs: 0 * @var \PayPal\StructType\OptionSelectionDetailsType[] @@ -58,7 +58,7 @@ public function setOptionName($optionName = null) { // validation for constraint: string if (!is_null($optionName) && !is_string($optionName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionName, true), gettype($optionName)), __LINE__); } $this->OptionName = $optionName; return $this; @@ -71,6 +71,28 @@ public function getOptionSelectionDetails() { return $this->OptionSelectionDetails; } + /** + * This method is responsible for validating the values passed to the setOptionSelectionDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setOptionSelectionDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateOptionSelectionDetailsForArrayConstraintsFromSetOptionSelectionDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $optionDetailsTypeOptionSelectionDetailsItem) { + // validation for constraint: itemType + if (!$optionDetailsTypeOptionSelectionDetailsItem instanceof \PayPal\StructType\OptionSelectionDetailsType) { + $invalidValues[] = is_object($optionDetailsTypeOptionSelectionDetailsItem) ? get_class($optionDetailsTypeOptionSelectionDetailsItem) : sprintf('%s(%s)', gettype($optionDetailsTypeOptionSelectionDetailsItem), var_export($optionDetailsTypeOptionSelectionDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The OptionSelectionDetails property can only contain items of type \PayPal\StructType\OptionSelectionDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set OptionSelectionDetails value * @throws \InvalidArgumentException @@ -79,11 +101,13 @@ public function getOptionSelectionDetails() */ public function setOptionSelectionDetails(array $optionSelectionDetails = array()) { - foreach ($optionSelectionDetails as $optionDetailsTypeOptionSelectionDetailsItem) { - // validation for constraint: itemType - if (!$optionDetailsTypeOptionSelectionDetailsItem instanceof \PayPal\StructType\OptionSelectionDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionSelectionDetails property can only contain items of \PayPal\StructType\OptionSelectionDetailsType, "%s" given', is_object($optionDetailsTypeOptionSelectionDetailsItem) ? get_class($optionDetailsTypeOptionSelectionDetailsItem) : gettype($optionDetailsTypeOptionSelectionDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($optionSelectionDetailsArrayErrorMessage = self::validateOptionSelectionDetailsForArrayConstraintsFromSetOptionSelectionDetails($optionSelectionDetails))) { + throw new \InvalidArgumentException($optionSelectionDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(100) + if (is_array($optionSelectionDetails) && count($optionSelectionDetails) > 100) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 100', count($optionSelectionDetails)), __LINE__); } $this->OptionSelectionDetails = $optionSelectionDetails; return $this; @@ -98,7 +122,11 @@ public function addToOptionSelectionDetails(\PayPal\StructType\OptionSelectionDe { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\OptionSelectionDetailsType) { - throw new \InvalidArgumentException(sprintf('The OptionSelectionDetails property can only contain items of \PayPal\StructType\OptionSelectionDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The OptionSelectionDetails property can only contain items of type \PayPal\StructType\OptionSelectionDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(100) + if (is_array($this->OptionSelectionDetails) && count($this->OptionSelectionDetails) >= 100) { + 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 100', count($this->OptionSelectionDetails)), __LINE__); } $this->OptionSelectionDetails[] = $item; return $this; diff --git a/src/StructType/OptionSelectionDetailsType.php b/src/StructType/OptionSelectionDetailsType.php index deb0ee5..c0f8f65 100644 --- a/src/StructType/OptionSelectionDetailsType.php +++ b/src/StructType/OptionSelectionDetailsType.php @@ -13,7 +13,7 @@ class OptionSelectionDetailsType extends AbstractStructBase { /** * The OptionSelection - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Selection. Required Character length and limitations: 12 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class OptionSelectionDetailsType extends AbstractStructBase public $OptionSelection; /** * The Price - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Price. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class OptionSelectionDetailsType extends AbstractStructBase public $Price; /** * The OptionType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Type Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -40,7 +40,7 @@ class OptionSelectionDetailsType extends AbstractStructBase public $OptionType; /** * The PaymentPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 10 * - minOccurs: 0 * @var \PayPal\StructType\InstallmentDetailsType[] @@ -82,7 +82,7 @@ public function setOptionSelection($optionSelection = null) { // validation for constraint: string if (!is_null($optionSelection) && !is_string($optionSelection)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionSelection)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionSelection, true), gettype($optionSelection)), __LINE__); } $this->OptionSelection = $optionSelection; return $this; @@ -104,7 +104,7 @@ public function setPrice($price = null) { // validation for constraint: string if (!is_null($price) && !is_string($price)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($price)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($price, true), gettype($price)), __LINE__); } $this->Price = $price; return $this; @@ -129,7 +129,7 @@ public function setOptionType($optionType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\OptionTypeListType::valueIsValid($optionType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $optionType, implode(', ', \PayPal\EnumType\OptionTypeListType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\OptionTypeListType', is_array($optionType) ? implode(', ', $optionType) : var_export($optionType, true), implode(', ', \PayPal\EnumType\OptionTypeListType::getValidValues())), __LINE__); } $this->OptionType = $optionType; return $this; @@ -142,6 +142,28 @@ public function getPaymentPeriod() { return $this->PaymentPeriod; } + /** + * This method is responsible for validating the values passed to the setPaymentPeriod method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentPeriod method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentPeriodForArrayConstraintsFromSetPaymentPeriod(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $optionSelectionDetailsTypePaymentPeriodItem) { + // validation for constraint: itemType + if (!$optionSelectionDetailsTypePaymentPeriodItem instanceof \PayPal\StructType\InstallmentDetailsType) { + $invalidValues[] = is_object($optionSelectionDetailsTypePaymentPeriodItem) ? get_class($optionSelectionDetailsTypePaymentPeriodItem) : sprintf('%s(%s)', gettype($optionSelectionDetailsTypePaymentPeriodItem), var_export($optionSelectionDetailsTypePaymentPeriodItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The PaymentPeriod property can only contain items of type \PayPal\StructType\InstallmentDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentPeriod value * @throws \InvalidArgumentException @@ -150,11 +172,13 @@ public function getPaymentPeriod() */ public function setPaymentPeriod(array $paymentPeriod = array()) { - foreach ($paymentPeriod as $optionSelectionDetailsTypePaymentPeriodItem) { - // validation for constraint: itemType - if (!$optionSelectionDetailsTypePaymentPeriodItem instanceof \PayPal\StructType\InstallmentDetailsType) { - throw new \InvalidArgumentException(sprintf('The PaymentPeriod property can only contain items of \PayPal\StructType\InstallmentDetailsType, "%s" given', is_object($optionSelectionDetailsTypePaymentPeriodItem) ? get_class($optionSelectionDetailsTypePaymentPeriodItem) : gettype($optionSelectionDetailsTypePaymentPeriodItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentPeriodArrayErrorMessage = self::validatePaymentPeriodForArrayConstraintsFromSetPaymentPeriod($paymentPeriod))) { + throw new \InvalidArgumentException($paymentPeriodArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($paymentPeriod) && count($paymentPeriod) > 10) { + 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($paymentPeriod)), __LINE__); } $this->PaymentPeriod = $paymentPeriod; return $this; @@ -169,7 +193,11 @@ public function addToPaymentPeriod(\PayPal\StructType\InstallmentDetailsType $it { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\InstallmentDetailsType) { - throw new \InvalidArgumentException(sprintf('The PaymentPeriod property can only contain items of \PayPal\StructType\InstallmentDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The PaymentPeriod property can only contain items of type \PayPal\StructType\InstallmentDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->PaymentPeriod) && count($this->PaymentPeriod) >= 10) { + 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->PaymentPeriod)), __LINE__); } $this->PaymentPeriod[] = $item; return $this; diff --git a/src/StructType/OptionTrackingDetailsType.php b/src/StructType/OptionTrackingDetailsType.php index 0e37bb5..5b8f2be 100644 --- a/src/StructType/OptionTrackingDetailsType.php +++ b/src/StructType/OptionTrackingDetailsType.php @@ -13,7 +13,7 @@ class OptionTrackingDetailsType extends AbstractStructBase { /** * The OptionNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Number. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class OptionTrackingDetailsType extends AbstractStructBase public $OptionNumber; /** * The OptionQty - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Quantity. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class OptionTrackingDetailsType extends AbstractStructBase public $OptionQty; /** * The OptionSelect - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Select Name. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -40,7 +40,7 @@ class OptionTrackingDetailsType extends AbstractStructBase public $OptionSelect; /** * The OptionQtyDelta - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Quantity Delta. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -49,7 +49,7 @@ class OptionTrackingDetailsType extends AbstractStructBase public $OptionQtyDelta; /** * The OptionAlert - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Alert. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -58,7 +58,7 @@ class OptionTrackingDetailsType extends AbstractStructBase public $OptionAlert; /** * The OptionCost - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Option Cost. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -107,7 +107,7 @@ public function setOptionNumber($optionNumber = null) { // validation for constraint: string if (!is_null($optionNumber) && !is_string($optionNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionNumber, true), gettype($optionNumber)), __LINE__); } $this->OptionNumber = $optionNumber; return $this; @@ -129,7 +129,7 @@ public function setOptionQty($optionQty = null) { // validation for constraint: string if (!is_null($optionQty) && !is_string($optionQty)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionQty)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionQty, true), gettype($optionQty)), __LINE__); } $this->OptionQty = $optionQty; return $this; @@ -151,7 +151,7 @@ public function setOptionSelect($optionSelect = null) { // validation for constraint: string if (!is_null($optionSelect) && !is_string($optionSelect)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionSelect)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionSelect, true), gettype($optionSelect)), __LINE__); } $this->OptionSelect = $optionSelect; return $this; @@ -173,7 +173,7 @@ public function setOptionQtyDelta($optionQtyDelta = null) { // validation for constraint: string if (!is_null($optionQtyDelta) && !is_string($optionQtyDelta)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionQtyDelta)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionQtyDelta, true), gettype($optionQtyDelta)), __LINE__); } $this->OptionQtyDelta = $optionQtyDelta; return $this; @@ -195,7 +195,7 @@ public function setOptionAlert($optionAlert = null) { // validation for constraint: string if (!is_null($optionAlert) && !is_string($optionAlert)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionAlert)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionAlert, true), gettype($optionAlert)), __LINE__); } $this->OptionAlert = $optionAlert; return $this; @@ -217,7 +217,7 @@ public function setOptionCost($optionCost = null) { // validation for constraint: string if (!is_null($optionCost) && !is_string($optionCost)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($optionCost)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionCost, true), gettype($optionCost)), __LINE__); } $this->OptionCost = $optionCost; return $this; diff --git a/src/StructType/OptionType.php b/src/StructType/OptionType.php index 332e02c..3d4b24e 100644 --- a/src/StructType/OptionType.php +++ b/src/StructType/OptionType.php @@ -6,7 +6,7 @@ /** * This class stands for OptionType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: OptionType PayPal item options for shopping cart. * @subpackage Structs * @author WsdlToPhp @@ -15,14 +15,14 @@ class OptionType extends AbstractStructBase { /** * The name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: required * @var string */ public $name; /** * The value - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: required * @var string */ @@ -57,7 +57,7 @@ public function setName($name = null) { // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); } $this->name = $name; return $this; @@ -79,7 +79,7 @@ public function setValue($value = null) { // validation for constraint: string if (!is_null($value) && !is_string($value)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($value)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($value, true), gettype($value)), __LINE__); } $this->value = $value; return $this; diff --git a/src/StructType/OrderDetailsType.php b/src/StructType/OrderDetailsType.php index 5f5d6cd..1bdaa39 100644 --- a/src/StructType/OrderDetailsType.php +++ b/src/StructType/OrderDetailsType.php @@ -13,7 +13,7 @@ class OrderDetailsType extends AbstractStructBase { /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Description of the Order. * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class OrderDetailsType extends AbstractStructBase public $Description; /** * The MaxAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Expected maximum amount that the merchant may pull using DoReferenceTransaction * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -57,7 +57,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this; diff --git a/src/StructType/OtherPaymentMethodDetailsType.php b/src/StructType/OtherPaymentMethodDetailsType.php index 45d495e..6f45854 100644 --- a/src/StructType/OtherPaymentMethodDetailsType.php +++ b/src/StructType/OtherPaymentMethodDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for OtherPaymentMethodDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Lists the Payment Methods (other than PayPal) that the use can pay with e.g. Money Order. Optional. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class OtherPaymentMethodDetailsType extends AbstractStructBase { /** * The OtherPaymentMethodId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The identifier of the Payment Method. * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class OtherPaymentMethodDetailsType extends AbstractStructBase public $OtherPaymentMethodId; /** * The OtherPaymentMethodType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Valid values are 'Method', 'SubMethod'. * - maxOccurs: 1 * - minOccurs: 0 @@ -33,7 +33,7 @@ class OtherPaymentMethodDetailsType extends AbstractStructBase public $OtherPaymentMethodType; /** * The OtherPaymentMethodLabel - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The name of the Payment Method. * - maxOccurs: 1 * - minOccurs: 0 @@ -42,7 +42,7 @@ class OtherPaymentMethodDetailsType extends AbstractStructBase public $OtherPaymentMethodLabel; /** * The OtherPaymentMethodLabelDescription - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The short description of the Payment Method, goes along with the label. * - maxOccurs: 1 * - minOccurs: 0 @@ -51,7 +51,7 @@ class OtherPaymentMethodDetailsType extends AbstractStructBase public $OtherPaymentMethodLabelDescription; /** * The OtherPaymentMethodLongDescriptionTitle - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The title for the long description. * - maxOccurs: 1 * - minOccurs: 0 @@ -60,7 +60,7 @@ class OtherPaymentMethodDetailsType extends AbstractStructBase public $OtherPaymentMethodLongDescriptionTitle; /** * The OtherPaymentMethodLongDescription - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The long description of the Payment Method. * - maxOccurs: 1 * - minOccurs: 0 @@ -69,7 +69,7 @@ class OtherPaymentMethodDetailsType extends AbstractStructBase public $OtherPaymentMethodLongDescription; /** * The OtherPaymentMethodIcon - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The icon of the Payment Method. * - maxOccurs: 1 * - minOccurs: 0 @@ -78,7 +78,7 @@ class OtherPaymentMethodDetailsType extends AbstractStructBase public $OtherPaymentMethodIcon; /** * The OtherPaymentMethodHideLabel - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If this flag is true, then OtherPaymentMethodIcon is required to have a valid value; the label will be hidden and only ICON will be shown. * - maxOccurs: 1 * - minOccurs: 0 @@ -133,7 +133,7 @@ public function setOtherPaymentMethodId($otherPaymentMethodId = null) { // validation for constraint: string if (!is_null($otherPaymentMethodId) && !is_string($otherPaymentMethodId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($otherPaymentMethodId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($otherPaymentMethodId, true), gettype($otherPaymentMethodId)), __LINE__); } $this->OtherPaymentMethodId = $otherPaymentMethodId; return $this; @@ -155,7 +155,7 @@ public function setOtherPaymentMethodType($otherPaymentMethodType = null) { // validation for constraint: string if (!is_null($otherPaymentMethodType) && !is_string($otherPaymentMethodType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($otherPaymentMethodType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($otherPaymentMethodType, true), gettype($otherPaymentMethodType)), __LINE__); } $this->OtherPaymentMethodType = $otherPaymentMethodType; return $this; @@ -177,7 +177,7 @@ public function setOtherPaymentMethodLabel($otherPaymentMethodLabel = null) { // validation for constraint: string if (!is_null($otherPaymentMethodLabel) && !is_string($otherPaymentMethodLabel)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($otherPaymentMethodLabel)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($otherPaymentMethodLabel, true), gettype($otherPaymentMethodLabel)), __LINE__); } $this->OtherPaymentMethodLabel = $otherPaymentMethodLabel; return $this; @@ -199,7 +199,7 @@ public function setOtherPaymentMethodLabelDescription($otherPaymentMethodLabelDe { // validation for constraint: string if (!is_null($otherPaymentMethodLabelDescription) && !is_string($otherPaymentMethodLabelDescription)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($otherPaymentMethodLabelDescription)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($otherPaymentMethodLabelDescription, true), gettype($otherPaymentMethodLabelDescription)), __LINE__); } $this->OtherPaymentMethodLabelDescription = $otherPaymentMethodLabelDescription; return $this; @@ -221,7 +221,7 @@ public function setOtherPaymentMethodLongDescriptionTitle($otherPaymentMethodLon { // validation for constraint: string if (!is_null($otherPaymentMethodLongDescriptionTitle) && !is_string($otherPaymentMethodLongDescriptionTitle)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($otherPaymentMethodLongDescriptionTitle)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($otherPaymentMethodLongDescriptionTitle, true), gettype($otherPaymentMethodLongDescriptionTitle)), __LINE__); } $this->OtherPaymentMethodLongDescriptionTitle = $otherPaymentMethodLongDescriptionTitle; return $this; @@ -243,7 +243,7 @@ public function setOtherPaymentMethodLongDescription($otherPaymentMethodLongDesc { // validation for constraint: string if (!is_null($otherPaymentMethodLongDescription) && !is_string($otherPaymentMethodLongDescription)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($otherPaymentMethodLongDescription)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($otherPaymentMethodLongDescription, true), gettype($otherPaymentMethodLongDescription)), __LINE__); } $this->OtherPaymentMethodLongDescription = $otherPaymentMethodLongDescription; return $this; @@ -265,7 +265,7 @@ public function setOtherPaymentMethodIcon($otherPaymentMethodIcon = null) { // validation for constraint: string if (!is_null($otherPaymentMethodIcon) && !is_string($otherPaymentMethodIcon)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($otherPaymentMethodIcon)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($otherPaymentMethodIcon, true), gettype($otherPaymentMethodIcon)), __LINE__); } $this->OtherPaymentMethodIcon = $otherPaymentMethodIcon; return $this; @@ -287,7 +287,7 @@ public function setOtherPaymentMethodHideLabel($otherPaymentMethodHideLabel = nu { // validation for constraint: boolean if (!is_null($otherPaymentMethodHideLabel) && !is_bool($otherPaymentMethodHideLabel)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($otherPaymentMethodHideLabel)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($otherPaymentMethodHideLabel, true), gettype($otherPaymentMethodHideLabel)), __LINE__); } $this->OtherPaymentMethodHideLabel = $otherPaymentMethodHideLabel; return $this; diff --git a/src/StructType/PaginationResultType.php b/src/StructType/PaginationResultType.php index 434d4f4..4f42af7 100644 --- a/src/StructType/PaginationResultType.php +++ b/src/StructType/PaginationResultType.php @@ -13,14 +13,14 @@ class PaginationResultType extends AbstractStructBase { /** * The TotalNumberOfPages - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ public $TotalNumberOfPages; /** * The TotalNumberOfEntries - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ @@ -54,8 +54,8 @@ public function getTotalNumberOfPages() public function setTotalNumberOfPages($totalNumberOfPages = null) { // validation for constraint: int - if (!is_null($totalNumberOfPages) && !is_numeric($totalNumberOfPages)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($totalNumberOfPages)), __LINE__); + if (!is_null($totalNumberOfPages) && !(is_int($totalNumberOfPages) || ctype_digit($totalNumberOfPages))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($totalNumberOfPages, true), gettype($totalNumberOfPages)), __LINE__); } $this->TotalNumberOfPages = $totalNumberOfPages; return $this; @@ -76,8 +76,8 @@ public function getTotalNumberOfEntries() public function setTotalNumberOfEntries($totalNumberOfEntries = null) { // validation for constraint: int - if (!is_null($totalNumberOfEntries) && !is_numeric($totalNumberOfEntries)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($totalNumberOfEntries)), __LINE__); + if (!is_null($totalNumberOfEntries) && !(is_int($totalNumberOfEntries) || ctype_digit($totalNumberOfEntries))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($totalNumberOfEntries, true), gettype($totalNumberOfEntries)), __LINE__); } $this->TotalNumberOfEntries = $totalNumberOfEntries; return $this; diff --git a/src/StructType/PaginationType.php b/src/StructType/PaginationType.php index 122b0f3..c0a7c11 100644 --- a/src/StructType/PaginationType.php +++ b/src/StructType/PaginationType.php @@ -13,14 +13,14 @@ class PaginationType extends AbstractStructBase { /** * The EntriesPerPage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ public $EntriesPerPage; /** * The PageNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ @@ -54,8 +54,8 @@ public function getEntriesPerPage() public function setEntriesPerPage($entriesPerPage = null) { // validation for constraint: int - if (!is_null($entriesPerPage) && !is_numeric($entriesPerPage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($entriesPerPage)), __LINE__); + if (!is_null($entriesPerPage) && !(is_int($entriesPerPage) || ctype_digit($entriesPerPage))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($entriesPerPage, true), gettype($entriesPerPage)), __LINE__); } $this->EntriesPerPage = $entriesPerPage; return $this; @@ -76,8 +76,8 @@ public function getPageNumber() public function setPageNumber($pageNumber = null) { // validation for constraint: int - if (!is_null($pageNumber) && !is_numeric($pageNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($pageNumber)), __LINE__); + if (!is_null($pageNumber) && !(is_int($pageNumber) || ctype_digit($pageNumber))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($pageNumber, true), gettype($pageNumber)), __LINE__); } $this->PageNumber = $pageNumber; return $this; diff --git a/src/StructType/PayeeInfoType.php b/src/StructType/PayeeInfoType.php index edab7cc..20b86b6 100644 --- a/src/StructType/PayeeInfoType.php +++ b/src/StructType/PayeeInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for PayeeInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PayeeInfoType Payee Information * @subpackage Structs * @author WsdlToPhp @@ -15,18 +15,20 @@ class PayeeInfoType extends AbstractStructBase { /** * The PayeeEmail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Email address of payee/agreement owner Character length and limitations: 127 single-byte characters + * - base: xs:string * - minOccurs: 0 * @var string */ public $PayeeEmail; /** * The PayeeID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique Merchant ID Character length and limitations: 17 single-byte characters - * - minOccurs: 0 + * - base: xs:string * - maxLength: 127 + * - minOccurs: 0 * @var string */ public $PayeeID; @@ -60,7 +62,7 @@ public function setPayeeEmail($payeeEmail = null) { // validation for constraint: string if (!is_null($payeeEmail) && !is_string($payeeEmail)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payeeEmail)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payeeEmail, true), gettype($payeeEmail)), __LINE__); } $this->PayeeEmail = $payeeEmail; return $this; @@ -80,13 +82,13 @@ public function getPayeeID() */ public function setPayeeID($payeeID = null) { - // validation for constraint: maxLength - if ((is_scalar($payeeID) && strlen($payeeID) > 127) || (is_array($payeeID) && count($payeeID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($payeeID) ? strlen($payeeID) : count($payeeID)), __LINE__); - } // validation for constraint: string if (!is_null($payeeID) && !is_string($payeeID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payeeID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payeeID, true), gettype($payeeID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($payeeID) && mb_strlen($payeeID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($payeeID)), __LINE__); } $this->PayeeID = $payeeID; return $this; diff --git a/src/StructType/PayerInfoType.php b/src/StructType/PayerInfoType.php index 0c3b29d..aa9df5e 100644 --- a/src/StructType/PayerInfoType.php +++ b/src/StructType/PayerInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for PayerInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PayerInfoType Payer information * @subpackage Structs * @author WsdlToPhp @@ -15,24 +15,26 @@ class PayerInfoType extends AbstractStructBase { /** * The Payer - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Email address of payer Character length and limitations: 127 single-byte characters + * - base: xs:string * - minOccurs: 0 * @var string */ public $Payer; /** * The PayerID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique customer ID Character length and limitations: 17 single-byte characters - * - minOccurs: 0 + * - base: xs:string * - maxLength: 127 + * - minOccurs: 0 * @var string */ public $PayerID; /** * The PayerStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Status of payer's email address * - minOccurs: 0 * @var string @@ -40,14 +42,14 @@ class PayerInfoType extends AbstractStructBase public $PayerStatus; /** * The PayerName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Name of payer * @var \PayPal\StructType\PersonNameType */ public $PayerName; /** * The PayerCountry - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Payment sender's country of residence using standard two-character ISO 3166 country codes. Character length and limitations: Two single-byte characters * - minOccurs: 0 * @var string @@ -55,7 +57,7 @@ class PayerInfoType extends AbstractStructBase public $PayerCountry; /** * The PayerBusiness - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Payer's business name. Character length and limitations: 127 single-byte characters * - minOccurs: 0 * @var string @@ -63,7 +65,7 @@ class PayerInfoType extends AbstractStructBase public $PayerBusiness; /** * The Address - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Payer's business address * - minOccurs: 0 * @var \PayPal\StructType\AddressType @@ -71,7 +73,7 @@ class PayerInfoType extends AbstractStructBase public $Address; /** * The ContactPhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Business contact telephone number * - minOccurs: 0 * @var string @@ -79,7 +81,7 @@ class PayerInfoType extends AbstractStructBase public $ContactPhone; /** * The WalletItems - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Items such as merchant coupons, loyalty cards, and manufacturer coupons in the PayPal wallet. * - maxOccurs: unbounded * - minOccurs: 0 @@ -88,7 +90,7 @@ class PayerInfoType extends AbstractStructBase public $WalletItems; /** * The TaxIdDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about payer's tax info. Refer to the TaxIdDetailsType for more details. * - maxOccurs: 1 * - minOccurs: 0 @@ -97,7 +99,7 @@ class PayerInfoType extends AbstractStructBase public $TaxIdDetails; /** * The EnhancedPayerInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Holds any enhanced information about the payer * - maxOccurs: 1 * - minOccurs: 0 @@ -161,7 +163,7 @@ public function setPayer($payer = null) { // validation for constraint: string if (!is_null($payer) && !is_string($payer)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payer)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payer, true), gettype($payer)), __LINE__); } $this->Payer = $payer; return $this; @@ -181,13 +183,13 @@ public function getPayerID() */ public function setPayerID($payerID = null) { - // validation for constraint: maxLength - if ((is_scalar($payerID) && strlen($payerID) > 127) || (is_array($payerID) && count($payerID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($payerID) ? strlen($payerID) : count($payerID)), __LINE__); - } // validation for constraint: string if (!is_null($payerID) && !is_string($payerID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payerID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payerID, true), gettype($payerID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($payerID) && mb_strlen($payerID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($payerID)), __LINE__); } $this->PayerID = $payerID; return $this; @@ -212,7 +214,7 @@ public function setPayerStatus($payerStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PayPalUserStatusCodeType::valueIsValid($payerStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $payerStatus, implode(', ', \PayPal\EnumType\PayPalUserStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PayPalUserStatusCodeType', is_array($payerStatus) ? implode(', ', $payerStatus) : var_export($payerStatus, true), implode(', ', \PayPal\EnumType\PayPalUserStatusCodeType::getValidValues())), __LINE__); } $this->PayerStatus = $payerStatus; return $this; @@ -255,7 +257,7 @@ public function setPayerCountry($payerCountry = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CountryCodeType::valueIsValid($payerCountry)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $payerCountry, implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CountryCodeType', is_array($payerCountry) ? implode(', ', $payerCountry) : var_export($payerCountry, true), implode(', ', \PayPal\EnumType\CountryCodeType::getValidValues())), __LINE__); } $this->PayerCountry = $payerCountry; return $this; @@ -277,7 +279,7 @@ public function setPayerBusiness($payerBusiness = null) { // validation for constraint: string if (!is_null($payerBusiness) && !is_string($payerBusiness)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payerBusiness)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payerBusiness, true), gettype($payerBusiness)), __LINE__); } $this->PayerBusiness = $payerBusiness; return $this; @@ -317,7 +319,7 @@ public function setContactPhone($contactPhone = null) { // validation for constraint: string if (!is_null($contactPhone) && !is_string($contactPhone)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($contactPhone)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($contactPhone, true), gettype($contactPhone)), __LINE__); } $this->ContactPhone = $contactPhone; return $this; @@ -330,6 +332,28 @@ public function getWalletItems() { return $this->WalletItems; } + /** + * This method is responsible for validating the values passed to the setWalletItems method + * This method is willingly generated in order to preserve the one-line inline validation within the setWalletItems method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateWalletItemsForArrayConstraintsFromSetWalletItems(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $payerInfoTypeWalletItemsItem) { + // validation for constraint: itemType + if (!$payerInfoTypeWalletItemsItem instanceof \PayPal\StructType\WalletItemsType) { + $invalidValues[] = is_object($payerInfoTypeWalletItemsItem) ? get_class($payerInfoTypeWalletItemsItem) : sprintf('%s(%s)', gettype($payerInfoTypeWalletItemsItem), var_export($payerInfoTypeWalletItemsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The WalletItems property can only contain items of type \PayPal\StructType\WalletItemsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set WalletItems value * @throws \InvalidArgumentException @@ -338,11 +362,9 @@ public function getWalletItems() */ public function setWalletItems(array $walletItems = array()) { - foreach ($walletItems as $payerInfoTypeWalletItemsItem) { - // validation for constraint: itemType - if (!$payerInfoTypeWalletItemsItem instanceof \PayPal\StructType\WalletItemsType) { - throw new \InvalidArgumentException(sprintf('The WalletItems property can only contain items of \PayPal\StructType\WalletItemsType, "%s" given', is_object($payerInfoTypeWalletItemsItem) ? get_class($payerInfoTypeWalletItemsItem) : gettype($payerInfoTypeWalletItemsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($walletItemsArrayErrorMessage = self::validateWalletItemsForArrayConstraintsFromSetWalletItems($walletItems))) { + throw new \InvalidArgumentException($walletItemsArrayErrorMessage, __LINE__); } $this->WalletItems = $walletItems; return $this; @@ -357,7 +379,7 @@ public function addToWalletItems(\PayPal\StructType\WalletItemsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\WalletItemsType) { - throw new \InvalidArgumentException(sprintf('The WalletItems property can only contain items of \PayPal\StructType\WalletItemsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The WalletItems property can only contain items of type \PayPal\StructType\WalletItemsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->WalletItems[] = $item; return $this; diff --git a/src/StructType/PaymentDetailsItemType.php b/src/StructType/PaymentDetailsItemType.php index edec28d..58f1102 100644 --- a/src/StructType/PaymentDetailsItemType.php +++ b/src/StructType/PaymentDetailsItemType.php @@ -6,7 +6,7 @@ /** * This class stands for PaymentDetailsItemType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentDetailsItemType Information about a Payment Item. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class PaymentDetailsItemType extends AbstractStructBase { /** * The Name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item name. Optional Character length and limitations: 127 single-byte characters * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $Name; /** * The Number - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item number. Optional Character length and limitations: 127 single-byte characters * - minOccurs: 0 * @var string @@ -31,7 +31,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $Number; /** * The Quantity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item quantity. Optional Character length and limitations: Any positive integer * - minOccurs: 0 * @var int @@ -39,7 +39,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $Quantity; /** * The Tax - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item sales tax. Optional Character length and limitations: any valid currency amount; currency code is set the same as for OrderTotal. * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -47,7 +47,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $Tax; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Cost of item You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. * Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - minOccurs: 0 @@ -56,7 +56,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $Amount; /** * The EbayItemPaymentDetailsItem - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Ebay specific details. Optional * - minOccurs: 0 * @var \PayPal\StructType\EbayItemPaymentDetailsItemType @@ -64,7 +64,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $EbayItemPaymentDetailsItem; /** * The PromoCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Promotional financing code for item. Part of the Merchant Services Promotion Financing feature. * - maxOccurs: 1 * - minOccurs: 0 @@ -73,7 +73,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $PromoCode; /** * The ProductCategory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -81,7 +81,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $ProductCategory; /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item description. Optional Character length and limitations: 127 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -90,7 +90,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $Description; /** * The ItemWeight - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Item weight. * - maxOccurs: 1 * - minOccurs: 0 @@ -99,7 +99,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $ItemWeight; /** * The ItemLength - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Item length. * - maxOccurs: 1 * - minOccurs: 0 @@ -108,7 +108,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $ItemLength; /** * The ItemWidth - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Item width. * - maxOccurs: 1 * - minOccurs: 0 @@ -117,7 +117,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $ItemWidth; /** * The ItemHeight - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Item height. * - maxOccurs: 1 * - minOccurs: 0 @@ -126,7 +126,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $ItemHeight; /** * The ItemURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL for the item. Optional Character length and limitations: no limit. * - maxOccurs: 1 * - minOccurs: 0 @@ -135,7 +135,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $ItemURL; /** * The EnhancedItemData - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Enhanced data for each item in the cart. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -144,7 +144,7 @@ class PaymentDetailsItemType extends AbstractStructBase public $EnhancedItemData; /** * The ItemCategory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item category - physical or digital. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -223,7 +223,7 @@ public function setName($name = null) { // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); } $this->Name = $name; return $this; @@ -245,7 +245,7 @@ public function setNumber($number = null) { // validation for constraint: string if (!is_null($number) && !is_string($number)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($number)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($number, true), gettype($number)), __LINE__); } $this->Number = $number; return $this; @@ -266,8 +266,8 @@ public function getQuantity() public function setQuantity($quantity = null) { // validation for constraint: int - if (!is_null($quantity) && !is_numeric($quantity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($quantity)), __LINE__); + if (!is_null($quantity) && !(is_int($quantity) || ctype_digit($quantity))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($quantity, true), gettype($quantity)), __LINE__); } $this->Quantity = $quantity; return $this; @@ -343,7 +343,7 @@ public function setPromoCode($promoCode = null) { // validation for constraint: string if (!is_null($promoCode) && !is_string($promoCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($promoCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($promoCode, true), gettype($promoCode)), __LINE__); } $this->PromoCode = $promoCode; return $this; @@ -368,7 +368,7 @@ public function setProductCategory($productCategory = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ProductCategoryType::valueIsValid($productCategory)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $productCategory, implode(', ', \PayPal\EnumType\ProductCategoryType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ProductCategoryType', is_array($productCategory) ? implode(', ', $productCategory) : var_export($productCategory, true), implode(', ', \PayPal\EnumType\ProductCategoryType::getValidValues())), __LINE__); } $this->ProductCategory = $productCategory; return $this; @@ -390,7 +390,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this; @@ -484,7 +484,7 @@ public function setItemURL($itemURL = null) { // validation for constraint: string if (!is_null($itemURL) && !is_string($itemURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemURL, true), gettype($itemURL)), __LINE__); } $this->ItemURL = $itemURL; return $this; @@ -527,7 +527,7 @@ public function setItemCategory($itemCategory = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ItemCategoryType::valueIsValid($itemCategory)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $itemCategory, implode(', ', \PayPal\EnumType\ItemCategoryType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ItemCategoryType', is_array($itemCategory) ? implode(', ', $itemCategory) : var_export($itemCategory, true), implode(', ', \PayPal\EnumType\ItemCategoryType::getValidValues())), __LINE__); } $this->ItemCategory = $itemCategory; return $this; diff --git a/src/StructType/PaymentDetailsType.php b/src/StructType/PaymentDetailsType.php index fed78db..010fd98 100644 --- a/src/StructType/PaymentDetailsType.php +++ b/src/StructType/PaymentDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for PaymentDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentDetailsType Information about a payment. Used by DCC and Express Checkout. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class PaymentDetailsType extends AbstractStructBase { /** * The OrderTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total of order, including shipping, handling, and tax. You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Limitations: Must not exceed $10,000 USD in any * currency. No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - minOccurs: 0 @@ -24,7 +24,7 @@ class PaymentDetailsType extends AbstractStructBase public $OrderTotal; /** * The ItemTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sum of cost of all items in this order. You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional separator must be a comma (,). * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -32,7 +32,7 @@ class PaymentDetailsType extends AbstractStructBase public $ItemTotal; /** * The ShippingTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total shipping costs for this order. You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional Limitations: Must not exceed $10,000 USD in any currency. No * currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - minOccurs: 0 @@ -41,7 +41,7 @@ class PaymentDetailsType extends AbstractStructBase public $ShippingTotal; /** * The HandlingTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total handling costs for this order. You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional Limitations: Must not exceed $10,000 USD in any currency. No * currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - minOccurs: 0 @@ -50,7 +50,7 @@ class PaymentDetailsType extends AbstractStructBase public $HandlingTotal; /** * The TaxTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sum of tax for all items in this order. You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional Limitations: Must not exceed $10,000 USD in any currency. * No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - minOccurs: 0 @@ -59,7 +59,7 @@ class PaymentDetailsType extends AbstractStructBase public $TaxTotal; /** * The OrderDescription - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Description of items the customer is purchasing. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -67,7 +67,7 @@ class PaymentDetailsType extends AbstractStructBase public $OrderDescription; /** * The Custom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A free-form field for your own use. Optional Character length and limitations: 256 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -75,7 +75,7 @@ class PaymentDetailsType extends AbstractStructBase public $Custom; /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Your own invoice or tracking number. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -83,7 +83,7 @@ class PaymentDetailsType extends AbstractStructBase public $InvoiceID; /** * The ButtonSource - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An identification code for use by third-party applications to identify transactions. Optional Character length and limitations: 32 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -91,7 +91,7 @@ class PaymentDetailsType extends AbstractStructBase public $ButtonSource; /** * The NotifyURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Your URL for receiving Instant Payment Notification (IPN) about this transaction. Optional If you do not specify NotifyURL in the request, the notification URL from your Merchant Profile is used, if one exists. Character length and * limitations: 2,048 single-byte alphanumeric characters * - minOccurs: 0 @@ -100,7 +100,7 @@ class PaymentDetailsType extends AbstractStructBase public $NotifyURL; /** * The ShipToAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Address the order will be shipped to. Optional If you include the ShipToAddress element, the AddressType elements are required: Name Street1 CityName CountryCode Do not set set the CountryName element. * - minOccurs: 0 * @var \PayPal\StructType\AddressType @@ -108,7 +108,7 @@ class PaymentDetailsType extends AbstractStructBase public $ShipToAddress; /** * The MultiShipping - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that this payment is associated with multiple shipping addresses. Optional Character length and limitations: Four single-byte numeric characters. * - minOccurs: 0 * @var string @@ -116,7 +116,7 @@ class PaymentDetailsType extends AbstractStructBase public $MultiShipping; /** * The FulfillmentReferenceNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Thirdparty Fulfillment Reference Number. Optional Character length and limitations: 32 alphanumeric characters. * - maxOccurs: 1 * - minOccurs: 0 @@ -125,7 +125,7 @@ class PaymentDetailsType extends AbstractStructBase public $FulfillmentReferenceNumber; /** * The FulfillmentAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\AddressType @@ -133,7 +133,7 @@ class PaymentDetailsType extends AbstractStructBase public $FulfillmentAddress; /** * The PaymentCategoryType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -141,7 +141,7 @@ class PaymentDetailsType extends AbstractStructBase public $PaymentCategoryType; /** * The LocationType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -149,7 +149,7 @@ class PaymentDetailsType extends AbstractStructBase public $LocationType; /** * The ShippingMethod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -157,7 +157,7 @@ class PaymentDetailsType extends AbstractStructBase public $ShippingMethod; /** * The ProfileAddressChangeDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date and time (in GMT in the format yyyy-MM-ddTHH:mm:ssZ) at which address was changed by the user. * - maxOccurs: 1 * - minOccurs: 0 @@ -166,7 +166,7 @@ class PaymentDetailsType extends AbstractStructBase public $ProfileAddressChangeDate; /** * The PaymentDetailsItem - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the individual purchased items * - maxOccurs: unbounded * - minOccurs: 0 @@ -175,7 +175,7 @@ class PaymentDetailsType extends AbstractStructBase public $PaymentDetailsItem; /** * The InsuranceTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total shipping insurance costs for this order. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -184,7 +184,7 @@ class PaymentDetailsType extends AbstractStructBase public $InsuranceTotal; /** * The ShippingDiscount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Shipping discount for this order, specified as a negative number. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -193,7 +193,7 @@ class PaymentDetailsType extends AbstractStructBase public $ShippingDiscount; /** * The InsuranceOptionOffered - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Insurance options. * - maxOccurs: 1 * - minOccurs: 0 @@ -202,7 +202,7 @@ class PaymentDetailsType extends AbstractStructBase public $InsuranceOptionOffered; /** * The AllowedPaymentMethod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Allowed payment methods for this transaction. * - maxOccurs: 1 * - minOccurs: 0 @@ -211,7 +211,7 @@ class PaymentDetailsType extends AbstractStructBase public $AllowedPaymentMethod; /** * The EnhancedPaymentData - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Enhanced Data section to accept channel specific data. Applicable for version 62 and above, use this tag to pass airline itinerary data. Optional Refer to EnhancedPaymentDataType for details. * - maxOccurs: 1 * - minOccurs: 0 @@ -220,7 +220,7 @@ class PaymentDetailsType extends AbstractStructBase public $EnhancedPaymentData; /** * The SellerDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about the seller. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -229,7 +229,7 @@ class PaymentDetailsType extends AbstractStructBase public $SellerDetails; /** * The NoteText - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Note to recipient/seller. Optional Character length and limitations: 127 single-byte alphanumeric characters. * - maxOccurs: 1 * - minOccurs: 0 @@ -238,7 +238,7 @@ class PaymentDetailsType extends AbstractStructBase public $NoteText; /** * The TransactionId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PayPal Transaction Id, returned once DoExpressCheckout is completed. * - maxOccurs: 1 * - minOccurs: 0 @@ -247,7 +247,7 @@ class PaymentDetailsType extends AbstractStructBase public $TransactionId; /** * The PaymentAction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: How you want to obtain payment. This payment action input will be used for split payments Authorization indicates that this payment is a basic authorization subject to settlement with PayPal Authorization and Capture. Order indicates * that this payment is is an order authorization subject to settlement with PayPal Authorization and Capture. Sale indicates that this is a final sale for which you are requesting payment. IMPORTANT: You cannot set PaymentAction to Sale on * SetExpressCheckoutRequest and then change PaymentAction to Authorization on the final Express Checkout API, DoExpressCheckoutPaymentRequest. Character length and limit: Up to 13 single-byte alphabetic characters @@ -258,7 +258,7 @@ class PaymentDetailsType extends AbstractStructBase public $PaymentAction; /** * The PaymentRequestID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique identifier and mandatory for the particular payment request in case of multiple payment * - minOccurs: 0 * @var string @@ -266,7 +266,7 @@ class PaymentDetailsType extends AbstractStructBase public $PaymentRequestID; /** * The OrderURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL on Merchant site pertaining to this invoice. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -275,7 +275,7 @@ class PaymentDetailsType extends AbstractStructBase public $OrderURL; /** * The SoftDescriptor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Soft Descriptor supported for Sale and Auth in DEC only. For Order this will be ignored. * - maxOccurs: 1 * - minOccurs: 0 @@ -284,7 +284,7 @@ class PaymentDetailsType extends AbstractStructBase public $SoftDescriptor; /** * The BranchLevel - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: BranchLevel is used to identify chain payment. If BranchLevel is 0 or 1, this payment is where money moves to. If BranchLevel greater than 1, this payment contains the actual seller info. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -293,7 +293,7 @@ class PaymentDetailsType extends AbstractStructBase public $BranchLevel; /** * The OfferDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Soft Descriptor supported for Sale and Auth in DEC only. For Order this will be ignored. * - maxOccurs: 1 * - minOccurs: 0 @@ -302,7 +302,7 @@ class PaymentDetailsType extends AbstractStructBase public $OfferDetails; /** * The Recurring - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Flag to indicate the recurring transaction * - maxOccurs: 1 * - minOccurs: 0 @@ -311,7 +311,7 @@ class PaymentDetailsType extends AbstractStructBase public $Recurring; /** * The PaymentReason - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates the purpose of this payment like Refund * - maxOccurs: 1 * - minOccurs: 0 @@ -320,7 +320,7 @@ class PaymentDetailsType extends AbstractStructBase public $PaymentReason; /** * The LocationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Location ID Specified by merchant Optional Character length and limitations: 50 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -328,7 +328,7 @@ class PaymentDetailsType extends AbstractStructBase public $LocationID; /** * The RedeemedOffers - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: For instance single use coupons should not be returned in future CheckIn calls once they are redeemed. * - maxOccurs: 100 * - minOccurs: 0 @@ -337,7 +337,7 @@ class PaymentDetailsType extends AbstractStructBase public $RedeemedOffers; /** * The CummulativePoints - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total loyalty points for a given id accumulated by the consumre so far. * - maxOccurs: 100 * - minOccurs: 0 @@ -346,7 +346,7 @@ class PaymentDetailsType extends AbstractStructBase public $CummulativePoints; /** * The MerchantData - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchant Data that is passed through from Merchant to Processor * - maxOccurs: 16 * - minOccurs: 0 @@ -584,7 +584,7 @@ public function setOrderDescription($orderDescription = null) { // validation for constraint: string if (!is_null($orderDescription) && !is_string($orderDescription)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($orderDescription)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($orderDescription, true), gettype($orderDescription)), __LINE__); } $this->OrderDescription = $orderDescription; return $this; @@ -606,7 +606,7 @@ public function setCustom($custom = null) { // validation for constraint: string if (!is_null($custom) && !is_string($custom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($custom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); } $this->Custom = $custom; return $this; @@ -628,7 +628,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; @@ -650,7 +650,7 @@ public function setButtonSource($buttonSource = null) { // validation for constraint: string if (!is_null($buttonSource) && !is_string($buttonSource)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buttonSource)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buttonSource, true), gettype($buttonSource)), __LINE__); } $this->ButtonSource = $buttonSource; return $this; @@ -672,7 +672,7 @@ public function setNotifyURL($notifyURL = null) { // validation for constraint: string if (!is_null($notifyURL) && !is_string($notifyURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($notifyURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($notifyURL, true), gettype($notifyURL)), __LINE__); } $this->NotifyURL = $notifyURL; return $this; @@ -712,7 +712,7 @@ public function setMultiShipping($multiShipping = null) { // validation for constraint: string if (!is_null($multiShipping) && !is_string($multiShipping)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($multiShipping)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($multiShipping, true), gettype($multiShipping)), __LINE__); } $this->MultiShipping = $multiShipping; return $this; @@ -734,7 +734,7 @@ public function setFulfillmentReferenceNumber($fulfillmentReferenceNumber = null { // validation for constraint: string if (!is_null($fulfillmentReferenceNumber) && !is_string($fulfillmentReferenceNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($fulfillmentReferenceNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fulfillmentReferenceNumber, true), gettype($fulfillmentReferenceNumber)), __LINE__); } $this->FulfillmentReferenceNumber = $fulfillmentReferenceNumber; return $this; @@ -777,7 +777,7 @@ public function setPaymentCategoryType($paymentCategoryType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentCategoryType::valueIsValid($paymentCategoryType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentCategoryType, implode(', ', \PayPal\EnumType\PaymentCategoryType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentCategoryType', is_array($paymentCategoryType) ? implode(', ', $paymentCategoryType) : var_export($paymentCategoryType, true), implode(', ', \PayPal\EnumType\PaymentCategoryType::getValidValues())), __LINE__); } $this->PaymentCategoryType = $paymentCategoryType; return $this; @@ -802,7 +802,7 @@ public function setLocationType($locationType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\LocationType::valueIsValid($locationType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $locationType, implode(', ', \PayPal\EnumType\LocationType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\LocationType', is_array($locationType) ? implode(', ', $locationType) : var_export($locationType, true), implode(', ', \PayPal\EnumType\LocationType::getValidValues())), __LINE__); } $this->LocationType = $locationType; return $this; @@ -827,7 +827,7 @@ public function setShippingMethod($shippingMethod = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ShippingServiceCodeType::valueIsValid($shippingMethod)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $shippingMethod, implode(', ', \PayPal\EnumType\ShippingServiceCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ShippingServiceCodeType', is_array($shippingMethod) ? implode(', ', $shippingMethod) : var_export($shippingMethod, true), implode(', ', \PayPal\EnumType\ShippingServiceCodeType::getValidValues())), __LINE__); } $this->ShippingMethod = $shippingMethod; return $this; @@ -849,7 +849,7 @@ public function setProfileAddressChangeDate($profileAddressChangeDate = null) { // validation for constraint: string if (!is_null($profileAddressChangeDate) && !is_string($profileAddressChangeDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileAddressChangeDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileAddressChangeDate, true), gettype($profileAddressChangeDate)), __LINE__); } $this->ProfileAddressChangeDate = $profileAddressChangeDate; return $this; @@ -862,6 +862,28 @@ public function getPaymentDetailsItem() { return $this->PaymentDetailsItem; } + /** + * This method is responsible for validating the values passed to the setPaymentDetailsItem method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentDetailsItem method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentDetailsItemForArrayConstraintsFromSetPaymentDetailsItem(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $paymentDetailsTypePaymentDetailsItemItem) { + // validation for constraint: itemType + if (!$paymentDetailsTypePaymentDetailsItemItem instanceof \PayPal\StructType\PaymentDetailsItemType) { + $invalidValues[] = is_object($paymentDetailsTypePaymentDetailsItemItem) ? get_class($paymentDetailsTypePaymentDetailsItemItem) : sprintf('%s(%s)', gettype($paymentDetailsTypePaymentDetailsItemItem), var_export($paymentDetailsTypePaymentDetailsItemItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The PaymentDetailsItem property can only contain items of type \PayPal\StructType\PaymentDetailsItemType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentDetailsItem value * @throws \InvalidArgumentException @@ -870,11 +892,9 @@ public function getPaymentDetailsItem() */ public function setPaymentDetailsItem(array $paymentDetailsItem = array()) { - foreach ($paymentDetailsItem as $paymentDetailsTypePaymentDetailsItemItem) { - // validation for constraint: itemType - if (!$paymentDetailsTypePaymentDetailsItemItem instanceof \PayPal\StructType\PaymentDetailsItemType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetailsItem property can only contain items of \PayPal\StructType\PaymentDetailsItemType, "%s" given', is_object($paymentDetailsTypePaymentDetailsItemItem) ? get_class($paymentDetailsTypePaymentDetailsItemItem) : gettype($paymentDetailsTypePaymentDetailsItemItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentDetailsItemArrayErrorMessage = self::validatePaymentDetailsItemForArrayConstraintsFromSetPaymentDetailsItem($paymentDetailsItem))) { + throw new \InvalidArgumentException($paymentDetailsItemArrayErrorMessage, __LINE__); } $this->PaymentDetailsItem = $paymentDetailsItem; return $this; @@ -889,7 +909,7 @@ public function addToPaymentDetailsItem(\PayPal\StructType\PaymentDetailsItemTyp { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentDetailsItemType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetailsItem property can only contain items of \PayPal\StructType\PaymentDetailsItemType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The PaymentDetailsItem property can only contain items of type \PayPal\StructType\PaymentDetailsItemType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->PaymentDetailsItem[] = $item; return $this; @@ -947,7 +967,7 @@ public function setInsuranceOptionOffered($insuranceOptionOffered = null) { // validation for constraint: string if (!is_null($insuranceOptionOffered) && !is_string($insuranceOptionOffered)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($insuranceOptionOffered)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($insuranceOptionOffered, true), gettype($insuranceOptionOffered)), __LINE__); } $this->InsuranceOptionOffered = $insuranceOptionOffered; return $this; @@ -972,7 +992,7 @@ public function setAllowedPaymentMethod($allowedPaymentMethod = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AllowedPaymentMethodType::valueIsValid($allowedPaymentMethod)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $allowedPaymentMethod, implode(', ', \PayPal\EnumType\AllowedPaymentMethodType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AllowedPaymentMethodType', is_array($allowedPaymentMethod) ? implode(', ', $allowedPaymentMethod) : var_export($allowedPaymentMethod, true), implode(', ', \PayPal\EnumType\AllowedPaymentMethodType::getValidValues())), __LINE__); } $this->AllowedPaymentMethod = $allowedPaymentMethod; return $this; @@ -1030,7 +1050,7 @@ public function setNoteText($noteText = null) { // validation for constraint: string if (!is_null($noteText) && !is_string($noteText)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($noteText)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($noteText, true), gettype($noteText)), __LINE__); } $this->NoteText = $noteText; return $this; @@ -1052,7 +1072,7 @@ public function setTransactionId($transactionId = null) { // validation for constraint: string if (!is_null($transactionId) && !is_string($transactionId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionId, true), gettype($transactionId)), __LINE__); } $this->TransactionId = $transactionId; return $this; @@ -1077,7 +1097,7 @@ public function setPaymentAction($paymentAction = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentActionCodeType::valueIsValid($paymentAction)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentAction, implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentActionCodeType', is_array($paymentAction) ? implode(', ', $paymentAction) : var_export($paymentAction, true), implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); } $this->PaymentAction = $paymentAction; return $this; @@ -1099,7 +1119,7 @@ public function setPaymentRequestID($paymentRequestID = null) { // validation for constraint: string if (!is_null($paymentRequestID) && !is_string($paymentRequestID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentRequestID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paymentRequestID, true), gettype($paymentRequestID)), __LINE__); } $this->PaymentRequestID = $paymentRequestID; return $this; @@ -1121,7 +1141,7 @@ public function setOrderURL($orderURL = null) { // validation for constraint: string if (!is_null($orderURL) && !is_string($orderURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($orderURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($orderURL, true), gettype($orderURL)), __LINE__); } $this->OrderURL = $orderURL; return $this; @@ -1143,7 +1163,7 @@ public function setSoftDescriptor($softDescriptor = null) { // validation for constraint: string if (!is_null($softDescriptor) && !is_string($softDescriptor)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptor)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptor, true), gettype($softDescriptor)), __LINE__); } $this->SoftDescriptor = $softDescriptor; return $this; @@ -1164,8 +1184,8 @@ public function getBranchLevel() public function setBranchLevel($branchLevel = null) { // validation for constraint: int - if (!is_null($branchLevel) && !is_numeric($branchLevel)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($branchLevel)), __LINE__); + if (!is_null($branchLevel) && !(is_int($branchLevel) || ctype_digit($branchLevel))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($branchLevel, true), gettype($branchLevel)), __LINE__); } $this->BranchLevel = $branchLevel; return $this; @@ -1208,7 +1228,7 @@ public function setRecurring($recurring = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\RecurringFlagType::valueIsValid($recurring)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $recurring, implode(', ', \PayPal\EnumType\RecurringFlagType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\RecurringFlagType', is_array($recurring) ? implode(', ', $recurring) : var_export($recurring, true), implode(', ', \PayPal\EnumType\RecurringFlagType::getValidValues())), __LINE__); } $this->Recurring = $recurring; return $this; @@ -1233,7 +1253,7 @@ public function setPaymentReason($paymentReason = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentReasonType::valueIsValid($paymentReason)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentReason, implode(', ', \PayPal\EnumType\PaymentReasonType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentReasonType', is_array($paymentReason) ? implode(', ', $paymentReason) : var_export($paymentReason, true), implode(', ', \PayPal\EnumType\PaymentReasonType::getValidValues())), __LINE__); } $this->PaymentReason = $paymentReason; return $this; @@ -1255,7 +1275,7 @@ public function setLocationID($locationID = null) { // validation for constraint: string if (!is_null($locationID) && !is_string($locationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($locationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($locationID, true), gettype($locationID)), __LINE__); } $this->LocationID = $locationID; return $this; @@ -1268,6 +1288,28 @@ public function getRedeemedOffers() { return $this->RedeemedOffers; } + /** + * This method is responsible for validating the values passed to the setRedeemedOffers method + * This method is willingly generated in order to preserve the one-line inline validation within the setRedeemedOffers method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateRedeemedOffersForArrayConstraintsFromSetRedeemedOffers(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $paymentDetailsTypeRedeemedOffersItem) { + // validation for constraint: itemType + if (!$paymentDetailsTypeRedeemedOffersItem instanceof \PayPal\StructType\DiscountInfoType) { + $invalidValues[] = is_object($paymentDetailsTypeRedeemedOffersItem) ? get_class($paymentDetailsTypeRedeemedOffersItem) : sprintf('%s(%s)', gettype($paymentDetailsTypeRedeemedOffersItem), var_export($paymentDetailsTypeRedeemedOffersItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The RedeemedOffers property can only contain items of type \PayPal\StructType\DiscountInfoType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set RedeemedOffers value * @throws \InvalidArgumentException @@ -1276,11 +1318,13 @@ public function getRedeemedOffers() */ public function setRedeemedOffers(array $redeemedOffers = array()) { - foreach ($redeemedOffers as $paymentDetailsTypeRedeemedOffersItem) { - // validation for constraint: itemType - if (!$paymentDetailsTypeRedeemedOffersItem instanceof \PayPal\StructType\DiscountInfoType) { - throw new \InvalidArgumentException(sprintf('The RedeemedOffers property can only contain items of \PayPal\StructType\DiscountInfoType, "%s" given', is_object($paymentDetailsTypeRedeemedOffersItem) ? get_class($paymentDetailsTypeRedeemedOffersItem) : gettype($paymentDetailsTypeRedeemedOffersItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($redeemedOffersArrayErrorMessage = self::validateRedeemedOffersForArrayConstraintsFromSetRedeemedOffers($redeemedOffers))) { + throw new \InvalidArgumentException($redeemedOffersArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(100) + if (is_array($redeemedOffers) && count($redeemedOffers) > 100) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 100', count($redeemedOffers)), __LINE__); } $this->RedeemedOffers = $redeemedOffers; return $this; @@ -1295,7 +1339,11 @@ public function addToRedeemedOffers(\PayPal\StructType\DiscountInfoType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\DiscountInfoType) { - throw new \InvalidArgumentException(sprintf('The RedeemedOffers property can only contain items of \PayPal\StructType\DiscountInfoType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The RedeemedOffers property can only contain items of type \PayPal\StructType\DiscountInfoType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(100) + if (is_array($this->RedeemedOffers) && count($this->RedeemedOffers) >= 100) { + 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 100', count($this->RedeemedOffers)), __LINE__); } $this->RedeemedOffers[] = $item; return $this; @@ -1308,6 +1356,28 @@ public function getCummulativePoints() { return $this->CummulativePoints; } + /** + * This method is responsible for validating the values passed to the setCummulativePoints method + * This method is willingly generated in order to preserve the one-line inline validation within the setCummulativePoints method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateCummulativePointsForArrayConstraintsFromSetCummulativePoints(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $paymentDetailsTypeCummulativePointsItem) { + // validation for constraint: itemType + if (!$paymentDetailsTypeCummulativePointsItem instanceof \PayPal\StructType\DiscountInfoType) { + $invalidValues[] = is_object($paymentDetailsTypeCummulativePointsItem) ? get_class($paymentDetailsTypeCummulativePointsItem) : sprintf('%s(%s)', gettype($paymentDetailsTypeCummulativePointsItem), var_export($paymentDetailsTypeCummulativePointsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The CummulativePoints property can only contain items of type \PayPal\StructType\DiscountInfoType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set CummulativePoints value * @throws \InvalidArgumentException @@ -1316,11 +1386,13 @@ public function getCummulativePoints() */ public function setCummulativePoints(array $cummulativePoints = array()) { - foreach ($cummulativePoints as $paymentDetailsTypeCummulativePointsItem) { - // validation for constraint: itemType - if (!$paymentDetailsTypeCummulativePointsItem instanceof \PayPal\StructType\DiscountInfoType) { - throw new \InvalidArgumentException(sprintf('The CummulativePoints property can only contain items of \PayPal\StructType\DiscountInfoType, "%s" given', is_object($paymentDetailsTypeCummulativePointsItem) ? get_class($paymentDetailsTypeCummulativePointsItem) : gettype($paymentDetailsTypeCummulativePointsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($cummulativePointsArrayErrorMessage = self::validateCummulativePointsForArrayConstraintsFromSetCummulativePoints($cummulativePoints))) { + throw new \InvalidArgumentException($cummulativePointsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(100) + if (is_array($cummulativePoints) && count($cummulativePoints) > 100) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 100', count($cummulativePoints)), __LINE__); } $this->CummulativePoints = $cummulativePoints; return $this; @@ -1335,7 +1407,11 @@ public function addToCummulativePoints(\PayPal\StructType\DiscountInfoType $item { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\DiscountInfoType) { - throw new \InvalidArgumentException(sprintf('The CummulativePoints property can only contain items of \PayPal\StructType\DiscountInfoType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The CummulativePoints property can only contain items of type \PayPal\StructType\DiscountInfoType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(100) + if (is_array($this->CummulativePoints) && count($this->CummulativePoints) >= 100) { + 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 100', count($this->CummulativePoints)), __LINE__); } $this->CummulativePoints[] = $item; return $this; @@ -1348,6 +1424,28 @@ public function getMerchantData() { return $this->MerchantData; } + /** + * This method is responsible for validating the values passed to the setMerchantData method + * This method is willingly generated in order to preserve the one-line inline validation within the setMerchantData method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateMerchantDataForArrayConstraintsFromSetMerchantData(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $paymentDetailsTypeMerchantDataItem) { + // validation for constraint: itemType + if (!$paymentDetailsTypeMerchantDataItem instanceof \PayPal\StructType\MerchantDataType) { + $invalidValues[] = is_object($paymentDetailsTypeMerchantDataItem) ? get_class($paymentDetailsTypeMerchantDataItem) : sprintf('%s(%s)', gettype($paymentDetailsTypeMerchantDataItem), var_export($paymentDetailsTypeMerchantDataItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The MerchantData property can only contain items of type \PayPal\StructType\MerchantDataType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set MerchantData value * @throws \InvalidArgumentException @@ -1356,11 +1454,13 @@ public function getMerchantData() */ public function setMerchantData(array $merchantData = array()) { - foreach ($merchantData as $paymentDetailsTypeMerchantDataItem) { - // validation for constraint: itemType - if (!$paymentDetailsTypeMerchantDataItem instanceof \PayPal\StructType\MerchantDataType) { - throw new \InvalidArgumentException(sprintf('The MerchantData property can only contain items of \PayPal\StructType\MerchantDataType, "%s" given', is_object($paymentDetailsTypeMerchantDataItem) ? get_class($paymentDetailsTypeMerchantDataItem) : gettype($paymentDetailsTypeMerchantDataItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($merchantDataArrayErrorMessage = self::validateMerchantDataForArrayConstraintsFromSetMerchantData($merchantData))) { + throw new \InvalidArgumentException($merchantDataArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(16) + if (is_array($merchantData) && count($merchantData) > 16) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 16', count($merchantData)), __LINE__); } $this->MerchantData = $merchantData; return $this; @@ -1375,7 +1475,11 @@ public function addToMerchantData(\PayPal\StructType\MerchantDataType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\MerchantDataType) { - throw new \InvalidArgumentException(sprintf('The MerchantData property can only contain items of \PayPal\StructType\MerchantDataType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The MerchantData property can only contain items of type \PayPal\StructType\MerchantDataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(16) + if (is_array($this->MerchantData) && count($this->MerchantData) >= 16) { + 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 16', count($this->MerchantData)), __LINE__); } $this->MerchantData[] = $item; return $this; diff --git a/src/StructType/PaymentDirectivesType.php b/src/StructType/PaymentDirectivesType.php index 7106ce6..922b82d 100644 --- a/src/StructType/PaymentDirectivesType.php +++ b/src/StructType/PaymentDirectivesType.php @@ -13,7 +13,7 @@ class PaymentDirectivesType extends AbstractStructBase { /** * The PaymentType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of the Payment is it Instant or Echeck or Any. * - minOccurs: 0 * @var string @@ -49,7 +49,7 @@ public function setPaymentType($paymentType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MerchantPullPaymentCodeType::valueIsValid($paymentType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentType, implode(', ', \PayPal\EnumType\MerchantPullPaymentCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MerchantPullPaymentCodeType', is_array($paymentType) ? implode(', ', $paymentType) : var_export($paymentType, true), implode(', ', \PayPal\EnumType\MerchantPullPaymentCodeType::getValidValues())), __LINE__); } $this->PaymentType = $paymentType; return $this; diff --git a/src/StructType/PaymentInfoType.php b/src/StructType/PaymentInfoType.php index f389861..7d4ed2f 100644 --- a/src/StructType/PaymentInfoType.php +++ b/src/StructType/PaymentInfoType.php @@ -6,9 +6,9 @@ /** * This class stands for PaymentInfoType StructType - * Meta informations extracted from the WSDL - * - documentation: PaymentInfoType Payment information. | A transaction identification number. Character length and limits: 19 single-byte characters maximum | Its Ebay transaction id. EbayTransactionID will returned for immediate pay item transaction - * in ECA | Receipt ID Character length and limitations: 16 digits in xxxx-xxxx-xxxx-xxxx format + * Meta information extracted from the WSDL + * - documentation: Receipt ID Character length and limitations: 16 digits in xxxx-xxxx-xxxx-xxxx format | Its Ebay transaction id. EbayTransactionID will returned for immediate pay item transaction in ECA | A transaction identification number. + * Character length and limits: 19 single-byte characters maximum | PaymentInfoType Payment information. * @subpackage Structs * @author WsdlToPhp */ @@ -16,7 +16,7 @@ class PaymentInfoType extends AbstractStructBase { /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:TransactionID * @var string @@ -24,7 +24,7 @@ class PaymentInfoType extends AbstractStructBase public $TransactionID; /** * The EbayTransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:EbayTransactionID * @var string @@ -32,17 +32,18 @@ class PaymentInfoType extends AbstractStructBase public $EbayTransactionID; /** * The ParentTransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Parent or related transaction identification number. This field is populated for the following transaction types: ReversalCapture of an authorized transaction.Reauthorization of a transaction.Capture of an order. The value of * ParentTransactionID is the original OrderID.Authorization of an order. The value of ParentTransactionID is the original OrderID.Capture of an order authorization.Void of an order. The value of ParentTransactionID is the original OrderID. Character * length and limits: 19 single-byte characters maximum | TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * - minOccurs: 0 * @var string */ public $ParentTransactionID; /** * The ReceiptID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:ReceiptID * @var string @@ -50,7 +51,7 @@ class PaymentInfoType extends AbstractStructBase public $ReceiptID; /** * The TransactionType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The type of transaction cart: Transaction created via the PayPal Shopping Cart feature or by Express Checkout with multiple purchased item express-checkout: Transaction created by Express Checkout with a single purchased items * send-money: Transaction created by customer from the Send Money tab on the PayPal website. web-accept: Transaction created by customer via Buy Now, Donation, or Auction Smart Logos. subscr-*: Transaction created by customer via Subscription. eot * means "end of subscription term." merch-pmt: preapproved payment. mass-pay: Transaction created via MassPay. virtual-terminal: Transaction created via merchant virtual terminal. credit: Transaction created via merchant virtual terminal or API to @@ -60,7 +61,7 @@ class PaymentInfoType extends AbstractStructBase public $TransactionType; /** * The PaymentType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The type of payment * - minOccurs: 0 * @var string @@ -68,7 +69,7 @@ class PaymentInfoType extends AbstractStructBase public $PaymentType; /** * The RefundSourceCodeType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The type of funding source * - minOccurs: 0 * @var string @@ -76,7 +77,7 @@ class PaymentInfoType extends AbstractStructBase public $RefundSourceCodeType; /** * The ExpectedeCheckClearDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: eCheck latest expected clear date * - minOccurs: 0 * @var string @@ -84,7 +85,7 @@ class PaymentInfoType extends AbstractStructBase public $ExpectedeCheckClearDate; /** * The PaymentDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date and time of payment * - minOccurs: 0 * @var string @@ -92,7 +93,7 @@ class PaymentInfoType extends AbstractStructBase public $PaymentDate; /** * The GrossAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Full amount of the customer's payment, before transaction fee is subtracted * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -100,7 +101,7 @@ class PaymentInfoType extends AbstractStructBase public $GrossAmount; /** * The FeeAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Transaction fee associated with the payment * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -108,7 +109,7 @@ class PaymentInfoType extends AbstractStructBase public $FeeAmount; /** * The FinancingFeeAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Transaction financing fee associated with the payment. * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -116,7 +117,7 @@ class PaymentInfoType extends AbstractStructBase public $FinancingFeeAmount; /** * The FinancingTotalCost - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total overall cost associated with this financing transaction. * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -124,7 +125,7 @@ class PaymentInfoType extends AbstractStructBase public $FinancingTotalCost; /** * The FinancingMonthlyPayment - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Monthly payment for this financing transaction. * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -132,7 +133,7 @@ class PaymentInfoType extends AbstractStructBase public $FinancingMonthlyPayment; /** * The FinancingTerm - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The length of this financing term, in months. * - minOccurs: 0 * @var string @@ -140,14 +141,14 @@ class PaymentInfoType extends AbstractStructBase public $FinancingTerm; /** * The IsFinancing - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $IsFinancing; /** * The SettleAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount deposited into the account's primary balance after a currency conversion from automatic conversion through your Payment Receiving Preferences or manual conversion through manually accepting a payment. This amount is calculated * after fees and taxes have been assessed. * - minOccurs: 0 @@ -156,7 +157,7 @@ class PaymentInfoType extends AbstractStructBase public $SettleAmount; /** * The TaxAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of tax for transaction * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -164,7 +165,7 @@ class PaymentInfoType extends AbstractStructBase public $TaxAmount; /** * The ExchangeRate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Exchange rate for transaction * - minOccurs: 0 * @var string @@ -172,7 +173,7 @@ class PaymentInfoType extends AbstractStructBase public $ExchangeRate; /** * The PaymentStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The status of the payment: None: No status Created: A giropay payment has been initiated. Canceled-Reversal: A reversal has been canceled. For example, you won a dispute with the customer, and the funds for the transaction that was * reversed have been returned to you. Completed: The payment has been completed, and the funds have been added successfully to your account balance. Denied: You denied the payment. This happens only if the payment was previously pending because of * possible reasons described for the PendingReason element. Expired: This authorization has expired and cannot be captured. Failed: The payment has failed. This happens only if the payment was made from your customer's bank account. In-Progress: The @@ -184,7 +185,7 @@ class PaymentInfoType extends AbstractStructBase public $PaymentStatus; /** * The PendingReason - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The reason the payment is pending: none: No pending reason address: The payment is pending because your customer did not include a confirmed shipping address and your Payment Receiving Preferences is set such that you want to * manually accept or deny each of these payments. To change your preference, go to the Preferences section of your Profile. authorization: You set PaymentAction to Authorization on SetExpressCheckoutRequest and have not yet captured funds. echeck: The * payment is pending because it was made by an eCheck that has not yet cleared. intl: The payment is pending because you hold a non-U.S. account and do not have a withdrawal mechanism. You must manually accept or deny this payment from your Account @@ -199,7 +200,7 @@ class PaymentInfoType extends AbstractStructBase public $PendingReason; /** * The ReasonCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The reason for a reversal if TransactionType is reversal: none: No reason code chargeback: A reversal has occurred on this transaction due to a chargeback by your customer. guarantee: A reversal has occurred on this transaction due * to your customer triggering a money-back guarantee. buyer-complaint: A reversal has occurred on this transaction due to a complaint about the transaction from your customer. refund: A reversal has occurred on this transaction because you have given * the customer a refund. other: A reversal has occurred on this transaction due to a reason not listed above. @@ -209,7 +210,7 @@ class PaymentInfoType extends AbstractStructBase public $ReasonCode; /** * The HoldDecision - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: HoldDecision is returned in the response only if PaymentStatus is Completed-Funds-Held. The reason the funds are kept in pending balance: newsellerpaymenthold: The seller is new. paymenthold: A hold is placed on your transaction due * to a reason not listed above. * - minOccurs: 0 @@ -218,7 +219,7 @@ class PaymentInfoType extends AbstractStructBase public $HoldDecision; /** * The ShippingMethod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Shipping method selected by the user during check-out. * - minOccurs: 0 * @var string @@ -226,7 +227,7 @@ class PaymentInfoType extends AbstractStructBase public $ShippingMethod; /** * The ProtectionEligibility - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Protection Eligibility for this Transaction - None, SPP or ESPP * - minOccurs: 0 * @var string @@ -234,7 +235,7 @@ class PaymentInfoType extends AbstractStructBase public $ProtectionEligibility; /** * The ProtectionEligibilityType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Protection Eligibility details for this Transaction * - minOccurs: 0 * @var string @@ -242,7 +243,7 @@ class PaymentInfoType extends AbstractStructBase public $ProtectionEligibilityType; /** * The ReceiptReferenceNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Receipt Reference Number for this Transaction * - minOccurs: 0 * @var string @@ -250,7 +251,7 @@ class PaymentInfoType extends AbstractStructBase public $ReceiptReferenceNumber; /** * The POSTransactionType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The type of POS transaction F: Forced post transaction. POS merchant can send transactions at a later point if connectivity is lost. S: Single call checkout, and this is to identify PayPal Lite API usage. * - minOccurs: 0 * @var string @@ -258,7 +259,7 @@ class PaymentInfoType extends AbstractStructBase public $POSTransactionType; /** * The ShipAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of shipping charged on transaction * - minOccurs: 0 * @var string @@ -266,7 +267,7 @@ class PaymentInfoType extends AbstractStructBase public $ShipAmount; /** * The ShipHandleAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of ship handling charged on transaction * - minOccurs: 0 * @var string @@ -274,7 +275,7 @@ class PaymentInfoType extends AbstractStructBase public $ShipHandleAmount; /** * The ShipDiscount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of shipping discount on transaction * - minOccurs: 0 * @var string @@ -282,7 +283,7 @@ class PaymentInfoType extends AbstractStructBase public $ShipDiscount; /** * The InsuranceAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of Insurance amount on transaction * - minOccurs: 0 * @var string @@ -290,7 +291,7 @@ class PaymentInfoType extends AbstractStructBase public $InsuranceAmount; /** * The Subject - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Subject as entered in the transaction * - minOccurs: 0 * @var string @@ -298,7 +299,7 @@ class PaymentInfoType extends AbstractStructBase public $Subject; /** * The StoreID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: StoreID as entered in the transaction * - minOccurs: 0 * @var string @@ -306,7 +307,7 @@ class PaymentInfoType extends AbstractStructBase public $StoreID; /** * The TerminalID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: TerminalID as entered in the transaction * - minOccurs: 0 * @var string @@ -314,7 +315,7 @@ class PaymentInfoType extends AbstractStructBase public $TerminalID; /** * The SellerDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about the seller. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -323,7 +324,7 @@ class PaymentInfoType extends AbstractStructBase public $SellerDetails; /** * The PaymentRequestID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique identifier and mandatory for each bucket in case of split payement * - minOccurs: 0 * @var string @@ -331,7 +332,7 @@ class PaymentInfoType extends AbstractStructBase public $PaymentRequestID; /** * The FMFDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Thes are filters that could result in accept/deny/pending action. * - maxOccurs: 1 * - minOccurs: 0 @@ -340,7 +341,7 @@ class PaymentInfoType extends AbstractStructBase public $FMFDetails; /** * The EnhancedPaymentInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This will be enhanced info for the payment: Example: UATP details * - maxOccurs: 1 * - minOccurs: 0 @@ -349,7 +350,7 @@ class PaymentInfoType extends AbstractStructBase public $EnhancedPaymentInfo; /** * The PaymentError - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This will indicate the payment status for individual payment request in case of split payment * - maxOccurs: 1 * - minOccurs: 0 @@ -358,7 +359,7 @@ class PaymentInfoType extends AbstractStructBase public $PaymentError; /** * The InstrumentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of the payment instrument. * - minOccurs: 0 * @var \PayPal\StructType\InstrumentDetailsType @@ -366,7 +367,7 @@ class PaymentInfoType extends AbstractStructBase public $InstrumentDetails; /** * The OfferDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Offer Details. * - minOccurs: 0 * @var \PayPal\StructType\OfferDetailsType @@ -374,7 +375,7 @@ class PaymentInfoType extends AbstractStructBase public $OfferDetails; /** * The BinEligibility - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This field indicates whether the credit card number used for this transaction is in a particular bin range registered with PayPal by the merchant. This filed is optional and will be present if merchant has a registered bin range. The * value of this field will be "true" if merchant has a registered bin range and the credit card used in the transaction is within the registered bin range. The value of this field will be false if merchant has a registered bin range and credit card * used in the transaction outside registered bin range or the transaction is not done using a credit card. @@ -384,7 +385,7 @@ class PaymentInfoType extends AbstractStructBase public $BinEligibility; /** * The SoftDescriptor - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This information holds business name and other data describing the transaction. This information is usually displayed in the CC account holder's statement. * - minOccurs: 0 * @var string @@ -392,7 +393,7 @@ class PaymentInfoType extends AbstractStructBase public $SoftDescriptor; /** * The SoftDescriptorCity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: CC Information about how consumer should contact the merchant. This information is usually displayed in the CC account holder's statement. * - minOccurs: 0 * @var string @@ -557,7 +558,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -579,7 +580,7 @@ public function setEbayTransactionID($ebayTransactionID = null) { // validation for constraint: string if (!is_null($ebayTransactionID) && !is_string($ebayTransactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($ebayTransactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($ebayTransactionID, true), gettype($ebayTransactionID)), __LINE__); } $this->EbayTransactionID = $ebayTransactionID; return $this; @@ -601,7 +602,7 @@ public function setParentTransactionID($parentTransactionID = null) { // validation for constraint: string if (!is_null($parentTransactionID) && !is_string($parentTransactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($parentTransactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($parentTransactionID, true), gettype($parentTransactionID)), __LINE__); } $this->ParentTransactionID = $parentTransactionID; return $this; @@ -623,7 +624,7 @@ public function setReceiptID($receiptID = null) { // validation for constraint: string if (!is_null($receiptID) && !is_string($receiptID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiptID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiptID, true), gettype($receiptID)), __LINE__); } $this->ReceiptID = $receiptID; return $this; @@ -648,7 +649,7 @@ public function setTransactionType($transactionType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentTransactionCodeType::valueIsValid($transactionType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $transactionType, implode(', ', \PayPal\EnumType\PaymentTransactionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentTransactionCodeType', is_array($transactionType) ? implode(', ', $transactionType) : var_export($transactionType, true), implode(', ', \PayPal\EnumType\PaymentTransactionCodeType::getValidValues())), __LINE__); } $this->TransactionType = $transactionType; return $this; @@ -673,7 +674,7 @@ public function setPaymentType($paymentType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentCodeType::valueIsValid($paymentType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentType, implode(', ', \PayPal\EnumType\PaymentCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentCodeType', is_array($paymentType) ? implode(', ', $paymentType) : var_export($paymentType, true), implode(', ', \PayPal\EnumType\PaymentCodeType::getValidValues())), __LINE__); } $this->PaymentType = $paymentType; return $this; @@ -698,7 +699,7 @@ public function setRefundSourceCodeType($refundSourceCodeType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\RefundSourceCodeType::valueIsValid($refundSourceCodeType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $refundSourceCodeType, implode(', ', \PayPal\EnumType\RefundSourceCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\RefundSourceCodeType', is_array($refundSourceCodeType) ? implode(', ', $refundSourceCodeType) : var_export($refundSourceCodeType, true), implode(', ', \PayPal\EnumType\RefundSourceCodeType::getValidValues())), __LINE__); } $this->RefundSourceCodeType = $refundSourceCodeType; return $this; @@ -720,7 +721,7 @@ public function setExpectedeCheckClearDate($expectedeCheckClearDate = null) { // validation for constraint: string if (!is_null($expectedeCheckClearDate) && !is_string($expectedeCheckClearDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($expectedeCheckClearDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($expectedeCheckClearDate, true), gettype($expectedeCheckClearDate)), __LINE__); } $this->ExpectedeCheckClearDate = $expectedeCheckClearDate; return $this; @@ -742,7 +743,7 @@ public function setPaymentDate($paymentDate = null) { // validation for constraint: string if (!is_null($paymentDate) && !is_string($paymentDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paymentDate, true), gettype($paymentDate)), __LINE__); } $this->PaymentDate = $paymentDate; return $this; @@ -854,7 +855,7 @@ public function setFinancingTerm($financingTerm = null) { // validation for constraint: string if (!is_null($financingTerm) && !is_string($financingTerm)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($financingTerm)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($financingTerm, true), gettype($financingTerm)), __LINE__); } $this->FinancingTerm = $financingTerm; return $this; @@ -876,7 +877,7 @@ public function setIsFinancing($isFinancing = null) { // validation for constraint: string if (!is_null($isFinancing) && !is_string($isFinancing)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($isFinancing)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($isFinancing, true), gettype($isFinancing)), __LINE__); } $this->IsFinancing = $isFinancing; return $this; @@ -934,7 +935,7 @@ public function setExchangeRate($exchangeRate = null) { // validation for constraint: string if (!is_null($exchangeRate) && !is_string($exchangeRate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($exchangeRate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($exchangeRate, true), gettype($exchangeRate)), __LINE__); } $this->ExchangeRate = $exchangeRate; return $this; @@ -959,7 +960,7 @@ public function setPaymentStatus($paymentStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentStatusCodeType::valueIsValid($paymentStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentStatus, implode(', ', \PayPal\EnumType\PaymentStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentStatusCodeType', is_array($paymentStatus) ? implode(', ', $paymentStatus) : var_export($paymentStatus, true), implode(', ', \PayPal\EnumType\PaymentStatusCodeType::getValidValues())), __LINE__); } $this->PaymentStatus = $paymentStatus; return $this; @@ -984,7 +985,7 @@ public function setPendingReason($pendingReason = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PendingStatusCodeType::valueIsValid($pendingReason)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $pendingReason, implode(', ', \PayPal\EnumType\PendingStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PendingStatusCodeType', is_array($pendingReason) ? implode(', ', $pendingReason) : var_export($pendingReason, true), implode(', ', \PayPal\EnumType\PendingStatusCodeType::getValidValues())), __LINE__); } $this->PendingReason = $pendingReason; return $this; @@ -1009,7 +1010,7 @@ public function setReasonCode($reasonCode = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ReversalReasonCodeType::valueIsValid($reasonCode)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $reasonCode, implode(', ', \PayPal\EnumType\ReversalReasonCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ReversalReasonCodeType', is_array($reasonCode) ? implode(', ', $reasonCode) : var_export($reasonCode, true), implode(', ', \PayPal\EnumType\ReversalReasonCodeType::getValidValues())), __LINE__); } $this->ReasonCode = $reasonCode; return $this; @@ -1031,7 +1032,7 @@ public function setHoldDecision($holdDecision = null) { // validation for constraint: string if (!is_null($holdDecision) && !is_string($holdDecision)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($holdDecision)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($holdDecision, true), gettype($holdDecision)), __LINE__); } $this->HoldDecision = $holdDecision; return $this; @@ -1053,7 +1054,7 @@ public function setShippingMethod($shippingMethod = null) { // validation for constraint: string if (!is_null($shippingMethod) && !is_string($shippingMethod)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingMethod)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingMethod, true), gettype($shippingMethod)), __LINE__); } $this->ShippingMethod = $shippingMethod; return $this; @@ -1075,7 +1076,7 @@ public function setProtectionEligibility($protectionEligibility = null) { // validation for constraint: string if (!is_null($protectionEligibility) && !is_string($protectionEligibility)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($protectionEligibility)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($protectionEligibility, true), gettype($protectionEligibility)), __LINE__); } $this->ProtectionEligibility = $protectionEligibility; return $this; @@ -1097,7 +1098,7 @@ public function setProtectionEligibilityType($protectionEligibilityType = null) { // validation for constraint: string if (!is_null($protectionEligibilityType) && !is_string($protectionEligibilityType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($protectionEligibilityType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($protectionEligibilityType, true), gettype($protectionEligibilityType)), __LINE__); } $this->ProtectionEligibilityType = $protectionEligibilityType; return $this; @@ -1119,7 +1120,7 @@ public function setReceiptReferenceNumber($receiptReferenceNumber = null) { // validation for constraint: string if (!is_null($receiptReferenceNumber) && !is_string($receiptReferenceNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiptReferenceNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiptReferenceNumber, true), gettype($receiptReferenceNumber)), __LINE__); } $this->ReceiptReferenceNumber = $receiptReferenceNumber; return $this; @@ -1144,7 +1145,7 @@ public function setPOSTransactionType($pOSTransactionType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\POSTransactionCodeType::valueIsValid($pOSTransactionType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $pOSTransactionType, implode(', ', \PayPal\EnumType\POSTransactionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\POSTransactionCodeType', is_array($pOSTransactionType) ? implode(', ', $pOSTransactionType) : var_export($pOSTransactionType, true), implode(', ', \PayPal\EnumType\POSTransactionCodeType::getValidValues())), __LINE__); } $this->POSTransactionType = $pOSTransactionType; return $this; @@ -1166,7 +1167,7 @@ public function setShipAmount($shipAmount = null) { // validation for constraint: string if (!is_null($shipAmount) && !is_string($shipAmount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shipAmount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shipAmount, true), gettype($shipAmount)), __LINE__); } $this->ShipAmount = $shipAmount; return $this; @@ -1188,7 +1189,7 @@ public function setShipHandleAmount($shipHandleAmount = null) { // validation for constraint: string if (!is_null($shipHandleAmount) && !is_string($shipHandleAmount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shipHandleAmount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shipHandleAmount, true), gettype($shipHandleAmount)), __LINE__); } $this->ShipHandleAmount = $shipHandleAmount; return $this; @@ -1210,7 +1211,7 @@ public function setShipDiscount($shipDiscount = null) { // validation for constraint: string if (!is_null($shipDiscount) && !is_string($shipDiscount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shipDiscount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shipDiscount, true), gettype($shipDiscount)), __LINE__); } $this->ShipDiscount = $shipDiscount; return $this; @@ -1232,7 +1233,7 @@ public function setInsuranceAmount($insuranceAmount = null) { // validation for constraint: string if (!is_null($insuranceAmount) && !is_string($insuranceAmount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($insuranceAmount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($insuranceAmount, true), gettype($insuranceAmount)), __LINE__); } $this->InsuranceAmount = $insuranceAmount; return $this; @@ -1254,7 +1255,7 @@ public function setSubject($subject = null) { // validation for constraint: string if (!is_null($subject) && !is_string($subject)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($subject)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subject, true), gettype($subject)), __LINE__); } $this->Subject = $subject; return $this; @@ -1276,7 +1277,7 @@ public function setStoreID($storeID = null) { // validation for constraint: string if (!is_null($storeID) && !is_string($storeID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($storeID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($storeID, true), gettype($storeID)), __LINE__); } $this->StoreID = $storeID; return $this; @@ -1298,7 +1299,7 @@ public function setTerminalID($terminalID = null) { // validation for constraint: string if (!is_null($terminalID) && !is_string($terminalID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($terminalID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($terminalID, true), gettype($terminalID)), __LINE__); } $this->TerminalID = $terminalID; return $this; @@ -1338,7 +1339,7 @@ public function setPaymentRequestID($paymentRequestID = null) { // validation for constraint: string if (!is_null($paymentRequestID) && !is_string($paymentRequestID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentRequestID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paymentRequestID, true), gettype($paymentRequestID)), __LINE__); } $this->PaymentRequestID = $paymentRequestID; return $this; @@ -1450,7 +1451,7 @@ public function setBinEligibility($binEligibility = null) { // validation for constraint: string if (!is_null($binEligibility) && !is_string($binEligibility)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($binEligibility)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($binEligibility, true), gettype($binEligibility)), __LINE__); } $this->BinEligibility = $binEligibility; return $this; @@ -1472,7 +1473,7 @@ public function setSoftDescriptor($softDescriptor = null) { // validation for constraint: string if (!is_null($softDescriptor) && !is_string($softDescriptor)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptor)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptor, true), gettype($softDescriptor)), __LINE__); } $this->SoftDescriptor = $softDescriptor; return $this; @@ -1494,7 +1495,7 @@ public function setSoftDescriptorCity($softDescriptorCity = null) { // validation for constraint: string if (!is_null($softDescriptorCity) && !is_string($softDescriptorCity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($softDescriptorCity)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($softDescriptorCity, true), gettype($softDescriptorCity)), __LINE__); } $this->SoftDescriptorCity = $softDescriptorCity; return $this; diff --git a/src/StructType/PaymentItemInfoType.php b/src/StructType/PaymentItemInfoType.php index 34fa8ae..4c9968b 100644 --- a/src/StructType/PaymentItemInfoType.php +++ b/src/StructType/PaymentItemInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for PaymentItemInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentItemInfoType Information about a PayPal item. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class PaymentItemInfoType extends AbstractStructBase { /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Invoice number you set in the original transaction. Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class PaymentItemInfoType extends AbstractStructBase public $InvoiceID; /** * The Custom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Custom field you set in the original transaction. Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -31,7 +31,7 @@ class PaymentItemInfoType extends AbstractStructBase public $Custom; /** * The Memo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Memo entered by your customer in PayPal Website Payments note field. Character length and limitations: 255 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -39,7 +39,7 @@ class PaymentItemInfoType extends AbstractStructBase public $Memo; /** * The SalesTax - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of tax charged on transaction * - minOccurs: 0 * @var string @@ -47,7 +47,7 @@ class PaymentItemInfoType extends AbstractStructBase public $SalesTax; /** * The PaymentItem - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about the indivudal purchased item * - maxOccurs: unbounded * - minOccurs: 0 @@ -56,7 +56,7 @@ class PaymentItemInfoType extends AbstractStructBase public $PaymentItem; /** * The Subscription - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the transaction if it was created via PayPal Subcriptions * - minOccurs: 0 * @var \PayPal\StructType\SubscriptionInfoType @@ -64,7 +64,7 @@ class PaymentItemInfoType extends AbstractStructBase public $Subscription; /** * The Auction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the transaction if it was created via an auction * - minOccurs: 0 * @var \PayPal\StructType\AuctionInfoType @@ -115,7 +115,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; @@ -137,7 +137,7 @@ public function setCustom($custom = null) { // validation for constraint: string if (!is_null($custom) && !is_string($custom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($custom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); } $this->Custom = $custom; return $this; @@ -159,7 +159,7 @@ public function setMemo($memo = null) { // validation for constraint: string if (!is_null($memo) && !is_string($memo)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($memo)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($memo, true), gettype($memo)), __LINE__); } $this->Memo = $memo; return $this; @@ -181,7 +181,7 @@ public function setSalesTax($salesTax = null) { // validation for constraint: string if (!is_null($salesTax) && !is_string($salesTax)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($salesTax)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($salesTax, true), gettype($salesTax)), __LINE__); } $this->SalesTax = $salesTax; return $this; @@ -194,6 +194,28 @@ public function getPaymentItem() { return $this->PaymentItem; } + /** + * This method is responsible for validating the values passed to the setPaymentItem method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentItem method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentItemForArrayConstraintsFromSetPaymentItem(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $paymentItemInfoTypePaymentItemItem) { + // validation for constraint: itemType + if (!$paymentItemInfoTypePaymentItemItem instanceof \PayPal\StructType\PaymentItemType) { + $invalidValues[] = is_object($paymentItemInfoTypePaymentItemItem) ? get_class($paymentItemInfoTypePaymentItemItem) : sprintf('%s(%s)', gettype($paymentItemInfoTypePaymentItemItem), var_export($paymentItemInfoTypePaymentItemItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The PaymentItem property can only contain items of type \PayPal\StructType\PaymentItemType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentItem value * @throws \InvalidArgumentException @@ -202,11 +224,9 @@ public function getPaymentItem() */ public function setPaymentItem(array $paymentItem = array()) { - foreach ($paymentItem as $paymentItemInfoTypePaymentItemItem) { - // validation for constraint: itemType - if (!$paymentItemInfoTypePaymentItemItem instanceof \PayPal\StructType\PaymentItemType) { - throw new \InvalidArgumentException(sprintf('The PaymentItem property can only contain items of \PayPal\StructType\PaymentItemType, "%s" given', is_object($paymentItemInfoTypePaymentItemItem) ? get_class($paymentItemInfoTypePaymentItemItem) : gettype($paymentItemInfoTypePaymentItemItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentItemArrayErrorMessage = self::validatePaymentItemForArrayConstraintsFromSetPaymentItem($paymentItem))) { + throw new \InvalidArgumentException($paymentItemArrayErrorMessage, __LINE__); } $this->PaymentItem = $paymentItem; return $this; @@ -221,7 +241,7 @@ public function addToPaymentItem(\PayPal\StructType\PaymentItemType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentItemType) { - throw new \InvalidArgumentException(sprintf('The PaymentItem property can only contain items of \PayPal\StructType\PaymentItemType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The PaymentItem property can only contain items of type \PayPal\StructType\PaymentItemType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->PaymentItem[] = $item; return $this; diff --git a/src/StructType/PaymentItemType.php b/src/StructType/PaymentItemType.php index 659433f..ca8bcbb 100644 --- a/src/StructType/PaymentItemType.php +++ b/src/StructType/PaymentItemType.php @@ -6,7 +6,7 @@ /** * This class stands for PaymentItemType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentItemType Information about a Payment Item. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class PaymentItemType extends AbstractStructBase { /** * The EbayItemTxnId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: eBay Auction Transaction ID of the Item Optional Character length and limitations: 255 single-byte characters * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class PaymentItemType extends AbstractStructBase public $EbayItemTxnId; /** * The Name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item name set by you or entered by the customer. Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -31,7 +31,7 @@ class PaymentItemType extends AbstractStructBase public $Name; /** * The Number - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item number set by you. Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -39,7 +39,7 @@ class PaymentItemType extends AbstractStructBase public $Number; /** * The Quantity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Quantity set by you or entered by the customer. Character length and limitations: no limit * - minOccurs: 0 * @var string @@ -47,7 +47,7 @@ class PaymentItemType extends AbstractStructBase public $Quantity; /** * The SalesTax - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of tax charged on payment * - minOccurs: 0 * @var string @@ -55,7 +55,7 @@ class PaymentItemType extends AbstractStructBase public $SalesTax; /** * The ShippingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of shipping charged on payment * - minOccurs: 0 * @var string @@ -63,7 +63,7 @@ class PaymentItemType extends AbstractStructBase public $ShippingAmount; /** * The HandlingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of handling charged on payment * - minOccurs: 0 * @var string @@ -71,7 +71,7 @@ class PaymentItemType extends AbstractStructBase public $HandlingAmount; /** * The InvoiceItemDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Invoice item details * - minOccurs: 0 * @var \PayPal\StructType\InvoiceItemType @@ -79,7 +79,7 @@ class PaymentItemType extends AbstractStructBase public $InvoiceItemDetails; /** * The CouponID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Coupon ID Number * - minOccurs: 0 * @var string @@ -87,7 +87,7 @@ class PaymentItemType extends AbstractStructBase public $CouponID; /** * The CouponAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount Value of The Coupon * - minOccurs: 0 * @var string @@ -95,7 +95,7 @@ class PaymentItemType extends AbstractStructBase public $CouponAmount; /** * The CouponAmountCurrency - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Currency of the Coupon Amount * - minOccurs: 0 * @var string @@ -103,7 +103,7 @@ class PaymentItemType extends AbstractStructBase public $CouponAmountCurrency; /** * The LoyaltyCardDiscountAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of Discount on this Loyalty Card * - minOccurs: 0 * @var string @@ -111,7 +111,7 @@ class PaymentItemType extends AbstractStructBase public $LoyaltyCardDiscountAmount; /** * The LoyaltyCardDiscountCurrency - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Currency of the Discount * - minOccurs: 0 * @var string @@ -119,7 +119,7 @@ class PaymentItemType extends AbstractStructBase public $LoyaltyCardDiscountCurrency; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Cost of item * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -127,7 +127,7 @@ class PaymentItemType extends AbstractStructBase public $Amount; /** * The Options - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item options selected in PayPal shopping cart * - maxOccurs: unbounded * - minOccurs: 0 @@ -203,7 +203,7 @@ public function setEbayItemTxnId($ebayItemTxnId = null) { // validation for constraint: string if (!is_null($ebayItemTxnId) && !is_string($ebayItemTxnId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($ebayItemTxnId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($ebayItemTxnId, true), gettype($ebayItemTxnId)), __LINE__); } $this->EbayItemTxnId = $ebayItemTxnId; return $this; @@ -225,7 +225,7 @@ public function setName($name = null) { // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); } $this->Name = $name; return $this; @@ -247,7 +247,7 @@ public function setNumber($number = null) { // validation for constraint: string if (!is_null($number) && !is_string($number)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($number)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($number, true), gettype($number)), __LINE__); } $this->Number = $number; return $this; @@ -269,7 +269,7 @@ public function setQuantity($quantity = null) { // validation for constraint: string if (!is_null($quantity) && !is_string($quantity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($quantity)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($quantity, true), gettype($quantity)), __LINE__); } $this->Quantity = $quantity; return $this; @@ -291,7 +291,7 @@ public function setSalesTax($salesTax = null) { // validation for constraint: string if (!is_null($salesTax) && !is_string($salesTax)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($salesTax)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($salesTax, true), gettype($salesTax)), __LINE__); } $this->SalesTax = $salesTax; return $this; @@ -313,7 +313,7 @@ public function setShippingAmount($shippingAmount = null) { // validation for constraint: string if (!is_null($shippingAmount) && !is_string($shippingAmount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingAmount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingAmount, true), gettype($shippingAmount)), __LINE__); } $this->ShippingAmount = $shippingAmount; return $this; @@ -335,7 +335,7 @@ public function setHandlingAmount($handlingAmount = null) { // validation for constraint: string if (!is_null($handlingAmount) && !is_string($handlingAmount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($handlingAmount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($handlingAmount, true), gettype($handlingAmount)), __LINE__); } $this->HandlingAmount = $handlingAmount; return $this; @@ -375,7 +375,7 @@ public function setCouponID($couponID = null) { // validation for constraint: string if (!is_null($couponID) && !is_string($couponID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($couponID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($couponID, true), gettype($couponID)), __LINE__); } $this->CouponID = $couponID; return $this; @@ -397,7 +397,7 @@ public function setCouponAmount($couponAmount = null) { // validation for constraint: string if (!is_null($couponAmount) && !is_string($couponAmount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($couponAmount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($couponAmount, true), gettype($couponAmount)), __LINE__); } $this->CouponAmount = $couponAmount; return $this; @@ -419,7 +419,7 @@ public function setCouponAmountCurrency($couponAmountCurrency = null) { // validation for constraint: string if (!is_null($couponAmountCurrency) && !is_string($couponAmountCurrency)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($couponAmountCurrency)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($couponAmountCurrency, true), gettype($couponAmountCurrency)), __LINE__); } $this->CouponAmountCurrency = $couponAmountCurrency; return $this; @@ -441,7 +441,7 @@ public function setLoyaltyCardDiscountAmount($loyaltyCardDiscountAmount = null) { // validation for constraint: string if (!is_null($loyaltyCardDiscountAmount) && !is_string($loyaltyCardDiscountAmount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($loyaltyCardDiscountAmount)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($loyaltyCardDiscountAmount, true), gettype($loyaltyCardDiscountAmount)), __LINE__); } $this->LoyaltyCardDiscountAmount = $loyaltyCardDiscountAmount; return $this; @@ -463,7 +463,7 @@ public function setLoyaltyCardDiscountCurrency($loyaltyCardDiscountCurrency = nu { // validation for constraint: string if (!is_null($loyaltyCardDiscountCurrency) && !is_string($loyaltyCardDiscountCurrency)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($loyaltyCardDiscountCurrency)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($loyaltyCardDiscountCurrency, true), gettype($loyaltyCardDiscountCurrency)), __LINE__); } $this->LoyaltyCardDiscountCurrency = $loyaltyCardDiscountCurrency; return $this; @@ -494,6 +494,28 @@ public function getOptions() { return $this->Options; } + /** + * This method is responsible for validating the values passed to the setOptions method + * This method is willingly generated in order to preserve the one-line inline validation within the setOptions method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateOptionsForArrayConstraintsFromSetOptions(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $paymentItemTypeOptionsItem) { + // validation for constraint: itemType + if (!$paymentItemTypeOptionsItem instanceof \PayPal\StructType\OptionType) { + $invalidValues[] = is_object($paymentItemTypeOptionsItem) ? get_class($paymentItemTypeOptionsItem) : sprintf('%s(%s)', gettype($paymentItemTypeOptionsItem), var_export($paymentItemTypeOptionsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Options property can only contain items of type \PayPal\StructType\OptionType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Options value * @throws \InvalidArgumentException @@ -502,11 +524,9 @@ public function getOptions() */ public function setOptions(array $options = array()) { - foreach ($options as $paymentItemTypeOptionsItem) { - // validation for constraint: itemType - if (!$paymentItemTypeOptionsItem instanceof \PayPal\StructType\OptionType) { - throw new \InvalidArgumentException(sprintf('The Options property can only contain items of \PayPal\StructType\OptionType, "%s" given', is_object($paymentItemTypeOptionsItem) ? get_class($paymentItemTypeOptionsItem) : gettype($paymentItemTypeOptionsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($optionsArrayErrorMessage = self::validateOptionsForArrayConstraintsFromSetOptions($options))) { + throw new \InvalidArgumentException($optionsArrayErrorMessage, __LINE__); } $this->Options = $options; return $this; @@ -521,7 +541,7 @@ public function addToOptions(\PayPal\StructType\OptionType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\OptionType) { - throw new \InvalidArgumentException(sprintf('The Options property can only contain items of \PayPal\StructType\OptionType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Options property can only contain items of type \PayPal\StructType\OptionType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Options[] = $item; return $this; diff --git a/src/StructType/PaymentMeansType.php b/src/StructType/PaymentMeansType.php index 8e67970..4e7c79c 100644 --- a/src/StructType/PaymentMeansType.php +++ b/src/StructType/PaymentMeansType.php @@ -46,7 +46,7 @@ public function setTypeCodeID($typeCodeID = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SellerPaymentMethodCodeType::valueIsValid($typeCodeID)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $typeCodeID, implode(', ', \PayPal\EnumType\SellerPaymentMethodCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SellerPaymentMethodCodeType', is_array($typeCodeID) ? implode(', ', $typeCodeID) : var_export($typeCodeID, true), implode(', ', \PayPal\EnumType\SellerPaymentMethodCodeType::getValidValues())), __LINE__); } $this->TypeCodeID = $typeCodeID; return $this; diff --git a/src/StructType/PaymentRequestInfoType.php b/src/StructType/PaymentRequestInfoType.php index ac8d0c3..84e4641 100644 --- a/src/StructType/PaymentRequestInfoType.php +++ b/src/StructType/PaymentRequestInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for PaymentRequestInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains payment request information for each bucket in the cart. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class PaymentRequestInfoType extends AbstractStructBase { /** * The TransactionId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains the transaction id of the bucket. * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class PaymentRequestInfoType extends AbstractStructBase public $TransactionId; /** * The PaymentRequestID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains the bucket id. * - maxOccurs: 1 * - minOccurs: 0 @@ -33,7 +33,7 @@ class PaymentRequestInfoType extends AbstractStructBase public $PaymentRequestID; /** * The PaymentError - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains the error details. * - maxOccurs: 1 * - minOccurs: 0 @@ -73,7 +73,7 @@ public function setTransactionId($transactionId = null) { // validation for constraint: string if (!is_null($transactionId) && !is_string($transactionId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionId, true), gettype($transactionId)), __LINE__); } $this->TransactionId = $transactionId; return $this; @@ -95,7 +95,7 @@ public function setPaymentRequestID($paymentRequestID = null) { // validation for constraint: string if (!is_null($paymentRequestID) && !is_string($paymentRequestID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentRequestID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paymentRequestID, true), gettype($paymentRequestID)), __LINE__); } $this->PaymentRequestID = $paymentRequestID; return $this; diff --git a/src/StructType/PaymentTransactionSearchResultType.php b/src/StructType/PaymentTransactionSearchResultType.php index 5abd4bb..08b011d 100644 --- a/src/StructType/PaymentTransactionSearchResultType.php +++ b/src/StructType/PaymentTransactionSearchResultType.php @@ -6,8 +6,8 @@ /** * This class stands for PaymentTransactionSearchResultType StructType - * Meta informations extracted from the WSDL - * - documentation: PaymentTransactionSearchResultType Results from a PaymentTransaction search | The transaction ID of the seller + * Meta information extracted from the WSDL + * - documentation: The transaction ID of the seller | PaymentTransactionSearchResultType Results from a PaymentTransaction search * @subpackage Structs * @author WsdlToPhp */ @@ -15,70 +15,71 @@ class PaymentTransactionSearchResultType extends AbstractStructBase { /** * The Timestamp - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The date and time (in UTC/GMT format) the transaction occurred * @var string */ public $Timestamp; /** * The Timezone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The time zone of the transaction * @var string */ public $Timezone; /** * The Type - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The type of the transaction * @var string */ public $Type; /** * The Payer - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The email address of the payer + * - base: xs:string * @var string */ public $Payer; /** * The PayerDisplayName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Display name of the payer * @var string */ public $PayerDisplayName; /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:TransactionID * @var string */ public $TransactionID; /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The status of the transaction * @var string */ public $Status; /** * The GrossAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The total gross amount charged, including any profile shipping cost and taxes * @var \PayPal\StructType\BasicAmountType */ public $GrossAmount; /** * The FeeAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The fee that PayPal charged for the transaction * @var \PayPal\StructType\BasicAmountType */ public $FeeAmount; /** * The NetAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The net amount of the transaction * @var \PayPal\StructType\BasicAmountType */ @@ -137,7 +138,7 @@ public function setTimestamp($timestamp = null) { // validation for constraint: string if (!is_null($timestamp) && !is_string($timestamp)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($timestamp)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($timestamp, true), gettype($timestamp)), __LINE__); } $this->Timestamp = $timestamp; return $this; @@ -159,7 +160,7 @@ public function setTimezone($timezone = null) { // validation for constraint: string if (!is_null($timezone) && !is_string($timezone)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($timezone)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($timezone, true), gettype($timezone)), __LINE__); } $this->Timezone = $timezone; return $this; @@ -181,7 +182,7 @@ public function setType($type = null) { // validation for constraint: string if (!is_null($type) && !is_string($type)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($type)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($type, true), gettype($type)), __LINE__); } $this->Type = $type; return $this; @@ -203,7 +204,7 @@ public function setPayer($payer = null) { // validation for constraint: string if (!is_null($payer) && !is_string($payer)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payer)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payer, true), gettype($payer)), __LINE__); } $this->Payer = $payer; return $this; @@ -225,7 +226,7 @@ public function setPayerDisplayName($payerDisplayName = null) { // validation for constraint: string if (!is_null($payerDisplayName) && !is_string($payerDisplayName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payerDisplayName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payerDisplayName, true), gettype($payerDisplayName)), __LINE__); } $this->PayerDisplayName = $payerDisplayName; return $this; @@ -247,7 +248,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -269,7 +270,7 @@ public function setStatus($status = null) { // validation for constraint: string if (!is_null($status) && !is_string($status)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($status)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($status, true), gettype($status)), __LINE__); } $this->Status = $status; return $this; diff --git a/src/StructType/PaymentTransactionType.php b/src/StructType/PaymentTransactionType.php index a93c1e5..af31b48 100644 --- a/src/StructType/PaymentTransactionType.php +++ b/src/StructType/PaymentTransactionType.php @@ -6,7 +6,7 @@ /** * This class stands for PaymentTransactionType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: PaymentTransactionType Information about a PayPal payment from the seller side * @subpackage Structs * @author WsdlToPhp @@ -15,21 +15,21 @@ class PaymentTransactionType extends AbstractStructBase { /** * The ReceiverInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the recipient of the payment * @var \PayPal\StructType\ReceiverInfoType */ public $ReceiverInfo; /** * The PayerInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the payer * @var \PayPal\StructType\PayerInfoType */ public $PayerInfo; /** * The TPLReferenceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This field is for holding ReferenceId for shippment sent from Merchant to the 3rd Party * - maxOccurs: 1 * - minOccurs: 0 @@ -38,14 +38,14 @@ class PaymentTransactionType extends AbstractStructBase public $TPLReferenceID; /** * The PaymentInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the transaction * @var \PayPal\StructType\PaymentInfoType */ public $PaymentInfo; /** * The PaymentItemInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about an individual item in the transaction * - minOccurs: 0 * @var \PayPal\StructType\PaymentItemInfoType @@ -53,7 +53,7 @@ class PaymentTransactionType extends AbstractStructBase public $PaymentItemInfo; /** * The OfferCouponInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about an individual Offer and Coupon information in the transaction * - minOccurs: 0 * @var \PayPal\StructType\OfferCouponInfoType @@ -61,7 +61,7 @@ class PaymentTransactionType extends AbstractStructBase public $OfferCouponInfo; /** * The SecondaryAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about Secondary Address * - minOccurs: 0 * @var \PayPal\StructType\AddressType @@ -69,7 +69,7 @@ class PaymentTransactionType extends AbstractStructBase public $SecondaryAddress; /** * The UserSelectedOptions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the user selected options. * - maxOccurs: 1 * - minOccurs: 0 @@ -78,7 +78,7 @@ class PaymentTransactionType extends AbstractStructBase public $UserSelectedOptions; /** * The GiftMessage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift message. * - maxOccurs: 1 * - minOccurs: 0 @@ -87,7 +87,7 @@ class PaymentTransactionType extends AbstractStructBase public $GiftMessage; /** * The GiftReceipt - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift receipt. * - maxOccurs: 1 * - minOccurs: 0 @@ -96,7 +96,7 @@ class PaymentTransactionType extends AbstractStructBase public $GiftReceipt; /** * The GiftWrapName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift Wrap name. * - maxOccurs: 1 * - minOccurs: 0 @@ -105,7 +105,7 @@ class PaymentTransactionType extends AbstractStructBase public $GiftWrapName; /** * The GiftWrapAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift Wrap amount. * - maxOccurs: 1 * - minOccurs: 0 @@ -114,7 +114,7 @@ class PaymentTransactionType extends AbstractStructBase public $GiftWrapAmount; /** * The BuyerEmailOptIn - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Buyer email. * - maxOccurs: 1 * - minOccurs: 0 @@ -123,7 +123,7 @@ class PaymentTransactionType extends AbstractStructBase public $BuyerEmailOptIn; /** * The SurveyQuestion - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the survey question. * - maxOccurs: 1 * - minOccurs: 0 @@ -132,7 +132,7 @@ class PaymentTransactionType extends AbstractStructBase public $SurveyQuestion; /** * The SurveyChoiceSelected - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the survey choice selected by the user. * - maxOccurs: unbounded * - minOccurs: 0 @@ -244,7 +244,7 @@ public function setTPLReferenceID($tPLReferenceID = null) { // validation for constraint: string if (!is_null($tPLReferenceID) && !is_string($tPLReferenceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($tPLReferenceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($tPLReferenceID, true), gettype($tPLReferenceID)), __LINE__); } $this->TPLReferenceID = $tPLReferenceID; return $this; @@ -356,7 +356,7 @@ public function setGiftMessage($giftMessage = null) { // validation for constraint: string if (!is_null($giftMessage) && !is_string($giftMessage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftMessage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftMessage, true), gettype($giftMessage)), __LINE__); } $this->GiftMessage = $giftMessage; return $this; @@ -378,7 +378,7 @@ public function setGiftReceipt($giftReceipt = null) { // validation for constraint: string if (!is_null($giftReceipt) && !is_string($giftReceipt)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftReceipt)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftReceipt, true), gettype($giftReceipt)), __LINE__); } $this->GiftReceipt = $giftReceipt; return $this; @@ -400,7 +400,7 @@ public function setGiftWrapName($giftWrapName = null) { // validation for constraint: string if (!is_null($giftWrapName) && !is_string($giftWrapName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftWrapName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftWrapName, true), gettype($giftWrapName)), __LINE__); } $this->GiftWrapName = $giftWrapName; return $this; @@ -440,7 +440,7 @@ public function setBuyerEmailOptIn($buyerEmailOptIn = null) { // validation for constraint: string if (!is_null($buyerEmailOptIn) && !is_string($buyerEmailOptIn)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerEmailOptIn)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerEmailOptIn, true), gettype($buyerEmailOptIn)), __LINE__); } $this->BuyerEmailOptIn = $buyerEmailOptIn; return $this; @@ -462,7 +462,7 @@ public function setSurveyQuestion($surveyQuestion = null) { // validation for constraint: string if (!is_null($surveyQuestion) && !is_string($surveyQuestion)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($surveyQuestion)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($surveyQuestion, true), gettype($surveyQuestion)), __LINE__); } $this->SurveyQuestion = $surveyQuestion; return $this; @@ -475,6 +475,28 @@ public function getSurveyChoiceSelected() { return $this->SurveyChoiceSelected; } + /** + * This method is responsible for validating the values passed to the setSurveyChoiceSelected method + * This method is willingly generated in order to preserve the one-line inline validation within the setSurveyChoiceSelected method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateSurveyChoiceSelectedForArrayConstraintsFromSetSurveyChoiceSelected(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $paymentTransactionTypeSurveyChoiceSelectedItem) { + // validation for constraint: itemType + if (!is_string($paymentTransactionTypeSurveyChoiceSelectedItem)) { + $invalidValues[] = is_object($paymentTransactionTypeSurveyChoiceSelectedItem) ? get_class($paymentTransactionTypeSurveyChoiceSelectedItem) : sprintf('%s(%s)', gettype($paymentTransactionTypeSurveyChoiceSelectedItem), var_export($paymentTransactionTypeSurveyChoiceSelectedItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set SurveyChoiceSelected value * @throws \InvalidArgumentException @@ -483,11 +505,9 @@ public function getSurveyChoiceSelected() */ public function setSurveyChoiceSelected(array $surveyChoiceSelected = array()) { - foreach ($surveyChoiceSelected as $paymentTransactionTypeSurveyChoiceSelectedItem) { - // validation for constraint: itemType - if (!is_string($paymentTransactionTypeSurveyChoiceSelectedItem)) { - throw new \InvalidArgumentException(sprintf('The SurveyChoiceSelected property can only contain items of string, "%s" given', is_object($paymentTransactionTypeSurveyChoiceSelectedItem) ? get_class($paymentTransactionTypeSurveyChoiceSelectedItem) : gettype($paymentTransactionTypeSurveyChoiceSelectedItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($surveyChoiceSelectedArrayErrorMessage = self::validateSurveyChoiceSelectedForArrayConstraintsFromSetSurveyChoiceSelected($surveyChoiceSelected))) { + throw new \InvalidArgumentException($surveyChoiceSelectedArrayErrorMessage, __LINE__); } $this->SurveyChoiceSelected = $surveyChoiceSelected; return $this; @@ -502,7 +522,7 @@ public function addToSurveyChoiceSelected($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The SurveyChoiceSelected property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); } $this->SurveyChoiceSelected[] = $item; return $this; diff --git a/src/StructType/PaymentType.php b/src/StructType/PaymentType.php index ecabe10..4c4a581 100644 --- a/src/StructType/PaymentType.php +++ b/src/StructType/PaymentType.php @@ -6,7 +6,7 @@ /** * This class stands for PaymentType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - type: ns:PaymentType * @subpackage Structs * @author WsdlToPhp diff --git a/src/StructType/PersonNameType.php b/src/StructType/PersonNameType.php index 9e83709..e08ed20 100644 --- a/src/StructType/PersonNameType.php +++ b/src/StructType/PersonNameType.php @@ -13,41 +13,46 @@ class PersonNameType extends AbstractStructBase { /** * The Salutation - * Meta informations extracted from the WSDL - * - minOccurs: 0 + * Meta information extracted from the WSDL + * - base: xs:string * - maxLength: 20 + * - minOccurs: 0 * @var string */ public $Salutation; /** * The FirstName - * Meta informations extracted from the WSDL - * - minOccurs: 0 + * Meta information extracted from the WSDL + * - base: xs:string * - maxLength: 25 + * - minOccurs: 0 * @var string */ public $FirstName; /** * The MiddleName - * Meta informations extracted from the WSDL - * - minOccurs: 0 + * Meta information extracted from the WSDL + * - base: xs:string * - maxLength: 25 + * - minOccurs: 0 * @var string */ public $MiddleName; /** * The LastName - * Meta informations extracted from the WSDL - * - minOccurs: 0 + * Meta information extracted from the WSDL + * - base: xs:string * - maxLength: 25 + * - minOccurs: 0 * @var string */ public $LastName; /** * The Suffix - * Meta informations extracted from the WSDL - * - minOccurs: 0 + * Meta information extracted from the WSDL + * - base: xs:string * - maxLength: 12 + * - minOccurs: 0 * @var string */ public $Suffix; @@ -88,13 +93,13 @@ public function getSalutation() */ public function setSalutation($salutation = null) { - // validation for constraint: maxLength - if ((is_scalar($salutation) && strlen($salutation) > 20) || (is_array($salutation) && count($salutation) > 20)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 20 element(s) or a scalar of 20 character(s) at most, "%d" length given', is_scalar($salutation) ? strlen($salutation) : count($salutation)), __LINE__); - } // validation for constraint: string if (!is_null($salutation) && !is_string($salutation)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($salutation)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($salutation, true), gettype($salutation)), __LINE__); + } + // validation for constraint: maxLength(20) + if (!is_null($salutation) && mb_strlen($salutation) > 20) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 20', mb_strlen($salutation)), __LINE__); } $this->Salutation = $salutation; return $this; @@ -114,13 +119,13 @@ public function getFirstName() */ public function setFirstName($firstName = null) { - // validation for constraint: maxLength - if ((is_scalar($firstName) && strlen($firstName) > 25) || (is_array($firstName) && count($firstName) > 25)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 25 element(s) or a scalar of 25 character(s) at most, "%d" length given', is_scalar($firstName) ? strlen($firstName) : count($firstName)), __LINE__); - } // validation for constraint: string if (!is_null($firstName) && !is_string($firstName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($firstName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($firstName, true), gettype($firstName)), __LINE__); + } + // validation for constraint: maxLength(25) + if (!is_null($firstName) && mb_strlen($firstName) > 25) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 25', mb_strlen($firstName)), __LINE__); } $this->FirstName = $firstName; return $this; @@ -140,13 +145,13 @@ public function getMiddleName() */ public function setMiddleName($middleName = null) { - // validation for constraint: maxLength - if ((is_scalar($middleName) && strlen($middleName) > 25) || (is_array($middleName) && count($middleName) > 25)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 25 element(s) or a scalar of 25 character(s) at most, "%d" length given', is_scalar($middleName) ? strlen($middleName) : count($middleName)), __LINE__); - } // validation for constraint: string if (!is_null($middleName) && !is_string($middleName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($middleName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($middleName, true), gettype($middleName)), __LINE__); + } + // validation for constraint: maxLength(25) + if (!is_null($middleName) && mb_strlen($middleName) > 25) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 25', mb_strlen($middleName)), __LINE__); } $this->MiddleName = $middleName; return $this; @@ -166,13 +171,13 @@ public function getLastName() */ public function setLastName($lastName = null) { - // validation for constraint: maxLength - if ((is_scalar($lastName) && strlen($lastName) > 25) || (is_array($lastName) && count($lastName) > 25)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 25 element(s) or a scalar of 25 character(s) at most, "%d" length given', is_scalar($lastName) ? strlen($lastName) : count($lastName)), __LINE__); - } // validation for constraint: string if (!is_null($lastName) && !is_string($lastName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastName, true), gettype($lastName)), __LINE__); + } + // validation for constraint: maxLength(25) + if (!is_null($lastName) && mb_strlen($lastName) > 25) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 25', mb_strlen($lastName)), __LINE__); } $this->LastName = $lastName; return $this; @@ -192,13 +197,13 @@ public function getSuffix() */ public function setSuffix($suffix = null) { - // validation for constraint: maxLength - if ((is_scalar($suffix) && strlen($suffix) > 12) || (is_array($suffix) && count($suffix) > 12)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 12 element(s) or a scalar of 12 character(s) at most, "%d" length given', is_scalar($suffix) ? strlen($suffix) : count($suffix)), __LINE__); - } // validation for constraint: string if (!is_null($suffix) && !is_string($suffix)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($suffix)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($suffix, true), gettype($suffix)), __LINE__); + } + // validation for constraint: maxLength(12) + if (!is_null($suffix) && mb_strlen($suffix) > 12) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 12', mb_strlen($suffix)), __LINE__); } $this->Suffix = $suffix; return $this; diff --git a/src/StructType/PhoneNumberType.php b/src/StructType/PhoneNumberType.php index bbaef93..5555e05 100644 --- a/src/StructType/PhoneNumberType.php +++ b/src/StructType/PhoneNumberType.php @@ -13,7 +13,7 @@ class PhoneNumberType extends AbstractStructBase { /** * The CountryCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Country code associated with this phone number. * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class PhoneNumberType extends AbstractStructBase public $CountryCode; /** * The PhoneNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Phone number associated with this phone. * - minOccurs: 0 * @var string @@ -29,7 +29,7 @@ class PhoneNumberType extends AbstractStructBase public $PhoneNumber; /** * The Extension - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Extension associated with this phone number. * - minOccurs: 0 * @var string @@ -68,7 +68,7 @@ public function setCountryCode($countryCode = null) { // validation for constraint: string if (!is_null($countryCode) && !is_string($countryCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($countryCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($countryCode, true), gettype($countryCode)), __LINE__); } $this->CountryCode = $countryCode; return $this; @@ -90,7 +90,7 @@ public function setPhoneNumber($phoneNumber = null) { // validation for constraint: string if (!is_null($phoneNumber) && !is_string($phoneNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($phoneNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($phoneNumber, true), gettype($phoneNumber)), __LINE__); } $this->PhoneNumber = $phoneNumber; return $this; @@ -112,7 +112,7 @@ public function setExtension($extension = null) { // validation for constraint: string if (!is_null($extension) && !is_string($extension)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($extension)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($extension, true), gettype($extension)), __LINE__); } $this->Extension = $extension; return $this; diff --git a/src/StructType/PromotedItemType.php b/src/StructType/PromotedItemType.php index 7f63135..3d8fa29 100644 --- a/src/StructType/PromotedItemType.php +++ b/src/StructType/PromotedItemType.php @@ -6,7 +6,7 @@ /** * This class stands for PromotedItemType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchandizing info for an Item. This contains a list of crosssell or upsell items. * @subpackage Structs * @author WsdlToPhp @@ -15,15 +15,16 @@ class PromotedItemType extends AbstractStructBase { /** * The ItemID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item ID for the base item. Based on this item other items are promoted. it is teh only tag that would show up in all calls that use promoted item type. some are not in soap yet, such as get and ser promotion rules | Represents the * unique identifier for an item. To be used to specify the elements that represents an ItemID. + * - base: xs:string * @var string */ public $ItemID; /** * The PictureURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL for the picture of the promoted item. * - minOccurs: 0 * @var string @@ -31,7 +32,7 @@ class PromotedItemType extends AbstractStructBase public $PictureURL; /** * The position - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Where to display in the list of items.currentl y even forget and set does not have to be minoccur =0 but if we ever were to do revise promotion tems, it can be omitted * - minOccurs: 0 * @var int @@ -39,7 +40,7 @@ class PromotedItemType extends AbstractStructBase public $position; /** * The PromotionPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Promotion Price. Price at which the buyer can buy the item now. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -47,21 +48,21 @@ class PromotedItemType extends AbstractStructBase public $PromotionPrice; /** * The PromotionPriceType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $PromotionPriceType; /** * The SelectionType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $SelectionType; /** * The Title - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item Title for the promoted item. * - minOccurs: 0 * @var string @@ -69,7 +70,7 @@ class PromotedItemType extends AbstractStructBase public $Title; /** * The ListingType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -122,7 +123,7 @@ public function setItemID($itemID = null) { // validation for constraint: string if (!is_null($itemID) && !is_string($itemID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemID, true), gettype($itemID)), __LINE__); } $this->ItemID = $itemID; return $this; @@ -144,7 +145,7 @@ public function setPictureURL($pictureURL = null) { // validation for constraint: string if (!is_null($pictureURL) && !is_string($pictureURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pictureURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pictureURL, true), gettype($pictureURL)), __LINE__); } $this->PictureURL = $pictureURL; return $this; @@ -165,8 +166,8 @@ public function getPosition() public function setPosition($position = null) { // validation for constraint: int - if (!is_null($position) && !is_numeric($position)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($position)), __LINE__); + if (!is_null($position) && !(is_int($position) || ctype_digit($position))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($position, true), gettype($position)), __LINE__); } $this->position = $position; return $this; @@ -209,7 +210,7 @@ public function setPromotionPriceType($promotionPriceType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PromotionItemPriceTypeCodeType::valueIsValid($promotionPriceType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $promotionPriceType, implode(', ', \PayPal\EnumType\PromotionItemPriceTypeCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PromotionItemPriceTypeCodeType', is_array($promotionPriceType) ? implode(', ', $promotionPriceType) : var_export($promotionPriceType, true), implode(', ', \PayPal\EnumType\PromotionItemPriceTypeCodeType::getValidValues())), __LINE__); } $this->PromotionPriceType = $promotionPriceType; return $this; @@ -234,7 +235,7 @@ public function setSelectionType($selectionType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PromotionItemSelectionCodeType::valueIsValid($selectionType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $selectionType, implode(', ', \PayPal\EnumType\PromotionItemSelectionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PromotionItemSelectionCodeType', is_array($selectionType) ? implode(', ', $selectionType) : var_export($selectionType, true), implode(', ', \PayPal\EnumType\PromotionItemSelectionCodeType::getValidValues())), __LINE__); } $this->SelectionType = $selectionType; return $this; @@ -256,7 +257,7 @@ public function setTitle($title = null) { // validation for constraint: string if (!is_null($title) && !is_string($title)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($title)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($title, true), gettype($title)), __LINE__); } $this->Title = $title; return $this; @@ -281,7 +282,7 @@ public function setListingType($listingType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ListingTypeCodeType::valueIsValid($listingType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $listingType, implode(', ', \PayPal\EnumType\ListingTypeCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ListingTypeCodeType', is_array($listingType) ? implode(', ', $listingType) : var_export($listingType, true), implode(', ', \PayPal\EnumType\ListingTypeCodeType::getValidValues())), __LINE__); } $this->ListingType = $listingType; return $this; diff --git a/src/StructType/QuantityType.php b/src/StructType/QuantityType.php index 3ebb97a..a9ab7ac 100644 --- a/src/StructType/QuantityType.php +++ b/src/StructType/QuantityType.php @@ -18,7 +18,7 @@ class QuantityType extends AbstractStructBase public $_; /** * The unit - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: optional * @var string */ @@ -51,6 +51,10 @@ public function get_() */ public function set_($_ = null) { + // validation for constraint: float + if (!is_null($_) && !(is_float($_) || is_numeric($_))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($_, true), gettype($_)), __LINE__); + } $this->_ = $_; return $this; } @@ -71,7 +75,7 @@ public function setUnit($unit = null) { // validation for constraint: string if (!is_null($unit) && !is_string($unit)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($unit)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($unit, true), gettype($unit)), __LINE__); } $this->unit = $unit; return $this; diff --git a/src/StructType/ReceiverInfoType.php b/src/StructType/ReceiverInfoType.php index ef96808..2e654bb 100644 --- a/src/StructType/ReceiverInfoType.php +++ b/src/StructType/ReceiverInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for ReceiverInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: ReceiverInfoType Receiver information. * @subpackage Structs * @author WsdlToPhp @@ -15,23 +15,26 @@ class ReceiverInfoType extends AbstractStructBase { /** * The Business - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Email address or account ID of the payment recipient (the seller). Equivalent to Receiver if payment is sent to primary account. Character length and limitations: 127 single-byte alphanumeric characters + * - base: xs:string * @var string */ public $Business; /** * The Receiver - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Primary email address of the payment recipient (the seller). If you are the recipient of the payment and the payment is sent to your non-primary email address, the value of Receiver is still your primary email address. Character * length and limitations: 127 single-byte alphanumeric characters + * - base: xs:string * @var string */ public $Receiver; /** * The ReceiverID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique account ID of the payment recipient (the seller). This value is the same as the value of the recipient's referral ID. + * - base: xs:string * - maxLength: 127 * @var string */ @@ -69,7 +72,7 @@ public function setBusiness($business = null) { // validation for constraint: string if (!is_null($business) && !is_string($business)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($business)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($business, true), gettype($business)), __LINE__); } $this->Business = $business; return $this; @@ -91,7 +94,7 @@ public function setReceiver($receiver = null) { // validation for constraint: string if (!is_null($receiver) && !is_string($receiver)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiver)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiver, true), gettype($receiver)), __LINE__); } $this->Receiver = $receiver; return $this; @@ -111,13 +114,13 @@ public function getReceiverID() */ public function setReceiverID($receiverID = null) { - // validation for constraint: maxLength - if ((is_scalar($receiverID) && strlen($receiverID) > 127) || (is_array($receiverID) && count($receiverID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($receiverID) ? strlen($receiverID) : count($receiverID)), __LINE__); - } // validation for constraint: string if (!is_null($receiverID) && !is_string($receiverID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiverID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiverID, true), gettype($receiverID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($receiverID) && mb_strlen($receiverID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($receiverID)), __LINE__); } $this->ReceiverID = $receiverID; return $this; diff --git a/src/StructType/RecurringPaymentsProfileDetailsType.php b/src/StructType/RecurringPaymentsProfileDetailsType.php index ff06144..ee45126 100644 --- a/src/StructType/RecurringPaymentsProfileDetailsType.php +++ b/src/StructType/RecurringPaymentsProfileDetailsType.php @@ -13,7 +13,7 @@ class RecurringPaymentsProfileDetailsType extends AbstractStructBase { /** * The BillingStartDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: When does this Profile begin billing? * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class RecurringPaymentsProfileDetailsType extends AbstractStructBase public $BillingStartDate; /** * The SubscriberName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Subscriber name - if missing, will use name in buyer's account * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class RecurringPaymentsProfileDetailsType extends AbstractStructBase public $SubscriberName; /** * The SubscriberShippingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Subscriber address - if missing, will use address in buyer's account * - maxOccurs: 1 * - minOccurs: 0 @@ -40,7 +40,7 @@ class RecurringPaymentsProfileDetailsType extends AbstractStructBase public $SubscriberShippingAddress; /** * The ProfileReference - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Your own unique invoice or tracking number. Optional Character length and limitations: 127 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -83,7 +83,7 @@ public function setBillingStartDate($billingStartDate = null) { // validation for constraint: string if (!is_null($billingStartDate) && !is_string($billingStartDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingStartDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingStartDate, true), gettype($billingStartDate)), __LINE__); } $this->BillingStartDate = $billingStartDate; return $this; @@ -105,7 +105,7 @@ public function setSubscriberName($subscriberName = null) { // validation for constraint: string if (!is_null($subscriberName) && !is_string($subscriberName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($subscriberName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subscriberName, true), gettype($subscriberName)), __LINE__); } $this->SubscriberName = $subscriberName; return $this; @@ -145,7 +145,7 @@ public function setProfileReference($profileReference = null) { // validation for constraint: string if (!is_null($profileReference) && !is_string($profileReference)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileReference)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileReference, true), gettype($profileReference)), __LINE__); } $this->ProfileReference = $profileReference; return $this; diff --git a/src/StructType/RecurringPaymentsSummaryType.php b/src/StructType/RecurringPaymentsSummaryType.php index 3e40359..4607dd3 100644 --- a/src/StructType/RecurringPaymentsSummaryType.php +++ b/src/StructType/RecurringPaymentsSummaryType.php @@ -13,7 +13,7 @@ class RecurringPaymentsSummaryType extends AbstractStructBase { /** * The NumberCyclesCompleted - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var int @@ -21,7 +21,7 @@ class RecurringPaymentsSummaryType extends AbstractStructBase public $NumberCyclesCompleted; /** * The NumberCyclesRemaining - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var int @@ -29,7 +29,7 @@ class RecurringPaymentsSummaryType extends AbstractStructBase public $NumberCyclesRemaining; /** * The OutstandingBalance - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var \PayPal\StructType\BasicAmountType @@ -37,7 +37,7 @@ class RecurringPaymentsSummaryType extends AbstractStructBase public $OutstandingBalance; /** * The FailedPaymentCount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var int @@ -45,7 +45,7 @@ class RecurringPaymentsSummaryType extends AbstractStructBase public $FailedPaymentCount; /** * The NextBillingDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -53,7 +53,7 @@ class RecurringPaymentsSummaryType extends AbstractStructBase public $NextBillingDate; /** * The LastPaymentDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -61,7 +61,7 @@ class RecurringPaymentsSummaryType extends AbstractStructBase public $LastPaymentDate; /** * The LastPaymentAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -111,8 +111,8 @@ public function getNumberCyclesCompleted() public function setNumberCyclesCompleted($numberCyclesCompleted = null) { // validation for constraint: int - if (!is_null($numberCyclesCompleted) && !is_numeric($numberCyclesCompleted)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($numberCyclesCompleted)), __LINE__); + if (!is_null($numberCyclesCompleted) && !(is_int($numberCyclesCompleted) || ctype_digit($numberCyclesCompleted))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($numberCyclesCompleted, true), gettype($numberCyclesCompleted)), __LINE__); } $this->NumberCyclesCompleted = $numberCyclesCompleted; return $this; @@ -133,8 +133,8 @@ public function getNumberCyclesRemaining() public function setNumberCyclesRemaining($numberCyclesRemaining = null) { // validation for constraint: int - if (!is_null($numberCyclesRemaining) && !is_numeric($numberCyclesRemaining)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($numberCyclesRemaining)), __LINE__); + if (!is_null($numberCyclesRemaining) && !(is_int($numberCyclesRemaining) || ctype_digit($numberCyclesRemaining))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($numberCyclesRemaining, true), gettype($numberCyclesRemaining)), __LINE__); } $this->NumberCyclesRemaining = $numberCyclesRemaining; return $this; @@ -173,8 +173,8 @@ public function getFailedPaymentCount() public function setFailedPaymentCount($failedPaymentCount = null) { // validation for constraint: int - if (!is_null($failedPaymentCount) && !is_numeric($failedPaymentCount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($failedPaymentCount)), __LINE__); + if (!is_null($failedPaymentCount) && !(is_int($failedPaymentCount) || ctype_digit($failedPaymentCount))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($failedPaymentCount, true), gettype($failedPaymentCount)), __LINE__); } $this->FailedPaymentCount = $failedPaymentCount; return $this; @@ -196,7 +196,7 @@ public function setNextBillingDate($nextBillingDate = null) { // validation for constraint: string if (!is_null($nextBillingDate) && !is_string($nextBillingDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($nextBillingDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($nextBillingDate, true), gettype($nextBillingDate)), __LINE__); } $this->NextBillingDate = $nextBillingDate; return $this; @@ -218,7 +218,7 @@ public function setLastPaymentDate($lastPaymentDate = null) { // validation for constraint: string if (!is_null($lastPaymentDate) && !is_string($lastPaymentDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastPaymentDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastPaymentDate, true), gettype($lastPaymentDate)), __LINE__); } $this->LastPaymentDate = $lastPaymentDate; return $this; diff --git a/src/StructType/ReferenceCreditCardDetailsType.php b/src/StructType/ReferenceCreditCardDetailsType.php index eb45433..a9db704 100644 --- a/src/StructType/ReferenceCreditCardDetailsType.php +++ b/src/StructType/ReferenceCreditCardDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for ReferenceCreditCardDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: CreditCardDetailsType for DCC Reference Transaction Information about a Credit Card. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class ReferenceCreditCardDetailsType extends AbstractStructBase { /** * The CreditCardNumberType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\CreditCardNumberTypeType @@ -23,7 +23,7 @@ class ReferenceCreditCardDetailsType extends AbstractStructBase public $CreditCardNumberType; /** * The ExpMonth - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var int @@ -31,7 +31,7 @@ class ReferenceCreditCardDetailsType extends AbstractStructBase public $ExpMonth; /** * The ExpYear - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var int @@ -39,7 +39,7 @@ class ReferenceCreditCardDetailsType extends AbstractStructBase public $ExpYear; /** * The CardOwnerName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\PersonNameType @@ -47,7 +47,7 @@ class ReferenceCreditCardDetailsType extends AbstractStructBase public $CardOwnerName; /** * The BillingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\AddressType @@ -55,7 +55,7 @@ class ReferenceCreditCardDetailsType extends AbstractStructBase public $BillingAddress; /** * The CVV2 - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -63,7 +63,7 @@ class ReferenceCreditCardDetailsType extends AbstractStructBase public $CVV2; /** * The StartMonth - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var int @@ -71,7 +71,7 @@ class ReferenceCreditCardDetailsType extends AbstractStructBase public $StartMonth; /** * The StartYear - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var int @@ -79,7 +79,7 @@ class ReferenceCreditCardDetailsType extends AbstractStructBase public $StartYear; /** * The IssueNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -153,8 +153,8 @@ public function getExpMonth() public function setExpMonth($expMonth = null) { // validation for constraint: int - if (!is_null($expMonth) && !is_numeric($expMonth)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($expMonth)), __LINE__); + if (!is_null($expMonth) && !(is_int($expMonth) || ctype_digit($expMonth))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($expMonth, true), gettype($expMonth)), __LINE__); } $this->ExpMonth = $expMonth; return $this; @@ -175,8 +175,8 @@ public function getExpYear() public function setExpYear($expYear = null) { // validation for constraint: int - if (!is_null($expYear) && !is_numeric($expYear)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($expYear)), __LINE__); + if (!is_null($expYear) && !(is_int($expYear) || ctype_digit($expYear))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($expYear, true), gettype($expYear)), __LINE__); } $this->ExpYear = $expYear; return $this; @@ -234,7 +234,7 @@ public function setCVV2($cVV2 = null) { // validation for constraint: string if (!is_null($cVV2) && !is_string($cVV2)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cVV2)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cVV2, true), gettype($cVV2)), __LINE__); } $this->CVV2 = $cVV2; return $this; @@ -255,8 +255,8 @@ public function getStartMonth() public function setStartMonth($startMonth = null) { // validation for constraint: int - if (!is_null($startMonth) && !is_numeric($startMonth)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($startMonth)), __LINE__); + if (!is_null($startMonth) && !(is_int($startMonth) || ctype_digit($startMonth))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($startMonth, true), gettype($startMonth)), __LINE__); } $this->StartMonth = $startMonth; return $this; @@ -277,8 +277,8 @@ public function getStartYear() public function setStartYear($startYear = null) { // validation for constraint: int - if (!is_null($startYear) && !is_numeric($startYear)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($startYear)), __LINE__); + if (!is_null($startYear) && !(is_int($startYear) || ctype_digit($startYear))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($startYear, true), gettype($startYear)), __LINE__); } $this->StartYear = $startYear; return $this; @@ -300,7 +300,7 @@ public function setIssueNumber($issueNumber = null) { // validation for constraint: string if (!is_null($issueNumber) && !is_string($issueNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($issueNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($issueNumber, true), gettype($issueNumber)), __LINE__); } $this->IssueNumber = $issueNumber; return $this; diff --git a/src/StructType/RefreshTokenStatusDetailsType.php b/src/StructType/RefreshTokenStatusDetailsType.php index f560ec7..2a9945d 100644 --- a/src/StructType/RefreshTokenStatusDetailsType.php +++ b/src/StructType/RefreshTokenStatusDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for RefreshTokenStatusDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Response information resulting from opt-in operation or current login bypass status. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class RefreshTokenStatusDetailsType extends AbstractStructBase { /** * The RefreshTokenStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Required field that reports status of opt-in or login bypass attempt. 0 = Success, successful opt-in or RefreshToken corresponding to AccessToken specified in SetExpressCheckout is valid (user is still opted in). 1 = New RefreshToken * was generated (user is still opted in). 2 = Invalid ID, RefreshToken corresponding to AccessToken specified in SetExpressCheckout is invalid (user is opted out). -2 = Internal Error, system error or outage during opt-in or login bypass. Can retry * opt-in or login bypass next time. Flow will force full authentication and allow buyer to complete transaction. -1 = None, the field does not represent any valid value of the status. @@ -26,7 +26,7 @@ class RefreshTokenStatusDetailsType extends AbstractStructBase public $RefreshTokenStatus; /** * The RefreshToken - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Identifier returned on external-remember-me-opt-in to allow the merchant to request bypass of PayPal login * - maxOccurs: 1 * - minOccurs: 0 @@ -35,7 +35,7 @@ class RefreshTokenStatusDetailsType extends AbstractStructBase public $RefreshToken; /** * The ImmutableID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The immutable_id is the user's unique value per merchant that should never ever change for that account. This would be the key used to uniquely identify the user * - maxOccurs: 1 * - minOccurs: 0 @@ -74,8 +74,8 @@ public function getRefreshTokenStatus() public function setRefreshTokenStatus($refreshTokenStatus = null) { // validation for constraint: int - if (!is_null($refreshTokenStatus) && !is_numeric($refreshTokenStatus)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($refreshTokenStatus)), __LINE__); + if (!is_null($refreshTokenStatus) && !(is_int($refreshTokenStatus) || ctype_digit($refreshTokenStatus))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($refreshTokenStatus, true), gettype($refreshTokenStatus)), __LINE__); } $this->RefreshTokenStatus = $refreshTokenStatus; return $this; @@ -97,7 +97,7 @@ public function setRefreshToken($refreshToken = null) { // validation for constraint: string if (!is_null($refreshToken) && !is_string($refreshToken)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($refreshToken)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($refreshToken, true), gettype($refreshToken)), __LINE__); } $this->RefreshToken = $refreshToken; return $this; @@ -119,7 +119,7 @@ public function setImmutableID($immutableID = null) { // validation for constraint: string if (!is_null($immutableID) && !is_string($immutableID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($immutableID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($immutableID, true), gettype($immutableID)), __LINE__); } $this->ImmutableID = $immutableID; return $this; diff --git a/src/StructType/RefundInfoType.php b/src/StructType/RefundInfoType.php index ee03430..a11341e 100644 --- a/src/StructType/RefundInfoType.php +++ b/src/StructType/RefundInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for RefundInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Holds refunds payment status information * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class RefundInfoType extends AbstractStructBase { /** * The RefundStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Refund status whether it is Instant or Delayed. * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class RefundInfoType extends AbstractStructBase public $RefundStatus; /** * The PendingReason - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Tells us the reason when refund payment status is Delayed. * - maxOccurs: 1 * - minOccurs: 0 @@ -64,7 +64,7 @@ public function setRefundStatus($refundStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentStatusCodeType::valueIsValid($refundStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $refundStatus, implode(', ', \PayPal\EnumType\PaymentStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentStatusCodeType', is_array($refundStatus) ? implode(', ', $refundStatus) : var_export($refundStatus, true), implode(', ', \PayPal\EnumType\PaymentStatusCodeType::getValidValues())), __LINE__); } $this->RefundStatus = $refundStatus; return $this; @@ -89,7 +89,7 @@ public function setPendingReason($pendingReason = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PendingStatusCodeType::valueIsValid($pendingReason)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $pendingReason, implode(', ', \PayPal\EnumType\PendingStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PendingStatusCodeType', is_array($pendingReason) ? implode(', ', $pendingReason) : var_export($pendingReason, true), implode(', ', \PayPal\EnumType\PendingStatusCodeType::getValidValues())), __LINE__); } $this->PendingReason = $pendingReason; return $this; diff --git a/src/StructType/RefundTransactionReq.php b/src/StructType/RefundTransactionReq.php index 74b86eb..795252e 100644 --- a/src/StructType/RefundTransactionReq.php +++ b/src/StructType/RefundTransactionReq.php @@ -13,7 +13,7 @@ class RefundTransactionReq extends AbstractStructBase { /** * The RefundTransactionRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:RefundTransactionRequest * @var \PayPal\StructType\RefundTransactionRequestType */ diff --git a/src/StructType/RefundTransactionRequestType.php b/src/StructType/RefundTransactionRequestType.php index 5a01900..a87b0f1 100644 --- a/src/StructType/RefundTransactionRequestType.php +++ b/src/StructType/RefundTransactionRequestType.php @@ -6,8 +6,8 @@ /** * This class stands for RefundTransactionRequestType StructType - * Meta informations extracted from the WSDL - * - documentation: To pass the Merchant store informationOptional | Information about the individual details of the items to be refunded.Optional | This holds key-value pair which merchants wants to pass it to the open wallet-PLCC processorOptional + * Meta information extracted from the WSDL + * - documentation: This holds key-value pair which merchants wants to pass it to the open wallet-PLCC processorOptional | Information about the individual details of the items to be refunded.Optional | To pass the Merchant store informationOptional * @subpackage Structs * @author WsdlToPhp */ @@ -15,8 +15,9 @@ class RefundTransactionRequestType extends AbstractRequestType { /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique identifier of the transaction you are refunding. Optional Character length and limitations: 17 single-byte alphanumeric characters | TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -24,17 +25,18 @@ class RefundTransactionRequestType extends AbstractRequestType public $TransactionID; /** * The PayerID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Encrypted PayPal customer account identification number. Optional Character length and limitations: 127 single-byte alphanumeric characters + * - base: xs:string + * - maxLength: 127 * - maxOccurs: 1 * - minOccurs: 0 - * - maxLength: 127 * @var string */ public $PayerID; /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Invoice number corresponding to transaction details for tracking the refund of a payment. This parameter is passed by the merchant or recipient while refunding the transaction. This parameter does not affect the business logic, it is * persisted in the DB for transaction reference Optional * - maxOccurs: 1 @@ -44,7 +46,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $InvoiceID; /** * The RefundType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of refund you are making Required * - maxOccurs: 1 * - minOccurs: 0 @@ -53,7 +55,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $RefundType; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Refund amount. Amount is required if RefundType is Partial. NOTE: If RefundType is Full, do not set Amount. * - maxOccurs: 1 * - minOccurs: 0 @@ -62,7 +64,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $Amount; /** * The ShippingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Shipping amount. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -71,7 +73,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $ShippingAmount; /** * The TaxAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Tax amount. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -80,7 +82,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $TaxAmount; /** * The Memo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Custom memo about the refund. Optional Character length and limitations: 255 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -89,7 +91,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $Memo; /** * The RetryUntil - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The maximum time till which refund must be tried. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -98,7 +100,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $RetryUntil; /** * The RefundSource - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The type of funding source for refund. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -107,7 +109,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $RefundSource; /** * The RefundAdvice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Flag to indicate that the customer was already given store credit for a given transaction. This will allow us to make sure we do not double refund. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -116,7 +118,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $RefundAdvice; /** * The MerchantStoreDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:MerchantStoreDetails @@ -125,7 +127,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $MerchantStoreDetails; /** * The RefundItemDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * - ref: ebl:RefundItemDetails @@ -134,7 +136,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $RefundItemDetails; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique id for each API request to prevent duplicate payments. Optional Character length and limits: 38 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -143,7 +145,7 @@ class RefundTransactionRequestType extends AbstractRequestType public $MsgSubID; /** * The MerchantData - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:MerchantData @@ -219,7 +221,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -239,13 +241,13 @@ public function getPayerID() */ public function setPayerID($payerID = null) { - // validation for constraint: maxLength - if ((is_scalar($payerID) && strlen($payerID) > 127) || (is_array($payerID) && count($payerID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($payerID) ? strlen($payerID) : count($payerID)), __LINE__); - } // validation for constraint: string if (!is_null($payerID) && !is_string($payerID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payerID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payerID, true), gettype($payerID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($payerID) && mb_strlen($payerID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($payerID)), __LINE__); } $this->PayerID = $payerID; return $this; @@ -267,7 +269,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; @@ -292,7 +294,7 @@ public function setRefundType($refundType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\RefundType::valueIsValid($refundType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $refundType, implode(', ', \PayPal\EnumType\RefundType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\RefundType', is_array($refundType) ? implode(', ', $refundType) : var_export($refundType, true), implode(', ', \PayPal\EnumType\RefundType::getValidValues())), __LINE__); } $this->RefundType = $refundType; return $this; @@ -368,7 +370,7 @@ public function setMemo($memo = null) { // validation for constraint: string if (!is_null($memo) && !is_string($memo)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($memo)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($memo, true), gettype($memo)), __LINE__); } $this->Memo = $memo; return $this; @@ -390,7 +392,7 @@ public function setRetryUntil($retryUntil = null) { // validation for constraint: string if (!is_null($retryUntil) && !is_string($retryUntil)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($retryUntil)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($retryUntil, true), gettype($retryUntil)), __LINE__); } $this->RetryUntil = $retryUntil; return $this; @@ -415,7 +417,7 @@ public function setRefundSource($refundSource = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\RefundSourceCodeType::valueIsValid($refundSource)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $refundSource, implode(', ', \PayPal\EnumType\RefundSourceCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\RefundSourceCodeType', is_array($refundSource) ? implode(', ', $refundSource) : var_export($refundSource, true), implode(', ', \PayPal\EnumType\RefundSourceCodeType::getValidValues())), __LINE__); } $this->RefundSource = $refundSource; return $this; @@ -437,7 +439,7 @@ public function setRefundAdvice($refundAdvice = null) { // validation for constraint: boolean if (!is_null($refundAdvice) && !is_bool($refundAdvice)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($refundAdvice)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($refundAdvice, true), gettype($refundAdvice)), __LINE__); } $this->RefundAdvice = $refundAdvice; return $this; @@ -468,6 +470,28 @@ public function getRefundItemDetails() { return $this->RefundItemDetails; } + /** + * This method is responsible for validating the values passed to the setRefundItemDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setRefundItemDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateRefundItemDetailsForArrayConstraintsFromSetRefundItemDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $refundTransactionRequestTypeRefundItemDetailsItem) { + // validation for constraint: itemType + if (!$refundTransactionRequestTypeRefundItemDetailsItem instanceof \PayPal\StructType\InvoiceItemType) { + $invalidValues[] = is_object($refundTransactionRequestTypeRefundItemDetailsItem) ? get_class($refundTransactionRequestTypeRefundItemDetailsItem) : sprintf('%s(%s)', gettype($refundTransactionRequestTypeRefundItemDetailsItem), var_export($refundTransactionRequestTypeRefundItemDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The RefundItemDetails property can only contain items of type \PayPal\StructType\InvoiceItemType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set RefundItemDetails value * @throws \InvalidArgumentException @@ -476,11 +500,9 @@ public function getRefundItemDetails() */ public function setRefundItemDetails(array $refundItemDetails = array()) { - foreach ($refundItemDetails as $refundTransactionRequestTypeRefundItemDetailsItem) { - // validation for constraint: itemType - if (!$refundTransactionRequestTypeRefundItemDetailsItem instanceof \PayPal\StructType\InvoiceItemType) { - throw new \InvalidArgumentException(sprintf('The RefundItemDetails property can only contain items of \PayPal\StructType\InvoiceItemType, "%s" given', is_object($refundTransactionRequestTypeRefundItemDetailsItem) ? get_class($refundTransactionRequestTypeRefundItemDetailsItem) : gettype($refundTransactionRequestTypeRefundItemDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($refundItemDetailsArrayErrorMessage = self::validateRefundItemDetailsForArrayConstraintsFromSetRefundItemDetails($refundItemDetails))) { + throw new \InvalidArgumentException($refundItemDetailsArrayErrorMessage, __LINE__); } $this->RefundItemDetails = $refundItemDetails; return $this; @@ -495,7 +517,7 @@ public function addToRefundItemDetails(\PayPal\StructType\InvoiceItemType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\InvoiceItemType) { - throw new \InvalidArgumentException(sprintf('The RefundItemDetails property can only contain items of \PayPal\StructType\InvoiceItemType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The RefundItemDetails property can only contain items of type \PayPal\StructType\InvoiceItemType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->RefundItemDetails[] = $item; return $this; @@ -517,7 +539,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/RefundTransactionResponseType.php b/src/StructType/RefundTransactionResponseType.php index bb0db66..e160ab1 100644 --- a/src/StructType/RefundTransactionResponseType.php +++ b/src/StructType/RefundTransactionResponseType.php @@ -6,7 +6,7 @@ /** * This class stands for RefundTransactionResponseType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains Refund Payment status information. * @subpackage Structs * @author WsdlToPhp @@ -15,8 +15,9 @@ class RefundTransactionResponseType extends AbstractResponseType { /** * The RefundTransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique transaction ID of the refund. Character length and limitations:17 single-byte characters | TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * - nillable: true @@ -25,7 +26,7 @@ class RefundTransactionResponseType extends AbstractResponseType public $RefundTransactionID; /** * The NetRefundAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount subtracted from PayPal balance of original recipient of payment to make this refund * - maxOccurs: 1 * - minOccurs: 0 @@ -34,7 +35,7 @@ class RefundTransactionResponseType extends AbstractResponseType public $NetRefundAmount; /** * The FeeRefundAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Transaction fee refunded to original recipient of payment * - maxOccurs: 1 * - minOccurs: 0 @@ -43,7 +44,7 @@ class RefundTransactionResponseType extends AbstractResponseType public $FeeRefundAmount; /** * The GrossRefundAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of money refunded to original payer * - maxOccurs: 1 * - minOccurs: 0 @@ -52,7 +53,7 @@ class RefundTransactionResponseType extends AbstractResponseType public $GrossRefundAmount; /** * The TotalRefundedAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total of all previous refunds * - maxOccurs: 1 * - minOccurs: 0 @@ -61,7 +62,7 @@ class RefundTransactionResponseType extends AbstractResponseType public $TotalRefundedAmount; /** * The RefundInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:RefundInfo @@ -70,7 +71,7 @@ class RefundTransactionResponseType extends AbstractResponseType public $RefundInfo; /** * The ReceiptData - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Any general information like offer details that is reinstated or any other marketing data * - maxOccurs: 1 * - minOccurs: 0 @@ -79,7 +80,7 @@ class RefundTransactionResponseType extends AbstractResponseType public $ReceiptData; /** * The MsgSubID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Return msgsubid back to merchant * - maxOccurs: 1 * - minOccurs: 0 @@ -139,7 +140,7 @@ public function setRefundTransactionID($refundTransactionID = null) { // validation for constraint: string if (!is_null($refundTransactionID) && !is_string($refundTransactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($refundTransactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($refundTransactionID, true), gettype($refundTransactionID)), __LINE__); } if (is_null($refundTransactionID) || (is_array($refundTransactionID) && empty($refundTransactionID))) { unset($this->RefundTransactionID); @@ -255,7 +256,7 @@ public function setReceiptData($receiptData = null) { // validation for constraint: string if (!is_null($receiptData) && !is_string($receiptData)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiptData)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiptData, true), gettype($receiptData)), __LINE__); } $this->ReceiptData = $receiptData; return $this; @@ -277,7 +278,7 @@ public function setMsgSubID($msgSubID = null) { // validation for constraint: string if (!is_null($msgSubID) && !is_string($msgSubID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($msgSubID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($msgSubID, true), gettype($msgSubID)), __LINE__); } $this->MsgSubID = $msgSubID; return $this; diff --git a/src/StructType/RememberMeIDInfoType.php b/src/StructType/RememberMeIDInfoType.php index ab0a88b..33c2107 100644 --- a/src/StructType/RememberMeIDInfoType.php +++ b/src/StructType/RememberMeIDInfoType.php @@ -13,7 +13,7 @@ class RememberMeIDInfoType extends AbstractStructBase { /** * The ExternalRememberMeID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: External remember-me ID returned by GetExpressCheckoutDetails on successful opt-in. The ExternalRememberMeID is a 17-character alphanumeric (encrypted) string that identifies the buyer's remembered login with a merchant and has * meaning only to the merchant. If present, requests that the web flow attempt bypass of login. * - maxOccurs: 1 @@ -48,7 +48,7 @@ public function setExternalRememberMeID($externalRememberMeID = null) { // validation for constraint: string if (!is_null($externalRememberMeID) && !is_string($externalRememberMeID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($externalRememberMeID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($externalRememberMeID, true), gettype($externalRememberMeID)), __LINE__); } $this->ExternalRememberMeID = $externalRememberMeID; return $this; diff --git a/src/StructType/ReverseTransactionReq.php b/src/StructType/ReverseTransactionReq.php index 9064c7b..82ff78f 100644 --- a/src/StructType/ReverseTransactionReq.php +++ b/src/StructType/ReverseTransactionReq.php @@ -13,7 +13,7 @@ class ReverseTransactionReq extends AbstractStructBase { /** * The ReverseTransactionRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:ReverseTransactionRequest * @var \PayPal\StructType\ReverseTransactionRequestType */ diff --git a/src/StructType/ReverseTransactionRequestDetailsType.php b/src/StructType/ReverseTransactionRequestDetailsType.php index 8ecde42..6374c21 100644 --- a/src/StructType/ReverseTransactionRequestDetailsType.php +++ b/src/StructType/ReverseTransactionRequestDetailsType.php @@ -13,8 +13,9 @@ class ReverseTransactionRequestDetailsType extends AbstractStructBase { /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Identifier of the transaction to reverse. Required Character length and limitations: 17 single-byte alphanumeric characters | TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -47,7 +48,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; diff --git a/src/StructType/ReverseTransactionRequestType.php b/src/StructType/ReverseTransactionRequestType.php index cbdedf4..5fadd1d 100644 --- a/src/StructType/ReverseTransactionRequestType.php +++ b/src/StructType/ReverseTransactionRequestType.php @@ -13,7 +13,7 @@ class ReverseTransactionRequestType extends AbstractRequestType { /** * The ReverseTransactionRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:ReverseTransactionRequestDetails diff --git a/src/StructType/ReverseTransactionResponseDetailsType.php b/src/StructType/ReverseTransactionResponseDetailsType.php index 1c7c26a..f88f198 100644 --- a/src/StructType/ReverseTransactionResponseDetailsType.php +++ b/src/StructType/ReverseTransactionResponseDetailsType.php @@ -13,7 +13,7 @@ class ReverseTransactionResponseDetailsType extends AbstractStructBase { /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Status of reversal request. Required * - maxOccurs: 1 * - minOccurs: 1 @@ -22,8 +22,9 @@ class ReverseTransactionResponseDetailsType extends AbstractStructBase public $Status; /** * The ReverseTransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique transaction identifier of the reversal transaction created. Character length and limitations:17 single-byte characters | TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * - nillable: true @@ -60,7 +61,7 @@ public function setStatus($status = null) { // validation for constraint: string if (!is_null($status) && !is_string($status)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($status)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($status, true), gettype($status)), __LINE__); } $this->Status = $status; return $this; @@ -87,7 +88,7 @@ public function setReverseTransactionID($reverseTransactionID = null) { // validation for constraint: string if (!is_null($reverseTransactionID) && !is_string($reverseTransactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reverseTransactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reverseTransactionID, true), gettype($reverseTransactionID)), __LINE__); } if (is_null($reverseTransactionID) || (is_array($reverseTransactionID) && empty($reverseTransactionID))) { unset($this->ReverseTransactionID); diff --git a/src/StructType/ReverseTransactionResponseType.php b/src/StructType/ReverseTransactionResponseType.php index b07c29a..9a8f40a 100644 --- a/src/StructType/ReverseTransactionResponseType.php +++ b/src/StructType/ReverseTransactionResponseType.php @@ -13,7 +13,7 @@ class ReverseTransactionResponseType extends AbstractResponseType { /** * The ReverseTransactionResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:ReverseTransactionResponseDetails diff --git a/src/StructType/ReviseStatusType.php b/src/StructType/ReviseStatusType.php index 94cd675..9e9ae1a 100644 --- a/src/StructType/ReviseStatusType.php +++ b/src/StructType/ReviseStatusType.php @@ -6,7 +6,7 @@ /** * This class stands for ReviseStatusType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains the revise status information details (e.g., item properties information). ths node contains system set data only - always output and always all data. no minccurs needed, except for motors specific data, since it wil lnot be * retruned for non motors items * @subpackage Structs @@ -16,14 +16,14 @@ class ReviseStatusType extends AbstractStructBase { /** * The ItemRevised - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether the item was revised since the auction started. * @var bool */ public $ItemRevised; /** * The BuyItNowAdded - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If true, indicates that a Buy It Now Price was added for the item. Only returned for Motors items. * - minOccurs: 0 * @var bool @@ -31,7 +31,7 @@ class ReviseStatusType extends AbstractStructBase public $BuyItNowAdded; /** * The BuyItNowLowered - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Replaces BinLowered as of API version 305. If true, indicates that the Buy It Now Price was lowered for the item. Only returned for Motors items. * - minOccurs: 0 * @var bool @@ -39,7 +39,7 @@ class ReviseStatusType extends AbstractStructBase public $BuyItNowLowered; /** * The ReserveLowered - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If true, indicates that the Reserve Price was lowered for the item. Only returned for Motors items. * - minOccurs: 0 * @var bool @@ -47,7 +47,7 @@ class ReviseStatusType extends AbstractStructBase public $ReserveLowered; /** * The ReserveRemoved - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If true, indicates that the Reserve Price was removed from the item. Only returned for eBay Motors items. * - minOccurs: 0 * @var bool @@ -92,7 +92,7 @@ public function setItemRevised($itemRevised = null) { // validation for constraint: boolean if (!is_null($itemRevised) && !is_bool($itemRevised)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($itemRevised)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($itemRevised, true), gettype($itemRevised)), __LINE__); } $this->ItemRevised = $itemRevised; return $this; @@ -114,7 +114,7 @@ public function setBuyItNowAdded($buyItNowAdded = null) { // validation for constraint: boolean if (!is_null($buyItNowAdded) && !is_bool($buyItNowAdded)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($buyItNowAdded)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($buyItNowAdded, true), gettype($buyItNowAdded)), __LINE__); } $this->BuyItNowAdded = $buyItNowAdded; return $this; @@ -136,7 +136,7 @@ public function setBuyItNowLowered($buyItNowLowered = null) { // validation for constraint: boolean if (!is_null($buyItNowLowered) && !is_bool($buyItNowLowered)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($buyItNowLowered)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($buyItNowLowered, true), gettype($buyItNowLowered)), __LINE__); } $this->BuyItNowLowered = $buyItNowLowered; return $this; @@ -158,7 +158,7 @@ public function setReserveLowered($reserveLowered = null) { // validation for constraint: boolean if (!is_null($reserveLowered) && !is_bool($reserveLowered)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($reserveLowered)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($reserveLowered, true), gettype($reserveLowered)), __LINE__); } $this->ReserveLowered = $reserveLowered; return $this; @@ -180,7 +180,7 @@ public function setReserveRemoved($reserveRemoved = null) { // validation for constraint: boolean if (!is_null($reserveRemoved) && !is_bool($reserveRemoved)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($reserveRemoved)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($reserveRemoved, true), gettype($reserveRemoved)), __LINE__); } $this->ReserveRemoved = $reserveRemoved; return $this; diff --git a/src/StructType/RiskFilterDetailsType.php b/src/StructType/RiskFilterDetailsType.php index 3e2385e..2153075 100644 --- a/src/StructType/RiskFilterDetailsType.php +++ b/src/StructType/RiskFilterDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for RiskFilterDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details of Risk Filter. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class RiskFilterDetailsType extends AbstractStructBase { /** * The Id - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var int @@ -23,7 +23,7 @@ class RiskFilterDetailsType extends AbstractStructBase public $Id; /** * The Name - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -31,7 +31,7 @@ class RiskFilterDetailsType extends AbstractStructBase public $Name; /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -69,8 +69,8 @@ public function getId() public function setId($id = null) { // validation for constraint: int - if (!is_null($id) && !is_numeric($id)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($id)), __LINE__); + if (!is_null($id) && !(is_int($id) || ctype_digit($id))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($id, true), gettype($id)), __LINE__); } $this->Id = $id; return $this; @@ -92,7 +92,7 @@ public function setName($name = null) { // validation for constraint: string if (!is_null($name) && !is_string($name)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); } $this->Name = $name; return $this; @@ -114,7 +114,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this; diff --git a/src/StructType/RiskFilterListType.php b/src/StructType/RiskFilterListType.php index 2df651e..75e60c7 100644 --- a/src/StructType/RiskFilterListType.php +++ b/src/StructType/RiskFilterListType.php @@ -6,7 +6,7 @@ /** * This class stands for RiskFilterListType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details of Risk Filter. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class RiskFilterListType extends AbstractStructBase { /** * The Filters - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 1 * @var \PayPal\StructType\RiskFilterDetailsType[] @@ -39,6 +39,28 @@ public function getFilters() { return $this->Filters; } + /** + * This method is responsible for validating the values passed to the setFilters method + * This method is willingly generated in order to preserve the one-line inline validation within the setFilters method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateFiltersForArrayConstraintsFromSetFilters(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $riskFilterListTypeFiltersItem) { + // validation for constraint: itemType + if (!$riskFilterListTypeFiltersItem instanceof \PayPal\StructType\RiskFilterDetailsType) { + $invalidValues[] = is_object($riskFilterListTypeFiltersItem) ? get_class($riskFilterListTypeFiltersItem) : sprintf('%s(%s)', gettype($riskFilterListTypeFiltersItem), var_export($riskFilterListTypeFiltersItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Filters property can only contain items of type \PayPal\StructType\RiskFilterDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Filters value * @throws \InvalidArgumentException @@ -47,11 +69,9 @@ public function getFilters() */ public function setFilters(array $filters = array()) { - foreach ($filters as $riskFilterListTypeFiltersItem) { - // validation for constraint: itemType - if (!$riskFilterListTypeFiltersItem instanceof \PayPal\StructType\RiskFilterDetailsType) { - throw new \InvalidArgumentException(sprintf('The Filters property can only contain items of \PayPal\StructType\RiskFilterDetailsType, "%s" given', is_object($riskFilterListTypeFiltersItem) ? get_class($riskFilterListTypeFiltersItem) : gettype($riskFilterListTypeFiltersItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($filtersArrayErrorMessage = self::validateFiltersForArrayConstraintsFromSetFilters($filters))) { + throw new \InvalidArgumentException($filtersArrayErrorMessage, __LINE__); } $this->Filters = $filters; return $this; @@ -66,7 +86,7 @@ public function addToFilters(\PayPal\StructType\RiskFilterDetailsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\RiskFilterDetailsType) { - throw new \InvalidArgumentException(sprintf('The Filters property can only contain items of \PayPal\StructType\RiskFilterDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Filters property can only contain items of type \PayPal\StructType\RiskFilterDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Filters[] = $item; return $this; diff --git a/src/StructType/SalesTaxType.php b/src/StructType/SalesTaxType.php index 8010d7e..354f705 100644 --- a/src/StructType/SalesTaxType.php +++ b/src/StructType/SalesTaxType.php @@ -13,7 +13,7 @@ class SalesTaxType extends AbstractStructBase { /** * The SalesTaxPercent - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Amount of the sales tax to be collected for the transaction. Sales tax is only for US. * - minOccurs: 0 * @var float @@ -21,7 +21,7 @@ class SalesTaxType extends AbstractStructBase public $SalesTaxPercent; /** * The SalesTaxState - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sales tax for the transaction, expressed as a percentage. Should be empty for items listed on international sites (hence, this is US-only element). * - minOccurs: 0 * @var string @@ -29,7 +29,7 @@ class SalesTaxType extends AbstractStructBase public $SalesTaxState; /** * The ShippingIncludedInTax - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether shipping is included in the tax. Applicable if ShippingType = 1 or 2. This element is used for US-only. * - minOccurs: 0 * @var bool @@ -66,6 +66,10 @@ public function getSalesTaxPercent() */ public function setSalesTaxPercent($salesTaxPercent = null) { + // validation for constraint: float + if (!is_null($salesTaxPercent) && !(is_float($salesTaxPercent) || is_numeric($salesTaxPercent))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($salesTaxPercent, true), gettype($salesTaxPercent)), __LINE__); + } $this->SalesTaxPercent = $salesTaxPercent; return $this; } @@ -86,7 +90,7 @@ public function setSalesTaxState($salesTaxState = null) { // validation for constraint: string if (!is_null($salesTaxState) && !is_string($salesTaxState)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($salesTaxState)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($salesTaxState, true), gettype($salesTaxState)), __LINE__); } $this->SalesTaxState = $salesTaxState; return $this; @@ -108,7 +112,7 @@ public function setShippingIncludedInTax($shippingIncludedInTax = null) { // validation for constraint: boolean if (!is_null($shippingIncludedInTax) && !is_bool($shippingIncludedInTax)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($shippingIncludedInTax)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($shippingIncludedInTax, true), gettype($shippingIncludedInTax)), __LINE__); } $this->ShippingIncludedInTax = $shippingIncludedInTax; return $this; diff --git a/src/StructType/ScheduleDetailsType.php b/src/StructType/ScheduleDetailsType.php index 082591b..3d100f3 100644 --- a/src/StructType/ScheduleDetailsType.php +++ b/src/StructType/ScheduleDetailsType.php @@ -13,7 +13,7 @@ class ScheduleDetailsType extends AbstractStructBase { /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Schedule details for the Recurring Payment * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class ScheduleDetailsType extends AbstractStructBase public $Description; /** * The PaymentPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var \PayPal\StructType\BillingPeriodDetailsType @@ -30,7 +30,7 @@ class ScheduleDetailsType extends AbstractStructBase public $PaymentPeriod; /** * The TrialPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Trial period of this schedule * - maxOccurs: 1 * - minOccurs: 0 @@ -39,7 +39,7 @@ class ScheduleDetailsType extends AbstractStructBase public $TrialPeriod; /** * The MaxFailedPayments - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The max number of payments the buyer can fail before this Recurring Payments profile is cancelled * - maxOccurs: 1 * - minOccurs: 0 @@ -48,7 +48,7 @@ class ScheduleDetailsType extends AbstractStructBase public $MaxFailedPayments; /** * The ActivationDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\ActivationDetailsType @@ -56,7 +56,7 @@ class ScheduleDetailsType extends AbstractStructBase public $ActivationDetails; /** * The AutoBillOutstandingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -104,7 +104,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this; @@ -161,8 +161,8 @@ public function getMaxFailedPayments() public function setMaxFailedPayments($maxFailedPayments = null) { // validation for constraint: int - if (!is_null($maxFailedPayments) && !is_numeric($maxFailedPayments)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($maxFailedPayments)), __LINE__); + if (!is_null($maxFailedPayments) && !(is_int($maxFailedPayments) || ctype_digit($maxFailedPayments))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($maxFailedPayments, true), gettype($maxFailedPayments)), __LINE__); } $this->MaxFailedPayments = $maxFailedPayments; return $this; @@ -205,7 +205,7 @@ public function setAutoBillOutstandingAmount($autoBillOutstandingAmount = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AutoBillType::valueIsValid($autoBillOutstandingAmount)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $autoBillOutstandingAmount, implode(', ', \PayPal\EnumType\AutoBillType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AutoBillType', is_array($autoBillOutstandingAmount) ? implode(', ', $autoBillOutstandingAmount) : var_export($autoBillOutstandingAmount, true), implode(', ', \PayPal\EnumType\AutoBillType::getValidValues())), __LINE__); } $this->AutoBillOutstandingAmount = $autoBillOutstandingAmount; return $this; diff --git a/src/StructType/SchedulingInfoType.php b/src/StructType/SchedulingInfoType.php index e7da08a..94422e4 100644 --- a/src/StructType/SchedulingInfoType.php +++ b/src/StructType/SchedulingInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for SchedulingInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains information for Scheduling limits for the user. All dtails must be present,unless we will have revise call one day, just in case we might let's make min occur = 0 * @subpackage Structs * @author WsdlToPhp @@ -15,21 +15,21 @@ class SchedulingInfoType extends AbstractStructBase { /** * The MaxScheduledMinutes - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ public $MaxScheduledMinutes; /** * The MinScheduledMinutes - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ public $MinScheduledMinutes; /** * The MaxScheduledItems - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var int */ @@ -66,8 +66,8 @@ public function getMaxScheduledMinutes() public function setMaxScheduledMinutes($maxScheduledMinutes = null) { // validation for constraint: int - if (!is_null($maxScheduledMinutes) && !is_numeric($maxScheduledMinutes)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($maxScheduledMinutes)), __LINE__); + if (!is_null($maxScheduledMinutes) && !(is_int($maxScheduledMinutes) || ctype_digit($maxScheduledMinutes))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($maxScheduledMinutes, true), gettype($maxScheduledMinutes)), __LINE__); } $this->MaxScheduledMinutes = $maxScheduledMinutes; return $this; @@ -88,8 +88,8 @@ public function getMinScheduledMinutes() public function setMinScheduledMinutes($minScheduledMinutes = null) { // validation for constraint: int - if (!is_null($minScheduledMinutes) && !is_numeric($minScheduledMinutes)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($minScheduledMinutes)), __LINE__); + if (!is_null($minScheduledMinutes) && !(is_int($minScheduledMinutes) || ctype_digit($minScheduledMinutes))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($minScheduledMinutes, true), gettype($minScheduledMinutes)), __LINE__); } $this->MinScheduledMinutes = $minScheduledMinutes; return $this; @@ -110,8 +110,8 @@ public function getMaxScheduledItems() public function setMaxScheduledItems($maxScheduledItems = null) { // validation for constraint: int - if (!is_null($maxScheduledItems) && !is_numeric($maxScheduledItems)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($maxScheduledItems)), __LINE__); + if (!is_null($maxScheduledItems) && !(is_int($maxScheduledItems) || ctype_digit($maxScheduledItems))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($maxScheduledItems, true), gettype($maxScheduledItems)), __LINE__); } $this->MaxScheduledItems = $maxScheduledItems; return $this; diff --git a/src/StructType/SellerDetailsType.php b/src/StructType/SellerDetailsType.php index 7425c5a..d876b21 100644 --- a/src/StructType/SellerDetailsType.php +++ b/src/StructType/SellerDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for SellerDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about the seller. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class SellerDetailsType extends AbstractStructBase { /** * The SellerId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique identifier for the seller. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class SellerDetailsType extends AbstractStructBase public $SellerId; /** * The SellerUserName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The user name of the user at the marketplaces site. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -33,7 +33,7 @@ class SellerDetailsType extends AbstractStructBase public $SellerUserName; /** * The SellerRegistrationDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date when the user registered with the marketplace. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -42,7 +42,7 @@ class SellerDetailsType extends AbstractStructBase public $SellerRegistrationDate; /** * The PayPalAccountID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Seller Paypal Account Id contains the seller EmailId or PayerId or PhoneNo passed during the Request. * - maxOccurs: 1 * - minOccurs: 0 @@ -51,11 +51,12 @@ class SellerDetailsType extends AbstractStructBase public $PayPalAccountID; /** * The SecureMerchantAccountID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique PayPal customer account identification number (of the seller). This feild is meant for Response. This field is ignored, if passed in the Request. + * - base: xs:string + * - maxLength: 127 * - maxOccurs: 1 * - minOccurs: 0 - * - maxLength: 127 * @var string */ public $SecureMerchantAccountID; @@ -98,7 +99,7 @@ public function setSellerId($sellerId = null) { // validation for constraint: string if (!is_null($sellerId) && !is_string($sellerId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sellerId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerId, true), gettype($sellerId)), __LINE__); } $this->SellerId = $sellerId; return $this; @@ -120,7 +121,7 @@ public function setSellerUserName($sellerUserName = null) { // validation for constraint: string if (!is_null($sellerUserName) && !is_string($sellerUserName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sellerUserName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerUserName, true), gettype($sellerUserName)), __LINE__); } $this->SellerUserName = $sellerUserName; return $this; @@ -142,7 +143,7 @@ public function setSellerRegistrationDate($sellerRegistrationDate = null) { // validation for constraint: string if (!is_null($sellerRegistrationDate) && !is_string($sellerRegistrationDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sellerRegistrationDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerRegistrationDate, true), gettype($sellerRegistrationDate)), __LINE__); } $this->SellerRegistrationDate = $sellerRegistrationDate; return $this; @@ -164,7 +165,7 @@ public function setPayPalAccountID($payPalAccountID = null) { // validation for constraint: string if (!is_null($payPalAccountID) && !is_string($payPalAccountID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payPalAccountID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payPalAccountID, true), gettype($payPalAccountID)), __LINE__); } $this->PayPalAccountID = $payPalAccountID; return $this; @@ -184,13 +185,13 @@ public function getSecureMerchantAccountID() */ public function setSecureMerchantAccountID($secureMerchantAccountID = null) { - // validation for constraint: maxLength - if ((is_scalar($secureMerchantAccountID) && strlen($secureMerchantAccountID) > 127) || (is_array($secureMerchantAccountID) && count($secureMerchantAccountID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($secureMerchantAccountID) ? strlen($secureMerchantAccountID) : count($secureMerchantAccountID)), __LINE__); - } // validation for constraint: string if (!is_null($secureMerchantAccountID) && !is_string($secureMerchantAccountID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($secureMerchantAccountID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($secureMerchantAccountID, true), gettype($secureMerchantAccountID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($secureMerchantAccountID) && mb_strlen($secureMerchantAccountID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($secureMerchantAccountID)), __LINE__); } $this->SecureMerchantAccountID = $secureMerchantAccountID; return $this; diff --git a/src/StructType/SellerType.php b/src/StructType/SellerType.php index acf3c3d..9c0ea75 100644 --- a/src/StructType/SellerType.php +++ b/src/StructType/SellerType.php @@ -6,7 +6,7 @@ /** * This class stands for SellerType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about user used by selling applications there are number of required elements - they will always show up for seller node there is not such a call to do revise seller info. only added minoccur=0 to elements that will not * show up in every type of request/responce * @subpackage Structs @@ -21,14 +21,14 @@ class SellerType extends AbstractStructBase public $AllowPaymentEdit; /** * The BillingCurrency - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $BillingCurrency; /** * The CheckoutEnabled - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:CheckoutEnabled * @var bool */ @@ -50,7 +50,7 @@ class SellerType extends AbstractStructBase public $LiveAuctionAuthorized; /** * The MerchandizingPref - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether the user has elected to participate as a seller in the Merchandising Manager feature. * @var string */ @@ -62,14 +62,14 @@ class SellerType extends AbstractStructBase public $QualifiesForB2BVAT; /** * The SellerLevel - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:SellerLevel * @var string */ public $SellerLevel; /** * The SellerPaymentAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:SellerPaymentAddress * @var \PayPal\StructType\AddressType @@ -77,21 +77,21 @@ class SellerType extends AbstractStructBase public $SellerPaymentAddress; /** * The SchedulingInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\SchedulingInfoType */ public $SchedulingInfo; /** * The StoreOwner - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:StoreOwner * @var bool */ public $StoreOwner; /** * The StoreURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -159,7 +159,7 @@ public function setAllowPaymentEdit($allowPaymentEdit = null) { // validation for constraint: boolean if (!is_null($allowPaymentEdit) && !is_bool($allowPaymentEdit)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($allowPaymentEdit)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($allowPaymentEdit, true), gettype($allowPaymentEdit)), __LINE__); } $this->AllowPaymentEdit = $allowPaymentEdit; return $this; @@ -184,7 +184,7 @@ public function setBillingCurrency($billingCurrency = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CurrencyCodeType::valueIsValid($billingCurrency)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $billingCurrency, implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CurrencyCodeType', is_array($billingCurrency) ? implode(', ', $billingCurrency) : var_export($billingCurrency, true), implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); } $this->BillingCurrency = $billingCurrency; return $this; @@ -206,7 +206,7 @@ public function setCheckoutEnabled($checkoutEnabled = null) { // validation for constraint: boolean if (!is_null($checkoutEnabled) && !is_bool($checkoutEnabled)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($checkoutEnabled)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($checkoutEnabled, true), gettype($checkoutEnabled)), __LINE__); } $this->CheckoutEnabled = $checkoutEnabled; return $this; @@ -228,7 +228,7 @@ public function setCIPBankAccountStored($cIPBankAccountStored = null) { // validation for constraint: boolean if (!is_null($cIPBankAccountStored) && !is_bool($cIPBankAccountStored)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($cIPBankAccountStored)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($cIPBankAccountStored, true), gettype($cIPBankAccountStored)), __LINE__); } $this->CIPBankAccountStored = $cIPBankAccountStored; return $this; @@ -250,7 +250,7 @@ public function setGoodStanding($goodStanding = null) { // validation for constraint: boolean if (!is_null($goodStanding) && !is_bool($goodStanding)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($goodStanding)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($goodStanding, true), gettype($goodStanding)), __LINE__); } $this->GoodStanding = $goodStanding; return $this; @@ -272,7 +272,7 @@ public function setLiveAuctionAuthorized($liveAuctionAuthorized = null) { // validation for constraint: boolean if (!is_null($liveAuctionAuthorized) && !is_bool($liveAuctionAuthorized)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($liveAuctionAuthorized)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($liveAuctionAuthorized, true), gettype($liveAuctionAuthorized)), __LINE__); } $this->LiveAuctionAuthorized = $liveAuctionAuthorized; return $this; @@ -297,7 +297,7 @@ public function setMerchandizingPref($merchandizingPref = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\MerchandizingPrefCodeType::valueIsValid($merchandizingPref)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $merchandizingPref, implode(', ', \PayPal\EnumType\MerchandizingPrefCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\MerchandizingPrefCodeType', is_array($merchandizingPref) ? implode(', ', $merchandizingPref) : var_export($merchandizingPref, true), implode(', ', \PayPal\EnumType\MerchandizingPrefCodeType::getValidValues())), __LINE__); } $this->MerchandizingPref = $merchandizingPref; return $this; @@ -319,7 +319,7 @@ public function setQualifiesForB2BVAT($qualifiesForB2BVAT = null) { // validation for constraint: boolean if (!is_null($qualifiesForB2BVAT) && !is_bool($qualifiesForB2BVAT)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($qualifiesForB2BVAT)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($qualifiesForB2BVAT, true), gettype($qualifiesForB2BVAT)), __LINE__); } $this->QualifiesForB2BVAT = $qualifiesForB2BVAT; return $this; @@ -344,7 +344,7 @@ public function setSellerLevel($sellerLevel = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SellerLevelCodeType::valueIsValid($sellerLevel)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $sellerLevel, implode(', ', \PayPal\EnumType\SellerLevelCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SellerLevelCodeType', is_array($sellerLevel) ? implode(', ', $sellerLevel) : var_export($sellerLevel, true), implode(', ', \PayPal\EnumType\SellerLevelCodeType::getValidValues())), __LINE__); } $this->SellerLevel = $sellerLevel; return $this; @@ -402,7 +402,7 @@ public function setStoreOwner($storeOwner = null) { // validation for constraint: boolean if (!is_null($storeOwner) && !is_bool($storeOwner)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($storeOwner)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($storeOwner, true), gettype($storeOwner)), __LINE__); } $this->StoreOwner = $storeOwner; return $this; @@ -424,7 +424,7 @@ public function setStoreURL($storeURL = null) { // validation for constraint: string if (!is_null($storeURL) && !is_string($storeURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($storeURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($storeURL, true), gettype($storeURL)), __LINE__); } $this->StoreURL = $storeURL; return $this; diff --git a/src/StructType/SellingStatusType.php b/src/StructType/SellingStatusType.php index 2395643..bad8555 100644 --- a/src/StructType/SellingStatusType.php +++ b/src/StructType/SellingStatusType.php @@ -6,10 +6,10 @@ /** * This class stands for SellingStatusType StructType - * Meta informations extracted from the WSDL - * - documentation: Contains the listed items price details which consists of following information: BuyItNowPrice, ConvertedBuyItNowPrice, ConvertedPrice, ConvertedStartPrice, CurrentPrice, MinimumToBid, ReservePrice, and StartPrice. need to take in - * account get seller events when defining minoccurs = 0 | Contains one User node representing the current high bidder. GetItem returns a high bidder for auctions that have ended and have a winning bidder. For Fixed Price listings, in-progress auctions, - * or auction items that received no bids, GetItem returns a HighBidder node with empty tags. + * Meta information extracted from the WSDL + * - documentation: Contains one User node representing the current high bidder. GetItem returns a high bidder for auctions that have ended and have a winning bidder. For Fixed Price listings, in-progress auctions, or auction items that received no + * bids, GetItem returns a HighBidder node with empty tags. | Contains the listed items price details which consists of following information: BuyItNowPrice, ConvertedBuyItNowPrice, ConvertedPrice, ConvertedStartPrice, CurrentPrice, MinimumToBid, + * ReservePrice, and StartPrice. need to take in account get seller events when defining minoccurs = 0 * @subpackage Structs * @author WsdlToPhp */ @@ -17,7 +17,7 @@ class SellingStatusType extends AbstractStructBase { /** * The BidCount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Number of bids placed so far against the item. Not returned for International Fixed Price items. * - minOccurs: 0 * @var int @@ -25,7 +25,7 @@ class SellingStatusType extends AbstractStructBase public $BidCount; /** * The BidIncrement - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Smallest amount a bid must be above the current high bid. Not returned International Fixed Price items. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -33,7 +33,7 @@ class SellingStatusType extends AbstractStructBase public $BidIncrement; /** * The ConvertedCurrentPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Converted current price of listed item. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -41,7 +41,7 @@ class SellingStatusType extends AbstractStructBase public $ConvertedCurrentPrice; /** * The CurrentPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: For auction-format listings, current minimum asking price or the current highest bid for the item if bids have been placed. Shows minimum bid if no bids have been placed against the item. This field does not reflect the actual * current price of the item if it's a Type=7 or Type=9 (Fixed Price) item and the price has been revised. (See StartPrice for revised asking price.) * @var \PayPal\StructType\AmountType @@ -49,7 +49,7 @@ class SellingStatusType extends AbstractStructBase public $CurrentPrice; /** * The HighBidder - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:HighBidder * @var \PayPal\StructType\UserType @@ -57,7 +57,7 @@ class SellingStatusType extends AbstractStructBase public $HighBidder; /** * The LeadCount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Applicable to ad-format items only. Indicates how many leads to potential buyers are associated with this item. For other item types (other than ad-format items), returns a value of 0 (zero). * - minOccurs: 0 * @var int @@ -65,7 +65,7 @@ class SellingStatusType extends AbstractStructBase public $LeadCount; /** * The MinimumToBid - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Minimum acceptable bid for the item. Not returned for International Fixed Price items. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -73,14 +73,14 @@ class SellingStatusType extends AbstractStructBase public $MinimumToBid; /** * The QuantitySold - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Number of items purchased so far. (Subtract from the value returned in the Quantity field to calculate the number of items remaining.) * @var int */ public $QuantitySold; /** * The ReserveMet - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Returns true if the reserve price was met or no reserve price was specified. * - minOccurs: 0 * @var bool @@ -88,7 +88,7 @@ class SellingStatusType extends AbstractStructBase public $ReserveMet; /** * The SecondChanceEligible - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ @@ -146,8 +146,8 @@ public function getBidCount() public function setBidCount($bidCount = null) { // validation for constraint: int - if (!is_null($bidCount) && !is_numeric($bidCount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($bidCount)), __LINE__); + if (!is_null($bidCount) && !(is_int($bidCount) || ctype_digit($bidCount))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($bidCount, true), gettype($bidCount)), __LINE__); } $this->BidCount = $bidCount; return $this; @@ -240,8 +240,8 @@ public function getLeadCount() public function setLeadCount($leadCount = null) { // validation for constraint: int - if (!is_null($leadCount) && !is_numeric($leadCount)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($leadCount)), __LINE__); + if (!is_null($leadCount) && !(is_int($leadCount) || ctype_digit($leadCount))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($leadCount, true), gettype($leadCount)), __LINE__); } $this->LeadCount = $leadCount; return $this; @@ -280,8 +280,8 @@ public function getQuantitySold() public function setQuantitySold($quantitySold = null) { // validation for constraint: int - if (!is_null($quantitySold) && !is_numeric($quantitySold)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($quantitySold)), __LINE__); + if (!is_null($quantitySold) && !(is_int($quantitySold) || ctype_digit($quantitySold))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($quantitySold, true), gettype($quantitySold)), __LINE__); } $this->QuantitySold = $quantitySold; return $this; @@ -303,7 +303,7 @@ public function setReserveMet($reserveMet = null) { // validation for constraint: boolean if (!is_null($reserveMet) && !is_bool($reserveMet)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($reserveMet)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($reserveMet, true), gettype($reserveMet)), __LINE__); } $this->ReserveMet = $reserveMet; return $this; @@ -325,7 +325,7 @@ public function setSecondChanceEligible($secondChanceEligible = null) { // validation for constraint: boolean if (!is_null($secondChanceEligible) && !is_bool($secondChanceEligible)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($secondChanceEligible)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($secondChanceEligible, true), gettype($secondChanceEligible)), __LINE__); } $this->SecondChanceEligible = $secondChanceEligible; return $this; diff --git a/src/StructType/SenderDetailsType.php b/src/StructType/SenderDetailsType.php index 3c4c970..42f9b22 100644 --- a/src/StructType/SenderDetailsType.php +++ b/src/StructType/SenderDetailsType.php @@ -13,7 +13,7 @@ class SenderDetailsType extends AbstractStructBase { /** * The DeviceDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\DeviceDetailsType */ diff --git a/src/StructType/SetAccessPermissionsReq.php b/src/StructType/SetAccessPermissionsReq.php index 34a12e1..81260d1 100644 --- a/src/StructType/SetAccessPermissionsReq.php +++ b/src/StructType/SetAccessPermissionsReq.php @@ -13,7 +13,7 @@ class SetAccessPermissionsReq extends AbstractStructBase { /** * The SetAccessPermissionsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:SetAccessPermissionsRequest * @var \PayPal\StructType\SetAccessPermissionsRequestType */ diff --git a/src/StructType/SetAccessPermissionsRequestDetailsType.php b/src/StructType/SetAccessPermissionsRequestDetailsType.php index 7466d5d..a8b3caa 100644 --- a/src/StructType/SetAccessPermissionsRequestDetailsType.php +++ b/src/StructType/SetAccessPermissionsRequestDetailsType.php @@ -13,28 +13,28 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase { /** * The ReturnURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer's browser is returned after choosing to login with PayPal. Required Character length and limitations: no limit. * @var string */ public $ReturnURL; /** * The CancelURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer is returned if he does not approve the use of PayPal login. Required Character length and limitations: no limit * @var string */ public $CancelURL; /** * The LogoutURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer's browser is returned after user logs out from PayPal. Required Character length and limitations: no limit. * @var string */ public $LogoutURL; /** * The InitFlowType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The type of the flow. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -42,7 +42,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $InitFlowType; /** * The SkipLoginPage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The used to decide SkipLogin allowed or not. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -50,7 +50,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $SkipLoginPage; /** * The RequiredAccessPermissions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: contains information about API Services * - maxOccurs: unbounded * - minOccurs: 0 @@ -59,7 +59,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $RequiredAccessPermissions; /** * The OptionalAccessPermissions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: contains information about API Services * - maxOccurs: unbounded * - minOccurs: 0 @@ -68,7 +68,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $OptionalAccessPermissions; /** * The LocaleCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Locale of pages displayed by PayPal during Authentication Login. Optional Character length and limitations: Five single-byte alphabetic characters, upper- or lowercase. Allowable values: AU or en_AUDE or de_DEFR or fr_FRGB or en_GBIT * or it_ITJP or ja_JPUS or en_US * - minOccurs: 0 @@ -77,7 +77,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $LocaleCode; /** * The PageStyle - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the Custom Payment Page Style for flow pages associated with this button/link. PageStyle corresponds to the HTML variable page_style for customizing flow pages. The value is the same as the Page Style Name you chose when adding * or editing the page style from the Profile subtab of the My Account tab of your PayPal account. Optional Character length and limitations: 30 single-byte alphabetic characters. * - minOccurs: 0 @@ -86,7 +86,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $PageStyle; /** * The cpp_header_image - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A URL for the image you want to appear at the top left of the flow page. The image has a maximum size of 750 pixels wide by 90 pixels high. PayPal recommends that you provide an image that is stored on a secure (https) server. * Optional Character length and limitations: 127 * - minOccurs: 0 @@ -95,7 +95,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $cpp_header_image; /** * The cpp_header_border_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the border color around the header of the flow page. The border is a 2-pixel perimeter around the header space, which is 750 pixels wide by 90 pixels high. Optional Character length and limitations: Six character HTML * hexadecimal color code in ASCII * - minOccurs: 0 @@ -104,7 +104,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $cpp_header_border_color; /** * The cpp_header_back_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the background color for the header of the flow page. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -112,7 +112,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $cpp_header_back_color; /** * The cpp_payflow_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the background color for the payment page. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -120,7 +120,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $cpp_payflow_color; /** * The FirstName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: First Name of the user, this information is used if user chooses to signup with PayPal. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -128,7 +128,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $FirstName; /** * The LastName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Last Name of the user, this information is used if user chooses to signup with PayPal. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -136,7 +136,7 @@ class SetAccessPermissionsRequestDetailsType extends AbstractStructBase public $LastName; /** * The Address - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: User address, this information is used when user chooses to signup for PayPal. Optional If you include a shipping address and set the AddressOverride element on the request, PayPal returns this same address in * GetExpressCheckoutDetailsResponse. * - minOccurs: 0 @@ -215,7 +215,7 @@ public function setReturnURL($returnURL = null) { // validation for constraint: string if (!is_null($returnURL) && !is_string($returnURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($returnURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($returnURL, true), gettype($returnURL)), __LINE__); } $this->ReturnURL = $returnURL; return $this; @@ -237,7 +237,7 @@ public function setCancelURL($cancelURL = null) { // validation for constraint: string if (!is_null($cancelURL) && !is_string($cancelURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cancelURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cancelURL, true), gettype($cancelURL)), __LINE__); } $this->CancelURL = $cancelURL; return $this; @@ -259,7 +259,7 @@ public function setLogoutURL($logoutURL = null) { // validation for constraint: string if (!is_null($logoutURL) && !is_string($logoutURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($logoutURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($logoutURL, true), gettype($logoutURL)), __LINE__); } $this->LogoutURL = $logoutURL; return $this; @@ -281,7 +281,7 @@ public function setInitFlowType($initFlowType = null) { // validation for constraint: string if (!is_null($initFlowType) && !is_string($initFlowType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($initFlowType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($initFlowType, true), gettype($initFlowType)), __LINE__); } $this->InitFlowType = $initFlowType; return $this; @@ -303,7 +303,7 @@ public function setSkipLoginPage($skipLoginPage = null) { // validation for constraint: string if (!is_null($skipLoginPage) && !is_string($skipLoginPage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($skipLoginPage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($skipLoginPage, true), gettype($skipLoginPage)), __LINE__); } $this->SkipLoginPage = $skipLoginPage; return $this; @@ -316,6 +316,28 @@ public function getRequiredAccessPermissions() { return $this->RequiredAccessPermissions; } + /** + * This method is responsible for validating the values passed to the setRequiredAccessPermissions method + * This method is willingly generated in order to preserve the one-line inline validation within the setRequiredAccessPermissions method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateRequiredAccessPermissionsForArrayConstraintsFromSetRequiredAccessPermissions(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem) { + // validation for constraint: itemType + if (!is_string($setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem)) { + $invalidValues[] = is_object($setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem) ? get_class($setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem) : sprintf('%s(%s)', gettype($setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem), var_export($setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The RequiredAccessPermissions property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set RequiredAccessPermissions value * @throws \InvalidArgumentException @@ -324,11 +346,9 @@ public function getRequiredAccessPermissions() */ public function setRequiredAccessPermissions(array $requiredAccessPermissions = array()) { - foreach ($requiredAccessPermissions as $setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem) { - // validation for constraint: itemType - if (!is_string($setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem)) { - throw new \InvalidArgumentException(sprintf('The RequiredAccessPermissions property can only contain items of string, "%s" given', is_object($setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem) ? get_class($setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem) : gettype($setAccessPermissionsRequestDetailsTypeRequiredAccessPermissionsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($requiredAccessPermissionsArrayErrorMessage = self::validateRequiredAccessPermissionsForArrayConstraintsFromSetRequiredAccessPermissions($requiredAccessPermissions))) { + throw new \InvalidArgumentException($requiredAccessPermissionsArrayErrorMessage, __LINE__); } $this->RequiredAccessPermissions = $requiredAccessPermissions; return $this; @@ -343,7 +363,7 @@ public function addToRequiredAccessPermissions($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The RequiredAccessPermissions property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The RequiredAccessPermissions property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->RequiredAccessPermissions[] = $item; return $this; @@ -356,6 +376,28 @@ public function getOptionalAccessPermissions() { return $this->OptionalAccessPermissions; } + /** + * This method is responsible for validating the values passed to the setOptionalAccessPermissions method + * This method is willingly generated in order to preserve the one-line inline validation within the setOptionalAccessPermissions method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateOptionalAccessPermissionsForArrayConstraintsFromSetOptionalAccessPermissions(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem) { + // validation for constraint: itemType + if (!is_string($setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem)) { + $invalidValues[] = is_object($setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem) ? get_class($setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem) : sprintf('%s(%s)', gettype($setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem), var_export($setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The OptionalAccessPermissions property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set OptionalAccessPermissions value * @throws \InvalidArgumentException @@ -364,11 +406,9 @@ public function getOptionalAccessPermissions() */ public function setOptionalAccessPermissions(array $optionalAccessPermissions = array()) { - foreach ($optionalAccessPermissions as $setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem) { - // validation for constraint: itemType - if (!is_string($setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem)) { - throw new \InvalidArgumentException(sprintf('The OptionalAccessPermissions property can only contain items of string, "%s" given', is_object($setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem) ? get_class($setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem) : gettype($setAccessPermissionsRequestDetailsTypeOptionalAccessPermissionsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($optionalAccessPermissionsArrayErrorMessage = self::validateOptionalAccessPermissionsForArrayConstraintsFromSetOptionalAccessPermissions($optionalAccessPermissions))) { + throw new \InvalidArgumentException($optionalAccessPermissionsArrayErrorMessage, __LINE__); } $this->OptionalAccessPermissions = $optionalAccessPermissions; return $this; @@ -383,7 +423,7 @@ public function addToOptionalAccessPermissions($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The OptionalAccessPermissions property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The OptionalAccessPermissions property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->OptionalAccessPermissions[] = $item; return $this; @@ -405,7 +445,7 @@ public function setLocaleCode($localeCode = null) { // validation for constraint: string if (!is_null($localeCode) && !is_string($localeCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($localeCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($localeCode, true), gettype($localeCode)), __LINE__); } $this->LocaleCode = $localeCode; return $this; @@ -427,7 +467,7 @@ public function setPageStyle($pageStyle = null) { // validation for constraint: string if (!is_null($pageStyle) && !is_string($pageStyle)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pageStyle)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pageStyle, true), gettype($pageStyle)), __LINE__); } $this->PageStyle = $pageStyle; return $this; @@ -449,7 +489,7 @@ public function setCpp_header_image($cpp_header_image = null) { // validation for constraint: string if (!is_null($cpp_header_image) && !is_string($cpp_header_image)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_image)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_image, true), gettype($cpp_header_image)), __LINE__); } $this->cpp_header_image = $this->{'cpp-header-image'} = $cpp_header_image; return $this; @@ -471,7 +511,7 @@ public function setCpp_header_border_color($cpp_header_border_color = null) { // validation for constraint: string if (!is_null($cpp_header_border_color) && !is_string($cpp_header_border_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_border_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_border_color, true), gettype($cpp_header_border_color)), __LINE__); } $this->cpp_header_border_color = $this->{'cpp-header-border-color'} = $cpp_header_border_color; return $this; @@ -493,7 +533,7 @@ public function setCpp_header_back_color($cpp_header_back_color = null) { // validation for constraint: string if (!is_null($cpp_header_back_color) && !is_string($cpp_header_back_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_back_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_back_color, true), gettype($cpp_header_back_color)), __LINE__); } $this->cpp_header_back_color = $this->{'cpp-header-back-color'} = $cpp_header_back_color; return $this; @@ -515,7 +555,7 @@ public function setCpp_payflow_color($cpp_payflow_color = null) { // validation for constraint: string if (!is_null($cpp_payflow_color) && !is_string($cpp_payflow_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_payflow_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_payflow_color, true), gettype($cpp_payflow_color)), __LINE__); } $this->cpp_payflow_color = $this->{'cpp-payflow-color'} = $cpp_payflow_color; return $this; @@ -537,7 +577,7 @@ public function setFirstName($firstName = null) { // validation for constraint: string if (!is_null($firstName) && !is_string($firstName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($firstName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($firstName, true), gettype($firstName)), __LINE__); } $this->FirstName = $firstName; return $this; @@ -559,7 +599,7 @@ public function setLastName($lastName = null) { // validation for constraint: string if (!is_null($lastName) && !is_string($lastName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastName, true), gettype($lastName)), __LINE__); } $this->LastName = $lastName; return $this; diff --git a/src/StructType/SetAccessPermissionsRequestType.php b/src/StructType/SetAccessPermissionsRequestType.php index 69f6136..a934924 100644 --- a/src/StructType/SetAccessPermissionsRequestType.php +++ b/src/StructType/SetAccessPermissionsRequestType.php @@ -13,7 +13,7 @@ class SetAccessPermissionsRequestType extends AbstractRequestType { /** * The SetAccessPermissionsRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:SetAccessPermissionsRequestDetails diff --git a/src/StructType/SetAccessPermissionsResponseType.php b/src/StructType/SetAccessPermissionsResponseType.php index c113339..697793d 100644 --- a/src/StructType/SetAccessPermissionsResponseType.php +++ b/src/StructType/SetAccessPermissionsResponseType.php @@ -13,8 +13,9 @@ class SetAccessPermissionsResponseType extends AbstractResponseType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A timestamped token by which you identify to PayPal that you are processing this user. The token expires after three hours. Character length and limitations: 20 single-byte characters + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -47,7 +48,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/SetAuthFlowParamReq.php b/src/StructType/SetAuthFlowParamReq.php index 194d4e8..eb79f59 100644 --- a/src/StructType/SetAuthFlowParamReq.php +++ b/src/StructType/SetAuthFlowParamReq.php @@ -13,7 +13,7 @@ class SetAuthFlowParamReq extends AbstractStructBase { /** * The SetAuthFlowParamRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:SetAuthFlowParamRequest * @var \PayPal\StructType\SetAuthFlowParamRequestType */ diff --git a/src/StructType/SetAuthFlowParamRequestDetailsType.php b/src/StructType/SetAuthFlowParamRequestDetailsType.php index f12a5ae..0452608 100644 --- a/src/StructType/SetAuthFlowParamRequestDetailsType.php +++ b/src/StructType/SetAuthFlowParamRequestDetailsType.php @@ -13,28 +13,28 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase { /** * The ReturnURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer's browser is returned after choosing to login with PayPal. Required Character length and limitations: no limit. * @var string */ public $ReturnURL; /** * The CancelURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer is returned if he does not approve the use of PayPal login. Required Character length and limitations: no limit * @var string */ public $CancelURL; /** * The LogoutURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer's browser is returned after user logs out from PayPal. Required Character length and limitations: no limit. * @var string */ public $LogoutURL; /** * The InitFlowType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The type of the flow. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -42,7 +42,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $InitFlowType; /** * The SkipLoginPage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The used to decide SkipLogin allowed or not. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -50,7 +50,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $SkipLoginPage; /** * The ServiceName1 - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The name of the field Merchant requires from PayPal after user's login. Optional Character length and limitations: 256 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -58,7 +58,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $ServiceName1; /** * The ServiceDefReq1 - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Whether the field is required, opt-in or opt-out. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -66,7 +66,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $ServiceDefReq1; /** * The ServiceName2 - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The name of the field Merchant requires from PayPal after user's login. Optional Character length and limitations: 256 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -74,7 +74,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $ServiceName2; /** * The ServiceDefReq2 - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Whether the field is required, opt-in or opt-out. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -82,7 +82,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $ServiceDefReq2; /** * The LocaleCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Locale of pages displayed by PayPal during Authentication Login. Optional Character length and limitations: Five single-byte alphabetic characters, upper- or lowercase. Allowable values: AU or en_AUDE or de_DEFR or fr_FRGB or en_GBIT * or it_ITJP or ja_JPUS or en_US * - minOccurs: 0 @@ -91,7 +91,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $LocaleCode; /** * The PageStyle - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the Custom Payment Page Style for flow pages associated with this button/link. PageStyle corresponds to the HTML variable page_style for customizing flow pages. The value is the same as the Page Style Name you chose when adding * or editing the page style from the Profile subtab of the My Account tab of your PayPal account. Optional Character length and limitations: 30 single-byte alphabetic characters. * - minOccurs: 0 @@ -100,7 +100,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $PageStyle; /** * The cpp_header_image - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A URL for the image you want to appear at the top left of the flow page. The image has a maximum size of 750 pixels wide by 90 pixels high. PayPal recommends that you provide an image that is stored on a secure (https) server. * Optional Character length and limitations: 127 * - minOccurs: 0 @@ -109,7 +109,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $cpp_header_image; /** * The cpp_header_border_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the border color around the header of the flow page. The border is a 2-pixel perimeter around the header space, which is 750 pixels wide by 90 pixels high. Optional Character length and limitations: Six character HTML * hexadecimal color code in ASCII * - minOccurs: 0 @@ -118,7 +118,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $cpp_header_border_color; /** * The cpp_header_back_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the background color for the header of the flow page. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -126,7 +126,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $cpp_header_back_color; /** * The cpp_payflow_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the background color for the payment page. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -134,7 +134,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $cpp_payflow_color; /** * The FirstName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: First Name of the user, this information is used if user chooses to signup with PayPal. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -142,7 +142,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $FirstName; /** * The LastName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Last Name of the user, this information is used if user chooses to signup with PayPal. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -150,7 +150,7 @@ class SetAuthFlowParamRequestDetailsType extends AbstractStructBase public $LastName; /** * The Address - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: User address, this information is used when user chooses to signup for PayPal. Optional If you include a shipping address and set the AddressOverride element on the request, PayPal returns this same address in * GetExpressCheckoutDetailsResponse. * - minOccurs: 0 @@ -235,7 +235,7 @@ public function setReturnURL($returnURL = null) { // validation for constraint: string if (!is_null($returnURL) && !is_string($returnURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($returnURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($returnURL, true), gettype($returnURL)), __LINE__); } $this->ReturnURL = $returnURL; return $this; @@ -257,7 +257,7 @@ public function setCancelURL($cancelURL = null) { // validation for constraint: string if (!is_null($cancelURL) && !is_string($cancelURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cancelURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cancelURL, true), gettype($cancelURL)), __LINE__); } $this->CancelURL = $cancelURL; return $this; @@ -279,7 +279,7 @@ public function setLogoutURL($logoutURL = null) { // validation for constraint: string if (!is_null($logoutURL) && !is_string($logoutURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($logoutURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($logoutURL, true), gettype($logoutURL)), __LINE__); } $this->LogoutURL = $logoutURL; return $this; @@ -301,7 +301,7 @@ public function setInitFlowType($initFlowType = null) { // validation for constraint: string if (!is_null($initFlowType) && !is_string($initFlowType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($initFlowType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($initFlowType, true), gettype($initFlowType)), __LINE__); } $this->InitFlowType = $initFlowType; return $this; @@ -323,7 +323,7 @@ public function setSkipLoginPage($skipLoginPage = null) { // validation for constraint: string if (!is_null($skipLoginPage) && !is_string($skipLoginPage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($skipLoginPage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($skipLoginPage, true), gettype($skipLoginPage)), __LINE__); } $this->SkipLoginPage = $skipLoginPage; return $this; @@ -345,7 +345,7 @@ public function setServiceName1($serviceName1 = null) { // validation for constraint: string if (!is_null($serviceName1) && !is_string($serviceName1)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($serviceName1)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($serviceName1, true), gettype($serviceName1)), __LINE__); } $this->ServiceName1 = $serviceName1; return $this; @@ -367,7 +367,7 @@ public function setServiceDefReq1($serviceDefReq1 = null) { // validation for constraint: string if (!is_null($serviceDefReq1) && !is_string($serviceDefReq1)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($serviceDefReq1)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($serviceDefReq1, true), gettype($serviceDefReq1)), __LINE__); } $this->ServiceDefReq1 = $serviceDefReq1; return $this; @@ -389,7 +389,7 @@ public function setServiceName2($serviceName2 = null) { // validation for constraint: string if (!is_null($serviceName2) && !is_string($serviceName2)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($serviceName2)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($serviceName2, true), gettype($serviceName2)), __LINE__); } $this->ServiceName2 = $serviceName2; return $this; @@ -411,7 +411,7 @@ public function setServiceDefReq2($serviceDefReq2 = null) { // validation for constraint: string if (!is_null($serviceDefReq2) && !is_string($serviceDefReq2)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($serviceDefReq2)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($serviceDefReq2, true), gettype($serviceDefReq2)), __LINE__); } $this->ServiceDefReq2 = $serviceDefReq2; return $this; @@ -433,7 +433,7 @@ public function setLocaleCode($localeCode = null) { // validation for constraint: string if (!is_null($localeCode) && !is_string($localeCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($localeCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($localeCode, true), gettype($localeCode)), __LINE__); } $this->LocaleCode = $localeCode; return $this; @@ -455,7 +455,7 @@ public function setPageStyle($pageStyle = null) { // validation for constraint: string if (!is_null($pageStyle) && !is_string($pageStyle)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pageStyle)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pageStyle, true), gettype($pageStyle)), __LINE__); } $this->PageStyle = $pageStyle; return $this; @@ -477,7 +477,7 @@ public function setCpp_header_image($cpp_header_image = null) { // validation for constraint: string if (!is_null($cpp_header_image) && !is_string($cpp_header_image)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_image)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_image, true), gettype($cpp_header_image)), __LINE__); } $this->cpp_header_image = $this->{'cpp-header-image'} = $cpp_header_image; return $this; @@ -499,7 +499,7 @@ public function setCpp_header_border_color($cpp_header_border_color = null) { // validation for constraint: string if (!is_null($cpp_header_border_color) && !is_string($cpp_header_border_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_border_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_border_color, true), gettype($cpp_header_border_color)), __LINE__); } $this->cpp_header_border_color = $this->{'cpp-header-border-color'} = $cpp_header_border_color; return $this; @@ -521,7 +521,7 @@ public function setCpp_header_back_color($cpp_header_back_color = null) { // validation for constraint: string if (!is_null($cpp_header_back_color) && !is_string($cpp_header_back_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_back_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_back_color, true), gettype($cpp_header_back_color)), __LINE__); } $this->cpp_header_back_color = $this->{'cpp-header-back-color'} = $cpp_header_back_color; return $this; @@ -543,7 +543,7 @@ public function setCpp_payflow_color($cpp_payflow_color = null) { // validation for constraint: string if (!is_null($cpp_payflow_color) && !is_string($cpp_payflow_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_payflow_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_payflow_color, true), gettype($cpp_payflow_color)), __LINE__); } $this->cpp_payflow_color = $this->{'cpp-payflow-color'} = $cpp_payflow_color; return $this; @@ -565,7 +565,7 @@ public function setFirstName($firstName = null) { // validation for constraint: string if (!is_null($firstName) && !is_string($firstName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($firstName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($firstName, true), gettype($firstName)), __LINE__); } $this->FirstName = $firstName; return $this; @@ -587,7 +587,7 @@ public function setLastName($lastName = null) { // validation for constraint: string if (!is_null($lastName) && !is_string($lastName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastName, true), gettype($lastName)), __LINE__); } $this->LastName = $lastName; return $this; diff --git a/src/StructType/SetAuthFlowParamRequestType.php b/src/StructType/SetAuthFlowParamRequestType.php index 3462d0d..560b619 100644 --- a/src/StructType/SetAuthFlowParamRequestType.php +++ b/src/StructType/SetAuthFlowParamRequestType.php @@ -13,7 +13,7 @@ class SetAuthFlowParamRequestType extends AbstractRequestType { /** * The SetAuthFlowParamRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:SetAuthFlowParamRequestDetails diff --git a/src/StructType/SetAuthFlowParamResponseType.php b/src/StructType/SetAuthFlowParamResponseType.php index b44e3b5..79b49b5 100644 --- a/src/StructType/SetAuthFlowParamResponseType.php +++ b/src/StructType/SetAuthFlowParamResponseType.php @@ -13,8 +13,9 @@ class SetAuthFlowParamResponseType extends AbstractResponseType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A timestamped token by which you identify to PayPal that you are processing this user. The token expires after three hours. Character length and limitations: 20 single-byte characters + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -47,7 +48,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/SetCustomerBillingAgreementReq.php b/src/StructType/SetCustomerBillingAgreementReq.php index c383cef..355a5a4 100644 --- a/src/StructType/SetCustomerBillingAgreementReq.php +++ b/src/StructType/SetCustomerBillingAgreementReq.php @@ -13,7 +13,7 @@ class SetCustomerBillingAgreementReq extends AbstractStructBase { /** * The SetCustomerBillingAgreementRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:SetCustomerBillingAgreementRequest * @var \PayPal\StructType\SetCustomerBillingAgreementRequestType */ diff --git a/src/StructType/SetCustomerBillingAgreementRequestDetailsType.php b/src/StructType/SetCustomerBillingAgreementRequestDetailsType.php index 4e07074..ef357da 100644 --- a/src/StructType/SetCustomerBillingAgreementRequestDetailsType.php +++ b/src/StructType/SetCustomerBillingAgreementRequestDetailsType.php @@ -13,7 +13,7 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase { /** * The BillingAgreementDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var \PayPal\StructType\BillingAgreementDetailsType @@ -21,7 +21,7 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase public $BillingAgreementDetails; /** * The ReturnURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -29,7 +29,7 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase public $ReturnURL; /** * The CancelURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -37,7 +37,7 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase public $CancelURL; /** * The LocaleCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -45,7 +45,7 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase public $LocaleCode; /** * The PageStyle - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -53,7 +53,7 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase public $PageStyle; /** * The cpp_header_image - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -61,7 +61,7 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase public $cpp_header_image; /** * The cpp_header_border_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -69,7 +69,7 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase public $cpp_header_border_color; /** * The cpp_header_back_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -77,7 +77,7 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase public $cpp_header_back_color; /** * The cpp_payflow_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -85,7 +85,8 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase public $cpp_payflow_color; /** * The BuyerEmail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -93,7 +94,7 @@ class SetCustomerBillingAgreementRequestDetailsType extends AbstractStructBase public $BuyerEmail; /** * The ReqBillingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that you require that the customer's billing address on file. Setting this element overrides the setting you have specified in Admin. Optional Character length and limitations: One single-byte numeric character. * - minOccurs: 0 * @var string @@ -174,7 +175,7 @@ public function setReturnURL($returnURL = null) { // validation for constraint: string if (!is_null($returnURL) && !is_string($returnURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($returnURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($returnURL, true), gettype($returnURL)), __LINE__); } $this->ReturnURL = $returnURL; return $this; @@ -196,7 +197,7 @@ public function setCancelURL($cancelURL = null) { // validation for constraint: string if (!is_null($cancelURL) && !is_string($cancelURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cancelURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cancelURL, true), gettype($cancelURL)), __LINE__); } $this->CancelURL = $cancelURL; return $this; @@ -218,7 +219,7 @@ public function setLocaleCode($localeCode = null) { // validation for constraint: string if (!is_null($localeCode) && !is_string($localeCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($localeCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($localeCode, true), gettype($localeCode)), __LINE__); } $this->LocaleCode = $localeCode; return $this; @@ -240,7 +241,7 @@ public function setPageStyle($pageStyle = null) { // validation for constraint: string if (!is_null($pageStyle) && !is_string($pageStyle)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pageStyle)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pageStyle, true), gettype($pageStyle)), __LINE__); } $this->PageStyle = $pageStyle; return $this; @@ -262,7 +263,7 @@ public function setCpp_header_image($cpp_header_image = null) { // validation for constraint: string if (!is_null($cpp_header_image) && !is_string($cpp_header_image)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_image)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_image, true), gettype($cpp_header_image)), __LINE__); } $this->cpp_header_image = $this->{'cpp-header-image'} = $cpp_header_image; return $this; @@ -284,7 +285,7 @@ public function setCpp_header_border_color($cpp_header_border_color = null) { // validation for constraint: string if (!is_null($cpp_header_border_color) && !is_string($cpp_header_border_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_border_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_border_color, true), gettype($cpp_header_border_color)), __LINE__); } $this->cpp_header_border_color = $this->{'cpp-header-border-color'} = $cpp_header_border_color; return $this; @@ -306,7 +307,7 @@ public function setCpp_header_back_color($cpp_header_back_color = null) { // validation for constraint: string if (!is_null($cpp_header_back_color) && !is_string($cpp_header_back_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_back_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_back_color, true), gettype($cpp_header_back_color)), __LINE__); } $this->cpp_header_back_color = $this->{'cpp-header-back-color'} = $cpp_header_back_color; return $this; @@ -328,7 +329,7 @@ public function setCpp_payflow_color($cpp_payflow_color = null) { // validation for constraint: string if (!is_null($cpp_payflow_color) && !is_string($cpp_payflow_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_payflow_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_payflow_color, true), gettype($cpp_payflow_color)), __LINE__); } $this->cpp_payflow_color = $this->{'cpp-payflow-color'} = $cpp_payflow_color; return $this; @@ -350,7 +351,7 @@ public function setBuyerEmail($buyerEmail = null) { // validation for constraint: string if (!is_null($buyerEmail) && !is_string($buyerEmail)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerEmail)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerEmail, true), gettype($buyerEmail)), __LINE__); } $this->BuyerEmail = $buyerEmail; return $this; @@ -372,7 +373,7 @@ public function setReqBillingAddress($reqBillingAddress = null) { // validation for constraint: string if (!is_null($reqBillingAddress) && !is_string($reqBillingAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reqBillingAddress)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reqBillingAddress, true), gettype($reqBillingAddress)), __LINE__); } $this->ReqBillingAddress = $reqBillingAddress; return $this; diff --git a/src/StructType/SetCustomerBillingAgreementRequestType.php b/src/StructType/SetCustomerBillingAgreementRequestType.php index 1e3a54a..e2e9450 100644 --- a/src/StructType/SetCustomerBillingAgreementRequestType.php +++ b/src/StructType/SetCustomerBillingAgreementRequestType.php @@ -13,7 +13,7 @@ class SetCustomerBillingAgreementRequestType extends AbstractRequestType { /** * The SetCustomerBillingAgreementRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:SetCustomerBillingAgreementRequestDetails diff --git a/src/StructType/SetCustomerBillingAgreementResponseType.php b/src/StructType/SetCustomerBillingAgreementResponseType.php index c158a37..9a253bb 100644 --- a/src/StructType/SetCustomerBillingAgreementResponseType.php +++ b/src/StructType/SetCustomerBillingAgreementResponseType.php @@ -13,7 +13,8 @@ class SetCustomerBillingAgreementResponseType extends AbstractResponseType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -46,7 +47,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/SetDataRequestType.php b/src/StructType/SetDataRequestType.php index 88802b1..df57107 100644 --- a/src/StructType/SetDataRequestType.php +++ b/src/StructType/SetDataRequestType.php @@ -13,7 +13,7 @@ class SetDataRequestType extends AbstractStructBase { /** * The BillingApprovalDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about Billing Agreements requested to be created. * - maxOccurs: unbounded * - minOccurs: 0 @@ -22,7 +22,7 @@ class SetDataRequestType extends AbstractStructBase public $BillingApprovalDetails; /** * The BuyerDetail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Only needed if Auto Authorization is requested. The authentication session token will be passed in here. * - maxOccurs: 1 * - minOccurs: 0 @@ -31,7 +31,7 @@ class SetDataRequestType extends AbstractStructBase public $BuyerDetail; /** * The InfoSharingDirectives - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Requests for specific buyer information like Billing Address to be returned through GetExpressCheckoutDetails should be specified under this. * - maxOccurs: 1 * - minOccurs: 0 @@ -40,7 +40,7 @@ class SetDataRequestType extends AbstractStructBase public $InfoSharingDirectives; /** * The RetrieveShippingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that you require to retrieve the customer's shipping address on file with PayPal. Any value other than 1 indicates that no such requirement. * - maxOccurs: 1 * - minOccurs: 0 @@ -49,7 +49,7 @@ class SetDataRequestType extends AbstractStructBase public $RetrieveShippingAddress; /** * The UserChannel - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: the value is required by ACS team to specify the channel which the partners are in. the channel will be used for risk assessment the value is defined in biz/User/value_object/Channel.oml Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -58,7 +58,7 @@ class SetDataRequestType extends AbstractStructBase public $UserChannel; /** * The ReqConfirmShipping - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that you require that the customer's shipping address on file with PayPal be a confirmed address. Any value other than 1 indicates that the customer's shipping address on file with PayPal need NOT be a confirmed * address. Setting this element overrides the setting you have specified in the recipient's Merchant Account Profile. Optional * - maxOccurs: 1 @@ -68,7 +68,7 @@ class SetDataRequestType extends AbstractStructBase public $ReqConfirmShipping; /** * The PaymentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the payment. * - maxOccurs: 10 * - minOccurs: 0 @@ -77,7 +77,7 @@ class SetDataRequestType extends AbstractStructBase public $PaymentDetails; /** * The ExternalPartnerTrackingDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An optional set of values related to tracking for external partner. * - maxOccurs: 1 * - minOccurs: 0 @@ -86,7 +86,7 @@ class SetDataRequestType extends AbstractStructBase public $ExternalPartnerTrackingDetails; /** * The URI - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URI(uniform resource identifier), the source from which the request is initiated. * - maxOccurs: 1 * - minOccurs: 0 @@ -135,6 +135,28 @@ public function getBillingApprovalDetails() { return $this->BillingApprovalDetails; } + /** + * This method is responsible for validating the values passed to the setBillingApprovalDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setBillingApprovalDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateBillingApprovalDetailsForArrayConstraintsFromSetBillingApprovalDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setDataRequestTypeBillingApprovalDetailsItem) { + // validation for constraint: itemType + if (!$setDataRequestTypeBillingApprovalDetailsItem instanceof \PayPal\StructType\BillingApprovalDetailsType) { + $invalidValues[] = is_object($setDataRequestTypeBillingApprovalDetailsItem) ? get_class($setDataRequestTypeBillingApprovalDetailsItem) : sprintf('%s(%s)', gettype($setDataRequestTypeBillingApprovalDetailsItem), var_export($setDataRequestTypeBillingApprovalDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The BillingApprovalDetails property can only contain items of type \PayPal\StructType\BillingApprovalDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set BillingApprovalDetails value * @throws \InvalidArgumentException @@ -143,11 +165,9 @@ public function getBillingApprovalDetails() */ public function setBillingApprovalDetails(array $billingApprovalDetails = array()) { - foreach ($billingApprovalDetails as $setDataRequestTypeBillingApprovalDetailsItem) { - // validation for constraint: itemType - if (!$setDataRequestTypeBillingApprovalDetailsItem instanceof \PayPal\StructType\BillingApprovalDetailsType) { - throw new \InvalidArgumentException(sprintf('The BillingApprovalDetails property can only contain items of \PayPal\StructType\BillingApprovalDetailsType, "%s" given', is_object($setDataRequestTypeBillingApprovalDetailsItem) ? get_class($setDataRequestTypeBillingApprovalDetailsItem) : gettype($setDataRequestTypeBillingApprovalDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($billingApprovalDetailsArrayErrorMessage = self::validateBillingApprovalDetailsForArrayConstraintsFromSetBillingApprovalDetails($billingApprovalDetails))) { + throw new \InvalidArgumentException($billingApprovalDetailsArrayErrorMessage, __LINE__); } $this->BillingApprovalDetails = $billingApprovalDetails; return $this; @@ -162,7 +182,7 @@ public function addToBillingApprovalDetails(\PayPal\StructType\BillingApprovalDe { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\BillingApprovalDetailsType) { - throw new \InvalidArgumentException(sprintf('The BillingApprovalDetails property can only contain items of \PayPal\StructType\BillingApprovalDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The BillingApprovalDetails property can only contain items of type \PayPal\StructType\BillingApprovalDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->BillingApprovalDetails[] = $item; return $this; @@ -220,7 +240,7 @@ public function setRetrieveShippingAddress($retrieveShippingAddress = null) { // validation for constraint: boolean if (!is_null($retrieveShippingAddress) && !is_bool($retrieveShippingAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($retrieveShippingAddress)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($retrieveShippingAddress, true), gettype($retrieveShippingAddress)), __LINE__); } $this->RetrieveShippingAddress = $retrieveShippingAddress; return $this; @@ -245,7 +265,7 @@ public function setUserChannel($userChannel = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\UserChannelCodeType::valueIsValid($userChannel)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $userChannel, implode(', ', \PayPal\EnumType\UserChannelCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\UserChannelCodeType', is_array($userChannel) ? implode(', ', $userChannel) : var_export($userChannel, true), implode(', ', \PayPal\EnumType\UserChannelCodeType::getValidValues())), __LINE__); } $this->UserChannel = $userChannel; return $this; @@ -267,7 +287,7 @@ public function setReqConfirmShipping($reqConfirmShipping = null) { // validation for constraint: boolean if (!is_null($reqConfirmShipping) && !is_bool($reqConfirmShipping)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($reqConfirmShipping)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($reqConfirmShipping, true), gettype($reqConfirmShipping)), __LINE__); } $this->ReqConfirmShipping = $reqConfirmShipping; return $this; @@ -280,6 +300,28 @@ public function getPaymentDetails() { return $this->PaymentDetails; } + /** + * This method is responsible for validating the values passed to the setPaymentDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentDetailsForArrayConstraintsFromSetPaymentDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setDataRequestTypePaymentDetailsItem) { + // validation for constraint: itemType + if (!$setDataRequestTypePaymentDetailsItem instanceof \PayPal\StructType\PaymentDetailsType) { + $invalidValues[] = is_object($setDataRequestTypePaymentDetailsItem) ? get_class($setDataRequestTypePaymentDetailsItem) : sprintf('%s(%s)', gettype($setDataRequestTypePaymentDetailsItem), var_export($setDataRequestTypePaymentDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentDetails value * @throws \InvalidArgumentException @@ -288,11 +330,13 @@ public function getPaymentDetails() */ public function setPaymentDetails(array $paymentDetails = array()) { - foreach ($paymentDetails as $setDataRequestTypePaymentDetailsItem) { - // validation for constraint: itemType - if (!$setDataRequestTypePaymentDetailsItem instanceof \PayPal\StructType\PaymentDetailsType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetails property can only contain items of \PayPal\StructType\PaymentDetailsType, "%s" given', is_object($setDataRequestTypePaymentDetailsItem) ? get_class($setDataRequestTypePaymentDetailsItem) : gettype($setDataRequestTypePaymentDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentDetailsArrayErrorMessage = self::validatePaymentDetailsForArrayConstraintsFromSetPaymentDetails($paymentDetails))) { + throw new \InvalidArgumentException($paymentDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($paymentDetails) && count($paymentDetails) > 10) { + 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__); } $this->PaymentDetails = $paymentDetails; return $this; @@ -307,7 +351,11 @@ public function addToPaymentDetails(\PayPal\StructType\PaymentDetailsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentDetailsType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetails property can only contain items of \PayPal\StructType\PaymentDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->PaymentDetails) && count($this->PaymentDetails) >= 10) { + 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__); } $this->PaymentDetails[] = $item; return $this; @@ -347,7 +395,7 @@ public function setURI($uRI = null) { // validation for constraint: string if (!is_null($uRI) && !is_string($uRI)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($uRI)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($uRI, true), gettype($uRI)), __LINE__); } $this->URI = $uRI; return $this; diff --git a/src/StructType/SetDataResponseType.php b/src/StructType/SetDataResponseType.php index cb223ab..acab764 100644 --- a/src/StructType/SetDataResponseType.php +++ b/src/StructType/SetDataResponseType.php @@ -13,8 +13,9 @@ class SetDataResponseType extends AbstractStructBase { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If Checkout session was initialized successfully, the corresponding token is returned in this element. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -22,7 +23,7 @@ class SetDataResponseType extends AbstractStructBase public $Token; /** * The ShippingAddresses - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var \PayPal\StructType\AddressType[] @@ -30,7 +31,7 @@ class SetDataResponseType extends AbstractStructBase public $ShippingAddresses; /** * The SetDataError - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var \PayPal\StructType\ErrorType[] @@ -69,7 +70,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; @@ -82,6 +83,28 @@ public function getShippingAddresses() { return $this->ShippingAddresses; } + /** + * This method is responsible for validating the values passed to the setShippingAddresses method + * This method is willingly generated in order to preserve the one-line inline validation within the setShippingAddresses method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateShippingAddressesForArrayConstraintsFromSetShippingAddresses(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setDataResponseTypeShippingAddressesItem) { + // validation for constraint: itemType + if (!$setDataResponseTypeShippingAddressesItem instanceof \PayPal\StructType\AddressType) { + $invalidValues[] = is_object($setDataResponseTypeShippingAddressesItem) ? get_class($setDataResponseTypeShippingAddressesItem) : sprintf('%s(%s)', gettype($setDataResponseTypeShippingAddressesItem), var_export($setDataResponseTypeShippingAddressesItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The ShippingAddresses property can only contain items of type \PayPal\StructType\AddressType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set ShippingAddresses value * @throws \InvalidArgumentException @@ -90,11 +113,9 @@ public function getShippingAddresses() */ public function setShippingAddresses(array $shippingAddresses = array()) { - foreach ($shippingAddresses as $setDataResponseTypeShippingAddressesItem) { - // validation for constraint: itemType - if (!$setDataResponseTypeShippingAddressesItem instanceof \PayPal\StructType\AddressType) { - throw new \InvalidArgumentException(sprintf('The ShippingAddresses property can only contain items of \PayPal\StructType\AddressType, "%s" given', is_object($setDataResponseTypeShippingAddressesItem) ? get_class($setDataResponseTypeShippingAddressesItem) : gettype($setDataResponseTypeShippingAddressesItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($shippingAddressesArrayErrorMessage = self::validateShippingAddressesForArrayConstraintsFromSetShippingAddresses($shippingAddresses))) { + throw new \InvalidArgumentException($shippingAddressesArrayErrorMessage, __LINE__); } $this->ShippingAddresses = $shippingAddresses; return $this; @@ -109,7 +130,7 @@ public function addToShippingAddresses(\PayPal\StructType\AddressType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\AddressType) { - throw new \InvalidArgumentException(sprintf('The ShippingAddresses property can only contain items of \PayPal\StructType\AddressType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The ShippingAddresses property can only contain items of type \PayPal\StructType\AddressType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->ShippingAddresses[] = $item; return $this; @@ -122,6 +143,28 @@ public function getSetDataError() { return $this->SetDataError; } + /** + * This method is responsible for validating the values passed to the setSetDataError method + * This method is willingly generated in order to preserve the one-line inline validation within the setSetDataError method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateSetDataErrorForArrayConstraintsFromSetSetDataError(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setDataResponseTypeSetDataErrorItem) { + // validation for constraint: itemType + if (!$setDataResponseTypeSetDataErrorItem instanceof \PayPal\StructType\ErrorType) { + $invalidValues[] = is_object($setDataResponseTypeSetDataErrorItem) ? get_class($setDataResponseTypeSetDataErrorItem) : sprintf('%s(%s)', gettype($setDataResponseTypeSetDataErrorItem), var_export($setDataResponseTypeSetDataErrorItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The SetDataError property can only contain items of type \PayPal\StructType\ErrorType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set SetDataError value * @throws \InvalidArgumentException @@ -130,11 +173,9 @@ public function getSetDataError() */ public function setSetDataError(array $setDataError = array()) { - foreach ($setDataError as $setDataResponseTypeSetDataErrorItem) { - // validation for constraint: itemType - if (!$setDataResponseTypeSetDataErrorItem instanceof \PayPal\StructType\ErrorType) { - throw new \InvalidArgumentException(sprintf('The SetDataError property can only contain items of \PayPal\StructType\ErrorType, "%s" given', is_object($setDataResponseTypeSetDataErrorItem) ? get_class($setDataResponseTypeSetDataErrorItem) : gettype($setDataResponseTypeSetDataErrorItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($setDataErrorArrayErrorMessage = self::validateSetDataErrorForArrayConstraintsFromSetSetDataError($setDataError))) { + throw new \InvalidArgumentException($setDataErrorArrayErrorMessage, __LINE__); } $this->SetDataError = $setDataError; return $this; @@ -149,7 +190,7 @@ public function addToSetDataError(\PayPal\StructType\ErrorType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\ErrorType) { - throw new \InvalidArgumentException(sprintf('The SetDataError property can only contain items of \PayPal\StructType\ErrorType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The SetDataError property can only contain items of type \PayPal\StructType\ErrorType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->SetDataError[] = $item; return $this; diff --git a/src/StructType/SetEbayMobileCheckoutRequestDetailsType.php b/src/StructType/SetEbayMobileCheckoutRequestDetailsType.php index 2adb1d1..0275b48 100644 --- a/src/StructType/SetEbayMobileCheckoutRequestDetailsType.php +++ b/src/StructType/SetEbayMobileCheckoutRequestDetailsType.php @@ -13,7 +13,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase { /** * The CheckoutType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 'Auction' indicates that user is coming to checkout after an auction ended. A value of 'BuyItNow' indicates if the user is coming to checkout by clicking on the 'buy it now' button in a chinese auction. A value of * 'FixedPriceItem' indicates that user clicked on 'Buy it now' on a fixed price item. A value of Autopay indicates autopay (or immediate pay) which is not supported at the moment. Required * - minOccurs: 1 @@ -22,7 +22,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase public $CheckoutType; /** * The ItemId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An item number assigned to the item in eBay database. Required Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 1 * @var string @@ -30,7 +30,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase public $ItemId; /** * The TransactionId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An Transaction id assigned to the item in eBay database. In case of Chinese auction Item Id itself indicates Transaction Id. Transaction Id in this case is Zero. Required Character length and limitations: 127 single-byte alphanumeric * characters * - minOccurs: 1 @@ -39,7 +39,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase public $TransactionId; /** * The SiteId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An id indicating the site on which the item was listed. Required Character length and limitations: 2 alphanumeric characters * - minOccurs: 1 * @var string @@ -47,7 +47,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase public $SiteId; /** * The BuyerId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Buyers ebay Id. Required Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 1 * @var string @@ -55,7 +55,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase public $BuyerId; /** * The ClientType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicating the client type. Weather it is WAP or J2ME. A value of 'WAP' indicates WAP. A value of 'J2MEClient' indicates J2ME client. Required * - minOccurs: 1 * @var string @@ -63,7 +63,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase public $ClientType; /** * The BuyerPhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The phone number of the buyer's mobile device, if available. Optional * - minOccurs: 0 * @var \PayPal\StructType\PhoneNumberType @@ -71,7 +71,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase public $BuyerPhone; /** * The ReturnURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer's browser is returned after choosing to pay with PayPal. PayPal recommends that the value of ReturnURL be the final review page on which the customer confirms the order and payment. Optional Character length * and limitations: no limit. * - minOccurs: 0 @@ -80,7 +80,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase public $ReturnURL; /** * The CancelURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer is returned if he does not approve the use of PayPal to pay you. PayPal recommends that the value of CancelURL be the original page on which the customer chose to pay with PayPal. Optional Character length * and limitations: no limit * - minOccurs: 0 @@ -89,7 +89,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase public $CancelURL; /** * The Quantity - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Specify quantity in case it is an immediate pay (or autopay) item. Optional * - minOccurs: 0 * @var int @@ -97,7 +97,7 @@ class SetEbayMobileCheckoutRequestDetailsType extends AbstractStructBase public $Quantity; /** * The ItemAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Cost of this item before tax and shipping.You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies.Used only for autopay items. Optional * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -163,7 +163,7 @@ public function setCheckoutType($checkoutType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\EbayCheckoutType::valueIsValid($checkoutType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $checkoutType, implode(', ', \PayPal\EnumType\EbayCheckoutType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\EbayCheckoutType', is_array($checkoutType) ? implode(', ', $checkoutType) : var_export($checkoutType, true), implode(', ', \PayPal\EnumType\EbayCheckoutType::getValidValues())), __LINE__); } $this->CheckoutType = $checkoutType; return $this; @@ -185,7 +185,7 @@ public function setItemId($itemId = null) { // validation for constraint: string if (!is_null($itemId) && !is_string($itemId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemId, true), gettype($itemId)), __LINE__); } $this->ItemId = $itemId; return $this; @@ -207,7 +207,7 @@ public function setTransactionId($transactionId = null) { // validation for constraint: string if (!is_null($transactionId) && !is_string($transactionId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionId, true), gettype($transactionId)), __LINE__); } $this->TransactionId = $transactionId; return $this; @@ -229,7 +229,7 @@ public function setSiteId($siteId = null) { // validation for constraint: string if (!is_null($siteId) && !is_string($siteId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($siteId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($siteId, true), gettype($siteId)), __LINE__); } $this->SiteId = $siteId; return $this; @@ -251,7 +251,7 @@ public function setBuyerId($buyerId = null) { // validation for constraint: string if (!is_null($buyerId) && !is_string($buyerId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerId, true), gettype($buyerId)), __LINE__); } $this->BuyerId = $buyerId; return $this; @@ -276,7 +276,7 @@ public function setClientType($clientType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\DyneticClientType::valueIsValid($clientType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $clientType, implode(', ', \PayPal\EnumType\DyneticClientType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\DyneticClientType', is_array($clientType) ? implode(', ', $clientType) : var_export($clientType, true), implode(', ', \PayPal\EnumType\DyneticClientType::getValidValues())), __LINE__); } $this->ClientType = $clientType; return $this; @@ -316,7 +316,7 @@ public function setReturnURL($returnURL = null) { // validation for constraint: string if (!is_null($returnURL) && !is_string($returnURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($returnURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($returnURL, true), gettype($returnURL)), __LINE__); } $this->ReturnURL = $returnURL; return $this; @@ -338,7 +338,7 @@ public function setCancelURL($cancelURL = null) { // validation for constraint: string if (!is_null($cancelURL) && !is_string($cancelURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cancelURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cancelURL, true), gettype($cancelURL)), __LINE__); } $this->CancelURL = $cancelURL; return $this; @@ -359,8 +359,8 @@ public function getQuantity() public function setQuantity($quantity = null) { // validation for constraint: int - if (!is_null($quantity) && !is_numeric($quantity)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($quantity)), __LINE__); + if (!is_null($quantity) && !(is_int($quantity) || ctype_digit($quantity))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($quantity, true), gettype($quantity)), __LINE__); } $this->Quantity = $quantity; return $this; diff --git a/src/StructType/SetExpressCheckoutReq.php b/src/StructType/SetExpressCheckoutReq.php index e5f7082..1dcd63b 100644 --- a/src/StructType/SetExpressCheckoutReq.php +++ b/src/StructType/SetExpressCheckoutReq.php @@ -13,7 +13,7 @@ class SetExpressCheckoutReq extends AbstractStructBase { /** * The SetExpressCheckoutRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:SetExpressCheckoutRequest * @var \PayPal\StructType\SetExpressCheckoutRequestType */ diff --git a/src/StructType/SetExpressCheckoutRequestDetailsType.php b/src/StructType/SetExpressCheckoutRequestDetailsType.php index 701b2ac..3390061 100644 --- a/src/StructType/SetExpressCheckoutRequestDetailsType.php +++ b/src/StructType/SetExpressCheckoutRequestDetailsType.php @@ -13,7 +13,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase { /** * The OrderTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The total cost of the order to the customer. If shipping cost and tax charges are known, include them in OrderTotal; if not, OrderTotal should be the current sub-total of the order. You must set the currencyID attribute to one of the * three-character currency codes for any of the supported PayPal currencies. Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - minOccurs: 0 @@ -22,7 +22,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $OrderTotal; /** * The ReturnURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer's browser is returned after choosing to pay with PayPal. PayPal recommends that the value of ReturnURL be the final review page on which the customer confirms the order and payment. Required Character length * and limitations: no limit. * @var string @@ -30,7 +30,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $ReturnURL; /** * The CancelURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer is returned if he does not approve the use of PayPal to pay you. PayPal recommends that the value of CancelURL be the original page on which the customer chose to pay with PayPal. Required Character length * and limitations: no limit * @var string @@ -38,7 +38,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $CancelURL; /** * The TrackingImageURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Tracking URL for ebay. Required Character length and limitations: no limit * - minOccurs: 0 * @var string @@ -46,7 +46,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $TrackingImageURL; /** * The giropaySuccessURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer's browser is returned after paying with giropay online. Optional Character length and limitations: no limit. * - minOccurs: 0 * @var string @@ -54,7 +54,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $giropaySuccessURL; /** * The giropayCancelURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer's browser is returned after fail to pay with giropay online. Optional Character length and limitations: no limit. * - minOccurs: 0 * @var string @@ -62,7 +62,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $giropayCancelURL; /** * The BanktxnPendingURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer's browser can be returned in the mEFT done page. Optional Character length and limitations: no limit. * - minOccurs: 0 * @var string @@ -70,16 +70,17 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $BanktxnPendingURL; /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: On your first invocation of SetExpressCheckoutRequest, the value of this token is returned by SetExpressCheckoutResponse. Optional Include this element and its value only if you want to modify an existing checkout session with * another invocation of SetExpressCheckoutRequest; for example, if you want the customer to edit his shipping address on PayPal. Character length and limitations: 20 single-byte characters + * - base: xs:string * - minOccurs: 0 * @var string */ public $Token; /** * The MaxAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The expected maximum total amount of the complete order, including shipping cost and tax charges. Optional You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. * Limitations: Must not exceed $10,000 USD in any currency. No currency symbol. Decimal separator must be a period (.), and the thousands separator must be a comma (,). * - minOccurs: 0 @@ -88,7 +89,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $MaxAmount; /** * The OrderDescription - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Description of items the customer is purchasing. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -96,7 +97,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $OrderDescription; /** * The Custom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A free-form field for your own use, such as a tracking number or other value you want PayPal to return on GetExpressCheckoutDetailsResponse and DoExpressCheckoutPaymentResponse. Optional Character length and limitations: 256 * single-byte alphanumeric characters * - minOccurs: 0 @@ -105,7 +106,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $Custom; /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Your own unique invoice or tracking number. PayPal returns this value to you on DoExpressCheckoutPaymentResponse. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -113,7 +114,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $InvoiceID; /** * The ReqConfirmShipping - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that you require that the customer's shipping address on file with PayPal be a confirmed address. Any value other than 1 indicates that the customer's shipping address on file with PayPal need NOT be a confirmed * address. Setting this element overrides the setting you have specified in the recipient's Merchant Account Profile. Optional Character length and limitations: One single-byte numeric character. * - minOccurs: 0 @@ -122,7 +123,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $ReqConfirmShipping; /** * The ReqBillingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that you require that the customer's billing address on file. Setting this element overrides the setting you have specified in Admin. Optional Character length and limitations: One single-byte numeric character. * - minOccurs: 0 * @var string @@ -130,7 +131,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $ReqBillingAddress; /** * The BillingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The billing address for the buyer. Optional If you include the BillingAddress element, the AddressType elements are required: Name Street1 CityName CountryCode Do not set set the CountryName element. * - minOccurs: 0 * @var \PayPal\StructType\AddressType @@ -138,7 +139,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $BillingAddress; /** * The NoShipping - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that on the PayPal pages, no shipping address fields should be displayed whatsoever. Optional Character length and limitations: Four single-byte numeric characters. * - minOccurs: 0 * @var string @@ -146,7 +147,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $NoShipping; /** * The AddressOverride - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that the PayPal pages should display the shipping address set by you in the Address element on this SetExpressCheckoutRequest, not the shipping address on file with PayPal for this customer. Displaying the * PayPal street address on file does not allow the customer to edit that address. Optional Character length and limitations: Four single-byte numeric characters. * - minOccurs: 0 @@ -155,7 +156,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $AddressOverride; /** * The LocaleCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Locale of pages displayed by PayPal during Express Checkout. Optional Character length and limitations: Five single-byte alphabetic characters, upper- or lowercase. Allowable values: AU or en_AUDE or de_DEFR or fr_FRGB or en_GBIT or * it_ITJP or ja_JPUS or en_US * - minOccurs: 0 @@ -164,7 +165,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $LocaleCode; /** * The PageStyle - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the Custom Payment Page Style for payment pages associated with this button/link. PageStyle corresponds to the HTML variable page_style for customizing payment pages. The value is the same as the Page Style Name you chose when * adding or editing the page style from the Profile subtab of the My Account tab of your PayPal account. Optional Character length and limitations: 30 single-byte alphabetic characters. * - minOccurs: 0 @@ -173,7 +174,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $PageStyle; /** * The cpp_header_image - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A URL for the image you want to appear at the top left of the payment page. The image has a maximum size of 750 pixels wide by 90 pixels high. PayPal recommends that you provide an image that is stored on a secure (https) server. * Optional Character length and limitations: 127 * - minOccurs: 0 @@ -182,7 +183,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $cpp_header_image; /** * The cpp_header_border_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the border color around the header of the payment page. The border is a 2-pixel perimeter around the header space, which is 750 pixels wide by 90 pixels high. Optional Character length and limitations: Six character HTML * hexadecimal color code in ASCII * - minOccurs: 0 @@ -191,7 +192,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $cpp_header_border_color; /** * The cpp_header_back_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the background color for the header of the payment page. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -199,7 +200,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $cpp_header_back_color; /** * The cpp_payflow_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the background color for the payment page. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -207,7 +208,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $cpp_payflow_color; /** * The cpp_cart_border_color - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sets the cart gradient color for the Mini Cart on 1X flow. Optional Character length and limitation: Six character HTML hexadecimal color code in ASCII * - minOccurs: 0 * @var string @@ -215,7 +216,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $cpp_cart_border_color; /** * The cpp_logo_image - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A URL for the image you want to appear above the mini-cart. The image has a maximum size of 190 pixels wide by 60 pixels high. PayPal recommends that you provide an image that is stored on a secure (https) server. Optional Character * length and limitations: 127 * - minOccurs: 0 @@ -224,7 +225,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $cpp_logo_image; /** * The Address - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Customer's shipping address. Optional If you include a shipping address and set the AddressOverride element on the request, PayPal returns this same address in GetExpressCheckoutDetailsResponse. * - minOccurs: 0 * @var \PayPal\StructType\AddressType @@ -232,7 +233,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $Address; /** * The PaymentAction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: How you want to obtain payment. Required Authorization indicates that this payment is a basic authorization subject to settlement with PayPal Authorization and Capture. Order indicates that this payment is is an order authorization * subject to settlement with PayPal Authorization and Capture. Sale indicates that this is a final sale for which you are requesting payment. IMPORTANT: You cannot set PaymentAction to Sale or Order on SetExpressCheckoutRequest and then change * PaymentAction to Authorization on the final Express Checkout API, DoExpressCheckoutPaymentRequest. Character length and limit: Up to 13 single-byte alphabetic characters @@ -242,7 +243,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $PaymentAction; /** * The SolutionType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This will indicate which flow you are choosing (expresschecheckout or expresscheckout optional) Optional None Sole indicates that you are in the ExpressO flow Mark indicates that you are in the old express flow. * - minOccurs: 0 * @var string @@ -250,7 +251,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $SolutionType; /** * The LandingPage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This indicates Which page to display for ExpressO (Billing or Login) Optional None Billing indicates that you are not a paypal account holder Login indicates that you are a paypal account holder * - minOccurs: 0 * @var string @@ -258,22 +259,23 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $LandingPage; /** * The BuyerEmail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Email address of the buyer as entered during checkout. PayPal uses this value to pre-fill the PayPal membership sign-up portion of the PayPal login page. Optional Character length and limit: 127 single-byte alphanumeric characters + * - base: xs:string * - minOccurs: 0 * @var string */ public $BuyerEmail; /** * The ChannelType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $ChannelType; /** * The BillingAgreementDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * @var \PayPal\StructType\BillingAgreementDetailsType[] @@ -281,7 +283,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $BillingAgreementDetails; /** * The PromoCodes - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Promo Code Optional List of promo codes supplied by merchant. These promo codes enable the Merchant Services Promotion Financing feature. * - maxOccurs: unbounded * - minOccurs: 0 @@ -290,7 +292,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $PromoCodes; /** * The PayPalCheckOutBtnType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Default Funding option for PayLater Checkout button. * - maxOccurs: 1 * - minOccurs: 0 @@ -299,7 +301,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $PayPalCheckOutBtnType; /** * The ProductCategory - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -307,7 +309,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $ProductCategory; /** * The ShippingMethod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -315,7 +317,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $ShippingMethod; /** * The ProfileAddressChangeDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date and time (in GMT in the format yyyy-MM-ddTHH:mm:ssZ) at which address was changed by the user. * - maxOccurs: 1 * - minOccurs: 0 @@ -324,7 +326,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $ProfileAddressChangeDate; /** * The AllowNote - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that the customer may enter a note to the merchant on the PayPal page during checkout. The note is returned in the GetExpressCheckoutDetails response and the DoExpressCheckoutPayment response. Optional Character * length and limitations: One single-byte numeric character. Allowable values: 0,1 * - maxOccurs: 1 @@ -334,7 +336,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $AllowNote; /** * The FundingSourceDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Funding source preferences. * - maxOccurs: 1 * - minOccurs: 0 @@ -343,7 +345,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $FundingSourceDetails; /** * The BrandName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The label that needs to be displayed on the cancel links in the PayPal hosted checkout pages. Optional Character length and limit: 127 single-byte alphanumeric characters * - maxOccurs: 1 * - minOccurs: 0 @@ -352,7 +354,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $BrandName; /** * The CallbackURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL for PayPal to use to retrieve shipping, handling, insurance, and tax details from your website. Optional Character length and limitations: 2048 characters. * - maxOccurs: 1 * - minOccurs: 0 @@ -361,7 +363,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $CallbackURL; /** * The EnhancedCheckoutData - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Enhanced data for different industry segments. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -370,7 +372,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $EnhancedCheckoutData; /** * The OtherPaymentMethods - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: List of other payment methods the user can pay with. Optional Refer to the OtherPaymentMethodDetailsType for more details. * - maxOccurs: unbounded * - minOccurs: 0 @@ -379,7 +381,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $OtherPaymentMethods; /** * The BuyerDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about the buyer's account. Optional Refer to the BuyerDetailsType for more details. * - maxOccurs: 1 * - minOccurs: 0 @@ -388,7 +390,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $BuyerDetails; /** * The PaymentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the payment. * - maxOccurs: 10 * - minOccurs: 0 @@ -397,7 +399,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $PaymentDetails; /** * The FlatRateShippingOptions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: List of Fall Back Shipping options provided by merchant. * - maxOccurs: unbounded * - minOccurs: 0 @@ -406,7 +408,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $FlatRateShippingOptions; /** * The CallbackTimeout - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the call back timeout override. * - maxOccurs: 1 * - minOccurs: 0 @@ -415,7 +417,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $CallbackTimeout; /** * The CallbackVersion - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the call back version. * - maxOccurs: 1 * - minOccurs: 0 @@ -424,7 +426,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $CallbackVersion; /** * The CustomerServiceNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Customer service number. * - maxOccurs: 1 * - minOccurs: 0 @@ -433,7 +435,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $CustomerServiceNumber; /** * The GiftMessageEnable - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift message enable. * - maxOccurs: 1 * - minOccurs: 0 @@ -442,7 +444,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $GiftMessageEnable; /** * The GiftReceiptEnable - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift receipt enable. * - maxOccurs: 1 * - minOccurs: 0 @@ -451,7 +453,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $GiftReceiptEnable; /** * The GiftWrapEnable - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift Wrap enable. * - maxOccurs: 1 * - minOccurs: 0 @@ -460,7 +462,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $GiftWrapEnable; /** * The GiftWrapName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift Wrap name. * - maxOccurs: 1 * - minOccurs: 0 @@ -469,7 +471,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $GiftWrapName; /** * The GiftWrapAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Gift Wrap amount. * - maxOccurs: 1 * - minOccurs: 0 @@ -478,7 +480,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $GiftWrapAmount; /** * The BuyerEmailOptInEnable - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the Buyer email option enable . * - maxOccurs: 1 * - minOccurs: 0 @@ -487,7 +489,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $BuyerEmailOptInEnable; /** * The SurveyEnable - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the survey enable. * - maxOccurs: 1 * - minOccurs: 0 @@ -496,7 +498,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $SurveyEnable; /** * The SurveyQuestion - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the survey question. * - maxOccurs: 1 * - minOccurs: 0 @@ -505,7 +507,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $SurveyQuestion; /** * The SurveyChoice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the survey choices for survey question. * - maxOccurs: unbounded * - minOccurs: 0 @@ -514,14 +516,14 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $SurveyChoice; /** * The TotalType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $TotalType; /** * The NoteToBuyer - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Any message the seller would like to be displayed in the Mini Cart for UX. * - maxOccurs: 1 * - minOccurs: 0 @@ -530,7 +532,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $NoteToBuyer; /** * The Incentives - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Incentive Code Optional List of incentive codes supplied by ebay/merchant. * - maxOccurs: unbounded * - minOccurs: 0 @@ -539,7 +541,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $Incentives; /** * The ReqInstrumentDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Merchant specified flag which indicates whether to return Funding Instrument Details in DoEC or not. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -548,7 +550,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $ReqInstrumentDetails; /** * The ExternalRememberMeOptInDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This element contains information that allows the merchant to request to opt into external remember me on behalf of the buyer or to request login bypass using external remember me. Note the opt-in details are silently ignored if the * ExternalRememberMeID is present. * - maxOccurs: 1 @@ -558,7 +560,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $ExternalRememberMeOptInDetails; /** * The FlowControlDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An optional set of values related to flow-specific details. * - maxOccurs: 1 * - minOccurs: 0 @@ -567,7 +569,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $FlowControlDetails; /** * The DisplayControlDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An optional set of values related to display-specific details. * - maxOccurs: 1 * - minOccurs: 0 @@ -576,7 +578,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $DisplayControlDetails; /** * The ExternalPartnerTrackingDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An optional set of values related to tracking for external partner. * - maxOccurs: 1 * - minOccurs: 0 @@ -585,7 +587,7 @@ class SetExpressCheckoutRequestDetailsType extends AbstractStructBase public $ExternalPartnerTrackingDetails; /** * The CoupledBuckets - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Optional element that defines relationship between buckets * - maxOccurs: 5 * - minOccurs: 0 @@ -835,7 +837,7 @@ public function setReturnURL($returnURL = null) { // validation for constraint: string if (!is_null($returnURL) && !is_string($returnURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($returnURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($returnURL, true), gettype($returnURL)), __LINE__); } $this->ReturnURL = $returnURL; return $this; @@ -857,7 +859,7 @@ public function setCancelURL($cancelURL = null) { // validation for constraint: string if (!is_null($cancelURL) && !is_string($cancelURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cancelURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cancelURL, true), gettype($cancelURL)), __LINE__); } $this->CancelURL = $cancelURL; return $this; @@ -879,7 +881,7 @@ public function setTrackingImageURL($trackingImageURL = null) { // validation for constraint: string if (!is_null($trackingImageURL) && !is_string($trackingImageURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($trackingImageURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($trackingImageURL, true), gettype($trackingImageURL)), __LINE__); } $this->TrackingImageURL = $trackingImageURL; return $this; @@ -901,7 +903,7 @@ public function setGiropaySuccessURL($giropaySuccessURL = null) { // validation for constraint: string if (!is_null($giropaySuccessURL) && !is_string($giropaySuccessURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giropaySuccessURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giropaySuccessURL, true), gettype($giropaySuccessURL)), __LINE__); } $this->giropaySuccessURL = $giropaySuccessURL; return $this; @@ -923,7 +925,7 @@ public function setGiropayCancelURL($giropayCancelURL = null) { // validation for constraint: string if (!is_null($giropayCancelURL) && !is_string($giropayCancelURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giropayCancelURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giropayCancelURL, true), gettype($giropayCancelURL)), __LINE__); } $this->giropayCancelURL = $giropayCancelURL; return $this; @@ -945,7 +947,7 @@ public function setBanktxnPendingURL($banktxnPendingURL = null) { // validation for constraint: string if (!is_null($banktxnPendingURL) && !is_string($banktxnPendingURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($banktxnPendingURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($banktxnPendingURL, true), gettype($banktxnPendingURL)), __LINE__); } $this->BanktxnPendingURL = $banktxnPendingURL; return $this; @@ -967,7 +969,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; @@ -1007,7 +1009,7 @@ public function setOrderDescription($orderDescription = null) { // validation for constraint: string if (!is_null($orderDescription) && !is_string($orderDescription)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($orderDescription)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($orderDescription, true), gettype($orderDescription)), __LINE__); } $this->OrderDescription = $orderDescription; return $this; @@ -1029,7 +1031,7 @@ public function setCustom($custom = null) { // validation for constraint: string if (!is_null($custom) && !is_string($custom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($custom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); } $this->Custom = $custom; return $this; @@ -1051,7 +1053,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; @@ -1073,7 +1075,7 @@ public function setReqConfirmShipping($reqConfirmShipping = null) { // validation for constraint: string if (!is_null($reqConfirmShipping) && !is_string($reqConfirmShipping)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reqConfirmShipping)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reqConfirmShipping, true), gettype($reqConfirmShipping)), __LINE__); } $this->ReqConfirmShipping = $reqConfirmShipping; return $this; @@ -1095,7 +1097,7 @@ public function setReqBillingAddress($reqBillingAddress = null) { // validation for constraint: string if (!is_null($reqBillingAddress) && !is_string($reqBillingAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reqBillingAddress)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reqBillingAddress, true), gettype($reqBillingAddress)), __LINE__); } $this->ReqBillingAddress = $reqBillingAddress; return $this; @@ -1135,7 +1137,7 @@ public function setNoShipping($noShipping = null) { // validation for constraint: string if (!is_null($noShipping) && !is_string($noShipping)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($noShipping)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($noShipping, true), gettype($noShipping)), __LINE__); } $this->NoShipping = $noShipping; return $this; @@ -1157,7 +1159,7 @@ public function setAddressOverride($addressOverride = null) { // validation for constraint: string if (!is_null($addressOverride) && !is_string($addressOverride)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($addressOverride)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($addressOverride, true), gettype($addressOverride)), __LINE__); } $this->AddressOverride = $addressOverride; return $this; @@ -1179,7 +1181,7 @@ public function setLocaleCode($localeCode = null) { // validation for constraint: string if (!is_null($localeCode) && !is_string($localeCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($localeCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($localeCode, true), gettype($localeCode)), __LINE__); } $this->LocaleCode = $localeCode; return $this; @@ -1201,7 +1203,7 @@ public function setPageStyle($pageStyle = null) { // validation for constraint: string if (!is_null($pageStyle) && !is_string($pageStyle)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pageStyle)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pageStyle, true), gettype($pageStyle)), __LINE__); } $this->PageStyle = $pageStyle; return $this; @@ -1223,7 +1225,7 @@ public function setCpp_header_image($cpp_header_image = null) { // validation for constraint: string if (!is_null($cpp_header_image) && !is_string($cpp_header_image)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_image)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_image, true), gettype($cpp_header_image)), __LINE__); } $this->cpp_header_image = $this->{'cpp-header-image'} = $cpp_header_image; return $this; @@ -1245,7 +1247,7 @@ public function setCpp_header_border_color($cpp_header_border_color = null) { // validation for constraint: string if (!is_null($cpp_header_border_color) && !is_string($cpp_header_border_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_border_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_border_color, true), gettype($cpp_header_border_color)), __LINE__); } $this->cpp_header_border_color = $this->{'cpp-header-border-color'} = $cpp_header_border_color; return $this; @@ -1267,7 +1269,7 @@ public function setCpp_header_back_color($cpp_header_back_color = null) { // validation for constraint: string if (!is_null($cpp_header_back_color) && !is_string($cpp_header_back_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_header_back_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_header_back_color, true), gettype($cpp_header_back_color)), __LINE__); } $this->cpp_header_back_color = $this->{'cpp-header-back-color'} = $cpp_header_back_color; return $this; @@ -1289,7 +1291,7 @@ public function setCpp_payflow_color($cpp_payflow_color = null) { // validation for constraint: string if (!is_null($cpp_payflow_color) && !is_string($cpp_payflow_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_payflow_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_payflow_color, true), gettype($cpp_payflow_color)), __LINE__); } $this->cpp_payflow_color = $this->{'cpp-payflow-color'} = $cpp_payflow_color; return $this; @@ -1311,7 +1313,7 @@ public function setCpp_cart_border_color($cpp_cart_border_color = null) { // validation for constraint: string if (!is_null($cpp_cart_border_color) && !is_string($cpp_cart_border_color)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_cart_border_color)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_cart_border_color, true), gettype($cpp_cart_border_color)), __LINE__); } $this->cpp_cart_border_color = $this->{'cpp-cart-border-color'} = $cpp_cart_border_color; return $this; @@ -1333,7 +1335,7 @@ public function setCpp_logo_image($cpp_logo_image = null) { // validation for constraint: string if (!is_null($cpp_logo_image) && !is_string($cpp_logo_image)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cpp_logo_image)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cpp_logo_image, true), gettype($cpp_logo_image)), __LINE__); } $this->cpp_logo_image = $this->{'cpp-logo-image'} = $cpp_logo_image; return $this; @@ -1376,7 +1378,7 @@ public function setPaymentAction($paymentAction = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentActionCodeType::valueIsValid($paymentAction)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentAction, implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentActionCodeType', is_array($paymentAction) ? implode(', ', $paymentAction) : var_export($paymentAction, true), implode(', ', \PayPal\EnumType\PaymentActionCodeType::getValidValues())), __LINE__); } $this->PaymentAction = $paymentAction; return $this; @@ -1401,7 +1403,7 @@ public function setSolutionType($solutionType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SolutionTypeType::valueIsValid($solutionType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $solutionType, implode(', ', \PayPal\EnumType\SolutionTypeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SolutionTypeType', is_array($solutionType) ? implode(', ', $solutionType) : var_export($solutionType, true), implode(', ', \PayPal\EnumType\SolutionTypeType::getValidValues())), __LINE__); } $this->SolutionType = $solutionType; return $this; @@ -1426,7 +1428,7 @@ public function setLandingPage($landingPage = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\LandingPageType::valueIsValid($landingPage)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $landingPage, implode(', ', \PayPal\EnumType\LandingPageType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\LandingPageType', is_array($landingPage) ? implode(', ', $landingPage) : var_export($landingPage, true), implode(', ', \PayPal\EnumType\LandingPageType::getValidValues())), __LINE__); } $this->LandingPage = $landingPage; return $this; @@ -1448,7 +1450,7 @@ public function setBuyerEmail($buyerEmail = null) { // validation for constraint: string if (!is_null($buyerEmail) && !is_string($buyerEmail)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerEmail)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerEmail, true), gettype($buyerEmail)), __LINE__); } $this->BuyerEmail = $buyerEmail; return $this; @@ -1473,7 +1475,7 @@ public function setChannelType($channelType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ChannelType::valueIsValid($channelType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $channelType, implode(', ', \PayPal\EnumType\ChannelType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ChannelType', is_array($channelType) ? implode(', ', $channelType) : var_export($channelType, true), implode(', ', \PayPal\EnumType\ChannelType::getValidValues())), __LINE__); } $this->ChannelType = $channelType; return $this; @@ -1486,6 +1488,28 @@ public function getBillingAgreementDetails() { return $this->BillingAgreementDetails; } + /** + * This method is responsible for validating the values passed to the setBillingAgreementDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setBillingAgreementDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateBillingAgreementDetailsForArrayConstraintsFromSetBillingAgreementDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem) { + // validation for constraint: itemType + if (!$setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem instanceof \PayPal\StructType\BillingAgreementDetailsType) { + $invalidValues[] = is_object($setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem) ? get_class($setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem) : sprintf('%s(%s)', gettype($setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem), var_export($setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The BillingAgreementDetails property can only contain items of type \PayPal\StructType\BillingAgreementDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set BillingAgreementDetails value * @throws \InvalidArgumentException @@ -1494,11 +1518,9 @@ public function getBillingAgreementDetails() */ public function setBillingAgreementDetails(array $billingAgreementDetails = array()) { - foreach ($billingAgreementDetails as $setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem) { - // validation for constraint: itemType - if (!$setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem instanceof \PayPal\StructType\BillingAgreementDetailsType) { - throw new \InvalidArgumentException(sprintf('The BillingAgreementDetails property can only contain items of \PayPal\StructType\BillingAgreementDetailsType, "%s" given', is_object($setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem) ? get_class($setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem) : gettype($setExpressCheckoutRequestDetailsTypeBillingAgreementDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($billingAgreementDetailsArrayErrorMessage = self::validateBillingAgreementDetailsForArrayConstraintsFromSetBillingAgreementDetails($billingAgreementDetails))) { + throw new \InvalidArgumentException($billingAgreementDetailsArrayErrorMessage, __LINE__); } $this->BillingAgreementDetails = $billingAgreementDetails; return $this; @@ -1513,7 +1535,7 @@ public function addToBillingAgreementDetails(\PayPal\StructType\BillingAgreement { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\BillingAgreementDetailsType) { - throw new \InvalidArgumentException(sprintf('The BillingAgreementDetails property can only contain items of \PayPal\StructType\BillingAgreementDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The BillingAgreementDetails property can only contain items of type \PayPal\StructType\BillingAgreementDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->BillingAgreementDetails[] = $item; return $this; @@ -1526,6 +1548,28 @@ public function getPromoCodes() { return $this->PromoCodes; } + /** + * This method is responsible for validating the values passed to the setPromoCodes method + * This method is willingly generated in order to preserve the one-line inline validation within the setPromoCodes method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePromoCodesForArrayConstraintsFromSetPromoCodes(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setExpressCheckoutRequestDetailsTypePromoCodesItem) { + // validation for constraint: itemType + if (!is_string($setExpressCheckoutRequestDetailsTypePromoCodesItem)) { + $invalidValues[] = is_object($setExpressCheckoutRequestDetailsTypePromoCodesItem) ? get_class($setExpressCheckoutRequestDetailsTypePromoCodesItem) : sprintf('%s(%s)', gettype($setExpressCheckoutRequestDetailsTypePromoCodesItem), var_export($setExpressCheckoutRequestDetailsTypePromoCodesItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The PromoCodes property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set PromoCodes value * @throws \InvalidArgumentException @@ -1534,11 +1578,9 @@ public function getPromoCodes() */ public function setPromoCodes(array $promoCodes = array()) { - foreach ($promoCodes as $setExpressCheckoutRequestDetailsTypePromoCodesItem) { - // validation for constraint: itemType - if (!is_string($setExpressCheckoutRequestDetailsTypePromoCodesItem)) { - throw new \InvalidArgumentException(sprintf('The PromoCodes property can only contain items of string, "%s" given', is_object($setExpressCheckoutRequestDetailsTypePromoCodesItem) ? get_class($setExpressCheckoutRequestDetailsTypePromoCodesItem) : gettype($setExpressCheckoutRequestDetailsTypePromoCodesItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($promoCodesArrayErrorMessage = self::validatePromoCodesForArrayConstraintsFromSetPromoCodes($promoCodes))) { + throw new \InvalidArgumentException($promoCodesArrayErrorMessage, __LINE__); } $this->PromoCodes = $promoCodes; return $this; @@ -1553,7 +1595,7 @@ public function addToPromoCodes($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The PromoCodes property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The PromoCodes property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->PromoCodes[] = $item; return $this; @@ -1575,7 +1617,7 @@ public function setPayPalCheckOutBtnType($payPalCheckOutBtnType = null) { // validation for constraint: string if (!is_null($payPalCheckOutBtnType) && !is_string($payPalCheckOutBtnType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payPalCheckOutBtnType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payPalCheckOutBtnType, true), gettype($payPalCheckOutBtnType)), __LINE__); } $this->PayPalCheckOutBtnType = $payPalCheckOutBtnType; return $this; @@ -1600,7 +1642,7 @@ public function setProductCategory($productCategory = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ProductCategoryType::valueIsValid($productCategory)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $productCategory, implode(', ', \PayPal\EnumType\ProductCategoryType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ProductCategoryType', is_array($productCategory) ? implode(', ', $productCategory) : var_export($productCategory, true), implode(', ', \PayPal\EnumType\ProductCategoryType::getValidValues())), __LINE__); } $this->ProductCategory = $productCategory; return $this; @@ -1625,7 +1667,7 @@ public function setShippingMethod($shippingMethod = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ShippingServiceCodeType::valueIsValid($shippingMethod)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $shippingMethod, implode(', ', \PayPal\EnumType\ShippingServiceCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ShippingServiceCodeType', is_array($shippingMethod) ? implode(', ', $shippingMethod) : var_export($shippingMethod, true), implode(', ', \PayPal\EnumType\ShippingServiceCodeType::getValidValues())), __LINE__); } $this->ShippingMethod = $shippingMethod; return $this; @@ -1647,7 +1689,7 @@ public function setProfileAddressChangeDate($profileAddressChangeDate = null) { // validation for constraint: string if (!is_null($profileAddressChangeDate) && !is_string($profileAddressChangeDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileAddressChangeDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileAddressChangeDate, true), gettype($profileAddressChangeDate)), __LINE__); } $this->ProfileAddressChangeDate = $profileAddressChangeDate; return $this; @@ -1669,7 +1711,7 @@ public function setAllowNote($allowNote = null) { // validation for constraint: string if (!is_null($allowNote) && !is_string($allowNote)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($allowNote)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($allowNote, true), gettype($allowNote)), __LINE__); } $this->AllowNote = $allowNote; return $this; @@ -1709,7 +1751,7 @@ public function setBrandName($brandName = null) { // validation for constraint: string if (!is_null($brandName) && !is_string($brandName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($brandName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($brandName, true), gettype($brandName)), __LINE__); } $this->BrandName = $brandName; return $this; @@ -1731,7 +1773,7 @@ public function setCallbackURL($callbackURL = null) { // validation for constraint: string if (!is_null($callbackURL) && !is_string($callbackURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($callbackURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($callbackURL, true), gettype($callbackURL)), __LINE__); } $this->CallbackURL = $callbackURL; return $this; @@ -1762,6 +1804,28 @@ public function getOtherPaymentMethods() { return $this->OtherPaymentMethods; } + /** + * This method is responsible for validating the values passed to the setOtherPaymentMethods method + * This method is willingly generated in order to preserve the one-line inline validation within the setOtherPaymentMethods method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateOtherPaymentMethodsForArrayConstraintsFromSetOtherPaymentMethods(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem) { + // validation for constraint: itemType + if (!$setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem instanceof \PayPal\StructType\OtherPaymentMethodDetailsType) { + $invalidValues[] = is_object($setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem) ? get_class($setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem) : sprintf('%s(%s)', gettype($setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem), var_export($setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The OtherPaymentMethods property can only contain items of type \PayPal\StructType\OtherPaymentMethodDetailsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set OtherPaymentMethods value * @throws \InvalidArgumentException @@ -1770,11 +1834,9 @@ public function getOtherPaymentMethods() */ public function setOtherPaymentMethods(array $otherPaymentMethods = array()) { - foreach ($otherPaymentMethods as $setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem) { - // validation for constraint: itemType - if (!$setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem instanceof \PayPal\StructType\OtherPaymentMethodDetailsType) { - throw new \InvalidArgumentException(sprintf('The OtherPaymentMethods property can only contain items of \PayPal\StructType\OtherPaymentMethodDetailsType, "%s" given', is_object($setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem) ? get_class($setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem) : gettype($setExpressCheckoutRequestDetailsTypeOtherPaymentMethodsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($otherPaymentMethodsArrayErrorMessage = self::validateOtherPaymentMethodsForArrayConstraintsFromSetOtherPaymentMethods($otherPaymentMethods))) { + throw new \InvalidArgumentException($otherPaymentMethodsArrayErrorMessage, __LINE__); } $this->OtherPaymentMethods = $otherPaymentMethods; return $this; @@ -1789,7 +1851,7 @@ public function addToOtherPaymentMethods(\PayPal\StructType\OtherPaymentMethodDe { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\OtherPaymentMethodDetailsType) { - throw new \InvalidArgumentException(sprintf('The OtherPaymentMethods property can only contain items of \PayPal\StructType\OtherPaymentMethodDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The OtherPaymentMethods property can only contain items of type \PayPal\StructType\OtherPaymentMethodDetailsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->OtherPaymentMethods[] = $item; return $this; @@ -1820,6 +1882,28 @@ public function getPaymentDetails() { return $this->PaymentDetails; } + /** + * This method is responsible for validating the values passed to the setPaymentDetails method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentDetails method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentDetailsForArrayConstraintsFromSetPaymentDetails(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setExpressCheckoutRequestDetailsTypePaymentDetailsItem) { + // validation for constraint: itemType + if (!$setExpressCheckoutRequestDetailsTypePaymentDetailsItem instanceof \PayPal\StructType\PaymentDetailsType) { + $invalidValues[] = is_object($setExpressCheckoutRequestDetailsTypePaymentDetailsItem) ? get_class($setExpressCheckoutRequestDetailsTypePaymentDetailsItem) : sprintf('%s(%s)', gettype($setExpressCheckoutRequestDetailsTypePaymentDetailsItem), var_export($setExpressCheckoutRequestDetailsTypePaymentDetailsItem, true)); + } + } + if (!empty($invalidValues)) { + $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))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentDetails value * @throws \InvalidArgumentException @@ -1828,11 +1912,13 @@ public function getPaymentDetails() */ public function setPaymentDetails(array $paymentDetails = array()) { - foreach ($paymentDetails as $setExpressCheckoutRequestDetailsTypePaymentDetailsItem) { - // validation for constraint: itemType - if (!$setExpressCheckoutRequestDetailsTypePaymentDetailsItem instanceof \PayPal\StructType\PaymentDetailsType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetails property can only contain items of \PayPal\StructType\PaymentDetailsType, "%s" given', is_object($setExpressCheckoutRequestDetailsTypePaymentDetailsItem) ? get_class($setExpressCheckoutRequestDetailsTypePaymentDetailsItem) : gettype($setExpressCheckoutRequestDetailsTypePaymentDetailsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentDetailsArrayErrorMessage = self::validatePaymentDetailsForArrayConstraintsFromSetPaymentDetails($paymentDetails))) { + throw new \InvalidArgumentException($paymentDetailsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(10) + if (is_array($paymentDetails) && count($paymentDetails) > 10) { + 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__); } $this->PaymentDetails = $paymentDetails; return $this; @@ -1847,7 +1933,11 @@ public function addToPaymentDetails(\PayPal\StructType\PaymentDetailsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentDetailsType) { - throw new \InvalidArgumentException(sprintf('The PaymentDetails property can only contain items of \PayPal\StructType\PaymentDetailsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + 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__); + } + // validation for constraint: maxOccurs(10) + if (is_array($this->PaymentDetails) && count($this->PaymentDetails) >= 10) { + 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__); } $this->PaymentDetails[] = $item; return $this; @@ -1860,6 +1950,28 @@ public function getFlatRateShippingOptions() { return $this->FlatRateShippingOptions; } + /** + * This method is responsible for validating the values passed to the setFlatRateShippingOptions method + * This method is willingly generated in order to preserve the one-line inline validation within the setFlatRateShippingOptions method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateFlatRateShippingOptionsForArrayConstraintsFromSetFlatRateShippingOptions(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem) { + // validation for constraint: itemType + if (!$setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem instanceof \PayPal\StructType\ShippingOptionType) { + $invalidValues[] = is_object($setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem) ? get_class($setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem) : sprintf('%s(%s)', gettype($setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem), var_export($setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The FlatRateShippingOptions property can only contain items of type \PayPal\StructType\ShippingOptionType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set FlatRateShippingOptions value * @throws \InvalidArgumentException @@ -1868,11 +1980,9 @@ public function getFlatRateShippingOptions() */ public function setFlatRateShippingOptions(array $flatRateShippingOptions = array()) { - foreach ($flatRateShippingOptions as $setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem) { - // validation for constraint: itemType - if (!$setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem instanceof \PayPal\StructType\ShippingOptionType) { - throw new \InvalidArgumentException(sprintf('The FlatRateShippingOptions property can only contain items of \PayPal\StructType\ShippingOptionType, "%s" given', is_object($setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem) ? get_class($setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem) : gettype($setExpressCheckoutRequestDetailsTypeFlatRateShippingOptionsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($flatRateShippingOptionsArrayErrorMessage = self::validateFlatRateShippingOptionsForArrayConstraintsFromSetFlatRateShippingOptions($flatRateShippingOptions))) { + throw new \InvalidArgumentException($flatRateShippingOptionsArrayErrorMessage, __LINE__); } $this->FlatRateShippingOptions = $flatRateShippingOptions; return $this; @@ -1887,7 +1997,7 @@ public function addToFlatRateShippingOptions(\PayPal\StructType\ShippingOptionTy { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\ShippingOptionType) { - throw new \InvalidArgumentException(sprintf('The FlatRateShippingOptions property can only contain items of \PayPal\StructType\ShippingOptionType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The FlatRateShippingOptions property can only contain items of type \PayPal\StructType\ShippingOptionType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->FlatRateShippingOptions[] = $item; return $this; @@ -1909,7 +2019,7 @@ public function setCallbackTimeout($callbackTimeout = null) { // validation for constraint: string if (!is_null($callbackTimeout) && !is_string($callbackTimeout)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($callbackTimeout)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($callbackTimeout, true), gettype($callbackTimeout)), __LINE__); } $this->CallbackTimeout = $callbackTimeout; return $this; @@ -1931,7 +2041,7 @@ public function setCallbackVersion($callbackVersion = null) { // validation for constraint: string if (!is_null($callbackVersion) && !is_string($callbackVersion)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($callbackVersion)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($callbackVersion, true), gettype($callbackVersion)), __LINE__); } $this->CallbackVersion = $callbackVersion; return $this; @@ -1953,7 +2063,7 @@ public function setCustomerServiceNumber($customerServiceNumber = null) { // validation for constraint: string if (!is_null($customerServiceNumber) && !is_string($customerServiceNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($customerServiceNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($customerServiceNumber, true), gettype($customerServiceNumber)), __LINE__); } $this->CustomerServiceNumber = $customerServiceNumber; return $this; @@ -1975,7 +2085,7 @@ public function setGiftMessageEnable($giftMessageEnable = null) { // validation for constraint: string if (!is_null($giftMessageEnable) && !is_string($giftMessageEnable)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftMessageEnable)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftMessageEnable, true), gettype($giftMessageEnable)), __LINE__); } $this->GiftMessageEnable = $giftMessageEnable; return $this; @@ -1997,7 +2107,7 @@ public function setGiftReceiptEnable($giftReceiptEnable = null) { // validation for constraint: string if (!is_null($giftReceiptEnable) && !is_string($giftReceiptEnable)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftReceiptEnable)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftReceiptEnable, true), gettype($giftReceiptEnable)), __LINE__); } $this->GiftReceiptEnable = $giftReceiptEnable; return $this; @@ -2019,7 +2129,7 @@ public function setGiftWrapEnable($giftWrapEnable = null) { // validation for constraint: string if (!is_null($giftWrapEnable) && !is_string($giftWrapEnable)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftWrapEnable)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftWrapEnable, true), gettype($giftWrapEnable)), __LINE__); } $this->GiftWrapEnable = $giftWrapEnable; return $this; @@ -2041,7 +2151,7 @@ public function setGiftWrapName($giftWrapName = null) { // validation for constraint: string if (!is_null($giftWrapName) && !is_string($giftWrapName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($giftWrapName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($giftWrapName, true), gettype($giftWrapName)), __LINE__); } $this->GiftWrapName = $giftWrapName; return $this; @@ -2081,7 +2191,7 @@ public function setBuyerEmailOptInEnable($buyerEmailOptInEnable = null) { // validation for constraint: string if (!is_null($buyerEmailOptInEnable) && !is_string($buyerEmailOptInEnable)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerEmailOptInEnable)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerEmailOptInEnable, true), gettype($buyerEmailOptInEnable)), __LINE__); } $this->BuyerEmailOptInEnable = $buyerEmailOptInEnable; return $this; @@ -2103,7 +2213,7 @@ public function setSurveyEnable($surveyEnable = null) { // validation for constraint: string if (!is_null($surveyEnable) && !is_string($surveyEnable)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($surveyEnable)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($surveyEnable, true), gettype($surveyEnable)), __LINE__); } $this->SurveyEnable = $surveyEnable; return $this; @@ -2125,7 +2235,7 @@ public function setSurveyQuestion($surveyQuestion = null) { // validation for constraint: string if (!is_null($surveyQuestion) && !is_string($surveyQuestion)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($surveyQuestion)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($surveyQuestion, true), gettype($surveyQuestion)), __LINE__); } $this->SurveyQuestion = $surveyQuestion; return $this; @@ -2138,6 +2248,28 @@ public function getSurveyChoice() { return $this->SurveyChoice; } + /** + * This method is responsible for validating the values passed to the setSurveyChoice method + * This method is willingly generated in order to preserve the one-line inline validation within the setSurveyChoice method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateSurveyChoiceForArrayConstraintsFromSetSurveyChoice(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setExpressCheckoutRequestDetailsTypeSurveyChoiceItem) { + // validation for constraint: itemType + if (!is_string($setExpressCheckoutRequestDetailsTypeSurveyChoiceItem)) { + $invalidValues[] = is_object($setExpressCheckoutRequestDetailsTypeSurveyChoiceItem) ? get_class($setExpressCheckoutRequestDetailsTypeSurveyChoiceItem) : sprintf('%s(%s)', gettype($setExpressCheckoutRequestDetailsTypeSurveyChoiceItem), var_export($setExpressCheckoutRequestDetailsTypeSurveyChoiceItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The SurveyChoice property can only contain items of type string, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set SurveyChoice value * @throws \InvalidArgumentException @@ -2146,11 +2278,9 @@ public function getSurveyChoice() */ public function setSurveyChoice(array $surveyChoice = array()) { - foreach ($surveyChoice as $setExpressCheckoutRequestDetailsTypeSurveyChoiceItem) { - // validation for constraint: itemType - if (!is_string($setExpressCheckoutRequestDetailsTypeSurveyChoiceItem)) { - throw new \InvalidArgumentException(sprintf('The SurveyChoice property can only contain items of string, "%s" given', is_object($setExpressCheckoutRequestDetailsTypeSurveyChoiceItem) ? get_class($setExpressCheckoutRequestDetailsTypeSurveyChoiceItem) : gettype($setExpressCheckoutRequestDetailsTypeSurveyChoiceItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($surveyChoiceArrayErrorMessage = self::validateSurveyChoiceForArrayConstraintsFromSetSurveyChoice($surveyChoice))) { + throw new \InvalidArgumentException($surveyChoiceArrayErrorMessage, __LINE__); } $this->SurveyChoice = $surveyChoice; return $this; @@ -2165,7 +2295,7 @@ public function addToSurveyChoice($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The SurveyChoice property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The SurveyChoice property can only contain items of type string, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->SurveyChoice[] = $item; return $this; @@ -2190,7 +2320,7 @@ public function setTotalType($totalType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\TotalType::valueIsValid($totalType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $totalType, implode(', ', \PayPal\EnumType\TotalType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\TotalType', is_array($totalType) ? implode(', ', $totalType) : var_export($totalType, true), implode(', ', \PayPal\EnumType\TotalType::getValidValues())), __LINE__); } $this->TotalType = $totalType; return $this; @@ -2212,7 +2342,7 @@ public function setNoteToBuyer($noteToBuyer = null) { // validation for constraint: string if (!is_null($noteToBuyer) && !is_string($noteToBuyer)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($noteToBuyer)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($noteToBuyer, true), gettype($noteToBuyer)), __LINE__); } $this->NoteToBuyer = $noteToBuyer; return $this; @@ -2225,6 +2355,28 @@ public function getIncentives() { return $this->Incentives; } + /** + * This method is responsible for validating the values passed to the setIncentives method + * This method is willingly generated in order to preserve the one-line inline validation within the setIncentives method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateIncentivesForArrayConstraintsFromSetIncentives(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setExpressCheckoutRequestDetailsTypeIncentivesItem) { + // validation for constraint: itemType + if (!$setExpressCheckoutRequestDetailsTypeIncentivesItem instanceof \PayPal\StructType\IncentiveInfoType) { + $invalidValues[] = is_object($setExpressCheckoutRequestDetailsTypeIncentivesItem) ? get_class($setExpressCheckoutRequestDetailsTypeIncentivesItem) : sprintf('%s(%s)', gettype($setExpressCheckoutRequestDetailsTypeIncentivesItem), var_export($setExpressCheckoutRequestDetailsTypeIncentivesItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Incentives property can only contain items of type \PayPal\StructType\IncentiveInfoType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Incentives value * @throws \InvalidArgumentException @@ -2233,11 +2385,9 @@ public function getIncentives() */ public function setIncentives(array $incentives = array()) { - foreach ($incentives as $setExpressCheckoutRequestDetailsTypeIncentivesItem) { - // validation for constraint: itemType - if (!$setExpressCheckoutRequestDetailsTypeIncentivesItem instanceof \PayPal\StructType\IncentiveInfoType) { - throw new \InvalidArgumentException(sprintf('The Incentives property can only contain items of \PayPal\StructType\IncentiveInfoType, "%s" given', is_object($setExpressCheckoutRequestDetailsTypeIncentivesItem) ? get_class($setExpressCheckoutRequestDetailsTypeIncentivesItem) : gettype($setExpressCheckoutRequestDetailsTypeIncentivesItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($incentivesArrayErrorMessage = self::validateIncentivesForArrayConstraintsFromSetIncentives($incentives))) { + throw new \InvalidArgumentException($incentivesArrayErrorMessage, __LINE__); } $this->Incentives = $incentives; return $this; @@ -2252,7 +2402,7 @@ public function addToIncentives(\PayPal\StructType\IncentiveInfoType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\IncentiveInfoType) { - throw new \InvalidArgumentException(sprintf('The Incentives property can only contain items of \PayPal\StructType\IncentiveInfoType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Incentives property can only contain items of type \PayPal\StructType\IncentiveInfoType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Incentives[] = $item; return $this; @@ -2274,7 +2424,7 @@ public function setReqInstrumentDetails($reqInstrumentDetails = null) { // validation for constraint: string if (!is_null($reqInstrumentDetails) && !is_string($reqInstrumentDetails)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reqInstrumentDetails)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reqInstrumentDetails, true), gettype($reqInstrumentDetails)), __LINE__); } $this->ReqInstrumentDetails = $reqInstrumentDetails; return $this; @@ -2359,6 +2509,28 @@ public function getCoupledBuckets() { return $this->CoupledBuckets; } + /** + * This method is responsible for validating the values passed to the setCoupledBuckets method + * This method is willingly generated in order to preserve the one-line inline validation within the setCoupledBuckets method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateCoupledBucketsForArrayConstraintsFromSetCoupledBuckets(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $setExpressCheckoutRequestDetailsTypeCoupledBucketsItem) { + // validation for constraint: itemType + if (!$setExpressCheckoutRequestDetailsTypeCoupledBucketsItem instanceof \PayPal\StructType\CoupledBucketsType) { + $invalidValues[] = is_object($setExpressCheckoutRequestDetailsTypeCoupledBucketsItem) ? get_class($setExpressCheckoutRequestDetailsTypeCoupledBucketsItem) : sprintf('%s(%s)', gettype($setExpressCheckoutRequestDetailsTypeCoupledBucketsItem), var_export($setExpressCheckoutRequestDetailsTypeCoupledBucketsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The CoupledBuckets property can only contain items of type \PayPal\StructType\CoupledBucketsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set CoupledBuckets value * @throws \InvalidArgumentException @@ -2367,11 +2539,13 @@ public function getCoupledBuckets() */ public function setCoupledBuckets(array $coupledBuckets = array()) { - foreach ($coupledBuckets as $setExpressCheckoutRequestDetailsTypeCoupledBucketsItem) { - // validation for constraint: itemType - if (!$setExpressCheckoutRequestDetailsTypeCoupledBucketsItem instanceof \PayPal\StructType\CoupledBucketsType) { - throw new \InvalidArgumentException(sprintf('The CoupledBuckets property can only contain items of \PayPal\StructType\CoupledBucketsType, "%s" given', is_object($setExpressCheckoutRequestDetailsTypeCoupledBucketsItem) ? get_class($setExpressCheckoutRequestDetailsTypeCoupledBucketsItem) : gettype($setExpressCheckoutRequestDetailsTypeCoupledBucketsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($coupledBucketsArrayErrorMessage = self::validateCoupledBucketsForArrayConstraintsFromSetCoupledBuckets($coupledBuckets))) { + throw new \InvalidArgumentException($coupledBucketsArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($coupledBuckets) && count($coupledBuckets) > 5) { + 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($coupledBuckets)), __LINE__); } $this->CoupledBuckets = $coupledBuckets; return $this; @@ -2386,7 +2560,11 @@ public function addToCoupledBuckets(\PayPal\StructType\CoupledBucketsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\CoupledBucketsType) { - throw new \InvalidArgumentException(sprintf('The CoupledBuckets property can only contain items of \PayPal\StructType\CoupledBucketsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The CoupledBuckets property can only contain items of type \PayPal\StructType\CoupledBucketsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(5) + if (is_array($this->CoupledBuckets) && count($this->CoupledBuckets) >= 5) { + 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->CoupledBuckets)), __LINE__); } $this->CoupledBuckets[] = $item; return $this; diff --git a/src/StructType/SetExpressCheckoutRequestType.php b/src/StructType/SetExpressCheckoutRequestType.php index bd83b5f..9796c25 100644 --- a/src/StructType/SetExpressCheckoutRequestType.php +++ b/src/StructType/SetExpressCheckoutRequestType.php @@ -13,7 +13,7 @@ class SetExpressCheckoutRequestType extends AbstractRequestType { /** * The SetExpressCheckoutRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:SetExpressCheckoutRequestDetails diff --git a/src/StructType/SetExpressCheckoutResponseType.php b/src/StructType/SetExpressCheckoutResponseType.php index 30bf789..0bcf74a 100644 --- a/src/StructType/SetExpressCheckoutResponseType.php +++ b/src/StructType/SetExpressCheckoutResponseType.php @@ -13,9 +13,10 @@ class SetExpressCheckoutResponseType extends AbstractResponseType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A timestamped token by which you identify to PayPal that you are processing this payment with Express Checkout. The token expires after three hours. If you set Token in the SetExpressCheckoutRequest, the value of Token in the * response is identical to the value in the request. Character length and limitations: 20 single-byte characters + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -48,7 +49,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/SetMobileCheckoutReq.php b/src/StructType/SetMobileCheckoutReq.php index c15fbc4..99a1924 100644 --- a/src/StructType/SetMobileCheckoutReq.php +++ b/src/StructType/SetMobileCheckoutReq.php @@ -13,7 +13,7 @@ class SetMobileCheckoutReq extends AbstractStructBase { /** * The SetMobileCheckoutRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:SetMobileCheckoutRequest * @var \PayPal\StructType\SetMobileCheckoutRequestType */ diff --git a/src/StructType/SetMobileCheckoutRequestDetailsType.php b/src/StructType/SetMobileCheckoutRequestDetailsType.php index 7eb2f53..68cca58 100644 --- a/src/StructType/SetMobileCheckoutRequestDetailsType.php +++ b/src/StructType/SetMobileCheckoutRequestDetailsType.php @@ -13,7 +13,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase { /** * The ItemAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Cost of this item before tax and shipping.You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Required * - minOccurs: 1 * @var \PayPal\StructType\BasicAmountType @@ -21,7 +21,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $ItemAmount; /** * The ItemName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Description of the item that the customer is purchasing. Required Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 1 * @var string @@ -29,7 +29,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $ItemName; /** * The ReturnURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer's browser is returned after choosing to pay with PayPal. PayPal recommends that the value of ReturnURL be the final review page on which the customer confirms the order and payment. Required Character length * and limitations: no limit. * - minOccurs: 1 @@ -38,7 +38,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $ReturnURL; /** * The BuyerPhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The phone number of the buyer's mobile device, if available. Optional * - minOccurs: 0 * @var \PayPal\StructType\PhoneNumberType @@ -46,7 +46,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $BuyerPhone; /** * The Tax - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Tax amount for this item.You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -54,7 +54,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $Tax; /** * The Shipping - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Shipping amount for this item.You must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. Optional * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -62,7 +62,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $Shipping; /** * The ItemNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Reference number of the item that the customer is purchasing. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -70,7 +70,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $ItemNumber; /** * The Custom - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A free-form field for your own use, such as a tracking number or other value you want returned to you in IPN. Optional Character length and limitations: 256 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -78,7 +78,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $Custom; /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Your own unique invoice or tracking number. Optional Character length and limitations: 127 single-byte alphanumeric characters * - minOccurs: 0 * @var string @@ -86,7 +86,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $InvoiceID; /** * The CancelURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL to which the customer is returned if he does not approve the use of PayPal to pay you. PayPal recommends that the value of CancelURL be the original page on which the customer chose to pay with PayPal. Optional Character length * and limitations: no limit * - minOccurs: 0 @@ -95,7 +95,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $CancelURL; /** * The AddressDisplayOptions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that you require that the customer's shipping address on file with PayPal be a confirmed address. Setting this element overrides the setting you have specified in your Merchant Account Profile. Optional * - minOccurs: 0 * @var int @@ -103,7 +103,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $AddressDisplayOptions; /** * The SharePhone - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value 1 indicates that you require that the customer specifies a contact phone for the transactxion. Default is 0 / none required. Optional * - minOccurs: 0 * @var int @@ -111,7 +111,7 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $SharePhone; /** * The ShipToAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Customer's shipping address. Optional * - minOccurs: 0 * @var \PayPal\StructType\AddressType @@ -119,8 +119,9 @@ class SetMobileCheckoutRequestDetailsType extends AbstractStructBase public $ShipToAddress; /** * The BuyerEmail - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Email address of the buyer as entered during checkout. PayPal uses this value to pre-fill the login portion of the PayPal login page. Optional Character length and limit: 127 single-byte alphanumeric characters + * - base: xs:string * - minOccurs: 0 * @var string */ @@ -209,7 +210,7 @@ public function setItemName($itemName = null) { // validation for constraint: string if (!is_null($itemName) && !is_string($itemName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemName, true), gettype($itemName)), __LINE__); } $this->ItemName = $itemName; return $this; @@ -231,7 +232,7 @@ public function setReturnURL($returnURL = null) { // validation for constraint: string if (!is_null($returnURL) && !is_string($returnURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($returnURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($returnURL, true), gettype($returnURL)), __LINE__); } $this->ReturnURL = $returnURL; return $this; @@ -307,7 +308,7 @@ public function setItemNumber($itemNumber = null) { // validation for constraint: string if (!is_null($itemNumber) && !is_string($itemNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($itemNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemNumber, true), gettype($itemNumber)), __LINE__); } $this->ItemNumber = $itemNumber; return $this; @@ -329,7 +330,7 @@ public function setCustom($custom = null) { // validation for constraint: string if (!is_null($custom) && !is_string($custom)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($custom)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($custom, true), gettype($custom)), __LINE__); } $this->Custom = $custom; return $this; @@ -351,7 +352,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; @@ -373,7 +374,7 @@ public function setCancelURL($cancelURL = null) { // validation for constraint: string if (!is_null($cancelURL) && !is_string($cancelURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cancelURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cancelURL, true), gettype($cancelURL)), __LINE__); } $this->CancelURL = $cancelURL; return $this; @@ -394,8 +395,8 @@ public function getAddressDisplayOptions() public function setAddressDisplayOptions($addressDisplayOptions = null) { // validation for constraint: int - if (!is_null($addressDisplayOptions) && !is_numeric($addressDisplayOptions)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($addressDisplayOptions)), __LINE__); + if (!is_null($addressDisplayOptions) && !(is_int($addressDisplayOptions) || ctype_digit($addressDisplayOptions))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($addressDisplayOptions, true), gettype($addressDisplayOptions)), __LINE__); } $this->AddressDisplayOptions = $addressDisplayOptions; return $this; @@ -416,8 +417,8 @@ public function getSharePhone() public function setSharePhone($sharePhone = null) { // validation for constraint: int - if (!is_null($sharePhone) && !is_numeric($sharePhone)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($sharePhone)), __LINE__); + if (!is_null($sharePhone) && !(is_int($sharePhone) || ctype_digit($sharePhone))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($sharePhone, true), gettype($sharePhone)), __LINE__); } $this->SharePhone = $sharePhone; return $this; @@ -457,7 +458,7 @@ public function setBuyerEmail($buyerEmail = null) { // validation for constraint: string if (!is_null($buyerEmail) && !is_string($buyerEmail)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($buyerEmail)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($buyerEmail, true), gettype($buyerEmail)), __LINE__); } $this->BuyerEmail = $buyerEmail; return $this; diff --git a/src/StructType/SetMobileCheckoutRequestType.php b/src/StructType/SetMobileCheckoutRequestType.php index 2179ab6..7403e65 100644 --- a/src/StructType/SetMobileCheckoutRequestType.php +++ b/src/StructType/SetMobileCheckoutRequestType.php @@ -13,7 +13,7 @@ class SetMobileCheckoutRequestType extends AbstractRequestType { /** * The SetMobileCheckoutRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * - ref: ebl:SetMobileCheckoutRequestDetails diff --git a/src/StructType/SetMobileCheckoutResponseType.php b/src/StructType/SetMobileCheckoutResponseType.php index 994766c..8666b09 100644 --- a/src/StructType/SetMobileCheckoutResponseType.php +++ b/src/StructType/SetMobileCheckoutResponseType.php @@ -13,7 +13,7 @@ class SetMobileCheckoutResponseType extends AbstractResponseType { /** * The Token - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A timestamped token by which you identify to PayPal that you are processing this payment with Mobile Checkout. The token expires after three hours. Character length and limitations: 20 single-byte characters * - maxOccurs: 1 * - minOccurs: 1 @@ -47,7 +47,7 @@ public function setToken($token = null) { // validation for constraint: string if (!is_null($token) && !is_string($token)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($token)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($token, true), gettype($token)), __LINE__); } $this->Token = $token; return $this; diff --git a/src/StructType/ShippingCarrierDetailsType.php b/src/StructType/ShippingCarrierDetailsType.php index 3785f3f..0bbe9b9 100644 --- a/src/StructType/ShippingCarrierDetailsType.php +++ b/src/StructType/ShippingCarrierDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for ShippingCarrierDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: is unique identified of shipping carrier, without this element the whole node makes no sence * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class ShippingCarrierDetailsType extends AbstractStructBase { /** * The CarrierShippingFee - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Calculated cost of shipping, based on shipping parameters and selected shipping service. Only returned if ShippingType = 2 (i.e., calculated shipping rate). * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -23,7 +23,7 @@ class ShippingCarrierDetailsType extends AbstractStructBase public $CarrierShippingFee; /** * The InsuranceFee - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:InsuranceFee * @var \PayPal\StructType\AmountType @@ -31,7 +31,7 @@ class ShippingCarrierDetailsType extends AbstractStructBase public $InsuranceFee; /** * The InsuranceOption - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:InsuranceOption * @var string @@ -39,7 +39,7 @@ class ShippingCarrierDetailsType extends AbstractStructBase public $InsuranceOption; /** * The PackagingHandlingCosts - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Optional fees a seller might assess for the shipping of the item. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -47,7 +47,7 @@ class ShippingCarrierDetailsType extends AbstractStructBase public $PackagingHandlingCosts; /** * The ShippingRateErrorMessage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Describes any error message associated with the attempt to calculate shipping rates. If there was no error, returns "No Error" (without the quotation marks). * - minOccurs: 0 * @var string @@ -55,7 +55,7 @@ class ShippingCarrierDetailsType extends AbstractStructBase public $ShippingRateErrorMessage; /** * The ShippingService - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:ShippingService * @var string */ @@ -141,7 +141,7 @@ public function setInsuranceOption($insuranceOption = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\InsuranceOptionCodeType::valueIsValid($insuranceOption)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $insuranceOption, implode(', ', \PayPal\EnumType\InsuranceOptionCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\InsuranceOptionCodeType', is_array($insuranceOption) ? implode(', ', $insuranceOption) : var_export($insuranceOption, true), implode(', ', \PayPal\EnumType\InsuranceOptionCodeType::getValidValues())), __LINE__); } $this->InsuranceOption = $insuranceOption; return $this; @@ -181,7 +181,7 @@ public function setShippingRateErrorMessage($shippingRateErrorMessage = null) { // validation for constraint: string if (!is_null($shippingRateErrorMessage) && !is_string($shippingRateErrorMessage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingRateErrorMessage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingRateErrorMessage, true), gettype($shippingRateErrorMessage)), __LINE__); } $this->ShippingRateErrorMessage = $shippingRateErrorMessage; return $this; @@ -206,7 +206,7 @@ public function setShippingService($shippingService = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\ShippingServiceCodeType::valueIsValid($shippingService)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $shippingService, implode(', ', \PayPal\EnumType\ShippingServiceCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\ShippingServiceCodeType', is_array($shippingService) ? implode(', ', $shippingService) : var_export($shippingService, true), implode(', ', \PayPal\EnumType\ShippingServiceCodeType::getValidValues())), __LINE__); } $this->ShippingService = $shippingService; return $this; diff --git a/src/StructType/ShippingDetailsType.php b/src/StructType/ShippingDetailsType.php index b743cb9..cec2a49 100644 --- a/src/StructType/ShippingDetailsType.php +++ b/src/StructType/ShippingDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for ShippingDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Specifies the shipping payment details. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class ShippingDetailsType extends AbstractStructBase { /** * The AllowPaymentEdit - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether the buyer edited the payment amount. * - minOccurs: 0 * @var bool @@ -23,7 +23,7 @@ class ShippingDetailsType extends AbstractStructBase public $AllowPaymentEdit; /** * The CalculatedShippingRate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Calculated shipping rate details. If present, then the calculated shipping rate option was used. * - minOccurs: 0 * @var \PayPal\StructType\CalculatedShippingRateType @@ -31,7 +31,7 @@ class ShippingDetailsType extends AbstractStructBase public $CalculatedShippingRate; /** * The ChangePaymentInstructions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether the payment instructions are included (e.g., for updating the details of a transaction). * - minOccurs: 0 * @var bool @@ -39,7 +39,7 @@ class ShippingDetailsType extends AbstractStructBase public $ChangePaymentInstructions; /** * The FlatShippingRate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Flat shipping rate details. If present, then the flat shipping rate option was used. * - maxOccurs: unbounded * - minOccurs: 0 @@ -48,7 +48,7 @@ class ShippingDetailsType extends AbstractStructBase public $FlatShippingRate; /** * The InsuranceTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Total cost of insurance for the transaction. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -56,7 +56,7 @@ class ShippingDetailsType extends AbstractStructBase public $InsuranceTotal; /** * The InsuranceWanted - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether buyer selected to have insurance. * - minOccurs: 0 * @var bool @@ -64,7 +64,7 @@ class ShippingDetailsType extends AbstractStructBase public $InsuranceWanted; /** * The PaymentInstructions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Payment instuctions. * - minOccurs: 0 * @var string @@ -72,7 +72,7 @@ class ShippingDetailsType extends AbstractStructBase public $PaymentInstructions; /** * The SalesTax - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Sales tax details. Sales tax applicable for only US sites. For non-US sites this sub-element should not be used. * - minOccurs: 0 * @var \PayPal\StructType\SalesTaxType @@ -80,7 +80,7 @@ class ShippingDetailsType extends AbstractStructBase public $SalesTax; /** * The SellerPostalCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Postal/Zip code from where the seller will ship the item. * - minOccurs: 0 * @var string @@ -137,7 +137,7 @@ public function setAllowPaymentEdit($allowPaymentEdit = null) { // validation for constraint: boolean if (!is_null($allowPaymentEdit) && !is_bool($allowPaymentEdit)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($allowPaymentEdit)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($allowPaymentEdit, true), gettype($allowPaymentEdit)), __LINE__); } $this->AllowPaymentEdit = $allowPaymentEdit; return $this; @@ -177,7 +177,7 @@ public function setChangePaymentInstructions($changePaymentInstructions = null) { // validation for constraint: boolean if (!is_null($changePaymentInstructions) && !is_bool($changePaymentInstructions)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($changePaymentInstructions)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($changePaymentInstructions, true), gettype($changePaymentInstructions)), __LINE__); } $this->ChangePaymentInstructions = $changePaymentInstructions; return $this; @@ -190,6 +190,28 @@ public function getFlatShippingRate() { return $this->FlatShippingRate; } + /** + * This method is responsible for validating the values passed to the setFlatShippingRate method + * This method is willingly generated in order to preserve the one-line inline validation within the setFlatShippingRate method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateFlatShippingRateForArrayConstraintsFromSetFlatShippingRate(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $shippingDetailsTypeFlatShippingRateItem) { + // validation for constraint: itemType + if (!$shippingDetailsTypeFlatShippingRateItem instanceof \PayPal\StructType\FlatShippingRateType) { + $invalidValues[] = is_object($shippingDetailsTypeFlatShippingRateItem) ? get_class($shippingDetailsTypeFlatShippingRateItem) : sprintf('%s(%s)', gettype($shippingDetailsTypeFlatShippingRateItem), var_export($shippingDetailsTypeFlatShippingRateItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The FlatShippingRate property can only contain items of type \PayPal\StructType\FlatShippingRateType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set FlatShippingRate value * @throws \InvalidArgumentException @@ -198,11 +220,9 @@ public function getFlatShippingRate() */ public function setFlatShippingRate(array $flatShippingRate = array()) { - foreach ($flatShippingRate as $shippingDetailsTypeFlatShippingRateItem) { - // validation for constraint: itemType - if (!$shippingDetailsTypeFlatShippingRateItem instanceof \PayPal\StructType\FlatShippingRateType) { - throw new \InvalidArgumentException(sprintf('The FlatShippingRate property can only contain items of \PayPal\StructType\FlatShippingRateType, "%s" given', is_object($shippingDetailsTypeFlatShippingRateItem) ? get_class($shippingDetailsTypeFlatShippingRateItem) : gettype($shippingDetailsTypeFlatShippingRateItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($flatShippingRateArrayErrorMessage = self::validateFlatShippingRateForArrayConstraintsFromSetFlatShippingRate($flatShippingRate))) { + throw new \InvalidArgumentException($flatShippingRateArrayErrorMessage, __LINE__); } $this->FlatShippingRate = $flatShippingRate; return $this; @@ -217,7 +237,7 @@ public function addToFlatShippingRate(\PayPal\StructType\FlatShippingRateType $i { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\FlatShippingRateType) { - throw new \InvalidArgumentException(sprintf('The FlatShippingRate property can only contain items of \PayPal\StructType\FlatShippingRateType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The FlatShippingRate property can only contain items of type \PayPal\StructType\FlatShippingRateType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->FlatShippingRate[] = $item; return $this; @@ -257,7 +277,7 @@ public function setInsuranceWanted($insuranceWanted = null) { // validation for constraint: boolean if (!is_null($insuranceWanted) && !is_bool($insuranceWanted)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($insuranceWanted)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($insuranceWanted, true), gettype($insuranceWanted)), __LINE__); } $this->InsuranceWanted = $insuranceWanted; return $this; @@ -279,7 +299,7 @@ public function setPaymentInstructions($paymentInstructions = null) { // validation for constraint: string if (!is_null($paymentInstructions) && !is_string($paymentInstructions)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($paymentInstructions)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($paymentInstructions, true), gettype($paymentInstructions)), __LINE__); } $this->PaymentInstructions = $paymentInstructions; return $this; @@ -319,7 +339,7 @@ public function setSellerPostalCode($sellerPostalCode = null) { // validation for constraint: string if (!is_null($sellerPostalCode) && !is_string($sellerPostalCode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sellerPostalCode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sellerPostalCode, true), gettype($sellerPostalCode)), __LINE__); } $this->SellerPostalCode = $sellerPostalCode; return $this; diff --git a/src/StructType/ShippingInfoType.php b/src/StructType/ShippingInfoType.php index 232e928..eb3d1ce 100644 --- a/src/StructType/ShippingInfoType.php +++ b/src/StructType/ShippingInfoType.php @@ -75,7 +75,7 @@ public function setShippingMethod($shippingMethod = null) { // validation for constraint: string if (!is_null($shippingMethod) && !is_string($shippingMethod)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingMethod)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingMethod, true), gettype($shippingMethod)), __LINE__); } $this->ShippingMethod = $shippingMethod; return $this; @@ -97,7 +97,7 @@ public function setShippingCarrier($shippingCarrier = null) { // validation for constraint: string if (!is_null($shippingCarrier) && !is_string($shippingCarrier)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingCarrier)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingCarrier, true), gettype($shippingCarrier)), __LINE__); } $this->ShippingCarrier = $shippingCarrier; return $this; diff --git a/src/StructType/ShippingOptionType.php b/src/StructType/ShippingOptionType.php index f20d7fa..95e900c 100644 --- a/src/StructType/ShippingOptionType.php +++ b/src/StructType/ShippingOptionType.php @@ -6,7 +6,7 @@ /** * This class stands for ShippingOptionType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Fallback shipping options type. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class ShippingOptionType extends AbstractStructBase { /** * The ShippingOptionIsDefault - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class ShippingOptionType extends AbstractStructBase public $ShippingOptionIsDefault; /** * The ShippingOptionAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -31,7 +31,7 @@ class ShippingOptionType extends AbstractStructBase public $ShippingOptionAmount; /** * The ShippingOptionName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -70,7 +70,7 @@ public function setShippingOptionIsDefault($shippingOptionIsDefault = null) { // validation for constraint: string if (!is_null($shippingOptionIsDefault) && !is_string($shippingOptionIsDefault)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingOptionIsDefault)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingOptionIsDefault, true), gettype($shippingOptionIsDefault)), __LINE__); } $this->ShippingOptionIsDefault = $shippingOptionIsDefault; return $this; @@ -110,7 +110,7 @@ public function setShippingOptionName($shippingOptionName = null) { // validation for constraint: string if (!is_null($shippingOptionName) && !is_string($shippingOptionName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingOptionName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingOptionName, true), gettype($shippingOptionName)), __LINE__); } $this->ShippingOptionName = $shippingOptionName; return $this; diff --git a/src/StructType/SiteHostedPictureType.php b/src/StructType/SiteHostedPictureType.php index 9497cf2..ab1d5b4 100644 --- a/src/StructType/SiteHostedPictureType.php +++ b/src/StructType/SiteHostedPictureType.php @@ -13,7 +13,7 @@ class SiteHostedPictureType extends AbstractStructBase { /** * The PictureURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URLs for item picture that are stored/hosted at eBay site. * - maxOccurs: 6 * - minOccurs: 0 @@ -22,7 +22,7 @@ class SiteHostedPictureType extends AbstractStructBase public $PictureURL; /** * The PhotoDisplay - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Type of display for photos used for PhotoHosting slide show. Here are display options: None = No special Picture Services features. SlideShow = Slideshow of multiple pictures. SuperSize = Super-size format picture. PicturePack = * Picture Pack. Default is 'None'. * - minOccurs: 0 @@ -31,7 +31,7 @@ class SiteHostedPictureType extends AbstractStructBase public $PhotoDisplay; /** * The GalleryType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This will be either "Featured" or "Gallery". * - minOccurs: 0 * @var string @@ -61,6 +61,28 @@ public function getPictureURL() { return $this->PictureURL; } + /** + * This method is responsible for validating the values passed to the setPictureURL method + * This method is willingly generated in order to preserve the one-line inline validation within the setPictureURL method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePictureURLForArrayConstraintsFromSetPictureURL(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $siteHostedPictureTypePictureURLItem) { + // validation for constraint: itemType + if (!is_string($siteHostedPictureTypePictureURLItem)) { + $invalidValues[] = is_object($siteHostedPictureTypePictureURLItem) ? get_class($siteHostedPictureTypePictureURLItem) : sprintf('%s(%s)', gettype($siteHostedPictureTypePictureURLItem), var_export($siteHostedPictureTypePictureURLItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The PictureURL property can only contain items of type anyURI, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set PictureURL value * @throws \InvalidArgumentException @@ -69,11 +91,13 @@ public function getPictureURL() */ public function setPictureURL(array $pictureURL = array()) { - foreach ($pictureURL as $siteHostedPictureTypePictureURLItem) { - // validation for constraint: itemType - if (!is_string($siteHostedPictureTypePictureURLItem)) { - throw new \InvalidArgumentException(sprintf('The PictureURL property can only contain items of anyURI, "%s" given', is_object($siteHostedPictureTypePictureURLItem) ? get_class($siteHostedPictureTypePictureURLItem) : gettype($siteHostedPictureTypePictureURLItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($pictureURLArrayErrorMessage = self::validatePictureURLForArrayConstraintsFromSetPictureURL($pictureURL))) { + throw new \InvalidArgumentException($pictureURLArrayErrorMessage, __LINE__); + } + // validation for constraint: maxOccurs(6) + if (is_array($pictureURL) && count($pictureURL) > 6) { + throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 6', count($pictureURL)), __LINE__); } $this->PictureURL = $pictureURL; return $this; @@ -88,7 +112,11 @@ public function addToPictureURL($item) { // validation for constraint: itemType if (!is_string($item)) { - throw new \InvalidArgumentException(sprintf('The PictureURL property can only contain items of anyURI, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The PictureURL property can only contain items of type anyURI, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); + } + // validation for constraint: maxOccurs(6) + if (is_array($this->PictureURL) && count($this->PictureURL) >= 6) { + 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 6', count($this->PictureURL)), __LINE__); } $this->PictureURL[] = $item; return $this; @@ -113,7 +141,7 @@ public function setPhotoDisplay($photoDisplay = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PhotoDisplayCodeType::valueIsValid($photoDisplay)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $photoDisplay, implode(', ', \PayPal\EnumType\PhotoDisplayCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PhotoDisplayCodeType', is_array($photoDisplay) ? implode(', ', $photoDisplay) : var_export($photoDisplay, true), implode(', ', \PayPal\EnumType\PhotoDisplayCodeType::getValidValues())), __LINE__); } $this->PhotoDisplay = $photoDisplay; return $this; @@ -138,7 +166,7 @@ public function setGalleryType($galleryType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\GalleryTypeCodeType::valueIsValid($galleryType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $galleryType, implode(', ', \PayPal\EnumType\GalleryTypeCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\GalleryTypeCodeType', is_array($galleryType) ? implode(', ', $galleryType) : var_export($galleryType, true), implode(', ', \PayPal\EnumType\GalleryTypeCodeType::getValidValues())), __LINE__); } $this->GalleryType = $galleryType; return $this; diff --git a/src/StructType/StorefrontType.php b/src/StructType/StorefrontType.php index b6fd8ae..c96c361 100644 --- a/src/StructType/StorefrontType.php +++ b/src/StructType/StorefrontType.php @@ -6,10 +6,10 @@ /** * This class stands for StorefrontType StructType - * Meta informations extracted from the WSDL - * - documentation: Contains the eBay Stores-specific item attributes department number and store location. StorefrontInfo is shown for any item that belongs to an eBay Store owner, regardless of whether it is fixed price or auction type. Returned as - * null for international fixed price items. | assumed this type is specific to add/get/revise item, then each StorefrontType nust have category id, for store details this node makes no sense to use | in case or revise item for example - to change store - * category (department) you do not need to change store URL, so it will notbe in request + * Meta information extracted from the WSDL + * - documentation: in case or revise item for example - to change store category (department) you do not need to change store URL, so it will notbe in request | assumed this type is specific to add/get/revise item, then each StorefrontType nust have + * category id, for store details this node makes no sense to use | Contains the eBay Stores-specific item attributes department number and store location. StorefrontInfo is shown for any item that belongs to an eBay Store owner, regardless of whether + * it is fixed price or auction type. Returned as null for international fixed price items. * @subpackage Structs * @author WsdlToPhp */ @@ -17,14 +17,14 @@ class StorefrontType extends AbstractStructBase { /** * The StoreCategoryID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:StoreCategoryID * @var int */ public $StoreCategoryID; /** * The StoreURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:StoreURL * @var string @@ -59,8 +59,8 @@ public function getStoreCategoryID() public function setStoreCategoryID($storeCategoryID = null) { // validation for constraint: int - if (!is_null($storeCategoryID) && !is_numeric($storeCategoryID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($storeCategoryID)), __LINE__); + if (!is_null($storeCategoryID) && !(is_int($storeCategoryID) || ctype_digit($storeCategoryID))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($storeCategoryID, true), gettype($storeCategoryID)), __LINE__); } $this->StoreCategoryID = $storeCategoryID; return $this; @@ -82,7 +82,7 @@ public function setStoreURL($storeURL = null) { // validation for constraint: string if (!is_null($storeURL) && !is_string($storeURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($storeURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($storeURL, true), gettype($storeURL)), __LINE__); } $this->StoreURL = $storeURL; return $this; diff --git a/src/StructType/SubscriptionInfoType.php b/src/StructType/SubscriptionInfoType.php index e70e32e..e36fa60 100644 --- a/src/StructType/SubscriptionInfoType.php +++ b/src/StructType/SubscriptionInfoType.php @@ -6,8 +6,8 @@ /** * This class stands for SubscriptionInfoType StructType - * Meta informations extracted from the WSDL - * - documentation: SubscriptionInfoType Information about a PayPal Subscription. | ID generated by PayPal for the subscriber. Character length and limitations: no limit + * Meta information extracted from the WSDL + * - documentation: ID generated by PayPal for the subscriber. Character length and limitations: no limit | SubscriptionInfoType Information about a PayPal Subscription. * @subpackage Structs * @author WsdlToPhp */ @@ -15,28 +15,28 @@ class SubscriptionInfoType extends AbstractStructBase { /** * The reattempt - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: required * @var string */ public $reattempt; /** * The recurring - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: required * @var string */ public $recurring; /** * The SubscriptionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:SubscriptionID * @var string */ public $SubscriptionID; /** * The SubscriptionDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Subscription start date * - minOccurs: 0 * @var string @@ -44,7 +44,7 @@ class SubscriptionInfoType extends AbstractStructBase public $SubscriptionDate; /** * The EffectiveDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date when the subscription modification will be effective * - minOccurs: 0 * @var string @@ -52,7 +52,7 @@ class SubscriptionInfoType extends AbstractStructBase public $EffectiveDate; /** * The RetryTime - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Date PayPal will retry a failed subscription payment * - minOccurs: 0 * @var string @@ -60,7 +60,7 @@ class SubscriptionInfoType extends AbstractStructBase public $RetryTime; /** * The Username - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Username generated by PayPal and given to subscriber to access the subscription. Character length and limitations: 64 alphanumeric single-byte characters * - minOccurs: 0 * @var string @@ -68,7 +68,7 @@ class SubscriptionInfoType extends AbstractStructBase public $Username; /** * The Password - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Password generated by PayPal and given to subscriber to access the subscription. For security, the value of the password is hashed. Character length and limitations: 128 alphanumeric single-byte characters * - minOccurs: 0 * @var string @@ -76,7 +76,7 @@ class SubscriptionInfoType extends AbstractStructBase public $Password; /** * The Recurrences - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The number of payment installments that will occur at the regular rate. Character length and limitations: no limit * - minOccurs: 0 * @var string @@ -84,7 +84,7 @@ class SubscriptionInfoType extends AbstractStructBase public $Recurrences; /** * The Terms - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Subscription duration and charges * - maxOccurs: unbounded * - minOccurs: 0 @@ -145,7 +145,7 @@ public function setReattempt($reattempt = null) { // validation for constraint: string if (!is_null($reattempt) && !is_string($reattempt)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($reattempt)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reattempt, true), gettype($reattempt)), __LINE__); } $this->reattempt = $reattempt; return $this; @@ -167,7 +167,7 @@ public function setRecurring($recurring = null) { // validation for constraint: string if (!is_null($recurring) && !is_string($recurring)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($recurring)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($recurring, true), gettype($recurring)), __LINE__); } $this->recurring = $recurring; return $this; @@ -189,7 +189,7 @@ public function setSubscriptionID($subscriptionID = null) { // validation for constraint: string if (!is_null($subscriptionID) && !is_string($subscriptionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($subscriptionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subscriptionID, true), gettype($subscriptionID)), __LINE__); } $this->SubscriptionID = $subscriptionID; return $this; @@ -211,7 +211,7 @@ public function setSubscriptionDate($subscriptionDate = null) { // validation for constraint: string if (!is_null($subscriptionDate) && !is_string($subscriptionDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($subscriptionDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subscriptionDate, true), gettype($subscriptionDate)), __LINE__); } $this->SubscriptionDate = $subscriptionDate; return $this; @@ -233,7 +233,7 @@ public function setEffectiveDate($effectiveDate = null) { // validation for constraint: string if (!is_null($effectiveDate) && !is_string($effectiveDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($effectiveDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($effectiveDate, true), gettype($effectiveDate)), __LINE__); } $this->EffectiveDate = $effectiveDate; return $this; @@ -255,7 +255,7 @@ public function setRetryTime($retryTime = null) { // validation for constraint: string if (!is_null($retryTime) && !is_string($retryTime)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($retryTime)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($retryTime, true), gettype($retryTime)), __LINE__); } $this->RetryTime = $retryTime; return $this; @@ -277,7 +277,7 @@ public function setUsername($username = null) { // validation for constraint: string if (!is_null($username) && !is_string($username)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($username)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($username, true), gettype($username)), __LINE__); } $this->Username = $username; return $this; @@ -299,7 +299,7 @@ public function setPassword($password = null) { // validation for constraint: string if (!is_null($password) && !is_string($password)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($password)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($password, true), gettype($password)), __LINE__); } $this->Password = $password; return $this; @@ -321,7 +321,7 @@ public function setRecurrences($recurrences = null) { // validation for constraint: string if (!is_null($recurrences) && !is_string($recurrences)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($recurrences)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($recurrences, true), gettype($recurrences)), __LINE__); } $this->Recurrences = $recurrences; return $this; @@ -334,6 +334,28 @@ public function getTerms() { return $this->Terms; } + /** + * This method is responsible for validating the values passed to the setTerms method + * This method is willingly generated in order to preserve the one-line inline validation within the setTerms method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateTermsForArrayConstraintsFromSetTerms(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $subscriptionInfoTypeTermsItem) { + // validation for constraint: itemType + if (!$subscriptionInfoTypeTermsItem instanceof \PayPal\StructType\SubscriptionTermsType) { + $invalidValues[] = is_object($subscriptionInfoTypeTermsItem) ? get_class($subscriptionInfoTypeTermsItem) : sprintf('%s(%s)', gettype($subscriptionInfoTypeTermsItem), var_export($subscriptionInfoTypeTermsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Terms property can only contain items of type \PayPal\StructType\SubscriptionTermsType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Terms value * @throws \InvalidArgumentException @@ -342,11 +364,9 @@ public function getTerms() */ public function setTerms(array $terms = array()) { - foreach ($terms as $subscriptionInfoTypeTermsItem) { - // validation for constraint: itemType - if (!$subscriptionInfoTypeTermsItem instanceof \PayPal\StructType\SubscriptionTermsType) { - throw new \InvalidArgumentException(sprintf('The Terms property can only contain items of \PayPal\StructType\SubscriptionTermsType, "%s" given', is_object($subscriptionInfoTypeTermsItem) ? get_class($subscriptionInfoTypeTermsItem) : gettype($subscriptionInfoTypeTermsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($termsArrayErrorMessage = self::validateTermsForArrayConstraintsFromSetTerms($terms))) { + throw new \InvalidArgumentException($termsArrayErrorMessage, __LINE__); } $this->Terms = $terms; return $this; @@ -361,7 +381,7 @@ public function addToTerms(\PayPal\StructType\SubscriptionTermsType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\SubscriptionTermsType) { - throw new \InvalidArgumentException(sprintf('The Terms property can only contain items of \PayPal\StructType\SubscriptionTermsType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Terms property can only contain items of type \PayPal\StructType\SubscriptionTermsType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Terms[] = $item; return $this; diff --git a/src/StructType/SubscriptionTermsType.php b/src/StructType/SubscriptionTermsType.php index 52fa2d2..cf7dc15 100644 --- a/src/StructType/SubscriptionTermsType.php +++ b/src/StructType/SubscriptionTermsType.php @@ -6,7 +6,7 @@ /** * This class stands for SubscriptionTermsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: SubscriptionTermsType Terms of a PayPal subscription. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class SubscriptionTermsType extends AbstractStructBase { /** * The period - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: required * @var string */ @@ -55,7 +55,7 @@ public function setPeriod($period = null) { // validation for constraint: string if (!is_null($period) && !is_string($period)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($period)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($period, true), gettype($period)), __LINE__); } $this->period = $period; return $this; diff --git a/src/StructType/TaxIdDetailsType.php b/src/StructType/TaxIdDetailsType.php index 0c8d3fc..0ea9d0a 100644 --- a/src/StructType/TaxIdDetailsType.php +++ b/src/StructType/TaxIdDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for TaxIdDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about the payer's tax info passed in by the merchant or partner. Optional. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class TaxIdDetailsType extends AbstractStructBase { /** * The TaxIdType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The payer's Tax ID type; CNPJ/CPF for BR country. * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class TaxIdDetailsType extends AbstractStructBase public $TaxIdType; /** * The TaxId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The payer's Tax ID * - minOccurs: 0 * @var string @@ -59,7 +59,7 @@ public function setTaxIdType($taxIdType = null) { // validation for constraint: string if (!is_null($taxIdType) && !is_string($taxIdType)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($taxIdType)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($taxIdType, true), gettype($taxIdType)), __LINE__); } $this->TaxIdType = $taxIdType; return $this; @@ -81,7 +81,7 @@ public function setTaxId($taxId = null) { // validation for constraint: string if (!is_null($taxId) && !is_string($taxId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($taxId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($taxId, true), gettype($taxId)), __LINE__); } $this->TaxId = $taxId; return $this; diff --git a/src/StructType/TaxInfoType.php b/src/StructType/TaxInfoType.php index d9e466c..06df580 100644 --- a/src/StructType/TaxInfoType.php +++ b/src/StructType/TaxInfoType.php @@ -77,7 +77,7 @@ public function setSalesTaxPercentage($salesTaxPercentage = null) { // validation for constraint: string if (!is_null($salesTaxPercentage) && !is_string($salesTaxPercentage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($salesTaxPercentage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($salesTaxPercentage, true), gettype($salesTaxPercentage)), __LINE__); } $this->SalesTaxPercentage = $salesTaxPercentage; return $this; @@ -99,7 +99,7 @@ public function setTaxState($taxState = null) { // validation for constraint: string if (!is_null($taxState) && !is_string($taxState)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($taxState)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($taxState, true), gettype($taxState)), __LINE__); } $this->TaxState = $taxState; return $this; diff --git a/src/StructType/ThreeDSecureInfoType.php b/src/StructType/ThreeDSecureInfoType.php index 723ad50..875a157 100644 --- a/src/StructType/ThreeDSecureInfoType.php +++ b/src/StructType/ThreeDSecureInfoType.php @@ -6,7 +6,7 @@ /** * This class stands for ThreeDSecureInfoType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: 3DSecureInfoType Information about 3D Secure parameters. * @subpackage Structs * @author WsdlToPhp @@ -15,14 +15,14 @@ class ThreeDSecureInfoType extends AbstractStructBase { /** * The ThreeDSecureRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\ThreeDSecureRequestType */ public $ThreeDSecureRequest; /** * The ThreeDSecureResponse - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\ThreeDSecureResponseType */ diff --git a/src/StructType/ThreeDSecureRequestType.php b/src/StructType/ThreeDSecureRequestType.php index aa85b31..c366313 100644 --- a/src/StructType/ThreeDSecureRequestType.php +++ b/src/StructType/ThreeDSecureRequestType.php @@ -6,7 +6,7 @@ /** * This class stands for ThreeDSecureRequestType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The Common 3DS fields. Common for both GTD and DCC API's. * @subpackage Structs * @author WsdlToPhp @@ -15,35 +15,35 @@ class ThreeDSecureRequestType extends AbstractStructBase { /** * The Eci3ds - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $Eci3ds; /** * The Cavv - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $Cavv; /** * The Xid - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $Xid; /** * The MpiVendor3ds - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $MpiVendor3ds; /** * The AuthStatus3ds - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -87,7 +87,7 @@ public function setEci3ds($eci3ds = null) { // validation for constraint: string if (!is_null($eci3ds) && !is_string($eci3ds)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($eci3ds)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($eci3ds, true), gettype($eci3ds)), __LINE__); } $this->Eci3ds = $eci3ds; return $this; @@ -109,7 +109,7 @@ public function setCavv($cavv = null) { // validation for constraint: string if (!is_null($cavv) && !is_string($cavv)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cavv)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cavv, true), gettype($cavv)), __LINE__); } $this->Cavv = $cavv; return $this; @@ -131,7 +131,7 @@ public function setXid($xid = null) { // validation for constraint: string if (!is_null($xid) && !is_string($xid)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($xid)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($xid, true), gettype($xid)), __LINE__); } $this->Xid = $xid; return $this; @@ -153,7 +153,7 @@ public function setMpiVendor3ds($mpiVendor3ds = null) { // validation for constraint: string if (!is_null($mpiVendor3ds) && !is_string($mpiVendor3ds)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($mpiVendor3ds)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($mpiVendor3ds, true), gettype($mpiVendor3ds)), __LINE__); } $this->MpiVendor3ds = $mpiVendor3ds; return $this; @@ -175,7 +175,7 @@ public function setAuthStatus3ds($authStatus3ds = null) { // validation for constraint: string if (!is_null($authStatus3ds) && !is_string($authStatus3ds)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authStatus3ds)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authStatus3ds, true), gettype($authStatus3ds)), __LINE__); } $this->AuthStatus3ds = $authStatus3ds; return $this; diff --git a/src/StructType/ThreeDSecureResponseType.php b/src/StructType/ThreeDSecureResponseType.php index ebb9b52..860a12a 100644 --- a/src/StructType/ThreeDSecureResponseType.php +++ b/src/StructType/ThreeDSecureResponseType.php @@ -6,7 +6,7 @@ /** * This class stands for ThreeDSecureResponseType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: 3DS remaining fields. * @subpackage Structs * @author WsdlToPhp @@ -15,14 +15,14 @@ class ThreeDSecureResponseType extends AbstractStructBase { /** * The Vpas - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $Vpas; /** * The EciSubmitted3DS - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ @@ -57,7 +57,7 @@ public function setVpas($vpas = null) { // validation for constraint: string if (!is_null($vpas) && !is_string($vpas)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($vpas)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($vpas, true), gettype($vpas)), __LINE__); } $this->Vpas = $vpas; return $this; @@ -79,7 +79,7 @@ public function setEciSubmitted3DS($eciSubmitted3DS = null) { // validation for constraint: string if (!is_null($eciSubmitted3DS) && !is_string($eciSubmitted3DS)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($eciSubmitted3DS)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($eciSubmitted3DS, true), gettype($eciSubmitted3DS)), __LINE__); } $this->EciSubmitted3DS = $eciSubmitted3DS; return $this; diff --git a/src/StructType/TransactionSearchReq.php b/src/StructType/TransactionSearchReq.php index 7de2727..1bbc5a8 100644 --- a/src/StructType/TransactionSearchReq.php +++ b/src/StructType/TransactionSearchReq.php @@ -13,7 +13,7 @@ class TransactionSearchReq extends AbstractStructBase { /** * The TransactionSearchRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:TransactionSearchRequest * @var \PayPal\StructType\TransactionSearchRequestType */ diff --git a/src/StructType/TransactionSearchRequestType.php b/src/StructType/TransactionSearchRequestType.php index 00a486a..13515a4 100644 --- a/src/StructType/TransactionSearchRequestType.php +++ b/src/StructType/TransactionSearchRequestType.php @@ -13,7 +13,7 @@ class TransactionSearchRequestType extends AbstractRequestType { /** * The StartDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The earliest transaction date at which to start the search. No wildcards are allowed. Required * - maxOccurs: 1 * - minOccurs: 1 @@ -22,7 +22,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $StartDate; /** * The EndDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The latest transaction date to be included in the search Optional * - minOccurs: 0 * @var string @@ -30,8 +30,9 @@ class TransactionSearchRequestType extends AbstractRequestType public $EndDate; /** * The Payer - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by the buyer's email address OptionalCharacter length and limitations: 127 single-byte alphanumeric characters + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -39,8 +40,9 @@ class TransactionSearchRequestType extends AbstractRequestType public $Payer; /** * The Receiver - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by the receiver's email address. If the merchant account has only one email, this is the primary email. Can also be a non-primary email.Optional + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -48,7 +50,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $Receiver; /** * The ReceiptID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by the PayPal Account Optional receipt IDOptional * - maxOccurs: 1 * - minOccurs: 0 @@ -57,8 +59,9 @@ class TransactionSearchRequestType extends AbstractRequestType public $ReceiptID; /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by the transaction ID. OptionalThe returned results are from the merchant's transaction records. Character length and limitations: 19 single-byte characters maximum | TransactionId - Type for a PayPal Transaction ID. + * - base: xs:string * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -66,7 +69,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $TransactionID; /** * The ProfileID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by Recurring Payment Profile id. The ProfileID is returned as part of the CreateRecurringPaymentsProfile API response. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -75,7 +78,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $ProfileID; /** * The PayerName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by the buyer's name OptionalSalutation: 20 single-byte character limit.FirstName: 25 single-byte character limit.MiddleName: 25 single-byte character limit.LastName: 25 single-byte character limit.Suffix: 12 single-byte * character limit. * - maxOccurs: 1 @@ -85,7 +88,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $PayerName; /** * The AuctionItemNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by item number of the purchased goods.OptionalTo search for purchased items not related to auctions, set the AuctionItemNumber element to the value of the HTML item_number variable set in the shopping cart for the original * transaction. * - maxOccurs: 1 @@ -95,7 +98,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $AuctionItemNumber; /** * The InvoiceID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by invoice identification key, as set by you for the original transaction. InvoiceID searches the invoice records for items sold by the merchant, not the items purchased. OptionalThe value for InvoiceID must exactly match an * invoice identification number. No wildcards are allowed. Character length and limitations: 127 single-byte characters maximum * - maxOccurs: 1 @@ -105,7 +108,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $InvoiceID; /** * The CardNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -113,7 +116,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $CardNumber; /** * The TransactionClass - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by classification of transaction. Some kinds of possible classes of transactions are not searchable with TransactionSearchRequest. You cannot search for bank transfer withdrawals, for example. OptionalAll: all transaction * classifications.Sent: only payments sent.Received: only payments received.MassPay: only mass payments.MoneyRequest: only money requests.FundsAdded: only funds added to balance.FundsWithdrawn: only funds withdrawn from balance.Referral: only * transactions involving referrals.Fee: only transactions involving fees.Subscription: only transactions involving subscriptions.Dividend: only transactions involving dividends.Billpay: only transactions involving BillPay Transactions.Refund: only @@ -126,7 +129,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $TransactionClass; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by transaction amount OptionalYou must set the currencyID attribute to one of the three-character currency codes for any of the supported PayPal currencies. * - maxOccurs: 1 * - minOccurs: 0 @@ -135,7 +138,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $Amount; /** * The CurrencyCode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by currency codeOptional * - maxOccurs: 1 * - minOccurs: 0 @@ -144,7 +147,7 @@ class TransactionSearchRequestType extends AbstractRequestType public $CurrencyCode; /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Search by transaction status OptionalPending: The payment is pending. The specific reason the payment is pending is returned by the GetTransactionDetails APIPendingReason element. For more information, see PendingReason.Processing: * The payment is being processed.Success: The payment has been completed and the funds have been added successfully to your account balance.Denied: You denied the payment. This happens only if the payment was previously pending.Reversed: A payment was * reversed due to a chargeback or other type of reversal. The funds have been removed from your account balance and returned to the buyer. @@ -222,7 +225,7 @@ public function setStartDate($startDate = null) { // validation for constraint: string if (!is_null($startDate) && !is_string($startDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($startDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($startDate, true), gettype($startDate)), __LINE__); } $this->StartDate = $startDate; return $this; @@ -244,7 +247,7 @@ public function setEndDate($endDate = null) { // validation for constraint: string if (!is_null($endDate) && !is_string($endDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($endDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($endDate, true), gettype($endDate)), __LINE__); } $this->EndDate = $endDate; return $this; @@ -266,7 +269,7 @@ public function setPayer($payer = null) { // validation for constraint: string if (!is_null($payer) && !is_string($payer)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payer)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payer, true), gettype($payer)), __LINE__); } $this->Payer = $payer; return $this; @@ -288,7 +291,7 @@ public function setReceiver($receiver = null) { // validation for constraint: string if (!is_null($receiver) && !is_string($receiver)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiver)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiver, true), gettype($receiver)), __LINE__); } $this->Receiver = $receiver; return $this; @@ -310,7 +313,7 @@ public function setReceiptID($receiptID = null) { // validation for constraint: string if (!is_null($receiptID) && !is_string($receiptID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($receiptID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receiptID, true), gettype($receiptID)), __LINE__); } $this->ReceiptID = $receiptID; return $this; @@ -332,7 +335,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -354,7 +357,7 @@ public function setProfileID($profileID = null) { // validation for constraint: string if (!is_null($profileID) && !is_string($profileID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileID, true), gettype($profileID)), __LINE__); } $this->ProfileID = $profileID; return $this; @@ -394,7 +397,7 @@ public function setAuctionItemNumber($auctionItemNumber = null) { // validation for constraint: string if (!is_null($auctionItemNumber) && !is_string($auctionItemNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($auctionItemNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($auctionItemNumber, true), gettype($auctionItemNumber)), __LINE__); } $this->AuctionItemNumber = $auctionItemNumber; return $this; @@ -416,7 +419,7 @@ public function setInvoiceID($invoiceID = null) { // validation for constraint: string if (!is_null($invoiceID) && !is_string($invoiceID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($invoiceID, true), gettype($invoiceID)), __LINE__); } $this->InvoiceID = $invoiceID; return $this; @@ -438,7 +441,7 @@ public function setCardNumber($cardNumber = null) { // validation for constraint: string if (!is_null($cardNumber) && !is_string($cardNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($cardNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($cardNumber, true), gettype($cardNumber)), __LINE__); } $this->CardNumber = $cardNumber; return $this; @@ -463,7 +466,7 @@ public function setTransactionClass($transactionClass = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentTransactionClassCodeType::valueIsValid($transactionClass)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $transactionClass, implode(', ', \PayPal\EnumType\PaymentTransactionClassCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentTransactionClassCodeType', is_array($transactionClass) ? implode(', ', $transactionClass) : var_export($transactionClass, true), implode(', ', \PayPal\EnumType\PaymentTransactionClassCodeType::getValidValues())), __LINE__); } $this->TransactionClass = $transactionClass; return $this; @@ -506,7 +509,7 @@ public function setCurrencyCode($currencyCode = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\CurrencyCodeType::valueIsValid($currencyCode)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $currencyCode, implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\CurrencyCodeType', is_array($currencyCode) ? implode(', ', $currencyCode) : var_export($currencyCode, true), implode(', ', \PayPal\EnumType\CurrencyCodeType::getValidValues())), __LINE__); } $this->CurrencyCode = $currencyCode; return $this; @@ -531,7 +534,7 @@ public function setStatus($status = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\PaymentTransactionStatusCodeType::valueIsValid($status)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $status, implode(', ', \PayPal\EnumType\PaymentTransactionStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\PaymentTransactionStatusCodeType', is_array($status) ? implode(', ', $status) : var_export($status, true), implode(', ', \PayPal\EnumType\PaymentTransactionStatusCodeType::getValidValues())), __LINE__); } $this->Status = $status; return $this; diff --git a/src/StructType/TransactionSearchResponseType.php b/src/StructType/TransactionSearchResponseType.php index 5dac6b5..b24b9b1 100644 --- a/src/StructType/TransactionSearchResponseType.php +++ b/src/StructType/TransactionSearchResponseType.php @@ -6,7 +6,7 @@ /** * This class stands for TransactionSearchResponseType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Results of a Transaction Search. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class TransactionSearchResponseType extends AbstractResponseType { /** * The PaymentTransactions - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - minOccurs: 0 * - ref: ebl:PaymentTransactions @@ -40,6 +40,28 @@ public function getPaymentTransactions() { return $this->PaymentTransactions; } + /** + * This method is responsible for validating the values passed to the setPaymentTransactions method + * This method is willingly generated in order to preserve the one-line inline validation within the setPaymentTransactions method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validatePaymentTransactionsForArrayConstraintsFromSetPaymentTransactions(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $transactionSearchResponseTypePaymentTransactionsItem) { + // validation for constraint: itemType + if (!$transactionSearchResponseTypePaymentTransactionsItem instanceof \PayPal\StructType\PaymentTransactionSearchResultType) { + $invalidValues[] = is_object($transactionSearchResponseTypePaymentTransactionsItem) ? get_class($transactionSearchResponseTypePaymentTransactionsItem) : sprintf('%s(%s)', gettype($transactionSearchResponseTypePaymentTransactionsItem), var_export($transactionSearchResponseTypePaymentTransactionsItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The PaymentTransactions property can only contain items of type \PayPal\StructType\PaymentTransactionSearchResultType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set PaymentTransactions value * @throws \InvalidArgumentException @@ -48,11 +70,9 @@ public function getPaymentTransactions() */ public function setPaymentTransactions(array $paymentTransactions = array()) { - foreach ($paymentTransactions as $transactionSearchResponseTypePaymentTransactionsItem) { - // validation for constraint: itemType - if (!$transactionSearchResponseTypePaymentTransactionsItem instanceof \PayPal\StructType\PaymentTransactionSearchResultType) { - throw new \InvalidArgumentException(sprintf('The PaymentTransactions property can only contain items of \PayPal\StructType\PaymentTransactionSearchResultType, "%s" given', is_object($transactionSearchResponseTypePaymentTransactionsItem) ? get_class($transactionSearchResponseTypePaymentTransactionsItem) : gettype($transactionSearchResponseTypePaymentTransactionsItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($paymentTransactionsArrayErrorMessage = self::validatePaymentTransactionsForArrayConstraintsFromSetPaymentTransactions($paymentTransactions))) { + throw new \InvalidArgumentException($paymentTransactionsArrayErrorMessage, __LINE__); } $this->PaymentTransactions = $paymentTransactions; return $this; @@ -67,7 +87,7 @@ public function addToPaymentTransactions(\PayPal\StructType\PaymentTransactionSe { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\PaymentTransactionSearchResultType) { - throw new \InvalidArgumentException(sprintf('The PaymentTransactions property can only contain items of \PayPal\StructType\PaymentTransactionSearchResultType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The PaymentTransactions property can only contain items of type \PayPal\StructType\PaymentTransactionSearchResultType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->PaymentTransactions[] = $item; return $this; diff --git a/src/StructType/TransactionStatusType.php b/src/StructType/TransactionStatusType.php index 132c7ea..1ca53df 100644 --- a/src/StructType/TransactionStatusType.php +++ b/src/StructType/TransactionStatusType.php @@ -13,7 +13,7 @@ class TransactionStatusType extends AbstractStructBase { /** * The eBayPaymentStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates the success or failure of an eBay Online Payment for the transaction. If the payment failed, the value returned indicates the reason for the failure. Possible values: 0 = No payment failure. 3 = Buyer's eCheck bounced. 4 = * Buyer's credit card failed. 5 = Buyer failed payment as reported by seller. 7 = Payment from buyer to seller is in PayPal process, but has not yet been completed. * - minOccurs: 0 @@ -22,7 +22,7 @@ class TransactionStatusType extends AbstractStructBase public $eBayPaymentStatus; /** * The IncompleteState - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates the current state of the checkout process for the transaction. Possible values: 0 = Checkout complete. 1 = Checkout incomplete. No details specified. 2 = Buyer requests total. 3 = Seller responded to buyer's request. * - minOccurs: 0 * @var int @@ -30,7 +30,7 @@ class TransactionStatusType extends AbstractStructBase public $IncompleteState; /** * The LastTimeModified - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates last date and time checkout status or incomplete state was updated (in GMT). * - minOccurs: 0 * @var string @@ -38,7 +38,7 @@ class TransactionStatusType extends AbstractStructBase public $LastTimeModified; /** * The PaymentMethodUsed - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Payment method used by the buyer. (See BuyerPaymentCodeList/Type). * - minOccurs: 0 * @var string @@ -46,7 +46,7 @@ class TransactionStatusType extends AbstractStructBase public $PaymentMethodUsed; /** * The StatusIs - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Indicates whether the transaction process complete or incomplete. Possible values: 1 = Incomplete 2 = Complete * - minOccurs: 0 * @var int @@ -90,8 +90,8 @@ public function getEBayPaymentStatus() public function setEBayPaymentStatus($eBayPaymentStatus = null) { // validation for constraint: int - if (!is_null($eBayPaymentStatus) && !is_numeric($eBayPaymentStatus)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($eBayPaymentStatus)), __LINE__); + if (!is_null($eBayPaymentStatus) && !(is_int($eBayPaymentStatus) || ctype_digit($eBayPaymentStatus))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($eBayPaymentStatus, true), gettype($eBayPaymentStatus)), __LINE__); } $this->eBayPaymentStatus = $eBayPaymentStatus; return $this; @@ -112,8 +112,8 @@ public function getIncompleteState() public function setIncompleteState($incompleteState = null) { // validation for constraint: int - if (!is_null($incompleteState) && !is_numeric($incompleteState)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($incompleteState)), __LINE__); + if (!is_null($incompleteState) && !(is_int($incompleteState) || ctype_digit($incompleteState))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($incompleteState, true), gettype($incompleteState)), __LINE__); } $this->IncompleteState = $incompleteState; return $this; @@ -135,7 +135,7 @@ public function setLastTimeModified($lastTimeModified = null) { // validation for constraint: string if (!is_null($lastTimeModified) && !is_string($lastTimeModified)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastTimeModified)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($lastTimeModified, true), gettype($lastTimeModified)), __LINE__); } $this->LastTimeModified = $lastTimeModified; return $this; @@ -160,7 +160,7 @@ public function setPaymentMethodUsed($paymentMethodUsed = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\BuyerPaymentMethodCodeType::valueIsValid($paymentMethodUsed)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $paymentMethodUsed, implode(', ', \PayPal\EnumType\BuyerPaymentMethodCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\BuyerPaymentMethodCodeType', is_array($paymentMethodUsed) ? implode(', ', $paymentMethodUsed) : var_export($paymentMethodUsed, true), implode(', ', \PayPal\EnumType\BuyerPaymentMethodCodeType::getValidValues())), __LINE__); } $this->PaymentMethodUsed = $paymentMethodUsed; return $this; @@ -181,8 +181,8 @@ public function getStatusIs() public function setStatusIs($statusIs = null) { // validation for constraint: int - if (!is_null($statusIs) && !is_numeric($statusIs)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($statusIs)), __LINE__); + if (!is_null($statusIs) && !(is_int($statusIs) || ctype_digit($statusIs))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($statusIs, true), gettype($statusIs)), __LINE__); } $this->StatusIs = $statusIs; return $this; diff --git a/src/StructType/TransactionType.php b/src/StructType/TransactionType.php index c04e641..10f1d35 100644 --- a/src/StructType/TransactionType.php +++ b/src/StructType/TransactionType.php @@ -6,13 +6,13 @@ /** * This class stands for TransactionType StructType - * Meta informations extracted from the WSDL - * - documentation: Contains information about a single transaction. A transaction contains information about the sale of a particular item. The system creates a transaction when a buyer has made a purchase (Fixed Price items) or is the winning bidder - * (BIN and auction items). A listing can be associated with one or more transactions in these cases: Multi-Item Fixed Price Listings Dutch Auction Listings A listing is associated with a single transaction in these cases: Single-Item Fixed Price - * Listings Single-Item Auction Listings | The amount the buyer paid for the item or agreed to pay, depending on how far into the checkout process the item is. If the seller allowed the buyer to change the item total, the buyer is able to change the - * total until the time that the transaction's status moves to Complete. Determine whether the buyer changed the amount by calling GetSellerTransactions or GetSellerTransactions and comparing the AmountPaid value to what the seller expected. For Motors - * items, AmountPaid is the amount paid by the buyer for the deposit. | Includes shipping payment data. | Unique identifier for a transaction. Returns 0 when Type=1 (Chinese auction). Typically, an ItemID and a TransactionID uniquely identify a checkout - * transaction. | Unique identifier for an authorization. + * Meta information extracted from the WSDL + * - documentation: Unique identifier for an authorization. | Unique identifier for a transaction. Returns 0 when Type=1 (Chinese auction). Typically, an ItemID and a TransactionID uniquely identify a checkout transaction. | Includes shipping payment + * data. | The amount the buyer paid for the item or agreed to pay, depending on how far into the checkout process the item is. If the seller allowed the buyer to change the item total, the buyer is able to change the total until the time that the + * transaction's status moves to Complete. Determine whether the buyer changed the amount by calling GetSellerTransactions or GetSellerTransactions and comparing the AmountPaid value to what the seller expected. For Motors items, AmountPaid is the + * amount paid by the buyer for the deposit. | Contains information about a single transaction. A transaction contains information about the sale of a particular item. The system creates a transaction when a buyer has made a purchase (Fixed Price items) + * or is the winning bidder (BIN and auction items). A listing can be associated with one or more transactions in these cases: Multi-Item Fixed Price Listings Dutch Auction Listings A listing is associated with a single transaction in these cases: + * Single-Item Fixed Price Listings Single-Item Auction Listings * @subpackage Structs * @author WsdlToPhp */ @@ -20,7 +20,7 @@ class TransactionType extends AbstractStructBase { /** * The AmountPaid - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:AmountPaid * @var \PayPal\StructType\AmountType @@ -28,7 +28,7 @@ class TransactionType extends AbstractStructBase public $AmountPaid; /** * The Buyer - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Container for buyer data. * - minOccurs: 0 * @var \PayPal\StructType\UserType @@ -36,7 +36,7 @@ class TransactionType extends AbstractStructBase public $Buyer; /** * The ShippingDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:ShippingDetails * @var \PayPal\StructType\ShippingDetailsType @@ -44,7 +44,7 @@ class TransactionType extends AbstractStructBase public $ShippingDetails; /** * The ConvertedAmountPaid - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Value returned in the Transaction/AmountPaid element, converted to the currency indicated by SiteCurrency. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -52,7 +52,7 @@ class TransactionType extends AbstractStructBase public $ConvertedAmountPaid; /** * The ConvertedTransactionPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Value returned in the Transaction/TransactionPrice element, converted to the currency indicated by SiteCurrency. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -60,7 +60,7 @@ class TransactionType extends AbstractStructBase public $ConvertedTransactionPrice; /** * The CreatedDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: For fixed-price, Stores, and BIN items indicates when the purchase (or BIN) occurred. For all other item types indicates when the transaction was created (the time when checkout was initiated). * - minOccurs: 0 * @var string @@ -68,7 +68,7 @@ class TransactionType extends AbstractStructBase public $CreatedDate; /** * The DepositType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Deposit type for Motors items. If item is not a Motors item, then returns a DepositType of None. Possible values: None Other Method Fast Deposit * - minOccurs: 0 * @var string @@ -76,7 +76,7 @@ class TransactionType extends AbstractStructBase public $DepositType; /** * The Item - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Item info associated with the transaction. * - minOccurs: 0 * @var \PayPal\StructType\ItemType @@ -84,7 +84,7 @@ class TransactionType extends AbstractStructBase public $Item; /** * The QuantityPurchased - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains the number of individual items the buyer purchased in the transaction. * - minOccurs: 0 * @var int @@ -92,7 +92,7 @@ class TransactionType extends AbstractStructBase public $QuantityPurchased; /** * The ShippingHandlingTotal - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Shipping cost totals shown to user (for both flat and calculated rates). * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -100,7 +100,7 @@ class TransactionType extends AbstractStructBase public $ShippingHandlingTotal; /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Container node for transaction status data. * - minOccurs: 0 * @var \PayPal\StructType\TransactionStatusType @@ -108,7 +108,7 @@ class TransactionType extends AbstractStructBase public $Status; /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:TransactionID * @var string @@ -116,7 +116,7 @@ class TransactionType extends AbstractStructBase public $TransactionID; /** * The AuthorizationID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:AuthorizationID * @var string @@ -124,7 +124,7 @@ class TransactionType extends AbstractStructBase public $AuthorizationID; /** * The TransactionPrice - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Price of the item, before shipping and sales tax. For Motors, TransactionPrice is the deposit amount. * - minOccurs: 0 * @var \PayPal\StructType\AmountType @@ -132,7 +132,7 @@ class TransactionType extends AbstractStructBase public $TransactionPrice; /** * The VATPercent - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: VAT rate for the item, if the item price includes the VAT rate. Specify the VATPercent if you want include the net price in addition to the gross price in the listing. VAT rates vary depending on the item and on the user's country of * residence; therefore a business seller is responsible for entering the correct VAT rate (it will not be calculated by eBay). * - minOccurs: 0 @@ -298,7 +298,7 @@ public function setCreatedDate($createdDate = null) { // validation for constraint: string if (!is_null($createdDate) && !is_string($createdDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($createdDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($createdDate, true), gettype($createdDate)), __LINE__); } $this->CreatedDate = $createdDate; return $this; @@ -323,7 +323,7 @@ public function setDepositType($depositType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\DepositTypeCodeType::valueIsValid($depositType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $depositType, implode(', ', \PayPal\EnumType\DepositTypeCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\DepositTypeCodeType', is_array($depositType) ? implode(', ', $depositType) : var_export($depositType, true), implode(', ', \PayPal\EnumType\DepositTypeCodeType::getValidValues())), __LINE__); } $this->DepositType = $depositType; return $this; @@ -362,8 +362,8 @@ public function getQuantityPurchased() public function setQuantityPurchased($quantityPurchased = null) { // validation for constraint: int - if (!is_null($quantityPurchased) && !is_numeric($quantityPurchased)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($quantityPurchased)), __LINE__); + if (!is_null($quantityPurchased) && !(is_int($quantityPurchased) || ctype_digit($quantityPurchased))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($quantityPurchased, true), gettype($quantityPurchased)), __LINE__); } $this->QuantityPurchased = $quantityPurchased; return $this; @@ -421,7 +421,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -443,7 +443,7 @@ public function setAuthorizationID($authorizationID = null) { // validation for constraint: string if (!is_null($authorizationID) && !is_string($authorizationID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authorizationID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authorizationID, true), gettype($authorizationID)), __LINE__); } $this->AuthorizationID = $authorizationID; return $this; @@ -481,6 +481,10 @@ public function getVATPercent() */ public function setVATPercent($vATPercent = null) { + // validation for constraint: float + if (!is_null($vATPercent) && !(is_float($vATPercent) || is_numeric($vATPercent))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($vATPercent, true), gettype($vATPercent)), __LINE__); + } $this->VATPercent = $vATPercent; return $this; } diff --git a/src/StructType/TransactionsType.php b/src/StructType/TransactionsType.php index 318129f..1745231 100644 --- a/src/StructType/TransactionsType.php +++ b/src/StructType/TransactionsType.php @@ -6,7 +6,7 @@ /** * This class stands for TransactionsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains information about multiple individual transations. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class TransactionsType extends AbstractStructBase { /** * The Transaction - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: unbounded * - ref: ns:Transaction * @var \PayPal\StructType\TransactionType[] @@ -39,6 +39,28 @@ public function getTransaction() { return $this->Transaction; } + /** + * This method is responsible for validating the values passed to the setTransaction method + * This method is willingly generated in order to preserve the one-line inline validation within the setTransaction method + * @param array $values + * @return string A non-empty message if the values does not match the validation rules + */ + public static function validateTransactionForArrayConstraintsFromSetTransaction(array $values = array()) + { + $message = ''; + $invalidValues = []; + foreach ($values as $transactionsTypeTransactionItem) { + // validation for constraint: itemType + if (!$transactionsTypeTransactionItem instanceof \PayPal\StructType\TransactionType) { + $invalidValues[] = is_object($transactionsTypeTransactionItem) ? get_class($transactionsTypeTransactionItem) : sprintf('%s(%s)', gettype($transactionsTypeTransactionItem), var_export($transactionsTypeTransactionItem, true)); + } + } + if (!empty($invalidValues)) { + $message = sprintf('The Transaction property can only contain items of type \PayPal\StructType\TransactionType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); + } + unset($invalidValues); + return $message; + } /** * Set Transaction value * @throws \InvalidArgumentException @@ -47,11 +69,9 @@ public function getTransaction() */ public function setTransaction(array $transaction = array()) { - foreach ($transaction as $transactionsTypeTransactionItem) { - // validation for constraint: itemType - if (!$transactionsTypeTransactionItem instanceof \PayPal\StructType\TransactionType) { - throw new \InvalidArgumentException(sprintf('The Transaction property can only contain items of \PayPal\StructType\TransactionType, "%s" given', is_object($transactionsTypeTransactionItem) ? get_class($transactionsTypeTransactionItem) : gettype($transactionsTypeTransactionItem)), __LINE__); - } + // validation for constraint: array + if ('' !== ($transactionArrayErrorMessage = self::validateTransactionForArrayConstraintsFromSetTransaction($transaction))) { + throw new \InvalidArgumentException($transactionArrayErrorMessage, __LINE__); } $this->Transaction = $transaction; return $this; @@ -66,7 +86,7 @@ public function addToTransaction(\PayPal\StructType\TransactionType $item) { // validation for constraint: itemType if (!$item instanceof \PayPal\StructType\TransactionType) { - throw new \InvalidArgumentException(sprintf('The Transaction property can only contain items of \PayPal\StructType\TransactionType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + throw new \InvalidArgumentException(sprintf('The Transaction property can only contain items of type \PayPal\StructType\TransactionType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); } $this->Transaction[] = $item; return $this; diff --git a/src/StructType/TupleType.php b/src/StructType/TupleType.php index c8208de..74132b9 100644 --- a/src/StructType/TupleType.php +++ b/src/StructType/TupleType.php @@ -6,7 +6,7 @@ /** * This class stands for TupleType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This holds single key-value pair. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class TupleType extends AbstractStructBase { /** * The Key - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Key Name.Optional * - maxOccurs: 1 * - minOccurs: 1 @@ -24,7 +24,7 @@ class TupleType extends AbstractStructBase public $Key; /** * The Value - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Value for the above key.Optional * - maxOccurs: 1 * - minOccurs: 1 @@ -61,7 +61,7 @@ public function setKey($key = null) { // validation for constraint: string if (!is_null($key) && !is_string($key)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($key)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($key, true), gettype($key)), __LINE__); } $this->Key = $key; return $this; @@ -83,7 +83,7 @@ public function setValue($value = null) { // validation for constraint: string if (!is_null($value) && !is_string($value)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($value)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($value, true), gettype($value)), __LINE__); } $this->Value = $value; return $this; diff --git a/src/StructType/UATPDetailsType.php b/src/StructType/UATPDetailsType.php index 65bd87d..d0117e5 100644 --- a/src/StructType/UATPDetailsType.php +++ b/src/StructType/UATPDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for UATPDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: UATP Card Details Type * @subpackage Structs * @author WsdlToPhp @@ -15,21 +15,21 @@ class UATPDetailsType extends AbstractStructBase { /** * The UATPNumber - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: UATP Card Number * @var string */ public $UATPNumber; /** * The ExpMonth - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: UATP Card expirty month * @var int */ public $ExpMonth; /** * The ExpYear - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: UATP Card expirty year * @var int */ @@ -67,7 +67,7 @@ public function setUATPNumber($uATPNumber = null) { // validation for constraint: string if (!is_null($uATPNumber) && !is_string($uATPNumber)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($uATPNumber)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($uATPNumber, true), gettype($uATPNumber)), __LINE__); } $this->UATPNumber = $uATPNumber; return $this; @@ -88,8 +88,8 @@ public function getExpMonth() public function setExpMonth($expMonth = null) { // validation for constraint: int - if (!is_null($expMonth) && !is_numeric($expMonth)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($expMonth)), __LINE__); + if (!is_null($expMonth) && !(is_int($expMonth) || ctype_digit($expMonth))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($expMonth, true), gettype($expMonth)), __LINE__); } $this->ExpMonth = $expMonth; return $this; @@ -110,8 +110,8 @@ public function getExpYear() public function setExpYear($expYear = null) { // validation for constraint: int - if (!is_null($expYear) && !is_numeric($expYear)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($expYear)), __LINE__); + if (!is_null($expYear) && !(is_int($expYear) || ctype_digit($expYear))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($expYear, true), gettype($expYear)), __LINE__); } $this->ExpYear = $expYear; return $this; diff --git a/src/StructType/UpdateAccessPermissionsReq.php b/src/StructType/UpdateAccessPermissionsReq.php index 47fd2e5..7813313 100644 --- a/src/StructType/UpdateAccessPermissionsReq.php +++ b/src/StructType/UpdateAccessPermissionsReq.php @@ -13,7 +13,7 @@ class UpdateAccessPermissionsReq extends AbstractStructBase { /** * The UpdateAccessPermissionsRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:UpdateAccessPermissionsRequest * @var \PayPal\StructType\UpdateAccessPermissionsRequestType */ diff --git a/src/StructType/UpdateAccessPermissionsRequestType.php b/src/StructType/UpdateAccessPermissionsRequestType.php index a3aa743..d697f74 100644 --- a/src/StructType/UpdateAccessPermissionsRequestType.php +++ b/src/StructType/UpdateAccessPermissionsRequestType.php @@ -13,11 +13,12 @@ class UpdateAccessPermissionsRequestType extends AbstractRequestType { /** * The PayerID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Unique PayPal customer account number, the value of which was returned by GetAuthDetails Response. Required Character length and limitations: 20 single-byte characters + * - base: xs:string + * - maxLength: 127 * - maxOccurs: 1 * - minOccurs: 1 - * - maxLength: 127 * @var string */ public $PayerID; @@ -46,13 +47,13 @@ public function getPayerID() */ public function setPayerID($payerID = null) { - // validation for constraint: maxLength - if ((is_scalar($payerID) && strlen($payerID) > 127) || (is_array($payerID) && count($payerID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($payerID) ? strlen($payerID) : count($payerID)), __LINE__); - } // validation for constraint: string if (!is_null($payerID) && !is_string($payerID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($payerID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($payerID, true), gettype($payerID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($payerID) && mb_strlen($payerID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($payerID)), __LINE__); } $this->PayerID = $payerID; return $this; diff --git a/src/StructType/UpdateAccessPermissionsResponseType.php b/src/StructType/UpdateAccessPermissionsResponseType.php index 18a38d2..d739d42 100644 --- a/src/StructType/UpdateAccessPermissionsResponseType.php +++ b/src/StructType/UpdateAccessPermissionsResponseType.php @@ -13,7 +13,7 @@ class UpdateAccessPermissionsResponseType extends AbstractResponseType { /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The status of the update call, Success/Failure. Character length and limitations: 20 single-byte characters * - maxOccurs: 1 * - minOccurs: 1 @@ -47,7 +47,7 @@ public function setStatus($status = null) { // validation for constraint: string if (!is_null($status) && !is_string($status)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($status)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($status, true), gettype($status)), __LINE__); } $this->Status = $status; return $this; diff --git a/src/StructType/UpdateAuthorizationReq.php b/src/StructType/UpdateAuthorizationReq.php index aa85acf..2ab524f 100644 --- a/src/StructType/UpdateAuthorizationReq.php +++ b/src/StructType/UpdateAuthorizationReq.php @@ -13,7 +13,7 @@ class UpdateAuthorizationReq extends AbstractStructBase { /** * The UpdateAuthorizationRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:UpdateAuthorizationRequest * @var \PayPal\StructType\UpdateAuthorizationRequestType */ diff --git a/src/StructType/UpdateAuthorizationRequestType.php b/src/StructType/UpdateAuthorizationRequestType.php index 84c40ce..49add14 100644 --- a/src/StructType/UpdateAuthorizationRequestType.php +++ b/src/StructType/UpdateAuthorizationRequestType.php @@ -6,7 +6,7 @@ /** * This class stands for UpdateAuthorizationRequestType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Shipping Address for this transaction. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class UpdateAuthorizationRequestType extends AbstractRequestType { /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The value of the authorizationâtransaction identification number returned by a PayPal product. Required Character length and limits: 19 single-byte characters maximum * - maxOccurs: 1 * - minOccurs: 1 @@ -24,7 +24,7 @@ class UpdateAuthorizationRequestType extends AbstractRequestType public $TransactionID; /** * The ShipToAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:ShipToAddress @@ -33,7 +33,7 @@ class UpdateAuthorizationRequestType extends AbstractRequestType public $ShipToAddress; /** * The IPAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: IP Address of the buyer * - maxOccurs: 1 * - minOccurs: 0 @@ -42,7 +42,7 @@ class UpdateAuthorizationRequestType extends AbstractRequestType public $IPAddress; /** * The ShipToStore - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: A flag indicating that this transaction is a Ship to Store transaction. Optional * - maxOccurs: 1 * - minOccurs: 0 @@ -85,7 +85,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; @@ -125,7 +125,7 @@ public function setIPAddress($iPAddress = null) { // validation for constraint: string if (!is_null($iPAddress) && !is_string($iPAddress)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($iPAddress)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($iPAddress, true), gettype($iPAddress)), __LINE__); } $this->IPAddress = $iPAddress; return $this; @@ -147,7 +147,7 @@ public function setShipToStore($shipToStore = null) { // validation for constraint: string if (!is_null($shipToStore) && !is_string($shipToStore)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shipToStore)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shipToStore, true), gettype($shipToStore)), __LINE__); } $this->ShipToStore = $shipToStore; return $this; diff --git a/src/StructType/UpdateAuthorizationResponseType.php b/src/StructType/UpdateAuthorizationResponseType.php index 1a3b6f9..2d6eb07 100644 --- a/src/StructType/UpdateAuthorizationResponseType.php +++ b/src/StructType/UpdateAuthorizationResponseType.php @@ -13,7 +13,7 @@ class UpdateAuthorizationResponseType extends AbstractResponseType { /** * The TransactionID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: An authorization identification number. Character length and limits: 19 single-byte characters * - maxOccurs: 1 * - minOccurs: 0 @@ -22,7 +22,7 @@ class UpdateAuthorizationResponseType extends AbstractResponseType public $TransactionID; /** * The AuthorizationInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * - ref: ebl:AuthorizationInfo @@ -59,7 +59,7 @@ public function setTransactionID($transactionID = null) { // validation for constraint: string if (!is_null($transactionID) && !is_string($transactionID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($transactionID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($transactionID, true), gettype($transactionID)), __LINE__); } $this->TransactionID = $transactionID; return $this; diff --git a/src/StructType/UpdateRecurringPaymentsProfileReq.php b/src/StructType/UpdateRecurringPaymentsProfileReq.php index 7e0efa9..23ce92d 100644 --- a/src/StructType/UpdateRecurringPaymentsProfileReq.php +++ b/src/StructType/UpdateRecurringPaymentsProfileReq.php @@ -13,7 +13,7 @@ class UpdateRecurringPaymentsProfileReq extends AbstractStructBase { /** * The UpdateRecurringPaymentsProfileRequest - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:UpdateRecurringPaymentsProfileRequest * @var \PayPal\StructType\UpdateRecurringPaymentsProfileRequestType */ diff --git a/src/StructType/UpdateRecurringPaymentsProfileRequestDetailsType.php b/src/StructType/UpdateRecurringPaymentsProfileRequestDetailsType.php index 2583a15..ad0cdf1 100644 --- a/src/StructType/UpdateRecurringPaymentsProfileRequestDetailsType.php +++ b/src/StructType/UpdateRecurringPaymentsProfileRequestDetailsType.php @@ -14,7 +14,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas { /** * The ProfileID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -22,7 +22,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $ProfileID; /** * The Note - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -30,7 +30,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $Note; /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -38,7 +38,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $Description; /** * The SubscriberName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -46,7 +46,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $SubscriberName; /** * The SubscriberShippingAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\AddressType @@ -54,7 +54,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $SubscriberShippingAddress; /** * The ProfileReference - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -62,7 +62,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $ProfileReference; /** * The AdditionalBillingCycles - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var int @@ -70,7 +70,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $AdditionalBillingCycles; /** * The Amount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -78,7 +78,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $Amount; /** * The ShippingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -86,7 +86,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $ShippingAmount; /** * The TaxAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -94,7 +94,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $TaxAmount; /** * The OutstandingBalance - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -102,7 +102,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $OutstandingBalance; /** * The AutoBillOutstandingAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -110,7 +110,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $AutoBillOutstandingAmount; /** * The MaxFailedPayments - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var int @@ -118,7 +118,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $MaxFailedPayments; /** * The CreditCard - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information about the credit card to be charged (required if Direct Payment) * - maxOccurs: 1 * - minOccurs: 0 @@ -127,7 +127,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $CreditCard; /** * The BillingStartDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: When does this Profile begin billing? * - maxOccurs: 1 * - minOccurs: 0 @@ -136,7 +136,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $BillingStartDate; /** * The TrialPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Trial period of this schedule * - maxOccurs: 1 * - minOccurs: 0 @@ -145,7 +145,7 @@ class UpdateRecurringPaymentsProfileRequestDetailsType extends AbstractStructBas public $TrialPeriod; /** * The PaymentPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BillingPeriodDetailsType_Update @@ -226,7 +226,7 @@ public function setProfileID($profileID = null) { // validation for constraint: string if (!is_null($profileID) && !is_string($profileID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileID, true), gettype($profileID)), __LINE__); } $this->ProfileID = $profileID; return $this; @@ -248,7 +248,7 @@ public function setNote($note = null) { // validation for constraint: string if (!is_null($note) && !is_string($note)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($note)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($note, true), gettype($note)), __LINE__); } $this->Note = $note; return $this; @@ -270,7 +270,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this; @@ -292,7 +292,7 @@ public function setSubscriberName($subscriberName = null) { // validation for constraint: string if (!is_null($subscriberName) && !is_string($subscriberName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($subscriberName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subscriberName, true), gettype($subscriberName)), __LINE__); } $this->SubscriberName = $subscriberName; return $this; @@ -332,7 +332,7 @@ public function setProfileReference($profileReference = null) { // validation for constraint: string if (!is_null($profileReference) && !is_string($profileReference)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileReference)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileReference, true), gettype($profileReference)), __LINE__); } $this->ProfileReference = $profileReference; return $this; @@ -353,8 +353,8 @@ public function getAdditionalBillingCycles() public function setAdditionalBillingCycles($additionalBillingCycles = null) { // validation for constraint: int - if (!is_null($additionalBillingCycles) && !is_numeric($additionalBillingCycles)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($additionalBillingCycles)), __LINE__); + if (!is_null($additionalBillingCycles) && !(is_int($additionalBillingCycles) || ctype_digit($additionalBillingCycles))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($additionalBillingCycles, true), gettype($additionalBillingCycles)), __LINE__); } $this->AdditionalBillingCycles = $additionalBillingCycles; return $this; @@ -451,7 +451,7 @@ public function setAutoBillOutstandingAmount($autoBillOutstandingAmount = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\AutoBillType::valueIsValid($autoBillOutstandingAmount)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $autoBillOutstandingAmount, implode(', ', \PayPal\EnumType\AutoBillType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\AutoBillType', is_array($autoBillOutstandingAmount) ? implode(', ', $autoBillOutstandingAmount) : var_export($autoBillOutstandingAmount, true), implode(', ', \PayPal\EnumType\AutoBillType::getValidValues())), __LINE__); } $this->AutoBillOutstandingAmount = $autoBillOutstandingAmount; return $this; @@ -472,8 +472,8 @@ public function getMaxFailedPayments() public function setMaxFailedPayments($maxFailedPayments = null) { // validation for constraint: int - if (!is_null($maxFailedPayments) && !is_numeric($maxFailedPayments)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($maxFailedPayments)), __LINE__); + if (!is_null($maxFailedPayments) && !(is_int($maxFailedPayments) || ctype_digit($maxFailedPayments))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($maxFailedPayments, true), gettype($maxFailedPayments)), __LINE__); } $this->MaxFailedPayments = $maxFailedPayments; return $this; @@ -513,7 +513,7 @@ public function setBillingStartDate($billingStartDate = null) { // validation for constraint: string if (!is_null($billingStartDate) && !is_string($billingStartDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($billingStartDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($billingStartDate, true), gettype($billingStartDate)), __LINE__); } $this->BillingStartDate = $billingStartDate; return $this; diff --git a/src/StructType/UpdateRecurringPaymentsProfileRequestType.php b/src/StructType/UpdateRecurringPaymentsProfileRequestType.php index 4770c93..8cac105 100644 --- a/src/StructType/UpdateRecurringPaymentsProfileRequestType.php +++ b/src/StructType/UpdateRecurringPaymentsProfileRequestType.php @@ -13,7 +13,7 @@ class UpdateRecurringPaymentsProfileRequestType extends AbstractRequestType { /** * The UpdateRecurringPaymentsProfileRequestDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:UpdateRecurringPaymentsProfileRequestDetails * @var \PayPal\StructType\UpdateRecurringPaymentsProfileRequestDetailsType */ diff --git a/src/StructType/UpdateRecurringPaymentsProfileResponseDetailsType.php b/src/StructType/UpdateRecurringPaymentsProfileResponseDetailsType.php index 79d8e52..9d5b640 100644 --- a/src/StructType/UpdateRecurringPaymentsProfileResponseDetailsType.php +++ b/src/StructType/UpdateRecurringPaymentsProfileResponseDetailsType.php @@ -14,7 +14,7 @@ class UpdateRecurringPaymentsProfileResponseDetailsType extends AbstractStructBa { /** * The ProfileID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 1 * @var string @@ -47,7 +47,7 @@ public function setProfileID($profileID = null) { // validation for constraint: string if (!is_null($profileID) && !is_string($profileID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($profileID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($profileID, true), gettype($profileID)), __LINE__); } $this->ProfileID = $profileID; return $this; diff --git a/src/StructType/UpdateRecurringPaymentsProfileResponseType.php b/src/StructType/UpdateRecurringPaymentsProfileResponseType.php index 3203acf..1d1a2f1 100644 --- a/src/StructType/UpdateRecurringPaymentsProfileResponseType.php +++ b/src/StructType/UpdateRecurringPaymentsProfileResponseType.php @@ -13,7 +13,7 @@ class UpdateRecurringPaymentsProfileResponseType extends AbstractResponseType { /** * The UpdateRecurringPaymentsProfileResponseDetails - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ebl:UpdateRecurringPaymentsProfileResponseDetails * @var \PayPal\StructType\UpdateRecurringPaymentsProfileResponseDetailsType */ diff --git a/src/StructType/UserIdPasswordType.php b/src/StructType/UserIdPasswordType.php index 5745a65..b225e87 100644 --- a/src/StructType/UserIdPasswordType.php +++ b/src/StructType/UserIdPasswordType.php @@ -13,42 +13,42 @@ class UserIdPasswordType extends AbstractStructBase { /** * The AppId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $AppId; /** * The DevId - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $DevId; /** * The AuthCert - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $AuthCert; /** * The Username - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: The username is the identifier for an account. * @var string */ public $Username; /** * The Password - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Password contains the current password associated with the username. * @var string */ public $Password; /** * The Signature - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Signature for Three Token authentication. * - minOccurs: 0 * @var string @@ -56,7 +56,7 @@ class UserIdPasswordType extends AbstractStructBase public $Signature; /** * The Subject - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This field identifies an account (e.g., payment) on whose behalf the operation is being performed. For instance one account holder may delegate the abililty to perform certain operations to another account holder. This delegation is * done through a separate mechanism. If the base username has not been authorized by the subject the request will be rejected. * - minOccurs: 0 @@ -65,7 +65,7 @@ class UserIdPasswordType extends AbstractStructBase public $Subject; /** * The AuthToken - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Authentication Session Token for authentication and authorization. * - minOccurs: 0 * @var string @@ -119,7 +119,7 @@ public function setAppId($appId = null) { // validation for constraint: string if (!is_null($appId) && !is_string($appId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($appId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($appId, true), gettype($appId)), __LINE__); } $this->AppId = $appId; return $this; @@ -141,7 +141,7 @@ public function setDevId($devId = null) { // validation for constraint: string if (!is_null($devId) && !is_string($devId)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($devId)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($devId, true), gettype($devId)), __LINE__); } $this->DevId = $devId; return $this; @@ -163,7 +163,7 @@ public function setAuthCert($authCert = null) { // validation for constraint: string if (!is_null($authCert) && !is_string($authCert)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authCert)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authCert, true), gettype($authCert)), __LINE__); } $this->AuthCert = $authCert; return $this; @@ -185,7 +185,7 @@ public function setUsername($username = null) { // validation for constraint: string if (!is_null($username) && !is_string($username)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($username)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($username, true), gettype($username)), __LINE__); } $this->Username = $username; return $this; @@ -207,7 +207,7 @@ public function setPassword($password = null) { // validation for constraint: string if (!is_null($password) && !is_string($password)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($password)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($password, true), gettype($password)), __LINE__); } $this->Password = $password; return $this; @@ -229,7 +229,7 @@ public function setSignature($signature = null) { // validation for constraint: string if (!is_null($signature) && !is_string($signature)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($signature)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($signature, true), gettype($signature)), __LINE__); } $this->Signature = $signature; return $this; @@ -251,7 +251,7 @@ public function setSubject($subject = null) { // validation for constraint: string if (!is_null($subject) && !is_string($subject)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($subject)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subject, true), gettype($subject)), __LINE__); } $this->Subject = $subject; return $this; @@ -273,7 +273,7 @@ public function setAuthToken($authToken = null) { // validation for constraint: string if (!is_null($authToken) && !is_string($authToken)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($authToken)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($authToken, true), gettype($authToken)), __LINE__); } $this->AuthToken = $authToken; return $this; diff --git a/src/StructType/UserSelectedOptionType.php b/src/StructType/UserSelectedOptionType.php index 4dacca1..f6602fb 100644 --- a/src/StructType/UserSelectedOptionType.php +++ b/src/StructType/UserSelectedOptionType.php @@ -6,7 +6,7 @@ /** * This class stands for UserSelectedOptionType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Information on user selected options * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class UserSelectedOptionType extends AbstractStructBase { /** * The ShippingCalculationMode - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -23,7 +23,7 @@ class UserSelectedOptionType extends AbstractStructBase public $ShippingCalculationMode; /** * The InsuranceOptionSelected - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -31,7 +31,7 @@ class UserSelectedOptionType extends AbstractStructBase public $InsuranceOptionSelected; /** * The ShippingOptionIsDefault - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -39,7 +39,7 @@ class UserSelectedOptionType extends AbstractStructBase public $ShippingOptionIsDefault; /** * The ShippingOptionAmount - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var \PayPal\StructType\BasicAmountType @@ -47,7 +47,7 @@ class UserSelectedOptionType extends AbstractStructBase public $ShippingOptionAmount; /** * The ShippingOptionName - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -55,7 +55,7 @@ class UserSelectedOptionType extends AbstractStructBase public $ShippingOptionName; /** * The ScheduledShippingDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -63,7 +63,7 @@ class UserSelectedOptionType extends AbstractStructBase public $ScheduledShippingDate; /** * The ScheduledShippingPeriod - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - maxOccurs: 1 * - minOccurs: 0 * @var string @@ -114,7 +114,7 @@ public function setShippingCalculationMode($shippingCalculationMode = null) { // validation for constraint: string if (!is_null($shippingCalculationMode) && !is_string($shippingCalculationMode)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingCalculationMode)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingCalculationMode, true), gettype($shippingCalculationMode)), __LINE__); } $this->ShippingCalculationMode = $shippingCalculationMode; return $this; @@ -136,7 +136,7 @@ public function setInsuranceOptionSelected($insuranceOptionSelected = null) { // validation for constraint: string if (!is_null($insuranceOptionSelected) && !is_string($insuranceOptionSelected)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($insuranceOptionSelected)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($insuranceOptionSelected, true), gettype($insuranceOptionSelected)), __LINE__); } $this->InsuranceOptionSelected = $insuranceOptionSelected; return $this; @@ -158,7 +158,7 @@ public function setShippingOptionIsDefault($shippingOptionIsDefault = null) { // validation for constraint: string if (!is_null($shippingOptionIsDefault) && !is_string($shippingOptionIsDefault)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingOptionIsDefault)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingOptionIsDefault, true), gettype($shippingOptionIsDefault)), __LINE__); } $this->ShippingOptionIsDefault = $shippingOptionIsDefault; return $this; @@ -198,7 +198,7 @@ public function setShippingOptionName($shippingOptionName = null) { // validation for constraint: string if (!is_null($shippingOptionName) && !is_string($shippingOptionName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shippingOptionName)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($shippingOptionName, true), gettype($shippingOptionName)), __LINE__); } $this->ShippingOptionName = $shippingOptionName; return $this; @@ -220,7 +220,7 @@ public function setScheduledShippingDate($scheduledShippingDate = null) { // validation for constraint: string if (!is_null($scheduledShippingDate) && !is_string($scheduledShippingDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($scheduledShippingDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($scheduledShippingDate, true), gettype($scheduledShippingDate)), __LINE__); } $this->ScheduledShippingDate = $scheduledShippingDate; return $this; @@ -242,7 +242,7 @@ public function setScheduledShippingPeriod($scheduledShippingPeriod = null) { // validation for constraint: string if (!is_null($scheduledShippingPeriod) && !is_string($scheduledShippingPeriod)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($scheduledShippingPeriod)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($scheduledShippingPeriod, true), gettype($scheduledShippingPeriod)), __LINE__); } $this->ScheduledShippingPeriod = $scheduledShippingPeriod; return $this; diff --git a/src/StructType/UserType.php b/src/StructType/UserType.php index 193b68a..8997c5e 100644 --- a/src/StructType/UserType.php +++ b/src/StructType/UserType.php @@ -6,7 +6,7 @@ /** * This class stands for UserType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Feedback scores are a quantitative expression of the desirability of dealing with that person as a Buyer or a Seller in auction transactions. Each auction transaction can result in one feedback entry for a given user (the Buyer can * leave one feedback about the Seller and the Seller can leave one feedback about the Buyer). That one feedback can be positive, negative, or neutral. The aggregated feedback counts for a particular user represent that user's overall feedback score * (referred to as a "feedback rating" on the eBay site). This rating is commonly expressed as the eBay Feedback score for the user. @@ -17,28 +17,28 @@ class UserType extends AbstractStructBase { /** * The AboutMePage - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $AboutMePage; /** * The EAISToken - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $EAISToken; /** * The Email - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - ref: ns:Email * @var string */ public $Email; /** * The FeedbackScore - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:FeedbackScore * @var int @@ -46,35 +46,35 @@ class UserType extends AbstractStructBase public $FeedbackScore; /** * The FeedbackPrivate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $FeedbackPrivate; /** * The FeedbackRatingStar - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $FeedbackRatingStar; /** * The IDVerified - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $IDVerified; /** * The NewUser - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $NewUser; /** * The RegistrationAddress - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:RegistrationAddress * @var \PayPal\StructType\AddressType @@ -82,14 +82,14 @@ class UserType extends AbstractStructBase public $RegistrationAddress; /** * The RegistrationDate - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $RegistrationDate; /** * The Site - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * - ref: ns:Site * @var string @@ -97,37 +97,38 @@ class UserType extends AbstractStructBase public $Site; /** * The Status - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $Status; /** * The UserID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL + * - base: xs:string + * - maxLength: 127 * - minOccurs: 0 * - ref: ns:UserID - * - maxLength: 127 * @var string */ public $UserID; /** * The UserIDChanged - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $UserIDChanged; /** * The UserIDLastChanged - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var string */ public $UserIDLastChanged; /** * The VATStatus - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: If present, indicates whether or not the user is subject to VAT. Users who have registered with eBay as VAT-exempt are not subject to VAT. See Value-Added Tax (VAT). Not returned for users whose country of residence is outside the * EU. Possible values for the user's status: 2 = Residence in an EU country but user registered as VAT-exempt 3 = Residence in an EU country and user not registered as VAT-exempt * - minOccurs: 0 @@ -136,14 +137,14 @@ class UserType extends AbstractStructBase public $VATStatus; /** * The BuyerInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\BuyerType */ public $BuyerInfo; /** * The SellerInfo - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var \PayPal\StructType\SellerType */ @@ -226,7 +227,7 @@ public function setAboutMePage($aboutMePage = null) { // validation for constraint: boolean if (!is_null($aboutMePage) && !is_bool($aboutMePage)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($aboutMePage)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($aboutMePage, true), gettype($aboutMePage)), __LINE__); } $this->AboutMePage = $aboutMePage; return $this; @@ -248,7 +249,7 @@ public function setEAISToken($eAISToken = null) { // validation for constraint: string if (!is_null($eAISToken) && !is_string($eAISToken)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($eAISToken)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($eAISToken, true), gettype($eAISToken)), __LINE__); } $this->EAISToken = $eAISToken; return $this; @@ -270,7 +271,7 @@ public function setEmail($email = null) { // validation for constraint: string if (!is_null($email) && !is_string($email)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($email)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($email, true), gettype($email)), __LINE__); } $this->Email = $email; return $this; @@ -291,8 +292,8 @@ public function getFeedbackScore() public function setFeedbackScore($feedbackScore = null) { // validation for constraint: int - if (!is_null($feedbackScore) && !is_numeric($feedbackScore)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($feedbackScore)), __LINE__); + if (!is_null($feedbackScore) && !(is_int($feedbackScore) || ctype_digit($feedbackScore))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($feedbackScore, true), gettype($feedbackScore)), __LINE__); } $this->FeedbackScore = $feedbackScore; return $this; @@ -314,7 +315,7 @@ public function setFeedbackPrivate($feedbackPrivate = null) { // validation for constraint: boolean if (!is_null($feedbackPrivate) && !is_bool($feedbackPrivate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($feedbackPrivate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($feedbackPrivate, true), gettype($feedbackPrivate)), __LINE__); } $this->FeedbackPrivate = $feedbackPrivate; return $this; @@ -339,7 +340,7 @@ public function setFeedbackRatingStar($feedbackRatingStar = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\FeedbackRatingStarCodeType::valueIsValid($feedbackRatingStar)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $feedbackRatingStar, implode(', ', \PayPal\EnumType\FeedbackRatingStarCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\FeedbackRatingStarCodeType', is_array($feedbackRatingStar) ? implode(', ', $feedbackRatingStar) : var_export($feedbackRatingStar, true), implode(', ', \PayPal\EnumType\FeedbackRatingStarCodeType::getValidValues())), __LINE__); } $this->FeedbackRatingStar = $feedbackRatingStar; return $this; @@ -361,7 +362,7 @@ public function setIDVerified($iDVerified = null) { // validation for constraint: boolean if (!is_null($iDVerified) && !is_bool($iDVerified)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($iDVerified)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($iDVerified, true), gettype($iDVerified)), __LINE__); } $this->IDVerified = $iDVerified; return $this; @@ -383,7 +384,7 @@ public function setNewUser($newUser = null) { // validation for constraint: boolean if (!is_null($newUser) && !is_bool($newUser)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($newUser)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($newUser, true), gettype($newUser)), __LINE__); } $this->NewUser = $newUser; return $this; @@ -423,7 +424,7 @@ public function setRegistrationDate($registrationDate = null) { // validation for constraint: string if (!is_null($registrationDate) && !is_string($registrationDate)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($registrationDate)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($registrationDate, true), gettype($registrationDate)), __LINE__); } $this->RegistrationDate = $registrationDate; return $this; @@ -448,7 +449,7 @@ public function setSite($site = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\SiteCodeType::valueIsValid($site)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $site, implode(', ', \PayPal\EnumType\SiteCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\SiteCodeType', is_array($site) ? implode(', ', $site) : var_export($site, true), implode(', ', \PayPal\EnumType\SiteCodeType::getValidValues())), __LINE__); } $this->Site = $site; return $this; @@ -473,7 +474,7 @@ public function setStatus($status = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\UserStatusCodeType::valueIsValid($status)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $status, implode(', ', \PayPal\EnumType\UserStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\UserStatusCodeType', is_array($status) ? implode(', ', $status) : var_export($status, true), implode(', ', \PayPal\EnumType\UserStatusCodeType::getValidValues())), __LINE__); } $this->Status = $status; return $this; @@ -493,13 +494,13 @@ public function getUserID() */ public function setUserID($userID = null) { - // validation for constraint: maxLength - if ((is_scalar($userID) && strlen($userID) > 127) || (is_array($userID) && count($userID) > 127)) { - throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 127 element(s) or a scalar of 127 character(s) at most, "%d" length given', is_scalar($userID) ? strlen($userID) : count($userID)), __LINE__); - } // validation for constraint: string if (!is_null($userID) && !is_string($userID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($userID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($userID, true), gettype($userID)), __LINE__); + } + // validation for constraint: maxLength(127) + if (!is_null($userID) && mb_strlen($userID) > 127) { + throw new \InvalidArgumentException(sprintf('Invalid length of %s, the number of characters/octets contained by the literal must be less than or equal to 127', mb_strlen($userID)), __LINE__); } $this->UserID = $userID; return $this; @@ -521,7 +522,7 @@ public function setUserIDChanged($userIDChanged = null) { // validation for constraint: boolean if (!is_null($userIDChanged) && !is_bool($userIDChanged)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($userIDChanged)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($userIDChanged, true), gettype($userIDChanged)), __LINE__); } $this->UserIDChanged = $userIDChanged; return $this; @@ -543,7 +544,7 @@ public function setUserIDLastChanged($userIDLastChanged = null) { // validation for constraint: string if (!is_null($userIDLastChanged) && !is_string($userIDLastChanged)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($userIDLastChanged)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($userIDLastChanged, true), gettype($userIDLastChanged)), __LINE__); } $this->UserIDLastChanged = $userIDLastChanged; return $this; @@ -568,7 +569,7 @@ public function setVATStatus($vATStatus = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\VATStatusCodeType::valueIsValid($vATStatus)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $vATStatus, implode(', ', \PayPal\EnumType\VATStatusCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\VATStatusCodeType', is_array($vATStatus) ? implode(', ', $vATStatus) : var_export($vATStatus, true), implode(', ', \PayPal\EnumType\VATStatusCodeType::getValidValues())), __LINE__); } $this->VATStatus = $vATStatus; return $this; diff --git a/src/StructType/VATDetailsType.php b/src/StructType/VATDetailsType.php index 6389277..21170f4 100644 --- a/src/StructType/VATDetailsType.php +++ b/src/StructType/VATDetailsType.php @@ -6,7 +6,7 @@ /** * This class stands for VATDetailsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Contains information required To list a business item. BusinessSeller - only for add item, the RestrictedToBusiness and VATPercent for both get and add, for revise all must be optional * @subpackage Structs * @author WsdlToPhp @@ -15,21 +15,21 @@ class VATDetailsType extends AbstractStructBase { /** * The BusinessSeller - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $BusinessSeller; /** * The RestrictedToBusiness - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var bool */ public $RestrictedToBusiness; /** * The VATPercent - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - minOccurs: 0 * @var float */ @@ -67,7 +67,7 @@ public function setBusinessSeller($businessSeller = null) { // validation for constraint: boolean if (!is_null($businessSeller) && !is_bool($businessSeller)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($businessSeller)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($businessSeller, true), gettype($businessSeller)), __LINE__); } $this->BusinessSeller = $businessSeller; return $this; @@ -89,7 +89,7 @@ public function setRestrictedToBusiness($restrictedToBusiness = null) { // validation for constraint: boolean if (!is_null($restrictedToBusiness) && !is_bool($restrictedToBusiness)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($restrictedToBusiness)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($restrictedToBusiness, true), gettype($restrictedToBusiness)), __LINE__); } $this->RestrictedToBusiness = $restrictedToBusiness; return $this; @@ -109,6 +109,10 @@ public function getVATPercent() */ public function setVATPercent($vATPercent = null) { + // validation for constraint: float + if (!is_null($vATPercent) && !(is_float($vATPercent) || is_numeric($vATPercent))) { + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($vATPercent, true), gettype($vATPercent)), __LINE__); + } $this->VATPercent = $vATPercent; return $this; } diff --git a/src/StructType/ValType.php b/src/StructType/ValType.php index 7e749d2..ef4b73e 100644 --- a/src/StructType/ValType.php +++ b/src/StructType/ValType.php @@ -18,7 +18,7 @@ class ValType extends AbstractStructBase public $ValueLiteral; /** * The ValueID - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - use: optional * @var string */ @@ -53,7 +53,7 @@ public function setValueLiteral($valueLiteral = null) { // validation for constraint: string if (!is_null($valueLiteral) && !is_string($valueLiteral)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($valueLiteral)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($valueLiteral, true), gettype($valueLiteral)), __LINE__); } $this->ValueLiteral = $valueLiteral; return $this; @@ -75,7 +75,7 @@ public function setValueID($valueID = null) { // validation for constraint: string if (!is_null($valueID) && !is_string($valueID)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($valueID)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($valueID, true), gettype($valueID)), __LINE__); } $this->ValueID = $valueID; return $this; diff --git a/src/StructType/VendorHostedPictureType.php b/src/StructType/VendorHostedPictureType.php index 753e5c5..6d0385a 100644 --- a/src/StructType/VendorHostedPictureType.php +++ b/src/StructType/VendorHostedPictureType.php @@ -13,7 +13,7 @@ class VendorHostedPictureType extends AbstractStructBase { /** * The PictureURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URLs for item picture that are stored/hosted at eBay site. * - minOccurs: 0 * @var string @@ -21,7 +21,7 @@ class VendorHostedPictureType extends AbstractStructBase public $PictureURL; /** * The GalleryURL - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: URL for a picture for the gallery. If the GalleryFeatured argument is true, a value must be supplied for either the GalleryURL or the PictureURL argument. In either case: (a) If a URL is provided for only PictureURL, it is used as * the Gallery thumbnail. (b) If a URL is provided for both GalleryURL and PictureURL, then the picture indicated in GalleryURL is used as the thumbnail. The image used for the Gallery thumbnail (specified in the GalleryURL or PictureURL argument) must * be in one of the graphics formats JPEG, BMP, TIF, or GIF. @@ -31,7 +31,7 @@ class VendorHostedPictureType extends AbstractStructBase public $GalleryURL; /** * The GalleryType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: This will be either "Featured" or "Gallery". * - minOccurs: 0 * @var string @@ -70,7 +70,7 @@ public function setPictureURL($pictureURL = null) { // validation for constraint: string if (!is_null($pictureURL) && !is_string($pictureURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pictureURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pictureURL, true), gettype($pictureURL)), __LINE__); } $this->PictureURL = $pictureURL; return $this; @@ -92,7 +92,7 @@ public function setGalleryURL($galleryURL = null) { // validation for constraint: string if (!is_null($galleryURL) && !is_string($galleryURL)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($galleryURL)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($galleryURL, true), gettype($galleryURL)), __LINE__); } $this->GalleryURL = $galleryURL; return $this; @@ -117,7 +117,7 @@ public function setGalleryType($galleryType = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\GalleryTypeCodeType::valueIsValid($galleryType)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $galleryType, implode(', ', \PayPal\EnumType\GalleryTypeCodeType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\GalleryTypeCodeType', is_array($galleryType) ? implode(', ', $galleryType) : var_export($galleryType, true), implode(', ', \PayPal\EnumType\GalleryTypeCodeType::getValidValues())), __LINE__); } $this->GalleryType = $galleryType; return $this; diff --git a/src/StructType/WalletItemsType.php b/src/StructType/WalletItemsType.php index 5fe99fa..55d678b 100644 --- a/src/StructType/WalletItemsType.php +++ b/src/StructType/WalletItemsType.php @@ -6,7 +6,7 @@ /** * This class stands for WalletItemsType StructType - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: Details about an Item stored in the PayPal Wallet. * @subpackage Structs * @author WsdlToPhp @@ -15,7 +15,7 @@ class WalletItemsType extends AbstractStructBase { /** * The Type - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: (Optional)Identifies a wallet item of a given type. The format varies depending on the type. * - maxOccurs: 1 * - minOccurs: 0 @@ -24,7 +24,7 @@ class WalletItemsType extends AbstractStructBase public $Type; /** * The Id - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: (Optional)Uniquely identifies a wallet item of given type. Format varies depending on the type. Character length and limitations: 64 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -33,7 +33,7 @@ class WalletItemsType extends AbstractStructBase public $Id; /** * The Description - * Meta informations extracted from the WSDL + * Meta information extracted from the WSDL * - documentation: (Optional)Description of wallet item. Character length and limitations: 512 single-byte characters maximum. * - maxOccurs: 1 * - minOccurs: 0 @@ -76,7 +76,7 @@ public function setType($type = null) { // validation for constraint: enumeration if (!\PayPal\EnumType\WalletItemType::valueIsValid($type)) { - throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $type, implode(', ', \PayPal\EnumType\WalletItemType::getValidValues())), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \PayPal\EnumType\WalletItemType', is_array($type) ? implode(', ', $type) : var_export($type, true), implode(', ', \PayPal\EnumType\WalletItemType::getValidValues())), __LINE__); } $this->Type = $type; return $this; @@ -98,7 +98,7 @@ public function setId($id = null) { // validation for constraint: string if (!is_null($id) && !is_string($id)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($id)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($id, true), gettype($id)), __LINE__); } $this->Id = $id; return $this; @@ -120,7 +120,7 @@ public function setDescription($description = null) { // validation for constraint: string if (!is_null($description) && !is_string($description)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__); + throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__); } $this->Description = $description; return $this;