Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
core
/
vendor
/
paypal
/
rest-api-sdk-php
/
lib
/
PayPal
/
Api
:
Image.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace PayPal\Api; use PayPal\Common\PayPalModel; /** * Class Image * * @package PayPal\Api * * @property string image */ class Image extends PayPalModel { /** * List of invoices belonging to a merchant. * * @param string $imageBase64String * * @return $this */ public function setImage($imageBase64String) { $this->image = $imageBase64String; return $this; } /** * Get Image as Base-64 encoded String * * @return string */ public function getImage() { return $this->image; } /** * Stores the Image to file * * @param string $name File Name * @return string File name */ public function saveToFile($name = null) { // Self Generate File Location if (!$name) { $name = uniqid() . '.png'; } // Save to File file_put_contents($name, base64_decode($this->getImage())); return $name; } }