Skip to content

Commit

Permalink
Add missing receipt_data Transaction property (#17)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Woodward <[email protected]>
  • Loading branch information
Invincibear and mikeymike authored Feb 6, 2024
1 parent dc2455b commit bf68510
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Entities/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ protected function __construct(
public \DateTimeInterface $createdAt,
public \DateTimeInterface $updatedAt,
public \DateTimeInterface|null $billedAt,
public string|null $receiptData,
public Address|null $address,
public array $adjustments,
public TransactionAdjustmentsTotals|null $adjustmentsTotals,
Expand Down Expand Up @@ -94,6 +95,7 @@ public static function from(array $data): self
createdAt: DateTime::from($data['created_at']),
updatedAt: DateTime::from($data['updated_at']),
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'] ?? []),
adjustmentsTotals: isset($data['adjustments_totals']) ? TransactionAdjustmentsTotals::from($data['adjustments_totals']) : null,
Expand Down

0 comments on commit bf68510

Please sign in to comment.