diff --git a/src/Entities/Event/EventTypeName.php b/src/Entities/Event/EventTypeName.php index f0e4dde..e6992b3 100644 --- a/src/Entities/Event/EventTypeName.php +++ b/src/Entities/Event/EventTypeName.php @@ -7,10 +7,12 @@ enum EventTypeName: string { case AddressCreated = 'address.created'; + case AddressImported = 'address.imported'; case AddressUpdated = 'address.updated'; case AdjustmentCreated = 'adjustment.created'; case AdjustmentUpdated = 'adjustment.updated'; case BusinessCreated = 'business.created'; + case BusinessImported = 'business.imported'; case BusinessUpdated = 'business.updated'; case CustomerCreated = 'customer.created'; case CustomerImported = 'customer.imported'; diff --git a/src/Entities/Notification/NotificationDiscount.php b/src/Entities/Notification/NotificationDiscount.php index 7aab58f..3f58545 100644 --- a/src/Entities/Notification/NotificationDiscount.php +++ b/src/Entities/Notification/NotificationDiscount.php @@ -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 { @@ -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, @@ -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']), diff --git a/src/Entities/Notification/NotificationSubscription.php b/src/Entities/Notification/NotificationSubscription.php index 23d105d..4551822 100644 --- a/src/Entities/Notification/NotificationSubscription.php +++ b/src/Entities/Notification/NotificationSubscription.php @@ -10,6 +10,7 @@ use Paddle\SDK\Entities\Shared\CollectionMode; use Paddle\SDK\Entities\Shared\CurrencyCode; use Paddle\SDK\Entities\Shared\CustomData; +use Paddle\SDK\Entities\Shared\ImportMeta; use Paddle\SDK\Entities\Shared\TimePeriod; use Paddle\SDK\Entities\Subscription\SubscriptionDiscount; use Paddle\SDK\Entities\Subscription\SubscriptionItem; @@ -41,11 +42,12 @@ protected function __construct( public SubscriptionDiscount|null $discount, public CollectionMode $collectionMode, public BillingDetails|null $billingDetails, - public SubscriptionTimePeriod $currentBillingPeriod, + public SubscriptionTimePeriod|null $currentBillingPeriod, public TimePeriod $billingCycle, public SubscriptionScheduledChange|null $scheduledChange, public array $items, public CustomData|null $customData, + public ImportMeta|null $importMeta, ) { } @@ -77,6 +79,7 @@ public static function from(array $data): self : null, items: array_map(fn (array $item): SubscriptionItem => SubscriptionItem::from($item), $data['items']), customData: isset($data['custom_data']) ? new CustomData($data['custom_data']) : null, + importMeta: isset($data['import_meta']) ? ImportMeta::from($data['import_meta']) : null, ); } } diff --git a/src/Entities/Transaction.php b/src/Entities/Transaction.php index 18951eb..96ace47 100644 --- a/src/Entities/Transaction.php +++ b/src/Entities/Transaction.php @@ -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, @@ -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,