Merge pull request #203 from paypal/Payouts

Enabled Payout API Support
This commit is contained in:
Jay
2015-01-08 14:22:09 -06:00
32 changed files with 4752 additions and 1165 deletions

191
lib/PayPal/Api/Payout.php Normal file
View File

@@ -0,0 +1,191 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Transport\PayPalRestCall;
use PayPal\Validation\ArgumentValidator;
use PayPal\Rest\ApiContext;
/**
* Class Payout
*
* This object represents a set of payouts that includes status data for the payouts. This object enables you to create a payout using a POST request.
*
* @package PayPal\Api
*
* @property \PayPal\Api\PayoutSenderBatchHeader sender_batch_header
* @property \PayPal\Api\PayoutItem[] items
* @property \PayPal\Api\Links[] links
*/
class Payout extends PayPalResourceModel
{
/**
* The original batch header as provided by the payment sender.
*
* @param \PayPal\Api\PayoutSenderBatchHeader $sender_batch_header
*
* @return $this
*/
public function setSenderBatchHeader($sender_batch_header)
{
$this->sender_batch_header = $sender_batch_header;
return $this;
}
/**
* The original batch header as provided by the payment sender.
*
* @return \PayPal\Api\PayoutSenderBatchHeader
*/
public function getSenderBatchHeader()
{
return $this->sender_batch_header;
}
/**
* The original batch header as provided by the payment sender.
*
* @deprecated Instead use setSenderBatchHeader
*
* @param \PayPal\Api\PayoutSenderBatchHeader $sender_batch_header
* @return $this
*/
public function setSender_batch_header($sender_batch_header)
{
$this->sender_batch_header = $sender_batch_header;
return $this;
}
/**
* The original batch header as provided by the payment sender.
* @deprecated Instead use getSenderBatchHeader
*
* @return \PayPal\Api\PayoutSenderBatchHeader
*/
public function getSender_batch_header()
{
return $this->sender_batch_header;
}
/**
* An array of payout items (that is, a set of individual payouts).
*
* @param \PayPal\Api\PayoutItem[] $items
*
* @return $this
*/
public function setItems($items)
{
$this->items = $items;
return $this;
}
/**
* An array of payout items (that is, a set of individual payouts).
*
* @return \PayPal\Api\PayoutItem[]
*/
public function getItems()
{
return $this->items;
}
/**
* Append Items to the list.
*
* @param \PayPal\Api\PayoutItem $payoutItem
* @return $this
*/
public function addItem($payoutItem)
{
if (!$this->getItems()) {
return $this->setItems(array($payoutItem));
} else {
return $this->setItems(
array_merge($this->getItems(), array($payoutItem))
);
}
}
/**
* Remove Items from the list.
*
* @param \PayPal\Api\PayoutItem $payoutItem
* @return $this
*/
public function removeItem($payoutItem)
{
return $this->setItems(
array_diff($this->getItems(), array($payoutItem))
);
}
/**
* Create a payout batch resource by passing a sender_batch_header and an items array to the request URI. The sender_batch_header contains payout parameters that describe the handling of a batch resource while the items array conatins payout items.
*
* @param array $params
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return PayoutBatch
*/
public function create($params = array(), $apiContext = null, $restCall = null)
{
$params = $params ? $params : array();
ArgumentValidator::validate($params, 'params');
$payLoad = $this->toJSON();
$allowedParams = array(
'sync_mode' => 1,
);
$json = self::executeCall(
"/v1/payments/payouts" . "?" . http_build_query(array_intersect_key($params, $allowedParams)),
"POST",
$payLoad,
null,
$apiContext,
$restCall
);
$ret = new PayoutBatch();
$ret->fromJson($json);
return $ret;
}
/**
* You can submit a payout with a synchronous API call, which immediately returns the results of a PayPal payment.
*
* @param ApiContext $apiContext
* @param PayPalRestCall $restCall
* @return PayoutBatch
*/
public function createSynchronous($apiContext = null, $restCall = null)
{
$params = array('sync_mode' => 'true');
return $this->create($params, $apiContext, $restCall);
}
/**
* Obtain the status of a specific batch resource by passing the payout batch ID to the request URI. You can issue this call multiple times to get the current status.
*
* @param string $payoutBatchId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return PayoutBatch
*/
public static function get($payoutBatchId, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($payoutBatchId, 'payoutBatchId');
$payLoad = "";
$json = self::executeCall(
"/v1/payments/payouts/$payoutBatchId",
"GET",
$payLoad,
null,
$apiContext,
$restCall
);
$ret = new PayoutBatch();
$ret->fromJson($json);
return $ret;
}
}

View File

@@ -0,0 +1,145 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class PayoutBatch
*
* The batch status as generated by PayPal.
*
* @package PayPal\Api
*
* @property \PayPal\Api\PayoutBatchHeader batch_header
* @property \PayPal\Api\PayoutItemDetails[] items
* @property \PayPal\Api\Links[] links
*/
class PayoutBatch extends PayPalModel
{
/**
* A batch header that includes the generated batch status.
*
* @param \PayPal\Api\PayoutBatchHeader $batch_header
*
* @return $this
*/
public function setBatchHeader($batch_header)
{
$this->batch_header = $batch_header;
return $this;
}
/**
* A batch header that includes the generated batch status.
*
* @return \PayPal\Api\PayoutBatchHeader
*/
public function getBatchHeader()
{
return $this->batch_header;
}
/**
* A batch header that includes the generated batch status.
*
* @deprecated Instead use setBatchHeader
*
* @param \PayPal\Api\PayoutBatchHeader $batch_header
* @return $this
*/
public function setBatch_header($batch_header)
{
$this->batch_header = $batch_header;
return $this;
}
/**
* A batch header that includes the generated batch status.
* @deprecated Instead use getBatchHeader
*
* @return \PayPal\Api\PayoutBatchHeader
*/
public function getBatch_header()
{
return $this->batch_header;
}
/**
* Array of the items in a batch payout.
*
* @param \PayPal\Api\PayoutItemDetails[] $items
*
* @return $this
*/
public function setItems($items)
{
$this->items = $items;
return $this;
}
/**
* Array of the items in a batch payout.
*
* @return \PayPal\Api\PayoutItemDetails[]
*/
public function getItems()
{
return $this->items;
}
/**
* Append Items to the list.
*
* @param \PayPal\Api\PayoutItemDetails $payoutItemDetails
* @return $this
*/
public function addItem($payoutItemDetails)
{
if (!$this->getItems()) {
return $this->setItems(array($payoutItemDetails));
} else {
return $this->setItems(
array_merge($this->getItems(), array($payoutItemDetails))
);
}
}
/**
* Remove Items from the list.
*
* @param \PayPal\Api\PayoutItemDetails $payoutItemDetails
* @return $this
*/
public function removeItem($payoutItemDetails)
{
return $this->setItems(
array_diff($this->getItems(), array($payoutItemDetails))
);
}
/**
* Sets Links
*
* @param \PayPal\Api\Links[] $links
*
* @return $this
*/
public function setLinks($links)
{
$this->links = $links;
return $this;
}
/**
* Gets Links
*
* @return \PayPal\Api\Links[]
*/
public function getLinks()
{
return $this->links;
}
}

View File

@@ -0,0 +1,388 @@
<?php
namespace PayPal\Api;
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.
*
* @package PayPal\Api
*
* @property string payout_batch_id
* @property string batch_status
* @property string time_created
* @property string time_completed
* @property \PayPal\Api\PayoutSenderBatchHeader sender_batch_header
* @property \PayPal\Api\Currency amount
* @property \PayPal\Api\Currency fees
* @property \PayPal\Api\Error errors
* @property \PayPal\Api\Links[] links
*/
class PayoutBatchHeader extends PayPalModel
{
/**
* An ID for the batch payout. Generated by PayPal. 30 characters max.
*
* @param string $payout_batch_id
*
* @return $this
*/
public function setPayoutBatchId($payout_batch_id)
{
$this->payout_batch_id = $payout_batch_id;
return $this;
}
/**
* An ID for the batch payout. Generated by PayPal. 30 characters max.
*
* @return string
*/
public function getPayoutBatchId()
{
return $this->payout_batch_id;
}
/**
* An ID for the batch payout. Generated by PayPal. 30 characters max.
*
* @deprecated Instead use setPayoutBatchId
*
* @param string $payout_batch_id
* @return $this
*/
public function setPayout_batch_id($payout_batch_id)
{
$this->payout_batch_id = $payout_batch_id;
return $this;
}
/**
* An ID for the batch payout. Generated by PayPal. 30 characters max.
* @deprecated Instead use getPayoutBatchId
*
* @return string
*/
public function getPayout_batch_id()
{
return $this->payout_batch_id;
}
/**
* Generated batch status.
*
* @param string $batch_status
*
* @return $this
*/
public function setBatchStatus($batch_status)
{
$this->batch_status = $batch_status;
return $this;
}
/**
* Generated batch status.
*
* @return string
*/
public function getBatchStatus()
{
return $this->batch_status;
}
/**
* Generated batch status.
*
* @deprecated Instead use setBatchStatus
*
* @param string $batch_status
* @return $this
*/
public function setBatch_status($batch_status)
{
$this->batch_status = $batch_status;
return $this;
}
/**
* Generated batch status.
* @deprecated Instead use getBatchStatus
*
* @return string
*/
public function getBatch_status()
{
return $this->batch_status;
}
/**
* The time the batch entered processing.
*
* @param string $time_created
*
* @return $this
*/
public function setTimeCreated($time_created)
{
$this->time_created = $time_created;
return $this;
}
/**
* The time the batch entered processing.
*
* @return string
*/
public function getTimeCreated()
{
return $this->time_created;
}
/**
* The time the batch entered processing.
*
* @deprecated Instead use setTimeCreated
*
* @param string $time_created
* @return $this
*/
public function setTime_created($time_created)
{
$this->time_created = $time_created;
return $this;
}
/**
* The time the batch entered processing.
* @deprecated Instead use getTimeCreated
*
* @return string
*/
public function getTime_created()
{
return $this->time_created;
}
/**
* The time that processing for the batch was completed.
*
* @param string $time_completed
*
* @return $this
*/
public function setTimeCompleted($time_completed)
{
$this->time_completed = $time_completed;
return $this;
}
/**
* The time that processing for the batch was completed.
*
* @return string
*/
public function getTimeCompleted()
{
return $this->time_completed;
}
/**
* The time that processing for the batch was completed.
*
* @deprecated Instead use setTimeCompleted
*
* @param string $time_completed
* @return $this
*/
public function setTime_completed($time_completed)
{
$this->time_completed = $time_completed;
return $this;
}
/**
* The time that processing for the batch was completed.
* @deprecated Instead use getTimeCompleted
*
* @return string
*/
public function getTime_completed()
{
return $this->time_completed;
}
/**
* The original batch header as provided by the payment sender.
*
* @param \PayPal\Api\PayoutSenderBatchHeader $sender_batch_header
*
* @return $this
*/
public function setSenderBatchHeader($sender_batch_header)
{
$this->sender_batch_header = $sender_batch_header;
return $this;
}
/**
* The original batch header as provided by the payment sender.
*
* @return \PayPal\Api\PayoutSenderBatchHeader
*/
public function getSenderBatchHeader()
{
return $this->sender_batch_header;
}
/**
* The original batch header as provided by the payment sender.
*
* @deprecated Instead use setSenderBatchHeader
*
* @param \PayPal\Api\PayoutSenderBatchHeader $sender_batch_header
* @return $this
*/
public function setSender_batch_header($sender_batch_header)
{
$this->sender_batch_header = $sender_batch_header;
return $this;
}
/**
* The original batch header as provided by the payment sender.
* @deprecated Instead use getSenderBatchHeader
*
* @return \PayPal\Api\PayoutSenderBatchHeader
*/
public function getSender_batch_header()
{
return $this->sender_batch_header;
}
/**
* Total amount, in U.S. dollars, requested for the applicable payouts.
*
* @param \PayPal\Api\Currency $amount
*
* @return $this
*/
public function setAmount($amount)
{
$this->amount = $amount;
return $this;
}
/**
* Total amount, in U.S. dollars, requested for the applicable payouts.
*
* @return \PayPal\Api\Currency
*/
public function getAmount()
{
return $this->amount;
}
/**
* Total estimate in U.S. dollars for the applicable payouts fees.
*
* @param \PayPal\Api\Currency $fees
*
* @return $this
*/
public function setFees($fees)
{
$this->fees = $fees;
return $this;
}
/**
* Total estimate in U.S. dollars for the applicable payouts fees.
*
* @return \PayPal\Api\Currency
*/
public function getFees()
{
return $this->fees;
}
/**
* Sets Errors
*
* @param \PayPal\Api\Error $errors
*
* @return $this
*/
public function setErrors($errors)
{
$this->errors = $errors;
return $this;
}
/**
* Gets Errors
*
* @return \PayPal\Api\Error
*/
public function getErrors()
{
return $this->errors;
}
/**
* Sets Links
*
* @param \PayPal\Api\Links[] $links
*
* @return $this
*/
public function setLinks($links)
{
$this->links = $links;
return $this;
}
/**
* Gets Links
*
* @return \PayPal\Api\Links[]
*/
public function getLinks()
{
return $this->links;
}
/**
* Append Links to the list.
*
* @param \PayPal\Api\Links $links
* @return $this
*/
public function addLink($links)
{
if (!$this->getLinks()) {
return $this->setLinks(array($links));
} else {
return $this->setLinks(
array_merge($this->getLinks(), array($links))
);
}
}
/**
* Remove Links from the list.
*
* @param \PayPal\Api\Links $links
* @return $this
*/
public function removeLink($links)
{
return $this->setLinks(
array_diff($this->getLinks(), array($links))
);
}
}

View File

@@ -0,0 +1,215 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalResourceModel;
use PayPal\Validation\ArgumentValidator;
use PayPal\Rest\ApiContext;
use PayPal\Transport\PayPalRestCall;
/**
* Class PayoutItem
*
* Sender-created description of a payout to a single recipient.
*
* @package PayPal\Api
*
* @property string recipient_type
* @property \PayPal\Api\Currency amount
* @property string note
* @property string receiver
* @property string sender_item_id
*/
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`.
*
* @param string $recipient_type
*
* @return $this
*/
public function setRecipientType($recipient_type)
{
$this->recipient_type = $recipient_type;
return $this;
}
/**
* 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`.
*
* @return string
*/
public function getRecipientType()
{
return $this->recipient_type;
}
/**
* 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`.
*
* @deprecated Instead use setRecipientType
*
* @param string $recipient_type
* @return $this
*/
public function setRecipient_type($recipient_type)
{
$this->recipient_type = $recipient_type;
return $this;
}
/**
* 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`.
* @deprecated Instead use getRecipientType
*
* @return string
*/
public function getRecipient_type()
{
return $this->recipient_type;
}
/**
* The amount of money to pay a receiver.
*
* @param \PayPal\Api\Currency $amount
*
* @return $this
*/
public function setAmount($amount)
{
$this->amount = $amount;
return $this;
}
/**
* The amount of money to pay a receiver.
*
* @return \PayPal\Api\Currency
*/
public function getAmount()
{
return $this->amount;
}
/**
* Note for notifications. The note is provided by the payment sender. This note can be any string. 4000 characters max.
*
* @param string $note
*
* @return $this
*/
public function setNote($note)
{
$this->note = $note;
return $this;
}
/**
* Note for notifications. The note is provided by the payment sender. This note can be any string. 4000 characters max.
*
* @return string
*/
public function getNote()
{
return $this->note;
}
/**
* 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.
*
* @param string $receiver
*
* @return $this
*/
public function setReceiver($receiver)
{
$this->receiver = $receiver;
return $this;
}
/**
* 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.
*
* @return string
*/
public function getReceiver()
{
return $this->receiver;
}
/**
* A sender-specific ID number, used in an accounting system for tracking purposes. 30 characters max.
*
* @param string $sender_item_id
*
* @return $this
*/
public function setSenderItemId($sender_item_id)
{
$this->sender_item_id = $sender_item_id;
return $this;
}
/**
* A sender-specific ID number, used in an accounting system for tracking purposes. 30 characters max.
*
* @return string
*/
public function getSenderItemId()
{
return $this->sender_item_id;
}
/**
* A sender-specific ID number, used in an accounting system for tracking purposes. 30 characters max.
*
* @deprecated Instead use setSenderItemId
*
* @param string $sender_item_id
* @return $this
*/
public function setSender_item_id($sender_item_id)
{
$this->sender_item_id = $sender_item_id;
return $this;
}
/**
* A sender-specific ID number, used in an accounting system for tracking purposes. 30 characters max.
* @deprecated Instead use getSenderItemId
*
* @return string
*/
public function getSender_item_id()
{
return $this->sender_item_id;
}
/**
* Obtain the status of a payout item by passing the item ID to the request URI.
*
* @param string $payoutItemId
* @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
* @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
* @return PayoutItemDetails
*/
public static function get($payoutItemId, $apiContext = null, $restCall = null)
{
ArgumentValidator::validate($payoutItemId, 'payoutItemId');
$payLoad = "";
$json = self::executeCall(
"/v1/payments/payouts-item/$payoutItemId",
"GET",
$payLoad,
null,
$apiContext,
$restCall
);
$ret = new PayoutItemDetails();
$ret->fromJson($json);
return $ret;
}
}

View File

@@ -0,0 +1,487 @@
<?php
namespace PayPal\Api;
use PayPal\Common\PayPalModel;
/**
* Class PayoutItemDetails
*
* This object contains status and other data for an individual payout of a batch.
*
* @package PayPal\Api
*
* @property string payout_item_id
* @property string transaction_id
* @property string transaction_status
* @property \PayPal\Api\Currency payout_item_fee
* @property string payout_batch_id
* @property string sender_batch_id
* @property \PayPal\Api\PayoutItem payout_item
* @property string time_processed
* @property \PayPal\Api\Error error
* @property \PayPal\Api\Links[] links
*/
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.
*
* @param string $payout_item_id
*
* @return $this
*/
public function setPayoutItemId($payout_item_id)
{
$this->payout_item_id = $payout_item_id;
return $this;
}
/**
* 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.
*
* @return string
*/
public function getPayoutItemId()
{
return $this->payout_item_id;
}
/**
* 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.
*
* @deprecated Instead use setPayoutItemId
*
* @param string $payout_item_id
* @return $this
*/
public function setPayout_item_id($payout_item_id)
{
$this->payout_item_id = $payout_item_id;
return $this;
}
/**
* 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.
* @deprecated Instead use getPayoutItemId
*
* @return string
*/
public function getPayout_item_id()
{
return $this->payout_item_id;
}
/**
* Generated ID for the transaction. 30 characters max.
*
* @param string $transaction_id
*
* @return $this
*/
public function setTransactionId($transaction_id)
{
$this->transaction_id = $transaction_id;
return $this;
}
/**
* Generated ID for the transaction. 30 characters max.
*
* @return string
*/
public function getTransactionId()
{
return $this->transaction_id;
}
/**
* Generated ID for the transaction. 30 characters max.
*
* @deprecated Instead use setTransactionId
*
* @param string $transaction_id
* @return $this
*/
public function setTransaction_id($transaction_id)
{
$this->transaction_id = $transaction_id;
return $this;
}
/**
* Generated ID for the transaction. 30 characters max.
* @deprecated Instead use getTransactionId
*
* @return string
*/
public function getTransaction_id()
{
return $this->transaction_id;
}
/**
* Status of a transaction.
*
* @param string $transaction_status
*
* @return $this
*/
public function setTransactionStatus($transaction_status)
{
$this->transaction_status = $transaction_status;
return $this;
}
/**
* Status of a transaction.
*
* @return string
*/
public function getTransactionStatus()
{
return $this->transaction_status;
}
/**
* Status of a transaction.
*
* @deprecated Instead use setTransactionStatus
*
* @param string $transaction_status
* @return $this
*/
public function setTransaction_status($transaction_status)
{
$this->transaction_status = $transaction_status;
return $this;
}
/**
* Status of a transaction.
* @deprecated Instead use getTransactionStatus
*
* @return string
*/
public function getTransaction_status()
{
return $this->transaction_status;
}
/**
* Amount of money in U.S. dollars for fees.
*
* @param \PayPal\Api\Currency $payout_item_fee
*
* @return $this
*/
public function setPayoutItemFee($payout_item_fee)
{
$this->payout_item_fee = $payout_item_fee;
return $this;
}
/**
* Amount of money in U.S. dollars for fees.
*
* @return \PayPal\Api\Currency
*/
public function getPayoutItemFee()
{
return $this->payout_item_fee;
}
/**
* Amount of money in U.S. dollars for fees.
*
* @deprecated Instead use setPayoutItemFee
*
* @param \PayPal\Api\Currency $payout_item_fee
* @return $this
*/
public function setPayout_item_fee($payout_item_fee)
{
$this->payout_item_fee = $payout_item_fee;
return $this;
}
/**
* Amount of money in U.S. dollars for fees.
* @deprecated Instead use getPayoutItemFee
*
* @return \PayPal\Api\Currency
*/
public function getPayout_item_fee()
{
return $this->payout_item_fee;
}
/**
* An ID for the batch payout. Generated by PayPal. 30 characters max.
*
* @param string $payout_batch_id
*
* @return $this
*/
public function setPayoutBatchId($payout_batch_id)
{
$this->payout_batch_id = $payout_batch_id;
return $this;
}
/**
* An ID for the batch payout. Generated by PayPal. 30 characters max.
*
* @return string
*/
public function getPayoutBatchId()
{
return $this->payout_batch_id;
}
/**
* An ID for the batch payout. Generated by PayPal. 30 characters max.
*
* @deprecated Instead use setPayoutBatchId
*
* @param string $payout_batch_id
* @return $this
*/
public function setPayout_batch_id($payout_batch_id)
{
$this->payout_batch_id = $payout_batch_id;
return $this;
}
/**
* An ID for the batch payout. Generated by PayPal. 30 characters max.
* @deprecated Instead use getPayoutBatchId
*
* @return string
*/
public function getPayout_batch_id()
{
return $this->payout_batch_id;
}
/**
* Sender-created ID for tracking the batch in an accounting system. 30 characters max.
*
* @param string $sender_batch_id
*
* @return $this
*/
public function setSenderBatchId($sender_batch_id)
{
$this->sender_batch_id = $sender_batch_id;
return $this;
}
/**
* Sender-created ID for tracking the batch in an accounting system. 30 characters max.
*
* @return string
*/
public function getSenderBatchId()
{
return $this->sender_batch_id;
}
/**
* Sender-created ID for tracking the batch in an accounting system. 30 characters max.
*
* @deprecated Instead use setSenderBatchId
*
* @param string $sender_batch_id
* @return $this
*/
public function setSender_batch_id($sender_batch_id)
{
$this->sender_batch_id = $sender_batch_id;
return $this;
}
/**
* Sender-created ID for tracking the batch in an accounting system. 30 characters max.
* @deprecated Instead use getSenderBatchId
*
* @return string
*/
public function getSender_batch_id()
{
return $this->sender_batch_id;
}
/**
* The data for a payout item that the sender initially provided.
*
* @param \PayPal\Api\PayoutItem $payout_item
*
* @return $this
*/
public function setPayoutItem($payout_item)
{
$this->payout_item = $payout_item;
return $this;
}
/**
* The data for a payout item that the sender initially provided.
*
* @return \PayPal\Api\PayoutItem
*/
public function getPayoutItem()
{
return $this->payout_item;
}
/**
* The data for a payout item that the sender initially provided.
*
* @deprecated Instead use setPayoutItem
*
* @param \PayPal\Api\PayoutItem $payout_item
* @return $this
*/
public function setPayout_item($payout_item)
{
$this->payout_item = $payout_item;
return $this;
}
/**
* The data for a payout item that the sender initially provided.
* @deprecated Instead use getPayoutItem
*
* @return \PayPal\Api\PayoutItem
*/
public function getPayout_item()
{
return $this->payout_item;
}
/**
* Time of the last processing for this item.
*
* @param string $time_processed
*
* @return $this
*/
public function setTimeProcessed($time_processed)
{
$this->time_processed = $time_processed;
return $this;
}
/**
* Time of the last processing for this item.
*
* @return string
*/
public function getTimeProcessed()
{
return $this->time_processed;
}
/**
* Time of the last processing for this item.
*
* @deprecated Instead use setTimeProcessed
*
* @param string $time_processed
* @return $this
*/
public function setTime_processed($time_processed)
{
$this->time_processed = $time_processed;
return $this;
}
/**
* Time of the last processing for this item.
* @deprecated Instead use getTimeProcessed
*
* @return string
*/
public function getTime_processed()
{
return $this->time_processed;
}
/**
* Sets Error
*
* @param \PayPal\Api\Error $error
*
* @return $this
*/
public function setErrors($error)
{
$this->errors = $error;
return $this;
}
/**
* Gets Error
*
* @return \PayPal\Api\Error
*/
public function getErrors()
{
return $this->errors;
}
/**
* Sets Links
*
* @param \PayPal\Api\Links[] $links
*
* @return $this
*/
public function setLinks($links)
{
$this->links = $links;
return $this;
}
/**
* Gets Links
*
* @return \PayPal\Api\Links[]
*/
public function getLinks()
{
return $this->links;
}
/**
* Append Links to the list.
*
* @param \PayPal\Api\Links $links
* @return $this
*/
public function addLink($links)
{
if (!$this->getLinks()) {
return $this->setLinks(array($links));
} else {
return $this->setLinks(
array_merge($this->getLinks(), array($links))
);
}
}
/**
* Remove Links from the list.
*
* @param \PayPal\Api\Links $links
* @return $this
*/
public function removeLink($links)
{
return $this->setLinks(
array_diff($this->getLinks(), array($links))
);
}
}

View File

@@ -0,0 +1,164 @@
<?php
namespace PayPal\Api;
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.
*
* @package PayPal\Api
*
* @property string sender_batch_id
* @property string email_subject
* @property string recipient_type
*/
class PayoutSenderBatchHeader extends PayPalModel
{
/**
* Sender-created ID for tracking the batch payout in an accounting system. 30 characters max.
*
* @param string $sender_batch_id
*
* @return $this
*/
public function setSenderBatchId($sender_batch_id)
{
$this->sender_batch_id = $sender_batch_id;
return $this;
}
/**
* Sender-created ID for tracking the batch payout in an accounting system. 30 characters max.
*
* @return string
*/
public function getSenderBatchId()
{
return $this->sender_batch_id;
}
/**
* Sender-created ID for tracking the batch payout in an accounting system. 30 characters max.
*
* @deprecated Instead use setSenderBatchId
*
* @param string $sender_batch_id
* @return $this
*/
public function setSender_batch_id($sender_batch_id)
{
$this->sender_batch_id = $sender_batch_id;
return $this;
}
/**
* Sender-created ID for tracking the batch payout in an accounting system. 30 characters max.
* @deprecated Instead use getSenderBatchId
*
* @return string
*/
public function getSender_batch_id()
{
return $this->sender_batch_id;
}
/**
* 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.
*
* @param string $email_subject
*
* @return $this
*/
public function setEmailSubject($email_subject)
{
$this->email_subject = $email_subject;
return $this;
}
/**
* 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.
*
* @return string
*/
public function getEmailSubject()
{
return $this->email_subject;
}
/**
* 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.
*
* @deprecated Instead use setEmailSubject
*
* @param string $email_subject
* @return $this
*/
public function setEmail_subject($email_subject)
{
$this->email_subject = $email_subject;
return $this;
}
/**
* 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.
* @deprecated Instead use getEmailSubject
*
* @return string
*/
public function getEmail_subject()
{
return $this->email_subject;
}
/**
* 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`.
*
* @param string $recipient_type
*
* @return $this
*/
public function setRecipientType($recipient_type)
{
$this->recipient_type = $recipient_type;
return $this;
}
/**
* 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`.
*
* @return string
*/
public function getRecipientType()
{
return $this->recipient_type;
}
/**
* 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`.
*
* @deprecated Instead use setRecipientType
*
* @param string $recipient_type
* @return $this
*/
public function setRecipient_type($recipient_type)
{
$this->recipient_type = $recipient_type;
return $this;
}
/**
* 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`.
* @deprecated Instead use getRecipientType
*
* @return string
*/
public function getRecipient_type()
{
return $this->recipient_type;
}
}