Exemplo n.º 1
0
 /**
  * Generate a QR code for an invoice by passing the invoice ID to the request URI. The request generates a QR code that is 500 pixels in width and height. You can change the dimensions of the returned code by specifying optional query parameters.
  *
  * @param array $params
  * @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 Image
  */
 public static function qrCode($invoiceId, $params = array(), $apiContext = null, $restCall = null)
 {
     ArgumentValidator::validate($invoiceId, 'invoiceId');
     ArgumentValidator::validate($params, 'params');
     $allowedParams = array('width' => 1, 'height' => 1, 'action' => 1);
     $payLoad = "";
     $json = self::executeCall("/v1/invoicing/invoices/{$invoiceId}/qr-code?" . http_build_query(array_intersect_key($params, $allowedParams)), "GET", $payLoad, null, $apiContext, $restCall);
     $ret = new Image();
     $ret->fromJson($json);
     return $ret;
 }
Exemplo n.º 2
0
 /**
  * @depends testSerializationDeserialization
  * @param Image $obj
  */
 public function testGetters($obj)
 {
     $this->assertEquals($obj->getImage(), "TestSample");
 }