public function refund($data = [])
    {
        $resource = "payments/" . urlencode($this->id) . "/refunds";

        $body = null;
        if (count($data) > 0) {
            $body = json_encode($data);
        }

        $result = $this->client->performHttpCall(
            MollieApiClient::HTTP_POST,
            $resource,
            $body
        );

        return ResourceFactory::createFromApiResult(
            $result,
            new Refund($this->client)
        );
    }
public function refund($data = [])
    {
        $resource = "payments/" . urlencode($this->id) . "/refunds";

        $body = null;
        if (count($data) > 0) {
            $body = json_encode($data);
        }

        $result = $this->client->performHttpCall(
            MollieApiClient::HTTP_POST,
            $resource,
            $body
        );

        return ResourceFactory::createFromApiResult(
            $result,
            new Refund($this->client)
        );
    }
public function refund ( $ data = [ ] ) { $ resource = "payments/" . urlencode ( $ this -> id ) . "/refunds" ; $ body = null ; if ( count ( $ data ) > 0 ) { $ body = json_encode ( $ data ) ; } $ result = $ this -> client -> performHttpCall ( MollieApiClient :: HTTP_POST , $ resource , $ body ) ; return ResourceFactory :: createFromApiResult ( $ result , new Refund ( $ this -> client ) ) ; }
Issue a refund for this payment.

The $data parameter may either be an array of endpoint parameters or empty to
do a full refund.

@param array|null $data

@return BaseResource
@throws ApiException
Issue a refund for this payment .