Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: Consistent naming for Adjustment totals obj #33

Merged
merged 1 commit into from
Feb 13, 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: 3 additions & 3 deletions src/Entities/Adjustment.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
use Paddle\SDK\Entities\Adjustment\AdjustmentItem;
use Paddle\SDK\Entities\Shared\Action;
use Paddle\SDK\Entities\Shared\AdjustmentStatus;
use Paddle\SDK\Entities\Shared\AdjustmentTotals;
use Paddle\SDK\Entities\Shared\CurrencyCode;
use Paddle\SDK\Entities\Shared\PayoutTotalsAdjustment;
use Paddle\SDK\Entities\Shared\TotalAdjustments;

class Adjustment implements Entity
{
Expand All @@ -36,7 +36,7 @@ protected function __construct(
public CurrencyCode $currencyCode,
public AdjustmentStatus $status,
public array $items,
public TotalAdjustments $totals,
public AdjustmentTotals $totals,
public PayoutTotalsAdjustment|null $payoutTotals,
public \DateTimeInterface $createdAt,
public \DateTimeInterface|null $updatedAt,
Expand All @@ -56,7 +56,7 @@ public static function from(array $data): self
currencyCode: CurrencyCode::from($data['currency_code']),
status: AdjustmentStatus::from($data['status']),
items: array_map(fn (array $item) => AdjustmentItem::from($item), $data['items']),
totals: TotalAdjustments::from($data['totals']),
totals: AdjustmentTotals::from($data['totals']),
payoutTotals: isset($data['payout_totals']) ? PayoutTotalsAdjustment::from($data['payout_totals']) : null,
createdAt: DateTime::from($data['created_at']),
updatedAt: DateTime::from($data['updated_at']),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Paddle\SDK\Entities\Shared;

class TotalAdjustments
class AdjustmentTotals
{
public function __construct(
public string $subtotal,
Expand Down
6 changes: 3 additions & 3 deletions src/Entities/Subscription/SubscriptionAdjustmentPreview.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Paddle\SDK\Entities\Subscription;

use Paddle\SDK\Entities\Shared\TotalAdjustments;
use Paddle\SDK\Entities\Shared\AdjustmentTotals;

class SubscriptionAdjustmentPreview
{
Expand All @@ -14,7 +14,7 @@ class SubscriptionAdjustmentPreview
public function __construct(
public string $transactionId,
public array $items,
public TotalAdjustments $totals,
public AdjustmentTotals $totals,
) {
}

Expand All @@ -23,7 +23,7 @@ public static function from(array $data): self
return new self(
transactionId: $data['transaction_id'],
items: array_map(fn (array $item) => SubscriptionAdjustmentItem::from($item), $data['items']),
totals: TotalAdjustments::from($data['totals']),
totals: AdjustmentTotals::from($data['totals']),
);
}
}
Loading