forked from LiveCarta/PayPal-PHP-SDK
Samples for All Invoice Operations including QR Code
- Invoice search method is static now - Shipping Info has proper Phone Params - Small Changes to Image Class - Updated Sample Docs
This commit is contained in:
120
lib/PayPal/Api/InvoiceSearchResponse.php
Normal file
120
lib/PayPal/Api/InvoiceSearchResponse.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace PayPal\Api;
|
||||
|
||||
use PayPal\Common\PPModel;
|
||||
|
||||
/**
|
||||
* Class InvoiceSearchResponse
|
||||
*
|
||||
*
|
||||
*
|
||||
* @package PayPal\Api
|
||||
*
|
||||
* @property int total_count
|
||||
* @property \PayPal\Api\Invoice[] invoices
|
||||
*/
|
||||
class InvoiceSearchResponse extends PPModel
|
||||
{
|
||||
/**
|
||||
* Total number of invoices.
|
||||
*
|
||||
* @param int $total_count
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotalCount($total_count)
|
||||
{
|
||||
$this->total_count = $total_count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of invoices.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalCount()
|
||||
{
|
||||
return $this->total_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of invoices.
|
||||
*
|
||||
* @deprecated Instead use setTotalCount
|
||||
*
|
||||
* @param int $total_count
|
||||
* @return $this
|
||||
*/
|
||||
public function setTotal_count($total_count)
|
||||
{
|
||||
$this->total_count = $total_count;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Total number of invoices.
|
||||
* @deprecated Instead use getTotalCount
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getTotal_count()
|
||||
{
|
||||
return $this->total_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of invoices belonging to a merchant.
|
||||
*
|
||||
* @param \PayPal\Api\Invoice[] $invoices
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append Invoices to the list.
|
||||
*
|
||||
* @param \PayPal\Api\Invoice $invoice
|
||||
* @return $this
|
||||
*/
|
||||
public function addInvoice($invoice)
|
||||
{
|
||||
if (!$this->getInvoices()) {
|
||||
return $this->setInvoices(array($invoice));
|
||||
} else {
|
||||
return $this->setInvoices(
|
||||
array_merge($this->getInvoices(), array($invoice))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove Invoices from the list.
|
||||
*
|
||||
* @param \PayPal\Api\Invoice $invoice
|
||||
* @return $this
|
||||
*/
|
||||
public function removeInvoice($invoice)
|
||||
{
|
||||
return $this->setInvoices(
|
||||
array_diff($this->getInvoices(), array($invoice))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user