This repository was archived by the owner on Feb 4, 2025. It is now read-only.
File tree 4 files changed +30
-7
lines changed
4 files changed +30
-7
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) . Please note this changelog affects
6
6
this package and not the Oxxa API.
7
7
8
+ ## [ 2.4.0]
9
+
10
+ ### Added
11
+
12
+ - Allow additional parameters for the ssl products endpoint.
13
+
14
+ ### Changed
15
+
16
+ - Moved pricing to a ` Price ` object.
17
+
8
18
## [ 2.3.0]
9
19
10
20
### Added
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Cyberfusion \Oxxa \DataTransferObjects ;
4
+
5
+ class Price
6
+ {
7
+ public function __construct (
8
+ public int $ period ,
9
+ public float $ price ,
10
+ ) {
11
+ }
12
+ }
Original file line number Diff line number Diff line change 3
3
namespace Cyberfusion \Oxxa \Endpoints ;
4
4
5
5
use Cyberfusion \Oxxa \Contracts \Endpoint as EndpointContract ;
6
+ use Cyberfusion \Oxxa \DataTransferObjects \Price ;
6
7
use Cyberfusion \Oxxa \Enum \StatusCode ;
7
8
use Cyberfusion \Oxxa \Enum \Toggle ;
8
9
use Cyberfusion \Oxxa \Models \SslProduct ;
11
12
12
13
class ProductEndpoint extends Endpoint implements EndpointContract
13
14
{
14
- public function sslProducts (): OxxaResult
15
+ public function sslProducts (array $ additionalParameters = [] ): OxxaResult
15
16
{
16
17
$ xml = $ this
17
18
->client
18
- ->request (['command ' => 'ssl_product_list ' ]);
19
+ ->request (array_merge ( ['command ' => 'ssl_product_list ' ], $ additionalParameters ) );
19
20
20
21
$ statusCode = $ this ->getStatusCode ($ xml );
21
22
$ statusDescription = $ this ->getStatusDescription ($ xml );
@@ -36,10 +37,10 @@ public function sslProducts(): OxxaResult
36
37
$ sslNode
37
38
->filter ('pricing > period ' )
38
39
->each (function (Crawler $ periodNode ) use (&$ pricing ) {
39
- $ pricing [] = [
40
- ' period ' => (int ) $ periodNode ->attr ('months ' ),
41
- ' price ' => (float ) $ periodNode ->filter ('price ' )->text (),
42
- ] ;
40
+ $ pricing [] = new Price (
41
+ period: (int ) $ periodNode ->attr ('months ' ),
42
+ price: (float ) $ periodNode ->filter ('price ' )->text (),
43
+ ) ;
43
44
});
44
45
}
45
46
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class Oxxa implements OxxaClient
14
14
{
15
15
private const TIMEOUT = 180 ;
16
16
17
- private const VERSION = '2.3 .0 ' ;
17
+ private const VERSION = '2.4 .0 ' ;
18
18
19
19
private const USER_AGENT = 'oxxa-api-client/ ' .self ::VERSION ;
20
20
You can’t perform that action at this time.
0 commit comments