PayPal\Api\Invoice::getAll PHP Method

getAll() public static method

Lists some or all merchant invoices. Filters the response by any specified optional query string parameters.
public static getAll ( array $params = [], ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : PayPal\Api\InvoiceSearchResponse
$params array
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPal\Transport\PayPalRestCall is the Rest Call Service that is used to make rest calls
return PayPal\Api\InvoiceSearchResponse
    public static function getAll($params = array(), $apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($params, 'params');
        $allowedParams = array('page' => 1, 'page_size' => 1, 'total_count_required' => 1);
        $payLoad = "";
        $json = self::executeCall("/v1/invoicing/invoices/?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
        $ret = new InvoiceSearchResponse();
        $ret->fromJson($json);
        return $ret;
    }

Usage Example

 /**
  * @dataProvider mockProvider
  * @param Invoice $obj
  */
 public function testGetAll($obj, $mockApiContext)
 {
     $mockPayPalRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPayPalRestCall->expects($this->any())->method('execute')->will($this->returnValue(InvoiceSearchResponseTest::getJson()));
     $result = $obj->getAll(array(), $mockApiContext, $mockPayPalRestCall);
     $this->assertNotNull($result);
 }
All Usage Examples Of PayPal\Api\Invoice::getAll