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

Add missing price for additional domains when retrieving SSL products #20

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Please note this changelog affects
this package and not the Oxxa API.

## [2.4.1]

### Fixed

- Add missing price for additional domains when retrieving SSL products.

## [2.4.0]

### Added
Expand Down
1 change: 1 addition & 0 deletions src/DataTransferObjects/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Price
public function __construct(
public int $period,
public float $price,
public ?float $priceAdditional = null,
) {
}
}
5 changes: 5 additions & 0 deletions src/Endpoints/ProductEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ public function sslProducts(array $additionalParameters = []): OxxaResult
$sslNode
->filter('pricing > period')
->each(function (Crawler $periodNode) use (&$pricing) {
$priceExtraDomainNode = $periodNode->filter('price_extra_domain');

$pricing[] = new Price(
period: (int) $periodNode->attr('months'),
price: (float) $periodNode->filter('price')->text(),
priceAdditional: $priceExtraDomainNode->count() && $priceExtraDomainNode->text() !== ''
? (float) $periodNode->filter('price_extra_domain')->text()
: null,
);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Oxxa.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Oxxa implements OxxaClient
{
private const TIMEOUT = 180;

private const VERSION = '2.4.0';
private const VERSION = '2.4.1';

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

Expand Down
Loading