Skip to content

Commit

Permalink
fix!: Transaction include to use core Adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeymike committed Feb 7, 2024
1 parent 04ddfd9 commit 7551ef9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Entities/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Paddle\SDK\Entities\Shared\TransactionOrigin;
use Paddle\SDK\Entities\Shared\TransactionPaymentAttempt;
use Paddle\SDK\Entities\Shared\TransactionStatus;
use Paddle\SDK\Entities\Transaction\TransactionAdjustment;
use Paddle\SDK\Entities\Transaction\TransactionAdjustmentsTotals;
use Paddle\SDK\Entities\Transaction\TransactionDetails;
use Paddle\SDK\Entities\Transaction\TransactionItem;
Expand All @@ -33,7 +32,7 @@ class Transaction implements Entity
*
* @param array<TransactionItem> $items
* @param array<TransactionPaymentAttempt> $payments
* @param array<TransactionAdjustment> $adjustments
* @param array<Adjustment> $adjustments
* @param array<AvailablePaymentMethods> $availablePaymentMethods
*/
protected function __construct(
Expand Down Expand Up @@ -97,7 +96,7 @@ public static function from(array $data): self
billedAt: isset($data['billed_at']) ? DateTime::from($data['billed_at']) : null,
receiptData: $data['receipt_data'] ?? null,
address: isset($data['address']) ? Address::from($data['address']) : null,
adjustments: array_map(fn (array $adjustment): TransactionAdjustment => TransactionAdjustment::from($adjustment), $data['adjustments'] ?? []),
adjustments: array_map(fn (array $adjustment): Adjustment => Adjustment::from($adjustment), $data['adjustments'] ?? []),
adjustmentsTotals: isset($data['adjustments_totals']) ? TransactionAdjustmentsTotals::from($data['adjustments_totals']) : null,
business: isset($data['business']) ? Business::from($data['business']) : null,
customer: isset($data['customer']) ? Customer::from($data['customer']) : null,
Expand Down

0 comments on commit 7551ef9

Please sign in to comment.