PayPalApiImage

Class Image.

Defined (1)

The class is defined in the following location(s).

/classes/lib/PayPal/Api/Image.php  
  1. class Image extends PayPalModel 
  2. /** 
  3. * List of invoices belonging to a merchant. 
  4. * @param string $imageBase64String 
  5. *  
  6. * @return $this 
  7. */ 
  8. public function setImage($imageBase64String) 
  9. $this->image = $imageBase64String; 
  10. return $this; 
  11.  
  12. /** 
  13. * Get Image as Base-64 encoded String 
  14. * @return string 
  15. */ 
  16. public function getImage() 
  17. return $this->image; 
  18.  
  19. /** 
  20. * Stores the Image to file 
  21. * @param string $name File Name 
  22. * @return string File name 
  23. */ 
  24. public function saveToFile($name = null) 
  25. // Self Generate File Location 
  26. if (!$name) { 
  27. $name = uniqid() . '.png'; 
  28. // Save to File 
  29. file_put_contents($name, base64_decode($this->getImage())); 
  30. return $name; 
  31.