Skip to content

Commit 07bbac5

Browse files
authored
fix!: Consistent naming for Adjustment totals obj (#33)
BREAKING CHANGE: Any existing typing for TotalAdjustments will cause a class not found error until refactored to AdjustmentTotals
1 parent 97f8baa commit 07bbac5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Entities/Adjustment.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
use Paddle\SDK\Entities\Adjustment\AdjustmentItem;
1515
use Paddle\SDK\Entities\Shared\Action;
1616
use Paddle\SDK\Entities\Shared\AdjustmentStatus;
17+
use Paddle\SDK\Entities\Shared\AdjustmentTotals;
1718
use Paddle\SDK\Entities\Shared\CurrencyCode;
1819
use Paddle\SDK\Entities\Shared\PayoutTotalsAdjustment;
19-
use Paddle\SDK\Entities\Shared\TotalAdjustments;
2020

2121
class Adjustment implements Entity
2222
{
@@ -36,7 +36,7 @@ protected function __construct(
3636
public CurrencyCode $currencyCode,
3737
public AdjustmentStatus $status,
3838
public array $items,
39-
public TotalAdjustments $totals,
39+
public AdjustmentTotals $totals,
4040
public PayoutTotalsAdjustment|null $payoutTotals,
4141
public \DateTimeInterface $createdAt,
4242
public \DateTimeInterface|null $updatedAt,
@@ -56,7 +56,7 @@ public static function from(array $data): self
5656
currencyCode: CurrencyCode::from($data['currency_code']),
5757
status: AdjustmentStatus::from($data['status']),
5858
items: array_map(fn (array $item) => AdjustmentItem::from($item), $data['items']),
59-
totals: TotalAdjustments::from($data['totals']),
59+
totals: AdjustmentTotals::from($data['totals']),
6060
payoutTotals: isset($data['payout_totals']) ? PayoutTotalsAdjustment::from($data['payout_totals']) : null,
6161
createdAt: DateTime::from($data['created_at']),
6262
updatedAt: DateTime::from($data['updated_at']),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Paddle\SDK\Entities\Shared;
1313

14-
class TotalAdjustments
14+
class AdjustmentTotals
1515
{
1616
public function __construct(
1717
public string $subtotal,

src/Entities/Subscription/SubscriptionAdjustmentPreview.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Paddle\SDK\Entities\Subscription;
66

7-
use Paddle\SDK\Entities\Shared\TotalAdjustments;
7+
use Paddle\SDK\Entities\Shared\AdjustmentTotals;
88

99
class SubscriptionAdjustmentPreview
1010
{
@@ -14,7 +14,7 @@ class SubscriptionAdjustmentPreview
1414
public function __construct(
1515
public string $transactionId,
1616
public array $items,
17-
public TotalAdjustments $totals,
17+
public AdjustmentTotals $totals,
1818
) {
1919
}
2020

@@ -23,7 +23,7 @@ public static function from(array $data): self
2323
return new self(
2424
transactionId: $data['transaction_id'],
2525
items: array_map(fn (array $item) => SubscriptionAdjustmentItem::from($item), $data['items']),
26-
totals: TotalAdjustments::from($data['totals']),
26+
totals: AdjustmentTotals::from($data['totals']),
2727
);
2828
}
2929
}

0 commit comments

Comments
 (0)