Skip to content

Commit

Permalink
Removed EncryptionEverywhere from the codebase and fixed issue#23
Browse files Browse the repository at this point in the history
  • Loading branch information
XolphinMike committed Nov 23, 2021
1 parent 91ad55f commit 77dc1e1
Show file tree
Hide file tree
Showing 27 changed files with 174 additions and 443 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vendor/
.idea/
.phpunit.result.cache
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All notable changes to the wrapper will be documented in this file.
- Updated guzzle from `6.x|7.x` to `^9`
- Minor changes in the readme
- Updated the phpunit.xml configuration file
- Changed the response base pagination into a Pagination class see Issue:#23
### Added
- Added support for PHP 8.0
- Added the `disableFreeSan` field for requests.
Expand All @@ -19,6 +20,7 @@ All notable changes to the wrapper will be documented in this file.
- Dropped support for all versions below PHP 7.4
- Removed functions previously marked deprecated
- Removed deprecated RequestDCV class
- Removed EncryptionEverywhere support

## [2.0.1]

Expand Down
21 changes: 5 additions & 16 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ And updated via
composer update xolphin/xolphin-api-php
```

### Upgrade guide: from v2.x to v3.x
- Access pagination attributes from `$response->getPagination()->{{method}};`
- Remove all EE (EncryptionEverywhere) blocks from your code, it has finally been removed.
- Make sure you enforce the right types since we enforce strict-typing now.

### Upgrade guide from v1.8.3 to v2.x

Update your `xolphin/xolphin-api-php` dependency to `^2.0` in your `composer.json` file.
Expand Down Expand Up @@ -170,22 +175,6 @@ foreach($notes as $note){
$client->requests->sendSectigoSAEmail(1234, 'mail@example.com', RequestLanguage::ENGLISH);
```

#### Request an "Encryption Everywhere" certificate

```php
$request = $this->_client->requests->createEE();
$request->setCsr('<csr_string>');
$request->setApproverEmail('email@example.com');
$request->setApproverFirstName('FirstName');
$request->setApproverLastName('SecondName');
$request->setApproverPhone('+12345678901');
$request->setDcvType(DCVTypes::FILE_VALIDATION);
// if you just want to validate
$request->setValidate(true);

$response = $client->requests->sendEE($request);
```

### Certificate

#### Certificates list and expirations
Expand Down
6 changes: 4 additions & 2 deletions src/Endpoints/CertificatesEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ public function all(): array
$result = new Certificates($this->client->get('certificates', ['page' => 1]));
if (!$result->isError()) {
$certificates = $result->certificates;
while ($result->page < $result->pages) {
$result = new Certificates($this->client->get('certificates', ['page' => $result->page + 1]));
while ($result->getPagination()->getPage() < $result->getPagination()->getPages()) {
$result = new Certificates($this->client->get('certificates', ['page' => $result->getPagination()->getPage() + 1]));

if ($result->isError()) {
break;
}

$certificates = array_merge($certificates, $result->certificates);
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/Endpoints/InvoicesEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ public function all(): array
$result = new Invoices($this->client->get('invoices', ['page' => 1]));
if (!$result->isError()) {
$invoices = $result->invoices;
while ($result->page < $result->pages) {
$result = new Invoices($this->client->get('invoices', ['page' => $result->page + 1]));
while ($result->getPagination()->getPage() < $result->getPagination()->getPages()) {
$result = new Invoices($this->client->get('invoices', ['page' => $result->getPagination()->getPage() + 1]));

if ($result->isError()) {
break;
}

$invoices = array_merge($invoices, $result->invoices);
}
}
Expand Down
26 changes: 4 additions & 22 deletions src/Endpoints/RequestsEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
use Xolphin\Client;
use Xolphin\Exceptions\XolphinRequestException;
use Xolphin\Requests\CertificateRequest;
use Xolphin\Requests\RequestEERequest;
use Xolphin\Responses\Base;
use Xolphin\Responses\Notes;
use Xolphin\Responses\Request;
use Xolphin\Responses\RequestEE;
use Xolphin\Responses\Requests;
use Xolphin\Responses\ValidationCalls;

Expand Down Expand Up @@ -46,11 +44,13 @@ public function all(): array
$result = new Requests($this->client->get('requests', ['page' => 1]));
if (!$result->isError()) {
$requests = $result->requests;
while ($result->page < $result->pages) {
$result = new Requests($this->client->get('requests', ['page' => $result->page + 1]));
while ($result->getPagination()->getPage() < $result->getPagination()->getPages()) {
$result = new Requests($this->client->get('requests', ['page' => $result->getPagination()->getPage() + 1]));

if ($result->isError()) {
break;
}

$requests = array_merge($requests, $result->requests);
}
}
Expand Down Expand Up @@ -81,24 +81,6 @@ public function send(CertificateRequest $request): Request
return new Request($this->client->post('requests', $request->getApiRequestBody()));
}

/**
* @return RequestEERequest
*/
public function createEE(): RequestEERequest
{
return new RequestEERequest();
}

/**
* @param RequestEERequest $request
* @return RequestEE
* @throws XolphinRequestException|GuzzleException
*/
public function sendEE(RequestEERequest $request): RequestEE
{
return new RequestEE($this->client->post('requests/ee', $request->getApiRequestBody()));
}

/**
* @param int $id
* @return Request
Expand Down
6 changes: 4 additions & 2 deletions src/Endpoints/SupportEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ public function products(): array
$result = new Products($this->client->get('products', ['page' => 1]));
if (!$result->isError()) {
$products = $result->products;
while ($result->page < $result->pages) {
$result = new Products($this->client->get('products', ['page' => $result->page + 1]));
while ($result->getPagination()->getPage() < $result->getPagination()->getPages()) {
$result = new Products($this->client->get('products', ['page' => $result->getPagination()->getPage() + 1]));

if ($result->isError()) {
break;
}

$products = array_merge($products, $result->products);
}
}
Expand Down
206 changes: 0 additions & 206 deletions src/Requests/RequestEERequest.php

This file was deleted.

Loading

0 comments on commit 77dc1e1

Please sign in to comment.