MangoPay/ApiDisputes.php
public function CreateDisputeDocumentPageFromFile($disputeId, $disputeDocumentId, $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');
        }
        
        $disputeDocumentPage = new \MangoPay\DisputeDocumentPage();
        $disputeDocumentPage->File = base64_encode(file_get_contents($filePath));
        
        if (empty($disputeDocumentPage->File)) {
            throw new \MangoPay\Libraries\Exception('Content of the file cannot be empty');
        }
        
        $this->CreateDisputeDocumentPage($disputeId, $disputeDocumentId, $disputeDocumentPage, $idempotencyKey);
    }
public function CreateDisputeDocumentPageFromFile($disputeId, $disputeDocumentId, $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');
        }
        
        $disputeDocumentPage = new \MangoPay\DisputeDocumentPage();
        $disputeDocumentPage->File = base64_encode(file_get_contents($filePath));
        
        if (empty($disputeDocumentPage->File)) {
            throw new \MangoPay\Libraries\Exception('Content of the file cannot be empty');
        }
        
        $this->CreateDisputeDocumentPage($disputeId, $disputeDocumentId, $disputeDocumentPage, $idempotencyKey);
    }
public function CreateDisputeDocumentPageFromFile ( $ disputeId , $ disputeDocumentId , $ 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' ) ; } $ disputeDocumentPage = new \ MangoPay \ DisputeDocumentPage ( ) ; $ disputeDocumentPage -> File = base64_encode ( file_get_contents ( $ filePath ) ) ; if ( empty ( $ disputeDocumentPage -> File ) ) { throw new \ MangoPay \ Libraries \ Exception ( 'Content of the file cannot be empty' ) ; } $ this -> CreateDisputeDocumentPage ( $ disputeId , $ disputeDocumentId , $ disputeDocumentPage , $ idempotencyKey ) ; }
Creates document's page for dispute from file
@param string $disputeId Dispute identifier
@param string $disputeDocumentId Dispute document identifier
@param string $file File path
@throws \MangoPay\Libraries\Exception
Creates document s page for dispute from file