Ejemplo n.º 1
0
 /**
  * Gets the details for a specified invoice, by ID.
  *
  * @param string $invoiceId
  * @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 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;
 }
Ejemplo n.º 2
0
 public static function get($invoiceId, $apiContext = null)
 {
     if ($invoiceId == null || strlen($invoiceId) <= 0) {
         throw new \InvalidArgumentException("invoiceId cannot be null or empty");
     }
     $payLoad = "";
     if ($apiContext == null) {
         $apiContext = new ApiContext(self::$credential);
     }
     $call = new PPRestCall($apiContext);
     $json = $call->execute(array('PayPal\\Rest\\RestHandler'), "/v1/invoicing/invoices/{$invoiceId}", "GET", $payLoad);
     $ret = new Invoice();
     $ret->fromJson($json);
     return $ret;
 }