Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 7eeeba4

Browse files
authored
Merge pull request #20 from CyberfusionIO/feature/ssl-product-list
Add missing price for additional domains when retrieving SSL products
2 parents 74b9984 + c7d19c4 commit 7eeeba4

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Please note this changelog affects
66
this package and not the Oxxa API.
77

8+
## [2.4.1]
9+
10+
### Fixed
11+
12+
- Add missing price for additional domains when retrieving SSL products.
13+
814
## [2.4.0]
915

1016
### Added

src/DataTransferObjects/Price.php

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class Price
77
public function __construct(
88
public int $period,
99
public float $price,
10+
public ?float $priceAdditional = null,
1011
) {
1112
}
1213
}

src/Endpoints/ProductEndpoint.php

+5
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,14 @@ public function sslProducts(array $additionalParameters = []): OxxaResult
3737
$sslNode
3838
->filter('pricing > period')
3939
->each(function (Crawler $periodNode) use (&$pricing) {
40+
$priceExtraDomainNode = $periodNode->filter('price_extra_domain');
41+
4042
$pricing[] = new Price(
4143
period: (int) $periodNode->attr('months'),
4244
price: (float) $periodNode->filter('price')->text(),
45+
priceAdditional: $priceExtraDomainNode->count() && $priceExtraDomainNode->text() !== ''
46+
? (float) $periodNode->filter('price_extra_domain')->text()
47+
: null,
4348
);
4449
});
4550
}

src/Oxxa.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Oxxa implements OxxaClient
1414
{
1515
private const TIMEOUT = 180;
1616

17-
private const VERSION = '2.4.0';
17+
private const VERSION = '2.4.1';
1818

1919
private const USER_AGENT = 'oxxa-api-client/'.self::VERSION;
2020

0 commit comments

Comments
 (0)