MangoPay/ApiClients.php
public function UploadLogoFromFile($file, $idempotencyKey = null)
    {
        $filePath = $file;
        if (is_array($file)) {
            $filePath = $file['tmp_name'];
        }
        
        if (empty($filePath)) {
            throw new \MangoPay\Libraries\Exception('Path of file cannot be empty');
        }
        
        if (!file_exists($filePath)) {
            throw new \MangoPay\Libraries\Exception('File not exist');
        }
        
        $logoUpload = new \MangoPay\ClientLogoUpload();
        $logoUpload->File = base64_encode(file_get_contents($filePath));
        
        if (empty($logoUpload->File)) {
            throw new \MangoPay\Libraries\Exception('Content of the file cannot be empty');
        }
        
        $this->UploadLogo($logoUpload, $idempotencyKey);
    }
public function UploadLogoFromFile($file, $idempotencyKey = null)
    {
        $filePath = $file;
        if (is_array($file)) {
            $filePath = $file['tmp_name'];
        }
        
        if (empty($filePath)) {
            throw new \MangoPay\Libraries\Exception('Path of file cannot be empty');
        }
        
        if (!file_exists($filePath)) {
            throw new \MangoPay\Libraries\Exception('File not exist');
        }
        
        $logoUpload = new \MangoPay\ClientLogoUpload();
        $logoUpload->File = base64_encode(file_get_contents($filePath));
        
        if (empty($logoUpload->File)) {
            throw new \MangoPay\Libraries\Exception('Content of the file cannot be empty');
        }
        
        $this->UploadLogo($logoUpload, $idempotencyKey);
    }
public function UploadLogoFromFile ( $ file , $ idempotencyKey = null ) { $ filePath = $ file ; if ( is_array ( $ file ) ) { $ filePath = $ file [ 'tmp_name' ] ; } if ( empty ( $ filePath ) ) { throw new \ MangoPay \ Libraries \ Exception ( 'Path of file cannot be empty' ) ; } if ( ! file_exists ( $ filePath ) ) { throw new \ MangoPay \ Libraries \ Exception ( 'File not exist' ) ; } $ logoUpload = new \ MangoPay \ ClientLogoUpload ( ) ; $ logoUpload -> File = base64_encode ( file_get_contents ( $ filePath ) ) ; if ( empty ( $ logoUpload -> File ) ) { throw new \ MangoPay \ Libraries \ Exception ( 'Content of the file cannot be empty' ) ; } $ this -> UploadLogo ( $ logoUpload , $ idempotencyKey ) ; }
Upload a logo for client from file.
Only GIF, PNG, JPG, JPEG, BMP, PDF and DOC formats are accepted,
and file must be less than about 7MB
@param string $file Path of file with logo
@throws \MangoPay\Libraries\Exception
Upload a logo for client from file . Only GIF PNG JPG JPEG BMP PDF and DOC formats are accepted and file must be less than about 7MB