src/Actions/ManagesCertificates.php
public function createCertificate($serverId, $siteId, array $data, $wait = true)
    {
        $certificate = $this->post("servers/$serverId/sites/$siteId/certificates", $data)['certificate'];

        if ($wait) {
            return $this->retry($this->getTimeout(), function () use ($serverId, $siteId, $certificate) {
                $certificate = $this->certificate($serverId, $siteId, $certificate['id']);

                return $certificate->status == 'installed' ? $certificate : null;
            });
        }

        return new Certificate($certificate + ['server_id' => $serverId, 'site_id' => $siteId], $this);
    }
public function createCertificate($serverId, $siteId, array $data, $wait = true)
    {
        $certificate = $this->post("servers/$serverId/sites/$siteId/certificates", $data)['certificate'];

        if ($wait) {
            return $this->retry($this->getTimeout(), function () use ($serverId, $siteId, $certificate) {
                $certificate = $this->certificate($serverId, $siteId, $certificate['id']);

                return $certificate->status == 'installed' ? $certificate : null;
            });
        }

        return new Certificate($certificate + ['server_id' => $serverId, 'site_id' => $siteId], $this);
    }
public function createCertificate ( $ serverId , $ siteId , array $ data , $ wait = true ) { $ certificate = $ this -> post ( "servers/$serverId/sites/$siteId/certificates" , $ data ) [ 'certificate' ] ; if ( $ wait ) { return $ this -> retry ( $ this -> getTimeout ( ) , function ( ) use ( $ serverId , $ siteId , $ certificate ) { $ certificate = $ this -> certificate ( $ serverId , $ siteId , $ certificate [ 'id' ] ) ; return $ certificate -> status == 'installed' ? $ certificate : null ; } ) ; } return new Certificate ( $ certificate + [ 'server_id' => $ serverId , 'site_id' => $ siteId ] , $ this ) ; }
Create a new certificate.

@param  integer $serverId
@param  integer $siteId
@param  array $data
@param  boolean $wait
@return Certificate
Create a new certificate .