PHP code example of deamwork / trustoceanphp

1. Go to this page and download the library: Download deamwork/trustoceanphp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

deamwork / trustoceanphp example snippets


$flow = new TOAPI('/path/to/your/config.json');
$order = $flow->createOrder('TrustOcean Encryption365 SSL', 'quarterly', 3);
$order_id = $order['order_id'];

$flow->addSANs($order_id, 3);

$flow->uploadCSR($order_id, "CSR TEXT GOES HERE");

$flow->addDomains($order_id, [
    'a.domain.tld', 'b.domain.tld', 'c.domain.tld',
    'd.domain.tld', 'e.domain.tld', 'f.domain.tld',
]);

$flow->removeDomain($order_id, [
    'd.domain.tld', 'e.domain.tld', 'f.domain.tld',
]);

$flow->getOrderDetails($order_id);

$flow->changeDCVMethod($order_id, [
    'a.domain.tld' => '[email protected]',
    'b.domain.tld' => 'CSR_CNAME_HASH',
    'c.domain.tld' => 'HTTP_CSR_HASH',
]);

$flow->reDoDCVCheck($order_id);
$flow->resendDCVEmail($order_id);

$flow->resendDCVEmailReDoDCVCheck($order_id);

$cert = $flow->getCertDetails($order_id);
print_r($cert['cert_code'], true); // get your certificate
print_r($cert['ca_code'], true);   // get CA certificate

$flow->setCertReissue($order_id);