Skip to content

Commit

Permalink
feat: Add support for custom_data and import_meta on Notification…
Browse files Browse the repository at this point in the history
… Discount
  • Loading branch information
Invincibear authored Feb 7, 2024
1 parent 1ea6936 commit 28675e4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Entities/Notification/NotificationDiscount.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
use Paddle\SDK\Entities\Discount\DiscountType;
use Paddle\SDK\Entities\Entity;
use Paddle\SDK\Entities\Shared\CurrencyCode;
use Paddle\SDK\Entities\Shared\CustomData;
use Paddle\SDK\Entities\Shared\ImportMeta;

class NotificationDiscount implements Entity
{
Expand All @@ -35,6 +37,8 @@ protected function __construct(
public int|null $maximumRecurringIntervals,
public int|null $usageLimit,
public array|null $restrictTo,
public CustomData|null $customData,
public ImportMeta|null $importMeta,
public \DateTimeInterface|null $expiresAt,
public \DateTimeInterface $createdAt,
public \DateTimeInterface $updatedAt,
Expand All @@ -56,6 +60,8 @@ public static function from(array $data): self
maximumRecurringIntervals: $data['maximum_recurring_intervals'],
usageLimit: $data['usage_limit'] ?? null,
restrictTo: $data['restrict_to'] ?? null,
customData: isset($data['custom_data']) ? new CustomData($data['custom_data']) : null,
importMeta: isset($data['import_meta']) ? ImportMeta::from($data['import_meta']) : null,
expiresAt: isset($data['expires_at']) ? DateTime::from($data['expires_at']) : null,
createdAt: DateTime::from($data['created_at']),
updatedAt: DateTime::from($data['updated_at']),
Expand Down

0 comments on commit 28675e4

Please sign in to comment.