diff --git a/README.md b/README.md index 0b065a83..e323071d 100644 --- a/README.md +++ b/README.md @@ -128,5 +128,5 @@ There are two kinds of tests that we include in our sdk package. Unit tests, and * [API Reference](https://developer.paypal.com/webapps/developer/docs/api/) * [Reporting issues / feature requests] (https://github.com/paypal/rest-api-sdk-php/issues) - + * [Pizza App Using Paypal REST API] (https://github.com/paypal/rest-api-sample-app-php) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/paypal/rest-api-sample-app-php/trend.png)](https://bitdeli.com/free "Bitdeli Badge") diff --git a/build.xml b/build.xml deleted file mode 100644 index d4e2ad4b..00000000 --- a/build.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - Composer is installed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/composer.json b/composer.json index c48fc9fa..f230f972 100644 --- a/composer.json +++ b/composer.json @@ -14,8 +14,7 @@ "require": { "php": ">=5.3.0", "ext-curl": "*", - "ext-json": "*", - "paypal/sdk-core-php": "2.5.*" + "ext-json": "*" }, "require-dev": { "phpunit/phpunit": "3.7.*" diff --git a/lib/PayPal/Api/BillingInfo.php b/lib/PayPal/Api/BillingInfo.php index 86e6ef6a..a18f9b16 100644 --- a/lib/PayPal/Api/BillingInfo.php +++ b/lib/PayPal/Api/BillingInfo.php @@ -4,221 +4,248 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class BillingInfo extends PPModel { - /** - * Email address of the invoice recipient. 260 characters max. - * - * @param string $email - */ - public function setEmail($email) { - $this->email = $email; - return $this; - } - - /** - * Email address of the invoice recipient. 260 characters max. - * - * @return string - */ - public function getEmail() { - return $this->email; - } - - - /** - * First name of the invoice recipient. 30 characters max. - * - * @param string $first_name - */ - public function setFirstName($first_name) { - $this->first_name = $first_name; - return $this; - } - - /** - * First name of the invoice recipient. 30 characters max. - * - * @return string - */ - public function getFirstName() { - return $this->first_name; - } - - /** - * First name of the invoice recipient. 30 characters max. - * - * @param string $first_name - * @deprecated. Instead use setFirstName - */ - public function setFirst_name($first_name) { - $this->first_name = $first_name; - return $this; - } - /** - * First name of the invoice recipient. 30 characters max. - * - * @return string - * @deprecated. Instead use getFirstName - */ - public function getFirst_name() { - return $this->first_name; - } - - /** - * Last name of the invoice recipient. 30 characters max. - * - * @param string $last_name - */ - public function setLastName($last_name) { - $this->last_name = $last_name; - return $this; - } - - /** - * Last name of the invoice recipient. 30 characters max. - * - * @return string - */ - public function getLastName() { - return $this->last_name; - } - - /** - * Last name of the invoice recipient. 30 characters max. - * - * @param string $last_name - * @deprecated. Instead use setLastName - */ - public function setLast_name($last_name) { - $this->last_name = $last_name; - return $this; - } - /** - * Last name of the invoice recipient. 30 characters max. - * - * @return string - * @deprecated. Instead use getLastName - */ - public function getLast_name() { - return $this->last_name; - } - - /** - * Company business name of the invoice recipient. 100 characters max. - * - * @param string $business_name - */ - public function setBusinessName($business_name) { - $this->business_name = $business_name; - return $this; - } - - /** - * Company business name of the invoice recipient. 100 characters max. - * - * @return string - */ - public function getBusinessName() { - return $this->business_name; - } - - /** - * Company business name of the invoice recipient. 100 characters max. - * - * @param string $business_name - * @deprecated. Instead use setBusinessName - */ - public function setBusiness_name($business_name) { - $this->business_name = $business_name; - return $this; - } - /** - * Company business name of the invoice recipient. 100 characters max. - * - * @return string - * @deprecated. Instead use getBusinessName - */ - public function getBusiness_name() { - return $this->business_name; - } - - /** - * Address of the invoice recipient. - * - * @param PayPal\Api\Address $address - */ - public function setAddress($address) { - $this->address = $address; - return $this; - } - - /** - * Address of the invoice recipient. - * - * @return PayPal\Api\Address - */ - public function getAddress() { - return $this->address; - } - - - /** - * Language of the email sent to the payer. Will only be used if payer doesn't have a PayPal account. - * - * @param string $language - */ - public function setLanguage($language) { - $this->language = $language; - return $this; - } - - /** - * Language of the email sent to the payer. Will only be used if payer doesn't have a PayPal account. - * - * @return string - */ - public function getLanguage() { - return $this->language; - } - - - /** - * Option to display additional information such as business hours. 40 characters max. - * - * @param string $additional_info - */ - public function setAdditionalInfo($additional_info) { - $this->additional_info = $additional_info; - return $this; - } - - /** - * Option to display additional information such as business hours. 40 characters max. - * - * @return string - */ - public function getAdditionalInfo() { - return $this->additional_info; - } - - /** - * Option to display additional information such as business hours. 40 characters max. - * - * @param string $additional_info - * @deprecated. Instead use setAdditionalInfo - */ - public function setAdditional_info($additional_info) { - $this->additional_info = $additional_info; - return $this; - } - /** - * Option to display additional information such as business hours. 40 characters max. - * - * @return string - * @deprecated. Instead use getAdditionalInfo - */ - public function getAdditional_info() { - return $this->additional_info; - } +class BillingInfo extends PPModel +{ + /** + * Email address of the invoice recipient. 260 characters max. + * + * @param string $email + */ + public function setEmail($email) + { + $this->email = $email; + return $this; + } + + /** + * Email address of the invoice recipient. 260 characters max. + * + * @return string + */ + public function getEmail() + { + return $this->email; + } + + + /** + * First name of the invoice recipient. 30 characters max. + * + * @param string $first_name + */ + public function setFirstName($first_name) + { + $this->first_name = $first_name; + return $this; + } + + /** + * First name of the invoice recipient. 30 characters max. + * + * @return string + */ + public function getFirstName() + { + return $this->first_name; + } + + /** + * First name of the invoice recipient. 30 characters max. + * + * @param string $first_name + * @deprecated. Instead use setFirstName + */ + public function setFirst_name($first_name) + { + $this->first_name = $first_name; + return $this; + } + + /** + * First name of the invoice recipient. 30 characters max. + * + * @return string + * @deprecated. Instead use getFirstName + */ + public function getFirst_name() + { + return $this->first_name; + } + + /** + * Last name of the invoice recipient. 30 characters max. + * + * @param string $last_name + */ + public function setLastName($last_name) + { + $this->last_name = $last_name; + return $this; + } + + /** + * Last name of the invoice recipient. 30 characters max. + * + * @return string + */ + public function getLastName() + { + return $this->last_name; + } + + /** + * Last name of the invoice recipient. 30 characters max. + * + * @param string $last_name + * @deprecated. Instead use setLastName + */ + public function setLast_name($last_name) + { + $this->last_name = $last_name; + return $this; + } + + /** + * Last name of the invoice recipient. 30 characters max. + * + * @return string + * @deprecated. Instead use getLastName + */ + public function getLast_name() + { + return $this->last_name; + } + + /** + * Company business name of the invoice recipient. 100 characters max. + * + * @param string $business_name + */ + public function setBusinessName($business_name) + { + $this->business_name = $business_name; + return $this; + } + + /** + * Company business name of the invoice recipient. 100 characters max. + * + * @return string + */ + public function getBusinessName() + { + return $this->business_name; + } + + /** + * Company business name of the invoice recipient. 100 characters max. + * + * @param string $business_name + * @deprecated. Instead use setBusinessName + */ + public function setBusiness_name($business_name) + { + $this->business_name = $business_name; + return $this; + } + + /** + * Company business name of the invoice recipient. 100 characters max. + * + * @return string + * @deprecated. Instead use getBusinessName + */ + public function getBusiness_name() + { + return $this->business_name; + } + + /** + * Address of the invoice recipient. + * + * @param PayPal\Api\Address $address + */ + public function setAddress($address) + { + $this->address = $address; + return $this; + } + + /** + * Address of the invoice recipient. + * + * @return PayPal\Api\Address + */ + public function getAddress() + { + return $this->address; + } + + + /** + * Language of the email sent to the payer. Will only be used if payer doesn't have a PayPal account. + * + * @param string $language + */ + public function setLanguage($language) + { + $this->language = $language; + return $this; + } + + /** + * Language of the email sent to the payer. Will only be used if payer doesn't have a PayPal account. + * + * @return string + */ + public function getLanguage() + { + return $this->language; + } + + + /** + * Option to display additional information such as business hours. 40 characters max. + * + * @param string $additional_info + */ + public function setAdditionalInfo($additional_info) + { + $this->additional_info = $additional_info; + return $this; + } + + /** + * Option to display additional information such as business hours. 40 characters max. + * + * @return string + */ + public function getAdditionalInfo() + { + return $this->additional_info; + } + + /** + * Option to display additional information such as business hours. 40 characters max. + * + * @param string $additional_info + * @deprecated. Instead use setAdditionalInfo + */ + public function setAdditional_info($additional_info) + { + $this->additional_info = $additional_info; + return $this; + } + + /** + * Option to display additional information such as business hours. 40 characters max. + * + * @return string + * @deprecated. Instead use getAdditionalInfo + */ + public function getAdditional_info() + { + return $this->additional_info; + } } diff --git a/lib/PayPal/Api/CancelNotification.php b/lib/PayPal/Api/CancelNotification.php index c41d5b68..c8f2a018 100644 --- a/lib/PayPal/Api/CancelNotification.php +++ b/lib/PayPal/Api/CancelNotification.php @@ -4,123 +4,138 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class CancelNotification extends PPModel { - /** - * Subject of the notification. - * - * @param string $subject - */ - public function setSubject($subject) { - $this->subject = $subject; - return $this; - } - - /** - * Subject of the notification. - * - * @return string - */ - public function getSubject() { - return $this->subject; - } - - - /** - * Note to the payer. - * - * @param string $note - */ - public function setNote($note) { - $this->note = $note; - return $this; - } - - /** - * Note to the payer. - * - * @return string - */ - public function getNote() { - return $this->note; - } - - - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @param boolean $send_to_merchant - */ - public function setSendToMerchant($send_to_merchant) { - $this->send_to_merchant = $send_to_merchant; - return $this; - } - - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @return boolean - */ - public function getSendToMerchant() { - return $this->send_to_merchant; - } - - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @param boolean $send_to_merchant - * @deprecated. Instead use setSendToMerchant - */ - public function setSend_to_merchant($send_to_merchant) { - $this->send_to_merchant = $send_to_merchant; - return $this; - } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @return boolean - * @deprecated. Instead use getSendToMerchant - */ - public function getSend_to_merchant() { - return $this->send_to_merchant; - } - - /** - * A flag indicating whether a copy of the email has to be sent to the payer. - * - * @param boolean $send_to_payer - */ - public function setSendToPayer($send_to_payer) { - $this->send_to_payer = $send_to_payer; - return $this; - } - - /** - * A flag indicating whether a copy of the email has to be sent to the payer. - * - * @return boolean - */ - public function getSendToPayer() { - return $this->send_to_payer; - } - - /** - * A flag indicating whether a copy of the email has to be sent to the payer. - * - * @param boolean $send_to_payer - * @deprecated. Instead use setSendToPayer - */ - public function setSend_to_payer($send_to_payer) { - $this->send_to_payer = $send_to_payer; - return $this; - } - /** - * A flag indicating whether a copy of the email has to be sent to the payer. - * - * @return boolean - * @deprecated. Instead use getSendToPayer - */ - public function getSend_to_payer() { - return $this->send_to_payer; - } +class CancelNotification extends PPModel +{ + /** + * Subject of the notification. + * + * @param string $subject + */ + public function setSubject($subject) + { + $this->subject = $subject; + return $this; + } + + /** + * Subject of the notification. + * + * @return string + */ + public function getSubject() + { + return $this->subject; + } + + + /** + * Note to the payer. + * + * @param string $note + */ + public function setNote($note) + { + $this->note = $note; + return $this; + } + + /** + * Note to the payer. + * + * @return string + */ + public function getNote() + { + return $this->note; + } + + + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @param boolean $send_to_merchant + */ + public function setSendToMerchant($send_to_merchant) + { + $this->send_to_merchant = $send_to_merchant; + return $this; + } + + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @return boolean + */ + public function getSendToMerchant() + { + return $this->send_to_merchant; + } + + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @param boolean $send_to_merchant + * @deprecated. Instead use setSendToMerchant + */ + public function setSend_to_merchant($send_to_merchant) + { + $this->send_to_merchant = $send_to_merchant; + return $this; + } + + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @return boolean + * @deprecated. Instead use getSendToMerchant + */ + public function getSend_to_merchant() + { + return $this->send_to_merchant; + } + + /** + * A flag indicating whether a copy of the email has to be sent to the payer. + * + * @param boolean $send_to_payer + */ + public function setSendToPayer($send_to_payer) + { + $this->send_to_payer = $send_to_payer; + return $this; + } + + /** + * A flag indicating whether a copy of the email has to be sent to the payer. + * + * @return boolean + */ + public function getSendToPayer() + { + return $this->send_to_payer; + } + + /** + * A flag indicating whether a copy of the email has to be sent to the payer. + * + * @param boolean $send_to_payer + * @deprecated. Instead use setSendToPayer + */ + public function setSend_to_payer($send_to_payer) + { + $this->send_to_payer = $send_to_payer; + return $this; + } + + /** + * A flag indicating whether a copy of the email has to be sent to the payer. + * + * @return boolean + * @deprecated. Instead use getSendToPayer + */ + public function getSend_to_payer() + { + return $this->send_to_payer; + } } diff --git a/lib/PayPal/Api/Cost.php b/lib/PayPal/Api/Cost.php index 694c3659..1551f1ec 100644 --- a/lib/PayPal/Api/Cost.php +++ b/lib/PayPal/Api/Cost.php @@ -4,45 +4,50 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class Cost extends PPModel { - /** - * Cost in percent. Range of 0 to 100. - * - * @param PayPal\Api\number $percent - */ - public function setPercent($percent) { - $this->percent = $percent; - return $this; - } - - /** - * Cost in percent. Range of 0 to 100. - * - * @return PayPal\Api\number - */ - public function getPercent() { - return $this->percent; - } - - - /** - * Cost in amount. Range of 0 to 999999.99. - * - * @param PayPal\Api\Currency $amount - */ - public function setAmount($amount) { - $this->amount = $amount; - return $this; - } - - /** - * Cost in amount. Range of 0 to 999999.99. - * - * @return PayPal\Api\Currency - */ - public function getAmount() { - return $this->amount; - } +class Cost extends PPModel +{ + /** + * Cost in percent. Range of 0 to 100. + * + * @param PayPal\Api\number $percent + */ + public function setPercent($percent) + { + $this->percent = $percent; + return $this; + } + + /** + * Cost in percent. Range of 0 to 100. + * + * @return PayPal\Api\number + */ + public function getPercent() + { + return $this->percent; + } + + + /** + * Cost in amount. Range of 0 to 999999.99. + * + * @param PayPal\Api\Currency $amount + */ + public function setAmount($amount) + { + $this->amount = $amount; + return $this; + } + + /** + * Cost in amount. Range of 0 to 999999.99. + * + * @return PayPal\Api\Currency + */ + public function getAmount() + { + return $this->amount; + } } diff --git a/lib/PayPal/Api/Currency.php b/lib/PayPal/Api/Currency.php index 651ef60d..d6884cc5 100644 --- a/lib/PayPal/Api/Currency.php +++ b/lib/PayPal/Api/Currency.php @@ -4,45 +4,50 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class Currency extends PPModel { - /** - * 3 letter currency code - * - * @param string $currency - */ - public function setCurrency($currency) { - $this->currency = $currency; - return $this; - } - - /** - * 3 letter currency code - * - * @return string - */ - public function getCurrency() { - return $this->currency; - } - - - /** - * amount upto 2 decimals represented as string - * - * @param string $value - */ - public function setValue($value) { - $this->value = $value; - return $this; - } - - /** - * amount upto 2 decimals represented as string - * - * @return string - */ - public function getValue() { - return $this->value; - } +class Currency extends PPModel +{ + /** + * 3 letter currency code + * + * @param string $currency + */ + public function setCurrency($currency) + { + $this->currency = $currency; + return $this; + } + + /** + * 3 letter currency code + * + * @return string + */ + public function getCurrency() + { + return $this->currency; + } + + + /** + * amount upto 2 decimals represented as string + * + * @param string $value + */ + public function setValue($value) + { + $this->value = $value; + return $this; + } + + /** + * amount upto 2 decimals represented as string + * + * @return string + */ + public function getValue() + { + return $this->value; + } } diff --git a/lib/PayPal/Api/CustomAmount.php b/lib/PayPal/Api/CustomAmount.php index 0fd89809..e4f9305e 100644 --- a/lib/PayPal/Api/CustomAmount.php +++ b/lib/PayPal/Api/CustomAmount.php @@ -4,45 +4,50 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class CustomAmount extends PPModel { - /** - * Custom amount label. 25 characters max. - * - * @param string $label - */ - public function setLabel($label) { - $this->label = $label; - return $this; - } - - /** - * Custom amount label. 25 characters max. - * - * @return string - */ - public function getLabel() { - return $this->label; - } - - - /** - * Custom amount value. Range of 0 to 999999.99. - * - * @param PayPal\Api\Currency $amount - */ - public function setAmount($amount) { - $this->amount = $amount; - return $this; - } - - /** - * Custom amount value. Range of 0 to 999999.99. - * - * @return PayPal\Api\Currency - */ - public function getAmount() { - return $this->amount; - } +class CustomAmount extends PPModel +{ + /** + * Custom amount label. 25 characters max. + * + * @param string $label + */ + public function setLabel($label) + { + $this->label = $label; + return $this; + } + + /** + * Custom amount label. 25 characters max. + * + * @return string + */ + public function getLabel() + { + return $this->label; + } + + + /** + * Custom amount value. Range of 0 to 999999.99. + * + * @param PayPal\Api\Currency $amount + */ + public function setAmount($amount) + { + $this->amount = $amount; + return $this; + } + + /** + * Custom amount value. Range of 0 to 999999.99. + * + * @return PayPal\Api\Currency + */ + public function getAmount() + { + return $this->amount; + } } diff --git a/lib/PayPal/Api/Error.php b/lib/PayPal/Api/Error.php index 62ddfe97..31720c69 100644 --- a/lib/PayPal/Api/Error.php +++ b/lib/PayPal/Api/Error.php @@ -4,143 +4,160 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class Error extends PPModel { - /** - * Human readable, unique name of the error. - * - * @param string $name - */ - public function setName($name) { - $this->name = $name; - return $this; - } - - /** - * Human readable, unique name of the error. - * - * @return string - */ - public function getName() { - return $this->name; - } - - - /** - * PayPal internal identifier used for correlation purposes. - * - * @param string $debug_id - */ - public function setDebugId($debug_id) { - $this->debug_id = $debug_id; - return $this; - } - - /** - * PayPal internal identifier used for correlation purposes. - * - * @return string - */ - public function getDebugId() { - return $this->debug_id; - } - - /** - * PayPal internal identifier used for correlation purposes. - * - * @param string $debug_id - * @deprecated. Instead use setDebugId - */ - public function setDebug_id($debug_id) { - $this->debug_id = $debug_id; - return $this; - } - /** - * PayPal internal identifier used for correlation purposes. - * - * @return string - * @deprecated. Instead use getDebugId - */ - public function getDebug_id() { - return $this->debug_id; - } - - /** - * Message describing the error. - * - * @param string $message - */ - public function setMessage($message) { - $this->message = $message; - return $this; - } - - /** - * Message describing the error. - * - * @return string - */ - public function getMessage() { - return $this->message; - } - - - /** - * URI for detailed information related to this error for the developer. - * - * @param string $information_link - */ - public function setInformationLink($information_link) { - $this->information_link = $information_link; - return $this; - } - - /** - * URI for detailed information related to this error for the developer. - * - * @return string - */ - public function getInformationLink() { - return $this->information_link; - } - - /** - * URI for detailed information related to this error for the developer. - * - * @param string $information_link - * @deprecated. Instead use setInformationLink - */ - public function setInformation_link($information_link) { - $this->information_link = $information_link; - return $this; - } - /** - * URI for detailed information related to this error for the developer. - * - * @return string - * @deprecated. Instead use getInformationLink - */ - public function getInformation_link() { - return $this->information_link; - } - - /** - * Additional details of the error - * - * @param PayPal\Api\ErrorDetails $details - */ - public function setDetails($details) { - $this->details = $details; - return $this; - } - - /** - * Additional details of the error - * - * @return PayPal\Api\ErrorDetails - */ - public function getDetails() { - return $this->details; - } +class Error extends PPModel +{ + /** + * Human readable, unique name of the error. + * + * @param string $name + */ + public function setName($name) + { + $this->name = $name; + return $this; + } + + /** + * Human readable, unique name of the error. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + + /** + * PayPal internal identifier used for correlation purposes. + * + * @param string $debug_id + */ + public function setDebugId($debug_id) + { + $this->debug_id = $debug_id; + return $this; + } + + /** + * PayPal internal identifier used for correlation purposes. + * + * @return string + */ + public function getDebugId() + { + return $this->debug_id; + } + + /** + * PayPal internal identifier used for correlation purposes. + * + * @param string $debug_id + * @deprecated. Instead use setDebugId + */ + public function setDebug_id($debug_id) + { + $this->debug_id = $debug_id; + return $this; + } + + /** + * PayPal internal identifier used for correlation purposes. + * + * @return string + * @deprecated. Instead use getDebugId + */ + public function getDebug_id() + { + return $this->debug_id; + } + + /** + * Message describing the error. + * + * @param string $message + */ + public function setMessage($message) + { + $this->message = $message; + return $this; + } + + /** + * Message describing the error. + * + * @return string + */ + public function getMessage() + { + return $this->message; + } + + + /** + * URI for detailed information related to this error for the developer. + * + * @param string $information_link + */ + public function setInformationLink($information_link) + { + $this->information_link = $information_link; + return $this; + } + + /** + * URI for detailed information related to this error for the developer. + * + * @return string + */ + public function getInformationLink() + { + return $this->information_link; + } + + /** + * URI for detailed information related to this error for the developer. + * + * @param string $information_link + * @deprecated. Instead use setInformationLink + */ + public function setInformation_link($information_link) + { + $this->information_link = $information_link; + return $this; + } + + /** + * URI for detailed information related to this error for the developer. + * + * @return string + * @deprecated. Instead use getInformationLink + */ + public function getInformation_link() + { + return $this->information_link; + } + + /** + * Additional details of the error + * + * @param PayPal\Api\ErrorDetails $details + */ + public function setDetails($details) + { + $this->details = $details; + return $this; + } + + /** + * Additional details of the error + * + * @return PayPal\Api\ErrorDetails + */ + public function getDetails() + { + return $this->details; + } } diff --git a/lib/PayPal/Api/ErrorDetails.php b/lib/PayPal/Api/ErrorDetails.php index 2b5487a6..6b02af09 100644 --- a/lib/PayPal/Api/ErrorDetails.php +++ b/lib/PayPal/Api/ErrorDetails.php @@ -4,45 +4,50 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class ErrorDetails extends PPModel { - /** - * Name of the field that caused the error. - * - * @param string $field - */ - public function setField($field) { - $this->field = $field; - return $this; - } - - /** - * Name of the field that caused the error. - * - * @return string - */ - public function getField() { - return $this->field; - } - - - /** - * Reason for the error. - * - * @param string $issue - */ - public function setIssue($issue) { - $this->issue = $issue; - return $this; - } - - /** - * Reason for the error. - * - * @return string - */ - public function getIssue() { - return $this->issue; - } +class ErrorDetails extends PPModel +{ + /** + * Name of the field that caused the error. + * + * @param string $field + */ + public function setField($field) + { + $this->field = $field; + return $this; + } + + /** + * Name of the field that caused the error. + * + * @return string + */ + public function getField() + { + return $this->field; + } + + + /** + * Reason for the error. + * + * @param string $issue + */ + public function setIssue($issue) + { + $this->issue = $issue; + return $this; + } + + /** + * Reason for the error. + * + * @return string + */ + public function getIssue() + { + return $this->issue; + } } diff --git a/lib/PayPal/Api/Invoice.php b/lib/PayPal/Api/Invoice.php index 53a20477..97dacdde 100644 --- a/lib/PayPal/Api/Invoice.php +++ b/lib/PayPal/Api/Invoice.php @@ -7,978 +7,1075 @@ use PayPal\Api\Invoices; use PayPal\Transport\PPRestCall; -class Invoice extends PPModel implements IResource { - - private static $credential; - - /** - * - * @deprecated. Pass ApiContext to create/get methods instead - */ - public static function setCredential($credential) { - self::$credential = $credential; - } - - /** - * Unique invoice resource identifier. - * - * @param string $id - */ - public function setId($id) { - $this->id = $id; - return $this; - } - - /** - * Unique invoice resource identifier. - * - * @return string - */ - public function getId() { - return $this->id; - } - - - /** - * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max. - * - * @param string $number - */ - public function setNumber($number) { - $this->number = $number; - return $this; - } - - /** - * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max. - * - * @return string - */ - public function getNumber() { - return $this->number; - } - - - /** - * URI of the invoice resource. - * - * @param string $uri - */ - public function setUri($uri) { - $this->uri = $uri; - return $this; - } - - /** - * URI of the invoice resource. - * - * @return string - */ - public function getUri() { - return $this->uri; - } - - - /** - * Status of the invoice. - * - * @param string $status - */ - public function setStatus($status) { - $this->status = $status; - return $this; - } - - /** - * Status of the invoice. - * - * @return string - */ - public function getStatus() { - return $this->status; - } - - - /** - * Information about the merchant who is sending the invoice. - * - * @param PayPal\Api\MerchantInfo $merchant_info - */ - public function setMerchantInfo($merchant_info) { - $this->merchant_info = $merchant_info; - return $this; - } - - /** - * Information about the merchant who is sending the invoice. - * - * @return PayPal\Api\MerchantInfo - */ - public function getMerchantInfo() { - return $this->merchant_info; - } - - /** - * Information about the merchant who is sending the invoice. - * - * @param PayPal\Api\MerchantInfo $merchant_info - * @deprecated. Instead use setMerchantInfo - */ - public function setMerchant_info($merchant_info) { - $this->merchant_info = $merchant_info; - return $this; - } - /** - * Information about the merchant who is sending the invoice. - * - * @return PayPal\Api\MerchantInfo - * @deprecated. Instead use getMerchantInfo - */ - public function getMerchant_info() { - return $this->merchant_info; - } - - /** - * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). - * - * @param PayPal\Api\BillingInfo $billing_info - */ - public function setBillingInfo($billing_info) { - $this->billing_info = $billing_info; - return $this; - } - - /** - * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). - * - * @return PayPal\Api\BillingInfo - */ - public function getBillingInfo() { - return $this->billing_info; - } - - /** - * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). - * - * @param PayPal\Api\BillingInfo $billing_info - * @deprecated. Instead use setBillingInfo - */ - public function setBilling_info($billing_info) { - $this->billing_info = $billing_info; - return $this; - } - /** - * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). - * - * @return PayPal\Api\BillingInfo - * @deprecated. Instead use getBillingInfo - */ - public function getBilling_info() { - return $this->billing_info; - } - - /** - * Shipping information for entities to whom items are being shipped. - * - * @param PayPal\Api\ShippingInfo $shipping_info - */ - public function setShippingInfo($shipping_info) { - $this->shipping_info = $shipping_info; - return $this; - } - - /** - * Shipping information for entities to whom items are being shipped. - * - * @return PayPal\Api\ShippingInfo - */ - public function getShippingInfo() { - return $this->shipping_info; - } - - /** - * Shipping information for entities to whom items are being shipped. - * - * @param PayPal\Api\ShippingInfo $shipping_info - * @deprecated. Instead use setShippingInfo - */ - public function setShipping_info($shipping_info) { - $this->shipping_info = $shipping_info; - return $this; - } - /** - * Shipping information for entities to whom items are being shipped. - * - * @return PayPal\Api\ShippingInfo - * @deprecated. Instead use getShippingInfo - */ - public function getShipping_info() { - return $this->shipping_info; - } - - /** - * List of items included in the invoice. 100 items max per invoice. - * - * @param PayPal\Api\InvoiceItem $items - */ - public function setItems($items) { - $this->items = $items; - return $this; - } - - /** - * List of items included in the invoice. 100 items max per invoice. - * - * @return PayPal\Api\InvoiceItem - */ - public function getItems() { - return $this->items; - } - - - /** - * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST - * - * @param string $invoice_date - */ - public function setInvoiceDate($invoice_date) { - $this->invoice_date = $invoice_date; - return $this; - } - - /** - * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST - * - * @return string - */ - public function getInvoiceDate() { - return $this->invoice_date; - } - - /** - * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST - * - * @param string $invoice_date - * @deprecated. Instead use setInvoiceDate - */ - public function setInvoice_date($invoice_date) { - $this->invoice_date = $invoice_date; - return $this; - } - /** - * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST - * - * @return string - * @deprecated. Instead use getInvoiceDate - */ - public function getInvoice_date() { - return $this->invoice_date; - } - - /** - * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. - * - * @param PayPal\Api\PaymentTerm $payment_term - */ - public function setPaymentTerm($payment_term) { - $this->payment_term = $payment_term; - return $this; - } - - /** - * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. - * - * @return PayPal\Api\PaymentTerm - */ - public function getPaymentTerm() { - return $this->payment_term; - } - - /** - * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. - * - * @param PayPal\Api\PaymentTerm $payment_term - * @deprecated. Instead use setPaymentTerm - */ - public function setPayment_term($payment_term) { - $this->payment_term = $payment_term; - return $this; - } - /** - * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. - * - * @return PayPal\Api\PaymentTerm - * @deprecated. Instead use getPaymentTerm - */ - public function getPayment_term() { - return $this->payment_term; - } - - /** - * Invoice level discount in percent or amount. - * - * @param PayPal\Api\Cost $discount - */ - public function setDiscount($discount) { - $this->discount = $discount; - return $this; - } - - /** - * Invoice level discount in percent or amount. - * - * @return PayPal\Api\Cost - */ - public function getDiscount() { - return $this->discount; - } - - - /** - * Shipping cost in percent or amount. - * - * @param PayPal\Api\ShippingCost $shipping_cost - */ - public function setShippingCost($shipping_cost) { - $this->shipping_cost = $shipping_cost; - return $this; - } - - /** - * Shipping cost in percent or amount. - * - * @return PayPal\Api\ShippingCost - */ - public function getShippingCost() { - return $this->shipping_cost; - } - - /** - * Shipping cost in percent or amount. - * - * @param PayPal\Api\ShippingCost $shipping_cost - * @deprecated. Instead use setShippingCost - */ - public function setShipping_cost($shipping_cost) { - $this->shipping_cost = $shipping_cost; - return $this; - } - /** - * Shipping cost in percent or amount. - * - * @return PayPal\Api\ShippingCost - * @deprecated. Instead use getShippingCost - */ - public function getShipping_cost() { - return $this->shipping_cost; - } - - /** - * Custom amount applied on an invoice. If a label is included then the amount cannot be empty. - * - * @param PayPal\Api\CustomAmount $custom - */ - public function setCustom($custom) { - $this->custom = $custom; - return $this; - } - - /** - * Custom amount applied on an invoice. If a label is included then the amount cannot be empty. - * - * @return PayPal\Api\CustomAmount - */ - public function getCustom() { - return $this->custom; - } - - - /** - * Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount. - * - * @param boolean $tax_calculated_after_discount - */ - public function setTaxCalculatedAfterDiscount($tax_calculated_after_discount) { - $this->tax_calculated_after_discount = $tax_calculated_after_discount; - return $this; - } - - /** - * Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount. - * - * @return boolean - */ - public function getTaxCalculatedAfterDiscount() { - return $this->tax_calculated_after_discount; - } - - /** - * Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount. - * - * @param boolean $tax_calculated_after_discount - * @deprecated. Instead use setTaxCalculatedAfterDiscount - */ - public function setTax_calculated_after_discount($tax_calculated_after_discount) { - $this->tax_calculated_after_discount = $tax_calculated_after_discount; - return $this; - } - /** - * Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount. - * - * @return boolean - * @deprecated. Instead use getTaxCalculatedAfterDiscount - */ - public function getTax_calculated_after_discount() { - return $this->tax_calculated_after_discount; - } - - /** - * A flag indicating whether the unit price includes tax. Default is false - * - * @param boolean $tax_inclusive - */ - public function setTaxInclusive($tax_inclusive) { - $this->tax_inclusive = $tax_inclusive; - return $this; - } - - /** - * A flag indicating whether the unit price includes tax. Default is false - * - * @return boolean - */ - public function getTaxInclusive() { - return $this->tax_inclusive; - } - - /** - * A flag indicating whether the unit price includes tax. Default is false - * - * @param boolean $tax_inclusive - * @deprecated. Instead use setTaxInclusive - */ - public function setTax_inclusive($tax_inclusive) { - $this->tax_inclusive = $tax_inclusive; - return $this; - } - /** - * A flag indicating whether the unit price includes tax. Default is false - * - * @return boolean - * @deprecated. Instead use getTaxInclusive - */ - public function getTax_inclusive() { - return $this->tax_inclusive; - } - - /** - * General terms of the invoice. 4000 characters max. - * - * @param string $terms - */ - public function setTerms($terms) { - $this->terms = $terms; - return $this; - } - - /** - * General terms of the invoice. 4000 characters max. - * - * @return string - */ - public function getTerms() { - return $this->terms; - } - - - /** - * Note to the payer. 4000 characters max. - * - * @param string $note - */ - public function setNote($note) { - $this->note = $note; - return $this; - } - - /** - * Note to the payer. 4000 characters max. - * - * @return string - */ - public function getNote() { - return $this->note; - } - - - /** - * Bookkeeping memo that is private to the merchant. 150 characters max. - * - * @param string $merchant_memo - */ - public function setMerchantMemo($merchant_memo) { - $this->merchant_memo = $merchant_memo; - return $this; - } - - /** - * Bookkeeping memo that is private to the merchant. 150 characters max. - * - * @return string - */ - public function getMerchantMemo() { - return $this->merchant_memo; - } - - /** - * Bookkeeping memo that is private to the merchant. 150 characters max. - * - * @param string $merchant_memo - * @deprecated. Instead use setMerchantMemo - */ - public function setMerchant_memo($merchant_memo) { - $this->merchant_memo = $merchant_memo; - return $this; - } - /** - * Bookkeeping memo that is private to the merchant. 150 characters max. - * - * @return string - * @deprecated. Instead use getMerchantMemo - */ - public function getMerchant_memo() { - return $this->merchant_memo; - } - - /** - * Full URL of an external image to use as the logo. 4000 characters max. - * - * @param string $logo_url - */ - public function setLogoUrl($logo_url) { - $this->logo_url = $logo_url; - return $this; - } - - /** - * Full URL of an external image to use as the logo. 4000 characters max. - * - * @return string - */ - public function getLogoUrl() { - return $this->logo_url; - } - - /** - * Full URL of an external image to use as the logo. 4000 characters max. - * - * @param string $logo_url - * @deprecated. Instead use setLogoUrl - */ - public function setLogo_url($logo_url) { - $this->logo_url = $logo_url; - return $this; - } - /** - * Full URL of an external image to use as the logo. 4000 characters max. - * - * @return string - * @deprecated. Instead use getLogoUrl - */ - public function getLogo_url() { - return $this->logo_url; - } - - /** - * The total amount of the invoice. - * - * @param PayPal\Api\Currency $total_amount - */ - public function setTotalAmount($total_amount) { - $this->total_amount = $total_amount; - return $this; - } - - /** - * The total amount of the invoice. - * - * @return PayPal\Api\Currency - */ - public function getTotalAmount() { - return $this->total_amount; - } - - /** - * The total amount of the invoice. - * - * @param PayPal\Api\Currency $total_amount - * @deprecated. Instead use setTotalAmount - */ - public function setTotal_amount($total_amount) { - $this->total_amount = $total_amount; - return $this; - } - /** - * The total amount of the invoice. - * - * @return PayPal\Api\Currency - * @deprecated. Instead use getTotalAmount - */ - public function getTotal_amount() { - return $this->total_amount; - } - - /** - * Set Payments - * A list of Payment resources - * - * @param \PayPal\Api\Payment $payments - * - * @return $this - */ - public function setPayments($payments) - { - $this->payments = $payments; - - return $this; - } - - /** - * Get Payments - * A list of Payment resources - * - * @return \PayPal\Api\Payment - */ - public function getPayments() - { - return $this->payments; - } - - /** - * List of payment details for the invoice. - * - * @param PayPal\Api\PaymentDetail $payment_details - */ - public function setPaymentDetails($payment_details) { - $this->payment_details = $payment_details; - return $this; - } - - /** - * List of payment details for the invoice. - * - * @return PayPal\Api\PaymentDetail - */ - public function getPaymentDetails() { - return $this->payment_details; - } - - /** - * List of payment details for the invoice. - * - * @param PayPal\Api\PaymentDetail $payment_details - * @deprecated. Instead use setPaymentDetails - */ - public function setPayment_details($payment_details) { - $this->payment_details = $payment_details; - return $this; - } - /** - * List of payment details for the invoice. - * - * @return PayPal\Api\PaymentDetail - * @deprecated. Instead use getPaymentDetails - */ - public function getPayment_details() { - return $this->payment_details; - } - - /** - * List of refund details for the invoice. - * - * @param PayPal\Api\RefundDetail $refund_details - */ - public function setRefundDetails($refund_details) { - $this->refund_details = $refund_details; - return $this; - } - - /** - * List of refund details for the invoice. - * - * @return PayPal\Api\RefundDetail - */ - public function getRefundDetails() { - return $this->refund_details; - } - - /** - * List of refund details for the invoice. - * - * @param PayPal\Api\RefundDetail $refund_details - * @deprecated. Instead use setRefundDetails - */ - public function setRefund_details($refund_details) { - $this->refund_details = $refund_details; - return $this; - } - /** - * List of refund details for the invoice. - * - * @return PayPal\Api\RefundDetail - * @deprecated. Instead use getRefundDetails - */ - public function getRefund_details() { - return $this->refund_details; - } - - /** - * Audit information for the invoice. - * - * @param PayPal\Api\Metadata $metadata - */ - public function setMetadata($metadata) { - $this->metadata = $metadata; - return $this; - } - - /** - * Audit information for the invoice. - * - * @return PayPal\Api\Metadata - */ - public function getMetadata() { - return $this->metadata; - } - - - - /* - * Creates a new invoice Resource. - * - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return Invoice - */ - public function create($apiContext = null) { - $payLoad = $this->toJSON(); - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices", "POST", $payLoad); - $this->fromJson($json); - return $this; - } - - /* - * Search for invoice resources. - * - * @param Search $search - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return Invoices - */ - public function search($search, $apiContext = null) { - if (($search == null)) { - throw new \InvalidArgumentException("search cannot be null or empty"); - } - $payLoad = $search->toJSON(); - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/search", "POST", $payLoad); - $ret = new Invoices(); - $ret->fromJson($json); - return $ret; - } - - /* - * Sends a legitimate invoice to the payer. - * - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return void - */ - public function send($apiContext = null) { - if ($this->getId() == null) { - throw new \InvalidArgumentException("Id cannot be null"); - } - $payLoad = ""; - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/send", "POST", $payLoad); - return true; - } - - /* - * Reminds the payer to pay the invoice. - * - * @param Notification $notification - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return void - */ - public function remind($notification, $apiContext = null) { - if ($this->getId() == null) { - throw new \InvalidArgumentException("Id cannot be null"); - } - if (($notification == null)) { - throw new \InvalidArgumentException("notification cannot be null or empty"); - } - $payLoad = $notification->toJSON(); - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/remind", "POST", $payLoad); - return true; - } - - /* - * Cancels an invoice. - * - * @param CancelNotification $cancelNotification - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return void - */ - public function cancel($cancelNotification, $apiContext = null) { - if ($this->getId() == null) { - throw new \InvalidArgumentException("Id cannot be null"); - } - if (($cancelNotification == null)) { - throw new \InvalidArgumentException("cancelNotification cannot be null or empty"); - } - $payLoad = $cancelNotification->toJSON(); - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/cancel", "POST", $payLoad); - return true; - } - - /* - * Mark the status of the invoice as paid. - * - * @param PaymentDetail $paymentDetail - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return void - */ - public function record_payment($paymentDetail, $apiContext = null) { - if ($this->getId() == null) { - throw new \InvalidArgumentException("Id cannot be null"); - } - if (($paymentDetail == null)) { - throw new \InvalidArgumentException("paymentDetail cannot be null or empty"); - } - $payLoad = $paymentDetail->toJSON(); - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/record-payment", "POST", $payLoad); - return true; - } - - /* - * Mark the status of the invoice as refunded. - * - * @param RefundDetail $refundDetail - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return void - */ - public function record_refund($refundDetail, $apiContext = null) { - if ($this->getId() == null) { - throw new \InvalidArgumentException("Id cannot be null"); - } - if (($refundDetail == null)) { - throw new \InvalidArgumentException("refundDetail cannot be null or empty"); - } - $payLoad = $refundDetail->toJSON(); - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/record-refund", "POST", $payLoad); - return true; - } - - /* - * Get the invoice resource for the given identifier. - * - * @param string $invoiceId - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return Invoice - */ - public static function get($invoiceId, $apiContext = null) { - if (($invoiceId == null) || (strlen($invoiceId) <= 0)) { - throw new \InvalidArgumentException("invoiceId cannot be null or empty"); - } - $payLoad = ""; - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/$invoiceId", "GET", $payLoad); - $ret = new Invoice(); - $ret->fromJson($json); - return $ret; - } - - /* - * Get all invoices of a merchant. - * - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return Invoices - */ - public static function get_all($apiContext = null) { - $payLoad = ""; - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/", "GET", $payLoad); - $ret = new Invoices(); - $ret->fromJson($json); - return $ret; - } - - /* - * Full update of the invoice resource for the given identifier. - * - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return Invoice - */ - public function update($apiContext = null) { - if ($this->getId() == null) { - throw new \InvalidArgumentException("Id cannot be null"); - } - $payLoad = $this->toJSON(); - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}", "PUT", $payLoad); - $this->fromJson($json); - return $this; - } - - /* - * Delete invoice resource for the given identifier. - * - * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @return void - */ - public function delete($apiContext = null) { - if ($this->getId() == null) { - throw new \InvalidArgumentException("Id cannot be null"); - } - $payLoad = ""; - if ($apiContext == null) { - $apiContext = new ApiContext(self::$credential); - } - $call = new PPRestCall($apiContext); - $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}", "DELETE", $payLoad); - return true; - } +class Invoice extends PPModel implements IResource +{ + + private static $credential; + + /** + * + * @deprecated. Pass ApiContext to create/get methods instead + */ + public static function setCredential($credential) + { + self::$credential = $credential; + } + + /** + * Unique invoice resource identifier. + * + * @param string $id + */ + public function setId($id) + { + $this->id = $id; + return $this; + } + + /** + * Unique invoice resource identifier. + * + * @return string + */ + public function getId() + { + return $this->id; + } + + + /** + * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max. + * + * @param string $number + */ + public function setNumber($number) + { + $this->number = $number; + return $this; + } + + /** + * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max. + * + * @return string + */ + public function getNumber() + { + return $this->number; + } + + + /** + * URI of the invoice resource. + * + * @param string $uri + */ + public function setUri($uri) + { + $this->uri = $uri; + return $this; + } + + /** + * URI of the invoice resource. + * + * @return string + */ + public function getUri() + { + return $this->uri; + } + + + /** + * Status of the invoice. + * + * @param string $status + */ + public function setStatus($status) + { + $this->status = $status; + return $this; + } + + /** + * Status of the invoice. + * + * @return string + */ + public function getStatus() + { + return $this->status; + } + + + /** + * Information about the merchant who is sending the invoice. + * + * @param PayPal\Api\MerchantInfo $merchant_info + */ + public function setMerchantInfo($merchant_info) + { + $this->merchant_info = $merchant_info; + return $this; + } + + /** + * Information about the merchant who is sending the invoice. + * + * @return PayPal\Api\MerchantInfo + */ + public function getMerchantInfo() + { + return $this->merchant_info; + } + + /** + * Information about the merchant who is sending the invoice. + * + * @param PayPal\Api\MerchantInfo $merchant_info + * @deprecated. Instead use setMerchantInfo + */ + public function setMerchant_info($merchant_info) + { + $this->merchant_info = $merchant_info; + return $this; + } + + /** + * Information about the merchant who is sending the invoice. + * + * @return PayPal\Api\MerchantInfo + * @deprecated. Instead use getMerchantInfo + */ + public function getMerchant_info() + { + return $this->merchant_info; + } + + /** + * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). + * + * @param PayPal\Api\BillingInfo $billing_info + */ + public function setBillingInfo($billing_info) + { + $this->billing_info = $billing_info; + return $this; + } + + /** + * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). + * + * @return PayPal\Api\BillingInfo + */ + public function getBillingInfo() + { + return $this->billing_info; + } + + /** + * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). + * + * @param PayPal\Api\BillingInfo $billing_info + * @deprecated. Instead use setBillingInfo + */ + public function setBilling_info($billing_info) + { + $this->billing_info = $billing_info; + return $this; + } + + /** + * Email address of invoice recipient (required) and optional billing information. (Note: We currently only allow one recipient). + * + * @return PayPal\Api\BillingInfo + * @deprecated. Instead use getBillingInfo + */ + public function getBilling_info() + { + return $this->billing_info; + } + + /** + * Shipping information for entities to whom items are being shipped. + * + * @param PayPal\Api\ShippingInfo $shipping_info + */ + public function setShippingInfo($shipping_info) + { + $this->shipping_info = $shipping_info; + return $this; + } + + /** + * Shipping information for entities to whom items are being shipped. + * + * @return PayPal\Api\ShippingInfo + */ + public function getShippingInfo() + { + return $this->shipping_info; + } + + /** + * Shipping information for entities to whom items are being shipped. + * + * @param PayPal\Api\ShippingInfo $shipping_info + * @deprecated. Instead use setShippingInfo + */ + public function setShipping_info($shipping_info) + { + $this->shipping_info = $shipping_info; + return $this; + } + + /** + * Shipping information for entities to whom items are being shipped. + * + * @return PayPal\Api\ShippingInfo + * @deprecated. Instead use getShippingInfo + */ + public function getShipping_info() + { + return $this->shipping_info; + } + + /** + * List of items included in the invoice. 100 items max per invoice. + * + * @param PayPal\Api\InvoiceItem $items + */ + public function setItems($items) + { + $this->items = $items; + return $this; + } + + /** + * List of items included in the invoice. 100 items max per invoice. + * + * @return PayPal\Api\InvoiceItem + */ + public function getItems() + { + return $this->items; + } + + + /** + * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * + * @param string $invoice_date + */ + public function setInvoiceDate($invoice_date) + { + $this->invoice_date = $invoice_date; + return $this; + } + + /** + * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * + * @return string + */ + public function getInvoiceDate() + { + return $this->invoice_date; + } + + /** + * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * + * @param string $invoice_date + * @deprecated. Instead use setInvoiceDate + */ + public function setInvoice_date($invoice_date) + { + $this->invoice_date = $invoice_date; + return $this; + } + + /** + * Date on which the invoice was enabled. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * + * @return string + * @deprecated. Instead use getInvoiceDate + */ + public function getInvoice_date() + { + return $this->invoice_date; + } + + /** + * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. + * + * @param PayPal\Api\PaymentTerm $payment_term + */ + public function setPaymentTerm($payment_term) + { + $this->payment_term = $payment_term; + return $this; + } + + /** + * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. + * + * @return PayPal\Api\PaymentTerm + */ + public function getPaymentTerm() + { + return $this->payment_term; + } + + /** + * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. + * + * @param PayPal\Api\PaymentTerm $payment_term + * @deprecated. Instead use setPaymentTerm + */ + public function setPayment_term($payment_term) + { + $this->payment_term = $payment_term; + return $this; + } + + /** + * Optional field to pass payment deadline for the invoice. Either term_type or due_date can be passed, but not both. + * + * @return PayPal\Api\PaymentTerm + * @deprecated. Instead use getPaymentTerm + */ + public function getPayment_term() + { + return $this->payment_term; + } + + /** + * Invoice level discount in percent or amount. + * + * @param PayPal\Api\Cost $discount + */ + public function setDiscount($discount) + { + $this->discount = $discount; + return $this; + } + + /** + * Invoice level discount in percent or amount. + * + * @return PayPal\Api\Cost + */ + public function getDiscount() + { + return $this->discount; + } + + + /** + * Shipping cost in percent or amount. + * + * @param PayPal\Api\ShippingCost $shipping_cost + */ + public function setShippingCost($shipping_cost) + { + $this->shipping_cost = $shipping_cost; + return $this; + } + + /** + * Shipping cost in percent or amount. + * + * @return PayPal\Api\ShippingCost + */ + public function getShippingCost() + { + return $this->shipping_cost; + } + + /** + * Shipping cost in percent or amount. + * + * @param PayPal\Api\ShippingCost $shipping_cost + * @deprecated. Instead use setShippingCost + */ + public function setShipping_cost($shipping_cost) + { + $this->shipping_cost = $shipping_cost; + return $this; + } + + /** + * Shipping cost in percent or amount. + * + * @return PayPal\Api\ShippingCost + * @deprecated. Instead use getShippingCost + */ + public function getShipping_cost() + { + return $this->shipping_cost; + } + + /** + * Custom amount applied on an invoice. If a label is included then the amount cannot be empty. + * + * @param PayPal\Api\CustomAmount $custom + */ + public function setCustom($custom) + { + $this->custom = $custom; + return $this; + } + + /** + * Custom amount applied on an invoice. If a label is included then the amount cannot be empty. + * + * @return PayPal\Api\CustomAmount + */ + public function getCustom() + { + return $this->custom; + } + + + /** + * Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount. + * + * @param boolean $tax_calculated_after_discount + */ + public function setTaxCalculatedAfterDiscount($tax_calculated_after_discount) + { + $this->tax_calculated_after_discount = $tax_calculated_after_discount; + return $this; + } + + /** + * Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount. + * + * @return boolean + */ + public function getTaxCalculatedAfterDiscount() + { + return $this->tax_calculated_after_discount; + } + + /** + * Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount. + * + * @param boolean $tax_calculated_after_discount + * @deprecated. Instead use setTaxCalculatedAfterDiscount + */ + public function setTax_calculated_after_discount($tax_calculated_after_discount) + { + $this->tax_calculated_after_discount = $tax_calculated_after_discount; + return $this; + } + + /** + * Indicates whether tax is calculated before or after a discount. If false (the default), the tax is calculated before a discount. If true, the tax is calculated after a discount. + * + * @return boolean + * @deprecated. Instead use getTaxCalculatedAfterDiscount + */ + public function getTax_calculated_after_discount() + { + return $this->tax_calculated_after_discount; + } + + /** + * A flag indicating whether the unit price includes tax. Default is false + * + * @param boolean $tax_inclusive + */ + public function setTaxInclusive($tax_inclusive) + { + $this->tax_inclusive = $tax_inclusive; + return $this; + } + + /** + * A flag indicating whether the unit price includes tax. Default is false + * + * @return boolean + */ + public function getTaxInclusive() + { + return $this->tax_inclusive; + } + + /** + * A flag indicating whether the unit price includes tax. Default is false + * + * @param boolean $tax_inclusive + * @deprecated. Instead use setTaxInclusive + */ + public function setTax_inclusive($tax_inclusive) + { + $this->tax_inclusive = $tax_inclusive; + return $this; + } + + /** + * A flag indicating whether the unit price includes tax. Default is false + * + * @return boolean + * @deprecated. Instead use getTaxInclusive + */ + public function getTax_inclusive() + { + return $this->tax_inclusive; + } + + /** + * General terms of the invoice. 4000 characters max. + * + * @param string $terms + */ + public function setTerms($terms) + { + $this->terms = $terms; + return $this; + } + + /** + * General terms of the invoice. 4000 characters max. + * + * @return string + */ + public function getTerms() + { + return $this->terms; + } + + + /** + * Note to the payer. 4000 characters max. + * + * @param string $note + */ + public function setNote($note) + { + $this->note = $note; + return $this; + } + + /** + * Note to the payer. 4000 characters max. + * + * @return string + */ + public function getNote() + { + return $this->note; + } + + + /** + * Bookkeeping memo that is private to the merchant. 150 characters max. + * + * @param string $merchant_memo + */ + public function setMerchantMemo($merchant_memo) + { + $this->merchant_memo = $merchant_memo; + return $this; + } + + /** + * Bookkeeping memo that is private to the merchant. 150 characters max. + * + * @return string + */ + public function getMerchantMemo() + { + return $this->merchant_memo; + } + + /** + * Bookkeeping memo that is private to the merchant. 150 characters max. + * + * @param string $merchant_memo + * @deprecated. Instead use setMerchantMemo + */ + public function setMerchant_memo($merchant_memo) + { + $this->merchant_memo = $merchant_memo; + return $this; + } + + /** + * Bookkeeping memo that is private to the merchant. 150 characters max. + * + * @return string + * @deprecated. Instead use getMerchantMemo + */ + public function getMerchant_memo() + { + return $this->merchant_memo; + } + + /** + * Full URL of an external image to use as the logo. 4000 characters max. + * + * @param string $logo_url + */ + public function setLogoUrl($logo_url) + { + $this->logo_url = $logo_url; + return $this; + } + + /** + * Full URL of an external image to use as the logo. 4000 characters max. + * + * @return string + */ + public function getLogoUrl() + { + return $this->logo_url; + } + + /** + * Full URL of an external image to use as the logo. 4000 characters max. + * + * @param string $logo_url + * @deprecated. Instead use setLogoUrl + */ + public function setLogo_url($logo_url) + { + $this->logo_url = $logo_url; + return $this; + } + + /** + * Full URL of an external image to use as the logo. 4000 characters max. + * + * @return string + * @deprecated. Instead use getLogoUrl + */ + public function getLogo_url() + { + return $this->logo_url; + } + + /** + * The total amount of the invoice. + * + * @param PayPal\Api\Currency $total_amount + */ + public function setTotalAmount($total_amount) + { + $this->total_amount = $total_amount; + return $this; + } + + /** + * The total amount of the invoice. + * + * @return PayPal\Api\Currency + */ + public function getTotalAmount() + { + return $this->total_amount; + } + + /** + * The total amount of the invoice. + * + * @param PayPal\Api\Currency $total_amount + * @deprecated. Instead use setTotalAmount + */ + public function setTotal_amount($total_amount) + { + $this->total_amount = $total_amount; + return $this; + } + + /** + * The total amount of the invoice. + * + * @return PayPal\Api\Currency + * @deprecated. Instead use getTotalAmount + */ + public function getTotal_amount() + { + return $this->total_amount; + } + + /** + * Set Payments + * A list of Payment resources + * + * @param \PayPal\Api\Payment $payments + * + * @return $this + */ + public function setPayments($payments) + { + $this->payments = $payments; + + return $this; + } + + /** + * Get Payments + * A list of Payment resources + * + * @return \PayPal\Api\Payment + */ + public function getPayments() + { + return $this->payments; + } + + /** + * List of payment details for the invoice. + * + * @param PayPal\Api\PaymentDetail $payment_details + */ + public function setPaymentDetails($payment_details) + { + $this->payment_details = $payment_details; + return $this; + } + + /** + * List of payment details for the invoice. + * + * @return PayPal\Api\PaymentDetail + */ + public function getPaymentDetails() + { + return $this->payment_details; + } + + /** + * List of payment details for the invoice. + * + * @param PayPal\Api\PaymentDetail $payment_details + * @deprecated. Instead use setPaymentDetails + */ + public function setPayment_details($payment_details) + { + $this->payment_details = $payment_details; + return $this; + } + + /** + * List of payment details for the invoice. + * + * @return PayPal\Api\PaymentDetail + * @deprecated. Instead use getPaymentDetails + */ + public function getPayment_details() + { + return $this->payment_details; + } + + /** + * List of refund details for the invoice. + * + * @param PayPal\Api\RefundDetail $refund_details + */ + public function setRefundDetails($refund_details) + { + $this->refund_details = $refund_details; + return $this; + } + + /** + * List of refund details for the invoice. + * + * @return PayPal\Api\RefundDetail + */ + public function getRefundDetails() + { + return $this->refund_details; + } + + /** + * List of refund details for the invoice. + * + * @param PayPal\Api\RefundDetail $refund_details + * @deprecated. Instead use setRefundDetails + */ + public function setRefund_details($refund_details) + { + $this->refund_details = $refund_details; + return $this; + } + + /** + * List of refund details for the invoice. + * + * @return PayPal\Api\RefundDetail + * @deprecated. Instead use getRefundDetails + */ + public function getRefund_details() + { + return $this->refund_details; + } + + /** + * Audit information for the invoice. + * + * @param PayPal\Api\Metadata $metadata + */ + public function setMetadata($metadata) + { + $this->metadata = $metadata; + return $this; + } + + /** + * Audit information for the invoice. + * + * @return PayPal\Api\Metadata + */ + public function getMetadata() + { + return $this->metadata; + } + + + /* + * Creates a new invoice Resource. + * + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return Invoice + */ + public function create($apiContext = null) + { + $payLoad = $this->toJSON(); + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices", "POST", $payLoad); + $this->fromJson($json); + return $this; + } + + /* + * Search for invoice resources. + * + * @param Search $search + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return Invoices + */ + public function search($search, $apiContext = null) + { + if (($search == null)) { + throw new \InvalidArgumentException("search cannot be null or empty"); + } + $payLoad = $search->toJSON(); + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/search", "POST", $payLoad); + $ret = new Invoices(); + $ret->fromJson($json); + return $ret; + } + + /* + * Sends a legitimate invoice to the payer. + * + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return void + */ + public function send($apiContext = null) + { + if ($this->getId() == null) { + throw new \InvalidArgumentException("Id cannot be null"); + } + $payLoad = ""; + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/send", "POST", $payLoad); + return true; + } + + /* + * Reminds the payer to pay the invoice. + * + * @param Notification $notification + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return void + */ + public function remind($notification, $apiContext = null) + { + if ($this->getId() == null) { + throw new \InvalidArgumentException("Id cannot be null"); + } + if (($notification == null)) { + throw new \InvalidArgumentException("notification cannot be null or empty"); + } + $payLoad = $notification->toJSON(); + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/remind", "POST", $payLoad); + return true; + } + + /* + * Cancels an invoice. + * + * @param CancelNotification $cancelNotification + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return void + */ + public function cancel($cancelNotification, $apiContext = null) + { + if ($this->getId() == null) { + throw new \InvalidArgumentException("Id cannot be null"); + } + if (($cancelNotification == null)) { + throw new \InvalidArgumentException("cancelNotification cannot be null or empty"); + } + $payLoad = $cancelNotification->toJSON(); + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/cancel", "POST", $payLoad); + return true; + } + + /* + * Mark the status of the invoice as paid. + * + * @param PaymentDetail $paymentDetail + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return void + */ + public function record_payment($paymentDetail, $apiContext = null) + { + if ($this->getId() == null) { + throw new \InvalidArgumentException("Id cannot be null"); + } + if (($paymentDetail == null)) { + throw new \InvalidArgumentException("paymentDetail cannot be null or empty"); + } + $payLoad = $paymentDetail->toJSON(); + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/record-payment", "POST", $payLoad); + return true; + } + + /* + * Mark the status of the invoice as refunded. + * + * @param RefundDetail $refundDetail + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return void + */ + public function record_refund($refundDetail, $apiContext = null) + { + if ($this->getId() == null) { + throw new \InvalidArgumentException("Id cannot be null"); + } + if (($refundDetail == null)) { + throw new \InvalidArgumentException("refundDetail cannot be null or empty"); + } + $payLoad = $refundDetail->toJSON(); + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}/record-refund", "POST", $payLoad); + return true; + } + + /* + * Get the invoice resource for the given identifier. + * + * @param string $invoiceId + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return Invoice + */ + public static function get($invoiceId, $apiContext = null) + { + if (($invoiceId == null) || (strlen($invoiceId) <= 0)) { + throw new \InvalidArgumentException("invoiceId cannot be null or empty"); + } + $payLoad = ""; + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/$invoiceId", "GET", $payLoad); + $ret = new Invoice(); + $ret->fromJson($json); + return $ret; + } + + /* + * Get all invoices of a merchant. + * + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return Invoices + */ + public static function get_all($apiContext = null) + { + $payLoad = ""; + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/", "GET", $payLoad); + $ret = new Invoices(); + $ret->fromJson($json); + return $ret; + } + + /* + * Full update of the invoice resource for the given identifier. + * + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return Invoice + */ + public function update($apiContext = null) + { + if ($this->getId() == null) { + throw new \InvalidArgumentException("Id cannot be null"); + } + $payLoad = $this->toJSON(); + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}", "PUT", $payLoad); + $this->fromJson($json); + return $this; + } + + /* + * Delete invoice resource for the given identifier. + * + * @param PayPal\Rest\ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. + * @return void + */ + public function delete($apiContext = null) + { + if ($this->getId() == null) { + throw new \InvalidArgumentException("Id cannot be null"); + } + $payLoad = ""; + if ($apiContext == null) { + $apiContext = new ApiContext(self::$credential); + } + $call = new PPRestCall($apiContext); + $json = $call->execute(array('PayPal\Rest\RestHandler'), "/v1/invoicing/invoices/{$this->getId()}", "DELETE", $payLoad); + return true; + } } diff --git a/lib/PayPal/Api/InvoiceItem.php b/lib/PayPal/Api/InvoiceItem.php index aefdaf9c..734db694 100644 --- a/lib/PayPal/Api/InvoiceItem.php +++ b/lib/PayPal/Api/InvoiceItem.php @@ -4,164 +4,182 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class InvoiceItem extends PPModel { - /** - * Name of the item. 60 characters max. - * - * @param string $name - */ - public function setName($name) { - $this->name = $name; - return $this; - } - - /** - * Name of the item. 60 characters max. - * - * @return string - */ - public function getName() { - return $this->name; - } - - - /** - * Description of the item. 1000 characters max. - * - * @param string $description - */ - public function setDescription($description) { - $this->description = $description; - return $this; - } - - /** - * Description of the item. 1000 characters max. - * - * @return string - */ - public function getDescription() { - return $this->description; - } - - - /** - * Quantity of the item. Range of 0 to 9999.999. - * - * @param PayPal\Api\number $quantity - */ - public function setQuantity($quantity) { - $this->quantity = $quantity; - return $this; - } - - /** - * Quantity of the item. Range of 0 to 9999.999. - * - * @return PayPal\Api\number - */ - public function getQuantity() { - return $this->quantity; - } - - - /** - * Unit price of the item. Range of -999999.99 to 999999.99. - * - * @param PayPal\Api\Currency $unit_price - */ - public function setUnitPrice($unit_price) { - $this->unit_price = $unit_price; - return $this; - } - - /** - * Unit price of the item. Range of -999999.99 to 999999.99. - * - * @return PayPal\Api\Currency - */ - public function getUnitPrice() { - return $this->unit_price; - } - - /** - * Unit price of the item. Range of -999999.99 to 999999.99. - * - * @param PayPal\Api\Currency $unit_price - * @deprecated. Instead use setUnitPrice - */ - public function setUnit_price($unit_price) { - $this->unit_price = $unit_price; - return $this; - } - /** - * Unit price of the item. Range of -999999.99 to 999999.99. - * - * @return PayPal\Api\Currency - * @deprecated. Instead use getUnitPrice - */ - public function getUnit_price() { - return $this->unit_price; - } - - /** - * Tax associated with the item. - * - * @param PayPal\Api\Tax $tax - */ - public function setTax($tax) { - $this->tax = $tax; - return $this; - } - - /** - * Tax associated with the item. - * - * @return PayPal\Api\Tax - */ - public function getTax() { - return $this->tax; - } - - - /** - * Date on which the item or service was provided. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. - * - * @param string $date - */ - public function setDate($date) { - $this->date = $date; - return $this; - } - - /** - * Date on which the item or service was provided. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. - * - * @return string - */ - public function getDate() { - return $this->date; - } - - - /** - * Item discount in percent or amount. - * - * @param PayPal\Api\Cost $discount - */ - public function setDiscount($discount) { - $this->discount = $discount; - return $this; - } - - /** - * Item discount in percent or amount. - * - * @return PayPal\Api\Cost - */ - public function getDiscount() { - return $this->discount; - } +class InvoiceItem extends PPModel +{ + /** + * Name of the item. 60 characters max. + * + * @param string $name + */ + public function setName($name) + { + $this->name = $name; + return $this; + } + + /** + * Name of the item. 60 characters max. + * + * @return string + */ + public function getName() + { + return $this->name; + } + + + /** + * Description of the item. 1000 characters max. + * + * @param string $description + */ + public function setDescription($description) + { + $this->description = $description; + return $this; + } + + /** + * Description of the item. 1000 characters max. + * + * @return string + */ + public function getDescription() + { + return $this->description; + } + + + /** + * Quantity of the item. Range of 0 to 9999.999. + * + * @param PayPal\Api\number $quantity + */ + public function setQuantity($quantity) + { + $this->quantity = $quantity; + return $this; + } + + /** + * Quantity of the item. Range of 0 to 9999.999. + * + * @return PayPal\Api\number + */ + public function getQuantity() + { + return $this->quantity; + } + + + /** + * Unit price of the item. Range of -999999.99 to 999999.99. + * + * @param PayPal\Api\Currency $unit_price + */ + public function setUnitPrice($unit_price) + { + $this->unit_price = $unit_price; + return $this; + } + + /** + * Unit price of the item. Range of -999999.99 to 999999.99. + * + * @return PayPal\Api\Currency + */ + public function getUnitPrice() + { + return $this->unit_price; + } + + /** + * Unit price of the item. Range of -999999.99 to 999999.99. + * + * @param PayPal\Api\Currency $unit_price + * @deprecated. Instead use setUnitPrice + */ + public function setUnit_price($unit_price) + { + $this->unit_price = $unit_price; + return $this; + } + + /** + * Unit price of the item. Range of -999999.99 to 999999.99. + * + * @return PayPal\Api\Currency + * @deprecated. Instead use getUnitPrice + */ + public function getUnit_price() + { + return $this->unit_price; + } + + /** + * Tax associated with the item. + * + * @param PayPal\Api\Tax $tax + */ + public function setTax($tax) + { + $this->tax = $tax; + return $this; + } + + /** + * Tax associated with the item. + * + * @return PayPal\Api\Tax + */ + public function getTax() + { + return $this->tax; + } + + + /** + * Date on which the item or service was provided. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * + * @param string $date + */ + public function setDate($date) + { + $this->date = $date; + return $this; + } + + /** + * Date on which the item or service was provided. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * + * @return string + */ + public function getDate() + { + return $this->date; + } + + + /** + * Item discount in percent or amount. + * + * @param PayPal\Api\Cost $discount + */ + public function setDiscount($discount) + { + $this->discount = $discount; + return $this; + } + + /** + * Item discount in percent or amount. + * + * @return PayPal\Api\Cost + */ + public function getDiscount() + { + return $this->discount; + } } diff --git a/lib/PayPal/Api/Invoices.php b/lib/PayPal/Api/Invoices.php index b74a0e03..15cbfd7d 100644 --- a/lib/PayPal/Api/Invoices.php +++ b/lib/PayPal/Api/Invoices.php @@ -4,64 +4,72 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class Invoices extends PPModel { - /** - * - * - * @param integer $total_count - */ - public function setTotalCount($total_count) { - $this->total_count = $total_count; - return $this; - } +class Invoices extends PPModel +{ + /** + * + * + * @param integer $total_count + */ + public function setTotalCount($total_count) + { + $this->total_count = $total_count; + return $this; + } - /** - * - * - * @return integer - */ - public function getTotalCount() { - return $this->total_count; - } + /** + * + * + * @return integer + */ + public function getTotalCount() + { + return $this->total_count; + } - /** - * - * - * @param integer $total_count - * @deprecated. Instead use setTotalCount - */ - public function setTotal_count($total_count) { - $this->total_count = $total_count; - return $this; - } - /** - * - * - * @return integer - * @deprecated. Instead use getTotalCount - */ - public function getTotal_count() { - return $this->total_count; - } + /** + * + * + * @param integer $total_count + * @deprecated. Instead use setTotalCount + */ + public function setTotal_count($total_count) + { + $this->total_count = $total_count; + return $this; + } - /** - * List of invoices belonging to a merchant. - * - * @param PayPal\Api\Invoice $invoices - */ - public function setInvoices($invoices) { - $this->invoices = $invoices; - return $this; - } + /** + * + * + * @return integer + * @deprecated. Instead use getTotalCount + */ + public function getTotal_count() + { + return $this->total_count; + } - /** - * List of invoices belonging to a merchant. - * - * @return PayPal\Api\Invoice - */ - public function getInvoices() { - return $this->invoices; - } + /** + * List of invoices belonging to a merchant. + * + * @param PayPal\Api\Invoice $invoices + */ + public function setInvoices($invoices) + { + $this->invoices = $invoices; + return $this; + } + + /** + * List of invoices belonging to a merchant. + * + * @return PayPal\Api\Invoice + */ + public function getInvoices() + { + return $this->invoices; + } } diff --git a/lib/PayPal/Api/InvoicingMetaData.php b/lib/PayPal/Api/InvoicingMetaData.php index 84122ef1..19d435ba 100644 --- a/lib/PayPal/Api/InvoicingMetaData.php +++ b/lib/PayPal/Api/InvoicingMetaData.php @@ -4,356 +4,402 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class InvoicingMetaData extends PPModel { - /** - * Date when the resource was created. - * - * @param string $created_date - */ - public function setCreatedDate($created_date) { - $this->created_date = $created_date; - return $this; - } - - /** - * Date when the resource was created. - * - * @return string - */ - public function getCreatedDate() { - return $this->created_date; - } - - /** - * Date when the resource was created. - * - * @param string $created_date - * @deprecated. Instead use setCreatedDate - */ - public function setCreated_date($created_date) { - $this->created_date = $created_date; - return $this; - } - /** - * Date when the resource was created. - * - * @return string - * @deprecated. Instead use getCreatedDate - */ - public function getCreated_date() { - return $this->created_date; - } - - /** - * Email address of the account that created the resource. - * - * @param string $created_by - */ - public function setCreatedBy($created_by) { - $this->created_by = $created_by; - return $this; - } - - /** - * Email address of the account that created the resource. - * - * @return string - */ - public function getCreatedBy() { - return $this->created_by; - } - - /** - * Email address of the account that created the resource. - * - * @param string $created_by - * @deprecated. Instead use setCreatedBy - */ - public function setCreated_by($created_by) { - $this->created_by = $created_by; - return $this; - } - /** - * Email address of the account that created the resource. - * - * @return string - * @deprecated. Instead use getCreatedBy - */ - public function getCreated_by() { - return $this->created_by; - } - - /** - * Date when the resource was cancelled. - * - * @param string $cancelled_date - */ - public function setCancelledDate($cancelled_date) { - $this->cancelled_date = $cancelled_date; - return $this; - } - - /** - * Date when the resource was cancelled. - * - * @return string - */ - public function getCancelledDate() { - return $this->cancelled_date; - } - - /** - * Date when the resource was cancelled. - * - * @param string $cancelled_date - * @deprecated. Instead use setCancelledDate - */ - public function setCancelled_date($cancelled_date) { - $this->cancelled_date = $cancelled_date; - return $this; - } - /** - * Date when the resource was cancelled. - * - * @return string - * @deprecated. Instead use getCancelledDate - */ - public function getCancelled_date() { - return $this->cancelled_date; - } - - /** - * Actor who cancelled the resource. - * - * @param string $cancelled_by - */ - public function setCancelledBy($cancelled_by) { - $this->cancelled_by = $cancelled_by; - return $this; - } - - /** - * Actor who cancelled the resource. - * - * @return string - */ - public function getCancelledBy() { - return $this->cancelled_by; - } - - /** - * Actor who cancelled the resource. - * - * @param string $cancelled_by - * @deprecated. Instead use setCancelledBy - */ - public function setCancelled_by($cancelled_by) { - $this->cancelled_by = $cancelled_by; - return $this; - } - /** - * Actor who cancelled the resource. - * - * @return string - * @deprecated. Instead use getCancelledBy - */ - public function getCancelled_by() { - return $this->cancelled_by; - } - - /** - * Date when the resource was last edited. - * - * @param string $last_updated_date - */ - public function setLastUpdatedDate($last_updated_date) { - $this->last_updated_date = $last_updated_date; - return $this; - } - - /** - * Date when the resource was last edited. - * - * @return string - */ - public function getLastUpdatedDate() { - return $this->last_updated_date; - } - - /** - * Date when the resource was last edited. - * - * @param string $last_updated_date - * @deprecated. Instead use setLastUpdatedDate - */ - public function setLast_updated_date($last_updated_date) { - $this->last_updated_date = $last_updated_date; - return $this; - } - /** - * Date when the resource was last edited. - * - * @return string - * @deprecated. Instead use getLastUpdatedDate - */ - public function getLast_updated_date() { - return $this->last_updated_date; - } - - /** - * Email address of the account that last edited the resource. - * - * @param string $last_updated_by - */ - public function setLastUpdatedBy($last_updated_by) { - $this->last_updated_by = $last_updated_by; - return $this; - } - - /** - * Email address of the account that last edited the resource. - * - * @return string - */ - public function getLastUpdatedBy() { - return $this->last_updated_by; - } - - /** - * Email address of the account that last edited the resource. - * - * @param string $last_updated_by - * @deprecated. Instead use setLastUpdatedBy - */ - public function setLast_updated_by($last_updated_by) { - $this->last_updated_by = $last_updated_by; - return $this; - } - /** - * Email address of the account that last edited the resource. - * - * @return string - * @deprecated. Instead use getLastUpdatedBy - */ - public function getLast_updated_by() { - return $this->last_updated_by; - } - - /** - * Date when the resource was first sent. - * - * @param string $first_sent_date - */ - public function setFirstSentDate($first_sent_date) { - $this->first_sent_date = $first_sent_date; - return $this; - } - - /** - * Date when the resource was first sent. - * - * @return string - */ - public function getFirstSentDate() { - return $this->first_sent_date; - } - - /** - * Date when the resource was first sent. - * - * @param string $first_sent_date - * @deprecated. Instead use setFirstSentDate - */ - public function setFirst_sent_date($first_sent_date) { - $this->first_sent_date = $first_sent_date; - return $this; - } - /** - * Date when the resource was first sent. - * - * @return string - * @deprecated. Instead use getFirstSentDate - */ - public function getFirst_sent_date() { - return $this->first_sent_date; - } - - /** - * Date when the resource was last sent. - * - * @param string $last_sent_date - */ - public function setLastSentDate($last_sent_date) { - $this->last_sent_date = $last_sent_date; - return $this; - } - - /** - * Date when the resource was last sent. - * - * @return string - */ - public function getLastSentDate() { - return $this->last_sent_date; - } - - /** - * Date when the resource was last sent. - * - * @param string $last_sent_date - * @deprecated. Instead use setLastSentDate - */ - public function setLast_sent_date($last_sent_date) { - $this->last_sent_date = $last_sent_date; - return $this; - } - /** - * Date when the resource was last sent. - * - * @return string - * @deprecated. Instead use getLastSentDate - */ - public function getLast_sent_date() { - return $this->last_sent_date; - } - - /** - * Email address of the account that last sent the resource. - * - * @param string $last_sent_by - */ - public function setLastSentBy($last_sent_by) { - $this->last_sent_by = $last_sent_by; - return $this; - } - - /** - * Email address of the account that last sent the resource. - * - * @return string - */ - public function getLastSentBy() { - return $this->last_sent_by; - } - - /** - * Email address of the account that last sent the resource. - * - * @param string $last_sent_by - * @deprecated. Instead use setLastSentBy - */ - public function setLast_sent_by($last_sent_by) { - $this->last_sent_by = $last_sent_by; - return $this; - } - /** - * Email address of the account that last sent the resource. - * - * @return string - * @deprecated. Instead use getLastSentBy - */ - public function getLast_sent_by() { - return $this->last_sent_by; - } +class InvoicingMetaData extends PPModel +{ + /** + * Date when the resource was created. + * + * @param string $created_date + */ + public function setCreatedDate($created_date) + { + $this->created_date = $created_date; + return $this; + } + + /** + * Date when the resource was created. + * + * @return string + */ + public function getCreatedDate() + { + return $this->created_date; + } + + /** + * Date when the resource was created. + * + * @param string $created_date + * @deprecated. Instead use setCreatedDate + */ + public function setCreated_date($created_date) + { + $this->created_date = $created_date; + return $this; + } + + /** + * Date when the resource was created. + * + * @return string + * @deprecated. Instead use getCreatedDate + */ + public function getCreated_date() + { + return $this->created_date; + } + + /** + * Email address of the account that created the resource. + * + * @param string $created_by + */ + public function setCreatedBy($created_by) + { + $this->created_by = $created_by; + return $this; + } + + /** + * Email address of the account that created the resource. + * + * @return string + */ + public function getCreatedBy() + { + return $this->created_by; + } + + /** + * Email address of the account that created the resource. + * + * @param string $created_by + * @deprecated. Instead use setCreatedBy + */ + public function setCreated_by($created_by) + { + $this->created_by = $created_by; + return $this; + } + + /** + * Email address of the account that created the resource. + * + * @return string + * @deprecated. Instead use getCreatedBy + */ + public function getCreated_by() + { + return $this->created_by; + } + + /** + * Date when the resource was cancelled. + * + * @param string $cancelled_date + */ + public function setCancelledDate($cancelled_date) + { + $this->cancelled_date = $cancelled_date; + return $this; + } + + /** + * Date when the resource was cancelled. + * + * @return string + */ + public function getCancelledDate() + { + return $this->cancelled_date; + } + + /** + * Date when the resource was cancelled. + * + * @param string $cancelled_date + * @deprecated. Instead use setCancelledDate + */ + public function setCancelled_date($cancelled_date) + { + $this->cancelled_date = $cancelled_date; + return $this; + } + + /** + * Date when the resource was cancelled. + * + * @return string + * @deprecated. Instead use getCancelledDate + */ + public function getCancelled_date() + { + return $this->cancelled_date; + } + + /** + * Actor who cancelled the resource. + * + * @param string $cancelled_by + */ + public function setCancelledBy($cancelled_by) + { + $this->cancelled_by = $cancelled_by; + return $this; + } + + /** + * Actor who cancelled the resource. + * + * @return string + */ + public function getCancelledBy() + { + return $this->cancelled_by; + } + + /** + * Actor who cancelled the resource. + * + * @param string $cancelled_by + * @deprecated. Instead use setCancelledBy + */ + public function setCancelled_by($cancelled_by) + { + $this->cancelled_by = $cancelled_by; + return $this; + } + + /** + * Actor who cancelled the resource. + * + * @return string + * @deprecated. Instead use getCancelledBy + */ + public function getCancelled_by() + { + return $this->cancelled_by; + } + + /** + * Date when the resource was last edited. + * + * @param string $last_updated_date + */ + public function setLastUpdatedDate($last_updated_date) + { + $this->last_updated_date = $last_updated_date; + return $this; + } + + /** + * Date when the resource was last edited. + * + * @return string + */ + public function getLastUpdatedDate() + { + return $this->last_updated_date; + } + + /** + * Date when the resource was last edited. + * + * @param string $last_updated_date + * @deprecated. Instead use setLastUpdatedDate + */ + public function setLast_updated_date($last_updated_date) + { + $this->last_updated_date = $last_updated_date; + return $this; + } + + /** + * Date when the resource was last edited. + * + * @return string + * @deprecated. Instead use getLastUpdatedDate + */ + public function getLast_updated_date() + { + return $this->last_updated_date; + } + + /** + * Email address of the account that last edited the resource. + * + * @param string $last_updated_by + */ + public function setLastUpdatedBy($last_updated_by) + { + $this->last_updated_by = $last_updated_by; + return $this; + } + + /** + * Email address of the account that last edited the resource. + * + * @return string + */ + public function getLastUpdatedBy() + { + return $this->last_updated_by; + } + + /** + * Email address of the account that last edited the resource. + * + * @param string $last_updated_by + * @deprecated. Instead use setLastUpdatedBy + */ + public function setLast_updated_by($last_updated_by) + { + $this->last_updated_by = $last_updated_by; + return $this; + } + + /** + * Email address of the account that last edited the resource. + * + * @return string + * @deprecated. Instead use getLastUpdatedBy + */ + public function getLast_updated_by() + { + return $this->last_updated_by; + } + + /** + * Date when the resource was first sent. + * + * @param string $first_sent_date + */ + public function setFirstSentDate($first_sent_date) + { + $this->first_sent_date = $first_sent_date; + return $this; + } + + /** + * Date when the resource was first sent. + * + * @return string + */ + public function getFirstSentDate() + { + return $this->first_sent_date; + } + + /** + * Date when the resource was first sent. + * + * @param string $first_sent_date + * @deprecated. Instead use setFirstSentDate + */ + public function setFirst_sent_date($first_sent_date) + { + $this->first_sent_date = $first_sent_date; + return $this; + } + + /** + * Date when the resource was first sent. + * + * @return string + * @deprecated. Instead use getFirstSentDate + */ + public function getFirst_sent_date() + { + return $this->first_sent_date; + } + + /** + * Date when the resource was last sent. + * + * @param string $last_sent_date + */ + public function setLastSentDate($last_sent_date) + { + $this->last_sent_date = $last_sent_date; + return $this; + } + + /** + * Date when the resource was last sent. + * + * @return string + */ + public function getLastSentDate() + { + return $this->last_sent_date; + } + + /** + * Date when the resource was last sent. + * + * @param string $last_sent_date + * @deprecated. Instead use setLastSentDate + */ + public function setLast_sent_date($last_sent_date) + { + $this->last_sent_date = $last_sent_date; + return $this; + } + + /** + * Date when the resource was last sent. + * + * @return string + * @deprecated. Instead use getLastSentDate + */ + public function getLast_sent_date() + { + return $this->last_sent_date; + } + + /** + * Email address of the account that last sent the resource. + * + * @param string $last_sent_by + */ + public function setLastSentBy($last_sent_by) + { + $this->last_sent_by = $last_sent_by; + return $this; + } + + /** + * Email address of the account that last sent the resource. + * + * @return string + */ + public function getLastSentBy() + { + return $this->last_sent_by; + } + + /** + * Email address of the account that last sent the resource. + * + * @param string $last_sent_by + * @deprecated. Instead use setLastSentBy + */ + public function setLast_sent_by($last_sent_by) + { + $this->last_sent_by = $last_sent_by; + return $this; + } + + /** + * Email address of the account that last sent the resource. + * + * @return string + * @deprecated. Instead use getLastSentBy + */ + public function getLast_sent_by() + { + return $this->last_sent_by; + } } diff --git a/lib/PayPal/Api/InvoicingNotification.php b/lib/PayPal/Api/InvoicingNotification.php index 41a55188..2cd7e3bc 100644 --- a/lib/PayPal/Api/InvoicingNotification.php +++ b/lib/PayPal/Api/InvoicingNotification.php @@ -4,84 +4,94 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class InvoicingNotification extends PPModel { - /** - * Subject of the notification. - * - * @param string $subject - */ - public function setSubject($subject) { - $this->subject = $subject; - return $this; - } +class InvoicingNotification extends PPModel +{ + /** + * Subject of the notification. + * + * @param string $subject + */ + public function setSubject($subject) + { + $this->subject = $subject; + return $this; + } - /** - * Subject of the notification. - * - * @return string - */ - public function getSubject() { - return $this->subject; - } + /** + * Subject of the notification. + * + * @return string + */ + public function getSubject() + { + return $this->subject; + } - /** - * Note to the payer. - * - * @param string $note - */ - public function setNote($note) { - $this->note = $note; - return $this; - } + /** + * Note to the payer. + * + * @param string $note + */ + public function setNote($note) + { + $this->note = $note; + return $this; + } - /** - * Note to the payer. - * - * @return string - */ - public function getNote() { - return $this->note; - } + /** + * Note to the payer. + * + * @return string + */ + public function getNote() + { + return $this->note; + } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @param boolean $send_to_merchant - */ - public function setSendToMerchant($send_to_merchant) { - $this->send_to_merchant = $send_to_merchant; - return $this; - } + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @param boolean $send_to_merchant + */ + public function setSendToMerchant($send_to_merchant) + { + $this->send_to_merchant = $send_to_merchant; + return $this; + } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @return boolean - */ - public function getSendToMerchant() { - return $this->send_to_merchant; - } + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @return boolean + */ + public function getSendToMerchant() + { + return $this->send_to_merchant; + } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @param boolean $send_to_merchant - * @deprecated. Instead use setSendToMerchant - */ - public function setSend_to_merchant($send_to_merchant) { - $this->send_to_merchant = $send_to_merchant; - return $this; - } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @return boolean - * @deprecated. Instead use getSendToMerchant - */ - public function getSend_to_merchant() { - return $this->send_to_merchant; - } + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @param boolean $send_to_merchant + * @deprecated. Instead use setSendToMerchant + */ + public function setSend_to_merchant($send_to_merchant) + { + $this->send_to_merchant = $send_to_merchant; + return $this; + } + + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @return boolean + * @deprecated. Instead use getSendToMerchant + */ + public function getSend_to_merchant() + { + return $this->send_to_merchant; + } } diff --git a/lib/PayPal/Api/InvoicingPaymentDetail.php b/lib/PayPal/Api/InvoicingPaymentDetail.php index a4e0a697..cba1edfc 100644 --- a/lib/PayPal/Api/InvoicingPaymentDetail.php +++ b/lib/PayPal/Api/InvoicingPaymentDetail.php @@ -4,163 +4,182 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class InvoicingPaymentDetail extends PPModel { - /** - * PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. - * - * @param string $type - */ - public function setType($type) { - $this->type = $type; - return $this; - } - - /** - * PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. - * - * @return string - */ - public function getType() { - return $this->type; - } - - - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * - * @param string $transaction_id - */ - public function setTransactionId($transaction_id) { - $this->transaction_id = $transaction_id; - return $this; - } - - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * - * @return string - */ - public function getTransactionId() { - return $this->transaction_id; - } - - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * - * @param string $transaction_id - * @deprecated. Instead use setTransactionId - */ - public function setTransaction_id($transaction_id) { - $this->transaction_id = $transaction_id; - return $this; - } - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * - * @return string - * @deprecated. Instead use getTransactionId - */ - public function getTransaction_id() { - return $this->transaction_id; - } - - /** - * Type of the transaction. - * - * @param string $transaction_type - */ - public function setTransactionType($transaction_type) { - $this->transaction_type = $transaction_type; - return $this; - } - - /** - * Type of the transaction. - * - * @return string - */ - public function getTransactionType() { - return $this->transaction_type; - } - - /** - * Type of the transaction. - * - * @param string $transaction_type - * @deprecated. Instead use setTransactionType - */ - public function setTransaction_type($transaction_type) { - $this->transaction_type = $transaction_type; - return $this; - } - /** - * Type of the transaction. - * - * @return string - * @deprecated. Instead use getTransactionType - */ - public function getTransaction_type() { - return $this->transaction_type; - } - - /** - * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. - * - * @param string $date - */ - public function setDate($date) { - $this->date = $date; - return $this; - } - - /** - * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. - * - * @return string - */ - public function getDate() { - return $this->date; - } - - - /** - * Payment mode or method. This field is mandatory if the value of the type field is OTHER. - * - * @param string $method - */ - public function setMethod($method) { - $this->method = $method; - return $this; - } - - /** - * Payment mode or method. This field is mandatory if the value of the type field is OTHER. - * - * @return string - */ - public function getMethod() { - return $this->method; - } - - - /** - * Optional note associated with the payment. - * - * @param string $note - */ - public function setNote($note) { - $this->note = $note; - return $this; - } - - /** - * Optional note associated with the payment. - * - * @return string - */ - public function getNote() { - return $this->note; - } +class InvoicingPaymentDetail extends PPModel +{ + /** + * PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. + * + * @param string $type + */ + public function setType($type) + { + $this->type = $type; + return $this; + } + + /** + * PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. + * + * @return string + */ + public function getType() + { + return $this->type; + } + + + /** + * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. + * + * @param string $transaction_id + */ + public function setTransactionId($transaction_id) + { + $this->transaction_id = $transaction_id; + return $this; + } + + /** + * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. + * + * @return string + */ + public function getTransactionId() + { + return $this->transaction_id; + } + + /** + * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. + * + * @param string $transaction_id + * @deprecated. Instead use setTransactionId + */ + public function setTransaction_id($transaction_id) + { + $this->transaction_id = $transaction_id; + return $this; + } + + /** + * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. + * + * @return string + * @deprecated. Instead use getTransactionId + */ + public function getTransaction_id() + { + return $this->transaction_id; + } + + /** + * Type of the transaction. + * + * @param string $transaction_type + */ + public function setTransactionType($transaction_type) + { + $this->transaction_type = $transaction_type; + return $this; + } + + /** + * Type of the transaction. + * + * @return string + */ + public function getTransactionType() + { + return $this->transaction_type; + } + + /** + * Type of the transaction. + * + * @param string $transaction_type + * @deprecated. Instead use setTransactionType + */ + public function setTransaction_type($transaction_type) + { + $this->transaction_type = $transaction_type; + return $this; + } + + /** + * Type of the transaction. + * + * @return string + * @deprecated. Instead use getTransactionType + */ + public function getTransaction_type() + { + return $this->transaction_type; + } + + /** + * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * + * @param string $date + */ + public function setDate($date) + { + $this->date = $date; + return $this; + } + + /** + * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * + * @return string + */ + public function getDate() + { + return $this->date; + } + + + /** + * Payment mode or method. This field is mandatory if the value of the type field is OTHER. + * + * @param string $method + */ + public function setMethod($method) + { + $this->method = $method; + return $this; + } + + /** + * Payment mode or method. This field is mandatory if the value of the type field is OTHER. + * + * @return string + */ + public function getMethod() + { + return $this->method; + } + + + /** + * Optional note associated with the payment. + * + * @param string $note + */ + public function setNote($note) + { + $this->note = $note; + return $this; + } + + /** + * Optional note associated with the payment. + * + * @return string + */ + public function getNote() + { + return $this->note; + } } diff --git a/lib/PayPal/Api/InvoicingRefundDetail.php b/lib/PayPal/Api/InvoicingRefundDetail.php index e7859f01..2868efca 100644 --- a/lib/PayPal/Api/InvoicingRefundDetail.php +++ b/lib/PayPal/Api/InvoicingRefundDetail.php @@ -4,65 +4,72 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class InvoicingRefundDetail extends PPModel { - /** - * PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. - * - * @param string $type - */ - public function setType($type) { - $this->type = $type; - return $this; - } +class InvoicingRefundDetail extends PPModel +{ + /** + * PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. + * + * @param string $type + */ + public function setType($type) + { + $this->type = $type; + return $this; + } - /** - * PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. - * - * @return string - */ - public function getType() { - return $this->type; - } + /** + * PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. + * + * @return string + */ + public function getType() + { + return $this->type; + } - /** - * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. - * - * @param string $date - */ - public function setDate($date) { - $this->date = $date; - return $this; - } + /** + * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. + * + * @param string $date + */ + public function setDate($date) + { + $this->date = $date; + return $this; + } - /** - * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. - * - * @return string - */ - public function getDate() { - return $this->date; - } + /** + * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. + * + * @return string + */ + public function getDate() + { + return $this->date; + } - /** - * Optional note associated with the refund. - * - * @param string $note - */ - public function setNote($note) { - $this->note = $note; - return $this; - } + /** + * Optional note associated with the refund. + * + * @param string $note + */ + public function setNote($note) + { + $this->note = $note; + return $this; + } - /** - * Optional note associated with the refund. - * - * @return string - */ - public function getNote() { - return $this->note; - } + /** + * Optional note associated with the refund. + * + * @return string + */ + public function getNote() + { + return $this->note; + } } diff --git a/lib/PayPal/Api/InvoicingSearch.php b/lib/PayPal/Api/InvoicingSearch.php index caf01ed6..ce76e7bc 100644 --- a/lib/PayPal/Api/InvoicingSearch.php +++ b/lib/PayPal/Api/InvoicingSearch.php @@ -4,670 +4,754 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class InvoicingSearch extends PPModel { - /** - * Initial letters of the email address. - * - * @param string $email - */ - public function setEmail($email) { - $this->email = $email; - return $this; - } - - /** - * Initial letters of the email address. - * - * @return string - */ - public function getEmail() { - return $this->email; - } - - - /** - * Initial letters of the recipient's first name. - * - * @param string $recipient_first_name - */ - public function setRecipientFirstName($recipient_first_name) { - $this->recipient_first_name = $recipient_first_name; - return $this; - } - - /** - * Initial letters of the recipient's first name. - * - * @return string - */ - public function getRecipientFirstName() { - return $this->recipient_first_name; - } - - /** - * Initial letters of the recipient's first name. - * - * @param string $recipient_first_name - * @deprecated. Instead use setRecipientFirstName - */ - public function setRecipient_first_name($recipient_first_name) { - $this->recipient_first_name = $recipient_first_name; - return $this; - } - /** - * Initial letters of the recipient's first name. - * - * @return string - * @deprecated. Instead use getRecipientFirstName - */ - public function getRecipient_first_name() { - return $this->recipient_first_name; - } - - /** - * Initial letters of the recipient's last name. - * - * @param string $recipient_last_name - */ - public function setRecipientLastName($recipient_last_name) { - $this->recipient_last_name = $recipient_last_name; - return $this; - } - - /** - * Initial letters of the recipient's last name. - * - * @return string - */ - public function getRecipientLastName() { - return $this->recipient_last_name; - } - - /** - * Initial letters of the recipient's last name. - * - * @param string $recipient_last_name - * @deprecated. Instead use setRecipientLastName - */ - public function setRecipient_last_name($recipient_last_name) { - $this->recipient_last_name = $recipient_last_name; - return $this; - } - /** - * Initial letters of the recipient's last name. - * - * @return string - * @deprecated. Instead use getRecipientLastName - */ - public function getRecipient_last_name() { - return $this->recipient_last_name; - } - - /** - * Initial letters of the recipient's business name. - * - * @param string $recipient_business_name - */ - public function setRecipientBusinessName($recipient_business_name) { - $this->recipient_business_name = $recipient_business_name; - return $this; - } - - /** - * Initial letters of the recipient's business name. - * - * @return string - */ - public function getRecipientBusinessName() { - return $this->recipient_business_name; - } - - /** - * Initial letters of the recipient's business name. - * - * @param string $recipient_business_name - * @deprecated. Instead use setRecipientBusinessName - */ - public function setRecipient_business_name($recipient_business_name) { - $this->recipient_business_name = $recipient_business_name; - return $this; - } - /** - * Initial letters of the recipient's business name. - * - * @return string - * @deprecated. Instead use getRecipientBusinessName - */ - public function getRecipient_business_name() { - return $this->recipient_business_name; - } - - /** - * The invoice number that appears on the invoice. - * - * @param string $number - */ - public function setNumber($number) { - $this->number = $number; - return $this; - } - - /** - * The invoice number that appears on the invoice. - * - * @return string - */ - public function getNumber() { - return $this->number; - } - - - /** - * Status of the invoice. - * - * @param string $status - */ - public function setStatus($status) { - $this->status = $status; - return $this; - } - - /** - * Status of the invoice. - * - * @return string - */ - public function getStatus() { - return $this->status; - } - - - /** - * Lower limit of total amount. - * - * @param PayPal\Api\Currency $lower_total_amount - */ - public function setLowerTotalAmount($lower_total_amount) { - $this->lower_total_amount = $lower_total_amount; - return $this; - } - - /** - * Lower limit of total amount. - * - * @return PayPal\Api\Currency - */ - public function getLowerTotalAmount() { - return $this->lower_total_amount; - } - - /** - * Lower limit of total amount. - * - * @param PayPal\Api\Currency $lower_total_amount - * @deprecated. Instead use setLowerTotalAmount - */ - public function setLower_total_amount($lower_total_amount) { - $this->lower_total_amount = $lower_total_amount; - return $this; - } - /** - * Lower limit of total amount. - * - * @return PayPal\Api\Currency - * @deprecated. Instead use getLowerTotalAmount - */ - public function getLower_total_amount() { - return $this->lower_total_amount; - } - - /** - * Upper limit of total amount. - * - * @param PayPal\Api\Currency $upper_total_amount - */ - public function setUpperTotalAmount($upper_total_amount) { - $this->upper_total_amount = $upper_total_amount; - return $this; - } - - /** - * Upper limit of total amount. - * - * @return PayPal\Api\Currency - */ - public function getUpperTotalAmount() { - return $this->upper_total_amount; - } - - /** - * Upper limit of total amount. - * - * @param PayPal\Api\Currency $upper_total_amount - * @deprecated. Instead use setUpperTotalAmount - */ - public function setUpper_total_amount($upper_total_amount) { - $this->upper_total_amount = $upper_total_amount; - return $this; - } - /** - * Upper limit of total amount. - * - * @return PayPal\Api\Currency - * @deprecated. Instead use getUpperTotalAmount - */ - public function getUpper_total_amount() { - return $this->upper_total_amount; - } - - /** - * Start invoice date. - * - * @param string $start_invoice_date - */ - public function setStartInvoiceDate($start_invoice_date) { - $this->start_invoice_date = $start_invoice_date; - return $this; - } - - /** - * Start invoice date. - * - * @return string - */ - public function getStartInvoiceDate() { - return $this->start_invoice_date; - } - - /** - * Start invoice date. - * - * @param string $start_invoice_date - * @deprecated. Instead use setStartInvoiceDate - */ - public function setStart_invoice_date($start_invoice_date) { - $this->start_invoice_date = $start_invoice_date; - return $this; - } - /** - * Start invoice date. - * - * @return string - * @deprecated. Instead use getStartInvoiceDate - */ - public function getStart_invoice_date() { - return $this->start_invoice_date; - } - - /** - * End invoice date. - * - * @param string $end_invoice_date - */ - public function setEndInvoiceDate($end_invoice_date) { - $this->end_invoice_date = $end_invoice_date; - return $this; - } - - /** - * End invoice date. - * - * @return string - */ - public function getEndInvoiceDate() { - return $this->end_invoice_date; - } - - /** - * End invoice date. - * - * @param string $end_invoice_date - * @deprecated. Instead use setEndInvoiceDate - */ - public function setEnd_invoice_date($end_invoice_date) { - $this->end_invoice_date = $end_invoice_date; - return $this; - } - /** - * End invoice date. - * - * @return string - * @deprecated. Instead use getEndInvoiceDate - */ - public function getEnd_invoice_date() { - return $this->end_invoice_date; - } - - /** - * Start invoice due date. - * - * @param string $start_due_date - */ - public function setStartDueDate($start_due_date) { - $this->start_due_date = $start_due_date; - return $this; - } - - /** - * Start invoice due date. - * - * @return string - */ - public function getStartDueDate() { - return $this->start_due_date; - } - - /** - * Start invoice due date. - * - * @param string $start_due_date - * @deprecated. Instead use setStartDueDate - */ - public function setStart_due_date($start_due_date) { - $this->start_due_date = $start_due_date; - return $this; - } - /** - * Start invoice due date. - * - * @return string - * @deprecated. Instead use getStartDueDate - */ - public function getStart_due_date() { - return $this->start_due_date; - } - - /** - * End invoice due date. - * - * @param string $end_due_date - */ - public function setEndDueDate($end_due_date) { - $this->end_due_date = $end_due_date; - return $this; - } - - /** - * End invoice due date. - * - * @return string - */ - public function getEndDueDate() { - return $this->end_due_date; - } - - /** - * End invoice due date. - * - * @param string $end_due_date - * @deprecated. Instead use setEndDueDate - */ - public function setEnd_due_date($end_due_date) { - $this->end_due_date = $end_due_date; - return $this; - } - /** - * End invoice due date. - * - * @return string - * @deprecated. Instead use getEndDueDate - */ - public function getEnd_due_date() { - return $this->end_due_date; - } - - /** - * Start invoice payment date. - * - * @param string $start_payment_date - */ - public function setStartPaymentDate($start_payment_date) { - $this->start_payment_date = $start_payment_date; - return $this; - } - - /** - * Start invoice payment date. - * - * @return string - */ - public function getStartPaymentDate() { - return $this->start_payment_date; - } - - /** - * Start invoice payment date. - * - * @param string $start_payment_date - * @deprecated. Instead use setStartPaymentDate - */ - public function setStart_payment_date($start_payment_date) { - $this->start_payment_date = $start_payment_date; - return $this; - } - /** - * Start invoice payment date. - * - * @return string - * @deprecated. Instead use getStartPaymentDate - */ - public function getStart_payment_date() { - return $this->start_payment_date; - } - - /** - * End invoice payment date. - * - * @param string $end_payment_date - */ - public function setEndPaymentDate($end_payment_date) { - $this->end_payment_date = $end_payment_date; - return $this; - } - - /** - * End invoice payment date. - * - * @return string - */ - public function getEndPaymentDate() { - return $this->end_payment_date; - } - - /** - * End invoice payment date. - * - * @param string $end_payment_date - * @deprecated. Instead use setEndPaymentDate - */ - public function setEnd_payment_date($end_payment_date) { - $this->end_payment_date = $end_payment_date; - return $this; - } - /** - * End invoice payment date. - * - * @return string - * @deprecated. Instead use getEndPaymentDate - */ - public function getEnd_payment_date() { - return $this->end_payment_date; - } - - /** - * Start invoice creation date. - * - * @param string $start_creation_date - */ - public function setStartCreationDate($start_creation_date) { - $this->start_creation_date = $start_creation_date; - return $this; - } - - /** - * Start invoice creation date. - * - * @return string - */ - public function getStartCreationDate() { - return $this->start_creation_date; - } - - /** - * Start invoice creation date. - * - * @param string $start_creation_date - * @deprecated. Instead use setStartCreationDate - */ - public function setStart_creation_date($start_creation_date) { - $this->start_creation_date = $start_creation_date; - return $this; - } - /** - * Start invoice creation date. - * - * @return string - * @deprecated. Instead use getStartCreationDate - */ - public function getStart_creation_date() { - return $this->start_creation_date; - } - - /** - * End invoice creation date. - * - * @param string $end_creation_date - */ - public function setEndCreationDate($end_creation_date) { - $this->end_creation_date = $end_creation_date; - return $this; - } - - /** - * End invoice creation date. - * - * @return string - */ - public function getEndCreationDate() { - return $this->end_creation_date; - } - - /** - * End invoice creation date. - * - * @param string $end_creation_date - * @deprecated. Instead use setEndCreationDate - */ - public function setEnd_creation_date($end_creation_date) { - $this->end_creation_date = $end_creation_date; - return $this; - } - /** - * End invoice creation date. - * - * @return string - * @deprecated. Instead use getEndCreationDate - */ - public function getEnd_creation_date() { - return $this->end_creation_date; - } - - /** - * Offset of the search results. - * - * @param PayPal\Api\number $page - */ - public function setPage($page) { - $this->page = $page; - return $this; - } - - /** - * Offset of the search results. - * - * @return PayPal\Api\number - */ - public function getPage() { - return $this->page; - } - - - /** - * Page size of the search results. - * - * @param PayPal\Api\number $page_size - */ - public function setPageSize($page_size) { - $this->page_size = $page_size; - return $this; - } - - /** - * Page size of the search results. - * - * @return PayPal\Api\number - */ - public function getPageSize() { - return $this->page_size; - } - - /** - * Page size of the search results. - * - * @param PayPal\Api\number $page_size - * @deprecated. Instead use setPageSize - */ - public function setPage_size($page_size) { - $this->page_size = $page_size; - return $this; - } - /** - * Page size of the search results. - * - * @return PayPal\Api\number - * @deprecated. Instead use getPageSize - */ - public function getPage_size() { - return $this->page_size; - } - - /** - * A flag indicating whether total count is required in the response. - * - * @param boolean $total_count_required - */ - public function setTotalCountRequired($total_count_required) { - $this->total_count_required = $total_count_required; - return $this; - } - - /** - * A flag indicating whether total count is required in the response. - * - * @return boolean - */ - public function getTotalCountRequired() { - return $this->total_count_required; - } - - /** - * A flag indicating whether total count is required in the response. - * - * @param boolean $total_count_required - * @deprecated. Instead use setTotalCountRequired - */ - public function setTotal_count_required($total_count_required) { - $this->total_count_required = $total_count_required; - return $this; - } - /** - * A flag indicating whether total count is required in the response. - * - * @return boolean - * @deprecated. Instead use getTotalCountRequired - */ - public function getTotal_count_required() { - return $this->total_count_required; - } +class InvoicingSearch extends PPModel +{ + /** + * Initial letters of the email address. + * + * @param string $email + */ + public function setEmail($email) + { + $this->email = $email; + return $this; + } + + /** + * Initial letters of the email address. + * + * @return string + */ + public function getEmail() + { + return $this->email; + } + + + /** + * Initial letters of the recipient's first name. + * + * @param string $recipient_first_name + */ + public function setRecipientFirstName($recipient_first_name) + { + $this->recipient_first_name = $recipient_first_name; + return $this; + } + + /** + * Initial letters of the recipient's first name. + * + * @return string + */ + public function getRecipientFirstName() + { + return $this->recipient_first_name; + } + + /** + * Initial letters of the recipient's first name. + * + * @param string $recipient_first_name + * @deprecated. Instead use setRecipientFirstName + */ + public function setRecipient_first_name($recipient_first_name) + { + $this->recipient_first_name = $recipient_first_name; + return $this; + } + + /** + * Initial letters of the recipient's first name. + * + * @return string + * @deprecated. Instead use getRecipientFirstName + */ + public function getRecipient_first_name() + { + return $this->recipient_first_name; + } + + /** + * Initial letters of the recipient's last name. + * + * @param string $recipient_last_name + */ + public function setRecipientLastName($recipient_last_name) + { + $this->recipient_last_name = $recipient_last_name; + return $this; + } + + /** + * Initial letters of the recipient's last name. + * + * @return string + */ + public function getRecipientLastName() + { + return $this->recipient_last_name; + } + + /** + * Initial letters of the recipient's last name. + * + * @param string $recipient_last_name + * @deprecated. Instead use setRecipientLastName + */ + public function setRecipient_last_name($recipient_last_name) + { + $this->recipient_last_name = $recipient_last_name; + return $this; + } + + /** + * Initial letters of the recipient's last name. + * + * @return string + * @deprecated. Instead use getRecipientLastName + */ + public function getRecipient_last_name() + { + return $this->recipient_last_name; + } + + /** + * Initial letters of the recipient's business name. + * + * @param string $recipient_business_name + */ + public function setRecipientBusinessName($recipient_business_name) + { + $this->recipient_business_name = $recipient_business_name; + return $this; + } + + /** + * Initial letters of the recipient's business name. + * + * @return string + */ + public function getRecipientBusinessName() + { + return $this->recipient_business_name; + } + + /** + * Initial letters of the recipient's business name. + * + * @param string $recipient_business_name + * @deprecated. Instead use setRecipientBusinessName + */ + public function setRecipient_business_name($recipient_business_name) + { + $this->recipient_business_name = $recipient_business_name; + return $this; + } + + /** + * Initial letters of the recipient's business name. + * + * @return string + * @deprecated. Instead use getRecipientBusinessName + */ + public function getRecipient_business_name() + { + return $this->recipient_business_name; + } + + /** + * The invoice number that appears on the invoice. + * + * @param string $number + */ + public function setNumber($number) + { + $this->number = $number; + return $this; + } + + /** + * The invoice number that appears on the invoice. + * + * @return string + */ + public function getNumber() + { + return $this->number; + } + + + /** + * Status of the invoice. + * + * @param string $status + */ + public function setStatus($status) + { + $this->status = $status; + return $this; + } + + /** + * Status of the invoice. + * + * @return string + */ + public function getStatus() + { + return $this->status; + } + + + /** + * Lower limit of total amount. + * + * @param PayPal\Api\Currency $lower_total_amount + */ + public function setLowerTotalAmount($lower_total_amount) + { + $this->lower_total_amount = $lower_total_amount; + return $this; + } + + /** + * Lower limit of total amount. + * + * @return PayPal\Api\Currency + */ + public function getLowerTotalAmount() + { + return $this->lower_total_amount; + } + + /** + * Lower limit of total amount. + * + * @param PayPal\Api\Currency $lower_total_amount + * @deprecated. Instead use setLowerTotalAmount + */ + public function setLower_total_amount($lower_total_amount) + { + $this->lower_total_amount = $lower_total_amount; + return $this; + } + + /** + * Lower limit of total amount. + * + * @return PayPal\Api\Currency + * @deprecated. Instead use getLowerTotalAmount + */ + public function getLower_total_amount() + { + return $this->lower_total_amount; + } + + /** + * Upper limit of total amount. + * + * @param PayPal\Api\Currency $upper_total_amount + */ + public function setUpperTotalAmount($upper_total_amount) + { + $this->upper_total_amount = $upper_total_amount; + return $this; + } + + /** + * Upper limit of total amount. + * + * @return PayPal\Api\Currency + */ + public function getUpperTotalAmount() + { + return $this->upper_total_amount; + } + + /** + * Upper limit of total amount. + * + * @param PayPal\Api\Currency $upper_total_amount + * @deprecated. Instead use setUpperTotalAmount + */ + public function setUpper_total_amount($upper_total_amount) + { + $this->upper_total_amount = $upper_total_amount; + return $this; + } + + /** + * Upper limit of total amount. + * + * @return PayPal\Api\Currency + * @deprecated. Instead use getUpperTotalAmount + */ + public function getUpper_total_amount() + { + return $this->upper_total_amount; + } + + /** + * Start invoice date. + * + * @param string $start_invoice_date + */ + public function setStartInvoiceDate($start_invoice_date) + { + $this->start_invoice_date = $start_invoice_date; + return $this; + } + + /** + * Start invoice date. + * + * @return string + */ + public function getStartInvoiceDate() + { + return $this->start_invoice_date; + } + + /** + * Start invoice date. + * + * @param string $start_invoice_date + * @deprecated. Instead use setStartInvoiceDate + */ + public function setStart_invoice_date($start_invoice_date) + { + $this->start_invoice_date = $start_invoice_date; + return $this; + } + + /** + * Start invoice date. + * + * @return string + * @deprecated. Instead use getStartInvoiceDate + */ + public function getStart_invoice_date() + { + return $this->start_invoice_date; + } + + /** + * End invoice date. + * + * @param string $end_invoice_date + */ + public function setEndInvoiceDate($end_invoice_date) + { + $this->end_invoice_date = $end_invoice_date; + return $this; + } + + /** + * End invoice date. + * + * @return string + */ + public function getEndInvoiceDate() + { + return $this->end_invoice_date; + } + + /** + * End invoice date. + * + * @param string $end_invoice_date + * @deprecated. Instead use setEndInvoiceDate + */ + public function setEnd_invoice_date($end_invoice_date) + { + $this->end_invoice_date = $end_invoice_date; + return $this; + } + + /** + * End invoice date. + * + * @return string + * @deprecated. Instead use getEndInvoiceDate + */ + public function getEnd_invoice_date() + { + return $this->end_invoice_date; + } + + /** + * Start invoice due date. + * + * @param string $start_due_date + */ + public function setStartDueDate($start_due_date) + { + $this->start_due_date = $start_due_date; + return $this; + } + + /** + * Start invoice due date. + * + * @return string + */ + public function getStartDueDate() + { + return $this->start_due_date; + } + + /** + * Start invoice due date. + * + * @param string $start_due_date + * @deprecated. Instead use setStartDueDate + */ + public function setStart_due_date($start_due_date) + { + $this->start_due_date = $start_due_date; + return $this; + } + + /** + * Start invoice due date. + * + * @return string + * @deprecated. Instead use getStartDueDate + */ + public function getStart_due_date() + { + return $this->start_due_date; + } + + /** + * End invoice due date. + * + * @param string $end_due_date + */ + public function setEndDueDate($end_due_date) + { + $this->end_due_date = $end_due_date; + return $this; + } + + /** + * End invoice due date. + * + * @return string + */ + public function getEndDueDate() + { + return $this->end_due_date; + } + + /** + * End invoice due date. + * + * @param string $end_due_date + * @deprecated. Instead use setEndDueDate + */ + public function setEnd_due_date($end_due_date) + { + $this->end_due_date = $end_due_date; + return $this; + } + + /** + * End invoice due date. + * + * @return string + * @deprecated. Instead use getEndDueDate + */ + public function getEnd_due_date() + { + return $this->end_due_date; + } + + /** + * Start invoice payment date. + * + * @param string $start_payment_date + */ + public function setStartPaymentDate($start_payment_date) + { + $this->start_payment_date = $start_payment_date; + return $this; + } + + /** + * Start invoice payment date. + * + * @return string + */ + public function getStartPaymentDate() + { + return $this->start_payment_date; + } + + /** + * Start invoice payment date. + * + * @param string $start_payment_date + * @deprecated. Instead use setStartPaymentDate + */ + public function setStart_payment_date($start_payment_date) + { + $this->start_payment_date = $start_payment_date; + return $this; + } + + /** + * Start invoice payment date. + * + * @return string + * @deprecated. Instead use getStartPaymentDate + */ + public function getStart_payment_date() + { + return $this->start_payment_date; + } + + /** + * End invoice payment date. + * + * @param string $end_payment_date + */ + public function setEndPaymentDate($end_payment_date) + { + $this->end_payment_date = $end_payment_date; + return $this; + } + + /** + * End invoice payment date. + * + * @return string + */ + public function getEndPaymentDate() + { + return $this->end_payment_date; + } + + /** + * End invoice payment date. + * + * @param string $end_payment_date + * @deprecated. Instead use setEndPaymentDate + */ + public function setEnd_payment_date($end_payment_date) + { + $this->end_payment_date = $end_payment_date; + return $this; + } + + /** + * End invoice payment date. + * + * @return string + * @deprecated. Instead use getEndPaymentDate + */ + public function getEnd_payment_date() + { + return $this->end_payment_date; + } + + /** + * Start invoice creation date. + * + * @param string $start_creation_date + */ + public function setStartCreationDate($start_creation_date) + { + $this->start_creation_date = $start_creation_date; + return $this; + } + + /** + * Start invoice creation date. + * + * @return string + */ + public function getStartCreationDate() + { + return $this->start_creation_date; + } + + /** + * Start invoice creation date. + * + * @param string $start_creation_date + * @deprecated. Instead use setStartCreationDate + */ + public function setStart_creation_date($start_creation_date) + { + $this->start_creation_date = $start_creation_date; + return $this; + } + + /** + * Start invoice creation date. + * + * @return string + * @deprecated. Instead use getStartCreationDate + */ + public function getStart_creation_date() + { + return $this->start_creation_date; + } + + /** + * End invoice creation date. + * + * @param string $end_creation_date + */ + public function setEndCreationDate($end_creation_date) + { + $this->end_creation_date = $end_creation_date; + return $this; + } + + /** + * End invoice creation date. + * + * @return string + */ + public function getEndCreationDate() + { + return $this->end_creation_date; + } + + /** + * End invoice creation date. + * + * @param string $end_creation_date + * @deprecated. Instead use setEndCreationDate + */ + public function setEnd_creation_date($end_creation_date) + { + $this->end_creation_date = $end_creation_date; + return $this; + } + + /** + * End invoice creation date. + * + * @return string + * @deprecated. Instead use getEndCreationDate + */ + public function getEnd_creation_date() + { + return $this->end_creation_date; + } + + /** + * Offset of the search results. + * + * @param PayPal\Api\number $page + */ + public function setPage($page) + { + $this->page = $page; + return $this; + } + + /** + * Offset of the search results. + * + * @return PayPal\Api\number + */ + public function getPage() + { + return $this->page; + } + + + /** + * Page size of the search results. + * + * @param PayPal\Api\number $page_size + */ + public function setPageSize($page_size) + { + $this->page_size = $page_size; + return $this; + } + + /** + * Page size of the search results. + * + * @return PayPal\Api\number + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size of the search results. + * + * @param PayPal\Api\number $page_size + * @deprecated. Instead use setPageSize + */ + public function setPage_size($page_size) + { + $this->page_size = $page_size; + return $this; + } + + /** + * Page size of the search results. + * + * @return PayPal\Api\number + * @deprecated. Instead use getPageSize + */ + public function getPage_size() + { + return $this->page_size; + } + + /** + * A flag indicating whether total count is required in the response. + * + * @param boolean $total_count_required + */ + public function setTotalCountRequired($total_count_required) + { + $this->total_count_required = $total_count_required; + return $this; + } + + /** + * A flag indicating whether total count is required in the response. + * + * @return boolean + */ + public function getTotalCountRequired() + { + return $this->total_count_required; + } + + /** + * A flag indicating whether total count is required in the response. + * + * @param boolean $total_count_required + * @deprecated. Instead use setTotalCountRequired + */ + public function setTotal_count_required($total_count_required) + { + $this->total_count_required = $total_count_required; + return $this; + } + + /** + * A flag indicating whether total count is required in the response. + * + * @return boolean + * @deprecated. Instead use getTotalCountRequired + */ + public function getTotal_count_required() + { + return $this->total_count_required; + } } diff --git a/lib/PayPal/Api/Item.php b/lib/PayPal/Api/Item.php index b50803ef..62055d0f 100644 --- a/lib/PayPal/Api/Item.php +++ b/lib/PayPal/Api/Item.php @@ -156,7 +156,8 @@ public function getSku() * * @return $this */ - public function setDescription($description) { + public function setDescription($description) + { $this->description = $description; return $this; @@ -168,7 +169,8 @@ public function setDescription($description) { * * @return string */ - public function getDescription() { + public function getDescription() + { return $this->description; } @@ -180,7 +182,8 @@ public function getDescription() { * * @return $this */ - public function setTax($tax) { + public function setTax($tax) + { $this->tax = $tax; return $this; @@ -192,7 +195,8 @@ public function setTax($tax) { * * @return string */ - public function getTax() { + public function getTax() + { return $this->tax; } } diff --git a/lib/PayPal/Api/ItemList.php b/lib/PayPal/Api/ItemList.php index 6f949013..725de606 100644 --- a/lib/PayPal/Api/ItemList.php +++ b/lib/PayPal/Api/ItemList.php @@ -17,14 +17,16 @@ class ItemList extends PPModel /** * Construct an empty list. */ - function __construct() { + function __construct() + { $this->items = array(); } - /** + /** * Is this list empty? */ - public function isEmpty() { + public function isEmpty() + { return empty($this->items); } @@ -67,26 +69,30 @@ public function setShippingAddress($shipping_address) return $this; } - /** - * Append an item to the list. - * @return PayPal\Api\Item - */ - public function addItem($item) { - return $this->setItems( - array_merge($this->items, array($item)) - ); - } + /** + * Append an item to the list. + * + * @return PayPal\Api\Item + */ + public function addItem($item) + { + return $this->setItems( + array_merge($this->items, array($item)) + ); + } - /** - * Remove an item from the list. - * Items are compared using === comparision (PHP.net) - * @return PayPal\Api\Item - */ - public function removeItem($item) { - return $this->setItems( - array_diff($this->items, array($item)) - ); - } + /** + * Remove an item from the list. + * Items are compared using === comparision (PHP.net) + * + * @return PayPal\Api\Item + */ + public function removeItem($item) + { + return $this->setItems( + array_diff($this->items, array($item)) + ); + } /** * Get Shipping Address diff --git a/lib/PayPal/Api/MerchantInfo.php b/lib/PayPal/Api/MerchantInfo.php index e7c8d6a3..41bd0ccb 100644 --- a/lib/PayPal/Api/MerchantInfo.php +++ b/lib/PayPal/Api/MerchantInfo.php @@ -4,300 +4,336 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class MerchantInfo extends PPModel { - /** - * Email address of the merchant. 260 characters max. - * - * @param string $email - */ - public function setEmail($email) { - $this->email = $email; - return $this; - } - - /** - * Email address of the merchant. 260 characters max. - * - * @return string - */ - public function getEmail() { - return $this->email; - } - - - /** - * First name of the merchant. 30 characters max. - * - * @param string $first_name - */ - public function setFirstName($first_name) { - $this->first_name = $first_name; - return $this; - } - - /** - * First name of the merchant. 30 characters max. - * - * @return string - */ - public function getFirstName() { - return $this->first_name; - } - - /** - * First name of the merchant. 30 characters max. - * - * @param string $first_name - * @deprecated. Instead use setFirstName - */ - public function setFirst_name($first_name) { - $this->first_name = $first_name; - return $this; - } - /** - * First name of the merchant. 30 characters max. - * - * @return string - * @deprecated. Instead use getFirstName - */ - public function getFirst_name() { - return $this->first_name; - } - - /** - * Last name of the merchant. 30 characters max. - * - * @param string $last_name - */ - public function setLastName($last_name) { - $this->last_name = $last_name; - return $this; - } - - /** - * Last name of the merchant. 30 characters max. - * - * @return string - */ - public function getLastName() { - return $this->last_name; - } - - /** - * Last name of the merchant. 30 characters max. - * - * @param string $last_name - * @deprecated. Instead use setLastName - */ - public function setLast_name($last_name) { - $this->last_name = $last_name; - return $this; - } - /** - * Last name of the merchant. 30 characters max. - * - * @return string - * @deprecated. Instead use getLastName - */ - public function getLast_name() { - return $this->last_name; - } - - /** - * Address of the merchant. - * - * @param PayPal\Api\Address $address - */ - public function setAddress($address) { - $this->address = $address; - return $this; - } - - /** - * Address of the merchant. - * - * @return PayPal\Api\Address - */ - public function getAddress() { - return $this->address; - } - - - /** - * Company business name of the merchant. 100 characters max. - * - * @param string $business_name - */ - public function setBusinessName($business_name) { - $this->business_name = $business_name; - return $this; - } - - /** - * Company business name of the merchant. 100 characters max. - * - * @return string - */ - public function getBusinessName() { - return $this->business_name; - } - - /** - * Company business name of the merchant. 100 characters max. - * - * @param string $business_name - * @deprecated. Instead use setBusinessName - */ - public function setBusiness_name($business_name) { - $this->business_name = $business_name; - return $this; - } - /** - * Company business name of the merchant. 100 characters max. - * - * @return string - * @deprecated. Instead use getBusinessName - */ - public function getBusiness_name() { - return $this->business_name; - } - - /** - * Phone number of the merchant. - * - * @param PayPal\Api\Phone $phone - */ - public function setPhone($phone) { - $this->phone = $phone; - return $this; - } - - /** - * Phone number of the merchant. - * - * @return PayPal\Api\Phone - */ - public function getPhone() { - return $this->phone; - } - - - /** - * Fax number of the merchant. - * - * @param PayPal\Api\Phone $fax - */ - public function setFax($fax) { - $this->fax = $fax; - return $this; - } - - /** - * Fax number of the merchant. - * - * @return PayPal\Api\Phone - */ - public function getFax() { - return $this->fax; - } - - - /** - * Website of the merchant. 2048 characters max. - * - * @param string $website - */ - public function setWebsite($website) { - $this->website = $website; - return $this; - } - - /** - * Website of the merchant. 2048 characters max. - * - * @return string - */ - public function getWebsite() { - return $this->website; - } - - - /** - * Tax ID of the merchant. 100 characters max. - * - * @param string $tax_id - */ - public function setTaxId($tax_id) { - $this->tax_id = $tax_id; - return $this; - } - - /** - * Tax ID of the merchant. 100 characters max. - * - * @return string - */ - public function getTaxId() { - return $this->tax_id; - } - - /** - * Tax ID of the merchant. 100 characters max. - * - * @param string $tax_id - * @deprecated. Instead use setTaxId - */ - public function setTax_id($tax_id) { - $this->tax_id = $tax_id; - return $this; - } - /** - * Tax ID of the merchant. 100 characters max. - * - * @return string - * @deprecated. Instead use getTaxId - */ - public function getTax_id() { - return $this->tax_id; - } - - /** - * Option to display additional information such as business hours. 40 characters max. - * - * @param string $additional_info - */ - public function setAdditionalInfo($additional_info) { - $this->additional_info = $additional_info; - return $this; - } - - /** - * Option to display additional information such as business hours. 40 characters max. - * - * @return string - */ - public function getAdditionalInfo() { - return $this->additional_info; - } - - /** - * Option to display additional information such as business hours. 40 characters max. - * - * @param string $additional_info - * @deprecated. Instead use setAdditionalInfo - */ - public function setAdditional_info($additional_info) { - $this->additional_info = $additional_info; - return $this; - } - /** - * Option to display additional information such as business hours. 40 characters max. - * - * @return string - * @deprecated. Instead use getAdditionalInfo - */ - public function getAdditional_info() { - return $this->additional_info; - } +class MerchantInfo extends PPModel +{ + /** + * Email address of the merchant. 260 characters max. + * + * @param string $email + */ + public function setEmail($email) + { + $this->email = $email; + return $this; + } + + /** + * Email address of the merchant. 260 characters max. + * + * @return string + */ + public function getEmail() + { + return $this->email; + } + + + /** + * First name of the merchant. 30 characters max. + * + * @param string $first_name + */ + public function setFirstName($first_name) + { + $this->first_name = $first_name; + return $this; + } + + /** + * First name of the merchant. 30 characters max. + * + * @return string + */ + public function getFirstName() + { + return $this->first_name; + } + + /** + * First name of the merchant. 30 characters max. + * + * @param string $first_name + * @deprecated. Instead use setFirstName + */ + public function setFirst_name($first_name) + { + $this->first_name = $first_name; + return $this; + } + + /** + * First name of the merchant. 30 characters max. + * + * @return string + * @deprecated. Instead use getFirstName + */ + public function getFirst_name() + { + return $this->first_name; + } + + /** + * Last name of the merchant. 30 characters max. + * + * @param string $last_name + */ + public function setLastName($last_name) + { + $this->last_name = $last_name; + return $this; + } + + /** + * Last name of the merchant. 30 characters max. + * + * @return string + */ + public function getLastName() + { + return $this->last_name; + } + + /** + * Last name of the merchant. 30 characters max. + * + * @param string $last_name + * @deprecated. Instead use setLastName + */ + public function setLast_name($last_name) + { + $this->last_name = $last_name; + return $this; + } + + /** + * Last name of the merchant. 30 characters max. + * + * @return string + * @deprecated. Instead use getLastName + */ + public function getLast_name() + { + return $this->last_name; + } + + /** + * Address of the merchant. + * + * @param PayPal\Api\Address $address + */ + public function setAddress($address) + { + $this->address = $address; + return $this; + } + + /** + * Address of the merchant. + * + * @return PayPal\Api\Address + */ + public function getAddress() + { + return $this->address; + } + + + /** + * Company business name of the merchant. 100 characters max. + * + * @param string $business_name + */ + public function setBusinessName($business_name) + { + $this->business_name = $business_name; + return $this; + } + + /** + * Company business name of the merchant. 100 characters max. + * + * @return string + */ + public function getBusinessName() + { + return $this->business_name; + } + + /** + * Company business name of the merchant. 100 characters max. + * + * @param string $business_name + * @deprecated. Instead use setBusinessName + */ + public function setBusiness_name($business_name) + { + $this->business_name = $business_name; + return $this; + } + + /** + * Company business name of the merchant. 100 characters max. + * + * @return string + * @deprecated. Instead use getBusinessName + */ + public function getBusiness_name() + { + return $this->business_name; + } + + /** + * Phone number of the merchant. + * + * @param PayPal\Api\Phone $phone + */ + public function setPhone($phone) + { + $this->phone = $phone; + return $this; + } + + /** + * Phone number of the merchant. + * + * @return PayPal\Api\Phone + */ + public function getPhone() + { + return $this->phone; + } + + + /** + * Fax number of the merchant. + * + * @param PayPal\Api\Phone $fax + */ + public function setFax($fax) + { + $this->fax = $fax; + return $this; + } + + /** + * Fax number of the merchant. + * + * @return PayPal\Api\Phone + */ + public function getFax() + { + return $this->fax; + } + + + /** + * Website of the merchant. 2048 characters max. + * + * @param string $website + */ + public function setWebsite($website) + { + $this->website = $website; + return $this; + } + + /** + * Website of the merchant. 2048 characters max. + * + * @return string + */ + public function getWebsite() + { + return $this->website; + } + + + /** + * Tax ID of the merchant. 100 characters max. + * + * @param string $tax_id + */ + public function setTaxId($tax_id) + { + $this->tax_id = $tax_id; + return $this; + } + + /** + * Tax ID of the merchant. 100 characters max. + * + * @return string + */ + public function getTaxId() + { + return $this->tax_id; + } + + /** + * Tax ID of the merchant. 100 characters max. + * + * @param string $tax_id + * @deprecated. Instead use setTaxId + */ + public function setTax_id($tax_id) + { + $this->tax_id = $tax_id; + return $this; + } + + /** + * Tax ID of the merchant. 100 characters max. + * + * @return string + * @deprecated. Instead use getTaxId + */ + public function getTax_id() + { + return $this->tax_id; + } + + /** + * Option to display additional information such as business hours. 40 characters max. + * + * @param string $additional_info + */ + public function setAdditionalInfo($additional_info) + { + $this->additional_info = $additional_info; + return $this; + } + + /** + * Option to display additional information such as business hours. 40 characters max. + * + * @return string + */ + public function getAdditionalInfo() + { + return $this->additional_info; + } + + /** + * Option to display additional information such as business hours. 40 characters max. + * + * @param string $additional_info + * @deprecated. Instead use setAdditionalInfo + */ + public function setAdditional_info($additional_info) + { + $this->additional_info = $additional_info; + return $this; + } + + /** + * Option to display additional information such as business hours. 40 characters max. + * + * @return string + * @deprecated. Instead use getAdditionalInfo + */ + public function getAdditional_info() + { + return $this->additional_info; + } } diff --git a/lib/PayPal/Api/Metadata.php b/lib/PayPal/Api/Metadata.php index 30383ad0..baf6e32c 100644 --- a/lib/PayPal/Api/Metadata.php +++ b/lib/PayPal/Api/Metadata.php @@ -4,356 +4,402 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class Metadata extends PPModel { - /** - * Date when the resource was created. - * - * @param string $created_date - */ - public function setCreatedDate($created_date) { - $this->created_date = $created_date; - return $this; - } - - /** - * Date when the resource was created. - * - * @return string - */ - public function getCreatedDate() { - return $this->created_date; - } - - /** - * Date when the resource was created. - * - * @param string $created_date - * @deprecated. Instead use setCreatedDate - */ - public function setCreated_date($created_date) { - $this->created_date = $created_date; - return $this; - } - /** - * Date when the resource was created. - * - * @return string - * @deprecated. Instead use getCreatedDate - */ - public function getCreated_date() { - return $this->created_date; - } - - /** - * Email address of the account that created the resource. - * - * @param string $created_by - */ - public function setCreatedBy($created_by) { - $this->created_by = $created_by; - return $this; - } - - /** - * Email address of the account that created the resource. - * - * @return string - */ - public function getCreatedBy() { - return $this->created_by; - } - - /** - * Email address of the account that created the resource. - * - * @param string $created_by - * @deprecated. Instead use setCreatedBy - */ - public function setCreated_by($created_by) { - $this->created_by = $created_by; - return $this; - } - /** - * Email address of the account that created the resource. - * - * @return string - * @deprecated. Instead use getCreatedBy - */ - public function getCreated_by() { - return $this->created_by; - } - - /** - * Date when the resource was cancelled. - * - * @param string $cancelled_date - */ - public function setCancelledDate($cancelled_date) { - $this->cancelled_date = $cancelled_date; - return $this; - } - - /** - * Date when the resource was cancelled. - * - * @return string - */ - public function getCancelledDate() { - return $this->cancelled_date; - } - - /** - * Date when the resource was cancelled. - * - * @param string $cancelled_date - * @deprecated. Instead use setCancelledDate - */ - public function setCancelled_date($cancelled_date) { - $this->cancelled_date = $cancelled_date; - return $this; - } - /** - * Date when the resource was cancelled. - * - * @return string - * @deprecated. Instead use getCancelledDate - */ - public function getCancelled_date() { - return $this->cancelled_date; - } - - /** - * Actor who cancelled the resource. - * - * @param string $cancelled_by - */ - public function setCancelledBy($cancelled_by) { - $this->cancelled_by = $cancelled_by; - return $this; - } - - /** - * Actor who cancelled the resource. - * - * @return string - */ - public function getCancelledBy() { - return $this->cancelled_by; - } - - /** - * Actor who cancelled the resource. - * - * @param string $cancelled_by - * @deprecated. Instead use setCancelledBy - */ - public function setCancelled_by($cancelled_by) { - $this->cancelled_by = $cancelled_by; - return $this; - } - /** - * Actor who cancelled the resource. - * - * @return string - * @deprecated. Instead use getCancelledBy - */ - public function getCancelled_by() { - return $this->cancelled_by; - } - - /** - * Date when the resource was last edited. - * - * @param string $last_updated_date - */ - public function setLastUpdatedDate($last_updated_date) { - $this->last_updated_date = $last_updated_date; - return $this; - } - - /** - * Date when the resource was last edited. - * - * @return string - */ - public function getLastUpdatedDate() { - return $this->last_updated_date; - } - - /** - * Date when the resource was last edited. - * - * @param string $last_updated_date - * @deprecated. Instead use setLastUpdatedDate - */ - public function setLast_updated_date($last_updated_date) { - $this->last_updated_date = $last_updated_date; - return $this; - } - /** - * Date when the resource was last edited. - * - * @return string - * @deprecated. Instead use getLastUpdatedDate - */ - public function getLast_updated_date() { - return $this->last_updated_date; - } - - /** - * Email address of the account that last edited the resource. - * - * @param string $last_updated_by - */ - public function setLastUpdatedBy($last_updated_by) { - $this->last_updated_by = $last_updated_by; - return $this; - } - - /** - * Email address of the account that last edited the resource. - * - * @return string - */ - public function getLastUpdatedBy() { - return $this->last_updated_by; - } - - /** - * Email address of the account that last edited the resource. - * - * @param string $last_updated_by - * @deprecated. Instead use setLastUpdatedBy - */ - public function setLast_updated_by($last_updated_by) { - $this->last_updated_by = $last_updated_by; - return $this; - } - /** - * Email address of the account that last edited the resource. - * - * @return string - * @deprecated. Instead use getLastUpdatedBy - */ - public function getLast_updated_by() { - return $this->last_updated_by; - } - - /** - * Date when the resource was first sent. - * - * @param string $first_sent_date - */ - public function setFirstSentDate($first_sent_date) { - $this->first_sent_date = $first_sent_date; - return $this; - } - - /** - * Date when the resource was first sent. - * - * @return string - */ - public function getFirstSentDate() { - return $this->first_sent_date; - } - - /** - * Date when the resource was first sent. - * - * @param string $first_sent_date - * @deprecated. Instead use setFirstSentDate - */ - public function setFirst_sent_date($first_sent_date) { - $this->first_sent_date = $first_sent_date; - return $this; - } - /** - * Date when the resource was first sent. - * - * @return string - * @deprecated. Instead use getFirstSentDate - */ - public function getFirst_sent_date() { - return $this->first_sent_date; - } - - /** - * Date when the resource was last sent. - * - * @param string $last_sent_date - */ - public function setLastSentDate($last_sent_date) { - $this->last_sent_date = $last_sent_date; - return $this; - } - - /** - * Date when the resource was last sent. - * - * @return string - */ - public function getLastSentDate() { - return $this->last_sent_date; - } - - /** - * Date when the resource was last sent. - * - * @param string $last_sent_date - * @deprecated. Instead use setLastSentDate - */ - public function setLast_sent_date($last_sent_date) { - $this->last_sent_date = $last_sent_date; - return $this; - } - /** - * Date when the resource was last sent. - * - * @return string - * @deprecated. Instead use getLastSentDate - */ - public function getLast_sent_date() { - return $this->last_sent_date; - } - - /** - * Email address of the account that last sent the resource. - * - * @param string $last_sent_by - */ - public function setLastSentBy($last_sent_by) { - $this->last_sent_by = $last_sent_by; - return $this; - } - - /** - * Email address of the account that last sent the resource. - * - * @return string - */ - public function getLastSentBy() { - return $this->last_sent_by; - } - - /** - * Email address of the account that last sent the resource. - * - * @param string $last_sent_by - * @deprecated. Instead use setLastSentBy - */ - public function setLast_sent_by($last_sent_by) { - $this->last_sent_by = $last_sent_by; - return $this; - } - /** - * Email address of the account that last sent the resource. - * - * @return string - * @deprecated. Instead use getLastSentBy - */ - public function getLast_sent_by() { - return $this->last_sent_by; - } +class Metadata extends PPModel +{ + /** + * Date when the resource was created. + * + * @param string $created_date + */ + public function setCreatedDate($created_date) + { + $this->created_date = $created_date; + return $this; + } + + /** + * Date when the resource was created. + * + * @return string + */ + public function getCreatedDate() + { + return $this->created_date; + } + + /** + * Date when the resource was created. + * + * @param string $created_date + * @deprecated. Instead use setCreatedDate + */ + public function setCreated_date($created_date) + { + $this->created_date = $created_date; + return $this; + } + + /** + * Date when the resource was created. + * + * @return string + * @deprecated. Instead use getCreatedDate + */ + public function getCreated_date() + { + return $this->created_date; + } + + /** + * Email address of the account that created the resource. + * + * @param string $created_by + */ + public function setCreatedBy($created_by) + { + $this->created_by = $created_by; + return $this; + } + + /** + * Email address of the account that created the resource. + * + * @return string + */ + public function getCreatedBy() + { + return $this->created_by; + } + + /** + * Email address of the account that created the resource. + * + * @param string $created_by + * @deprecated. Instead use setCreatedBy + */ + public function setCreated_by($created_by) + { + $this->created_by = $created_by; + return $this; + } + + /** + * Email address of the account that created the resource. + * + * @return string + * @deprecated. Instead use getCreatedBy + */ + public function getCreated_by() + { + return $this->created_by; + } + + /** + * Date when the resource was cancelled. + * + * @param string $cancelled_date + */ + public function setCancelledDate($cancelled_date) + { + $this->cancelled_date = $cancelled_date; + return $this; + } + + /** + * Date when the resource was cancelled. + * + * @return string + */ + public function getCancelledDate() + { + return $this->cancelled_date; + } + + /** + * Date when the resource was cancelled. + * + * @param string $cancelled_date + * @deprecated. Instead use setCancelledDate + */ + public function setCancelled_date($cancelled_date) + { + $this->cancelled_date = $cancelled_date; + return $this; + } + + /** + * Date when the resource was cancelled. + * + * @return string + * @deprecated. Instead use getCancelledDate + */ + public function getCancelled_date() + { + return $this->cancelled_date; + } + + /** + * Actor who cancelled the resource. + * + * @param string $cancelled_by + */ + public function setCancelledBy($cancelled_by) + { + $this->cancelled_by = $cancelled_by; + return $this; + } + + /** + * Actor who cancelled the resource. + * + * @return string + */ + public function getCancelledBy() + { + return $this->cancelled_by; + } + + /** + * Actor who cancelled the resource. + * + * @param string $cancelled_by + * @deprecated. Instead use setCancelledBy + */ + public function setCancelled_by($cancelled_by) + { + $this->cancelled_by = $cancelled_by; + return $this; + } + + /** + * Actor who cancelled the resource. + * + * @return string + * @deprecated. Instead use getCancelledBy + */ + public function getCancelled_by() + { + return $this->cancelled_by; + } + + /** + * Date when the resource was last edited. + * + * @param string $last_updated_date + */ + public function setLastUpdatedDate($last_updated_date) + { + $this->last_updated_date = $last_updated_date; + return $this; + } + + /** + * Date when the resource was last edited. + * + * @return string + */ + public function getLastUpdatedDate() + { + return $this->last_updated_date; + } + + /** + * Date when the resource was last edited. + * + * @param string $last_updated_date + * @deprecated. Instead use setLastUpdatedDate + */ + public function setLast_updated_date($last_updated_date) + { + $this->last_updated_date = $last_updated_date; + return $this; + } + + /** + * Date when the resource was last edited. + * + * @return string + * @deprecated. Instead use getLastUpdatedDate + */ + public function getLast_updated_date() + { + return $this->last_updated_date; + } + + /** + * Email address of the account that last edited the resource. + * + * @param string $last_updated_by + */ + public function setLastUpdatedBy($last_updated_by) + { + $this->last_updated_by = $last_updated_by; + return $this; + } + + /** + * Email address of the account that last edited the resource. + * + * @return string + */ + public function getLastUpdatedBy() + { + return $this->last_updated_by; + } + + /** + * Email address of the account that last edited the resource. + * + * @param string $last_updated_by + * @deprecated. Instead use setLastUpdatedBy + */ + public function setLast_updated_by($last_updated_by) + { + $this->last_updated_by = $last_updated_by; + return $this; + } + + /** + * Email address of the account that last edited the resource. + * + * @return string + * @deprecated. Instead use getLastUpdatedBy + */ + public function getLast_updated_by() + { + return $this->last_updated_by; + } + + /** + * Date when the resource was first sent. + * + * @param string $first_sent_date + */ + public function setFirstSentDate($first_sent_date) + { + $this->first_sent_date = $first_sent_date; + return $this; + } + + /** + * Date when the resource was first sent. + * + * @return string + */ + public function getFirstSentDate() + { + return $this->first_sent_date; + } + + /** + * Date when the resource was first sent. + * + * @param string $first_sent_date + * @deprecated. Instead use setFirstSentDate + */ + public function setFirst_sent_date($first_sent_date) + { + $this->first_sent_date = $first_sent_date; + return $this; + } + + /** + * Date when the resource was first sent. + * + * @return string + * @deprecated. Instead use getFirstSentDate + */ + public function getFirst_sent_date() + { + return $this->first_sent_date; + } + + /** + * Date when the resource was last sent. + * + * @param string $last_sent_date + */ + public function setLastSentDate($last_sent_date) + { + $this->last_sent_date = $last_sent_date; + return $this; + } + + /** + * Date when the resource was last sent. + * + * @return string + */ + public function getLastSentDate() + { + return $this->last_sent_date; + } + + /** + * Date when the resource was last sent. + * + * @param string $last_sent_date + * @deprecated. Instead use setLastSentDate + */ + public function setLast_sent_date($last_sent_date) + { + $this->last_sent_date = $last_sent_date; + return $this; + } + + /** + * Date when the resource was last sent. + * + * @return string + * @deprecated. Instead use getLastSentDate + */ + public function getLast_sent_date() + { + return $this->last_sent_date; + } + + /** + * Email address of the account that last sent the resource. + * + * @param string $last_sent_by + */ + public function setLastSentBy($last_sent_by) + { + $this->last_sent_by = $last_sent_by; + return $this; + } + + /** + * Email address of the account that last sent the resource. + * + * @return string + */ + public function getLastSentBy() + { + return $this->last_sent_by; + } + + /** + * Email address of the account that last sent the resource. + * + * @param string $last_sent_by + * @deprecated. Instead use setLastSentBy + */ + public function setLast_sent_by($last_sent_by) + { + $this->last_sent_by = $last_sent_by; + return $this; + } + + /** + * Email address of the account that last sent the resource. + * + * @return string + * @deprecated. Instead use getLastSentBy + */ + public function getLast_sent_by() + { + return $this->last_sent_by; + } } diff --git a/lib/PayPal/Api/Notification.php b/lib/PayPal/Api/Notification.php index b23b2f8e..d4d90fff 100644 --- a/lib/PayPal/Api/Notification.php +++ b/lib/PayPal/Api/Notification.php @@ -4,84 +4,94 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class Notification extends PPModel { - /** - * Subject of the notification. - * - * @param string $subject - */ - public function setSubject($subject) { - $this->subject = $subject; - return $this; - } +class Notification extends PPModel +{ + /** + * Subject of the notification. + * + * @param string $subject + */ + public function setSubject($subject) + { + $this->subject = $subject; + return $this; + } - /** - * Subject of the notification. - * - * @return string - */ - public function getSubject() { - return $this->subject; - } + /** + * Subject of the notification. + * + * @return string + */ + public function getSubject() + { + return $this->subject; + } - /** - * Note to the payer. - * - * @param string $note - */ - public function setNote($note) { - $this->note = $note; - return $this; - } + /** + * Note to the payer. + * + * @param string $note + */ + public function setNote($note) + { + $this->note = $note; + return $this; + } - /** - * Note to the payer. - * - * @return string - */ - public function getNote() { - return $this->note; - } + /** + * Note to the payer. + * + * @return string + */ + public function getNote() + { + return $this->note; + } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @param boolean $send_to_merchant - */ - public function setSendToMerchant($send_to_merchant) { - $this->send_to_merchant = $send_to_merchant; - return $this; - } + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @param boolean $send_to_merchant + */ + public function setSendToMerchant($send_to_merchant) + { + $this->send_to_merchant = $send_to_merchant; + return $this; + } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @return boolean - */ - public function getSendToMerchant() { - return $this->send_to_merchant; - } + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @return boolean + */ + public function getSendToMerchant() + { + return $this->send_to_merchant; + } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @param boolean $send_to_merchant - * @deprecated. Instead use setSendToMerchant - */ - public function setSend_to_merchant($send_to_merchant) { - $this->send_to_merchant = $send_to_merchant; - return $this; - } - /** - * A flag indicating whether a copy of the email has to be sent to the merchant. - * - * @return boolean - * @deprecated. Instead use getSendToMerchant - */ - public function getSend_to_merchant() { - return $this->send_to_merchant; - } + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @param boolean $send_to_merchant + * @deprecated. Instead use setSendToMerchant + */ + public function setSend_to_merchant($send_to_merchant) + { + $this->send_to_merchant = $send_to_merchant; + return $this; + } + + /** + * A flag indicating whether a copy of the email has to be sent to the merchant. + * + * @return boolean + * @deprecated. Instead use getSendToMerchant + */ + public function getSend_to_merchant() + { + return $this->send_to_merchant; + } } diff --git a/lib/PayPal/Api/Order.php b/lib/PayPal/Api/Order.php index ab760e78..e6300c56 100644 --- a/lib/PayPal/Api/Order.php +++ b/lib/PayPal/Api/Order.php @@ -7,7 +7,7 @@ /** * Class Order - * + * * @property string id * @property string createTime * @property string updateTime @@ -21,9 +21,9 @@ class Order extends PPModel { /** * Set the identifier of the order transaction. - * + * * @param string $id - * + * * @return $this */ public function setId($id) @@ -35,7 +35,7 @@ public function setId($id) /** * Get the identifier of the order transaction. - * + * * @return string */ public function getId() @@ -45,9 +45,9 @@ public function getId() /** * Set the time the resource was created. - * + * * @param string $create_time - * + * * @return $this */ public function setCreateTime($create_time) @@ -59,7 +59,7 @@ public function setCreateTime($create_time) /** * Get the time the resource was created. - * + * * @return string */ public function getCreateTime() @@ -69,9 +69,9 @@ public function getCreateTime() /** * Set the time the resource was last updated. - * + * * @param string $update_time - * + * * @return $this */ public function setUpdateTime($update_time) @@ -83,7 +83,7 @@ public function setUpdateTime($update_time) /** * Get the time the resource was last updated. - * + * * @return string */ public function getUpdateTime() @@ -93,11 +93,11 @@ public function getUpdateTime() /** * Set the state of the order transaction. - * + * * Allowed values are: `PENDING`, `COMPLETED`, `REFUNDED` or `PARTIALLY_REFUNDED`. - * + * * @param string $state - * + * * @return $this */ public function setState($state) @@ -109,9 +109,9 @@ public function setState($state) /** * Get the state of the order transaction. - * + * * Allowed values are: `PENDING`, `COMPLETED`, `REFUNDED` or `PARTIALLY_REFUNDED`. - * + * * @return string */ public function getState() @@ -121,9 +121,9 @@ public function getState() /** * Set the amount being collected. - * + * * @param \PayPal\Api\Amount $amount - * + * * @return $this */ public function setAmount($amount) @@ -135,7 +135,7 @@ public function setAmount($amount) /** * Get the amount being collected. - * + * * @return \PayPal\Api\Amount */ public function getAmount() @@ -145,9 +145,9 @@ public function getAmount() /** * Set ID of the payment resource on which this transaction is based. - * + * * @param string $parent_payment - * + * * @return $this */ public function setParentPayment($parent_payment) @@ -159,7 +159,7 @@ public function setParentPayment($parent_payment) /** * Get ID of the payment resource on which this transaction is based. - * + * * @return string */ public function getParentPayment() @@ -169,9 +169,9 @@ public function getParentPayment() /** * Set Links - * + * * @param \PayPal\Api\Links $links - * + * * @return $this */ public function setLinks($links) @@ -183,7 +183,7 @@ public function setLinks($links) /** * Get Links - * + * * @return \PayPal\Api\Links */ public function getLinks() @@ -193,16 +193,16 @@ public function getLinks() /** * Reason code for the transaction state being Pending or Reversed. Assigned in response. - * + * * Allowed values: `CHARGEBACK`, `GUARANTEE`, `BUYER_COMPLAINT`, `REFUND`, * `UNCONFIRMED_SHIPPING_ADDRESS`, * `ECHECK`, `INTERNATIONAL_WITHDRAWAL`, * `RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION`, `PAYMENT_REVIEW`, * `REGULATORY_REVIEW`, `UNILATERAL`, or `VERIFICATION_REQUIRED` * (`ORDER` can also be set in the response). - * + * * @param string $reason_code - * + * * @return $this */ public function setReasonCode($reason_code) @@ -214,14 +214,14 @@ public function setReasonCode($reason_code) /** * Reason code for the transaction state being Pending or Reversed. Assigned in response. - * + * * Allowed values: `CHARGEBACK`, `GUARANTEE`, `BUYER_COMPLAINT`, `REFUND`, * `UNCONFIRMED_SHIPPING_ADDRESS`, * `ECHECK`, `INTERNATIONAL_WITHDRAWAL`, * `RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION`, `PAYMENT_REVIEW`, * `REGULATORY_REVIEW`, `UNILATERAL`, or `VERIFICATION_REQUIRED` * (`ORDER` can also be set in the response). - * + * * @return string */ public function getReasonCode() diff --git a/lib/PayPal/Api/PayerInfo.php b/lib/PayPal/Api/PayerInfo.php index 93284819..28f411d5 100644 --- a/lib/PayPal/Api/PayerInfo.php +++ b/lib/PayPal/Api/PayerInfo.php @@ -279,7 +279,7 @@ public function setShipping_address($shipping_address) return $this; } - + /** * Get Shipping Address * Shipping address of the Payer from their PayPal Account diff --git a/lib/PayPal/Api/PaymentDetail.php b/lib/PayPal/Api/PaymentDetail.php index fe31f51b..afd2426b 100644 --- a/lib/PayPal/Api/PaymentDetail.php +++ b/lib/PayPal/Api/PaymentDetail.php @@ -4,163 +4,182 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class PaymentDetail extends PPModel { - /** - * PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. - * - * @param string $type - */ - public function setType($type) { - $this->type = $type; - return $this; - } - - /** - * PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. - * - * @return string - */ - public function getType() { - return $this->type; - } - - - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * - * @param string $transaction_id - */ - public function setTransactionId($transaction_id) { - $this->transaction_id = $transaction_id; - return $this; - } - - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * - * @return string - */ - public function getTransactionId() { - return $this->transaction_id; - } - - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * - * @param string $transaction_id - * @deprecated. Instead use setTransactionId - */ - public function setTransaction_id($transaction_id) { - $this->transaction_id = $transaction_id; - return $this; - } - /** - * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. - * - * @return string - * @deprecated. Instead use getTransactionId - */ - public function getTransaction_id() { - return $this->transaction_id; - } - - /** - * Type of the transaction. - * - * @param string $transaction_type - */ - public function setTransactionType($transaction_type) { - $this->transaction_type = $transaction_type; - return $this; - } - - /** - * Type of the transaction. - * - * @return string - */ - public function getTransactionType() { - return $this->transaction_type; - } - - /** - * Type of the transaction. - * - * @param string $transaction_type - * @deprecated. Instead use setTransactionType - */ - public function setTransaction_type($transaction_type) { - $this->transaction_type = $transaction_type; - return $this; - } - /** - * Type of the transaction. - * - * @return string - * @deprecated. Instead use getTransactionType - */ - public function getTransaction_type() { - return $this->transaction_type; - } - - /** - * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. - * - * @param string $date - */ - public function setDate($date) { - $this->date = $date; - return $this; - } - - /** - * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. - * - * @return string - */ - public function getDate() { - return $this->date; - } - - - /** - * Payment mode or method. This field is mandatory if the value of the type field is OTHER. - * - * @param string $method - */ - public function setMethod($method) { - $this->method = $method; - return $this; - } - - /** - * Payment mode or method. This field is mandatory if the value of the type field is OTHER. - * - * @return string - */ - public function getMethod() { - return $this->method; - } - - - /** - * Optional note associated with the payment. - * - * @param string $note - */ - public function setNote($note) { - $this->note = $note; - return $this; - } - - /** - * Optional note associated with the payment. - * - * @return string - */ - public function getNote() { - return $this->note; - } +class PaymentDetail extends PPModel +{ + /** + * PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. + * + * @param string $type + */ + public function setType($type) + { + $this->type = $type; + return $this; + } + + /** + * PayPal payment detail indicating whether payment was made in an invoicing flow via PayPal or externally. In the case of the mark-as-paid API, payment type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. + * + * @return string + */ + public function getType() + { + return $this->type; + } + + + /** + * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. + * + * @param string $transaction_id + */ + public function setTransactionId($transaction_id) + { + $this->transaction_id = $transaction_id; + return $this; + } + + /** + * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. + * + * @return string + */ + public function getTransactionId() + { + return $this->transaction_id; + } + + /** + * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. + * + * @param string $transaction_id + * @deprecated. Instead use setTransactionId + */ + public function setTransaction_id($transaction_id) + { + $this->transaction_id = $transaction_id; + return $this; + } + + /** + * PayPal payment transaction id. Mandatory field in case the type value is PAYPAL. + * + * @return string + * @deprecated. Instead use getTransactionId + */ + public function getTransaction_id() + { + return $this->transaction_id; + } + + /** + * Type of the transaction. + * + * @param string $transaction_type + */ + public function setTransactionType($transaction_type) + { + $this->transaction_type = $transaction_type; + return $this; + } + + /** + * Type of the transaction. + * + * @return string + */ + public function getTransactionType() + { + return $this->transaction_type; + } + + /** + * Type of the transaction. + * + * @param string $transaction_type + * @deprecated. Instead use setTransactionType + */ + public function setTransaction_type($transaction_type) + { + $this->transaction_type = $transaction_type; + return $this; + } + + /** + * Type of the transaction. + * + * @return string + * @deprecated. Instead use getTransactionType + */ + public function getTransaction_type() + { + return $this->transaction_type; + } + + /** + * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * + * @param string $date + */ + public function setDate($date) + { + $this->date = $date; + return $this; + } + + /** + * Date when the invoice was paid. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. + * + * @return string + */ + public function getDate() + { + return $this->date; + } + + + /** + * Payment mode or method. This field is mandatory if the value of the type field is OTHER. + * + * @param string $method + */ + public function setMethod($method) + { + $this->method = $method; + return $this; + } + + /** + * Payment mode or method. This field is mandatory if the value of the type field is OTHER. + * + * @return string + */ + public function getMethod() + { + return $this->method; + } + + + /** + * Optional note associated with the payment. + * + * @param string $note + */ + public function setNote($note) + { + $this->note = $note; + return $this; + } + + /** + * Optional note associated with the payment. + * + * @return string + */ + public function getNote() + { + return $this->note; + } } diff --git a/lib/PayPal/Api/PaymentHistory.php b/lib/PayPal/Api/PaymentHistory.php index f18a7205..612ff885 100644 --- a/lib/PayPal/Api/PaymentHistory.php +++ b/lib/PayPal/Api/PaymentHistory.php @@ -108,7 +108,7 @@ public function setNext_id($next_id) return $this; } - + /** * Get Next ID * Identifier of the next element to get the next range of results diff --git a/lib/PayPal/Api/PaymentTerm.php b/lib/PayPal/Api/PaymentTerm.php index 59202082..85b0e214 100644 --- a/lib/PayPal/Api/PaymentTerm.php +++ b/lib/PayPal/Api/PaymentTerm.php @@ -4,83 +4,94 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class PaymentTerm extends PPModel { - /** - * Terms by which the invoice payment is due. - * - * @param string $term_type - */ - public function setTermType($term_type) { - $this->term_type = $term_type; - return $this; - } +class PaymentTerm extends PPModel +{ + /** + * Terms by which the invoice payment is due. + * + * @param string $term_type + */ + public function setTermType($term_type) + { + $this->term_type = $term_type; + return $this; + } - /** - * Terms by which the invoice payment is due. - * - * @return string - */ - public function getTermType() { - return $this->term_type; - } + /** + * Terms by which the invoice payment is due. + * + * @return string + */ + public function getTermType() + { + return $this->term_type; + } - /** - * Terms by which the invoice payment is due. - * - * @param string $term_type - * @deprecated. Instead use setTermType - */ - public function setTerm_type($term_type) { - $this->term_type = $term_type; - return $this; - } - /** - * Terms by which the invoice payment is due. - * - * @return string - * @deprecated. Instead use getTermType - */ - public function getTerm_type() { - return $this->term_type; - } + /** + * Terms by which the invoice payment is due. + * + * @param string $term_type + * @deprecated. Instead use setTermType + */ + public function setTerm_type($term_type) + { + $this->term_type = $term_type; + return $this; + } - /** - * Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST - * - * @param string $due_date - */ - public function setDueDate($due_date) { - $this->due_date = $due_date; - return $this; - } + /** + * Terms by which the invoice payment is due. + * + * @return string + * @deprecated. Instead use getTermType + */ + public function getTerm_type() + { + return $this->term_type; + } - /** - * Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST - * - * @return string - */ - public function getDueDate() { - return $this->due_date; - } + /** + * Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * + * @param string $due_date + */ + public function setDueDate($due_date) + { + $this->due_date = $due_date; + return $this; + } - /** - * Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST - * - * @param string $due_date - * @deprecated. Instead use setDueDate - */ - public function setDue_date($due_date) { - $this->due_date = $due_date; - return $this; - } - /** - * Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST - * - * @return string - * @deprecated. Instead use getDueDate - */ - public function getDue_date() { - return $this->due_date; - } + /** + * Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * + * @return string + */ + public function getDueDate() + { + return $this->due_date; + } + + /** + * Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * + * @param string $due_date + * @deprecated. Instead use setDueDate + */ + public function setDue_date($due_date) + { + $this->due_date = $due_date; + return $this; + } + + /** + * Date on which invoice payment is due. It must be always a future date. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST + * + * @return string + * @deprecated. Instead use getDueDate + */ + public function getDue_date() + { + return $this->due_date; + } } diff --git a/lib/PayPal/Api/Phone.php b/lib/PayPal/Api/Phone.php index 76605b6e..e41495f9 100644 --- a/lib/PayPal/Api/Phone.php +++ b/lib/PayPal/Api/Phone.php @@ -4,83 +4,94 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class Phone extends PPModel { - /** - * Country code (in E.164 format). Assume length is n. - * - * @param string $country_code - */ - public function setCountryCode($country_code) { - $this->country_code = $country_code; - return $this; - } +class Phone extends PPModel +{ + /** + * Country code (in E.164 format). Assume length is n. + * + * @param string $country_code + */ + public function setCountryCode($country_code) + { + $this->country_code = $country_code; + return $this; + } - /** - * Country code (in E.164 format). Assume length is n. - * - * @return string - */ - public function getCountryCode() { - return $this->country_code; - } + /** + * Country code (in E.164 format). Assume length is n. + * + * @return string + */ + public function getCountryCode() + { + return $this->country_code; + } - /** - * Country code (in E.164 format). Assume length is n. - * - * @param string $country_code - * @deprecated. Instead use setCountryCode - */ - public function setCountry_code($country_code) { - $this->country_code = $country_code; - return $this; - } - /** - * Country code (in E.164 format). Assume length is n. - * - * @return string - * @deprecated. Instead use getCountryCode - */ - public function getCountry_code() { - return $this->country_code; - } + /** + * Country code (in E.164 format). Assume length is n. + * + * @param string $country_code + * @deprecated. Instead use setCountryCode + */ + public function setCountry_code($country_code) + { + $this->country_code = $country_code; + return $this; + } - /** - * In-country phone number (in E.164 format). Maximum (15 - n) digits. - * - * @param string $national_number - */ - public function setNationalNumber($national_number) { - $this->national_number = $national_number; - return $this; - } + /** + * Country code (in E.164 format). Assume length is n. + * + * @return string + * @deprecated. Instead use getCountryCode + */ + public function getCountry_code() + { + return $this->country_code; + } - /** - * In-country phone number (in E.164 format). Maximum (15 - n) digits. - * - * @return string - */ - public function getNationalNumber() { - return $this->national_number; - } + /** + * In-country phone number (in E.164 format). Maximum (15 - n) digits. + * + * @param string $national_number + */ + public function setNationalNumber($national_number) + { + $this->national_number = $national_number; + return $this; + } - /** - * In-country phone number (in E.164 format). Maximum (15 - n) digits. - * - * @param string $national_number - * @deprecated. Instead use setNationalNumber - */ - public function setNational_number($national_number) { - $this->national_number = $national_number; - return $this; - } - /** - * In-country phone number (in E.164 format). Maximum (15 - n) digits. - * - * @return string - * @deprecated. Instead use getNationalNumber - */ - public function getNational_number() { - return $this->national_number; - } + /** + * In-country phone number (in E.164 format). Maximum (15 - n) digits. + * + * @return string + */ + public function getNationalNumber() + { + return $this->national_number; + } + + /** + * In-country phone number (in E.164 format). Maximum (15 - n) digits. + * + * @param string $national_number + * @deprecated. Instead use setNationalNumber + */ + public function setNational_number($national_number) + { + $this->national_number = $national_number; + return $this; + } + + /** + * In-country phone number (in E.164 format). Maximum (15 - n) digits. + * + * @return string + * @deprecated. Instead use getNationalNumber + */ + public function getNational_number() + { + return $this->national_number; + } } diff --git a/lib/PayPal/Api/RedirectUrls.php b/lib/PayPal/Api/RedirectUrls.php index ba9ed1bd..d2451c63 100644 --- a/lib/PayPal/Api/RedirectUrls.php +++ b/lib/PayPal/Api/RedirectUrls.php @@ -23,8 +23,7 @@ class RedirectUrls extends PPModel */ public function setReturnUrl($return_url) { - if(filter_var($return_url, FILTER_VALIDATE_URL) === false) - { + if (filter_var($return_url, FILTER_VALIDATE_URL) === false) { throw new \InvalidArgumentException("Return URL is not a fully qualified URL"); } @@ -84,8 +83,7 @@ public function getReturn_url() */ public function setCancelUrl($cancel_url) { - if(filter_var($cancel_url, FILTER_VALIDATE_URL) === false) - { + if (filter_var($cancel_url, FILTER_VALIDATE_URL) === false) { throw new \InvalidArgumentException("Cancel URL is not a fully qualified URL"); } $this->cancel_url = $cancel_url; @@ -120,7 +118,7 @@ public function setCancel_url($cancel_url) return $this; } - + /** * Get Cancel URL * Url where the payer would be redirected to after canceling the payment diff --git a/lib/PayPal/Api/RefundDetail.php b/lib/PayPal/Api/RefundDetail.php index f659a433..a6e9ad66 100644 --- a/lib/PayPal/Api/RefundDetail.php +++ b/lib/PayPal/Api/RefundDetail.php @@ -4,65 +4,72 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class RefundDetail extends PPModel { - /** - * PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. - * - * @param string $type - */ - public function setType($type) { - $this->type = $type; - return $this; - } +class RefundDetail extends PPModel +{ + /** + * PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. + * + * @param string $type + */ + public function setType($type) + { + $this->type = $type; + return $this; + } - /** - * PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. - * - * @return string - */ - public function getType() { - return $this->type; - } + /** + * PayPal refund type indicating whether refund was done in invoicing flow via PayPal or externally. In the case of the mark-as-refunded API, refund type is EXTERNAL and this is what is now supported. The PAYPAL value is provided for backward compatibility. + * + * @return string + */ + public function getType() + { + return $this->type; + } - /** - * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. - * - * @param string $date - */ - public function setDate($date) { - $this->date = $date; - return $this; - } + /** + * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. + * + * @param string $date + */ + public function setDate($date) + { + $this->date = $date; + return $this; + } - /** - * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. - * - * @return string - */ - public function getDate() { - return $this->date; - } + /** + * Date when the invoice was marked as refunded. If no date is specified, the current date and time is used as the default. In addition, the date must be after the invoice payment date. + * + * @return string + */ + public function getDate() + { + return $this->date; + } - /** - * Optional note associated with the refund. - * - * @param string $note - */ - public function setNote($note) { - $this->note = $note; - return $this; - } + /** + * Optional note associated with the refund. + * + * @param string $note + */ + public function setNote($note) + { + $this->note = $note; + return $this; + } - /** - * Optional note associated with the refund. - * - * @return string - */ - public function getNote() { - return $this->note; - } + /** + * Optional note associated with the refund. + * + * @return string + */ + public function getNote() + { + return $this->note; + } } diff --git a/lib/PayPal/Api/RelatedResources.php b/lib/PayPal/Api/RelatedResources.php index e9ba9632..e7896443 100644 --- a/lib/PayPal/Api/RelatedResources.php +++ b/lib/PayPal/Api/RelatedResources.php @@ -117,9 +117,9 @@ public function getRefund() /** * Set Order - * + * * @param \PayPal\Api\Order $order - * + * * @return $this */ public function setOrder($order) @@ -131,7 +131,7 @@ public function setOrder($order) /** * Get Order - * + * * @return \PayPal\Api\Order */ public function getOrder() diff --git a/lib/PayPal/Api/Search.php b/lib/PayPal/Api/Search.php index 5985e282..ad1aebcf 100644 --- a/lib/PayPal/Api/Search.php +++ b/lib/PayPal/Api/Search.php @@ -4,670 +4,754 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class Search extends PPModel { - /** - * Initial letters of the email address. - * - * @param string $email - */ - public function setEmail($email) { - $this->email = $email; - return $this; - } - - /** - * Initial letters of the email address. - * - * @return string - */ - public function getEmail() { - return $this->email; - } - - - /** - * Initial letters of the recipient's first name. - * - * @param string $recipient_first_name - */ - public function setRecipientFirstName($recipient_first_name) { - $this->recipient_first_name = $recipient_first_name; - return $this; - } - - /** - * Initial letters of the recipient's first name. - * - * @return string - */ - public function getRecipientFirstName() { - return $this->recipient_first_name; - } - - /** - * Initial letters of the recipient's first name. - * - * @param string $recipient_first_name - * @deprecated. Instead use setRecipientFirstName - */ - public function setRecipient_first_name($recipient_first_name) { - $this->recipient_first_name = $recipient_first_name; - return $this; - } - /** - * Initial letters of the recipient's first name. - * - * @return string - * @deprecated. Instead use getRecipientFirstName - */ - public function getRecipient_first_name() { - return $this->recipient_first_name; - } - - /** - * Initial letters of the recipient's last name. - * - * @param string $recipient_last_name - */ - public function setRecipientLastName($recipient_last_name) { - $this->recipient_last_name = $recipient_last_name; - return $this; - } - - /** - * Initial letters of the recipient's last name. - * - * @return string - */ - public function getRecipientLastName() { - return $this->recipient_last_name; - } - - /** - * Initial letters of the recipient's last name. - * - * @param string $recipient_last_name - * @deprecated. Instead use setRecipientLastName - */ - public function setRecipient_last_name($recipient_last_name) { - $this->recipient_last_name = $recipient_last_name; - return $this; - } - /** - * Initial letters of the recipient's last name. - * - * @return string - * @deprecated. Instead use getRecipientLastName - */ - public function getRecipient_last_name() { - return $this->recipient_last_name; - } - - /** - * Initial letters of the recipient's business name. - * - * @param string $recipient_business_name - */ - public function setRecipientBusinessName($recipient_business_name) { - $this->recipient_business_name = $recipient_business_name; - return $this; - } - - /** - * Initial letters of the recipient's business name. - * - * @return string - */ - public function getRecipientBusinessName() { - return $this->recipient_business_name; - } - - /** - * Initial letters of the recipient's business name. - * - * @param string $recipient_business_name - * @deprecated. Instead use setRecipientBusinessName - */ - public function setRecipient_business_name($recipient_business_name) { - $this->recipient_business_name = $recipient_business_name; - return $this; - } - /** - * Initial letters of the recipient's business name. - * - * @return string - * @deprecated. Instead use getRecipientBusinessName - */ - public function getRecipient_business_name() { - return $this->recipient_business_name; - } - - /** - * The invoice number that appears on the invoice. - * - * @param string $number - */ - public function setNumber($number) { - $this->number = $number; - return $this; - } - - /** - * The invoice number that appears on the invoice. - * - * @return string - */ - public function getNumber() { - return $this->number; - } - - - /** - * Status of the invoice. - * - * @param string $status - */ - public function setStatus($status) { - $this->status = $status; - return $this; - } - - /** - * Status of the invoice. - * - * @return string - */ - public function getStatus() { - return $this->status; - } - - - /** - * Lower limit of total amount. - * - * @param PayPal\Api\Currency $lower_total_amount - */ - public function setLowerTotalAmount($lower_total_amount) { - $this->lower_total_amount = $lower_total_amount; - return $this; - } - - /** - * Lower limit of total amount. - * - * @return PayPal\Api\Currency - */ - public function getLowerTotalAmount() { - return $this->lower_total_amount; - } - - /** - * Lower limit of total amount. - * - * @param PayPal\Api\Currency $lower_total_amount - * @deprecated. Instead use setLowerTotalAmount - */ - public function setLower_total_amount($lower_total_amount) { - $this->lower_total_amount = $lower_total_amount; - return $this; - } - /** - * Lower limit of total amount. - * - * @return PayPal\Api\Currency - * @deprecated. Instead use getLowerTotalAmount - */ - public function getLower_total_amount() { - return $this->lower_total_amount; - } - - /** - * Upper limit of total amount. - * - * @param PayPal\Api\Currency $upper_total_amount - */ - public function setUpperTotalAmount($upper_total_amount) { - $this->upper_total_amount = $upper_total_amount; - return $this; - } - - /** - * Upper limit of total amount. - * - * @return PayPal\Api\Currency - */ - public function getUpperTotalAmount() { - return $this->upper_total_amount; - } - - /** - * Upper limit of total amount. - * - * @param PayPal\Api\Currency $upper_total_amount - * @deprecated. Instead use setUpperTotalAmount - */ - public function setUpper_total_amount($upper_total_amount) { - $this->upper_total_amount = $upper_total_amount; - return $this; - } - /** - * Upper limit of total amount. - * - * @return PayPal\Api\Currency - * @deprecated. Instead use getUpperTotalAmount - */ - public function getUpper_total_amount() { - return $this->upper_total_amount; - } - - /** - * Start invoice date. - * - * @param string $start_invoice_date - */ - public function setStartInvoiceDate($start_invoice_date) { - $this->start_invoice_date = $start_invoice_date; - return $this; - } - - /** - * Start invoice date. - * - * @return string - */ - public function getStartInvoiceDate() { - return $this->start_invoice_date; - } - - /** - * Start invoice date. - * - * @param string $start_invoice_date - * @deprecated. Instead use setStartInvoiceDate - */ - public function setStart_invoice_date($start_invoice_date) { - $this->start_invoice_date = $start_invoice_date; - return $this; - } - /** - * Start invoice date. - * - * @return string - * @deprecated. Instead use getStartInvoiceDate - */ - public function getStart_invoice_date() { - return $this->start_invoice_date; - } - - /** - * End invoice date. - * - * @param string $end_invoice_date - */ - public function setEndInvoiceDate($end_invoice_date) { - $this->end_invoice_date = $end_invoice_date; - return $this; - } - - /** - * End invoice date. - * - * @return string - */ - public function getEndInvoiceDate() { - return $this->end_invoice_date; - } - - /** - * End invoice date. - * - * @param string $end_invoice_date - * @deprecated. Instead use setEndInvoiceDate - */ - public function setEnd_invoice_date($end_invoice_date) { - $this->end_invoice_date = $end_invoice_date; - return $this; - } - /** - * End invoice date. - * - * @return string - * @deprecated. Instead use getEndInvoiceDate - */ - public function getEnd_invoice_date() { - return $this->end_invoice_date; - } - - /** - * Start invoice due date. - * - * @param string $start_due_date - */ - public function setStartDueDate($start_due_date) { - $this->start_due_date = $start_due_date; - return $this; - } - - /** - * Start invoice due date. - * - * @return string - */ - public function getStartDueDate() { - return $this->start_due_date; - } - - /** - * Start invoice due date. - * - * @param string $start_due_date - * @deprecated. Instead use setStartDueDate - */ - public function setStart_due_date($start_due_date) { - $this->start_due_date = $start_due_date; - return $this; - } - /** - * Start invoice due date. - * - * @return string - * @deprecated. Instead use getStartDueDate - */ - public function getStart_due_date() { - return $this->start_due_date; - } - - /** - * End invoice due date. - * - * @param string $end_due_date - */ - public function setEndDueDate($end_due_date) { - $this->end_due_date = $end_due_date; - return $this; - } - - /** - * End invoice due date. - * - * @return string - */ - public function getEndDueDate() { - return $this->end_due_date; - } - - /** - * End invoice due date. - * - * @param string $end_due_date - * @deprecated. Instead use setEndDueDate - */ - public function setEnd_due_date($end_due_date) { - $this->end_due_date = $end_due_date; - return $this; - } - /** - * End invoice due date. - * - * @return string - * @deprecated. Instead use getEndDueDate - */ - public function getEnd_due_date() { - return $this->end_due_date; - } - - /** - * Start invoice payment date. - * - * @param string $start_payment_date - */ - public function setStartPaymentDate($start_payment_date) { - $this->start_payment_date = $start_payment_date; - return $this; - } - - /** - * Start invoice payment date. - * - * @return string - */ - public function getStartPaymentDate() { - return $this->start_payment_date; - } - - /** - * Start invoice payment date. - * - * @param string $start_payment_date - * @deprecated. Instead use setStartPaymentDate - */ - public function setStart_payment_date($start_payment_date) { - $this->start_payment_date = $start_payment_date; - return $this; - } - /** - * Start invoice payment date. - * - * @return string - * @deprecated. Instead use getStartPaymentDate - */ - public function getStart_payment_date() { - return $this->start_payment_date; - } - - /** - * End invoice payment date. - * - * @param string $end_payment_date - */ - public function setEndPaymentDate($end_payment_date) { - $this->end_payment_date = $end_payment_date; - return $this; - } - - /** - * End invoice payment date. - * - * @return string - */ - public function getEndPaymentDate() { - return $this->end_payment_date; - } - - /** - * End invoice payment date. - * - * @param string $end_payment_date - * @deprecated. Instead use setEndPaymentDate - */ - public function setEnd_payment_date($end_payment_date) { - $this->end_payment_date = $end_payment_date; - return $this; - } - /** - * End invoice payment date. - * - * @return string - * @deprecated. Instead use getEndPaymentDate - */ - public function getEnd_payment_date() { - return $this->end_payment_date; - } - - /** - * Start invoice creation date. - * - * @param string $start_creation_date - */ - public function setStartCreationDate($start_creation_date) { - $this->start_creation_date = $start_creation_date; - return $this; - } - - /** - * Start invoice creation date. - * - * @return string - */ - public function getStartCreationDate() { - return $this->start_creation_date; - } - - /** - * Start invoice creation date. - * - * @param string $start_creation_date - * @deprecated. Instead use setStartCreationDate - */ - public function setStart_creation_date($start_creation_date) { - $this->start_creation_date = $start_creation_date; - return $this; - } - /** - * Start invoice creation date. - * - * @return string - * @deprecated. Instead use getStartCreationDate - */ - public function getStart_creation_date() { - return $this->start_creation_date; - } - - /** - * End invoice creation date. - * - * @param string $end_creation_date - */ - public function setEndCreationDate($end_creation_date) { - $this->end_creation_date = $end_creation_date; - return $this; - } - - /** - * End invoice creation date. - * - * @return string - */ - public function getEndCreationDate() { - return $this->end_creation_date; - } - - /** - * End invoice creation date. - * - * @param string $end_creation_date - * @deprecated. Instead use setEndCreationDate - */ - public function setEnd_creation_date($end_creation_date) { - $this->end_creation_date = $end_creation_date; - return $this; - } - /** - * End invoice creation date. - * - * @return string - * @deprecated. Instead use getEndCreationDate - */ - public function getEnd_creation_date() { - return $this->end_creation_date; - } - - /** - * Offset of the search results. - * - * @param PayPal\Api\number $page - */ - public function setPage($page) { - $this->page = $page; - return $this; - } - - /** - * Offset of the search results. - * - * @return PayPal\Api\number - */ - public function getPage() { - return $this->page; - } - - - /** - * Page size of the search results. - * - * @param PayPal\Api\number $page_size - */ - public function setPageSize($page_size) { - $this->page_size = $page_size; - return $this; - } - - /** - * Page size of the search results. - * - * @return PayPal\Api\number - */ - public function getPageSize() { - return $this->page_size; - } - - /** - * Page size of the search results. - * - * @param PayPal\Api\number $page_size - * @deprecated. Instead use setPageSize - */ - public function setPage_size($page_size) { - $this->page_size = $page_size; - return $this; - } - /** - * Page size of the search results. - * - * @return PayPal\Api\number - * @deprecated. Instead use getPageSize - */ - public function getPage_size() { - return $this->page_size; - } - - /** - * A flag indicating whether total count is required in the response. - * - * @param boolean $total_count_required - */ - public function setTotalCountRequired($total_count_required) { - $this->total_count_required = $total_count_required; - return $this; - } - - /** - * A flag indicating whether total count is required in the response. - * - * @return boolean - */ - public function getTotalCountRequired() { - return $this->total_count_required; - } - - /** - * A flag indicating whether total count is required in the response. - * - * @param boolean $total_count_required - * @deprecated. Instead use setTotalCountRequired - */ - public function setTotal_count_required($total_count_required) { - $this->total_count_required = $total_count_required; - return $this; - } - /** - * A flag indicating whether total count is required in the response. - * - * @return boolean - * @deprecated. Instead use getTotalCountRequired - */ - public function getTotal_count_required() { - return $this->total_count_required; - } +class Search extends PPModel +{ + /** + * Initial letters of the email address. + * + * @param string $email + */ + public function setEmail($email) + { + $this->email = $email; + return $this; + } + + /** + * Initial letters of the email address. + * + * @return string + */ + public function getEmail() + { + return $this->email; + } + + + /** + * Initial letters of the recipient's first name. + * + * @param string $recipient_first_name + */ + public function setRecipientFirstName($recipient_first_name) + { + $this->recipient_first_name = $recipient_first_name; + return $this; + } + + /** + * Initial letters of the recipient's first name. + * + * @return string + */ + public function getRecipientFirstName() + { + return $this->recipient_first_name; + } + + /** + * Initial letters of the recipient's first name. + * + * @param string $recipient_first_name + * @deprecated. Instead use setRecipientFirstName + */ + public function setRecipient_first_name($recipient_first_name) + { + $this->recipient_first_name = $recipient_first_name; + return $this; + } + + /** + * Initial letters of the recipient's first name. + * + * @return string + * @deprecated. Instead use getRecipientFirstName + */ + public function getRecipient_first_name() + { + return $this->recipient_first_name; + } + + /** + * Initial letters of the recipient's last name. + * + * @param string $recipient_last_name + */ + public function setRecipientLastName($recipient_last_name) + { + $this->recipient_last_name = $recipient_last_name; + return $this; + } + + /** + * Initial letters of the recipient's last name. + * + * @return string + */ + public function getRecipientLastName() + { + return $this->recipient_last_name; + } + + /** + * Initial letters of the recipient's last name. + * + * @param string $recipient_last_name + * @deprecated. Instead use setRecipientLastName + */ + public function setRecipient_last_name($recipient_last_name) + { + $this->recipient_last_name = $recipient_last_name; + return $this; + } + + /** + * Initial letters of the recipient's last name. + * + * @return string + * @deprecated. Instead use getRecipientLastName + */ + public function getRecipient_last_name() + { + return $this->recipient_last_name; + } + + /** + * Initial letters of the recipient's business name. + * + * @param string $recipient_business_name + */ + public function setRecipientBusinessName($recipient_business_name) + { + $this->recipient_business_name = $recipient_business_name; + return $this; + } + + /** + * Initial letters of the recipient's business name. + * + * @return string + */ + public function getRecipientBusinessName() + { + return $this->recipient_business_name; + } + + /** + * Initial letters of the recipient's business name. + * + * @param string $recipient_business_name + * @deprecated. Instead use setRecipientBusinessName + */ + public function setRecipient_business_name($recipient_business_name) + { + $this->recipient_business_name = $recipient_business_name; + return $this; + } + + /** + * Initial letters of the recipient's business name. + * + * @return string + * @deprecated. Instead use getRecipientBusinessName + */ + public function getRecipient_business_name() + { + return $this->recipient_business_name; + } + + /** + * The invoice number that appears on the invoice. + * + * @param string $number + */ + public function setNumber($number) + { + $this->number = $number; + return $this; + } + + /** + * The invoice number that appears on the invoice. + * + * @return string + */ + public function getNumber() + { + return $this->number; + } + + + /** + * Status of the invoice. + * + * @param string $status + */ + public function setStatus($status) + { + $this->status = $status; + return $this; + } + + /** + * Status of the invoice. + * + * @return string + */ + public function getStatus() + { + return $this->status; + } + + + /** + * Lower limit of total amount. + * + * @param PayPal\Api\Currency $lower_total_amount + */ + public function setLowerTotalAmount($lower_total_amount) + { + $this->lower_total_amount = $lower_total_amount; + return $this; + } + + /** + * Lower limit of total amount. + * + * @return PayPal\Api\Currency + */ + public function getLowerTotalAmount() + { + return $this->lower_total_amount; + } + + /** + * Lower limit of total amount. + * + * @param PayPal\Api\Currency $lower_total_amount + * @deprecated. Instead use setLowerTotalAmount + */ + public function setLower_total_amount($lower_total_amount) + { + $this->lower_total_amount = $lower_total_amount; + return $this; + } + + /** + * Lower limit of total amount. + * + * @return PayPal\Api\Currency + * @deprecated. Instead use getLowerTotalAmount + */ + public function getLower_total_amount() + { + return $this->lower_total_amount; + } + + /** + * Upper limit of total amount. + * + * @param PayPal\Api\Currency $upper_total_amount + */ + public function setUpperTotalAmount($upper_total_amount) + { + $this->upper_total_amount = $upper_total_amount; + return $this; + } + + /** + * Upper limit of total amount. + * + * @return PayPal\Api\Currency + */ + public function getUpperTotalAmount() + { + return $this->upper_total_amount; + } + + /** + * Upper limit of total amount. + * + * @param PayPal\Api\Currency $upper_total_amount + * @deprecated. Instead use setUpperTotalAmount + */ + public function setUpper_total_amount($upper_total_amount) + { + $this->upper_total_amount = $upper_total_amount; + return $this; + } + + /** + * Upper limit of total amount. + * + * @return PayPal\Api\Currency + * @deprecated. Instead use getUpperTotalAmount + */ + public function getUpper_total_amount() + { + return $this->upper_total_amount; + } + + /** + * Start invoice date. + * + * @param string $start_invoice_date + */ + public function setStartInvoiceDate($start_invoice_date) + { + $this->start_invoice_date = $start_invoice_date; + return $this; + } + + /** + * Start invoice date. + * + * @return string + */ + public function getStartInvoiceDate() + { + return $this->start_invoice_date; + } + + /** + * Start invoice date. + * + * @param string $start_invoice_date + * @deprecated. Instead use setStartInvoiceDate + */ + public function setStart_invoice_date($start_invoice_date) + { + $this->start_invoice_date = $start_invoice_date; + return $this; + } + + /** + * Start invoice date. + * + * @return string + * @deprecated. Instead use getStartInvoiceDate + */ + public function getStart_invoice_date() + { + return $this->start_invoice_date; + } + + /** + * End invoice date. + * + * @param string $end_invoice_date + */ + public function setEndInvoiceDate($end_invoice_date) + { + $this->end_invoice_date = $end_invoice_date; + return $this; + } + + /** + * End invoice date. + * + * @return string + */ + public function getEndInvoiceDate() + { + return $this->end_invoice_date; + } + + /** + * End invoice date. + * + * @param string $end_invoice_date + * @deprecated. Instead use setEndInvoiceDate + */ + public function setEnd_invoice_date($end_invoice_date) + { + $this->end_invoice_date = $end_invoice_date; + return $this; + } + + /** + * End invoice date. + * + * @return string + * @deprecated. Instead use getEndInvoiceDate + */ + public function getEnd_invoice_date() + { + return $this->end_invoice_date; + } + + /** + * Start invoice due date. + * + * @param string $start_due_date + */ + public function setStartDueDate($start_due_date) + { + $this->start_due_date = $start_due_date; + return $this; + } + + /** + * Start invoice due date. + * + * @return string + */ + public function getStartDueDate() + { + return $this->start_due_date; + } + + /** + * Start invoice due date. + * + * @param string $start_due_date + * @deprecated. Instead use setStartDueDate + */ + public function setStart_due_date($start_due_date) + { + $this->start_due_date = $start_due_date; + return $this; + } + + /** + * Start invoice due date. + * + * @return string + * @deprecated. Instead use getStartDueDate + */ + public function getStart_due_date() + { + return $this->start_due_date; + } + + /** + * End invoice due date. + * + * @param string $end_due_date + */ + public function setEndDueDate($end_due_date) + { + $this->end_due_date = $end_due_date; + return $this; + } + + /** + * End invoice due date. + * + * @return string + */ + public function getEndDueDate() + { + return $this->end_due_date; + } + + /** + * End invoice due date. + * + * @param string $end_due_date + * @deprecated. Instead use setEndDueDate + */ + public function setEnd_due_date($end_due_date) + { + $this->end_due_date = $end_due_date; + return $this; + } + + /** + * End invoice due date. + * + * @return string + * @deprecated. Instead use getEndDueDate + */ + public function getEnd_due_date() + { + return $this->end_due_date; + } + + /** + * Start invoice payment date. + * + * @param string $start_payment_date + */ + public function setStartPaymentDate($start_payment_date) + { + $this->start_payment_date = $start_payment_date; + return $this; + } + + /** + * Start invoice payment date. + * + * @return string + */ + public function getStartPaymentDate() + { + return $this->start_payment_date; + } + + /** + * Start invoice payment date. + * + * @param string $start_payment_date + * @deprecated. Instead use setStartPaymentDate + */ + public function setStart_payment_date($start_payment_date) + { + $this->start_payment_date = $start_payment_date; + return $this; + } + + /** + * Start invoice payment date. + * + * @return string + * @deprecated. Instead use getStartPaymentDate + */ + public function getStart_payment_date() + { + return $this->start_payment_date; + } + + /** + * End invoice payment date. + * + * @param string $end_payment_date + */ + public function setEndPaymentDate($end_payment_date) + { + $this->end_payment_date = $end_payment_date; + return $this; + } + + /** + * End invoice payment date. + * + * @return string + */ + public function getEndPaymentDate() + { + return $this->end_payment_date; + } + + /** + * End invoice payment date. + * + * @param string $end_payment_date + * @deprecated. Instead use setEndPaymentDate + */ + public function setEnd_payment_date($end_payment_date) + { + $this->end_payment_date = $end_payment_date; + return $this; + } + + /** + * End invoice payment date. + * + * @return string + * @deprecated. Instead use getEndPaymentDate + */ + public function getEnd_payment_date() + { + return $this->end_payment_date; + } + + /** + * Start invoice creation date. + * + * @param string $start_creation_date + */ + public function setStartCreationDate($start_creation_date) + { + $this->start_creation_date = $start_creation_date; + return $this; + } + + /** + * Start invoice creation date. + * + * @return string + */ + public function getStartCreationDate() + { + return $this->start_creation_date; + } + + /** + * Start invoice creation date. + * + * @param string $start_creation_date + * @deprecated. Instead use setStartCreationDate + */ + public function setStart_creation_date($start_creation_date) + { + $this->start_creation_date = $start_creation_date; + return $this; + } + + /** + * Start invoice creation date. + * + * @return string + * @deprecated. Instead use getStartCreationDate + */ + public function getStart_creation_date() + { + return $this->start_creation_date; + } + + /** + * End invoice creation date. + * + * @param string $end_creation_date + */ + public function setEndCreationDate($end_creation_date) + { + $this->end_creation_date = $end_creation_date; + return $this; + } + + /** + * End invoice creation date. + * + * @return string + */ + public function getEndCreationDate() + { + return $this->end_creation_date; + } + + /** + * End invoice creation date. + * + * @param string $end_creation_date + * @deprecated. Instead use setEndCreationDate + */ + public function setEnd_creation_date($end_creation_date) + { + $this->end_creation_date = $end_creation_date; + return $this; + } + + /** + * End invoice creation date. + * + * @return string + * @deprecated. Instead use getEndCreationDate + */ + public function getEnd_creation_date() + { + return $this->end_creation_date; + } + + /** + * Offset of the search results. + * + * @param PayPal\Api\number $page + */ + public function setPage($page) + { + $this->page = $page; + return $this; + } + + /** + * Offset of the search results. + * + * @return PayPal\Api\number + */ + public function getPage() + { + return $this->page; + } + + + /** + * Page size of the search results. + * + * @param PayPal\Api\number $page_size + */ + public function setPageSize($page_size) + { + $this->page_size = $page_size; + return $this; + } + + /** + * Page size of the search results. + * + * @return PayPal\Api\number + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Page size of the search results. + * + * @param PayPal\Api\number $page_size + * @deprecated. Instead use setPageSize + */ + public function setPage_size($page_size) + { + $this->page_size = $page_size; + return $this; + } + + /** + * Page size of the search results. + * + * @return PayPal\Api\number + * @deprecated. Instead use getPageSize + */ + public function getPage_size() + { + return $this->page_size; + } + + /** + * A flag indicating whether total count is required in the response. + * + * @param boolean $total_count_required + */ + public function setTotalCountRequired($total_count_required) + { + $this->total_count_required = $total_count_required; + return $this; + } + + /** + * A flag indicating whether total count is required in the response. + * + * @return boolean + */ + public function getTotalCountRequired() + { + return $this->total_count_required; + } + + /** + * A flag indicating whether total count is required in the response. + * + * @param boolean $total_count_required + * @deprecated. Instead use setTotalCountRequired + */ + public function setTotal_count_required($total_count_required) + { + $this->total_count_required = $total_count_required; + return $this; + } + + /** + * A flag indicating whether total count is required in the response. + * + * @return boolean + * @deprecated. Instead use getTotalCountRequired + */ + public function getTotal_count_required() + { + return $this->total_count_required; + } } diff --git a/lib/PayPal/Api/ShippingCost.php b/lib/PayPal/Api/ShippingCost.php index c9e711cb..3b5ca2e0 100644 --- a/lib/PayPal/Api/ShippingCost.php +++ b/lib/PayPal/Api/ShippingCost.php @@ -4,45 +4,50 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class ShippingCost extends PPModel { - /** - * Shipping cost in amount. Range of 0 to 999999.99. - * - * @param PayPal\Api\Currency $amount - */ - public function setAmount($amount) { - $this->amount = $amount; - return $this; - } - - /** - * Shipping cost in amount. Range of 0 to 999999.99. - * - * @return PayPal\Api\Currency - */ - public function getAmount() { - return $this->amount; - } - - - /** - * Tax percentage on shipping amount. - * - * @param PayPal\Api\Tax $tax - */ - public function setTax($tax) { - $this->tax = $tax; - return $this; - } - - /** - * Tax percentage on shipping amount. - * - * @return PayPal\Api\Tax - */ - public function getTax() { - return $this->tax; - } +class ShippingCost extends PPModel +{ + /** + * Shipping cost in amount. Range of 0 to 999999.99. + * + * @param PayPal\Api\Currency $amount + */ + public function setAmount($amount) + { + $this->amount = $amount; + return $this; + } + + /** + * Shipping cost in amount. Range of 0 to 999999.99. + * + * @return PayPal\Api\Currency + */ + public function getAmount() + { + return $this->amount; + } + + + /** + * Tax percentage on shipping amount. + * + * @param PayPal\Api\Tax $tax + */ + public function setTax($tax) + { + $this->tax = $tax; + return $this; + } + + /** + * Tax percentage on shipping amount. + * + * @return PayPal\Api\Tax + */ + public function getTax() + { + return $this->tax; + } } diff --git a/lib/PayPal/Api/ShippingInfo.php b/lib/PayPal/Api/ShippingInfo.php index 267816dc..83e96f2c 100644 --- a/lib/PayPal/Api/ShippingInfo.php +++ b/lib/PayPal/Api/ShippingInfo.php @@ -4,162 +4,182 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class ShippingInfo extends PPModel { - /** - * First name of the invoice recipient. 30 characters max. - * - * @param string $first_name - */ - public function setFirstName($first_name) { - $this->first_name = $first_name; - return $this; - } - - /** - * First name of the invoice recipient. 30 characters max. - * - * @return string - */ - public function getFirstName() { - return $this->first_name; - } - - /** - * First name of the invoice recipient. 30 characters max. - * - * @param string $first_name - * @deprecated. Instead use setFirstName - */ - public function setFirst_name($first_name) { - $this->first_name = $first_name; - return $this; - } - /** - * First name of the invoice recipient. 30 characters max. - * - * @return string - * @deprecated. Instead use getFirstName - */ - public function getFirst_name() { - return $this->first_name; - } - - /** - * Last name of the invoice recipient. 30 characters max. - * - * @param string $last_name - */ - public function setLastName($last_name) { - $this->last_name = $last_name; - return $this; - } - - /** - * Last name of the invoice recipient. 30 characters max. - * - * @return string - */ - public function getLastName() { - return $this->last_name; - } - - /** - * Last name of the invoice recipient. 30 characters max. - * - * @param string $last_name - * @deprecated. Instead use setLastName - */ - public function setLast_name($last_name) { - $this->last_name = $last_name; - return $this; - } - /** - * Last name of the invoice recipient. 30 characters max. - * - * @return string - * @deprecated. Instead use getLastName - */ - public function getLast_name() { - return $this->last_name; - } - - /** - * Company business name of the invoice recipient. 100 characters max. - * - * @param string $business_name - */ - public function setBusinessName($business_name) { - $this->business_name = $business_name; - return $this; - } - - /** - * Company business name of the invoice recipient. 100 characters max. - * - * @return string - */ - public function getBusinessName() { - return $this->business_name; - } - - /** - * Company business name of the invoice recipient. 100 characters max. - * - * @param string $business_name - * @deprecated. Instead use setBusinessName - */ - public function setBusiness_name($business_name) { - $this->business_name = $business_name; - return $this; - } - /** - * Company business name of the invoice recipient. 100 characters max. - * - * @return string - * @deprecated. Instead use getBusinessName - */ - public function getBusiness_name() { - return $this->business_name; - } - - /** - * - * - * @param PayPal\Api\Phone $phone - */ - public function setPhone($phone) { - $this->phone = $phone; - return $this; - } - - /** - * - * - * @return PayPal\Api\Phone - */ - public function getPhone() { - return $this->phone; - } - - - /** - * Address of the invoice recipient. - * - * @param PayPal\Api\Address $address - */ - public function setAddress($address) { - $this->address = $address; - return $this; - } - - /** - * Address of the invoice recipient. - * - * @return PayPal\Api\Address - */ - public function getAddress() { - return $this->address; - } +class ShippingInfo extends PPModel +{ + /** + * First name of the invoice recipient. 30 characters max. + * + * @param string $first_name + */ + public function setFirstName($first_name) + { + $this->first_name = $first_name; + return $this; + } + + /** + * First name of the invoice recipient. 30 characters max. + * + * @return string + */ + public function getFirstName() + { + return $this->first_name; + } + + /** + * First name of the invoice recipient. 30 characters max. + * + * @param string $first_name + * @deprecated. Instead use setFirstName + */ + public function setFirst_name($first_name) + { + $this->first_name = $first_name; + return $this; + } + + /** + * First name of the invoice recipient. 30 characters max. + * + * @return string + * @deprecated. Instead use getFirstName + */ + public function getFirst_name() + { + return $this->first_name; + } + + /** + * Last name of the invoice recipient. 30 characters max. + * + * @param string $last_name + */ + public function setLastName($last_name) + { + $this->last_name = $last_name; + return $this; + } + + /** + * Last name of the invoice recipient. 30 characters max. + * + * @return string + */ + public function getLastName() + { + return $this->last_name; + } + + /** + * Last name of the invoice recipient. 30 characters max. + * + * @param string $last_name + * @deprecated. Instead use setLastName + */ + public function setLast_name($last_name) + { + $this->last_name = $last_name; + return $this; + } + + /** + * Last name of the invoice recipient. 30 characters max. + * + * @return string + * @deprecated. Instead use getLastName + */ + public function getLast_name() + { + return $this->last_name; + } + + /** + * Company business name of the invoice recipient. 100 characters max. + * + * @param string $business_name + */ + public function setBusinessName($business_name) + { + $this->business_name = $business_name; + return $this; + } + + /** + * Company business name of the invoice recipient. 100 characters max. + * + * @return string + */ + public function getBusinessName() + { + return $this->business_name; + } + + /** + * Company business name of the invoice recipient. 100 characters max. + * + * @param string $business_name + * @deprecated. Instead use setBusinessName + */ + public function setBusiness_name($business_name) + { + $this->business_name = $business_name; + return $this; + } + + /** + * Company business name of the invoice recipient. 100 characters max. + * + * @return string + * @deprecated. Instead use getBusinessName + */ + public function getBusiness_name() + { + return $this->business_name; + } + + /** + * + * + * @param PayPal\Api\Phone $phone + */ + public function setPhone($phone) + { + $this->phone = $phone; + return $this; + } + + /** + * + * + * @return PayPal\Api\Phone + */ + public function getPhone() + { + return $this->phone; + } + + + /** + * Address of the invoice recipient. + * + * @param PayPal\Api\Address $address + */ + public function setAddress($address) + { + $this->address = $address; + return $this; + } + + /** + * Address of the invoice recipient. + * + * @return PayPal\Api\Address + */ + public function getAddress() + { + return $this->address; + } } diff --git a/lib/PayPal/Api/Tax.php b/lib/PayPal/Api/Tax.php index 60c73ea7..751faf50 100644 --- a/lib/PayPal/Api/Tax.php +++ b/lib/PayPal/Api/Tax.php @@ -4,85 +4,94 @@ use PayPal\Common\PPModel; use PayPal\Rest\ApiContext; -class Tax extends PPModel { - /** - * Identifier of the resource. - * - * @param string $id - */ - public function setId($id) { - $this->id = $id; - return $this; - } +class Tax extends PPModel +{ + /** + * Identifier of the resource. + * + * @param string $id + */ + public function setId($id) + { + $this->id = $id; + return $this; + } - /** - * Identifier of the resource. - * - * @return string - */ - public function getId() { - return $this->id; - } + /** + * Identifier of the resource. + * + * @return string + */ + public function getId() + { + return $this->id; + } - /** - * Name of the tax. 10 characters max. - * - * @param string $name - */ - public function setName($name) { - $this->name = $name; - return $this; - } + /** + * Name of the tax. 10 characters max. + * + * @param string $name + */ + public function setName($name) + { + $this->name = $name; + return $this; + } - /** - * Name of the tax. 10 characters max. - * - * @return string - */ - public function getName() { - return $this->name; - } + /** + * Name of the tax. 10 characters max. + * + * @return string + */ + public function getName() + { + return $this->name; + } - /** - * Rate of the specified tax. Range of 0.001 to 99.999. - * - * @param PayPal\Api\number $percent - */ - public function setPercent($percent) { - $this->percent = $percent; - return $this; - } + /** + * Rate of the specified tax. Range of 0.001 to 99.999. + * + * @param PayPal\Api\number $percent + */ + public function setPercent($percent) + { + $this->percent = $percent; + return $this; + } - /** - * Rate of the specified tax. Range of 0.001 to 99.999. - * - * @return PayPal\Api\number - */ - public function getPercent() { - return $this->percent; - } + /** + * Rate of the specified tax. Range of 0.001 to 99.999. + * + * @return PayPal\Api\number + */ + public function getPercent() + { + return $this->percent; + } - /** - * Tax in the form of money. Cannot be specified in a request. - * - * @param PayPal\Api\Currency $amount - */ - public function setAmount($amount) { - $this->amount = $amount; - return $this; - } + /** + * Tax in the form of money. Cannot be specified in a request. + * + * @param PayPal\Api\Currency $amount + */ + public function setAmount($amount) + { + $this->amount = $amount; + return $this; + } - /** - * Tax in the form of money. Cannot be specified in a request. - * - * @return PayPal\Api\Currency - */ - public function getAmount() { - return $this->amount; - } + /** + * Tax in the form of money. Cannot be specified in a request. + * + * @return PayPal\Api\Currency + */ + public function getAmount() + { + return $this->amount; + } } diff --git a/lib/PayPal/Common/PPArrayUtil.php b/lib/PayPal/Common/PPArrayUtil.php new file mode 100644 index 00000000..6b6342e3 --- /dev/null +++ b/lib/PayPal/Common/PPArrayUtil.php @@ -0,0 +1,28 @@ + $v) { + if (is_int($k)) { + return false; + } + } + return true; + } +} \ No newline at end of file diff --git a/lib/PayPal/Common/PPModel.php b/lib/PayPal/Common/PPModel.php new file mode 100644 index 00000000..85177fd5 --- /dev/null +++ b/lib/PayPal/Common/PPModel.php @@ -0,0 +1,148 @@ +_propMap[$key]; + } + + /** + * Magic Set Method + * + * @param $key + * @param $value + */ + public function __set($key, $value) + { + $this->_propMap[$key] = $value; + } + + /** + * Magic isSet Method + * + * @param $key + * @return bool + */ + public function __isset($key) + { + return isset($this->_propMap[$key]); + } + + /** + * Magic Unset Method + * + * @param $key + */ + public function __unset($key) + { + unset($this->_propMap[$key]); + } + + /** + * Converts Params to Array + * + * @param $param + * @return array + */ + private function _convertToArray($param) + { + $ret = array(); + foreach ($param as $k => $v) { + if ($v instanceof PPModel) { + $ret[$k] = $v->toArray(); + } else if (is_array($v)) { + $ret[$k] = $this->_convertToArray($v); + } else { + $ret[$k] = $v; + } + } + return $ret; + } + + /** + * Fills object value from Array list + * + * @param $arr + * @return $this + */ + public function fromArray($arr) + { + + foreach ($arr as $k => $v) { + if (is_array($v)) { + $clazz = PPReflectionUtil::getPropertyClass(get_class($this), $k); + + if (PPArrayUtil::isAssocArray($v)) { + /** @var self $o */ + $o = new $clazz(); + $o->fromArray($v); + $this->__set($k, $o); + } else { + $arr = array(); + foreach ($v as $nk => $nv) { + if (is_array($nv)) { + $o = new $clazz(); + $o->fromArray($nv); + $arr[$nk] = $o; + } else { + $arr[$nk] = $nv; + } + } + $this->__set($k, $arr); + } + } else { + $this->$k = $v; + } + } + return $this; + } + + /** + * Fills object value from Json string + * + * @param $json + * @return $this + */ + public function fromJson($json) + { + return $this->fromArray(json_decode($json, true)); + } + + /** + * Returns array representation of object + * + * @return array + */ + public function toArray() + { + return $this->_convertToArray($this->_propMap); + } + + /** + * Returns object JSON representation + * + * @param int $options http://php.net/manual/en/json.constants.php + * @return string + */ + public function toJSON($options = 0) + { + return json_encode($this->toArray(), $options); + } +} \ No newline at end of file diff --git a/lib/PayPal/Common/PPReflectionUtil.php b/lib/PayPal/Common/PPReflectionUtil.php new file mode 100644 index 00000000..892bf3d0 --- /dev/null +++ b/lib/PayPal/Common/PPReflectionUtil.php @@ -0,0 +1,102 @@ +getDocComment(), + $annots, + PREG_PATTERN_ORDER)) { + return null; + } + foreach ($annots[1] as $i => $annot) { + $annotations[strtolower($annot)] = empty($annots[2][$i]) ? TRUE : rtrim($annots[2][$i], " \t\n\r)"); + } + + return $annotations; + } + + /** + * preg_replace_callback callback function + * + * @param $match + * @return string + */ + private static function replace_callback($match) + { + return ucwords($match[2]); + } +} diff --git a/lib/PayPal/Common/PPUserAgent.php b/lib/PayPal/Common/PPUserAgent.php new file mode 100644 index 00000000..1ce56553 --- /dev/null +++ b/lib/PayPal/Common/PPUserAgent.php @@ -0,0 +1,59 @@ + "30", + "http.Retry" => "5", + ); + + /** + * Singleton Object + * + * @var $this + */ + private static $instance; + + /** + * Private Constructor + */ + private function __construct() + { + if (defined('PP_CONFIG_PATH')) { + $configFile = constant('PP_CONFIG_PATH') . '/sdk_config.ini'; + } else { + $configFile = implode(DIRECTORY_SEPARATOR, + array(dirname(__FILE__), "..", "config", "sdk_config.ini")); + } + $this->addConfigFromIni($configFile); + } + + /** + * Returns the singleton object + * + * @return $this + */ + public static function getInstance() + { + if (!isset(self::$instance)) { + self::$instance = new self(); + } + return self::$instance; + } + + /** + * Add Configuration from configuration.ini files + * + * @param string $fileName + * @return $this + */ + public function addConfigFromIni($fileName) + { + if ($configs = @parse_ini_file($fileName)) { + $this->addConfigs($configs); + } + return $this; + } + + /** + * If a configuration exists in both arrays, + * then the element from the first array will be used and + * the matching key's element from the second array will be ignored. + * + * @param [] $config + * @return $this + */ + public function addConfigs($configs = []) + { + $this->configs = $configs + $this->configs; + return $this; + } + + /** + * Simple getter for configuration params + * If an exact match for key is not found, + * does a "contains" search on the key + * + * @param string $searchKey + * @return array + */ + public function get($searchKey) + { + + if (array_key_exists($searchKey, $this->configs)) { + return $this->configs[$searchKey]; + } else { + $arr = array(); + foreach ($this->configs as $k => $v) { + if (strstr($k, $searchKey)) { + $arr[$k] = $v; + } + } + + return $arr; + } + + } + + /** + * Utility method for handling account configuration + * return config key corresponding to the API userId passed in + * + * If $userId is null, returns config keys corresponding to + * all configured accounts + * + * @param string|null $userId + * @return array|string + */ + public function getIniPrefix($userId = null) + { + + if ($userId == null) { + $arr = array(); + foreach ($this->configs as $key => $value) { + $pos = strpos($key, '.'); + if (strstr($key, "acct")) { + $arr[] = substr($key, 0, $pos); + } + } + return array_unique($arr); + } else { + $iniPrefix = array_search($userId, $this->configs); + $pos = strpos($iniPrefix, '.'); + $acct = substr($iniPrefix, 0, $pos); + + return $acct; + } + } + + /** + * returns the config file hashmap + */ + public function getConfigHashmap() + { + return $this->configs; + } + + /** + * Disabling __clone call + */ + public function __clone() + { + trigger_error('Clone is not allowed.', E_USER_ERROR); + } + +} + + diff --git a/lib/PayPal/Core/PPConstants.php b/lib/PayPal/Core/PPConstants.php new file mode 100644 index 00000000..2f97e224 --- /dev/null +++ b/lib/PayPal/Core/PPConstants.php @@ -0,0 +1,19 @@ +initCredential($config); + } catch (\Exception $e) { + $this->credentialHashmap = array(); + throw $e; + } + } + + /** + * Create singleton instance for this class. + * + * @param array|null $config + * @return PPCredentialManager + */ + public static function getInstance($config = null) + { + if (!self::$instance) { + self::$instance = new self($config == null ? PPConfigManager::getInstance()->getConfigHashmap() : $config); + } + return self::$instance; + } + + /** + * Load credentials for multiple accounts, with priority given to Signature credential. + * + * @param [] $config + */ + private function initCredential($config) + { + $suffix = 1; + $prefix = "acct"; + + $arr = array(); + foreach ($config as $k => $v) { + if (strstr($k, $prefix)) { + $arr[$k] = $v; + } + } + $credArr = $arr; + + $arr = array(); + foreach ($config as $key => $value) { + $pos = strpos($key, '.'); + if (strstr($key, "acct")) { + $arr[] = substr($key, 0, $pos); + } + } + $arrayPartKeys = array_unique($arr); + + $key = $prefix . $suffix; + $userName = null; + while (in_array($key, $arrayPartKeys)) { + if (isset($credArr[$key . ".ClientId"]) && isset($credArr[$key . ".ClientId"])) { + $userName = $key; + $this->credentialHashmap[$userName] = new OAuthTokenCredential( + $credArr[$key . ".ClientId"], + $credArr[$key . ".ClientSecret"] + ); + } + if ($userName && $this->defaultAccountName == null) { + if (array_key_exists($key . '.UserName', $credArr)) { + $this->defaultAccountName = $credArr[$key . '.UserName']; + } else { + $this->defaultAccountName = $key; + } + } + $suffix++; + $key = $prefix . $suffix; + } + + } + + /** + * Sets credential object for users + * + * @param \PayPal\Auth\OAuthTokenCredential $credential + * @param string|null $userId User Id associated with the account + * @param bool $default If set, it would make it as a default credential for all requests + * + * @return $this + */ + public function setCredentialObject(OAuthTokenCredential $credential, $userId = null, $default = true) + { + $key = $userId == null ? 'default' : $userId; + $this->credentialHashmap[$key] = $credential; + if ($default) { + $this->defaultAccountName = $key; + } + return $this; + } + + /** + * Obtain Credential Object based on UserId provided. + * + * @param null $userId + * @return OAuthTokenCredential + * @throws PPInvalidCredentialException + */ + public function getCredentialObject($userId = null) + { + if ($userId == null) { + $credObj = $this->credentialHashmap[$this->defaultAccountName]; + } else if (array_key_exists($userId, $this->credentialHashmap)) { + $credObj = $this->credentialHashmap[$userId]; + } + + if (empty($credObj)) { + throw new PPInvalidCredentialException("Invalid userId $userId"); + } + return $credObj; + } + + /** + * Disabling __clone call + */ + public function __clone() + { + trigger_error('Clone is not allowed.', E_USER_ERROR); + } + +} diff --git a/lib/PayPal/Core/PPHttpConfig.php b/lib/PayPal/Core/PPHttpConfig.php new file mode 100644 index 00000000..8c294cff --- /dev/null +++ b/lib/PayPal/Core/PPHttpConfig.php @@ -0,0 +1,258 @@ + 3, + CURLOPT_CONNECTTIMEOUT => 10, + CURLOPT_RETURNTRANSFER => TRUE, + CURLOPT_TIMEOUT => 60, // maximum number of seconds to allow cURL functions to execute + CURLOPT_USERAGENT => 'PayPal-PHP-SDK', + CURLOPT_HTTPHEADER => array(), + CURLOPT_SSL_VERIFYHOST => 2, + CURLOPT_SSL_VERIFYPEER => 1 + ); + + + const HEADER_SEPARATOR = ';'; + const HTTP_GET = 'GET'; + const HTTP_POST = 'POST'; + + private $headers = array(); + + private $curlOptions; + + private $url; + + private $method; + + /*** + * Number of times to retry a failed HTTP call + */ + private $retryCount = 0; + + /** + * Default Constructor + * + * @param string $url + * @param string $method HTTP method (GET, POST etc) defaults to POST + */ + public function __construct($url = null, $method = self::HTTP_POST) + { + $this->url = $url; + $this->method = $method; + $this->curlOptions = self::$defaultCurlOptions; + } + + /** + * Gets Url + * + * @return null|string + */ + public function getUrl() + { + return $this->url; + } + + /** + * Gets Method + * + * @return string + */ + public function getMethod() + { + return $this->method; + } + + /** + * Gets all Headers + * + * @return array + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Get Header by Name + * + * @param $name + * @return string|null + */ + public function getHeader($name) + { + if (array_key_exists($name, $this->headers)) { + return $this->headers[$name]; + } + return null; + } + + /** + * Sets Url + * + * @param $url + */ + public function setUrl($url) + { + $this->url = $url; + } + + /** + * Set Headers + * + * @param array $headers + */ + public function setHeaders(array $headers = []) + { + $this->headers = $headers; + } + + /** + * Adds a Header + * + * @param $name + * @param $value + * @param bool $overWrite allows you to override header value + */ + public function addHeader($name, $value, $overWrite = true) + { + if (!array_key_exists($name, $this->headers) || $overWrite) { + $this->headers[$name] = $value; + } else { + $this->headers[$name] = $this->headers[$name] . self::HEADER_SEPARATOR . $value; + } + } + + /** + * Removes a Header + * + * @param $name + */ + public function removeHeader($name) + { + unset($this->headers[$name]); + } + + /** + * Gets all curl options + * + * @return array + */ + public function getCurlOptions() + { + return $this->curlOptions; + } + + /** + * Add Curl Option + * + * @param string $name + * @param mixed $value + */ + public function addCurlOption($name, $value) + { + $this->curlOptions[$name] = $value; + } + + /** + * Set Curl Options. Overrides all curl options + * + * @param $options + */ + public function setCurlOptions($options) + { + $this->curlOptions = $options; + } + + /** + * Set ssl parameters for certificate based client authentication + * + * @param $certPath + * @param null $passPhrase + */ + public function setSSLCert($certPath, $passPhrase = null) + { + $this->curlOptions[CURLOPT_SSLCERT] = realpath($certPath); + if (isset($passPhrase) && trim($passPhrase) != "") { + $this->curlOptions[CURLOPT_SSLCERTPASSWD] = $passPhrase; + } + } + + /** + * Set connection timeout in seconds + * + * @param integer $timeout + */ + public function setHttpTimeout($timeout) + { + $this->curlOptions[CURLOPT_CONNECTTIMEOUT] = $timeout; + } + + /** + * Set HTTP proxy information + * + * @param string $proxy + * @throws PPConfigurationException + */ + public function setHttpProxy($proxy) + { + $urlParts = parse_url($proxy); + if ($urlParts == false || !array_key_exists("host", $urlParts)) { + throw new PPConfigurationException("Invalid proxy configuration " . $proxy); + } + $this->curlOptions[CURLOPT_PROXY] = $urlParts["host"]; + if (isset($urlParts["port"])) { + $this->curlOptions[CURLOPT_PROXY] .= ":" . $urlParts["port"]; + } + if (isset($urlParts["user"])) { + $this->curlOptions[CURLOPT_PROXYUSERPWD] = $urlParts["user"] . ":" . $urlParts["pass"]; + } + } + + /** + * Set Http Retry Counts + * + * @param int $retryCount + */ + public function setHttpRetryCount($retryCount) + { + $this->retryCount = $retryCount; + } + + /** + * Get Http Retry Counts + * + * @return int + */ + public function getHttpRetryCount() + { + return $this->retryCount; + } + + /** + * Sets the User-Agent string on the HTTP request + * + * @param string $userAgentString + */ + public function setUserAgent($userAgentString) + { + $this->curlOptions[CURLOPT_USERAGENT] = $userAgentString; + } +} diff --git a/lib/PayPal/Core/PPHttpConnection.php b/lib/PayPal/Core/PPHttpConnection.php new file mode 100644 index 00000000..6be52020 --- /dev/null +++ b/lib/PayPal/Core/PPHttpConnection.php @@ -0,0 +1,171 @@ +httpConfig = $httpConfig; + $this->logger = new PPLoggingManager(__CLASS__, $config); + } + + /** + * Gets all Http Headers + * + * @return array + */ + private function getHttpHeaders() + { + + $ret = array(); + foreach ($this->httpConfig->getHeaders() as $k => $v) { + $ret[] = "$k: $v"; + } + return $ret; + } + + /** + * Executes an HTTP request + * + * @param string $data query string OR POST content as a string + * @throws PPConnectionException + */ + /** + * Executes an HTTP request + * + * @param string $data query string OR POST content as a string + * @return mixed + * @throws PPConnectionException + */ + public function execute($data) + { + //Initialize the logger + $this->logger->fine("Connecting to " . $this->httpConfig->getUrl()); + $this->logger->fine("Payload " . $data); + + //Initialize Curl Options + $ch = curl_init($this->httpConfig->getUrl()); + curl_setopt_array($ch, $this->httpConfig->getCurlOptions()); + curl_setopt($ch, CURLOPT_URL, $this->httpConfig->getUrl()); + curl_setopt($ch, CURLOPT_HEADER, false); + curl_setopt($ch, CURLOPT_HTTPHEADER, $this->getHttpHeaders()); + + //Determine Curl Options based on Method + switch ($this->httpConfig->getMethod()) { + case 'POST': + curl_setopt($ch, CURLOPT_POST, true); + case 'PUT': + case 'PATCH': + curl_setopt($ch, CURLOPT_POSTFIELDS, $data); + break; + } + //Default Option if Method not of given types in switch case + if ($this->httpConfig->getMethod() != NULL) { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->httpConfig->getMethod()); + } + + //Logging Each Headers for debugging purposes + foreach ($this->getHttpHeaders() as $header) { + //TODO: Strip out credentials and other secure info when logging. + $this->logger->info("Adding header $header"); + } + + //Execute Curl Request + $result = curl_exec($ch); + + //Retry if Certificate Exception + if (curl_errno($ch) == 60) { + $this->logger->info("Invalid or no certificate authority found - Retrying using bundled CA certs file"); + curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem'); + $result = curl_exec($ch); + } + + //Retrieve Response Status + $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); + + //Retry if Failing + $retries = 0; + if (in_array($httpStatus, self::$retryCodes) && $this->httpConfig->getHttpRetryCount() != null) { + $this->logger->info("Got $httpStatus response from server. Retrying"); + do { + $result = curl_exec($ch); + $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); + } while (in_array($httpStatus, self::$retryCodes) && (++$retries < $this->httpConfig->getHttpRetryCount())); + } + + //Throw Exception if Retries and Certificates doenst work + if (curl_errno($ch)) { + $ex = new PPConnectionException( + $this->httpConfig->getUrl(), + curl_error($ch), + curl_errno($ch) + ); + curl_close($ch); + throw $ex; + } + + //Close the curl request + curl_close($ch); + + //More Exceptions based on HttpStatus Code + if (in_array($httpStatus, self::$retryCodes)) { + $ex = new PPConnectionException( + $this->httpConfig->getUrl(), + "Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}. " . + "Retried $retries times." + ); + $ex->setData($result); + throw $ex; + } else if ($httpStatus < 200 || $httpStatus >= 300) { + $ex = new PPConnectionException( + $this->httpConfig->getUrl(), + "Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}." + ); + $ex->setData($result); + throw $ex; + } + + //Return result object + return $result; + } + +} diff --git a/lib/PayPal/Core/PPLoggingLevel.php b/lib/PayPal/Core/PPLoggingLevel.php new file mode 100644 index 00000000..af592872 --- /dev/null +++ b/lib/PayPal/Core/PPLoggingLevel.php @@ -0,0 +1,23 @@ +loggerName = $loggerName; + $config = PPConfigManager::getInstance()->getConfigHashmap(); + + $this->isLoggingEnabled = (array_key_exists('log.LogEnabled', $config) && $config['log.LogEnabled'] == '1'); + + if ($this->isLoggingEnabled) { + $this->loggerFile = ($config['log.FileName']) ? $config['log.FileName'] : ini_get('error_log'); + $loggingLevel = strtoupper($config['log.LogLevel']); + $this->loggingLevel = + (isset($loggingLevel) && defined(__NAMESPACE__ . "\\PPLoggingLevel::$loggingLevel")) ? + constant(__NAMESPACE__ . "\\PPLoggingLevel::$loggingLevel") : + PPLoggingManager::DEFAULT_LOGGING_LEVEL; + } + } + + /** + * Default Logger + * + * @param string $message + * @param int $level + */ + private function log($message, $level = PPLoggingLevel::INFO) + { + if ($this->isLoggingEnabled && ($level <= $this->loggingLevel)) { + error_log($this->loggerName . ": $message\n", 3, $this->loggerFile); + } + } + + /** + * Log Error + * + * @param string $message + */ + public function error($message) + { + $this->log($message, PPLoggingLevel::ERROR); + } + + /** + * Log Warning + * + * @param string $message + */ + public function warning($message) + { + $this->log($message, PPLoggingLevel::WARN); + } + + /** + * Log Info + * + * @param string $message + */ + public function info($message) + { + $this->log($message, PPLoggingLevel::INFO); + } + + /** + * Log Fine + * + * @param string $message + */ + public function fine($message) + { + $this->log($message, PPLoggingLevel::FINE); + } + +} diff --git a/lib/PayPal/Exception/PPConfigurationException.php b/lib/PayPal/Exception/PPConfigurationException.php new file mode 100644 index 00000000..b17d2eb7 --- /dev/null +++ b/lib/PayPal/Exception/PPConfigurationException.php @@ -0,0 +1,23 @@ +url = $url; + } + + /** + * Sets Data + * + * @param $data + */ + public function setData($data) + { + $this->data = $data; + } + + /** + * Gets Data + * + * @return string + */ + public function getData() + { + return $this->data; + } + + /** + * Gets Url + * + * @return string + */ + public function getUrl() + { + return $this->url; + } +} \ No newline at end of file diff --git a/lib/PayPal/Exception/PPInvalidCredentialException.php b/lib/PayPal/Exception/PPInvalidCredentialException.php new file mode 100644 index 00000000..71b6f59f --- /dev/null +++ b/lib/PayPal/Exception/PPInvalidCredentialException.php @@ -0,0 +1,36 @@ +getLine() . ' in ' . $this->getFile() + . ': ' . $this->getMessage() . ''; + return $errorMsg; + } + +} \ No newline at end of file diff --git a/lib/PayPal/Exception/PPMissingCredentialException.php b/lib/PayPal/Exception/PPMissingCredentialException.php new file mode 100644 index 00000000..a5ecae91 --- /dev/null +++ b/lib/PayPal/Exception/PPMissingCredentialException.php @@ -0,0 +1,37 @@ +getLine() . ' in ' . $this->getFile() + . ': ' . $this->getMessage() . ''; + + return $errorMsg; + } + +} \ No newline at end of file diff --git a/lib/PayPal/Handler/IPPHandler.php b/lib/PayPal/Handler/IPPHandler.php new file mode 100644 index 00000000..dc57589f --- /dev/null +++ b/lib/PayPal/Handler/IPPHandler.php @@ -0,0 +1,20 @@ +credential == null) { + return PPCredentialManager::getInstance()->getCredentialObject(); + } return $this->credential; } @@ -58,16 +65,46 @@ public function getrequestId() * @param \PayPal\Auth\OAuthTokenCredential $credential * @param string|null $requestId */ - public function __construct($credential, $requestId = null) + public function __construct($credential = null, $requestId = null) { - $this->credential = $credential; $this->requestId = $requestId; + $this->credential = $credential; + } + + /** + * Sets Config + * + * @param array $config SDK configuration parameters + */ + public function setConfig(array $config) + { + PPConfigManager::getInstance()->addConfigs($config); + } + + /** + * Gets Configurations + * + * @return array + */ + public function getConfig() + { + return PPConfigManager::getInstance()->getConfigHashmap(); + } + + /** + * Gets a specific configuration from key + * + * @param $searchKey + */ + public function get($searchKey) + { + PPConfigManager::getInstance()->get($searchKey); } /** * Generates a unique per request id that * can be used to set the PayPal-Request-Id header - * that is used for idemptency + * that is used for idempotency * * @return string */ diff --git a/lib/PayPal/Rest/IResource.php b/lib/PayPal/Rest/IResource.php index 0f762f04..281ac470 100644 --- a/lib/PayPal/Rest/IResource.php +++ b/lib/PayPal/Rest/IResource.php @@ -4,6 +4,8 @@ /** * Interface IResource + * + * @package PayPal\Rest */ interface IResource { diff --git a/lib/PayPal/Rest/RestHandler.php b/lib/PayPal/Rest/RestHandler.php index 9331d6ea..63bfe439 100644 --- a/lib/PayPal/Rest/RestHandler.php +++ b/lib/PayPal/Rest/RestHandler.php @@ -51,14 +51,13 @@ public function __construct($apiContext) } /** - * Handle - * - * @param \PayPal\Core\PPHttpConfig $httpConfig - * @param \PayPal\Core\PPRequest $request - * @param array $options - * - * @throws \PayPal\Exception\PPInvalidCredentialException - * @throws \PayPal\Exception\PPMissingCredentialException + * @param \Paypal\Core\PPHttpConfig $httpConfig + * @param string $request + * @param mixed $options + * @return mixed|void + * @throws PPConfigurationException + * @throws PPInvalidCredentialException + * @throws PPMissingCredentialException */ public function handle($httpConfig, $request, $options) { @@ -125,7 +124,9 @@ private function _getEndpoint($config) break; } } else { - throw new PPConfigurationException('You must set one of service.endpoint or mode parameters in your configuration'); + throw new PPConfigurationException( + 'You must set one of service.endpoint or mode parameters in your configuration' + ); } } } diff --git a/lib/PayPal/Transport/PPRestCall.php b/lib/PayPal/Transport/PPRestCall.php new file mode 100644 index 00000000..c23fe222 --- /dev/null +++ b/lib/PayPal/Transport/PPRestCall.php @@ -0,0 +1,78 @@ +apiContext = $apiContext; + $this->logger = new PPLoggingManager(__CLASS__, $apiContext->getConfig()); + } + + /** + * @param array $handlers Array of handlers + * @param string $path Resource path relative to base service endpoint + * @param string $method HTTP method - one of GET, POST, PUT, DELETE, PATCH etc + * @param string $data Request payload + * @param array $headers HTTP headers + * @return mixed + * @throws \PayPal\Exception\PPConnectionException + */ + public function execute($handlers = [], $path, $method, $data = '', $headers = array()) + { + + $config = $this->apiContext->getConfig(); + $httpConfig = new PPHttpConfig(null, $method); + $httpConfig->setHeaders($headers + + array( + 'Content-Type' => 'application/json' + ) + ); + + /** @var \Paypal\Handler\IPPHandler $handler */ + foreach ($handlers as $handler) { + if (!is_object($handler)) { + $fullHandler = "\\" . (string)$handler; + $handler = new $fullHandler($this->apiContext); + } + $handler->handle($httpConfig, $data, array('path' => $path, 'apiContext' => $this->apiContext)); + } + $connection = new PPHttpConnection($httpConfig, $config); + $response = $connection->execute($data); + $this->logger->fine($response); + + return $response; + } + +} diff --git a/release_notes.md b/release_notes.md index d7b9089e..d4dc3975 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,6 +1,11 @@ PayPal PHP SDK release notes ============================ +v0.11.1 +---- +* Removed Dependency from SDK Core Project +* Enabled Future Payments + v0.11.0 ---- * Ability for PUT and PATCH requests @@ -25,7 +30,7 @@ v0.7.0 ----- * Added support for Auth and Capture APIs * Types modified to match the API Spec -* Updated SDK to use namespace supported core library +* Updated SDK to use namespace supported core library v0.6.0 ----- @@ -34,4 +39,4 @@ v0.6.0 v0.5.0 ----- -* Initial Release \ No newline at end of file +* Initial Release diff --git a/sample/bootstrap.php b/sample/bootstrap.php index 8352f536..12b0abfa 100644 --- a/sample/bootstrap.php +++ b/sample/bootstrap.php @@ -6,13 +6,12 @@ // Include the composer autoloader // The location of your project's vendor autoloader. $composerAutoload = dirname(dirname(dirname(__DIR__))) . '/autoload.php'; -if (!file_exists($composerAutoload)) -{ +if (!file_exists($composerAutoload)) { //If the project is used as its own project, it would use rest-api-sdk-php composer autoloader. - $composerAutoload = dirname(__DIR__) .'/vendor/autoload.php'; + $composerAutoload = dirname(__DIR__) . '/vendor/autoload.php'; - if(!file_exists($composerAutoload)) { + if (!file_exists($composerAutoload)) { echo "The 'vendor' folder is missing. You must run 'composer update' to resolve application dependencies.\nPlease see the README for more information.\n"; exit(1); } @@ -32,46 +31,46 @@ * * @return PayPal\Rest\ApiContext */ -function getApiContext() { - - // ### Api context - // Use an ApiContext object to authenticate - // API calls. The clientId and clientSecret for the - // OAuthTokenCredential class can be retrieved from - // developer.paypal.com +function getApiContext() +{ + + // ### Api context + // Use an ApiContext object to authenticate + // API calls. The clientId and clientSecret for the + // OAuthTokenCredential class can be retrieved from + // developer.paypal.com - $apiContext = new ApiContext( - new OAuthTokenCredential( - 'EBWKjlELKMYqRNQ6sYvFo64FtaRLRR5BdHEESmha49TM', - 'EO422dn3gQLgDbuwqTjzrFgFtaRLRR5BdHEESmha49TM' - ) - ); + $apiContext = new ApiContext( + new OAuthTokenCredential( + 'EBWKjlELKMYqRNQ6sYvFo64FtaRLRR5BdHEESmha49TM', + 'EO422dn3gQLgDbuwqTjzrFgFtaRLRR5BdHEESmha49TM' + ) + ); + // #### SDK configuration - // #### SDK configuration - - // Comment this line out and uncomment the PP_CONFIG_PATH - // 'define' block if you want to use static file - // based configuration + // Comment this line out and uncomment the PP_CONFIG_PATH + // 'define' block if you want to use static file + // based configuration - $apiContext->setConfig( - array( - 'mode' => 'sandbox', - 'http.ConnectionTimeOut' => 30, - 'log.LogEnabled' => true, - 'log.FileName' => '../PayPal.log', - 'log.LogLevel' => 'FINE' - ) - ); - - /* - // Register the sdk_config.ini file in current directory - // as the configuration source. - if(!defined("PP_CONFIG_PATH")) { - define("PP_CONFIG_PATH", __DIR__); - } - */ + $apiContext->setConfig( + array( + 'mode' => 'sandbox', + 'http.ConnectionTimeOut' => 30, + 'log.LogEnabled' => true, + 'log.FileName' => '../PayPal.log', + 'log.LogLevel' => 'FINE' + ) + ); + + /* + // Register the sdk_config.ini file in current directory + // as the configuration source. + if(!defined("PP_CONFIG_PATH")) { + define("PP_CONFIG_PATH", __DIR__); + } + */ - return $apiContext; + return $apiContext; } diff --git a/sample/source/assets/behavior.js b/sample/doc/assets/behavior.js similarity index 71% rename from sample/source/assets/behavior.js rename to sample/doc/assets/behavior.js index 8f217e10..364695fa 100644 --- a/sample/source/assets/behavior.js +++ b/sample/doc/assets/behavior.js @@ -6,318 +6,1387 @@ f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3 tableOfContents = [ { - "type": "file", + "type": "folder", "data": { - "language": { - "nameMatchers": [{}, ".fbp"], - "pygmentsLexer": "php", - "singleLineComment": ["//"], - "ignorePrefix": "}", - "foldPrefix": "^", - "name": "PHP" - }, - "projectPath": "CreatePayment.php", - "targetPath": "CreatePayment", - "pageTitle": "CreatePayment", - "title": "CreatePayment" + "path": "invoice", + "title": "invoice" }, "depth": 1, - "outline": [ + "children": [ { - "type": "heading", + "type": "file", "data": { - "level": 1, - "title": "CreatePaymentSample", - "slug": "createpaymentsample" + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/invoice/CancelInvoice.php", + "projectPath": "sample/invoice/CancelInvoice.php", + "targetPath": "invoice/CancelInvoice", + "pageTitle": "invoice/CancelInvoice", + "title": "CancelInvoice" }, - "depth": 1, - "children": [ + "depth": 2, + "outline": [ { "type": "heading", "data": { - "level": 3, - "title": "CreditCard", - "slug": "creditcard" + "level": 1, + "title": "Cancel Invoice Sample", + "slug": "cancel-invoice-sample" }, - "depth": 3 - }, { - "type": "heading", - "data": { - "level": 3, - "title": "FundingInstrument", - "slug": "fundinginstrument" - }, - "depth": 3 - }, { - "type": "heading", - "data": { - "level": 3, - "title": "Payer", - "slug": "payer" - }, - "depth": 3 - }, { - "type": "heading", - "data": { - "level": 3, - "title": "Itemized information", - "slug": "itemized-information" - }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Retrieve Invoice", + "slug": "retrieve-invoice" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Cancel Notification Object", + "slug": "cancel-notification-object" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Cancel Invoice", + "slug": "cancel-invoice" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/invoice/CreateInvoice.php", + "projectPath": "sample/invoice/CreateInvoice.php", + "targetPath": "invoice/CreateInvoice", + "pageTitle": "invoice/CreateInvoice", + "title": "CreateInvoice" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Additional payment details", - "slug": "additional-payment-details" + "level": 1, + "title": "Create Invoice Sample", + "slug": "create-invoice-sample" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Invoice Info", + "slug": "invoice-info" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Merchant Info", + "slug": "merchant-info" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Address Information", + "slug": "address-information" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Billing Information", + "slug": "billing-information" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Items List", + "slug": "items-list" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Shipping Information", + "slug": "shipping-information" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Create Invoice", + "slug": "create-invoice" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/invoice/GetInvoice.php", + "projectPath": "sample/invoice/GetInvoice.php", + "targetPath": "invoice/GetInvoice", + "pageTitle": "invoice/GetInvoice", + "title": "GetInvoice" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Amount", - "slug": "amount" + "level": 1, + "title": "Get Invoice Sample", + "slug": "get-invoice-sample" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Retrieve Invoice", + "slug": "retrieve-invoice" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/invoice/ListInvoice.php", + "projectPath": "sample/invoice/ListInvoice.php", + "targetPath": "invoice/ListInvoice", + "pageTitle": "invoice/ListInvoice", + "title": "ListInvoice" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Transaction", - "slug": "transaction" + "level": 1, + "title": "List Invoices Sample", + "slug": "list-invoices-sample" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Retrieve Invoices", + "slug": "retrieve-invoices" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/invoice/RemindInvoice.php", + "projectPath": "sample/invoice/RemindInvoice.php", + "targetPath": "invoice/RemindInvoice", + "pageTitle": "invoice/RemindInvoice", + "title": "RemindInvoice" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Payment", - "slug": "payment" + "level": 1, + "title": "Remind Invoice Sample", + "slug": "remind-invoice-sample" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Retrieve Invoice", + "slug": "retrieve-invoice" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Notification Object", + "slug": "notification-object" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Remind Invoice", + "slug": "remind-invoice" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/invoice/SendInvoice.php", + "projectPath": "sample/invoice/SendInvoice.php", + "targetPath": "invoice/SendInvoice", + "pageTitle": "invoice/SendInvoice", + "title": "SendInvoice" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Create Payment", - "slug": "create-payment" + "level": 1, + "title": "Create Invoice Sample", + "slug": "create-invoice-sample" }, - "depth": 3 + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Retrieve Invoice", + "slug": "retrieve-invoice" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Send Invoice", + "slug": "send-invoice" + }, + "depth": 3 + } + ] } ] } ] }, { - "type": "file", + "type": "folder", "data": { - "language": { - "nameMatchers": [{}, ".fbp"], - "pygmentsLexer": "php", - "singleLineComment": ["//"], - "ignorePrefix": "}", - "foldPrefix": "^", - "name": "PHP" - }, - "projectPath": "CreatePaymentUsingPayPal.php", - "targetPath": "CreatePaymentUsingPayPal", - "pageTitle": "CreatePaymentUsingPayPal", - "title": "CreatePaymentUsingPayPal" + "path": "payments", + "title": "payments" }, "depth": 1, - "outline": [ + "children": [ { - "type": "heading", + "type": "file", "data": { - "level": 1, - "title": "Create Payment using PayPal as payment method", - "slug": "create-payment-using-paypal-as-payment-method" + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/AuthorizationCapture.php", + "projectPath": "sample/payments/AuthorizationCapture.php", + "targetPath": "payments/AuthorizationCapture", + "pageTitle": "payments/AuthorizationCapture", + "title": "AuthorizationCapture" }, - "depth": 1, - "children": [ + "depth": 2, + "outline": [ { "type": "heading", "data": { - "level": 3, - "title": "Payer", - "slug": "payer" + "level": 1, + "title": "AuthorizationCapture", + "slug": "authorizationcapture" }, - "depth": 3 - }, { - "type": "heading", - "data": { - "level": 3, - "title": "Itemized information", - "slug": "itemized-information" - }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Capture Payment", + "slug": "capture-payment" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/CreateFuturePayment.php", + "projectPath": "sample/payments/CreateFuturePayment.php", + "targetPath": "payments/CreateFuturePayment", + "pageTitle": "payments/CreateFuturePayment", + "title": "CreateFuturePayment" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Additional payment details", - "slug": "additional-payment-details" + "level": 1, + "title": "Create Payment using PayPal as payment method", + "slug": "create-payment-using-paypal-as-payment-method" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Payer", + "slug": "payer" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Amount", + "slug": "amount" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Transaction", + "slug": "transaction" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Redirect urls", + "slug": "redirect-urls" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Payment", + "slug": "payment" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Get Refresh Token", + "slug": "get-refresh-token" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Create Future Payment", + "slug": "create-future-payment" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/CreatePayment.php", + "projectPath": "sample/payments/CreatePayment.php", + "targetPath": "payments/CreatePayment", + "pageTitle": "payments/CreatePayment", + "title": "CreatePayment" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Amount", - "slug": "amount" + "level": 1, + "title": "CreatePaymentSample", + "slug": "createpaymentsample" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "CreditCard", + "slug": "creditcard" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "FundingInstrument", + "slug": "fundinginstrument" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Payer", + "slug": "payer" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Itemized information", + "slug": "itemized-information" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Additional payment details", + "slug": "additional-payment-details" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Amount", + "slug": "amount" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Transaction", + "slug": "transaction" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Payment", + "slug": "payment" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Create Payment", + "slug": "create-payment" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/CreatePaymentUsingPayPal.php", + "projectPath": "sample/payments/CreatePaymentUsingPayPal.php", + "targetPath": "payments/CreatePaymentUsingPayPal", + "pageTitle": "payments/CreatePaymentUsingPayPal", + "title": "CreatePaymentUsingPayPal" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Transaction", - "slug": "transaction" + "level": 1, + "title": "Create Payment using PayPal as payment method", + "slug": "create-payment-using-paypal-as-payment-method" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Payer", + "slug": "payer" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Itemized information", + "slug": "itemized-information" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Additional payment details", + "slug": "additional-payment-details" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Amount", + "slug": "amount" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Transaction", + "slug": "transaction" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Redirect urls", + "slug": "redirect-urls" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Payment", + "slug": "payment" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Create Payment", + "slug": "create-payment" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Get redirect url", + "slug": "get-redirect-url" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Redirect buyer to PayPal website", + "slug": "redirect-buyer-to-paypal-website" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/CreatePaymentUsingSavedCard.php", + "projectPath": "sample/payments/CreatePaymentUsingSavedCard.php", + "targetPath": "payments/CreatePaymentUsingSavedCard", + "pageTitle": "payments/CreatePaymentUsingSavedCard", + "title": "CreatePaymentUsingSavedCard" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Redirect urls", - "slug": "redirect-urls" + "level": 1, + "title": "Create payment using a saved credit card", + "slug": "create-payment-using-a-saved-credit-card" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Credit card token", + "slug": "credit-card-token" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "FundingInstrument", + "slug": "fundinginstrument" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Payer", + "slug": "payer" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Itemized information", + "slug": "itemized-information" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Additional payment details", + "slug": "additional-payment-details" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Amount", + "slug": "amount" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Transaction", + "slug": "transaction" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Payment", + "slug": "payment" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Create Payment", + "slug": "create-payment" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/ExecutePayment.php", + "projectPath": "sample/payments/ExecutePayment.php", + "targetPath": "payments/ExecutePayment", + "pageTitle": "payments/ExecutePayment", + "title": "ExecutePayment" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Payment", - "slug": "payment" + "level": 1, + "title": "Execute Payment Sample", + "slug": "execute-payment-sample" }, - "depth": 3 - }, { + "depth": 1 + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/GetAuthorization.php", + "projectPath": "sample/payments/GetAuthorization.php", + "targetPath": "payments/GetAuthorization", + "pageTitle": "payments/GetAuthorization", + "title": "GetAuthorization" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Create Payment", - "slug": "create-payment" + "level": 1, + "title": "GetAuthorization", + "slug": "getauthorization" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "GetAuthorization", + "slug": "getauthorization" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/GetCapture.php", + "projectPath": "sample/payments/GetCapture.php", + "targetPath": "payments/GetCapture", + "pageTitle": "payments/GetCapture", + "title": "GetCapture" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Get redirect url", - "slug": "get-redirect-url" + "level": 1, + "title": "GetCapture", + "slug": "getcapture" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Create a mock Capture", + "slug": "create-a-mock-capture" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Retrieve Capture details", + "slug": "retrieve-capture-details" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/GetPayment.php", + "projectPath": "sample/payments/GetPayment.php", + "targetPath": "payments/GetPayment", + "pageTitle": "payments/GetPayment", + "title": "GetPayment" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Redirect buyer to PayPal website", - "slug": "redirect-buyer-to-paypal-website" + "level": 1, + "title": "GetPaymentSample", + "slug": "getpaymentsample" }, - "depth": 3 + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Retrieve payment", + "slug": "retrieve-payment" + }, + "depth": 3 + } + ] } ] - } - ] - }, { - "type": "file", - "data": { - "language": { - "nameMatchers": [{}, ".fbp"], - "pygmentsLexer": "php", - "singleLineComment": ["//"], - "ignorePrefix": "}", - "foldPrefix": "^", - "name": "PHP" - }, - "projectPath": "CreatePaymentUsingSavedCard.php", - "targetPath": "CreatePaymentUsingSavedCard", - "pageTitle": "CreatePaymentUsingSavedCard", - "title": "CreatePaymentUsingSavedCard" - }, - "depth": 1, - "outline": [ - { - "type": "heading", + }, { + "type": "file", "data": { - "level": 1, - "title": "Create payment using a saved credit card", - "slug": "create-payment-using-a-saved-credit-card" + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/ListPayments.php", + "projectPath": "sample/payments/ListPayments.php", + "targetPath": "payments/ListPayments", + "pageTitle": "payments/ListPayments", + "title": "ListPayments" }, - "depth": 1, - "children": [ + "depth": 2, + "outline": [ { "type": "heading", "data": { - "level": 3, - "title": "Credit card token", - "slug": "credit-card-token" + "level": 1, + "title": "GetPaymentList", + "slug": "getpaymentlist" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Retrieve payment", + "slug": "retrieve-payment" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/Reauthorization.php", + "projectPath": "sample/payments/Reauthorization.php", + "targetPath": "payments/Reauthorization", + "pageTitle": "payments/Reauthorization", + "title": "Reauthorization" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "FundingInstrument", - "slug": "fundinginstrument" + "level": 2, + "title": "Reauthorization Sample", + "slug": "reauthorization-sample" }, - "depth": 3 - }, { + "depth": 2, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Reauthorization", + "slug": "reauthorization" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Lookup authorization using the authorization id", + "slug": "lookup-authorization-using-the-authorization-id" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Reauthorize with amount being reauthorized", + "slug": "reauthorize-with-amount-being-reauthorized" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/RefundCapture.php", + "projectPath": "sample/payments/RefundCapture.php", + "targetPath": "payments/RefundCapture", + "pageTitle": "payments/RefundCapture", + "title": "RefundCapture" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Payer", - "slug": "payer" + "level": 1, + "title": "Refund Capture Sample", + "slug": "refund-capture-sample" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Capture", + "slug": "capture" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Refund", + "slug": "refund" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/payments/VoidAuthorization.php", + "projectPath": "sample/payments/VoidAuthorization.php", + "targetPath": "payments/VoidAuthorization", + "pageTitle": "payments/VoidAuthorization", + "title": "VoidAuthorization" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Itemized information", - "slug": "itemized-information" + "level": 1, + "title": "VoidAuthorization", + "slug": "voidauthorization" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "VoidAuthorization", + "slug": "voidauthorization" + }, + "depth": 3 + } + ] + } + ] + } + ] + }, { + "type": "folder", + "data": { + "path": "sale", + "title": "sale" + }, + "depth": 1, + "children": [ + { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/sale/GetSale.php", + "projectPath": "sample/sale/GetSale.php", + "targetPath": "sale/GetSale", + "pageTitle": "sale/GetSale", + "title": "GetSale" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Additional payment details", - "slug": "additional-payment-details" + "level": 1, + "title": "Get Sale sample", + "slug": "get-sale-sample" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Retrieve the sale object", + "slug": "retrieve-the-sale-object" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/sale/RefundSale.php", + "projectPath": "sample/sale/RefundSale.php", + "targetPath": "sale/RefundSale", + "pageTitle": "sale/RefundSale", + "title": "RefundSale" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Amount", - "slug": "amount" + "level": 1, + "title": "Sale Refund Sample", + "slug": "sale-refund-sample" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "Refund amount", + "slug": "refund-amount" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Refund object", + "slug": "refund-object" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Sale", + "slug": "sale" + }, + "depth": 3 + } + ] + } + ] + } + ] + }, { + "type": "folder", + "data": { + "path": "vault", + "title": "vault" + }, + "depth": 1, + "children": [ + { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/vault/CreateCreditCard.php", + "projectPath": "sample/vault/CreateCreditCard.php", + "targetPath": "vault/CreateCreditCard", + "pageTitle": "vault/CreateCreditCard", + "title": "CreateCreditCard" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Transaction", - "slug": "transaction" + "level": 1, + "title": "Create Credit Card Sample", + "slug": "create-credit-card-sample" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "CreditCard", + "slug": "creditcard" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Save card", + "slug": "save-card" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/vault/DeleteCreditCard.php", + "projectPath": "sample/vault/DeleteCreditCard.php", + "targetPath": "vault/DeleteCreditCard", + "pageTitle": "vault/DeleteCreditCard", + "title": "DeleteCreditCard" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Payment", - "slug": "payment" + "level": 1, + "title": "Delete CreditCard Sample", + "slug": "delete-creditcard-sample" }, - "depth": 3 - }, { + "depth": 1, + "children": [ + { + "type": "heading", + "data": { + "level": 3, + "title": "CreditCard", + "slug": "creditcard" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Save card", + "slug": "save-card" + }, + "depth": 3 + }, { + "type": "heading", + "data": { + "level": 3, + "title": "Delete Card", + "slug": "delete-card" + }, + "depth": 3 + } + ] + } + ] + }, { + "type": "file", + "data": { + "language": { + "nameMatchers": [{}, ".fbp"], + "pygmentsLexer": "php", + "singleLineComment": ["//"], + "ignorePrefix": "}", + "foldPrefix": "^", + "name": "PHP" + }, + "sourcePath": "/Users/japatel/Documents/workspace/Server-SDK/rest-api-sdk-php/sample/vault/GetCreditCard.php", + "projectPath": "sample/vault/GetCreditCard.php", + "targetPath": "vault/GetCreditCard", + "pageTitle": "vault/GetCreditCard", + "title": "GetCreditCard" + }, + "depth": 2, + "outline": [ + { "type": "heading", "data": { - "level": 3, - "title": "Create Payment", - "slug": "create-payment" + "level": 1, + "title": "Get Credit Card Sample", + "slug": "get-credit-card-sample" }, - "depth": 3 + "depth": 1 } ] } diff --git a/sample/doc/assets/style.css b/sample/doc/assets/style.css new file mode 100644 index 00000000..f9e0d437 --- /dev/null +++ b/sample/doc/assets/style.css @@ -0,0 +1 @@ +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}html,body{height:100%}#document{min-height:100%}body{max-width:33em}.segment{padding:0.5em 0 0.5em 33em;white-space:nowrap}.segment:first-child{padding-top:4.1em}.segment:last-child{padding-bottom:2em}.segment .comments,.segment .code{display:inline-block;vertical-align:top;padding:0 2em}.segment .comments{margin-left:-33em;width:29em;white-space:normal}.segment .code{white-space:pre}#meta{position:absolute;left:33em;padding:0.25em 1em}@media (max-width: 53em){html{font-size:1em}}@media (max-width: 52.94111em){html{font-size:0.99889em}}@media (max-width: 52.88222em){html{font-size:0.99778em}}@media (max-width: 52.82333em){html{font-size:0.99667em}}@media (max-width: 52.76444em){html{font-size:0.99556em}}@media (max-width: 52.70556em){html{font-size:0.99444em}}@media (max-width: 52.64667em){html{font-size:0.99333em}}@media (max-width: 52.58778em){html{font-size:0.99222em}}@media (max-width: 52.52889em){html{font-size:0.99111em}}@media (max-width: 52.47em){html{font-size:0.99em}}@media (max-width: 52.41111em){html{font-size:0.98889em}}@media (max-width: 52.35222em){html{font-size:0.98778em}}@media (max-width: 52.29333em){html{font-size:0.98667em}}@media (max-width: 52.23444em){html{font-size:0.98556em}}@media (max-width: 52.17556em){html{font-size:0.98444em}}@media (max-width: 52.11667em){html{font-size:0.98333em}}@media (max-width: 52.05778em){html{font-size:0.98222em}}@media (max-width: 51.99889em){html{font-size:0.98111em}}@media (max-width: 51.94em){html{font-size:0.98em}}@media (max-width: 51.88111em){html{font-size:0.97889em}}@media (max-width: 51.82222em){html{font-size:0.97778em}}@media (max-width: 51.76333em){html{font-size:0.97667em}}@media (max-width: 51.70444em){html{font-size:0.97556em}}@media (max-width: 51.64556em){html{font-size:0.97444em}}@media (max-width: 51.58667em){html{font-size:0.97333em}}@media (max-width: 51.52778em){html{font-size:0.97222em}}@media (max-width: 51.46889em){html{font-size:0.97111em}}@media (max-width: 51.41em){html{font-size:0.97em}}@media (max-width: 51.35111em){html{font-size:0.96889em}}@media (max-width: 51.29222em){html{font-size:0.96778em}}@media (max-width: 51.23333em){html{font-size:0.96667em}}@media (max-width: 51.17444em){html{font-size:0.96556em}}@media (max-width: 51.11556em){html{font-size:0.96444em}}@media (max-width: 51.05667em){html{font-size:0.96333em}}@media (max-width: 50.99778em){html{font-size:0.96222em}}@media (max-width: 50.93889em){html{font-size:0.96111em}}@media (max-width: 50.88em){html{font-size:0.96em}}@media (max-width: 50.82111em){html{font-size:0.95889em}}@media (max-width: 50.76222em){html{font-size:0.95778em}}@media (max-width: 50.70333em){html{font-size:0.95667em}}@media (max-width: 50.64444em){html{font-size:0.95556em}}@media (max-width: 50.58556em){html{font-size:0.95444em}}@media (max-width: 50.52667em){html{font-size:0.95333em}}@media (max-width: 50.46778em){html{font-size:0.95222em}}@media (max-width: 50.40889em){html{font-size:0.95111em}}@media (max-width: 50.35em){html{font-size:0.95em}}@media (max-width: 50.29111em){html{font-size:0.94889em}}@media (max-width: 50.23222em){html{font-size:0.94778em}}@media (max-width: 50.17333em){html{font-size:0.94667em}}@media (max-width: 50.11444em){html{font-size:0.94556em}}@media (max-width: 50.05556em){html{font-size:0.94444em}}@media (max-width: 49.99667em){html{font-size:0.94333em}}@media (max-width: 49.93778em){html{font-size:0.94222em}}@media (max-width: 49.87889em){html{font-size:0.94111em}}@media (max-width: 49.82em){html{font-size:0.94em}}@media (max-width: 49.76111em){html{font-size:0.93889em}}@media (max-width: 49.70222em){html{font-size:0.93778em}}@media (max-width: 49.64333em){html{font-size:0.93667em}}@media (max-width: 49.58444em){html{font-size:0.93556em}}@media (max-width: 49.52556em){html{font-size:0.93444em}}@media (max-width: 49.46667em){html{font-size:0.93333em}}@media (max-width: 49.40778em){html{font-size:0.93222em}}@media (max-width: 49.34889em){html{font-size:0.93111em}}@media (max-width: 49.29em){html{font-size:0.93em}}@media (max-width: 49.23111em){html{font-size:0.92889em}}@media (max-width: 49.17222em){html{font-size:0.92778em}}@media (max-width: 49.11333em){html{font-size:0.92667em}}@media (max-width: 49.05444em){html{font-size:0.92556em}}@media (max-width: 48.99556em){html{font-size:0.92444em}}@media (max-width: 48.93667em){html{font-size:0.92333em}}@media (max-width: 48.87778em){html{font-size:0.92222em}}@media (max-width: 48.81889em){html{font-size:0.92111em}}@media (max-width: 48.76em){html{font-size:0.92em}}@media (max-width: 48.70111em){html{font-size:0.91889em}}@media (max-width: 48.64222em){html{font-size:0.91778em}}@media (max-width: 48.58333em){html{font-size:0.91667em}}@media (max-width: 48.52444em){html{font-size:0.91556em}}@media (max-width: 48.46556em){html{font-size:0.91444em}}@media (max-width: 48.40667em){html{font-size:0.91333em}}@media (max-width: 48.34778em){html{font-size:0.91222em}}@media (max-width: 48.28889em){html{font-size:0.91111em}}@media (max-width: 48.23em){html{font-size:0.91em}}@media (max-width: 48.17111em){html{font-size:0.90889em}}@media (max-width: 48.11222em){html{font-size:0.90778em}}@media (max-width: 48.05333em){html{font-size:0.90667em}}@media (max-width: 47.99444em){html{font-size:0.90556em}}@media (max-width: 47.93556em){html{font-size:0.90444em}}@media (max-width: 47.87667em){html{font-size:0.90333em}}@media (max-width: 47.81778em){html{font-size:0.90222em}}@media (max-width: 47.75889em){html{font-size:0.90111em}}@media (max-width: 47.7em){html{font-size:0.9em}}@media (max-width: 47.64111em){html{font-size:0.89889em}}@media (max-width: 47.58222em){html{font-size:0.89778em}}@media (max-width: 47.52333em){html{font-size:0.89667em}}@media (max-width: 47.46444em){html{font-size:0.89556em}}@media (max-width: 47.40556em){html{font-size:0.89444em}}@media (max-width: 47.34667em){html{font-size:0.89333em}}@media (max-width: 47.28778em){html{font-size:0.89222em}}@media (max-width: 47.22889em){html{font-size:0.89111em}}@media (max-width: 47.17em){html{font-size:0.89em}}@media (max-width: 47.11111em){html{font-size:0.88889em}}@media (max-width: 47.05222em){html{font-size:0.88778em}}@media (max-width: 46.99333em){html{font-size:0.88667em}}@media (max-width: 46.93444em){html{font-size:0.88556em}}@media (max-width: 46.87556em){html{font-size:0.88444em}}@media (max-width: 46.81667em){html{font-size:0.88333em}}@media (max-width: 46.75778em){html{font-size:0.88222em}}@media (max-width: 46.69889em){html{font-size:0.88111em}}@media (max-width: 46.64em){html{font-size:0.88em}}@media (max-width: 46.58111em){html{font-size:0.87889em}}@media (max-width: 46.52222em){html{font-size:0.87778em}}@media (max-width: 46.46333em){html{font-size:0.87667em}}@media (max-width: 46.40444em){html{font-size:0.87556em}}@media (max-width: 46.34556em){html{font-size:0.87444em}}@media (max-width: 46.28667em){html{font-size:0.87333em}}@media (max-width: 46.22778em){html{font-size:0.87222em}}@media (max-width: 46.16889em){html{font-size:0.87111em}}@media (max-width: 46.11em){html{font-size:0.87em}}@media (max-width: 46.05111em){html{font-size:0.86889em}}@media (max-width: 45.99222em){html{font-size:0.86778em}}@media (max-width: 45.93333em){html{font-size:0.86667em}}@media (max-width: 45.87444em){html{font-size:0.86556em}}@media (max-width: 45.81556em){html{font-size:0.86444em}}@media (max-width: 45.75667em){html{font-size:0.86333em}}@media (max-width: 45.69778em){html{font-size:0.86222em}}@media (max-width: 45.63889em){html{font-size:0.86111em}}@media (max-width: 45.58em){html{font-size:0.86em}}@media (max-width: 45.52111em){html{font-size:0.85889em}}@media (max-width: 45.46222em){html{font-size:0.85778em}}@media (max-width: 45.40333em){html{font-size:0.85667em}}@media (max-width: 45.34444em){html{font-size:0.85556em}}@media (max-width: 45.28556em){html{font-size:0.85444em}}@media (max-width: 45.22667em){html{font-size:0.85333em}}@media (max-width: 45.16778em){html{font-size:0.85222em}}@media (max-width: 45.10889em){html{font-size:0.85111em}}@media (max-width: 45.05em){html{font-size:1em}body{margin:0 auto}.segment{padding:0;white-space:normal;max-width:29em;margin:0 auto}.segment .comments,.segment .code{display:block;padding:1em}.segment .comments{margin-left:0;width:auto}.segment .code{display:block;overflow-y:hidden;overflow-x:auto}.segment .code .wrapper{display:inline-block}#meta{position:static;margin:2em 0 0 0;overflow-y:hidden;overflow-x:auto}#meta .file-path{display:inline-block}}nav{position:fixed;top:0;right:0;width:20em}@media (max-width: 45.05em){nav{left:0;width:100%}}nav .tools{position:relative;z-index:100}nav .tools li{display:table-cell;vertical-align:middle;text-align:center;white-space:nowrap;height:2.1em;padding:0 0.55em}nav .tools .github{padding:0}nav .tools .github a{display:block;height:2.1em;width:2.1em;text-indent:-9001em}nav .tools .search{width:100%}nav .tools .search input{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;width:100%}nav .toc{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;top:2.1em;bottom:0;width:100%;overflow-x:hidden;overflow-y:auto}nav .toc li{position:relative}nav .toc .label{display:block;line-height:2em;padding:0 0.55em 0 0.55em}nav .toc li li .label{padding-left:1.1em}nav .toc li li li .label{padding-left:1.65em}nav .toc li li li li .label{padding-left:2.2em}nav .toc li li li li li .label{padding-left:2.75em}nav .toc li li li li li li .label{padding-left:3.3em}nav{-moz-transition:height 150ms 0;-o-transition:height 150ms 0;-webkit-transition:height 150ms 0;transition:height 150ms 0}nav .tools .toggle{-moz-transition:background 150ms;-o-transition:background 150ms;-webkit-transition:background 150ms;transition:background 150ms}nav.active{-moz-transition:height 0;-o-transition:height 0;-webkit-transition:height 0;transition:height 0;height:100%}nav .toc{-moz-transition:right 150ms;-o-transition:right 150ms;-webkit-transition:right 150ms;transition:right 150ms;right:-100%}nav.active .toc{right:0}@media (max-width: 45.05em){nav .toc{-moz-transition:left 150ms;-o-transition:left 150ms;-webkit-transition:left 150ms;transition:left 150ms;right:auto;left:-100%}nav.active .toc{left:0}}@media (max-width: 45.05em){body{-moz-transition:left 150ms;-o-transition:left 150ms;-webkit-transition:left 150ms;transition:left 150ms;position:relative;left:0}html.popped{overflow:hidden}html.popped body{left:100%;overflow:hidden}}nav .toc .children,nav .toc .outline{display:none}nav .toc .expanded>.children,nav .toc .expanded>.outline,nav .toc .expanded>.outline .children{display:block}nav .toc .discloser{-moz-transition-property:-moz-transform,-webkit-transform,-o-transform,-moz-transform;-o-transition-property:-moz-transform,-webkit-transform,-o-transform,-o-transform;-webkit-transition-property:-moz-transform,-webkit-transform,-o-transform,-webkit-transform;transition-property:-moz-transform -webkit-transform -o-transform transform;-moz-transition-duration:200ms;-o-transition-duration:200ms;-webkit-transition-duration:200ms;transition-duration:200ms;-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg);display:inline-block;height:9px;width:9px;padding:0.2em;margin:0.2em 0.2em -0.2em 0.2em;vertical-align:baseline;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowOEFDRENGQzE2NEUxMUUxODdDNUQ2ODM0QzVGRkVBMSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowOEFDRENGRDE2NEUxMUUxODdDNUQ2ODM0QzVGRkVBMSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjA4QUNEQ0ZBMTY0RTExRTE4N0M1RDY4MzRDNUZGRUExIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjA4QUNEQ0ZCMTY0RTExRTE4N0M1RDY4MzRDNUZGRUExIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+nQHMgwAAAM1JREFUeNpi/P//P0NJSYkuAwNDJhDXAPE7BjIAExIbZNA9IC4CYjZKDAIBfiDuBeLzQOxBiUEwoAXE26FYixKDYMAD6rpeqGvJNogBGl5F0PDLpMQgGBAC4mlQF9pTYhAMGADxASBeB8RylBgEA4FAfAOIW4CYhxKDQIAZxmChwJD1QFwGxHfINegaEGcB8UFyA/sd1AA9dEOIddFfIJ4OzdAfcSkiZNAOIC6GegcvwGXQHagBm8jNtB+hBmiTYgi6i+ZCw+EFOWkBIMAA1W4l62UzKWwAAAAASUVORK5CYII=') center center no-repeat;background-size:9px 9px}nav .toc .discloser.placeholder,nav .toc .expanded>.outline .discloser{background:none}nav .toc .expanded>.label .discloser{-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg)}nav .toc .filtered>.label{display:none}nav .toc .matched-child>.label{display:block}nav .toc .matched-child>.children,nav .toc .matched-child>.outline,nav .toc .matched-child>.outline .children{display:block}nav .toc .matched>.children,nav .toc .matched>.outline,nav .toc .matched>.outline .children{display:block}nav.searching .toc .discloser{display:none}.comments .wrapper{font-family:"Helvetica Neue",Helvetica,"Droid Sans",sans-serif;font-weight:300;font-size:0.9375em;line-height:1.35}.comments .wrapper h1,.comments .wrapper h2,.comments .wrapper h3,.comments .wrapper h4,.comments .wrapper h5,.comments .wrapper h6{font-family:"HelveticaNeue-UltraLight","Helvetica Neue",Helvetica,"Droid Sans",sans-serif;font-weight:100;letter-spacing:0.0625em;line-height:1.25;margin-bottom:0.5em}.comments .wrapper h1{font-size:2.5em}.comments .wrapper h2{font-size:2em}.comments .wrapper h3{font-size:1.6em}.comments .wrapper h4{font-size:1.4em}.comments .wrapper h5{font-size:1.3em}.comments .wrapper h6{font-size:1.2em}.comments .wrapper p{margin:1em 0}.comments .wrapper>*:first-child{margin-top:0}.comments .wrapper>*:last-child{margin-bottom:0}.comments .wrapper ol,.comments .wrapper ul{padding-left:1.75em;margin:1em 0}.comments .wrapper ol li{list-style:decimal}.comments .wrapper ul li{list-style:disc}.comments .wrapper li{margin:1em 0}.comments .wrapper li:first-child{margin-top:0}.comments .wrapper li:last-child{margin-bottom:0}.comments .wrapper code{display:inline-block;padding:0.25em 0.25em 0 0.25em}.comments .wrapper pre{display:block;overflow-x:auto;overflow-y:hidden}.comments .wrapper pre .hljs-comment,.comments .wrapper pre .hljs-template_comment,.comments .wrapper pre .diff .hljs-header,.comments .wrapper pre .hljs-doctype,.comments .wrapper pre .hljs-pi,.comments .wrapper pre .lisp .hljs-string,.comments .wrapper pre .hljs-javadoc{color:#93a1a1;font-style:italic}.comments .wrapper pre .hljs-keyword,.comments .wrapper pre .hljs-winutils,.comments .wrapper pre .method,.comments .wrapper pre .hljs-addition,.comments .wrapper pre .css .hljs-tag,.comments .wrapper pre .hljs-request,.comments .wrapper pre .hljs-status,.comments .wrapper pre .nginx .hljs-title{color:#859900}.comments .wrapper pre .hljs-number,.comments .wrapper pre .hljs-command,.comments .wrapper pre .hljs-string,.comments .wrapper pre .hljs-tag .hljs-value,.comments .wrapper pre .hljs-rules .hljs-value,.comments .wrapper pre .hljs-phpdoc,.comments .wrapper pre .tex .hljs-formula,.comments .wrapper pre .hljs-regexp,.comments .wrapper pre .hljs-hexcolor{color:#2aa198}.comments .wrapper pre .hljs-title,.comments .wrapper pre .hljs-localvars,.comments .wrapper pre .hljs-chunk,.comments .wrapper pre .hljs-decorator,.comments .wrapper pre .hljs-built_in,.comments .wrapper pre .hljs-identifier,.comments .wrapper pre .vhdl .hljs-literal,.comments .wrapper pre .hljs-id,.comments .wrapper pre .css .hljs-function{color:#268bd2}.comments .wrapper pre .hljs-attribute,.comments .wrapper pre .hljs-variable,.comments .wrapper pre .lisp .hljs-body,.comments .wrapper pre .smalltalk .hljs-number,.comments .wrapper pre .hljs-constant,.comments .wrapper pre .hljs-class .hljs-title,.comments .wrapper pre .hljs-parent,.comments .wrapper pre .haskell .hljs-type{color:#b58900}.comments .wrapper pre .hljs-preprocessor,.comments .wrapper pre .hljs-preprocessor .hljs-keyword,.comments .wrapper pre .hljs-pragma,.comments .wrapper pre .hljs-shebang,.comments .wrapper pre .hljs-symbol,.comments .wrapper pre .hljs-symbol .hljs-string,.comments .wrapper pre .diff .hljs-change,.comments .wrapper pre .hljs-special,.comments .wrapper pre .hljs-attr_selector,.comments .wrapper pre .hljs-important,.comments .wrapper pre .hljs-subst,.comments .wrapper pre .hljs-cdata,.comments .wrapper pre .clojure .hljs-title,.comments .wrapper pre .css .hljs-pseudo{color:#cb4b16}.comments .wrapper pre .hljs-deletion{color:#dc322f}.comments .wrapper pre .tex .hljs-formula{background:#eee8d5}.comments .wrapper pre code{padding:1em}.comments .wrapper blockquote{padding:0 1em}.comments .wrapper strong{font-weight:700}.comments .wrapper em{font-style:italic}html{background:#4a525a}#document{background:#f5fbff url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuMCIgeTE9IjAuNSIgeDI9IjEuMCIgeTI9IjAuNSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzI3MmMzMCIvPjxzdG9wIG9mZnNldD0iMzAlIiBzdG9wLWNvbG9yPSIjM2U0NTRjIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjNGE1MjVhIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g') 33em no-repeat;background:#f5fbff -webkit-gradient(linear, 0% 50%, 100% 50%, color-stop(0%, #272c30),color-stop(30%, #3e454c),color-stop(100%, #4a525a)) 33em no-repeat;background:#f5fbff -moz-linear-gradient(left, #272c30,#3e454c 0.3em,#4a525a 1em) 33em no-repeat;background:#f5fbff -webkit-linear-gradient(left, #272c30,#3e454c 0.3em,#4a525a 1em) 33em no-repeat;background:#f5fbff linear-gradient(to right, #272c30,#3e454c 0.3em,#4a525a 1em) 33em no-repeat;margin-right:-1em;padding-right:1em}@media (max-width: 45.05em){#document{margin-right:0;padding-right:0}}#meta>*{font-family:"Helvetica Neue",Helvetica,"Droid Sans",sans-serif;font-weight:300;font-size:0.9375em;line-height:1.35;text-shadow:#272c30 1px 1px 0}#meta>*,#meta>* a{color:#9faab7}#meta>* a{text-decoration:none}.comments .wrapper{font-family:"Helvetica Neue",Helvetica,"Droid Sans",sans-serif;font-weight:300;font-size:0.9375em;line-height:1.35;text-shadow:#fff 1px 1px 0;color:#4a525a}.code .wrapper{font-family:"Droid Sans Mono",Menlo,Monaco,monospace;font-size:0.75em;line-height:1.4;text-shadow:#272c30 1px 1px 0;color:#cbd1d8}.code .wrapper .hljs{display:block;padding:0.5em}.code .wrapper .hljs-comment,.code .wrapper .hljs-template_comment,.code .wrapper .diff .hljs-header,.code .wrapper .hljs-doctype,.code .wrapper .hljs-pi,.code .wrapper .lisp .hljs-string,.code .wrapper .hljs-javadoc{color:#b1bac4;font-style:italic}.code .wrapper .hljs-keyword,.code .wrapper .hljs-winutils,.code .wrapper .method,.code .wrapper .hljs-addition,.code .wrapper .css .hljs-tag,.code .wrapper .hljs-request,.code .wrapper .hljs-status,.code .wrapper .nginx .hljs-title{color:#e0c090}.code .wrapper .hljs-string{color:#e9baba}.code .wrapper .hljs-property{color:#b9d0af}.code .wrapper .hljs-function{color:#abd9cf}.code .wrapper .hljs-class{color:#cee4dd}.code .wrapper .hljs-number,.code .wrapper .hljs-command,.code .wrapper .hljs-tag .hljs-value,.code .wrapper .hljs-rules .hljs-value,.code .wrapper .hljs-phpdoc,.code .wrapper .tex .hljs-formula,.code .wrapper .hljs-regexp,.code .wrapper .hljs-hexcolor{color:#cba8d6}.code .wrapper .hljs-title,.code .wrapper .hljs-localvars,.code .wrapper .hljs-chunk,.code .wrapper .hljs-decorator,.code .wrapper .hljs-built_in,.code .wrapper .hljs-identifier,.code .wrapper .vhdl .hljs-literal,.code .wrapper .hljs-id,.code .wrapper .css .hljs-function{color:#a9c2ba}.code .wrapper .hljs-attribute,.code .wrapper .hljs-variable,.code .wrapper .lisp .hljs-body,.code .wrapper .smalltalk .hljs-number,.code .wrapper .hljs-constant,.code .wrapper .hljs-class .hljs-title,.code .wrapper .hljs-parent,.code .wrapper .haskell .hljs-type{color:#b9d0af}.code .wrapper .hljs-preprocessor,.code .wrapper .hljs-preprocessor .hljs-keyword,.code .wrapper .hljs-pragma,.code .wrapper .hljs-shebang,.code .wrapper .hljs-symbol,.code .wrapper .hljs-symbol .hljs-string,.code .wrapper .diff .hljs-change,.code .wrapper .hljs-special,.code .wrapper .hljs-attr_selector,.code .wrapper .hljs-important,.code .wrapper .hljs-subst,.code .wrapper .hljs-cdata,.code .wrapper .clojure .hljs-title,.code .wrapper .css .hljs-pseudo{color:#cee4dd}.code .wrapper .hljs-deletion{color:#dc322f}.code .wrapper .tex .hljs-formula{background:#e9baba}@media (max-width: 45.05em){.code{-moz-border-radius:0.4em;-webkit-border-radius:0.4em;border-radius:0.4em;-moz-box-shadow:#272c30 0 0 0.5em 0.2em inset;-webkit-box-shadow:#272c30 0 0 0.5em 0.2em inset;box-shadow:#272c30 0 0 0.5em 0.2em inset;background:#4a525a}.code .wrapper{-moz-box-shadow:#4a525a 0 0 0.25em 0.75em;-webkit-box-shadow:#4a525a 0 0 0.25em 0.75em;box-shadow:#4a525a 0 0 0.25em 0.75em;background:#4a525a}}@media (max-width: 29em){.code{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}}nav{text-shadow:#f0f0f0 1px 1px 0;color:#4a525a}nav .tools,nav .toc{font-family:"Helvetica Neue",Helvetica,"Droid Sans",sans-serif;font-weight:300;font-size:0.9375em;line-height:1.35}nav .tools{-moz-box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;-webkit-box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;background:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIwLjkiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNjZGNkY2QiIHN0b3Atb3BhY2l0eT0iMC45Ii8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmFkKSIgLz48L3N2Zz4g');background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255,255,255,0.9)),color-stop(100%, rgba(205,205,205,0.9)));background:-moz-linear-gradient(top, rgba(255,255,255,0.9),rgba(205,205,205,0.9));background:-webkit-linear-gradient(top, rgba(255,255,255,0.9),rgba(205,205,205,0.9));background:linear-gradient(to bottom, rgba(255,255,255,0.9),rgba(205,205,205,0.9));-moz-border-radius-bottomleft:0.4em;-webkit-border-bottom-left-radius:0.4em;border-bottom-left-radius:0.4em;border-bottom:1px solid #4a525a;border-left:1px solid #4a525a}@media (max-width: 53em){nav .tools{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0}}nav .tools li{border-right:1px solid #4a525a}nav .tools li:last-child{border-right:none}nav .tools .toggle{cursor:pointer}nav .tools .github a{-moz-transition:opacity 200ms;-o-transition:opacity 200ms;-webkit-transition:opacity 200ms;transition:opacity 200ms;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50);opacity:0.5;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAwCAYAAACScGMWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowOEFDRENGODE2NEUxMUUxODdDNUQ2ODM0QzVGRkVBMSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowOEFDRENGOTE2NEUxMUUxODdDNUQ2ODM0QzVGRkVBMSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjA4QUNEQ0Y2MTY0RTExRTE4N0M1RDY4MzRDNUZGRUExIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjA4QUNEQ0Y3MTY0RTExRTE4N0M1RDY4MzRDNUZGRUExIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+FC/Z5AAACv9JREFUeNrMWXl0VNUdvu/NmzWZJQnZN0hCWIQEIQuErUCBI2qwEAFRBJUeDvUPDwfKVhDUY2mPp8spakVELSq11goIiCBbUVKKUGKQQFiCSBJIQjLJZPbJzOt3J/dOXiYJgcqh3nO+vPfm3Xfvd3/3t94IsiyTH2sTyY+4SfxGpVIpfzdBokdxjQHOADuAj4GmuzRvFjAbmAZkAocEQZjLX/r9/vYbuq0UgigoQKagsxyG74FlgB4gYdAA0UASkAIkACahvSn70Xd/AlrCxm4VRDEBIBScUxg5wiCs7oZcEJDwN7g+AswH3gAOApVALdAIWIEGtpgyYAfwPFtYTU/jbtmy5W/gsZAugnMKbSsJ2oXAn1J62o9AIJCDy/ZgbzbQLVoqkAtM722fa2pqYnHJwfgmXG23MgjV7SjO3bR06BnlogUSe7PW+ntplXQHUlNTHewxqjdyR+8lOehxYNCgQa3hnHoil8a18F60trY2cenSpYU+n48qfXMnvaEQYcIMQ4KmrbAk/Cb3ZGV3gt7GWbx4cSm4xHd1JR2+aPfdIPK/ICIiwlNaWroKfMSgwDq0Moj78feB/1e4cjqdmq1btz6C25921jk5iOLe4i2XdDh+aF/ejhw5ksYEZJE6BAeHSuT83nyaMTLSZzAYfO2K7BPdbo/k9ngkOM8u32i1moBep2/TarVtGrU64PZ6VC0tLVqv1ydyFxLeamtrzbgYgJFSh+Bk2jOpe1ICmf7QtKp5856sHJo7zGoym4Lk3G636HQ4JXurTd3U1KTBtqgcTpcQZTYHIiIjfNExMV6DIaINuuTX6XQBp8sp1t24odv3+d6UN9/cPPTqtWpjOEFYLOeUI3CJwJJULAMZFE5u9cqVx1/esKE8jLebgWc3akCjjIFKbwF46dw0AlLXVnXpUlzx9OJpZyvO9VEShJR9LpfrHdy2SgqDCEB83i7Elj53NozYKeAY3QHAE0ZOz0KQmukuJ+VifUPkMrKyjO9t2bzvwUdmbL5eV2/gBBVE1crAL/OAy4mlJSe5Vq5Zd0pB7O/4OB7XXwJbgC/pYLHRFhJtNhONRk1q6xtIv+RE4vJ4SUOTldTdDKWABcBi+g3wdtH9OfaHJ4zaVpg7NHvH/oPrFKGMW4wghYn/uvJhwvjx1UZLFN+6I/iQ3r/Pnh+iGQcWUVPfaCWNzTZiiowgMA5yo7GJ1N5oIP4OI4llmQzV6QVAdenp8v3J8X1IhF7aplarV0HXaE5IJEniH8md/RwhFZ1iWFoqj3dUop8yQrzFPPvss78Cuf48e7W22IjL7SHXauuUxGgbpTS2goKC5fhu9InyCnLmfFWDiByQv6OOuCu5dmEeU46Iyfj7CqzKwXQp1OLj4wfSrcJEll78q0b5EBMTQ4k++V3N9cE6rVYCuRCP5OTkFm5ECskJFMdxd5X/dLOh3shuG9n1n8pMYuLEiQ10sawmuFU7SQMAfxg3bhxXn1yLyWDx+X0mhVT5O2d4NLADb/GHr0/9J97ltFO9lDJSgruyC3gpNjb20tq1a4+OHj26OaxQGgDMYxarbN8BTxuNxm9nzZr1zZIlS6r4GiWVekhbW0BL9Q0L9s+dO/dqKKfsJvCb4fMuMKuRP/nwvSN4//PHH55CsAXckqkhbGJ4nWYSbMCXmIKkKRNJhQeIATYqvs3PGZD1EX1F55s0adI5xbupXciJ7ddCWBCVopyekuw8ffJr2lkzMLMviYky0/7UeRcDNIMYxbeIKf6IvLy8madOnZqId1KEQU8S4/rA1ZiwODX9Ng9YCcxc/sxjkyWVivo+GRGkurKy8j1G7DW6YGWECMVY2hKTEicjHH1stVpNSYkJztmPlqw/uG/vK/6ATPeC+Nv88JIqUg2X0epwEo/XW4LPltMaFNs+vays7HhSUtLS9OTEpgi9jkRbTMRmd5Ios5G0OuGTA/LkMxcubWtr89MIcRnZyLYnnniC70Ap8JfutjWE9evXF02YMKGCiz0hPu5YWlLC/PuyMzOGZGdKOQP7k76pSSR3YDZJSYyDVE0js7KyVhw88MVQjJkODAR0AzLSyJi8XIJvzMMGZU+M7xP9V5p4snHf3/jqxp+g35+Z1F4GTEFOCsktYCHmANCgKAX779q1a9W7776bd/jw4b6QpFEtSUSr0VyTJPE8vMB3Br2uSRREh0oUbPEpaQlFhQW5dXU3mtUaddzBA4crHE5HItba3+ly9/V4fWbMSQuo7SD2DsanPnQhEMnmfYM66c4Vf3txTFdSDTwakqAYrE2jgAV2u/2tvXv3/mPRokUfZWdnfwhvXhHKBBm4IYXhX8BrwC/wvmDZsmV9mFQXKgzgaeovRUXFr5QcdQcvAKupwFJSUkqqa6q3Kxw0lWIqU/rhly9fTsKWP1hdXR3dW4YL3fumqqrq1xqNhpZ9cewMhiYJNAKdpjqG+a9wy+56VsIkNXLkSOqIZXjx5s/37Z3QnS5SK4yMjDx8J/VBSUlJOb5bATwGUB3rC2j57gQ9BSuyeixwEJLiYdbUucq5uTnXNm3a1B3BXKDtTshZLBbnxYsXV1M31GW82yXH8ArXHbPZbENa/kc8zwPoQcvrwDU+Kd7ZIUUXq57cc+bMKeMlICKCC1sZWsTOnTs/wVyP3i65noqZjezEiNhsNiP83XPovBXYzHKy0EHPzJkzz6elpQXDGIj48/Pz67mWjhgxorqoqOhKKJGwWmkCUADdNXSuBTqrWG8V//d0hXq93spDEEd4Gz58eCMqdoENLtPqPXQyKUl+vK8PS8tMQaMQeDkqk477zkm+dAsjOzxjxozxXq/3rZMnT2Y0NzcbaIWFrXLjKqJKCqZJCHOy4qTIj+ghK47GBLwPhEsITddxL/R+7Npd++CDD86AyJPAMzU1NXGYW0C+5UHkGLhhw4axzL0IyiCvUomBsPM84QefCfd4oi2KlZhgQ2pq6ng83ke3xeFweHo6ykIKJCuykB90GCTdTicQpLq3AyR30oIXQXoRPzLopu9dO52S7uSUkrkXmq67uzMOOAMZRtDj6aeisrqt+UIjqTWasEHbM/eo2HiiQ07G9JtodDpibahTNdXdCPYzRBoFo8XCDr2D48h8clRutH8oROoMkaEVpQ8YzCxE6PEoMERubPHPFJZDvXOwpiB6gyF4/E5/87jcJDE9gxz7bMcDlBx1mOkZGS5UXMFxNHq9v29mf4+I+oIarj9ApCE5w+x8jhNl5emzSmbUBM8aRo3lUaBdCjJzKQrrVUhO23kVcrsP8nk9TJdUxGGzJXz2/pYXbtbWBI/JxkyavKd/Zlbr1StV9PCFDB6aW1dUmN/YLzOr5cK5iuizZ8v7PDD17S+HDLu/8tuy0wP+8NuXh/jdds/8BU9Fet3uXrc2RM7a0NBOjq1ECB0CtBMVoUu2psZxrVbrOKM5emeE2bj7iz27Ilauf/EZR2srVE3tXvP8ui+R55Hla9Z9tfDx2cVVFy6YP9r5acaRQ4deLZk9K9Nlt5fs3r0nc3h+4RRbc+PJAETL5RH0jWHOMKQPk+fM7+7cq+NjSSQum4M01V8nZ//9FfXyxRevXJ02ZtTI6TGxsVf6ZWWv2LP946ms8iofkDOsKeBx/06j1WtPHC99E7XEizSfA7LZ6LSSOzBl7lPuTkqOtn/bO53J3WHLAx4G6igRlvPPZO6FFiy/B2j5V0hLQvYNPcY4AVB/Sa3BEqwTCLnSo3e4S//oiGHFDTXh3cDFsIVMZXH8N4z8bbX/CjAA0UTEH4oMvREAAAAASUVORK5CYII=') center center no-repeat;background-size:19.5px 24px}nav .tools .github a:hover{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=90);opacity:0.9}nav.active .tools{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0}nav.active .tools .toggle{background:rgba(205,205,205,0.9);position:relative}nav .toc{-moz-box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;-webkit-box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;background:rgba(230,230,230,0.9);border-left:1px solid #4a525a}nav .toc .label{color:#4a525a;text-decoration:none;border-top:1px solid rgba(192,192,192,0.9);border-bottom:1px solid rgba(192,192,192,0.9);margin-top:-1px}nav .toc .label:hover{background:rgba(205,205,205,0.9)}nav .toc .file>.label{font-weight:bold}nav .toc .selected>.label{background:#f5fbff}nav .toc .label em{font-weight:bold}nav .toc .file>.label em{color:#101214}nav .toc .matched-child>.label{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=65);opacity:0.65;text-shadow:none;background:rgba(192,192,192,0.9)}@media (max-width: 45.05em){nav .tools,nav .toc{border-left-width:0}nav .tools{background:url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgeDE9IjAuNSIgeTE9IjAuMCIgeDI9IjAuNSIgeTI9IjEuMCI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2NkY2RjZCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff),color-stop(100%, #cdcdcd));background:-moz-linear-gradient(top, #ffffff,#cdcdcd);background:-webkit-linear-gradient(top, #ffffff,#cdcdcd);background:linear-gradient(to bottom, #ffffff,#cdcdcd)}nav .toc{background:#e6e6e6}}.comments .wrapper a{display:inline-block;color:#a8614e;text-decoration:none}.comments .wrapper a:hover,.comments .wrapper a:hover *{text-decoration:underline}.comments .wrapper code{font-family:"Droid Sans Mono",Menlo,Monaco,monospace;font-size:0.75em;line-height:1.4;border:1px solid #e6e0d5}.comments .wrapper pre,.comments .wrapper code{-moz-border-radius:0.4em;-webkit-border-radius:0.4em;border-radius:0.4em;background:#fbf8f3}.comments .wrapper pre{-moz-box-shadow:#f2ece3 0 0 0.4em 0.2em;-webkit-box-shadow:#f2ece3 0 0 0.4em 0.2em;box-shadow:#f2ece3 0 0 0.4em 0.2em;border:1px solid #d9c9af}.comments .wrapper pre code{border-width:0;background:transparent}.comments .wrapper blockquote{border-left:0.15em solid #959fa8;margin-left:-0.15em}body{-webkit-text-size-adjust:100%}input[type="search"]{-moz-border-radius:1em;-webkit-border-radius:1em;border-radius:1em;-moz-box-shadow:#ddd 0 1px 1px 0 inset;-webkit-box-shadow:#ddd 0 1px 1px 0 inset;box-shadow:#ddd 0 1px 1px 0 inset;border:1px solid #959595;padding:0.15em 0.8em}.comments.doc-section .wrapper{color:#252519}.comments.doc-section.doc-section-private .wrapper,.comments.doc-section.doc-section-protected .wrapper,.comments.doc-section.doc-section-internal .wrapper{color:#7f7f7f}.comments.doc-section .doc-section-header{font:bold 18px "helvetica neue",helvetica,sans-serif}.comments.doc-section .docs .doc-section-header code{font-size:18px}.code .marker,.code .marker.wrapper,.code .wrapper.marker{display:none}.code.folded .wrapper{display:none;cursor:default}.code.folded .marker{-moz-border-radius:0.2em;-webkit-border-radius:0.2em;border-radius:0.2em;-moz-box-shadow:#2f3539 1px 1px 1px 0;-webkit-box-shadow:#2f3539 1px 1px 1px 0;box-shadow:#2f3539 1px 1px 1px 0;display:inline-block;border:1px solid #73787f;padding:0.2em 0.5em;margin-left:-0.5em;margin-right:-0.5em;background:#58616b;font:12px "Droid Sans Mono",Menlo,Monaco,monospace;text-shadow:#2f3539 1px 1px 0px;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none}.code.folded .marker .c1{color:#73787f;font-style:normal}.code.folded .marker:hover{background:#5f6872}.code.folded .marker:hover .c1{color:#7b8087}.code.folded .marker .c1:after{content:" …"} diff --git a/sample/doc/invoice/CancelInvoice.html b/sample/doc/invoice/CancelInvoice.html new file mode 100644 index 00000000..29efce51 --- /dev/null +++ b/sample/doc/invoice/CancelInvoice.html @@ -0,0 +1,44 @@ +invoice/CancelInvoice
sample/invoice/CancelInvoice.php
<?php

Cancel Invoice Sample

+

This sample code demonstrate how you can cancel +an invoice.

require __DIR__ . '/../bootstrap.php'; + +use PayPal\Api\Invoice; +use PayPal\Api\CancelNotification; + +try {

Retrieve Invoice

+

Retrieve the invoice object by calling the +static get method +on the Payment class by passing a valid +Invoice ID +(See bootstrap.php for more on ApiContext)

$invoice = Invoice::get("INV2-CJL7-PF4G-BLQF-5FWG", $apiContext);

Cancel Notification Object

+

This would send a notification to both merchant as well +the payer about the cancellation. The information of +merchant and payer is retrieved from the invoice details

$notify = new CancelNotification(); + $notify + ->setSubject("Past due") + ->setNote("Canceling invoice") + ->setSendToMerchant(true) + ->setSendToPayer(true);

Cancel Invoice

+

Cancel invoice object by calling the +static cancel method +on the Invoice class by passing a valid +notification object +(See bootstrap.php for more on ApiContext)

$cancelStatus = $invoice->cancel($notify, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} + +?> + +<html> +<head> + <title>Cancel Invoice</title> +</head> +<body> +<div>Cancel Invoice:</div> +<pre><?php echo $invoice->toJSON(JSON_PRETTY_PRINT); ?></pre> +<a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/invoice/CreateInvoice.html b/sample/doc/invoice/CreateInvoice.html new file mode 100644 index 00000000..a42146f9 --- /dev/null +++ b/sample/doc/invoice/CreateInvoice.html @@ -0,0 +1,95 @@ +invoice/CreateInvoice
sample/invoice/CreateInvoice.php
<?php

Create Invoice Sample

+

This sample code demonstrate how you can create +an invoice.

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Invoice; +use PayPal\Api\MerchantInfo; +use PayPal\Api\BillingInfo; +use PayPal\Api\InvoiceItem; +use PayPal\Api\Phone; +use PayPal\Api\Address; +use PayPal\Api\Currency; +use PayPal\Api\PaymentTerm; +use PayPal\Api\ShippingInfo; + +$invoice = new Invoice();

Invoice Info

+

Fill in all the information that is +required for invoice APIs

$invoice + ->setMerchantInfo(new MerchantInfo()) + ->setBillingInfo(array(new BillingInfo())) + ->setItems(array(new InvoiceItem())) + ->setNote("Medical Invoice 16 Jul, 2013 PST") + ->setPaymentTerm(new PaymentTerm()) + ->setShippingInfo(new ShippingInfo());

Merchant Info

+

A resource representing merchant information that can be +used to identify merchant

$invoice->getMerchantInfo() + ->setEmail("PPX.DevNet-facilitator@gmail.com") + ->setFirstName("Dennis") + ->setLastName("Doctor") + ->setbusinessName("Medical Professionals, LLC") + ->setPhone(new Phone()) + ->setAddress(new Address()); + +$invoice->getMerchantInfo()->getPhone() + ->setCountryCode("001") + ->setNationalNumber("5032141716");

Address Information

+

The address used for creating the invoice

$invoice->getMerchantInfo()->getAddress() + ->setLine1("1234 Main St.") + ->setCity("Portland") + ->setState("OR") + ->setPostalCode("97217") + ->setCountryCode("US");

Billing Information

+

Set the email address for each billing

$billing = $invoice->getBillingInfo(); +$billing[0] + ->setEmail("example@example.com");

Items List

+

You could provide the list of all items for +detailed breakdown of invoice

$items = $invoice->getItems(); +$items[0] + ->setName("Sutures") + ->setQuantity(100) + ->setUnitPrice(new Currency()); + +$items[0]->getUnitPrice() + ->setCurrency("USD") + ->setValue(5); + +$invoice->getPaymentTerm() + ->setTermType("NET_45");

Shipping Information

$invoice->getShippingInfo() + ->setFirstName("Sally") + ->setLastName("Patient") + ->setBusinessName("Not applicable") + ->setPhone(new Phone()) + ->setAddress(new Address()); + +$invoice->getShippingInfo()->getPhone() + ->setCountryCode("001") + ->setNationalNumber("5039871234"); + +$invoice->getShippingInfo()->getAddress() + ->setLine1("1234 Main St.") + ->setCity("Portland") + ->setState("OR") + ->setPostalCode("97217") + ->setCountryCode("US"); + +try {

Create Invoice

+

Create an invoice by calling the invoice->create() method +with a valid ApiContext (See bootstrap.php for more on ApiContext)

$invoice->create($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Invoice Creation</title> +</head> +<body> +<div> + Created Invoice: + <?php echo $invoice->getId(); ?> +</div> +<pre><?php echo $invoice->toJSON(JSON_PRETTY_PRINT); ?></pre> +<a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/invoice/GetInvoice.html b/sample/doc/invoice/GetInvoice.html new file mode 100644 index 00000000..bee95b8d --- /dev/null +++ b/sample/doc/invoice/GetInvoice.html @@ -0,0 +1,28 @@ +invoice/GetInvoice
sample/invoice/GetInvoice.php
<?php

Get Invoice Sample

+

This sample code demonstrate how you can retrieve +an invoice.

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Invoice; + +$invoiceId = "INV2-9DRB-YTHU-2V9Q-7Q24";

Retrieve Invoice

+

Retrieve the invoice object by calling the +static get method +on the Invoice class by passing a valid +Invoice ID +(See bootstrap.php for more on ApiContext)

try { + $invoice = Invoice::get($invoiceId, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception:" . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Lookup invoice details</title> +</head> +<body> + <div>Retrieving Invoice: <?php echo $invoiceId;?></div> + <pre><?php echo $invoice->toJSON(JSON_PRETTY_PRINT); ?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/invoice/ListInvoice.html b/sample/doc/invoice/ListInvoice.html new file mode 100644 index 00000000..e2fbdd07 --- /dev/null +++ b/sample/doc/invoice/ListInvoice.html @@ -0,0 +1,26 @@ +invoice/ListInvoice
sample/invoice/ListInvoice.php
<?php

List Invoices Sample

+

This sample code demonstrate how you can get +all invoice from history.

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Invoice; + +try {

Retrieve Invoices

+

Retrieve the Invoice History object by calling the +static get_all method on the Invoice class. +Refer the method doc for valid values for keys +(See bootstrap.php for more on ApiContext)

$invoices = Invoice::get_all($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception:" . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Lookup invoice history</title> +</head> +<body> + <div>Got invoices </div> + <pre><?php echo $invoices->toJSON(JSON_PRETTY_PRINT); ?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/invoice/RemindInvoice.html b/sample/doc/invoice/RemindInvoice.html new file mode 100644 index 00000000..29b477a2 --- /dev/null +++ b/sample/doc/invoice/RemindInvoice.html @@ -0,0 +1,43 @@ +invoice/RemindInvoice
sample/invoice/RemindInvoice.php
<?php

Remind Invoice Sample

+

This sample code demonstrate how you can remind +an invoice to the payer

require __DIR__ . '/../bootstrap.php'; + +use PayPal\Api\Invoice; +use PayPal\Api\Notification; + +try {

Retrieve Invoice

+

Retrieve the invoice object by calling the +static get method +on the Invoice class by passing a valid +Invoice ID +(See bootstrap.php for more on ApiContext)

$invoice = Invoice::get("INV2-9CAH-K5G7-2JPL-G4B4", $apiContext);

Notification Object

+

This would send a notification to both merchant as well +the payer. The information of merchant +and payer is retrieved from the invoice details

$notify = new Notification(); + $notify + ->setSubject("Past due") + ->setNote("Please pay soon") + ->setSendToMerchant(true);

Remind Invoice

+

Remind the notifiers by calling the +remind method +on the Invoice class by passing a valid +notification object +(See bootstrap.php for more on ApiContext)

$remindStatus = $invoice->remind($notify, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} + +?> + +<html> +<head> + <title>Remind Invoice</title> +</head> +<body> +<div>Remind Invoice:</div> +<pre><?php echo $invoice->toJSON(JSON_PRETTY_PRINT); ?></pre> +<a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/invoice/SendInvoice.html b/sample/doc/invoice/SendInvoice.html new file mode 100644 index 00000000..4b8a5de0 --- /dev/null +++ b/sample/doc/invoice/SendInvoice.html @@ -0,0 +1,31 @@ +invoice/SendInvoice
sample/invoice/SendInvoice.php
<?php

Create Invoice Sample

+

This sample code demonstrate how you can send +a legitimate invoice to the payer

require __DIR__ . '/../bootstrap.php'; + +use PayPal\Api\Invoice; + +try {

Retrieve Invoice

+

Retrieve the invoice object by calling the +static get method +on the Invoice class by passing a valid +Invoice ID +(See bootstrap.php for more on ApiContext)

$invoice = Invoice::get("INV2-9DRB-YTHU-2V9Q-7Q24", $apiContext);

Send Invoice

+

Send a legitimate invoice to the payer +with a valid ApiContext (See bootstrap.php for more on ApiContext)

$sendStatus = $invoice->send($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} + +?> +<html> +<head> + <title>Send Invoice</title> +</head> +<body> +<div>Send Invoice:</div> +<pre><?php echo $invoice->toJSON(JSON_PRETTY_PRINT); ?></pre> +<a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/payments/AuthorizationCapture.html b/sample/doc/payments/AuthorizationCapture.html new file mode 100644 index 00000000..0b79a7b2 --- /dev/null +++ b/sample/doc/payments/AuthorizationCapture.html @@ -0,0 +1,39 @@ +payments/AuthorizationCapture
sample/payments/AuthorizationCapture.php
<?php

AuthorizationCapture

+

This sample code demonstrates how you can capture +a previously authorized payment. +API used: /v1/payments/payment

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Amount; +use PayPal\Api\Capture; +use PayPal\Api\Authorization;

Capture Payment

+

You can capture and process a previously created authorization +by invoking the $authorization->capture method +with a valid ApiContext (See bootstrap.php for more on ApiContext)

try {

Create a new authorization to get authorization Id +createAuthorization defined in common.php

$authId = createAuthorization($apiContext); + + $amt = new Amount(); + $amt->setCurrency("USD") + ->setTotal("1.00"); + + ### Capture + $capture = new Capture(); + $capture->setId($authId) + ->setAmount($amt);

Lookup the authorization.

$authorization = Authorization::get($authId, $apiContext);

Perform a capture

$getCapture = $authorization->capture($capture, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Capturing an authorization</title> +</head> +<body> + <div> + Captured payment <?php echo $getCapture->getParentPayment(); ?>. Capture Id: + <?php echo $getCapture->getId();?> + </div> + <pre><?php echo $getCapture->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/payments/CreatePayment.html b/sample/doc/payments/CreatePayment.html new file mode 100644 index 00000000..d40afef7 --- /dev/null +++ b/sample/doc/payments/CreatePayment.html @@ -0,0 +1,97 @@ +payments/CreatePayment
sample/payments/CreatePayment.php
<?php

CreatePaymentSample

+

This sample code demonstrate how you can process +a direct credit card payment. Please note that direct +credit card payment and related features using the +REST API is restricted in some countries. +API used: /v1/payments/payment

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Amount; +use PayPal\Api\Details; +use PayPal\Api\Item; +use PayPal\Api\ItemList; +use PayPal\Api\CreditCard; +use PayPal\Api\Payer; +use PayPal\Api\Payment; +use PayPal\Api\FundingInstrument; +use PayPal\Api\Transaction;

CreditCard

+

A resource representing a credit card that can be +used to fund a payment.

$card = new CreditCard(); +$card->setType("visa") + ->setNumber("4417119669820331") + ->setExpireMonth("11") + ->setExpireYear("2019") + ->setCvv2("012") + ->setFirstName("Joe") + ->setLastName("Shopper");

FundingInstrument

+

A resource representing a Payer's funding instrument. +For direct credit card payments, set the CreditCard +field on this object.

$fi = new FundingInstrument(); +$fi->setCreditCard($card);

Payer

+

A resource representing a Payer that funds a payment +For direct credit card payments, set payment method +to 'credit_card' and add an array of funding instruments.

$payer = new Payer(); +$payer->setPaymentMethod("credit_card") + ->setFundingInstruments(array($fi));

Itemized information

+

(Optional) Lets you specify item wise +information

$item1 = new Item(); +$item1->setName('Ground Coffee 40 oz') + ->setDescription('Ground Coffee 40 oz') + ->setCurrency('USD') + ->setQuantity(1) + ->setTax('0.30') + ->setPrice('7.50'); +$item2 = new Item(); +$item2->setName('Granola bars') + ->setDescription('Granola Bars with Peanuts') + ->setCurrency('USD') + ->setQuantity(5) + ->setTax('0.20') + ->setPrice('2.00'); + +$itemList = new ItemList(); +$itemList->setItems(array($item1, $item2));

Additional payment details

+

Use this optional field to set additional +payment information such as tax, shipping +charges etc.

$details = new Details(); +$details->setShipping('1.20') + ->setTax('1.30') + ->setSubtotal('17.50');

Amount

+

Lets you specify a payment amount. +You can also specify additional details +such as shipping, tax.

$amount = new Amount(); +$amount->setCurrency("USD") + ->setTotal("20.00") + ->setDetails($details);

Transaction

+

A transaction defines the contract of a +payment - what is the payment for and who +is fulfilling it.

$transaction = new Transaction(); +$transaction->setAmount($amount) + ->setItemList($itemList) + ->setDescription("Payment description");

Payment

+

A Payment Resource; create one using +the above types and intent set to sale 'sale'

$payment = new Payment(); +$payment->setIntent("sale") + ->setPayer($payer) + ->setTransactions(array($transaction));

Create Payment

+

Create a payment by calling the payment->create() method +with a valid ApiContext (See bootstrap.php for more on ApiContext) +The return object contains the state.

try { + $payment->create($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Direct Credit card payments</title> +</head> +<body> + <div> + Created payment: + <?php echo $payment->getId();?> + </div> + <pre><?php echo $payment->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/payments/CreatePaymentUsingPayPal.html b/sample/doc/payments/CreatePaymentUsingPayPal.html new file mode 100644 index 00000000..e0455093 --- /dev/null +++ b/sample/doc/payments/CreatePaymentUsingPayPal.html @@ -0,0 +1,90 @@ +payments/CreatePaymentUsingPayPal
sample/payments/CreatePaymentUsingPayPal.php
<?php

Create Payment using PayPal as payment method

+

This sample code demonstrates how you can process a +PayPal Account based Payment. +API used: /v1/payments/payment

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Amount; +use PayPal\Api\Details; +use PayPal\Api\Item; +use PayPal\Api\ItemList; +use PayPal\Api\Payer; +use PayPal\Api\Payment; +use PayPal\Api\RedirectUrls; +use PayPal\Api\Transaction; +session_start();

Payer

+

A resource representing a Payer that funds a payment +For paypal account payments, set payment method +to 'paypal'.

$payer = new Payer(); +$payer->setPaymentMethod("paypal");

Itemized information

+

(Optional) Lets you specify item wise +information

$item1 = new Item(); +$item1->setName('Ground Coffee 40 oz') + ->setCurrency('USD') + ->setQuantity(1) + ->setPrice('7.50'); +$item2 = new Item(); +$item2->setName('Granola bars') + ->setCurrency('USD') + ->setQuantity(5) + ->setPrice('2.00'); + +$itemList = new ItemList(); +$itemList->setItems(array($item1, $item2));

Additional payment details

+

Use this optional field to set additional +payment information such as tax, shipping +charges etc.

$details = new Details(); +$details->setShipping('1.20') + ->setTax('1.30') + ->setSubtotal('17.50');

Amount

+

Lets you specify a payment amount. +You can also specify additional details +such as shipping, tax.

$amount = new Amount(); +$amount->setCurrency("USD") + ->setTotal("20.00") + ->setDetails($details);

Transaction

+

A transaction defines the contract of a +payment - what is the payment for and who +is fulfilling it.

$transaction = new Transaction(); +$transaction->setAmount($amount) + ->setItemList($itemList) + ->setDescription("Payment description");

Redirect urls

+

Set the urls that the buyer must be redirected to after +payment approval/ cancellation.

$baseUrl = getBaseUrl(); +$redirectUrls = new RedirectUrls(); +$redirectUrls->setReturnUrl("$baseUrl/ExecutePayment.php?success=true") + ->setCancelUrl("$baseUrl/ExecutePayment.php?success=false");

Payment

+

A Payment Resource; create one using +the above types and intent set to 'sale'

$payment = new Payment(); +$payment->setIntent("sale") + ->setPayer($payer) + ->setRedirectUrls($redirectUrls) + ->setTransactions(array($transaction));

Create Payment

+

Create a payment by calling the 'create' method +passing it a valid apiContext. +(See bootstrap.php for more on ApiContext) +The return object contains the state and the +url to which the buyer must be redirected to +for payment approval

try { + $payment->create($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +}

Get redirect url

+

The API response provides the url that you must redirect +the buyer to. Retrieve the url from the $payment->getLinks() +method

foreach($payment->getLinks() as $link) { + if($link->getRel() == 'approval_url') { + $redirectUrl = $link->getHref(); + break; + } +}

Redirect buyer to PayPal website

+

Save the payment id so that you can 'complete' the payment +once the buyer approves the payment and is redirected +back to your website. +It is not a great idea to store the payment id +in the session. In a real world app, you may want to +store the payment id in a database.

$_SESSION['paymentId'] = $payment->getId(); +if(isset($redirectUrl)) { + header("Location: $redirectUrl"); + exit; +}
\ No newline at end of file diff --git a/sample/doc/payments/CreatePaymentUsingSavedCard.html b/sample/doc/payments/CreatePaymentUsingSavedCard.html new file mode 100644 index 00000000..d42ff49c --- /dev/null +++ b/sample/doc/payments/CreatePaymentUsingSavedCard.html @@ -0,0 +1,86 @@ +payments/CreatePaymentUsingSavedCard
sample/payments/CreatePaymentUsingSavedCard.php
<?php

Create payment using a saved credit card

+

This sample code demonstrates how you can process a +Payment using a previously stored credit card token. +API used: /v1/payments/payment

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Amount; +use PayPal\Api\Details; +use PayPal\Api\Item; +use PayPal\Api\ItemList; +use PayPal\Api\CreditCardToken; +use PayPal\Api\Payer; +use PayPal\Api\Payment; +use PayPal\Api\FundingInstrument; +use PayPal\Api\Transaction;

Credit card token

+

Saved credit card id from a previous call to +CreateCreditCard.php

$creditCardToken = new CreditCardToken(); +$creditCardToken->setCreditCardId('CARD-29H07236G1554552FKINPBHQ');

FundingInstrument

+

A resource representing a Payer's funding instrument. +For stored credit card payments, set the CreditCardToken +field on this object.

$fi = new FundingInstrument(); +$fi->setCreditCardToken($creditCardToken);

Payer

+

A resource representing a Payer that funds a payment +For stored credit card payments, set payment method +to 'credit_card'.

$payer = new Payer(); +$payer->setPaymentMethod("credit_card") + ->setFundingInstruments(array($fi));

Itemized information

+

(Optional) Lets you specify item wise +information

$item1 = new Item(); +$item1->setName('Ground Coffee 40 oz') + ->setCurrency('USD') + ->setQuantity(1) + ->setPrice('7.50'); +$item2 = new Item(); +$item2->setName('Granola bars') + ->setCurrency('USD') + ->setQuantity(5) + ->setPrice('2.00'); + +$itemList = new ItemList(); +$itemList->setItems(array($item1, $item2));

Additional payment details

+

Use this optional field to set additional +payment information such as tax, shipping +charges etc.

$details = new Details(); +$details->setShipping('1.20') + ->setTax('1.30') + ->setSubtotal('17.50');

Amount

+

Lets you specify a payment amount. +You can also specify additional details +such as shipping, tax.

$amount = new Amount(); +$amount->setCurrency("USD") + ->setTotal("20.00") + ->setDetails($details);

Transaction

+

A transaction defines the contract of a +payment - what is the payment for and who +is fulfilling it.

$transaction = new Transaction(); +$transaction->setAmount($amount) + ->setItemList($itemList) + ->setDescription("Payment description");

Payment

+

A Payment Resource; create one using +the above types and intent set to 'sale'

$payment = new Payment(); +$payment->setIntent("sale") + ->setPayer($payer) + ->setTransactions(array($transaction));

Create Payment

+

Create a payment by calling the 'create' method +passing it a valid apiContext. +(See bootstrap.php for more on ApiContext) +The return object contains the state.

try { + $payment->create($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Saved Credit card payments</title> +</head> +<body> + <div> + Created payment: + <?php echo $payment->getId();?> + </div> + <pre><?php echo $payment->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/payments/ExecutePayment.html b/sample/doc/payments/ExecutePayment.html new file mode 100644 index 00000000..bc641620 --- /dev/null +++ b/sample/doc/payments/ExecutePayment.html @@ -0,0 +1,31 @@ +payments/ExecutePayment
sample/payments/ExecutePayment.php
<?php

Execute Payment Sample

+

This sample shows how you can complete +a payment that has been approved by +the buyer by logging into paypal site. +You can optionally update transaction +information by passing in one or more transactions. +API used: POST '/v1/payments/payment//execute'.

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\ExecutePayment; +use PayPal\Api\Payment; +use PayPal\Api\PaymentExecution; +session_start(); +if(isset($_GET['success']) && $_GET['success'] == 'true') { +

Get the payment Object by passing paymentId +payment id was previously stored in session in +CreatePaymentUsingPayPal.php

$paymentId = $_SESSION['paymentId']; + $payment = Payment::get($paymentId, $apiContext); +

PaymentExecution object includes information necessary +to execute a PayPal account payment. +The payer_id is added to the request query parameters +when the user is redirected from paypal back to your site

$execution = new PaymentExecution(); + $execution->setPayerId($_GET['PayerID']); + + //Execute the payment

(See bootstrap.php for more on ApiContext)

$result = $payment->execute($execution, $apiContext); + + echo "<html><body><pre>"; + echo $result->toJSON(JSON_PRETTY_PRINT); + echo "</pre><a href='../index.html'>Back</a></body></html>"; + +} else { + echo "User cancelled payment."; +}
\ No newline at end of file diff --git a/sample/doc/payments/GetAuthorization.html b/sample/doc/payments/GetAuthorization.html new file mode 100644 index 00000000..3a0d3d52 --- /dev/null +++ b/sample/doc/payments/GetAuthorization.html @@ -0,0 +1,31 @@ +payments/GetAuthorization
sample/payments/GetAuthorization.php
<?php

GetAuthorization

+

This sample code demonstrates how you can get details +of an authorized payment. +API used: /v1/payments/authorization/<$authorizationId>

require __DIR__ . '/../bootstrap.php'; + +use PayPal\Api\Authorization;

GetAuthorization

+

You can retrieve info about an Authorization +by invoking the Authorization::get method +with a valid ApiContext (See bootstrap.php for more on ApiContext) +The return object contains the authorization state.

try {

create a authorization to get authorization Id +createAuthorization is defined in common.php

$authId = createAuthorization($apiContext); +

Retrieve the authorization

$authorization = Authorization::get($authId, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Lookup an authorization</title> +</head> +<body> + <div> + Retrieved Authorization: + <?php echo $authorization->getId();?> + </div> + <pre><?php echo $authorization->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/payments/GetCapture.html b/sample/doc/payments/GetCapture.html new file mode 100644 index 00000000..3a3869e4 --- /dev/null +++ b/sample/doc/payments/GetCapture.html @@ -0,0 +1,47 @@ +payments/GetCapture
sample/payments/GetCapture.php
<?php

GetCapture

+

This sample code demonstrates how you can lookup the details +of a captured payment. +API used: /v1/payments/capture/<$captureId>

require __DIR__ . '/../bootstrap.php'; + +use PayPal\Api\Capture; +use PayPal\Api\Amount; +use PayPal\Api\Authorization;

Create a mock Capture

try {

create a mock authorization to get authorization Id +createAuthorization is defined in common.php

$authId = createAuthorization($apiContext);

Lookup the authorization

$authorization = Authorization::get($authId, $apiContext); + + ### Capture + + $amt = new Amount(); + $amt->setCurrency("USD") + ->setTotal("1.00"); +

Create a capture

$captureInfo = new Capture(); + $captureInfo->setId($authId) + ->setAmount($amt); + + $capture = $authorization->capture($captureInfo, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +}

Retrieve Capture details

+

You can look up a capture by invoking the Capture::get method +with a valid ApiContext (See bootstrap.php for more on ApiContext)

try { + $capture = Capture::get($capture->getId(), $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Lookup a capture</title> +</head> +<body> + <div> + Capture Id: + <?php echo $capture->getId();?> + </div> + <pre><?php echo $capture->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/payments/GetPayment.html b/sample/doc/payments/GetPayment.html new file mode 100644 index 00000000..fc3fdaa9 --- /dev/null +++ b/sample/doc/payments/GetPayment.html @@ -0,0 +1,33 @@ +payments/GetPayment
sample/payments/GetPayment.php
<?php

GetPaymentSample

+

This sample code demonstrate how you can +retrieve a list of all Payment resources +you've created using the Payments API. +Note various query parameters that you can +use to filter, and paginate through the +payments list. +API used: GET /v1/payments/payments

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Payment; + +$paymentId = "PAY-0XL713371A312273YKE2GCNI";

Retrieve payment

+

Retrieve the payment object by calling the +static get method +on the Payment class by passing a valid +Payment ID +(See bootstrap.php for more on ApiContext)

try { + $payment = Payment::get($paymentId, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception:" . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Lookup a payment</title> +</head> +<body> + <div>Retrieving Payment ID: <?php echo $paymentId;?></div> + <pre><?php echo $payment->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/payments/ListPayments.html b/sample/doc/payments/ListPayments.html new file mode 100644 index 00000000..334446b6 --- /dev/null +++ b/sample/doc/payments/ListPayments.html @@ -0,0 +1,32 @@ +payments/ListPayments
sample/payments/ListPayments.php
<?php

GetPaymentList

+

This sample code demonstrate how you can +retrieve a list of all Payment resources +you've created using the Payments API. +Note various query parameters that you can +use to filter, and paginate through the +payments list. +API used: GET /v1/payments/payments

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Payment;

Retrieve payment

+

Retrieve the PaymentHistory object by calling the +static get method on the Payment class, +and pass a Map object that contains +query parameters for paginations and filtering. +Refer the method doc for valid values for keys +(See bootstrap.php for more on ApiContext)

try { + $payments = Payment::all(array('count' => 10, 'start_index' => 5), $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception:" . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Lookup payment history</title> +</head> +<body> + <div>Got <?php echo $payments->getCount(); ?> matching payments </div> + <pre><?php echo $payments->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/payments/Reauthorization.html b/sample/doc/payments/Reauthorization.html new file mode 100644 index 00000000..d0efa9cd --- /dev/null +++ b/sample/doc/payments/Reauthorization.html @@ -0,0 +1,37 @@ +payments/Reauthorization
sample/payments/Reauthorization.php
<?php

Reauthorization Sample

+

This sample code demonstrates how you can reauthorize a PayPal +account payment. +API used: v1/payments/authorization/{authorization_id}/reauthorize

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Authorization; +use PayPal\Api\Amount;

Reauthorization

+

Reauthorization is available only for PayPal account payments +and not for credit card payments.

You can reauthorize a payment only once 4 to 29 +days after the 3-day honor period for the original authorization +has expired.

try { +

Lookup authorization using the authorization id

$authorization = Authorization::get('7GH53639GA425732B', $apiContext); + + $amount = new Amount(); + $amount->setCurrency("USD"); + $amount->setTotal("1.00");

Reauthorize with amount being reauthorized

$authorization->setAmount($amount); + $reauthorization = $authorization->reauthorize($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Reauthorize a payment</title> +</head> +<body> + <div> + Reauthorization Id: + <?php echo $reauthorization->getId();?> + </div> + <pre> + <?php echo $reauthorization->toJSON(JSON_PRETTY_PRINT);?> + </pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/payments/RefundCapture.html b/sample/doc/payments/RefundCapture.html new file mode 100644 index 00000000..272b6776 --- /dev/null +++ b/sample/doc/payments/RefundCapture.html @@ -0,0 +1,52 @@ +payments/RefundCapture
sample/payments/RefundCapture.php
<?php

Refund Capture Sample

+

This sample code demonstrates how you can +process a refund on a Captured transaction. +API used: /v1/payments/capture/{}/refund

require __DIR__ . '/../bootstrap.php'; + +use PayPal\Api\Authorization; +use PayPal\Api\Capture; +use PayPal\Api\Refund; +use PayPal\Api\Amount; +use PayPal\Rest\ApiContext; + + +try {

Create a mock authorization to get authorization Id

$authId = createAuthorization($apiContext);

Get the authorization

$authorization = Authorization::get($authId, $apiContext); + +

Capture

+ $amt = new Amount(); + $amt->setCurrency("USD") + ->setTotal("1.00"); +

Create a capture

$captureInfo = new Capture(); + $captureInfo->setAmount($amt); + + $capture = $authorization->capture($captureInfo, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +}

Refund

+

Create a refund object indicating +refund amount and call the refund method

$refund = new Refund(); +$refund->setAmount($amt); + +try {

Create a new apiContext object so we send a new +PayPal-Request-Id (idempotency) header for this resource

$apiContext = getApiContext(); + + $captureRefund = $capture->refund($refund, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> + +<html> +<head> + <title>Refund a captured payment</title> +</head> +<body> + <div>Refund Capture:</div> + <pre><?php echo $captureRefund->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/payments/VoidAuthorization.html b/sample/doc/payments/VoidAuthorization.html new file mode 100644 index 00000000..ae3aa7a8 --- /dev/null +++ b/sample/doc/payments/VoidAuthorization.html @@ -0,0 +1,28 @@ +payments/VoidAuthorization
sample/payments/VoidAuthorization.php
<?php

VoidAuthorization

+

This sample code demonstrates how you can +void an authorized payment. +API used: /v1/payments/authorization/<{authorizationid}>/void"

require __DIR__ . '/../bootstrap.php'; + +use PayPal\Api\Authorization;

VoidAuthorization

+

You can void a previously authorized payment +by invoking the $authorization->void method +with a valid ApiContext (See bootstrap.php for more on ApiContext)

try {

create an authorization to get authorization Id +createAuthorization is defined in common.php

$authId = createAuthorization($apiContext);

Lookup the authorization

$authorization = Authorization::get($authId, $apiContext);

Void the authorization

$voidedAuth = $authorization->void($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Void an authorization</title> +</head> +<body> + <div> + Voided authorization + </div> + <pre><?php echo $voidedAuth->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/sale/GetSale.html b/sample/doc/sale/GetSale.html new file mode 100644 index 00000000..357eb883 --- /dev/null +++ b/sample/doc/sale/GetSale.html @@ -0,0 +1,28 @@ +sale/GetSale
sample/sale/GetSale.php
<?php

Get Sale sample

+

Sale transactions are nothing but completed payments. +This sample code demonstrates how you can retrieve +details of completed Sale Transaction. +API used: /v1/payments/sale/{sale-id}

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Sale; + +$saleId = '3RM92092UW5126232'; + +try {

Retrieve the sale object

+

Pass the ID of the sale +transaction from your payment resource.

$sale = Sale::get($saleId, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception:" . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Lookup a sale</title> +</head> +<body> + <div>Retrieving sale id: <?php echo $saleId;?></div> + <pre><?php echo $sale->toJSON(JSON_PRETTY_PRINT)?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/sale/RefundSale.html b/sample/doc/sale/RefundSale.html new file mode 100644 index 00000000..f1f36139 --- /dev/null +++ b/sample/doc/sale/RefundSale.html @@ -0,0 +1,38 @@ +sale/RefundSale
sample/sale/RefundSale.php
<?php

Sale Refund Sample

+

This sample code demonstrate how you can +process a refund on a sale transaction created +using the Payments API. +API used: /v1/payments/sale/{sale-id}/refund

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\Amount; +use PayPal\Api\Refund; +use PayPal\Api\Sale;

Refund amount

+

Includes both the refunded amount (to Payer) +and refunded fee (to Payee). Use the $amt->details +field to mention fees refund details.

$amt = new Amount(); +$amt->setCurrency('USD') + ->setTotal('0.01');

Refund object

$refund = new Refund(); +$refund->setAmount($amt); + +$saleId = '3RM92092UW5126232';

Sale

+

A sale transaction. +Create a Sale object with the +given sale transaction id.

$sale = new Sale(); +$sale->setId($saleId); +try {

Refund the sale +(See bootstrap.php for more on ApiContext)

$sale->refund($refund, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception:" . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Refund a sale</title> +</head> +<body> + <div>Refunding sale id: <?php echo $saleId;?></div> + <pre><?php echo $sale->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/vault/CreateCreditCard.html b/sample/doc/vault/CreateCreditCard.html new file mode 100644 index 00000000..96253804 --- /dev/null +++ b/sample/doc/vault/CreateCreditCard.html @@ -0,0 +1,37 @@ +vault/CreateCreditCard
sample/vault/CreateCreditCard.php
<?php

Create Credit Card Sample

+

You can store credit card details securely +with PayPal. You can then use the returned +Credit card id to process future payments. +API used: POST /v1/vault/credit-card

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\CreditCard;

CreditCard

+

A resource representing a credit card that is +to be stored with PayPal.

$card = new CreditCard(); +$card->setType("visa") + ->setNumber("4417119669820331") + ->setExpireMonth("11") + ->setExpireYear("2019") + ->setCvv2("012") + ->setFirstName("Joe") + ->setLastName("Shopper");

Save card

+

Creates the credit card as a resource +in the PayPal vault. The response contains +an 'id' that you can use to refer to it +in future payments. +(See bootstrap.php for more on ApiContext)

try { + $card->create($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception:" . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Save a credit card</title> +</head> +<body> + <div>Saved a new credit card with id: <?php echo $card->getId();?></div> + <pre><?php echo $card->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/vault/DeleteCreditCard.html b/sample/doc/vault/DeleteCreditCard.html new file mode 100644 index 00000000..ed58f8a0 --- /dev/null +++ b/sample/doc/vault/DeleteCreditCard.html @@ -0,0 +1,45 @@ +vault/DeleteCreditCard
sample/vault/DeleteCreditCard.php
<?php

Delete CreditCard Sample

+

This sample code demonstrate how you can +delete a saved credit card. +API used: /v1/vault/credit-card/{} +NOTE: HTTP method used here is DELETE

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\CreditCard;

Store a mock card that can be deleted later.

+

CreditCard

+

A resource representing a credit card that can be +used to fund a payment.

$card = new CreditCard(); +$card->setType("visa") + ->setNumber("4417119669820331") + ->setExpireMonth("11") + ->setExpireYear("2019") + ->setCvv2("012") + ->setFirstName("Joe") + ->setLastName("Shopper");

Save card

+

Creates the credit card as a resource +in the PayPal vault. The response contains +an 'id' that you can use to refer to it later. +(See bootstrap.php for more on ApiContext)

try { + $card = $card->create($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception:" . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} + +try {

Delete Card

+

Lookup and delete a saved credit card. +(See bootstrap.php for more on ApiContext)

$creditCard = CreditCard::get($card->getId(), $apiContext); + $creditCard->delete($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + exit(1); +} +?> +<html> +<head> + <title>Delete a saved credit card</title> +</head> +<body> + <p> Credit Card deleted Successfully</p> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/doc/vault/GetCreditCard.html b/sample/doc/vault/GetCreditCard.html new file mode 100644 index 00000000..a596645e --- /dev/null +++ b/sample/doc/vault/GetCreditCard.html @@ -0,0 +1,27 @@ +vault/GetCreditCard
sample/vault/GetCreditCard.php
<?php

Get Credit Card Sample

+

The CreditCard resource allows you to +retrieve previously saved CreditCards. +API called: '/v1/vault/credit-card' +The following code takes you through +the process of retrieving a saved CreditCard

require __DIR__ . '/../bootstrap.php'; +use PayPal\Api\CreditCard;

The cardId can be obtained from a previous save credit +card operation. Use $card->getId()

$cardId = "CARD-5AR29593TC404090HKIKN77Q"; + +/// ### Retrieve card

(See bootstrap.php for more on ApiContext)

try { + $card = CreditCard::get($cardId, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> +<html> +<head> + <title>Lookup a saved credit card</title> +</head> +<body> + <div>Retrieving saved credit card: <?php echo $cardId;?></div> + <pre><?php echo $card->toJSON(JSON_PRETTY_PRINT);?></pre> + <a href='../index.html'>Back</a> +</body> +</html>
\ No newline at end of file diff --git a/sample/images/edt-format-source-button.png b/sample/images/edt-format-source-button.png deleted file mode 100644 index 88cc504d..00000000 Binary files a/sample/images/edt-format-source-button.png and /dev/null differ diff --git a/sample/images/favicon.ico b/sample/images/favicon.ico new file mode 100644 index 00000000..78713f95 Binary files /dev/null and b/sample/images/favicon.ico differ diff --git a/sample/images/play_button.png b/sample/images/play_button.png deleted file mode 100644 index 9afac6e6..00000000 Binary files a/sample/images/play_button.png and /dev/null differ diff --git a/sample/images/pp_v_rgb.png b/sample/images/pp_v_rgb.png new file mode 100755 index 00000000..771c17f6 Binary files /dev/null and b/sample/images/pp_v_rgb.png differ diff --git a/sample/index.html b/sample/index.html index c1915060..b31067d0 100644 --- a/sample/index.html +++ b/sample/index.html @@ -1,121 +1,310 @@ - - + + + - -PayPal REST API Samples - + + + + + + + + PayPal REST API Samples + + + + + + + -
-

PayPal REST API Samples

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Payments
Direct credit card paymentsExecuteSource
PayPal account paymentsExecuteSource
Stored credit card paymentsExecuteSource
Get payment detailsExecuteSource
Get payment historyExecuteSource
Get sale detailsExecuteSource
Refund a paymentExecuteSource
Vault
Save a credit cardExecuteSource
Retrieve saved credit cardExecuteSource
Delete saved credit cardExecuteSource
Authorization and capture
Get details of an authorized paymentExecuteSource
Capture an authorized paymentExecuteSource
Void an authorized paymentExecuteSource
Reauthorize a paymentExecuteSource
Get details of a captured paymentExecuteSource
Refund captured paymentExecuteSource
+ +
+
+
+
+ +
+
+

REST API Samples

+

These examples are created to experiment with the rest-api-sdk-php capabilities. Each examples are designed to demonstrate the default use-cases in each segment. + Many examples should be executable, and should allow you to experience the default behavior of our sdk, to expedite your integration experience.

+

+

+
+

+
+
+
+
+
+
+

Payments

+
+ + +
+ +
+
+

Sale

+
+ + +
+ +
+
+

Vault

+
+ + +
+ +
+
+

Authorization and capture

+
+ + +
+ +
+
+

Invoice

+
+ + +
+
+
+ + + + + + diff --git a/sample/invoice/CancelInvoice.php b/sample/invoice/CancelInvoice.php new file mode 100644 index 00000000..493adc1a --- /dev/null +++ b/sample/invoice/CancelInvoice.php @@ -0,0 +1,57 @@ +setSubject("Past due") + ->setNote("Canceling invoice") + ->setSendToMerchant(true) + ->setSendToPayer(true); + + + // ### Cancel Invoice + // Cancel invoice object by calling the + // static `cancel` method + // on the Invoice class by passing a valid + // notification object + // (See bootstrap.php for more on `ApiContext`) + $cancelStatus = $invoice->cancel($notify, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} + +?> + + + + Cancel Invoice + + +
Cancel Invoice:
+
toJSON(JSON_PRETTY_PRINT); ?>
+Back + + diff --git a/sample/invoice/CreateInvoice.php b/sample/invoice/CreateInvoice.php new file mode 100644 index 00000000..2df26fcb --- /dev/null +++ b/sample/invoice/CreateInvoice.php @@ -0,0 +1,119 @@ +setMerchantInfo(new MerchantInfo()) + ->setBillingInfo(array(new BillingInfo())) + ->setItems(array(new InvoiceItem())) + ->setNote("Medical Invoice 16 Jul, 2013 PST") + ->setPaymentTerm(new PaymentTerm()) + ->setShippingInfo(new ShippingInfo()); + +// ### Merchant Info +// A resource representing merchant information that can be +// used to identify merchant +$invoice->getMerchantInfo() + ->setEmail("PPX.DevNet-facilitator@gmail.com") + ->setFirstName("Dennis") + ->setLastName("Doctor") + ->setbusinessName("Medical Professionals, LLC") + ->setPhone(new Phone()) + ->setAddress(new Address()); + +$invoice->getMerchantInfo()->getPhone() + ->setCountryCode("001") + ->setNationalNumber("5032141716"); + +// ### Address Information +// The address used for creating the invoice +$invoice->getMerchantInfo()->getAddress() + ->setLine1("1234 Main St.") + ->setCity("Portland") + ->setState("OR") + ->setPostalCode("97217") + ->setCountryCode("US"); + +// ### Billing Information +// Set the email address for each billing +$billing = $invoice->getBillingInfo(); +$billing[0] + ->setEmail("example@example.com"); + +// ### Items List +// You could provide the list of all items for +// detailed breakdown of invoice +$items = $invoice->getItems(); +$items[0] + ->setName("Sutures") + ->setQuantity(100) + ->setUnitPrice(new Currency()); + +$items[0]->getUnitPrice() + ->setCurrency("USD") + ->setValue(5); + +$invoice->getPaymentTerm() + ->setTermType("NET_45"); + +// ### Shipping Information +$invoice->getShippingInfo() + ->setFirstName("Sally") + ->setLastName("Patient") + ->setBusinessName("Not applicable") + ->setPhone(new Phone()) + ->setAddress(new Address()); + +$invoice->getShippingInfo()->getPhone() + ->setCountryCode("001") + ->setNationalNumber("5039871234"); + +$invoice->getShippingInfo()->getAddress() + ->setLine1("1234 Main St.") + ->setCity("Portland") + ->setState("OR") + ->setPostalCode("97217") + ->setCountryCode("US"); + +try { + // ### Create Invoice + // Create an invoice by calling the invoice->create() method + // with a valid ApiContext (See bootstrap.php for more on `ApiContext`) + $invoice->create($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> + + + Invoice Creation + + +
+ Created Invoice: + getId(); ?> +
+
toJSON(JSON_PRETTY_PRINT); ?>
+Back + + diff --git a/sample/invoice/GetInvoice.php b/sample/invoice/GetInvoice.php new file mode 100644 index 00000000..1a480386 --- /dev/null +++ b/sample/invoice/GetInvoice.php @@ -0,0 +1,35 @@ +getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> + + + Lookup invoice details + + +
Retrieving Invoice:
+
toJSON(JSON_PRETTY_PRINT); ?>
+ Back + + diff --git a/sample/invoice/ListInvoice.php b/sample/invoice/ListInvoice.php new file mode 100644 index 00000000..9f69ffe0 --- /dev/null +++ b/sample/invoice/ListInvoice.php @@ -0,0 +1,32 @@ +getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} +?> + + + Lookup invoice history + + +
Got invoices
+
toJSON(JSON_PRETTY_PRINT); ?>
+ Back + + diff --git a/sample/invoice/RemindInvoice.php b/sample/invoice/RemindInvoice.php new file mode 100644 index 00000000..0ecb237a --- /dev/null +++ b/sample/invoice/RemindInvoice.php @@ -0,0 +1,55 @@ +setSubject("Past due") + ->setNote("Please pay soon") + ->setSendToMerchant(true); + + // ### Remind Invoice + // Remind the notifiers by calling the + // `remind` method + // on the Invoice class by passing a valid + // notification object + // (See bootstrap.php for more on `ApiContext`) + $remindStatus = $invoice->remind($notify, $apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} + +?> + + + + Remind Invoice + + +
Remind Invoice:
+
toJSON(JSON_PRETTY_PRINT); ?>
+Back + + diff --git a/sample/invoice/SendInvoice.php b/sample/invoice/SendInvoice.php new file mode 100644 index 00000000..47405598 --- /dev/null +++ b/sample/invoice/SendInvoice.php @@ -0,0 +1,40 @@ +send($apiContext); +} catch (PayPal\Exception\PPConnectionException $ex) { + echo "Exception: " . $ex->getMessage() . PHP_EOL; + var_dump($ex->getData()); + exit(1); +} + +?> + + + Send Invoice + + +
Send Invoice:
+
toJSON(JSON_PRETTY_PRINT); ?>
+Back + + diff --git a/sample/invoicing/CancelInvoice.php b/sample/invoicing/CancelInvoice.php deleted file mode 100644 index 5abefd6f..00000000 --- a/sample/invoicing/CancelInvoice.php +++ /dev/null @@ -1,37 +0,0 @@ -setSubject("Past due") - ->setNote("Canceling invoice") - ->setSendToMerchant(true) - ->setSendToPayer(true); - - - $cancelStatus = $invoice->cancel($notify, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} - -?> - - - - Cancel Invoice - - -
Cancel Invoice:
-
- Back - - diff --git a/sample/invoicing/CreateInvoice.php b/sample/invoicing/CreateInvoice.php deleted file mode 100644 index e67fcab8..00000000 --- a/sample/invoicing/CreateInvoice.php +++ /dev/null @@ -1,100 +0,0 @@ -setMerchantInfo(new MerchantInfo()) - ->setBillingInfo(array(new BillingInfo())) - ->setItems(array(new InvoiceItem())) - ->setNote("Medical Invoice 16 Jul, 2013 PST") - ->setPaymentTerm(new PaymentTerm()) - ->setShippingInfo(new ShippingInfo()); - -$invoice->getMerchantInfo() - ->setEmail("PPX.DevNet-facilitator@gmail.com") - ->setFirstName("Dennis") - ->setLastName("Doctor") - ->setbusinessName("Medical Professionals, LLC") - ->setPhone(new Phone()) - ->setAddress(new Address()); - -$invoice->getMerchantInfo()->getPhone() - ->setCountryCode("001") - ->setNationalNumber("5032141716"); - -$invoice->getMerchantInfo()->getAddress() - ->setLine1("1234 Main St.") - ->setCity("Portland") - ->setState("OR") - ->setPostalCode("97217") - ->setCountryCode("US"); - -$billing = $invoice->getBillingInfo(); -$billing[0] - ->setEmail("example@example.com"); - -$items = $invoice->getItems(); -$items[0] - ->setName("Sutures") - ->setQuantity(100) - ->setUnitPrice(new Currency()); - -$items[0]->getUnitPrice() - ->setCurrency("USD") - ->setValue(5); - -$invoice->getPaymentTerm() - ->setTermType("NET_45"); - -$invoice->getShippingInfo() - ->setFirstName("Sally") - ->setLastName("Patient") - ->setBusinessName("Not applicable") - ->setPhone(new Phone()) - ->setAddress(new Address()); - -$invoice->getShippingInfo()->getPhone() - ->setCountryCode("001") - ->setNationalNumber("5039871234"); - -$invoice->getShippingInfo()->getAddress() - ->setLine1("1234 Main St.") - ->setCity("Portland") - ->setState("OR") - ->setPostalCode("97217") - ->setCountryCode("US"); - -print(var_dump($invoice->toArray())); - -try { - $invoice->create($apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> - - - Direct Credit card payments - - -
- Created Invoice: - getId();?> -
-
toArray());?>
- Back - - diff --git a/sample/invoicing/GetInvoice.php b/sample/invoicing/GetInvoice.php deleted file mode 100644 index 3add02c1..00000000 --- a/sample/invoicing/GetInvoice.php +++ /dev/null @@ -1,19 +0,0 @@ - - - - Lookup invoice details - - -
Retrieving Invoice:
-
- Back - - diff --git a/sample/invoicing/ListInvoice.php b/sample/invoicing/ListInvoice.php deleted file mode 100644 index 420ebba4..00000000 --- a/sample/invoicing/ListInvoice.php +++ /dev/null @@ -1,22 +0,0 @@ -getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> - - - Lookup invoice history - - -
Got invoices
-
toArray());?>
- Back - - diff --git a/sample/invoicing/RemindInvoice.php b/sample/invoicing/RemindInvoice.php deleted file mode 100644 index 1d20789b..00000000 --- a/sample/invoicing/RemindInvoice.php +++ /dev/null @@ -1,35 +0,0 @@ -setSubject("Past due") - ->setNote("Please pay soon") - ->setSendToMerchant(true); - - $remindStatus = $invoice->remind($notify, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} - -?> - - - - Remind Invoice - - -
Remind Invoice:
-
- Back - - diff --git a/sample/invoicing/SendInvoice.php b/sample/invoicing/SendInvoice.php deleted file mode 100644 index 61d39cc8..00000000 --- a/sample/invoicing/SendInvoice.php +++ /dev/null @@ -1,27 +0,0 @@ -send($apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} - -?> - - - Send Invoice - - -
Send Invoice:
-
- Back - - diff --git a/sample/payments/AuthorizationCapture.php b/sample/payments/AuthorizationCapture.php index 0bfce9ea..6e3c7b82 100644 --- a/sample/payments/AuthorizationCapture.php +++ b/sample/payments/AuthorizationCapture.php @@ -48,7 +48,7 @@ Captured payment getParentPayment(); ?>. Capture Id: getId();?> -
toArray());?>
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/sample/payments/CreatePayment.php b/sample/payments/CreatePayment.php index 36ec3d8d..6dc0ad7a 100644 --- a/sample/payments/CreatePayment.php +++ b/sample/payments/CreatePayment.php @@ -123,7 +123,7 @@ Created payment: getId();?> -
toArray());?>
+
toJSON(JSON_PRETTY_PRINT);?>
Back \ No newline at end of file diff --git a/sample/payments/CreatePaymentUsingSavedCard.php b/sample/payments/CreatePaymentUsingSavedCard.php index 5f90f626..7c682ed7 100644 --- a/sample/payments/CreatePaymentUsingSavedCard.php +++ b/sample/payments/CreatePaymentUsingSavedCard.php @@ -111,7 +111,7 @@ Created payment: getId();?> -
toArray());?>
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/sample/payments/ExecutePayment.php b/sample/payments/ExecutePayment.php index 3ef96440..e3b9e653 100644 --- a/sample/payments/ExecutePayment.php +++ b/sample/payments/ExecutePayment.php @@ -32,7 +32,7 @@ $result = $payment->execute($execution, $apiContext); echo "
";
-	var_dump($result);
+	echo $result->toJSON(JSON_PRETTY_PRINT);
 	echo "
Back"; } else { diff --git a/sample/payments/GetAuthorization.php b/sample/payments/GetAuthorization.php index 2caeb8b5..f66bb859 100644 --- a/sample/payments/GetAuthorization.php +++ b/sample/payments/GetAuthorization.php @@ -37,7 +37,7 @@ Retrieved Authorization: getId();?> -
toArray());?>
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/sample/payments/GetCapture.php b/sample/payments/GetCapture.php index 288dda6f..d470dbd5 100644 --- a/sample/payments/GetCapture.php +++ b/sample/payments/GetCapture.php @@ -58,7 +58,7 @@ Capture Id: getId();?> -
toArray());?>
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/sample/payments/GetPayment.php b/sample/payments/GetPayment.php index 91d90c04..9eef28cb 100644 --- a/sample/payments/GetPayment.php +++ b/sample/payments/GetPayment.php @@ -33,7 +33,7 @@
Retrieving Payment ID:
-
toArray());?>
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/sample/payments/ListPayments.php b/sample/payments/ListPayments.php index 6b19b3ef..a5886132 100644 --- a/sample/payments/ListPayments.php +++ b/sample/payments/ListPayments.php @@ -34,7 +34,7 @@
Got getCount(); ?> matching payments
-
toArray());?>
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/sample/payments/Reauthorization.php b/sample/payments/Reauthorization.php index 7fc500cd..02a5ac06 100644 --- a/sample/payments/Reauthorization.php +++ b/sample/payments/Reauthorization.php @@ -44,7 +44,7 @@ getId();?>
-		toArray());?>
+		toJSON(JSON_PRETTY_PRINT);?>
 	
Back diff --git a/sample/payments/RefundCapture.php b/sample/payments/RefundCapture.php index 55a9be87..07c64274 100644 --- a/sample/payments/RefundCapture.php +++ b/sample/payments/RefundCapture.php @@ -64,7 +64,7 @@
Refund Capture:
-
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/sample/payments/VoidAuthorization.php b/sample/payments/VoidAuthorization.php index e1c3f745..974c6bbf 100644 --- a/sample/payments/VoidAuthorization.php +++ b/sample/payments/VoidAuthorization.php @@ -37,7 +37,7 @@
Voided authorization
-
toArray());?>
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/sample/sale/GetSale.php b/sample/sale/GetSale.php index ad64f708..0c8aece5 100644 --- a/sample/sale/GetSale.php +++ b/sample/sale/GetSale.php @@ -28,7 +28,7 @@
Retrieving sale id:
-
+
toJSON(JSON_PRETTY_PRINT)?>
Back diff --git a/sample/sale/RefundSale.php b/sample/sale/RefundSale.php index 01d72928..6b734ce0 100644 --- a/sample/sale/RefundSale.php +++ b/sample/sale/RefundSale.php @@ -47,7 +47,7 @@
Refunding sale id:
-
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/sample/source/AuthorizationCapture.html b/sample/source/AuthorizationCapture.html deleted file mode 100644 index b1df14b7..00000000 --- a/sample/source/AuthorizationCapture.html +++ /dev/null @@ -1,41 +0,0 @@ -AuthorizationCapture
AuthorizationCapture.php
<?php

AuthorizationCapture

- -

This sample code demonstrates how you can capture -a previously authorized payment. -API used: /v1/payments/payment

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\Amount; -use PayPal\Api\Capture; -use PayPal\Api\Authorization;

Capture Payment

- -

You can capture and process a previously created authorization -by invoking the $authorization->capture method -with a valid ApiContext (See bootstrap.php for more on ApiContext)

try {

Create a new authorization to get authorization Id -createAuthorization defined in common.php

$authId = createAuthorization($apiContext); - - $amt = new Amount(); - $amt->setCurrency("USD") - ->setTotal("1.00"); - - ### Capture - $capture = new Capture(); - $capture->setId($authId) - ->setAmount($amt);

Lookup the authorization.

$authorization = Authorization::get($authId, $apiContext);

Perform a capture

$getCapture = $authorization->capture($capture, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Capturing an authorization</title> -</head> -<body> - <div> - Captured payment <?php echo $getCapture->getParentPayment(); ?>. Capture Id: - <?php echo $getCapture->getId();?> - </div> - <pre><?php var_dump($getCapture->toArray());?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/CreateCreditCard.html b/sample/source/CreateCreditCard.html deleted file mode 100644 index e3a0eddf..00000000 --- a/sample/source/CreateCreditCard.html +++ /dev/null @@ -1,40 +0,0 @@ -CreateCreditCard
CreateCreditCard.php
<?php

Create Credit Card Sample

- -

You can store credit card details securely -with PayPal. You can then use the returned -Credit card id to process future payments. -API used: POST /v1/vault/credit-card

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\CreditCard;

CreditCard

- -

A resource representing a credit card that is -to be stored with PayPal.

$card = new CreditCard(); -$card->setType("visa") - ->setNumber("4417119669820331") - ->setExpireMonth("11") - ->setExpireYear("2019") - ->setCvv2("012") - ->setFirstName("Joe") - ->setLastName("Shopper");

Save card

- -

Creates the credit card as a resource -in the PayPal vault. The response contains -an 'id' that you can use to refer to it -in future payments. -(See bootstrap.php for more on ApiContext)

try { - $card->create($apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception:" . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Save a credit card</title> -</head> -<body> - <div>Saved a new credit card with id: <?php echo $card->getId();?></div> - <pre><?php var_dump($card);?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/CreatePayment.html b/sample/source/CreatePayment.html deleted file mode 100644 index 747f8b02..00000000 --- a/sample/source/CreatePayment.html +++ /dev/null @@ -1,103 +0,0 @@ -CreatePayment
CreatePayment.php
<?php

CreatePaymentSample

- -

This sample code demonstrate how you can process -a direct credit card payment. Please note that direct -credit card payment and related features using the -REST API is restricted in some countries. -API used: /v1/payments/payment

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\Amount; -use PayPal\Api\Details; -use PayPal\Api\Item; -use PayPal\Api\ItemList; -use PayPal\Api\CreditCard; -use PayPal\Api\Payer; -use PayPal\Api\Payment; -use PayPal\Api\FundingInstrument; -use PayPal\Api\Transaction;

CreditCard

- -

A resource representing a credit card that can be -used to fund a payment.

$card = new CreditCard(); -$card->setType("visa") - ->setNumber("4417119669820331") - ->setExpireMonth("11") - ->setExpireYear("2019") - ->setCvv2("012") - ->setFirstName("Joe") - ->setLastName("Shopper");

FundingInstrument

- -

A resource representing a Payer's funding instrument. -For direct credit card payments, set the CreditCard -field on this object.

$fi = new FundingInstrument(); -$fi->setCreditCard($card);

Payer

- -

A resource representing a Payer that funds a payment -For direct credit card payments, set payment method -to 'credit_card' and add an array of funding instruments.

$payer = new Payer(); -$payer->setPaymentMethod("credit_card") - ->setFundingInstruments(array($fi));

Itemized information

- -

(Optional) Lets you specify item wise -information

$item1 = new Item(); -$item1->setName('Ground Coffee 40 oz') - ->setCurrency('USD') - ->setQuantity(1) - ->setPrice('7.50'); -$item2 = new Item(); -$item2->setName('Granola bars') - ->setCurrency('USD') - ->setQuantity(5) - ->setPrice('2.00'); - -$itemList = new ItemList(); -$itemList->setItems(array($item1, $item2));

Additional payment details

- -

Use this optional field to set additional -payment information such as tax, shipping -charges etc.

$details = new Details(); -$details->setShipping('1.20') - ->setTax('1.30') - ->setSubtotal('17.50');

Amount

- -

Lets you specify a payment amount. -You can also specify additional details -such as shipping, tax.

$amount = new Amount(); -$amount->setCurrency("USD") - ->setTotal("20.00") - ->setDetails($details);

Transaction

- -

A transaction defines the contract of a -payment - what is the payment for and who -is fulfilling it.

$transaction = new Transaction(); -$transaction->setAmount($amount) - ->setItemList($itemList) - ->setDescription("Payment description");

Payment

- -

A Payment Resource; create one using -the above types and intent set to sale 'sale'

$payment = new Payment(); -$payment->setIntent("sale") - ->setPayer($payer) - ->setTransactions(array($transaction));

Create Payment

- -

Create a payment by calling the payment->create() method -with a valid ApiContext (See bootstrap.php for more on ApiContext) -The return object contains the state.

try { - $payment->create($apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Direct Credit card payments</title> -</head> -<body> - <div> - Created payment: - <?php echo $payment->getId();?> - </div> - <pre><?php var_dump($payment->toArray());?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/CreatePaymentUsingPayPal.html b/sample/source/CreatePaymentUsingPayPal.html deleted file mode 100644 index 851cdedd..00000000 --- a/sample/source/CreatePaymentUsingPayPal.html +++ /dev/null @@ -1,101 +0,0 @@ -CreatePaymentUsingPayPal
CreatePaymentUsingPayPal.php
<?php

Create Payment using PayPal as payment method

- -

This sample code demonstrates how you can process a -PayPal Account based Payment. -API used: /v1/payments/payment

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\Amount; -use PayPal\Api\Details; -use PayPal\Api\Item; -use PayPal\Api\ItemList; -use PayPal\Api\Payer; -use PayPal\Api\Payment; -use PayPal\Api\RedirectUrls; -use PayPal\Api\Transaction; -session_start();

Payer

- -

A resource representing a Payer that funds a payment -For paypal account payments, set payment method -to 'paypal'.

$payer = new Payer(); -$payer->setPaymentMethod("paypal");

Itemized information

- -

(Optional) Lets you specify item wise -information

$item1 = new Item(); -$item1->setName('Ground Coffee 40 oz') - ->setCurrency('USD') - ->setQuantity(1) - ->setPrice('7.50'); -$item2 = new Item(); -$item2->setName('Granola bars') - ->setCurrency('USD') - ->setQuantity(5) - ->setPrice('2.00'); - -$itemList = new ItemList(); -$itemList->setItems(array($item1, $item2));

Additional payment details

- -

Use this optional field to set additional -payment information such as tax, shipping -charges etc.

$details = new Details(); -$details->setShipping('1.20') - ->setTax('1.30') - ->setSubtotal('17.50');

Amount

- -

Lets you specify a payment amount. -You can also specify additional details -such as shipping, tax.

$amount = new Amount(); -$amount->setCurrency("USD") - ->setTotal("20.00") - ->setDetails($details);

Transaction

- -

A transaction defines the contract of a -payment - what is the payment for and who -is fulfilling it.

$transaction = new Transaction(); -$transaction->setAmount($amount) - ->setItemList($itemList) - ->setDescription("Payment description");

Redirect urls

- -

Set the urls that the buyer must be redirected to after -payment approval/ cancellation.

$baseUrl = getBaseUrl(); -$redirectUrls = new RedirectUrls(); -$redirectUrls->setReturnUrl("$baseUrl/ExecutePayment.php?success=true") - ->setCancelUrl("$baseUrl/ExecutePayment.php?success=false");

Payment

- -

A Payment Resource; create one using -the above types and intent set to 'sale'

$payment = new Payment(); -$payment->setIntent("sale") - ->setPayer($payer) - ->setRedirectUrls($redirectUrls) - ->setTransactions(array($transaction));

Create Payment

- -

Create a payment by calling the 'create' method -passing it a valid apiContext. -(See bootstrap.php for more on ApiContext) -The return object contains the state and the -url to which the buyer must be redirected to -for payment approval

try { - $payment->create($apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -}

Get redirect url

- -

The API response provides the url that you must redirect -the buyer to. Retrieve the url from the $payment->getLinks() -method

foreach($payment->getLinks() as $link) { - if($link->getRel() == 'approval_url') { - $redirectUrl = $link->getHref(); - break; - } -}

Redirect buyer to PayPal website

- -

Save the payment id so that you can 'complete' the payment -once the buyer approves the payment and is redirected -back to your website. -It is not a great idea to store the payment id -in the session. In a real world app, you may want to -store the payment id in a database.

$_SESSION['paymentId'] = $payment->getId(); -if(isset($redirectUrl)) { - header("Location: $redirectUrl"); - exit; -}
\ No newline at end of file diff --git a/sample/source/CreatePaymentUsingSavedCard.html b/sample/source/CreatePaymentUsingSavedCard.html deleted file mode 100644 index 971ee7fc..00000000 --- a/sample/source/CreatePaymentUsingSavedCard.html +++ /dev/null @@ -1,96 +0,0 @@ -CreatePaymentUsingSavedCard
CreatePaymentUsingSavedCard.php
<?php

Create payment using a saved credit card

- -

This sample code demonstrates how you can process a -Payment using a previously stored credit card token. -API used: /v1/payments/payment

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\Amount; -use PayPal\Api\Details; -use PayPal\Api\Item; -use PayPal\Api\ItemList; -use PayPal\Api\CreditCardToken; -use PayPal\Api\Payer; -use PayPal\Api\Payment; -use PayPal\Api\FundingInstrument; -use PayPal\Api\Transaction;

Credit card token

- -

Saved credit card id from a previous call to -CreateCreditCard.php

$creditCardToken = new CreditCardToken(); -$creditCardToken->setCreditCardId('CARD-29H07236G1554552FKINPBHQ');

FundingInstrument

- -

A resource representing a Payer's funding instrument. -For stored credit card payments, set the CreditCardToken -field on this object.

$fi = new FundingInstrument(); -$fi->setCreditCardToken($creditCardToken);

Payer

- -

A resource representing a Payer that funds a payment -For stored credit card payments, set payment method -to 'credit_card'.

$payer = new Payer(); -$payer->setPaymentMethod("credit_card") - ->setFundingInstruments(array($fi));

Itemized information

- -

(Optional) Lets you specify item wise -information

$item1 = new Item(); -$item1->setName('Ground Coffee 40 oz') - ->setCurrency('USD') - ->setQuantity(1) - ->setPrice('7.50'); -$item2 = new Item(); -$item2->setName('Granola bars') - ->setCurrency('USD') - ->setQuantity(5) - ->setPrice('2.00'); - -$itemList = new ItemList(); -$itemList->setItems(array($item1, $item2));

Additional payment details

- -

Use this optional field to set additional -payment information such as tax, shipping -charges etc.

$details = new Details(); -$details->setShipping('1.20') - ->setTax('1.30') - ->setSubtotal('17.50');

Amount

- -

Lets you specify a payment amount. -You can also specify additional details -such as shipping, tax.

$amount = new Amount(); -$amount->setCurrency("USD") - ->setTotal("20.00") - ->setDetails($details);

Transaction

- -

A transaction defines the contract of a -payment - what is the payment for and who -is fulfilling it.

$transaction = new Transaction(); -$transaction->setAmount($amount) - ->setItemList($itemList) - ->setDescription("Payment description");

Payment

- -

A Payment Resource; create one using -the above types and intent set to 'sale'

$payment = new Payment(); -$payment->setIntent("sale") - ->setPayer($payer) - ->setTransactions(array($transaction));

Create Payment

- -

Create a payment by calling the 'create' method -passing it a valid apiContext. -(See bootstrap.php for more on ApiContext) -The return object contains the state.

try { - $payment->create($apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Saved Credit card payments</title> -</head> -<body> - <div> - Created payment: - <?php echo $payment->getId();?> - </div> - <pre><?php var_dump($payment->toArray());?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/DeleteCreditCard.html b/sample/source/DeleteCreditCard.html deleted file mode 100644 index 37de6d72..00000000 --- a/sample/source/DeleteCreditCard.html +++ /dev/null @@ -1,50 +0,0 @@ -DeleteCreditCard
DeleteCreditCard.php
<?php

Delete CreditCard Sample

- -

This sample code demonstrate how you can -delete a saved credit card. -API used: /v1/vault/credit-card/{} -NOTE: HTTP method used here is DELETE

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\CreditCard;

Store a mock card that can be deleted later.

- -

CreditCard

- -

A resource representing a credit card that can be -used to fund a payment.

$card = new CreditCard(); -$card->setType("visa") - ->setNumber("4417119669820331") - ->setExpireMonth("11") - ->setExpireYear("2019") - ->setCvv2("012") - ->setFirstName("Joe") - ->setLastName("Shopper");

Save card

- -

Creates the credit card as a resource -in the PayPal vault. The response contains -an 'id' that you can use to refer to it later. -(See bootstrap.php for more on ApiContext)

try { - $card = $card->create($apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception:" . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} - -try {

Delete Card

- -

Lookup and delete a saved credit card. -(See bootstrap.php for more on ApiContext)

$creditCard = CreditCard::get($card->getId(), $apiContext); - $creditCard->delete($apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - exit(1); -} -?> -<html> -<head> - <title>Delete a saved credit card</title> -</head> -<body> - <p> Credit Card deleted Successfully</p> - <a href='../index.html'>Back</a> -</body> -</html>
diff --git a/sample/source/ExecutePayment.html b/sample/source/ExecutePayment.html deleted file mode 100644 index 98126678..00000000 --- a/sample/source/ExecutePayment.html +++ /dev/null @@ -1,32 +0,0 @@ -ExecutePayment
ExecutePayment.php
<?php

Execute Payment Sample

- -

This sample shows how you can complete -a payment that has been approved by -the buyer by logging into paypal site. -You can optionally update transaction -information by passing in one or more transactions. -API used: POST '/v1/payments/payment//execute'.

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\ExecutePayment; -use PayPal\Api\Payment; -use PayPal\Api\PaymentExecution; -session_start(); -if(isset($_GET['success']) && $_GET['success'] == 'true') { -

Get the payment Object by passing paymentId -payment id was previously stored in session in -CreatePaymentUsingPayPal.php

$paymentId = $_SESSION['paymentId']; - $payment = Payment::get($paymentId, $apiContext); -

PaymentExecution object includes information necessary -to execute a PayPal account payment. -The payer_id is added to the request query parameters -when the user is redirected from paypal back to your site

$execution = new PaymentExecution(); - $execution->setPayerId($_GET['PayerID']); - - //Execute the payment

(See bootstrap.php for more on ApiContext)

$payment->execute($execution, $apiContext); - - echo "<html><body><pre>"; - var_dump($payment->toArray()); - echo "</pre><a href='../index.html'>Back</a></body></html>"; - -} else { - echo "User cancelled payment."; -}
\ No newline at end of file diff --git a/sample/source/GetAuthorization.html b/sample/source/GetAuthorization.html deleted file mode 100644 index 0bf6b5b2..00000000 --- a/sample/source/GetAuthorization.html +++ /dev/null @@ -1,33 +0,0 @@ -GetAuthorization
GetAuthorization.php
<?php

GetAuthorization

- -

This sample code demonstrates how you can get details -of an authorized payment. -API used: /v1/payments/authorization/<$authorizationId>

require __DIR__ . '/../bootstrap.php'; - -use PayPal\Api\Authorization;

GetAuthorization

- -

You can retrieve info about an Authorization -by invoking the Authorization::get method -with a valid ApiContext (See bootstrap.php for more on ApiContext) -The return object contains the authorization state.

try {

create a authorization to get authorization Id -createAuthorization is defined in common.php

$authId = createAuthorization($apiContext); -

Retrieve the authorization

$authorization = Authorization::get($authId, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Lookup an authorization</title> -</head> -<body> - <div> - Retrieved Authorization: - <?php echo $authorization->getId();?> - </div> - <pre><?php var_dump($authorization->toArray());?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/GetCapture.html b/sample/source/GetCapture.html deleted file mode 100644 index 521bb68f..00000000 --- a/sample/source/GetCapture.html +++ /dev/null @@ -1,49 +0,0 @@ -GetCapture
GetCapture.php
<?php

GetCapture

- -

This sample code demonstrates how you can lookup the details -of a captured payment. -API used: /v1/payments/capture/<$captureId>

require __DIR__ . '/../bootstrap.php'; - -use PayPal\Api\Capture; -use PayPal\Api\Amount; -use PayPal\Api\Authorization;

Create a mock Capture

try {

create a mock authorization to get authorization Id -createAuthorization is defined in common.php

$authId = createAuthorization($apiContext);

Lookup the authorization

$authorization = Authorization::get($authId, $apiContext); - - ### Capture - - $amt = new Amount(); - $amt->setCurrency("USD") - ->setTotal("1.00"); -

Create a capture

$captureInfo = new Capture(); - $captureInfo->setId($authId) - ->setAmount($amt); - - $capture = $authorization->capture($captureInfo, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -}

Retrieve Capture details

- -

You can look up a capture by invoking the Capture::get method -with a valid ApiContext (See bootstrap.php for more on ApiContext)

try { - $capture = Capture::get($capture->getId(), $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Lookup a capture</title> -</head> -<body> - <div> - Capture Id: - <?php echo $capture->getId();?> - </div> - <pre><?php var_dump($capture->toArray());?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/GetCreditCard.html b/sample/source/GetCreditCard.html deleted file mode 100644 index 8761a9f6..00000000 --- a/sample/source/GetCreditCard.html +++ /dev/null @@ -1,28 +0,0 @@ -GetCreditCard
GetCreditCard.php
<?php

Get Credit Card Sample

- -

The CreditCard resource allows you to -retrieve previously saved CreditCards. -API called: '/v1/vault/credit-card' -The following code takes you through -the process of retrieving a saved CreditCard

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\CreditCard;

The cardId can be obtained from a previous save credit -card operation. Use $card->getId()

$cardId = "CARD-5AR29593TC404090HKIKN77Q"; - -/// ### Retrieve card

(See bootstrap.php for more on ApiContext)

try { - $card = CreditCard::get($cardId, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Lookup a saved credit card</title> -</head> -<body> - <div>Retrieving saved credit card: <?php echo $cardId;?></div> - <pre><?php var_dump($card);?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/GetPayment.html b/sample/source/GetPayment.html deleted file mode 100644 index dba7df89..00000000 --- a/sample/source/GetPayment.html +++ /dev/null @@ -1,35 +0,0 @@ -GetPayment
GetPayment.php
<?php

GetPaymentSample

- -

This sample code demonstrate how you can -retrieve a list of all Payment resources -you've created using the Payments API. -Note various query parameters that you can -use to filter, and paginate through the -payments list. -API used: GET /v1/payments/payments

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\Payment; - -$paymentId = "PAY-0XL713371A312273YKE2GCNI";

Retrieve payment

- -

Retrieve the payment object by calling the -static get method -on the Payment class by passing a valid -Payment ID -(See bootstrap.php for more on ApiContext)

try { - $payment = Payment::get($paymentId, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception:" . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Lookup a payment</title> -</head> -<body> - <div>Retrieving Payment ID: <?php echo $paymentId;?></div> - <pre><?php var_dump($payment->toArray());?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/GetSale.html b/sample/source/GetSale.html deleted file mode 100644 index 6aa2ea5d..00000000 --- a/sample/source/GetSale.html +++ /dev/null @@ -1,30 +0,0 @@ -GetSale
GetSale.php
<?php

Get Sale sample

- -

Sale transactions are nothing but completed payments. -This sample code demonstrates how you can retrieve -details of completed Sale Transaction. -API used: /v1/payments/sale/{sale-id}

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\Sale; - -$saleId = '3RM92092UW5126232'; - -try {

Retrieve the sale object

- -

Pass the ID of the sale -transaction from your payment resource.

$sale = Sale::get($saleId, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception:" . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Lookup a sale</title> -</head> -<body> - <div>Retrieving sale id: <?php echo $saleId;?></div> - <pre><?php var_dump($sale);?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/ListPayments.html b/sample/source/ListPayments.html deleted file mode 100644 index f56e3023..00000000 --- a/sample/source/ListPayments.html +++ /dev/null @@ -1,34 +0,0 @@ -ListPayments
ListPayments.php
<?php

GetPaymentList

- -

This sample code demonstrate how you can -retrieve a list of all Payment resources -you've created using the Payments API. -Note various query parameters that you can -use to filter, and paginate through the -payments list. -API used: GET /v1/payments/payments

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\Payment;

Retrieve payment

- -

Retrieve the PaymentHistory object by calling the -static get method on the Payment class, -and pass a Map object that contains -query parameters for paginations and filtering. -Refer the method doc for valid values for keys -(See bootstrap.php for more on ApiContext)

try { - $payments = Payment::all(array('count' => 10, 'start_index' => 5), $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception:" . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Lookup payment history</title> -</head> -<body> - <div>Got <?php echo $payments->getCount(); ?> matching payments </div> - <pre><?php var_dump($payments->toArray());?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/Reauthorization.html b/sample/source/Reauthorization.html deleted file mode 100644 index 76c9b243..00000000 --- a/sample/source/Reauthorization.html +++ /dev/null @@ -1,39 +0,0 @@ -Reauthorization
Reauthorization.php
<?php

Reauthorization Sample

- -

This sample code demonstrates how you can reauthorize a PayPal -account payment. -API used: v1/payments/authorization/{authorization_id}/reauthorize

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\Authorization; -use PayPal\Api\Amount;

Reauthorization

- -

Reauthorization is available only for PayPal account payments -and not for credit card payments.

You can reauthorize a payment only once 4 to 29 -days after the 3-day honor period for the original authorization -has expired.

try { -

Lookup authorization using the authorization id

$authorization = Authorization::get('7GH53639GA425732B', $apiContext); - - $amount = new Amount(); - $amount->setCurrency("USD"); - $amount->setTotal("1.00");

Reauthorize with amount being reauthorized

$authorization->setAmount($amount); - $reauthorization = $authorization->reauthorize($apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Reauthorize a payment</title> -</head> -<body> - <div> - Reauthorization Id: - <?php echo $reauthorization->getId();?> - </div> - <pre> - <?php var_dump($reauthorization->toArray());?> - </pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/RefundCapture.html b/sample/source/RefundCapture.html deleted file mode 100644 index 7d237add..00000000 --- a/sample/source/RefundCapture.html +++ /dev/null @@ -1,54 +0,0 @@ -RefundCapture
RefundCapture.php
<?php

Refund Capture Sample

- -

This sample code demonstrates how you can -process a refund on a Captured transaction. -API used: /v1/payments/capture/{}/refund

require __DIR__ . '/../bootstrap.php'; - -use PayPal\Api\Authorization; -use PayPal\Api\Capture; -use PayPal\Api\Refund; -use PayPal\Api\Amount; -use PayPal\Rest\ApiContext; - - -try {

Create a mock authorization to get authorization Id

$authId = createAuthorization($apiContext);

Get the authorization

$authorization = Authorization::get($authId, $apiContext); - -

Capture

- $amt = new Amount(); - $amt->setCurrency("USD") - ->setTotal("1.00"); -

Create a capture

$captureInfo = new Capture(); - $captureInfo->setAmount($amt); - - $capture = $authorization->capture($captureInfo, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -}

Refund

- -

Create a refund object indicating -refund amount and call the refund method

$refund = new Refund(); -$refund->setAmount($amt); - -try {

Create a new apiContext object so we send a new -PayPal-Request-Id (idempotency) header for this resource

$apiContext = new ApiContext($apiContext->getCredential()); - - $captureRefund = $capture->refund($refund, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> - -<html> -<head> - <title>Refund a captured payment</title> -</head> -<body> - <div>Refund Capture:</div> - <pre><?php var_dump($captureRefund);?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/RefundSale.html b/sample/source/RefundSale.html deleted file mode 100644 index 0b333017..00000000 --- a/sample/source/RefundSale.html +++ /dev/null @@ -1,41 +0,0 @@ -RefundSale
RefundSale.php
<?php

Sale Refund Sample

- -

This sample code demonstrate how you can -process a refund on a sale transaction created -using the Payments API. -API used: /v1/payments/sale/{sale-id}/refund

require __DIR__ . '/../bootstrap.php'; -use PayPal\Api\Amount; -use PayPal\Api\Refund; -use PayPal\Api\Sale;

Refund amount

- -

Includes both the refunded amount (to Payer) -and refunded fee (to Payee). Use the $amt->details -field to mention fees refund details.

$amt = new Amount(); -$amt->setCurrency('USD') - ->setTotal('0.01');

Refund object

$refund = new Refund(); -$refund->setAmount($amt); - -$saleId = '3RM92092UW5126232';

Sale

- -

A sale transaction. -Create a Sale object with the -given sale transaction id.

$sale = new Sale(); -$sale->setId($saleId); -try {

Refund the sale -(See bootstrap.php for more on ApiContext)

$sale->refund($refund, $apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception:" . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Refund a sale</title> -</head> -<body> - <div>Refunding sale id: <?php echo $saleId;?></div> - <pre><?php var_dump($sale);?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/VoidAuthorization.html b/sample/source/VoidAuthorization.html deleted file mode 100644 index 3aea3e08..00000000 --- a/sample/source/VoidAuthorization.html +++ /dev/null @@ -1,30 +0,0 @@ -VoidAuthorization
VoidAuthorization.php
<?php

VoidAuthorization

- -

This sample code demonstrates how you can -void an authorized payment. -API used: /v1/payments/authorization/<{authorizationid}>/void"

require __DIR__ . '/../bootstrap.php'; - -use PayPal\Api\Authorization;

VoidAuthorization

- -

You can void a previously authorized payment -by invoking the $authorization->void method -with a valid ApiContext (See bootstrap.php for more on ApiContext)

try {

create an authorization to get authorization Id -createAuthorization is defined in common.php

$authId = createAuthorization($apiContext);

Lookup the authorization

$authorization = Authorization::get($authId, $apiContext);

Void the authorization

$voidedAuth = $authorization->void($apiContext); -} catch (PayPal\Exception\PPConnectionException $ex) { - echo "Exception: " . $ex->getMessage() . PHP_EOL; - var_dump($ex->getData()); - exit(1); -} -?> -<html> -<head> - <title>Void an authorization</title> -</head> -<body> - <div> - Voided authorization - </div> - <pre><?php var_dump($voidedAuth->toArray());?></pre> - <a href='../index.html'>Back</a> -</body> -</html>
\ No newline at end of file diff --git a/sample/source/assets/docs.js b/sample/source/assets/docs.js deleted file mode 100644 index a60f4f0c..00000000 --- a/sample/source/assets/docs.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @depend jquery.nicescroll.js - */ - -var j_window = $(window), - j_flybar = $('#flybar'); - j_sidebar = $('.sidebar_popout'), - j_content = $('#document'); - -var docs = { - init: function() { - this.sidebar_popout(); - this.url_rewrite(); - }, - - sidebar_popout: function() { - $('#sidebar_button').on('click', function() { - var sidebar_hidden_class = 'sidebar_hidden', - animation_speed = 200; - - if ( !j_sidebar.hasClass(sidebar_hidden_class) ) { - j_sidebar.stop() - .animate({ - marginLeft: -270 - }, animation_speed) - .addClass(sidebar_hidden_class); - j_content.stop() - .animate({ - paddingLeft: 18 - }, animation_speed); - j_flybar.stop() - .animate({ - marginLeft: -282 - }, animation_speed); - $(this).stop() - .animate({ - marginLeft: -270 - }, animation_speed); - } - else { - j_sidebar.stop() - .animate({ - marginLeft: 0 - }, animation_speed) - .removeClass(sidebar_hidden_class); - j_content.stop() - .animate({ - paddingLeft: 300 - }, animation_speed); - j_flybar.stop() - .animate({ - marginLeft: 0 - }, animation_speed); - $(this).stop() - .animate({ - marginLeft: 0 - }, animation_speed); - } - }); - }, - - url_rewrite: function() { - $('.sidebar .menu a').each(function() { - var j_this = $(this), - href = j_this.attr('href'), - url = new RegExp(window.location.protocol + '//' + window.location.host + window.location.pathname); - - if (url.test(href)) { - href = href.replace(url, '#') // Replace domain and path - .replace(/\//g, '-') // Replace '/' with '-' - .replace(/-$/, ''); // Remove last '-' - - j_this.attr('href', encodeURI(href)); - } - }); - } -} - -$(function() { - docs.init(); - - /* Enable Nice Scroll on docs sidebar */ -// j_sidebar_docs.niceScroll({ -// zindex: 1, -// cursorcolor: '#bbb', -// cursorwidth: '7px', -// cursorborder: '0', -// cursorborderradius: '10px', -// autohidemode: false, -// railoffset: { left: 15 } -// }); - -}); diff --git a/sample/source/assets/jquery.min.js b/sample/source/assets/jquery.min.js deleted file mode 100644 index 198b3ff0..00000000 --- a/sample/source/assets/jquery.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/sample/source/assets/sideNavOut.png b/sample/source/assets/sideNavOut.png deleted file mode 100644 index b7129bf8..00000000 Binary files a/sample/source/assets/sideNavOut.png and /dev/null differ diff --git a/sample/source/assets/sideNavOver.png b/sample/source/assets/sideNavOver.png deleted file mode 100644 index 37ca9c94..00000000 Binary files a/sample/source/assets/sideNavOver.png and /dev/null differ diff --git a/sample/source/assets/style.css b/sample/source/assets/style.css deleted file mode 100644 index 38e374df..00000000 --- a/sample/source/assets/style.css +++ /dev/null @@ -1 +0,0 @@ -@charset "UTF-8";html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}html{line-height:1}ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,th,td{text-align:left;font-weight:normal;vertical-align:middle}q,blockquote{quotes:none}q:before,q:after,blockquote:before,blockquote:after{content:"";content:none}a img{border:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary{display:block}html,body{height:100%}#document{min-height:100%}body{max-width:33em}.segment{padding:0.5em 0 0.5em 33em;white-space:nowrap}.segment:first-child{padding-top:4.1em}.segment:last-child{padding-bottom:2em}.segment .comments,.segment .code{display:inline-block;vertical-align:top;padding:0 2em}.segment .comments{margin-left:-33em;width:29em;white-space:normal}.segment .code{white-space:pre}#meta{position:absolute;left:33em;padding:0.25em 1em}@media (max-width: 53em){html{font-size:1em}}@media (max-width: 52.94111em){html{font-size:0.99889em}}@media (max-width: 52.88222em){html{font-size:0.99778em}}@media (max-width: 52.82333em){html{font-size:0.99667em}}@media (max-width: 52.76444em){html{font-size:0.99556em}}@media (max-width: 52.70556em){html{font-size:0.99444em}}@media (max-width: 52.64667em){html{font-size:0.99333em}}@media (max-width: 52.58778em){html{font-size:0.99222em}}@media (max-width: 52.52889em){html{font-size:0.99111em}}@media (max-width: 52.47em){html{font-size:0.99em}}@media (max-width: 52.41111em){html{font-size:0.98889em}}@media (max-width: 52.35222em){html{font-size:0.98778em}}@media (max-width: 52.29333em){html{font-size:0.98667em}}@media (max-width: 52.23444em){html{font-size:0.98556em}}@media (max-width: 52.17556em){html{font-size:0.98444em}}@media (max-width: 52.11667em){html{font-size:0.98333em}}@media (max-width: 52.05778em){html{font-size:0.98222em}}@media (max-width: 51.99889em){html{font-size:0.98111em}}@media (max-width: 51.94em){html{font-size:0.98em}}@media (max-width: 51.88111em){html{font-size:0.97889em}}@media (max-width: 51.82222em){html{font-size:0.97778em}}@media (max-width: 51.76333em){html{font-size:0.97667em}}@media (max-width: 51.70444em){html{font-size:0.97556em}}@media (max-width: 51.64556em){html{font-size:0.97444em}}@media (max-width: 51.58667em){html{font-size:0.97333em}}@media (max-width: 51.52778em){html{font-size:0.97222em}}@media (max-width: 51.46889em){html{font-size:0.97111em}}@media (max-width: 51.41em){html{font-size:0.97em}}@media (max-width: 51.35111em){html{font-size:0.96889em}}@media (max-width: 51.29222em){html{font-size:0.96778em}}@media (max-width: 51.23333em){html{font-size:0.96667em}}@media (max-width: 51.17444em){html{font-size:0.96556em}}@media (max-width: 51.11556em){html{font-size:0.96444em}}@media (max-width: 51.05667em){html{font-size:0.96333em}}@media (max-width: 50.99778em){html{font-size:0.96222em}}@media (max-width: 50.93889em){html{font-size:0.96111em}}@media (max-width: 50.88em){html{font-size:0.96em}}@media (max-width: 50.82111em){html{font-size:0.95889em}}@media (max-width: 50.76222em){html{font-size:0.95778em}}@media (max-width: 50.70333em){html{font-size:0.95667em}}@media (max-width: 50.64444em){html{font-size:0.95556em}}@media (max-width: 50.58556em){html{font-size:0.95444em}}@media (max-width: 50.52667em){html{font-size:0.95333em}}@media (max-width: 50.46778em){html{font-size:0.95222em}}@media (max-width: 50.40889em){html{font-size:0.95111em}}@media (max-width: 50.35em){html{font-size:0.95em}}@media (max-width: 50.29111em){html{font-size:0.94889em}}@media (max-width: 50.23222em){html{font-size:0.94778em}}@media (max-width: 50.17333em){html{font-size:0.94667em}}@media (max-width: 50.11444em){html{font-size:0.94556em}}@media (max-width: 50.05556em){html{font-size:0.94444em}}@media (max-width: 49.99667em){html{font-size:0.94333em}}@media (max-width: 49.93778em){html{font-size:0.94222em}}@media (max-width: 49.87889em){html{font-size:0.94111em}}@media (max-width: 49.82em){html{font-size:0.94em}}@media (max-width: 49.76111em){html{font-size:0.93889em}}@media (max-width: 49.70222em){html{font-size:0.93778em}}@media (max-width: 49.64333em){html{font-size:0.93667em}}@media (max-width: 49.58444em){html{font-size:0.93556em}}@media (max-width: 49.52556em){html{font-size:0.93444em}}@media (max-width: 49.46667em){html{font-size:0.93333em}}@media (max-width: 49.40778em){html{font-size:0.93222em}}@media (max-width: 49.34889em){html{font-size:0.93111em}}@media (max-width: 49.29em){html{font-size:0.93em}}@media (max-width: 49.23111em){html{font-size:0.92889em}}@media (max-width: 49.17222em){html{font-size:0.92778em}}@media (max-width: 49.11333em){html{font-size:0.92667em}}@media (max-width: 49.05444em){html{font-size:0.92556em}}@media (max-width: 48.99556em){html{font-size:0.92444em}}@media (max-width: 48.93667em){html{font-size:0.92333em}}@media (max-width: 48.87778em){html{font-size:0.92222em}}@media (max-width: 48.81889em){html{font-size:0.92111em}}@media (max-width: 48.76em){html{font-size:0.92em}}@media (max-width: 48.70111em){html{font-size:0.91889em}}@media (max-width: 48.64222em){html{font-size:0.91778em}}@media (max-width: 48.58333em){html{font-size:0.91667em}}@media (max-width: 48.52444em){html{font-size:0.91556em}}@media (max-width: 48.46556em){html{font-size:0.91444em}}@media (max-width: 48.40667em){html{font-size:0.91333em}}@media (max-width: 48.34778em){html{font-size:0.91222em}}@media (max-width: 48.28889em){html{font-size:0.91111em}}@media (max-width: 48.23em){html{font-size:0.91em}}@media (max-width: 48.17111em){html{font-size:0.90889em}}@media (max-width: 48.11222em){html{font-size:0.90778em}}@media (max-width: 48.05333em){html{font-size:0.90667em}}@media (max-width: 47.99444em){html{font-size:0.90556em}}@media (max-width: 47.93556em){html{font-size:0.90444em}}@media (max-width: 47.87667em){html{font-size:0.90333em}}@media (max-width: 47.81778em){html{font-size:0.90222em}}@media (max-width: 47.75889em){html{font-size:0.90111em}}@media (max-width: 47.7em){html{font-size:0.9em}}@media (max-width: 47.64111em){html{font-size:0.89889em}}@media (max-width: 47.58222em){html{font-size:0.89778em}}@media (max-width: 47.52333em){html{font-size:0.89667em}}@media (max-width: 47.46444em){html{font-size:0.89556em}}@media (max-width: 47.40556em){html{font-size:0.89444em}}@media (max-width: 47.34667em){html{font-size:0.89333em}}@media (max-width: 47.28778em){html{font-size:0.89222em}}@media (max-width: 47.22889em){html{font-size:0.89111em}}@media (max-width: 47.17em){html{font-size:0.89em}}@media (max-width: 47.11111em){html{font-size:0.88889em}}@media (max-width: 47.05222em){html{font-size:0.88778em}}@media (max-width: 46.99333em){html{font-size:0.88667em}}@media (max-width: 46.93444em){html{font-size:0.88556em}}@media (max-width: 46.87556em){html{font-size:0.88444em}}@media (max-width: 46.81667em){html{font-size:0.88333em}}@media (max-width: 46.75778em){html{font-size:0.88222em}}@media (max-width: 46.69889em){html{font-size:0.88111em}}@media (max-width: 46.64em){html{font-size:0.88em}}@media (max-width: 46.58111em){html{font-size:0.87889em}}@media (max-width: 46.52222em){html{font-size:0.87778em}}@media (max-width: 46.46333em){html{font-size:0.87667em}}@media (max-width: 46.40444em){html{font-size:0.87556em}}@media (max-width: 46.34556em){html{font-size:0.87444em}}@media (max-width: 46.28667em){html{font-size:0.87333em}}@media (max-width: 46.22778em){html{font-size:0.87222em}}@media (max-width: 46.16889em){html{font-size:0.87111em}}@media (max-width: 46.11em){html{font-size:0.87em}}@media (max-width: 46.05111em){html{font-size:0.86889em}}@media (max-width: 45.99222em){html{font-size:0.86778em}}@media (max-width: 45.93333em){html{font-size:0.86667em}}@media (max-width: 45.87444em){html{font-size:0.86556em}}@media (max-width: 45.81556em){html{font-size:0.86444em}}@media (max-width: 45.75667em){html{font-size:0.86333em}}@media (max-width: 45.69778em){html{font-size:0.86222em}}@media (max-width: 45.63889em){html{font-size:0.86111em}}@media (max-width: 45.58em){html{font-size:0.86em}}@media (max-width: 45.52111em){html{font-size:0.85889em}}@media (max-width: 45.46222em){html{font-size:0.85778em}}@media (max-width: 45.40333em){html{font-size:0.85667em}}@media (max-width: 45.34444em){html{font-size:0.85556em}}@media (max-width: 45.28556em){html{font-size:0.85444em}}@media (max-width: 45.22667em){html{font-size:0.85333em}}@media (max-width: 45.16778em){html{font-size:0.85222em}}@media (max-width: 45.10889em){html{font-size:0.85111em}}@media (max-width: 45.05em){html{font-size:1em}body{margin:0 auto}.segment{padding:0;white-space:normal;max-width:29em;margin:0 auto}.segment .comments,.segment .code{display:block;padding:1em}.segment .comments{margin-left:0;width:auto}.segment .code{display:block;overflow-y:hidden;overflow-x:auto}.segment .code .wrapper{display:inline-block}#meta{position:static;margin:2em 0 0 0;overflow-y:hidden;overflow-x:auto}#meta .file-path{display:inline-block}}nav{position:fixed;top:0;right:0;width:20em}@media (max-width: 45.05em){nav{left:0;width:100%}}nav .tools{position:relative;z-index:100}nav .tools li{display:table-cell;vertical-align:middle;text-align:center;white-space:nowrap;height:2.1em;padding:0 0.55em}nav .tools .github{padding:0}nav .tools .github a{display:block;height:2.1em;width:2.1em;text-indent:-9001em}nav .tools .search{width:100%}nav .tools .search input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:100%}nav .toc{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;top:2.1em;bottom:0;width:100%;overflow-x:hidden;overflow-y:auto}nav .toc li{position:relative}nav .toc .label{display:block;line-height:2em;padding:0 0.55em 0 0.55em}nav .toc li li .label{padding-left:1.1em}nav .toc li li li .label{padding-left:1.65em}nav .toc li li li li .label{padding-left:2.2em}nav .toc li li li li li .label{padding-left:2.75em}nav .toc li li li li li li .label{padding-left:3.3em}nav{-webkit-transition:height 0;-webkit-transition-delay:150ms;-moz-transition:height 0 150ms;-o-transition:height 0 150ms;transition:height 0 150ms}nav .tools .toggle{-webkit-transition:background 150ms;-moz-transition:background 150ms;-o-transition:background 150ms;transition:background 150ms}nav.active{-webkit-transition:height 0 0;-moz-transition:height 0 0;-o-transition:height 0 0;transition:height 0 0;height:100%}nav .toc{-webkit-transition:right 150ms;-moz-transition:right 150ms;-o-transition:right 150ms;transition:right 150ms;right:-100%}nav.active .toc{right:0}@media (max-width: 45.05em){nav .toc{-webkit-transition:left 150ms;-moz-transition:left 150ms;-o-transition:left 150ms;transition:left 150ms;right:auto;left:-100%}nav.active .toc{left:0}}@media (max-width: 45.05em){body{-webkit-transition:left 150ms;-moz-transition:left 150ms;-o-transition:left 150ms;transition:left 150ms;position:relative;left:0}html.popped{overflow:hidden}html.popped body{left:100%;overflow:hidden}}nav .toc .children,nav .toc .outline{display:none}nav .toc .expanded>.children,nav .toc .expanded>.outline,nav .toc .expanded>.outline .children{display:block}nav .toc .discloser{-webkit-transition-property:-moz-transform,-webkit-transform,-o-transform,-webkit-transform;-moz-transition-property:-moz-transform,-webkit-transform,-o-transform,-moz-transform;-o-transition-property:-moz-transform,-webkit-transform,-o-transform,-o-transform;transition-property:-moz-transform -webkit-transform -o-transform transform;-webkit-transition-duration:200ms;-moz-transition-duration:200ms;-o-transition-duration:200ms;transition-duration:200ms;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg);display:inline-block;height:9px;width:9px;padding:0.2em;margin:0.2em 0.2em -0.2em 0.2em;vertical-align:baseline;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowOEFDRENGQzE2NEUxMUUxODdDNUQ2ODM0QzVGRkVBMSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowOEFDRENGRDE2NEUxMUUxODdDNUQ2ODM0QzVGRkVBMSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjA4QUNEQ0ZBMTY0RTExRTE4N0M1RDY4MzRDNUZGRUExIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjA4QUNEQ0ZCMTY0RTExRTE4N0M1RDY4MzRDNUZGRUExIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+nQHMgwAAAM1JREFUeNpi/P//P0NJSYkuAwNDJhDXAPE7BjIAExIbZNA9IC4CYjZKDAIBfiDuBeLzQOxBiUEwoAXE26FYixKDYMAD6rpeqGvJNogBGl5F0PDLpMQgGBAC4mlQF9pTYhAMGADxASBeB8RylBgEA4FAfAOIW4CYhxKDQIAZxmChwJD1QFwGxHfINegaEGcB8UFyA/sd1AA9dEOIddFfIJ4OzdAfcSkiZNAOIC6GegcvwGXQHagBm8jNtB+hBmiTYgi6i+ZCw+EFOWkBIMAA1W4l62UzKWwAAAAASUVORK5CYII=') center center no-repeat;background-size:9px 9px}nav .toc .discloser.placeholder,nav .toc .expanded>.outline .discloser{background:none}nav .toc .expanded>.label .discloser{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}nav .toc .filtered>.label{display:none}nav .toc .matched-child>.label{display:block}nav .toc .matched-child>.children,nav .toc .matched-child>.outline,nav .toc .matched-child>.outline .children{display:block}nav .toc .matched>.children,nav .toc .matched>.outline,nav .toc .matched>.outline .children{display:block}nav.searching .toc .discloser{display:none}.comments .wrapper{font-family:"Helvetica Neue",Helvetica,"Droid Sans",sans-serif;font-weight:300;font-size:0.9375em;line-height:1.35}.comments .wrapper h1,.comments .wrapper h2,.comments .wrapper h3,.comments .wrapper h4,.comments .wrapper h5,.comments .wrapper h6{font-family:"HelveticaNeue-UltraLight","Helvetica Neue",Helvetica,"Droid Sans",sans-serif;font-weight:100;letter-spacing:0.0625em;line-height:1.25;margin-bottom:0.5}.comments .wrapper h1{font-size:2.5em}.comments .wrapper h2{font-size:2em}.comments .wrapper h3{font-size:1.6em}.comments .wrapper h4{font-size:1.4em}.comments .wrapper h5{font-size:1.3em}.comments .wrapper h6{font-size:1.2em}.comments .wrapper p{margin:1em 0}.comments .wrapper>*:first-child{margin-top:0}.comments .wrapper>*:last-child{margin-bottom:0}.comments .wrapper ol,.comments .wrapper ul{padding-left:1.75em}.comments .wrapper ol li{list-style:decimal}.comments .wrapper ul li{list-style:disc}.comments .wrapper li{margin:1em 0}.comments .wrapper li:first-child{margin-top:0}.comments .wrapper li:last-child{margin-bottom:0}.comments .wrapper code{display:inline-block;padding:0.25em 0.25em 0 0.25em}.comments .wrapper pre{display:block;overflow-x:auto;overflow-y:hidden}.comments .wrapper pre code{padding:1em}.comments .wrapper blockquote{padding:0 1em}.comments .wrapper strong{font-weight:700}.comments .wrapper em{font-style:italic}html{background:#4a525a}#document{background:#f5fbff -webkit-gradient(linear, 0% 50%, 100% 50%, color-stop(0%, #272c30), color-stop(30%, #3e454c), color-stop(100%, #4a525a)) 33em no-repeat;background:#f5fbff -webkit-linear-gradient(left, #272c30,#3e454c 0.3em,#4a525a 1em) 33em no-repeat;background:#f5fbff -moz-linear-gradient(left, #272c30,#3e454c 0.3em,#4a525a 1em) 33em no-repeat;background:#f5fbff -o-linear-gradient(left, #272c30,#3e454c 0.3em,#4a525a 1em) 33em no-repeat;background:#f5fbff linear-gradient(left, #272c30,#3e454c 0.3em,#4a525a 1em) 33em no-repeat;margin-right:-1em;padding-right:1em}@media (max-width: 45.05em){#document{margin-right:0;padding-right:0}}#meta>*{font-family:"Helvetica Neue",Helvetica,"Droid Sans",sans-serif;font-weight:300;font-size:0.9375em;line-height:1.35;text-shadow:#272c30 1px 1px 0}#meta>*,#meta>* a{color:#9faab7}#meta>* a{text-decoration:none}.comments .wrapper{font-family:"Helvetica Neue",Helvetica,"Droid Sans",sans-serif;font-weight:300;font-size:0.9375em;line-height:1.35;text-shadow:#fff 1px 1px 0;color:#4a525a}.code .wrapper{font-family:"Droid Sans Mono",Menlo,Monaco,monospace;font-size:0.75em;line-height:1.4;text-shadow:#272c30 1px 1px 0;color:#cbd1d8}.code .wrapper .k{color:#e0c090}.code .wrapper .kc{color:#e0c090}.code .wrapper .kd{color:#e0c090}.code .wrapper .kp{color:#e0c090}.code .wrapper .kr{color:#e0c090}.code .wrapper .kt{color:#e0c090}.code .wrapper .na{color:#a9c2ba}.code .wrapper .nc{color:#cee4dd}.code .wrapper .no{color:#cee4dd}.code .wrapper .nd{color:#cee4dd}.code .wrapper .nf{color:#abd9cf}.code .wrapper .py{color:#abd9cf}.code .wrapper .nv{color:#b9d0af}.code .wrapper .vc{color:#b9d0af}.code .wrapper .vg{color:#b9d0af}.code .wrapper .vi{color:#b9d0af}.code .wrapper .s{color:#e9baba}.code .wrapper .sb{color:#e9baba}.code .wrapper .sc{color:#e9baba}.code .wrapper .sd{color:#e9baba}.code .wrapper .s2{color:#e9baba}.code .wrapper .se{color:#e9baba}.code .wrapper .sh{color:#e9baba}.code .wrapper .si{color:#e9baba}.code .wrapper .sx{color:#e9baba}.code .wrapper .sr{color:#cba8d6}.code .wrapper .s1{color:#e9baba}.code .wrapper .ss{color:#cba8d6}.code .wrapper .m{color:#cba8d6}.code .wrapper .mf{color:#cba8d6}.code .wrapper .mh{color:#cba8d6}.code .wrapper .mi{color:#cba8d6}.code .wrapper .il{color:#cba8d6}.code .wrapper .mo{color:#cba8d6}.code .wrapper .o{color:#ded3a1}.code .wrapper .ow{color:#ded3a1}.code .wrapper .p{color:#ded3a1}.code .wrapper .c,.code .wrapper .cm,.code .wrapper .cp,.code .wrapper .c1,.code .wrapper .cs{font-style:italic}.code .wrapper .c{color:#b1bac4}.code .wrapper .cm{color:#b1bac4}.code .wrapper .cp{color:#b1bac4}.code .wrapper .c1{color:#b1bac4}.code .wrapper .cs{color:#b1bac4}@media (max-width: 45.05em){.code{-webkit-border-radius:0.4em;-moz-border-radius:0.4em;-ms-border-radius:0.4em;-o-border-radius:0.4em;border-radius:0.4em;-webkit-box-shadow:#272c30 0 0 0.5em 0.2em inset;-moz-box-shadow:#272c30 0 0 0.5em 0.2em inset;box-shadow:#272c30 0 0 0.5em 0.2em inset;background:#4a525a}.code .wrapper{-webkit-box-shadow:#4a525a 0 0 0.25em 0.75em;-moz-box-shadow:#4a525a 0 0 0.25em 0.75em;box-shadow:#4a525a 0 0 0.25em 0.75em;background:#4a525a}}@media (max-width: 29em){.code{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;-o-border-radius:0;border-radius:0}}nav{text-shadow:#f0f0f0 1px 1px 0;color:#4a525a}nav .tools,nav .toc{font-family:"Helvetica Neue",Helvetica,"Droid Sans",sans-serif;font-weight:300;font-size:0.9375em;line-height:1.35}nav .tools{-webkit-box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;-moz-box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255,255,255,0.9)), color-stop(100%, rgba(205,205,205,0.9)));background:-webkit-linear-gradient(top, rgba(255,255,255,0.9),rgba(205,205,205,0.9));background:-moz-linear-gradient(top, rgba(255,255,255,0.9),rgba(205,205,205,0.9));background:-o-linear-gradient(top, rgba(255,255,255,0.9),rgba(205,205,205,0.9));background:linear-gradient(top, rgba(255,255,255,0.9),rgba(205,205,205,0.9));-moz-border-radius-bottomleft:0.4em;-webkit-border-bottom-left-radius:0.4em;border-bottom-left-radius:0.4em;border-bottom:1px solid #4a525a;border-left:1px solid #4a525a}@media (max-width: 53em){nav .tools{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0}}nav .tools li{border-right:1px solid #4a525a}nav .tools li:last-child{border-right:none}nav .tools .toggle{cursor:pointer}nav .tools .github a{-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;-o-transition:opacity 200ms;transition:opacity 200ms;filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50);opacity:0.5;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAAwCAYAAACScGMWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowOEFDRENGODE2NEUxMUUxODdDNUQ2ODM0QzVGRkVBMSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowOEFDRENGOTE2NEUxMUUxODdDNUQ2ODM0QzVGRkVBMSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjA4QUNEQ0Y2MTY0RTExRTE4N0M1RDY4MzRDNUZGRUExIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjA4QUNEQ0Y3MTY0RTExRTE4N0M1RDY4MzRDNUZGRUExIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+FC/Z5AAACv9JREFUeNrMWXl0VNUdvu/NmzWZJQnZN0hCWIQEIQuErUCBI2qwEAFRBJUeDvUPDwfKVhDUY2mPp8spakVELSq11goIiCBbUVKKUGKQQFiCSBJIQjLJZPbJzOt3J/dOXiYJgcqh3nO+vPfm3Xfvd3/3t94IsiyTH2sTyY+4SfxGpVIpfzdBokdxjQHOADuAj4GmuzRvFjAbmAZkAocEQZjLX/r9/vYbuq0UgigoQKagsxyG74FlgB4gYdAA0UASkAIkACahvSn70Xd/AlrCxm4VRDEBIBScUxg5wiCs7oZcEJDwN7g+AswH3gAOApVALdAIWIEGtpgyYAfwPFtYTU/jbtmy5W/gsZAugnMKbSsJ2oXAn1J62o9AIJCDy/ZgbzbQLVoqkAtM722fa2pqYnHJwfgmXG23MgjV7SjO3bR06BnlogUSe7PW+ntplXQHUlNTHewxqjdyR+8lOehxYNCgQa3hnHoil8a18F60trY2cenSpYU+n48qfXMnvaEQYcIMQ4KmrbAk/Cb3ZGV3gt7GWbx4cSm4xHd1JR2+aPfdIPK/ICIiwlNaWroKfMSgwDq0Moj78feB/1e4cjqdmq1btz6C25921jk5iOLe4i2XdDh+aF/ejhw5ksYEZJE6BAeHSuT83nyaMTLSZzAYfO2K7BPdbo/k9ngkOM8u32i1moBep2/TarVtGrU64PZ6VC0tLVqv1ydyFxLeamtrzbgYgJFSh+Bk2jOpe1ICmf7QtKp5856sHJo7zGoym4Lk3G636HQ4JXurTd3U1KTBtqgcTpcQZTYHIiIjfNExMV6DIaINuuTX6XQBp8sp1t24odv3+d6UN9/cPPTqtWpjOEFYLOeUI3CJwJJULAMZFE5u9cqVx1/esKE8jLebgWc3akCjjIFKbwF46dw0AlLXVnXpUlzx9OJpZyvO9VEShJR9LpfrHdy2SgqDCEB83i7Elj53NozYKeAY3QHAE0ZOz0KQmukuJ+VifUPkMrKyjO9t2bzvwUdmbL5eV2/gBBVE1crAL/OAy4mlJSe5Vq5Zd0pB7O/4OB7XXwJbgC/pYLHRFhJtNhONRk1q6xtIv+RE4vJ4SUOTldTdDKWABcBi+g3wdtH9OfaHJ4zaVpg7NHvH/oPrFKGMW4wghYn/uvJhwvjx1UZLFN+6I/iQ3r/Pnh+iGQcWUVPfaCWNzTZiiowgMA5yo7GJ1N5oIP4OI4llmQzV6QVAdenp8v3J8X1IhF7aplarV0HXaE5IJEniH8md/RwhFZ1iWFoqj3dUop8yQrzFPPvss78Cuf48e7W22IjL7SHXauuUxGgbpTS2goKC5fhu9InyCnLmfFWDiByQv6OOuCu5dmEeU46Iyfj7CqzKwXQp1OLj4wfSrcJEll78q0b5EBMTQ4k++V3N9cE6rVYCuRCP5OTkFm5ECskJFMdxd5X/dLOh3shuG9n1n8pMYuLEiQ10sawmuFU7SQMAfxg3bhxXn1yLyWDx+X0mhVT5O2d4NLADb/GHr0/9J97ltFO9lDJSgruyC3gpNjb20tq1a4+OHj26OaxQGgDMYxarbN8BTxuNxm9nzZr1zZIlS6r4GiWVekhbW0BL9Q0L9s+dO/dqKKfsJvCb4fMuMKuRP/nwvSN4//PHH55CsAXckqkhbGJ4nWYSbMCXmIKkKRNJhQeIATYqvs3PGZD1EX1F55s0adI5xbupXciJ7ddCWBCVopyekuw8ffJr2lkzMLMviYky0/7UeRcDNIMYxbeIKf6IvLy8madOnZqId1KEQU8S4/rA1ZiwODX9Ng9YCcxc/sxjkyWVivo+GRGkurKy8j1G7DW6YGWECMVY2hKTEicjHH1stVpNSYkJztmPlqw/uG/vK/6ATPeC+Nv88JIqUg2X0epwEo/XW4LPltMaFNs+vays7HhSUtLS9OTEpgi9jkRbTMRmd5Ios5G0OuGTA/LkMxcubWtr89MIcRnZyLYnnniC70Ap8JfutjWE9evXF02YMKGCiz0hPu5YWlLC/PuyMzOGZGdKOQP7k76pSSR3YDZJSYyDVE0js7KyVhw88MVQjJkODAR0AzLSyJi8XIJvzMMGZU+M7xP9V5p4snHf3/jqxp+g35+Z1F4GTEFOCsktYCHmANCgKAX779q1a9W7776bd/jw4b6QpFEtSUSr0VyTJPE8vMB3Br2uSRREh0oUbPEpaQlFhQW5dXU3mtUaddzBA4crHE5HItba3+ly9/V4fWbMSQuo7SD2DsanPnQhEMnmfYM66c4Vf3txTFdSDTwakqAYrE2jgAV2u/2tvXv3/mPRokUfZWdnfwhvXhHKBBm4IYXhX8BrwC/wvmDZsmV9mFQXKgzgaeovRUXFr5QcdQcvAKupwFJSUkqqa6q3Kxw0lWIqU/rhly9fTsKWP1hdXR3dW4YL3fumqqrq1xqNhpZ9cewMhiYJNAKdpjqG+a9wy+56VsIkNXLkSOqIZXjx5s/37Z3QnS5SK4yMjDx8J/VBSUlJOb5bATwGUB3rC2j57gQ9BSuyeixwEJLiYdbUucq5uTnXNm3a1B3BXKDtTshZLBbnxYsXV1M31GW82yXH8ArXHbPZbENa/kc8zwPoQcvrwDU+Kd7ZIUUXq57cc+bMKeMlICKCC1sZWsTOnTs/wVyP3i65noqZjezEiNhsNiP83XPovBXYzHKy0EHPzJkzz6elpQXDGIj48/Pz67mWjhgxorqoqOhKKJGwWmkCUADdNXSuBTqrWG8V//d0hXq93spDEEd4Gz58eCMqdoENLtPqPXQyKUl+vK8PS8tMQaMQeDkqk477zkm+dAsjOzxjxozxXq/3rZMnT2Y0NzcbaIWFrXLjKqJKCqZJCHOy4qTIj+ghK47GBLwPhEsITddxL/R+7Npd++CDD86AyJPAMzU1NXGYW0C+5UHkGLhhw4axzL0IyiCvUomBsPM84QefCfd4oi2KlZhgQ2pq6ng83ke3xeFweHo6ykIKJCuykB90GCTdTicQpLq3AyR30oIXQXoRPzLopu9dO52S7uSUkrkXmq67uzMOOAMZRtDj6aeisrqt+UIjqTWasEHbM/eo2HiiQ07G9JtodDpibahTNdXdCPYzRBoFo8XCDr2D48h8clRutH8oROoMkaEVpQ8YzCxE6PEoMERubPHPFJZDvXOwpiB6gyF4/E5/87jcJDE9gxz7bMcDlBx1mOkZGS5UXMFxNHq9v29mf4+I+oIarj9ApCE5w+x8jhNl5emzSmbUBM8aRo3lUaBdCjJzKQrrVUhO23kVcrsP8nk9TJdUxGGzJXz2/pYXbtbWBI/JxkyavKd/Zlbr1StV9PCFDB6aW1dUmN/YLzOr5cK5iuizZ8v7PDD17S+HDLu/8tuy0wP+8NuXh/jdds/8BU9Fet3uXrc2RM7a0NBOjq1ECB0CtBMVoUu2psZxrVbrOKM5emeE2bj7iz27Ilauf/EZR2srVE3tXvP8ui+R55Hla9Z9tfDx2cVVFy6YP9r5acaRQ4deLZk9K9Nlt5fs3r0nc3h+4RRbc+PJAETL5RH0jWHOMKQPk+fM7+7cq+NjSSQum4M01V8nZ//9FfXyxRevXJ02ZtTI6TGxsVf6ZWWv2LP946ms8iofkDOsKeBx/06j1WtPHC99E7XEizSfA7LZ6LSSOzBl7lPuTkqOtn/bO53J3WHLAx4G6igRlvPPZO6FFiy/B2j5V0hLQvYNPcY4AVB/Sa3BEqwTCLnSo3e4S//oiGHFDTXh3cDFsIVMZXH8N4z8bbX/CjAA0UTEH4oMvREAAAAASUVORK5CYII=') center center no-repeat;background-size:19.5px 24px}nav .tools .github a:hover{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=90);opacity:0.9}nav.active .tools{-moz-border-radius-bottomleft:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0}nav.active .tools .toggle{background:rgba(205,205,205,0.9);position:relative}nav .toc{-webkit-box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;-moz-box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;box-shadow:rgba(0,0,0,0.3) 0 0 0.5em 0.1em;background:rgba(230,230,230,0.9);border-left:1px solid #4a525a}nav .toc .label{color:#4a525a;text-decoration:none;border-top:1px solid rgba(192,192,192,0.9);border-bottom:1px solid rgba(192,192,192,0.9);margin-top:-1px}nav .toc .label:hover{background:rgba(205,205,205,0.9)}nav .toc .file>.label{font-weight:bold}nav .toc .selected>.label{background:#f5fbff}nav .toc .label em{font-weight:bold}nav .toc .file>.label em{color:#101214}nav .toc .matched-child>.label{filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=65);opacity:0.65;text-shadow:none;background:rgba(192,192,192,0.9)}@media (max-width: 45.05em){nav .tools,nav .toc{border-left-width:0}nav .tools{background:-webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #cdcdcd));background:-webkit-linear-gradient(top, #ffffff,#cdcdcd);background:-moz-linear-gradient(top, #ffffff,#cdcdcd);background:-o-linear-gradient(top, #ffffff,#cdcdcd);background:linear-gradient(top, #ffffff,#cdcdcd)}nav .toc{background:#e6e6e6}}.comments .wrapper a{display:inline-block;color:#a8614e;text-decoration:none}.comments .wrapper a:hover,.comments .wrapper a:hover *{text-decoration:underline}.comments .wrapper code{font-family:"Droid Sans Mono",Menlo,Monaco,monospace;font-size:0.75em;line-height:1.4;border:1px solid #e6e0d5}.comments .wrapper pre,.comments .wrapper code{-webkit-border-radius:0.4em;-moz-border-radius:0.4em;-ms-border-radius:0.4em;-o-border-radius:0.4em;border-radius:0.4em;background:#fbf8f3}.comments .wrapper pre{-webkit-box-shadow:#f2ece3 0 0 0.4em 0.2em;-moz-box-shadow:#f2ece3 0 0 0.4em 0.2em;box-shadow:#f2ece3 0 0 0.4em 0.2em;border:1px solid #d9c9af}.comments .wrapper pre code{border-width:0;background:transparent}.comments .wrapper blockquote{border-left:0.15em solid #959fa8;margin-left:-0.15em}body{-webkit-text-size-adjust:100%}input[type="search"]{-webkit-border-radius:1em;-moz-border-radius:1em;-ms-border-radius:1em;-o-border-radius:1em;border-radius:1em;-webkit-box-shadow:#ddd 0 1px 1px 0 inset;-moz-box-shadow:#ddd 0 1px 1px 0 inset;box-shadow:#ddd 0 1px 1px 0 inset;border:1px solid #959595;padding:0.15em 0.8em}.comments.doc-section .wrapper{color:#252519}.comments.doc-section.doc-section-private .wrapper,.comments.doc-section.doc-section-protected .wrapper,.comments.doc-section.doc-section-internal .wrapper{color:#7f7f7f}.comments.doc-section .doc-section-header{font:bold 18px "helvetica neue",helvetica,sans-serif}.comments.doc-section .docs .doc-section-header code{font-size:18px}.code .marker,.code .marker.wrapper,.code .wrapper.marker{display:none}.code.folded .wrapper{display:none;cursor:default}.code.folded .marker{-webkit-border-radius:0.2em;-moz-border-radius:0.2em;-ms-border-radius:0.2em;-o-border-radius:0.2em;border-radius:0.2em;-webkit-box-shadow:#2f3539 1px 1px 1px 0;-moz-box-shadow:#2f3539 1px 1px 1px 0;box-shadow:#2f3539 1px 1px 1px 0;display:inline-block;border:1px solid #73787f;padding:0.2em 0.5em;margin-left:-0.5em;margin-right:-0.5em;background:#58616b;font:12px "Droid Sans Mono",Menlo,Monaco,monospace;text-shadow:#2f3539 1px 1px 0px;cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none}.code.folded .marker .c1{color:#73787f;font-style:normal}.code.folded .marker:hover{background:#5f6872}.code.folded .marker:hover .c1{color:#7b8087}.code.folded .marker .c1:after{content:" …"} diff --git a/sample/vault/CreateCreditCard.php b/sample/vault/CreateCreditCard.php index 49535508..bea54bd6 100644 --- a/sample/vault/CreateCreditCard.php +++ b/sample/vault/CreateCreditCard.php @@ -42,7 +42,7 @@
Saved a new credit card with id: getId();?>
-
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/sample/vault/GetCreditCard.php b/sample/vault/GetCreditCard.php index c33e3339..fb57ac91 100644 --- a/sample/vault/GetCreditCard.php +++ b/sample/vault/GetCreditCard.php @@ -29,7 +29,7 @@
Retrieving saved credit card:
-
+
toJSON(JSON_PRETTY_PRINT);?>
Back diff --git a/tests/PayPal/Test/Api/AddressTest.php b/tests/PayPal/Test/Api/AddressTest.php index b881b300..e22cfd40 100644 --- a/tests/PayPal/Test/Api/AddressTest.php +++ b/tests/PayPal/Test/Api/AddressTest.php @@ -2,10 +2,10 @@ namespace PayPal\Test\Api; use PayPal\Api\Address; -use PayPal\Test\Constants; class AddressTest extends \PHPUnit_Framework_TestCase { + /** @var Address */ private $address; public static $line1 = "3909 Witmer Road"; diff --git a/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php b/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php index 80589ec8..1316ce49 100644 --- a/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php +++ b/tests/PayPal/Test/Auth/OAuthTokenCredentialTest.php @@ -7,10 +7,13 @@ use PayPal\Core\PPConfigManager; use PayPal\Exception\PPConnectionException; class OAuthTokenCredentialTest extends PHPUnit_Framework_TestCase { - + + /** + * @group integration + */ public function testGetAccessToken() { $cred = new OAuthTokenCredential(Constants::CLIENT_ID, Constants::CLIENT_SECRET); - $config = PPConfigManager::getConfigWithDefaults(); + $config = PPConfigManager::getInstance()->getConfigHashmap(); $token = $cred->getAccessToken($config); $this->assertNotNull($token); @@ -18,17 +21,14 @@ public function testGetAccessToken() { $newToken = $cred->getAccessToken($config); $this->assertNotNull($newToken); $this->assertEquals($token, $newToken); - -// sleep(60*8); -// $newToken = $cred->getAccessToken(); -// $this->assertNotNull($newToken); -// $this->assertNotEqual($token, $newToken); - } - + + /** + * @group integration + */ public function testInvalidCredentials() { $this->setExpectedException('PayPal\Exception\PPConnectionException'); $cred = new OAuthTokenCredential('dummy', 'secret'); - $this->assertNull($cred->getAccessToken(PPConfigManager::getConfigWithDefaults())); + $this->assertNull($cred->getAccessToken(PPConfigManager::getInstance()->getConfigHashmap())); } } \ No newline at end of file diff --git a/tests/PayPal/Test/Common/PPModelTest.php b/tests/PayPal/Test/Common/PPModelTest.php new file mode 100644 index 00000000..beab0a6c --- /dev/null +++ b/tests/PayPal/Test/Common/PPModelTest.php @@ -0,0 +1,228 @@ +field1 = $field1; + return $this; + } + + /** + * + * @access public + * @return string + */ + public function getField1() { + return $this->field1; + } + + /** + * + * @access public + * @param string $field2 + */ + public function setField2($field2) { + $this->field2 = $field2; + return $this; + } + + /** + * + * @access public + * @return string + */ + public function getField2() { + return $this->field2; + } + +} + + + +class ContainerModelTestClass extends PPModel { + + /** + * + * @access public + * @param string $field1 + */ + public function setField1($field1) { + $this->field1 = $field1; + return $this; + } + + /** + * + * @access public + * @return string + */ + public function getField1() { + return $this->field1; + } + + /** + * + * @access public + * @param SimpleModelTestClass $field1 + */ + public function setNested1($nested1) { + $this->nested1 = $nested1; + return $this; + } + + /** + * + * @access public + * @return SimpleModelTestClass + */ + public function getNested1() { + return $this->nested1; + } + + +} + +class ListModelTestClass extends PPModel { + + /** + * + * @access public + * @param string $list1 + */ + public function setList1($list1) { + $this->list1 = $list1; + } + + /** + * + * @access public + * @return string + */ + public function getList1() { + return $this->list1; + } + + /** + * + * @access public + * @param SimpleModelTestClass $list2 array of SimpleModelTestClass + */ + public function setList2($list2) { + $this->list2 = $list2; + return $this; + } + + /** + * + * @access public + * @return SimpleModelTestClass array of SimpleModelTestClass + */ + public function getList2() { + return $this->list2; + } + + +} + +/** + * Test class for PPModel. + * + */ +class PPModelTest extends PHPUnit_Framework_TestCase +{ + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() { + + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() { + } + + /** + * @test + */ + public function testSimpleConversion() { + $o = new SimpleModelTestClass(); + $o->setField1('value 1'); + $o->setField2("value 2"); + + $this->assertEquals('{"field1":"value 1","field2":"value 2"}', $o->toJSON()); + + $oCopy = new SimpleModelTestClass(); + $oCopy->fromJson($o->toJSON()); + $this->assertEquals($o, $oCopy); + + } + + /** + * @test + */ + public function testSpecialChars() { + $o = new SimpleModelTestClass(); + $o->setField1('value "1'); + $o->setField2("value 2"); + + $this->assertEquals('{"field1":"value \"1","field2":"value 2"}', $o->toJSON()); + + $oCopy = new SimpleModelTestClass(); + $oCopy->fromJson($o->toJSON()); + $this->assertEquals($o, $oCopy); + + } + + + /** + * @test + */ + public function testNestedConversion() { + $child = new SimpleModelTestClass(); + $child->setField1('value 1'); + $child->setField2("value 2"); + + $parent = new ContainerModelTestClass(); + $parent->setField1("parent"); + $parent->setNested1($child); + + $this->assertEquals('{"field1":"parent","nested1":{"field1":"value 1","field2":"value 2"}}', + $parent->toJSON()); + + $parentCopy = new ContainerModelTestClass(); + $parentCopy->fromJson($parent->toJSON()); + $this->assertEquals($parent, $parentCopy); + + } + + + /** + * @test + */ + public function testListConversion() { + $c1 = new SimpleModelTestClass(); + $c1->setField1("a")->setField2('value'); + + $c2 = new SimpleModelTestClass(); + $c1->setField1("another")->setField2('object'); + + $parent = new ListModelTestClass(); + $parent->setList1(array('simple', 'list', 'with', 'integer', 'keys')); + $parent->setList2(array($c1, $c2)); + + $parentCopy = new ListModelTestClass(); + $parentCopy->fromJson($parent->toJSON()); + $this->assertEquals($parent, $parentCopy); + + } +} \ No newline at end of file diff --git a/tests/PayPal/Test/Core/PPConfigManagerTest.php b/tests/PayPal/Test/Core/PPConfigManagerTest.php new file mode 100644 index 00000000..29f66cbc --- /dev/null +++ b/tests/PayPal/Test/Core/PPConfigManagerTest.php @@ -0,0 +1,126 @@ +add('PayPal\\Test', __DIR__); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * @test + */ + public function testGetInstance() + { + define("PP_CONFIG_PATH", dirname(dirname(dirname(__DIR__)))); + $this->object = PPConfigManager::getInstance(); + + $instance = $this->object->getInstance(); + $instance2 = $this->object->getInstance(); + $this->assertTrue($instance instanceof PPConfigManager); + $this->assertSame($instance, $instance2); + } + + /** + * @test + */ + public function testGet() + { + define("PP_CONFIG_PATH", dirname(dirname(dirname(__DIR__)))); + $this->object = PPConfigManager::getInstance(); + $ret = $this->object->get('acct2'); + $this->assertConfiguration(['acct2.ClientId' => 'TestClientId', 'acct2.ClientSecret' => 'TestClientSecret'], $ret); + $this->assertTrue(sizeof($ret) == 2); + + } + + /** + * @test + */ + public function testGetIniPrefix() + { + define("PP_CONFIG_PATH", dirname(dirname(dirname(__DIR__)))); + $this->object = PPConfigManager::getInstance(); + + $ret = $this->object->getIniPrefix(); + $this->assertContains('acct1', $ret); + $this->assertEquals(sizeof($ret), 2); + + $ret = $this->object->getIniPrefix('TestClientId'); + $this->assertEquals('acct2', $ret); + } + + /** + * @test + */ + public function testConfigByDefault() + { + define("PP_CONFIG_PATH", dirname(dirname(dirname(__DIR__)))); + $this->object = PPConfigManager::getInstance(); + + // Test file based config params and defaults + $config = PPConfigManager::getInstance()->getConfigHashmap(); + $this->assertConfiguration(['mode' => 'sandbox', 'http.ConnectionTimeOut' => '60'], $config); + } + + public function testConfigByCustom() + { + define("PP_CONFIG_PATH", dirname(dirname(dirname(__DIR__)))); + $this->object = PPConfigManager::getInstance(); + + // Test custom config params and defaults + $config = PPConfigManager::getInstance()->addConfigs(['mode' => 'custom', 'http.ConnectionTimeOut' => 900])->getConfigHashmap(); + $this->assertConfiguration(['mode' => 'custom', 'http.ConnectionTimeOut' => '900'], $config); + } + + public function testConfigByFileAndCustom() { + define("PP_CONFIG_PATH", __DIR__. '/non_existent/'); + $this->object = PPConfigManager::getInstance(); + + $config = PPConfigManager::getInstance()->getConfigHashmap(); + $this->assertArrayHasKey('http.ConnectionTimeOut', $config); + $this->assertEquals('30', $config['http.ConnectionTimeOut']); + $this->assertEquals('5', $config['http.Retry']); + + //Add more configs + $config = PPConfigManager::getInstance()->addConfigs(['http.Retry' => "10", 'mode' => 'sandbox'])->getConfigHashmap(); + $this->assertConfiguration(['http.ConnectionTimeOut' => "30", 'http.Retry' => "10", 'mode' => 'sandbox'], $config); + } + + /** + * Asserts if each configuration is available and has expected value. + * + * @param $conditions + * @param $config + */ + public function assertConfiguration($conditions, $config) { + foreach($conditions as $key => $value) { + $this->assertArrayHasKey($key, $config); + $this->assertEquals($value, $config[$key]); + } + } +} +?> diff --git a/tests/PayPal/Test/Core/PPCredentialManagerTest.php b/tests/PayPal/Test/Core/PPCredentialManagerTest.php new file mode 100644 index 00000000..112eda88 --- /dev/null +++ b/tests/PayPal/Test/Core/PPCredentialManagerTest.php @@ -0,0 +1,145 @@ + 'client-id', + 'acct1.ClientSecret' => 'client-secret', + 'http.ConnectionTimeOut' => '30', + 'http.Retry' => '5', + 'service.RedirectURL' => 'https://www.sandbox.paypal.com/webscr&cmd=', + 'service.DevCentralURL' => 'https://developer.paypal.com', + 'service.EndPoint.IPN' => 'https://www.sandbox.paypal.com/cgi-bin/webscr', + 'service.EndPoint.AdaptivePayments' => 'https://svcs.sandbox.paypal.com/', + 'service.SandboxEmailAddress' => 'platform_sdk_seller@gmail.com', + 'log.FileName' => 'PayPal.log', + 'log.LogLevel' => 'INFO', + 'log.LogEnabled' => '1', + ); + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() + { + $this->object = PPCredentialManager::getInstance($this->config); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * @test + */ + public function testGetInstance() + { + $instance = $this->object->getInstance($this->config); + $this->assertTrue($instance instanceof PPCredentialManager); + } + + /** + * @test + */ + public function testGetSpecificCredentialObject() + { + $cred = $this->object->getCredentialObject('acct1'); + $this->assertNotNull($cred); + $this->assertAttributeEquals('client-id', 'clientId', $cred); + $this->assertAttributeEquals('client-secret', 'clientSecret', $cred); + } + + /** + * @after testGetDefaultCredentialObject + * + * @throws \PayPal\Exception\PPInvalidCredentialException + */ + public function testSetCredentialObject() { + $authObject = $this->getMockBuilder('\Paypal\Auth\OAuthTokenCredential') + ->disableOriginalConstructor() + ->getMock(); + $cred = $this->object->setCredentialObject($authObject)->getCredentialObject(); + + $this->assertNotNull($cred); + $this->assertSame($this->object->getCredentialObject(), $authObject); + } + + /** + * @after testGetDefaultCredentialObject + * + * @throws \PayPal\Exception\PPInvalidCredentialException + */ + public function testSetCredentialObjectWithUserId() { + $authObject = $this->getMockBuilder('\Paypal\Auth\OAuthTokenCredential') + ->disableOriginalConstructor() + ->getMock(); + $cred = $this->object->setCredentialObject($authObject, 'sample')->getCredentialObject('sample'); + $this->assertNotNull($cred); + $this->assertSame($this->object->getCredentialObject(), $authObject); + } + + /** + * @after testGetDefaultCredentialObject + * + * @throws \PayPal\Exception\PPInvalidCredentialException + */ + public function testSetCredentialObjectWithoutDefault() { + $authObject = $this->getMockBuilder('\Paypal\Auth\OAuthTokenCredential') + ->disableOriginalConstructor() + ->getMock(); + $cred = $this->object->setCredentialObject($authObject, null, false)->getCredentialObject(); + $this->assertNotNull($cred); + $this->assertNotSame($this->object->getCredentialObject(), $authObject); + } + + + + + /** + * @test + */ + public function testGetInvalidCredentialObject() + { + $this->setExpectedException('PayPal\Exception\PPInvalidCredentialException'); + $cred = $this->object->getCredentialObject('invalid_biz_api1.gmail.com'); + } + + /** + * + */ + public function testGetDefaultCredentialObject() + { + $cred = $this->object->getCredentialObject(); + $this->assertNotNull($cred); + $this->assertAttributeEquals('client-id', 'clientId', $cred); + $this->assertAttributeEquals('client-secret', 'clientSecret', $cred); + } + + /** + * @test + */ + public function testGetRestCredentialObject() { + $cred = $this->object->getCredentialObject('acct1'); + + $this->assertNotNull($cred); + + $this->assertAttributeEquals($this->config['acct1.ClientId'], 'clientId', $cred); + + $this->assertAttributeEquals($this->config['acct1.ClientSecret'], 'clientSecret', $cred); + } +} +?> diff --git a/tests/PayPal/Test/Core/PPHttpConfigTest.php b/tests/PayPal/Test/Core/PPHttpConfigTest.php new file mode 100644 index 00000000..099e38c5 --- /dev/null +++ b/tests/PayPal/Test/Core/PPHttpConfigTest.php @@ -0,0 +1,121 @@ + '30', + 'http.Retry' => '5' , + ); + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp() + { + + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * @test + */ + public function testHeaderFunctions() + { + $o = new PPHttpConfig(); + $o->addHeader('key1', 'value1'); + $o->addHeader('key2', 'value'); + $o->addHeader('key2', 'overwritten'); + + $this->assertEquals(2, count($o->getHeaders())); + $this->assertEquals('overwritten', $o->getHeader('key2')); + $this->assertNull($o->getHeader('key3')); + + $o = new PPHttpConfig(); + $o->addHeader('key1', 'value1'); + $o->addHeader('key2', 'value'); + $o->addHeader('key2', 'and more', false); + + $this->assertEquals(2, count($o->getHeaders())); + $this->assertEquals('value;and more', $o->getHeader('key2')); + + $o->removeHeader('key2'); + $this->assertEquals(1, count($o->getHeaders())); + $this->assertNull($o->getHeader('key2')); + } + + /** + * @test + */ + public function testCurlOpts() + { + $o = new PPHttpConfig(); + $o->setCurlOptions(array('k' => 'v')); + + $curlOpts = $o->getCurlOptions(); + $this->assertEquals(1, count($curlOpts)); + $this->assertEquals('v', $curlOpts['k']); + } + + /** + * @test + */ + public function testUserAgent() + { + $ua = 'UAString'; + $o = new PPHttpConfig(); + $o->setUserAgent($ua); + + $curlOpts= $o->getCurlOptions(); + $this->assertEquals($ua, $curlOpts[CURLOPT_USERAGENT]); + } + + /** + * @test + */ + public function testSSLOpts() + { + $sslCert = '../cacert.pem'; + $sslPass = 'passPhrase'; + + $o = new PPHttpConfig(); + $o->setSSLCert($sslCert, $sslPass); + + $curlOpts= $o->getCurlOptions(); + $this->assertArrayHasKey(CURLOPT_SSLCERT, $curlOpts); + $this->assertEquals($sslPass, $curlOpts[CURLOPT_SSLCERTPASSWD]); + } + + /** + * @test + */ + public function testProxyOpts() + { + $proxy = 'http://me:secret@hostname:8081'; + + $o = new PPHttpConfig(); + $o->setHttpProxy($proxy); + + $curlOpts= $o->getCurlOptions(); + $this->assertEquals('hostname:8081', $curlOpts[CURLOPT_PROXY]); + $this->assertEquals('me:secret', $curlOpts[CURLOPT_PROXYUSERPWD]); + + $this->setExpectedException('PayPal\Exception\PPConfigurationException'); + $o->setHttpProxy('invalid string'); + } +} +?> diff --git a/tests/PayPal/Test/Core/PPLoggingManagerTest.php b/tests/PayPal/Test/Core/PPLoggingManagerTest.php new file mode 100644 index 00000000..5285ed84 --- /dev/null +++ b/tests/PayPal/Test/Core/PPLoggingManagerTest.php @@ -0,0 +1,64 @@ +object = new PPLoggingManager('InvoiceTest'); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * @test + */ + public function testError() + { + $this->object->error('Test Error Message'); + + } + + /** + * @test + */ + public function testWarning() + { + $this->object->warning('Test Warning Message'); + } + + /** + * @test + */ + public function testInfo() + { + $this->object->info('Test info Message'); + } + + /** + * @test + */ + public function testFine() + { + $this->object->fine('Test fine Message'); + } +} +?> diff --git a/tests/PayPal/Test/Exception/PPConfigurationExceptionTest.php b/tests/PayPal/Test/Exception/PPConfigurationExceptionTest.php new file mode 100644 index 00000000..95249e47 --- /dev/null +++ b/tests/PayPal/Test/Exception/PPConfigurationExceptionTest.php @@ -0,0 +1,35 @@ +object = new PPConfigurationException('Test PPConfigurationException'); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + public function testPPConfigurationException() + { + $this->assertEquals('Test PPConfigurationException', $this->object->getMessage()); + } +} +?> diff --git a/tests/PayPal/Test/Exception/PPConnectionExceptionTest.php b/tests/PayPal/Test/Exception/PPConnectionExceptionTest.php new file mode 100644 index 00000000..f51892b8 --- /dev/null +++ b/tests/PayPal/Test/Exception/PPConnectionExceptionTest.php @@ -0,0 +1,48 @@ +object = new PPConnectionException('http://testURL', 'test message'); + $this->object->setData('response payload for connection'); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * @test + */ + public function testGetUrl() + { + $this->assertEquals('http://testURL', $this->object->getUrl()); + } + + /** + * @test + */ + public function testGetData() + { + $this->assertEquals('response payload for connection', $this->object->getData()); + } +} +?> diff --git a/tests/PayPal/Test/Exception/PPInvalidCredentialExceptionTest.php b/tests/PayPal/Test/Exception/PPInvalidCredentialExceptionTest.php new file mode 100644 index 00000000..7ed7c5a9 --- /dev/null +++ b/tests/PayPal/Test/Exception/PPInvalidCredentialExceptionTest.php @@ -0,0 +1,40 @@ +object = new PPInvalidCredentialException; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * @test + */ + public function testErrorMessage() + { + $msg = $this->object->errorMessage(); + $this->assertContains('Error on line', $msg); + } +} +?> diff --git a/tests/PayPal/Test/Exception/PPMissingCredentialExceptionTest.php b/tests/PayPal/Test/Exception/PPMissingCredentialExceptionTest.php new file mode 100644 index 00000000..ec8e7521 --- /dev/null +++ b/tests/PayPal/Test/Exception/PPMissingCredentialExceptionTest.php @@ -0,0 +1,41 @@ +object = new PPMissingCredentialException; + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + */ + protected function tearDown() + { + } + + /** + * @test + */ + public function testErrorMessage() + { + $msg = $this->object->errorMessage(); + $this->assertContains('Error on line', $msg); + } +} +?> diff --git a/tests/bootstrap.php b/tests/bootstrap.php index d2495968..2764b1da 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -3,4 +3,6 @@ // Include the composer autoloader $loader = require dirname(__DIR__) . '/vendor/autoload.php'; $loader->add('PayPal\\Test', __DIR__); -define("PP_CONFIG_PATH", __DIR__); \ No newline at end of file +if (!defined("PP_CONFIG_PATH")) { + define("PP_CONFIG_PATH", __DIR__); +} \ No newline at end of file diff --git a/tests/sdk_config.ini b/tests/sdk_config.ini index 10bcb6e8..70487d69 100644 --- a/tests/sdk_config.ini +++ b/tests/sdk_config.ini @@ -3,13 +3,16 @@ acct1.ClientId = EBWKjlELKMYqRNQ6sYvFo64FtaRLRR5BdHEESmha49TM acct1.ClientSecret = EO422dn3gQLgDbuwqTjzrFgFtaRLRR5BdHEESmha49TM +acct2.ClientId = TestClientId +acct2.ClientSecret = TestClientSecret ;Connection Information [Http] -http.ConnectionTimeOut = 30 +http.ConnectionTimeOut = 60 http.Retry = 1 ;http.Proxy=http://[username:password]@hostname[:port][/path] +mode=sandbox ;Service Configuration [Service]