This repository has been archived on 2026-04-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PayPal-PHP-SDK/lib/PayPal/Api/Image.php
japatel 9c0827643b Renaming Namespaces and Organizing Classes
- Updated OpenId classes to be in API namespace
- Updated PP Naming Convention to PayPal Naming Convention
- FormatConverter Class got its own namespace
- Handlers are grouped in Handler namespace
- Samples and Tests Updated Accordingly
2014-12-18 14:16:41 -06:00

57 lines
1011 B
PHP

<?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;
}
}