| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Data\Pagarme\Response\OrderResponseData;
- use App\Data\Pagarme\PagarmeResponseData;
- final readonly class OrderCheckoutResponseData extends PagarmeResponseData
- {
- public function __construct(
- public ?string $id,
- public ?string $status,
- public ?string $url,
- ) {}
- public static function fromArray(array $payload): static
- {
- return new self(
- id: static::arrString($payload, 'id'),
- status: static::arrString($payload, 'status'),
- url: static::arrString($payload, 'url'),
- );
- }
- public function toArray(): array
- {
- return [
- 'id' => $this->id,
- 'status' => $this->status,
- 'url' => $this->url,
- ];
- }
- }
|