lib/Braintree/DisputeGateway.php
public function addFileEvidence($disputeId, $documentIdOrRequest)
    {
        $request = is_array($documentIdOrRequest) ? $documentIdOrRequest : ['documentId' => $documentIdOrRequest];

        if (trim($disputeId) == "") {
            throw new Exception\NotFound('dispute with id "' . $disputeId . '" not found');
        }

        if (trim($request['documentId']) == "") {
            throw new Exception\NotFound('document with id "' . $request['documentId'] . '" not found');
        }

        try {
            if (array_key_exists('category', $request)) {
                if (trim($request['category']) == "") {
                    throw new InvalidArgumentException('category cannot be blank');
                }
            }

            $request['document_upload_id'] = $request['documentId'];
            unset($request['documentId']);

            $path = $this->_config->merchantPath() . '/disputes/' . $disputeId . '/evidence';
            $response = $this->_http->post($path, ['evidence' => $request]);

            if (isset($response['apiErrorResponse'])) {
                return new Result\Error($response['apiErrorResponse']);
            }

            if (isset($response['evidence'])) {
                $evidence = new Dispute\EvidenceDetails($response['evidence']);
                return new Result\Successful($evidence);
            }
        } catch (Exception\NotFound $e) {
            throw new Exception\NotFound('dispute with id "' . $disputeId . '" not found');
        }
    }
public function addFileEvidence($disputeId, $documentIdOrRequest)
    {
        $request = is_array($documentIdOrRequest) ? $documentIdOrRequest : ['documentId' => $documentIdOrRequest];

        if (trim($disputeId) == "") {
            throw new Exception\NotFound('dispute with id "' . $disputeId . '" not found');
        }

        if (trim($request['documentId']) == "") {
            throw new Exception\NotFound('document with id "' . $request['documentId'] . '" not found');
        }

        try {
            if (array_key_exists('category', $request)) {
                if (trim($request['category']) == "") {
                    throw new InvalidArgumentException('category cannot be blank');
                }
            }

            $request['document_upload_id'] = $request['documentId'];
            unset($request['documentId']);

            $path = $this->_config->merchantPath() . '/disputes/' . $disputeId . '/evidence';
            $response = $this->_http->post($path, ['evidence' => $request]);

            if (isset($response['apiErrorResponse'])) {
                return new Result\Error($response['apiErrorResponse']);
            }

            if (isset($response['evidence'])) {
                $evidence = new Dispute\EvidenceDetails($response['evidence']);
                return new Result\Successful($evidence);
            }
        } catch (Exception\NotFound $e) {
            throw new Exception\NotFound('dispute with id "' . $disputeId . '" not found');
        }
    }
public function addFileEvidence ( $ disputeId , $ documentIdOrRequest ) { $ request = is_array ( $ documentIdOrRequest ) ? $ documentIdOrRequest : [ 'documentId' => $ documentIdOrRequest ] ; if ( trim ( $ disputeId ) == "" ) { throw new Exception \ NotFound ( 'dispute with id "' . $ disputeId . '" not found' ) ; } if ( trim ( $ request [ 'documentId' ] ) == "" ) { throw new Exception \ NotFound ( 'document with id "' . $ request [ 'documentId' ] . '" not found' ) ; } try { if ( array_key_exists ( 'category' , $ request ) ) { if ( trim ( $ request [ 'category' ] ) == "" ) { throw new InvalidArgumentException ( 'category cannot be blank' ) ; } } $ request [ 'document_upload_id' ] = $ request [ 'documentId' ] ; unset ( $ request [ 'documentId' ] ) ; $ path = $ this -> _config -> merchantPath ( ) . '/disputes/' . $ disputeId . '/evidence' ; $ response = $ this -> _http -> post ( $ path , [ 'evidence' => $ request ] ) ; if ( isset ( $ response [ 'apiErrorResponse' ] ) ) { return new Result \ Error ( $ response [ 'apiErrorResponse' ] ) ; } if ( isset ( $ response [ 'evidence' ] ) ) { $ evidence = new Dispute \ EvidenceDetails ( $ response [ 'evidence' ] ) ; return new Result \ Successful ( $ evidence ) ; } } catch ( Exception \ NotFound $ e ) { throw new Exception \ NotFound ( 'dispute with id "' . $ disputeId . '" not found' ) ; } }
Adds file evidence to a dispute, given a dispute ID and a document ID

@param string $disputeId
@param string $documentIdOrRequest
Adds file evidence to a dispute given a dispute ID and a document ID