From 0f3a5e6548203af284d7cfbba8058cbb3d4c7c6c Mon Sep 17 00:00:00 2001 From: sdcoffey Date: Thu, 13 Oct 2016 11:04:49 -0700 Subject: [PATCH] Update Payouts to v1.2 --- lib/PayPal/Api/Currency.php | 8 +- lib/PayPal/Api/Error.php | 143 +++++++++--------- lib/PayPal/Api/Patch.php | 20 +-- lib/PayPal/Api/PayoutBatch.php | 10 +- lib/PayPal/Api/PayoutBatchHeader.php | 22 +-- lib/PayPal/Api/PayoutItem.php | 33 ++-- lib/PayPal/Api/PayoutItemDetails.php | 38 ++--- lib/PayPal/Api/PayoutSenderBatchHeader.php | 38 ++++- tests/PayPal/Test/Api/PatchRequestTest.php | 1 + tests/PayPal/Test/Api/PatchTest.php | 10 +- .../PayPal/Test/Api/PayoutItemDetailsTest.php | 1 - .../Test/Api/PayoutSenderBatchHeaderTest.php | 6 +- 12 files changed, 177 insertions(+), 153 deletions(-) diff --git a/lib/PayPal/Api/Currency.php b/lib/PayPal/Api/Currency.php index eb53eb9..d50fc66 100644 --- a/lib/PayPal/Api/Currency.php +++ b/lib/PayPal/Api/Currency.php @@ -19,7 +19,7 @@ use PayPal\Validation\NumericValidator; class Currency extends PayPalModel { /** - * 3 letter currency code as defined by ISO 4217. + * 3 letter currency code * * @param string $currency * @@ -32,7 +32,7 @@ class Currency extends PayPalModel } /** - * 3 letter currency code as defined by ISO 4217. + * 3 letter currency code * * @return string */ @@ -42,7 +42,7 @@ class Currency extends PayPalModel } /** - * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code. + * amount upto 2 decimals represented as string * * @param string|double $value * @@ -57,7 +57,7 @@ class Currency extends PayPalModel } /** - * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code. + * amount upto 2 decimals represented as string * * @return string */ diff --git a/lib/PayPal/Api/Error.php b/lib/PayPal/Api/Error.php index 1ad013d..f6ef8e1 100644 --- a/lib/PayPal/Api/Error.php +++ b/lib/PayPal/Api/Error.php @@ -24,7 +24,7 @@ class Error extends PayPalModel * Human readable, unique name of the error. * * @param string $name - * + * * @return $this */ public function setName($name) @@ -68,29 +68,6 @@ class Error extends PayPalModel return $this->purchase_unit_reference_id; } - /** - * Message describing the error. - * - * @param string $message - * - * @return $this - */ - public function setMessage($message) - { - $this->message = $message; - return $this; - } - - /** - * Message describing the error. - * - * @return string - */ - public function getMessage() - { - return $this->message; - } - /** * PayPal internal error code. * @@ -116,11 +93,80 @@ class Error extends PayPalModel return $this->code; } + /** + * PayPal internal identifier used for correlation purposes. + * + * @param string $debug_id + * + * @return $this + */ + 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; + } + + /** + * Message describing the error. + * + * @param string $message + * + * @return $this + */ + 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 + * + * @return $this + */ + 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; + } + /** * Additional details of the error * * @param \PayPal\Api\ErrorDetails[] $details - * + * * @return $this */ public function setDetails($details) @@ -219,52 +265,6 @@ class Error extends PayPalModel return $this->fmf_details; } - /** - * URI for detailed information related to this error for the developer. - * - * @param string $information_link - * - * @return $this - */ - 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; - } - - /** - * PayPal internal identifier used for correlation purposes. - * - * @param string $debug_id - * - * @return $this - */ - 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; - } - /** * Sets Links * @@ -317,5 +317,4 @@ class Error extends PayPalModel array_diff($this->getLinks(), array($links)) ); } - } diff --git a/lib/PayPal/Api/Patch.php b/lib/PayPal/Api/Patch.php index 152f92c..bd9a168 100644 --- a/lib/PayPal/Api/Patch.php +++ b/lib/PayPal/Api/Patch.php @@ -7,13 +7,13 @@ use PayPal\Common\PayPalModel; /** * Class Patch * - * A JSON patch object used for applying partial updates to resources. + * A JSON Patch object used for doing partial updates to resources. * * @package PayPal\Api * * @property string op * @property string path - * @property mixed value + * @property mixed value * @property string from */ class Patch extends PayPalModel @@ -23,7 +23,7 @@ class Patch extends PayPalModel * Valid Values: ["add", "remove", "replace", "move", "copy", "test"] * * @param string $op - * + * * @return $this */ public function setOp($op) @@ -43,10 +43,10 @@ class Patch extends PayPalModel } /** - * String containing a JSON Pointer value that references a location within the target document where the operation is performed. + * string containing a JSON-Pointer value that references a location within the target document (the target location) where the operation is performed. * * @param string $path - * + * * @return $this */ public function setPath($path) @@ -56,7 +56,7 @@ class Patch extends PayPalModel } /** - * String containing a JSON Pointer value that references a location within the target document where the operation is performed. + * string containing a JSON-Pointer value that references a location within the target document (the target location) where the operation is performed. * * @return string */ @@ -68,8 +68,8 @@ class Patch extends PayPalModel /** * New value to apply based on the operation. * - * @param mixed $value - * + * @param string $value + * * @return $this */ public function setValue($value) @@ -81,7 +81,7 @@ class Patch extends PayPalModel /** * New value to apply based on the operation. * - * @return mixed + * @return string */ public function getValue() { @@ -92,7 +92,7 @@ class Patch extends PayPalModel * A string containing a JSON Pointer value that references the location in the target document to move the value from. * * @param string $from - * + * * @return $this */ public function setFrom($from) diff --git a/lib/PayPal/Api/PayoutBatch.php b/lib/PayPal/Api/PayoutBatch.php index 47c1c03..2b5e367 100644 --- a/lib/PayPal/Api/PayoutBatch.php +++ b/lib/PayPal/Api/PayoutBatch.php @@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel; /** * Class PayoutBatch * - * The batch status as generated by PayPal. + * The PayPal-generated batch status. * * @package PayPal\Api * @@ -18,7 +18,7 @@ use PayPal\Common\PayPalModel; class PayoutBatch extends PayPalModel { /** - * A batch header that includes the generated batch status. + * A batch header. Includes the generated batch status. * * @param \PayPal\Api\PayoutBatchHeader $batch_header * @@ -31,7 +31,7 @@ class PayoutBatch extends PayPalModel } /** - * A batch header that includes the generated batch status. + * A batch header. Includes the generated batch status. * * @return \PayPal\Api\PayoutBatchHeader */ @@ -41,7 +41,7 @@ class PayoutBatch extends PayPalModel } /** - * Array of the items in a batch payout. + * An array of items in a batch payout. * * @param \PayPal\Api\PayoutItemDetails[] $items * @@ -54,7 +54,7 @@ class PayoutBatch extends PayPalModel } /** - * Array of the items in a batch payout. + * An array of items in a batch payout. * * @return \PayPal\Api\PayoutItemDetails[] */ diff --git a/lib/PayPal/Api/PayoutBatchHeader.php b/lib/PayPal/Api/PayoutBatchHeader.php index c46125c..88a834b 100644 --- a/lib/PayPal/Api/PayoutBatchHeader.php +++ b/lib/PayPal/Api/PayoutBatchHeader.php @@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel; /** * Class PayoutBatchHeader * - * This object enables you to get payout header information for an entire batch request. This object represents payout header data, and can be the response to a batch header request. + * Batch header resource. * * @package PayPal\Api * @@ -24,7 +24,7 @@ use PayPal\Common\PayPalModel; class PayoutBatchHeader extends PayPalModel { /** - * An ID for the batch payout. Generated by PayPal. 30 characters max. + * The PayPal-generated ID for a batch payout. * * @param string $payout_batch_id * @@ -37,7 +37,7 @@ class PayoutBatchHeader extends PayPalModel } /** - * An ID for the batch payout. Generated by PayPal. 30 characters max. + * The PayPal-generated ID for a batch payout. * * @return string */ @@ -47,7 +47,7 @@ class PayoutBatchHeader extends PayPalModel } /** - * Generated batch status. + * The PayPal-generated batch payout status. If the batch payout passes the preliminary checks, the status is `PENDING`. * * @param string $batch_status * @@ -60,7 +60,7 @@ class PayoutBatchHeader extends PayPalModel } /** - * Generated batch status. + * The PayPal-generated batch payout status. If the batch payout passes the preliminary checks, the status is `PENDING`. * * @return string */ @@ -73,7 +73,7 @@ class PayoutBatchHeader extends PayPalModel * The time the batch entered processing. * * @param string $time_created - * + * * @return $this */ public function setTimeCreated($time_created) @@ -96,7 +96,7 @@ class PayoutBatchHeader extends PayPalModel * The time that processing for the batch was completed. * * @param string $time_completed - * + * * @return $this */ public function setTimeCompleted($time_completed) @@ -129,7 +129,7 @@ class PayoutBatchHeader extends PayPalModel } /** - * The original batch header as provided by the payment sender. + * The sender-provided batch payout header. * * @return \PayPal\Api\PayoutSenderBatchHeader */ @@ -142,7 +142,7 @@ class PayoutBatchHeader extends PayPalModel * Total amount, in U.S. dollars, requested for the applicable payouts. * * @param \PayPal\Api\Currency $amount - * + * * @return $this */ public function setAmount($amount) @@ -165,7 +165,7 @@ class PayoutBatchHeader extends PayPalModel * Total estimate in U.S. dollars for the applicable payouts fees. * * @param \PayPal\Api\Currency $fees - * + * * @return $this */ public function setFees($fees) @@ -188,7 +188,7 @@ class PayoutBatchHeader extends PayPalModel * Sets Errors * * @param \PayPal\Api\Error $errors - * + * * @return $this */ public function setErrors($errors) diff --git a/lib/PayPal/Api/PayoutItem.php b/lib/PayPal/Api/PayoutItem.php index 76f2d23..b8e628b 100644 --- a/lib/PayPal/Api/PayoutItem.php +++ b/lib/PayPal/Api/PayoutItem.php @@ -10,7 +10,7 @@ use PayPal\Validation\ArgumentValidator; /** * Class PayoutItem * - * Sender-created description of a payout to a single recipient. + * A sender-created definition of a payout to a single recipient. * * @package PayPal\Api * @@ -23,10 +23,10 @@ use PayPal\Validation\ArgumentValidator; class PayoutItem extends PayPalResourceModel { /** - * The type of identification for the payment receiver. If this field is provided, the payout items without a `recipient_type` will use the provided value. If this field is not provided, each payout item must include a value for the `recipient_type`. + * The type of ID that identifies the payment receiver. Value is:If the sender_batch_header includes the recipient_type attribute, any payout item without its own recipient_type attribute uses the recipient_type value from sender_batch_header. If the sender_batch_header omits the recipient_type attribute, each payout item must include its own recipient_type value. * * @param string $recipient_type - * + * * @return $this */ public function setRecipientType($recipient_type) @@ -36,7 +36,7 @@ class PayoutItem extends PayPalResourceModel } /** - * The type of identification for the payment receiver. If this field is provided, the payout items without a `recipient_type` will use the provided value. If this field is not provided, each payout item must include a value for the `recipient_type`. + * The type of ID that identifies the payment receiver. Value is:If the sender_batch_header includes the recipient_type attribute, any payout item without its own recipient_type attribute uses the recipient_type value from sender_batch_header. If the sender_batch_header omits the recipient_type attribute, each payout item must include its own recipient_type value. * * @return string */ @@ -46,10 +46,10 @@ class PayoutItem extends PayPalResourceModel } /** - * The amount of money to pay a receiver. + * The amount of money to pay the receiver. * * @param \PayPal\Api\Currency $amount - * + * * @return $this */ public function setAmount($amount) @@ -59,7 +59,7 @@ class PayoutItem extends PayPalResourceModel } /** - * The amount of money to pay a receiver. + * The amount of money to pay the receiver. * * @return \PayPal\Api\Currency */ @@ -69,10 +69,10 @@ class PayoutItem extends PayPalResourceModel } /** - * Note for notifications. The note is provided by the payment sender. This note can be any string. 4000 characters max. + * Optional. A sender-specified note for notifications. Value is any string value. * * @param string $note - * + * * @return $this */ public function setNote($note) @@ -82,7 +82,7 @@ class PayoutItem extends PayPalResourceModel } /** - * Note for notifications. The note is provided by the payment sender. This note can be any string. 4000 characters max. + * Optional. A sender-specified note for notifications. Value is any string value. * * @return string */ @@ -92,10 +92,10 @@ class PayoutItem extends PayPalResourceModel } /** - * The receiver of the payment. In a call response, the format of this value corresponds to the `recipient_type` specified in the request. 127 characters max. + * The receiver of the payment. Corresponds to the `recipient_type` value in the request. * * @param string $receiver - * + * * @return $this */ public function setReceiver($receiver) @@ -105,7 +105,7 @@ class PayoutItem extends PayPalResourceModel } /** - * The receiver of the payment. In a call response, the format of this value corresponds to the `recipient_type` specified in the request. 127 characters max. + * The receiver of the payment. Corresponds to the `recipient_type` value in the request. * * @return string */ @@ -115,10 +115,10 @@ class PayoutItem extends PayPalResourceModel } /** - * A sender-specific ID number, used in an accounting system for tracking purposes. 30 characters max. + * A sender-specified ID number. Tracks the batch payout in an accounting system. * * @param string $sender_item_id - * + * * @return $this */ public function setSenderItemId($sender_item_id) @@ -128,7 +128,7 @@ class PayoutItem extends PayPalResourceModel } /** - * A sender-specific ID number, used in an accounting system for tracking purposes. 30 characters max. + * A sender-specified ID number. Tracks the batch payout in an accounting system. * * @return string */ @@ -186,5 +186,4 @@ class PayoutItem extends PayPalResourceModel $ret->fromJson($json); return $ret; } - } diff --git a/lib/PayPal/Api/PayoutItemDetails.php b/lib/PayPal/Api/PayoutItemDetails.php index deeec97..147b99e 100644 --- a/lib/PayPal/Api/PayoutItemDetails.php +++ b/lib/PayPal/Api/PayoutItemDetails.php @@ -7,7 +7,7 @@ use PayPal\Common\PayPalModel; /** * Class PayoutItemDetails * - * This object contains status and other data for an individual payout of a batch. + * The payout item status and other details. * * @package PayPal\Api * @@ -25,7 +25,7 @@ use PayPal\Common\PayPalModel; class PayoutItemDetails extends PayPalModel { /** - * An ID for an individual payout. Provided by PayPal, such as in the case of getting the status of a batch request. 30 characters max. + * The ID for the payout item. Viewable when you show details for a batch payout. * * @param string $payout_item_id * @@ -38,7 +38,7 @@ class PayoutItemDetails extends PayPalModel } /** - * An ID for an individual payout. Provided by PayPal, such as in the case of getting the status of a batch request. 30 characters max. + * The ID for the payout item. Viewable when you show details for a batch payout. * * @return string */ @@ -48,7 +48,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Generated ID for the transaction. 30 characters max. + * The PayPal-generated ID for the transaction. * * @param string $transaction_id * @@ -61,7 +61,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Generated ID for the transaction. 30 characters max. + * The PayPal-generated ID for the transaction. * * @return string */ @@ -71,7 +71,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Status of a transaction. + * The transaction status. * * @param string $transaction_status * @@ -84,7 +84,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Status of a transaction. + * The transaction status. * * @return string */ @@ -94,7 +94,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Amount of money in U.S. dollars for fees. + * The amount of money, in U.S. dollars, for fees. * * @param \PayPal\Api\Currency $payout_item_fee * @@ -107,7 +107,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Amount of money in U.S. dollars for fees. + * The amount of money, in U.S. dollars, for fees. * * @return \PayPal\Api\Currency */ @@ -117,7 +117,7 @@ class PayoutItemDetails extends PayPalModel } /** - * An ID for the batch payout. Generated by PayPal. 30 characters max. + * The PayPal-generated ID for the batch payout. * * @param string $payout_batch_id * @@ -130,7 +130,7 @@ class PayoutItemDetails extends PayPalModel } /** - * An ID for the batch payout. Generated by PayPal. 30 characters max. + * The PayPal-generated ID for the batch payout. * * @return string */ @@ -140,7 +140,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Sender-created ID for tracking the batch in an accounting system. 30 characters max. + * A sender-specified ID number. Tracks the batch payout in an accounting system. * * @param string $sender_batch_id * @@ -153,7 +153,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Sender-created ID for tracking the batch in an accounting system. 30 characters max. + * A sender-specified ID number. Tracks the batch payout in an accounting system. * * @return string */ @@ -163,7 +163,7 @@ class PayoutItemDetails extends PayPalModel } /** - * The data for a payout item that the sender initially provided. + * The sender-provided information for the payout item. * * @param \PayPal\Api\PayoutItem $payout_item * @@ -176,7 +176,7 @@ class PayoutItemDetails extends PayPalModel } /** - * The data for a payout item that the sender initially provided. + * The sender-provided information for the payout item. * * @return \PayPal\Api\PayoutItem */ @@ -186,7 +186,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Time of the last processing for this item. + * The date and time when this item was last processed. * * @param string $time_processed * @@ -199,7 +199,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Time of the last processing for this item. + * The date and time when this item was last processed. * * @return string */ @@ -209,7 +209,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Sets Error + * Sets Errors * * @param \PayPal\Api\Error $errors * @@ -222,7 +222,7 @@ class PayoutItemDetails extends PayPalModel } /** - * Gets Error + * Gets Errors * * @return \PayPal\Api\Error */ diff --git a/lib/PayPal/Api/PayoutSenderBatchHeader.php b/lib/PayPal/Api/PayoutSenderBatchHeader.php index 2cd0f64..16d9ff0 100644 --- a/lib/PayPal/Api/PayoutSenderBatchHeader.php +++ b/lib/PayPal/Api/PayoutSenderBatchHeader.php @@ -7,18 +7,19 @@ use PayPal\Common\PayPalModel; /** * Class PayoutSenderBatchHeader * - * This object represents sender-provided data about a batch header. The data is provided in a POST request. All batch submissions must have a batch header. + * The sender-provided batch header for a batch payout request. * * @package PayPal\Api * * @property string sender_batch_id * @property string email_subject * @property string recipient_type + * @property string batch_status */ class PayoutSenderBatchHeader extends PayPalModel { /** - * Sender-created ID for tracking the batch payout in an accounting system. 30 characters max. + * A sender-specified ID number. Tracks the batch payout in an accounting system.
Note: PayPal prevents duplicate batches from being processed. If you specify a `sender_batch_id` that was used in the last 30 days, the API rejects the request and returns an error message that indicates the duplicate `sender_batch_id` and includes a HATEOAS link to the original batch payout with the same `sender_batch_id`. If you receive a HTTP `5nn` status code, you can safely retry the request with the same `sender_batch_id`. In any case, the API completes a payment only once for a specific `sender_batch_id` that is used within 30 days.
* * @param string $sender_batch_id * @@ -31,7 +32,7 @@ class PayoutSenderBatchHeader extends PayPalModel } /** - * Sender-created ID for tracking the batch payout in an accounting system. 30 characters max. + * A sender-specified ID number. Tracks the batch payout in an accounting system.
Note: PayPal prevents duplicate batches from being processed. If you specify a `sender_batch_id` that was used in the last 30 days, the API rejects the request and returns an error message that indicates the duplicate `sender_batch_id` and includes a HATEOAS link to the original batch payout with the same `sender_batch_id`. If you receive a HTTP `5nn` status code, you can safely retry the request with the same `sender_batch_id`. In any case, the API completes a payment only once for a specific `sender_batch_id` that is used within 30 days.
* * @return string */ @@ -41,7 +42,7 @@ class PayoutSenderBatchHeader extends PayPalModel } /** - * The subject line text for the email that PayPal sends when a payout item is completed. (The subject line is the same for all recipients.) Maximum of 255 single-byte alphanumeric characters. + * The subject line text for the email that PayPal sends when a payout item completes. The subject line is the same for all recipients. Value is an alphanumeric string with a maximum length of 255 single-byte characters. * * @param string $email_subject * @@ -54,7 +55,7 @@ class PayoutSenderBatchHeader extends PayPalModel } /** - * The subject line text for the email that PayPal sends when a payout item is completed. (The subject line is the same for all recipients.) Maximum of 255 single-byte alphanumeric characters. + * The subject line text for the email that PayPal sends when a payout item completes. The subject line is the same for all recipients. Value is an alphanumeric string with a maximum length of 255 single-byte characters. * * @return string */ @@ -64,7 +65,7 @@ class PayoutSenderBatchHeader extends PayPalModel } /** - * The type of ID for a payment receiver. If this field is provided, the payout items without a `recipient_type` will use the provided value. If this field is not provided, each payout item must include a value for the `recipient_type`. + * The type of ID that identifies the payment receiver. Value is:If the sender_batch_header includes the recipient_type attribute, any payout item without its own recipient_type attribute uses the recipient_type value from sender_batch_header. If the sender_batch_header omits the recipient_type attribute, each payout item must include its own recipient_type value. * * @param string $recipient_type * @@ -77,7 +78,7 @@ class PayoutSenderBatchHeader extends PayPalModel } /** - * The type of ID for a payment receiver. If this field is provided, the payout items without a `recipient_type` will use the provided value. If this field is not provided, each payout item must include a value for the `recipient_type`. + * The type of ID that identifies the payment receiver. Value is:If the sender_batch_header includes the recipient_type attribute, any payout item without its own recipient_type attribute uses the recipient_type value from sender_batch_header. If the sender_batch_header omits the recipient_type attribute, each payout item must include its own recipient_type value. * * @return string */ @@ -86,4 +87,27 @@ class PayoutSenderBatchHeader extends PayPalModel return $this->recipient_type; } + /** + * The batch status to update. You can change the `NEW` batch status to `PENDING` or `CANCEL`. + * + * @param string $batch_status + * + * @return $this + */ + public function setBatchStatus($batch_status) + { + $this->batch_status = $batch_status; + return $this; + } + + /** + * The batch status to update. You can change the `NEW` batch status to `PENDING` or `CANCEL`. + * + * @return string + */ + public function getBatchStatus() + { + return $this->batch_status; + } + } diff --git a/tests/PayPal/Test/Api/PatchRequestTest.php b/tests/PayPal/Test/Api/PatchRequestTest.php index 33cd25a..133d9c4 100644 --- a/tests/PayPal/Test/Api/PatchRequestTest.php +++ b/tests/PayPal/Test/Api/PatchRequestTest.php @@ -2,6 +2,7 @@ namespace PayPal\Test\Api; +use PayPal\Common\PayPalModel; use PayPal\Api\PatchRequest; /** diff --git a/tests/PayPal/Test/Api/PatchTest.php b/tests/PayPal/Test/Api/PatchTest.php index 7f8e946..9b989c9 100644 --- a/tests/PayPal/Test/Api/PatchTest.php +++ b/tests/PayPal/Test/Api/PatchTest.php @@ -2,6 +2,7 @@ namespace PayPal\Test\Api; +use PayPal\Common\PayPalModel; use PayPal\Api\Patch; /** @@ -13,17 +14,15 @@ class PatchTest extends \PHPUnit_Framework_TestCase { /** * Gets Json String of Object Patch - * * @return string */ public static function getJson() { - return '{"op":"TestSample","path":"TestSample","value":"TestSampleObject","from":"TestSample"}'; + return '{"op":"TestSample","path":"TestSample","value":"TestSample","from":"TestSample"}'; } /** * Gets Object Instance with Json data filled in - * * @return Patch */ public static function getObject() @@ -34,7 +33,6 @@ class PatchTest extends \PHPUnit_Framework_TestCase /** * Tests for Serialization and Deserialization Issues - * * @return Patch */ public function testSerializationDeserialization() @@ -57,7 +55,9 @@ class PatchTest extends \PHPUnit_Framework_TestCase { $this->assertEquals($obj->getOp(), "TestSample"); $this->assertEquals($obj->getPath(), "TestSample"); - $this->assertEquals($obj->getValue(), "TestSampleObject"); + $this->assertEquals($obj->getValue(), "TestSample"); $this->assertEquals($obj->getFrom(), "TestSample"); } + + } diff --git a/tests/PayPal/Test/Api/PayoutItemDetailsTest.php b/tests/PayPal/Test/Api/PayoutItemDetailsTest.php index 822358a..0db1a55 100644 --- a/tests/PayPal/Test/Api/PayoutItemDetailsTest.php +++ b/tests/PayPal/Test/Api/PayoutItemDetailsTest.php @@ -29,7 +29,6 @@ class PayoutItemDetailsTest extends \PHPUnit_Framework_TestCase return new PayoutItemDetails(self::getJson()); } - /** * Tests for Serialization and Deserialization Issues * @return PayoutItemDetails diff --git a/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php b/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php index 2f2fe34..0a0a823 100644 --- a/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php +++ b/tests/PayPal/Test/Api/PayoutSenderBatchHeaderTest.php @@ -2,6 +2,7 @@ namespace PayPal\Test\Api; +use PayPal\Common\PayPalModel; use PayPal\Api\PayoutSenderBatchHeader; /** @@ -17,7 +18,7 @@ class PayoutSenderBatchHeaderTest extends \PHPUnit_Framework_TestCase */ public static function getJson() { - return '{"sender_batch_id":"TestSample","email_subject":"TestSample","recipient_type":"TestSample"}'; + return '{"sender_batch_id":"TestSample","email_subject":"TestSample","recipient_type":"TestSample","batch_status":"TestSample"}'; } /** @@ -29,7 +30,6 @@ class PayoutSenderBatchHeaderTest extends \PHPUnit_Framework_TestCase return new PayoutSenderBatchHeader(self::getJson()); } - /** * Tests for Serialization and Deserialization Issues * @return PayoutSenderBatchHeader @@ -41,6 +41,7 @@ class PayoutSenderBatchHeaderTest extends \PHPUnit_Framework_TestCase $this->assertNotNull($obj->getSenderBatchId()); $this->assertNotNull($obj->getEmailSubject()); $this->assertNotNull($obj->getRecipientType()); + $this->assertNotNull($obj->getBatchStatus()); $this->assertEquals(self::getJson(), $obj->toJson()); return $obj; } @@ -54,5 +55,6 @@ class PayoutSenderBatchHeaderTest extends \PHPUnit_Framework_TestCase $this->assertEquals($obj->getSenderBatchId(), "TestSample"); $this->assertEquals($obj->getEmailSubject(), "TestSample"); $this->assertEquals($obj->getRecipientType(), "TestSample"); + $this->assertEquals($obj->getBatchStatus(), "TestSample"); } }