| 123456789101112131415161718192021222324252627282930 |
- <?php
- namespace App\Data\Pagarme\Response\PagarmeOrderResponseData;
- final readonly class PagarmeOrderCheckoutResponseData
- {
- public function __construct(
- public ?string $id,
- public ?string $status,
- public ?string $url,
- ) {}
- public static function fromArray(array $payload): self
- {
- return new self(
- id: $payload['id'] ?? null,
- status: $payload['status'] ?? null,
- url: $payload['url'] ?? null,
- );
- }
- public function toArray(): array
- {
- return [
- 'id' => $this->id,
- 'status' => $this->status,
- 'url' => $this->url,
- ];
- }
- }
|