PayPal\Api\Invoice::get PHP Method

get() public static method

Gets the details for a specified invoice, by ID.
public static get ( string $invoiceId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Invoice
$invoiceId string
$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 Invoice
    public static function get($invoiceId, $apiContext = null, $restCall = null)
    {
        ArgumentValidator::validate($invoiceId, 'invoiceId');
        $payLoad = "";
        $json = self::executeCall("/v1/invoicing/invoices/{$invoiceId}", "GET", $payLoad, null, $apiContext, $restCall);
        $ret = new Invoice();
        $ret->fromJson($json);
        return $ret;
    }

Usage Example

コード例 #1
0
 /**
  * @depends testCreate
  * @param $invoice Invoice
  * @return Invoice
  */
 public function testGet($invoice)
 {
     $result = Invoice::get($invoice->getId(), null, $this->mockPayPalRestCall);
     $this->assertNotNull($result);
     $this->assertEquals($invoice->getId(), $result->getId());
     return $result;
 }
All Usage Examples Of PayPal\Api\Invoice::get