diff --git a/src/TgBotLib/Objects/Payments/PaidMediaPurchased.php b/src/TgBotLib/Objects/Payments/PaidMediaPurchased.php new file mode 100644 index 0000000..c0b1a47 --- /dev/null +++ b/src/TgBotLib/Objects/Payments/PaidMediaPurchased.php @@ -0,0 +1,60 @@ +from; + } + + /** + * Bot-specified paid media payload + * + * @return string + */ + public function getPaidMediaPayload(): string + { + return $this->paid_media_payload; + } + + /** + * @inheritDoc + */ + public function toArray(): ?array + { + return [ + 'from' => $this->from->toArray(), + 'paid_media_payload' => $this->paid_media_payload, + ]; + } + + /** + * @inheritDoc + */ + public static function fromArray(?array $data): ?PaidMediaPurchased + { + if (is_null($data)) + { + return null; + } + + $object = new self(); + $object->from = isset($data['from']) ? User::fromArray($data['from']) : null; + $object->paid_media_payload = $data['paid_media_payload']; + + return $object; + } + } \ No newline at end of file