Skip to content

Commit 3fa0498

Browse files
author
Bart Faber
authored
Merge pull request #24 from xolphin/feature/deprecate-encryption-everywhere
Removed EncryptionEverywhere from the codebase and fixed issue#23
2 parents 91ad55f + 77dc1e1 commit 3fa0498

27 files changed

+174
-443
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
vendor/
22
.idea/
3+
.phpunit.result.cache

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All notable changes to the wrapper will be documented in this file.
1010
- Updated guzzle from `6.x|7.x` to `^9`
1111
- Minor changes in the readme
1212
- Updated the phpunit.xml configuration file
13+
- Changed the response base pagination into a Pagination class see Issue:#23
1314
### Added
1415
- Added support for PHP 8.0
1516
- Added the `disableFreeSan` field for requests.
@@ -19,6 +20,7 @@ All notable changes to the wrapper will be documented in this file.
1920
- Dropped support for all versions below PHP 7.4
2021
- Removed functions previously marked deprecated
2122
- Removed deprecated RequestDCV class
23+
- Removed EncryptionEverywhere support
2224

2325
## [2.0.1]
2426

readme.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ And updated via
2424
composer update xolphin/xolphin-api-php
2525
```
2626

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

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

173-
#### Request an "Encryption Everywhere" certificate
174-
175-
```php
176-
$request = $this->_client->requests->createEE();
177-
$request->setCsr('<csr_string>');
178-
$request->setApproverEmail('email@example.com');
179-
$request->setApproverFirstName('FirstName');
180-
$request->setApproverLastName('SecondName');
181-
$request->setApproverPhone('+12345678901');
182-
$request->setDcvType(DCVTypes::FILE_VALIDATION);
183-
// if you just want to validate
184-
$request->setValidate(true);
185-
186-
$response = $client->requests->sendEE($request);
187-
```
188-
189178
### Certificate
190179

191180
#### Certificates list and expirations

src/Endpoints/CertificatesEndpoint.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ public function all(): array
4444
$result = new Certificates($this->client->get('certificates', ['page' => 1]));
4545
if (!$result->isError()) {
4646
$certificates = $result->certificates;
47-
while ($result->page < $result->pages) {
48-
$result = new Certificates($this->client->get('certificates', ['page' => $result->page + 1]));
47+
while ($result->getPagination()->getPage() < $result->getPagination()->getPages()) {
48+
$result = new Certificates($this->client->get('certificates', ['page' => $result->getPagination()->getPage() + 1]));
49+
4950
if ($result->isError()) {
5051
break;
5152
}
53+
5254
$certificates = array_merge($certificates, $result->certificates);
5355
}
5456
}

src/Endpoints/InvoicesEndpoint.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ public function all(): array
4040
$result = new Invoices($this->client->get('invoices', ['page' => 1]));
4141
if (!$result->isError()) {
4242
$invoices = $result->invoices;
43-
while ($result->page < $result->pages) {
44-
$result = new Invoices($this->client->get('invoices', ['page' => $result->page + 1]));
43+
while ($result->getPagination()->getPage() < $result->getPagination()->getPages()) {
44+
$result = new Invoices($this->client->get('invoices', ['page' => $result->getPagination()->getPage() + 1]));
45+
4546
if ($result->isError()) {
4647
break;
4748
}
49+
4850
$invoices = array_merge($invoices, $result->invoices);
4951
}
5052
}

src/Endpoints/RequestsEndpoint.php

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@
1010
use Xolphin\Client;
1111
use Xolphin\Exceptions\XolphinRequestException;
1212
use Xolphin\Requests\CertificateRequest;
13-
use Xolphin\Requests\RequestEERequest;
1413
use Xolphin\Responses\Base;
1514
use Xolphin\Responses\Notes;
1615
use Xolphin\Responses\Request;
17-
use Xolphin\Responses\RequestEE;
1816
use Xolphin\Responses\Requests;
1917
use Xolphin\Responses\ValidationCalls;
2018

@@ -46,11 +44,13 @@ public function all(): array
4644
$result = new Requests($this->client->get('requests', ['page' => 1]));
4745
if (!$result->isError()) {
4846
$requests = $result->requests;
49-
while ($result->page < $result->pages) {
50-
$result = new Requests($this->client->get('requests', ['page' => $result->page + 1]));
47+
while ($result->getPagination()->getPage() < $result->getPagination()->getPages()) {
48+
$result = new Requests($this->client->get('requests', ['page' => $result->getPagination()->getPage() + 1]));
49+
5150
if ($result->isError()) {
5251
break;
5352
}
53+
5454
$requests = array_merge($requests, $result->requests);
5555
}
5656
}
@@ -81,24 +81,6 @@ public function send(CertificateRequest $request): Request
8181
return new Request($this->client->post('requests', $request->getApiRequestBody()));
8282
}
8383

84-
/**
85-
* @return RequestEERequest
86-
*/
87-
public function createEE(): RequestEERequest
88-
{
89-
return new RequestEERequest();
90-
}
91-
92-
/**
93-
* @param RequestEERequest $request
94-
* @return RequestEE
95-
* @throws XolphinRequestException|GuzzleException
96-
*/
97-
public function sendEE(RequestEERequest $request): RequestEE
98-
{
99-
return new RequestEE($this->client->post('requests/ee', $request->getApiRequestBody()));
100-
}
101-
10284
/**
10385
* @param int $id
10486
* @return Request

src/Endpoints/SupportEndpoint.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ public function products(): array
5959
$result = new Products($this->client->get('products', ['page' => 1]));
6060
if (!$result->isError()) {
6161
$products = $result->products;
62-
while ($result->page < $result->pages) {
63-
$result = new Products($this->client->get('products', ['page' => $result->page + 1]));
62+
while ($result->getPagination()->getPage() < $result->getPagination()->getPages()) {
63+
$result = new Products($this->client->get('products', ['page' => $result->getPagination()->getPage() + 1]));
64+
6465
if ($result->isError()) {
6566
break;
6667
}
68+
6769
$products = array_merge($products, $result->products);
6870
}
6971
}

src/Requests/RequestEERequest.php

Lines changed: 0 additions & 206 deletions
This file was deleted.

0 commit comments

Comments
 (0)