CustomerAddressRequestData.php 753 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Data\Pagarme\Request\CustomerRequestData;
  3. use App\Data\Pagarme\PagarmeData;
  4. final readonly class CustomerAddressRequestData extends PagarmeData
  5. {
  6. public function __construct(
  7. public ?string $line1,
  8. public ?string $line2,
  9. public ?string $zipCode,
  10. public ?string $city,
  11. public ?string $state,
  12. public ?string $country,
  13. ) {}
  14. public function toArray(): array
  15. {
  16. return $this->filterFilledRecursive([
  17. 'line_1' => $this->line1,
  18. 'line_2' => $this->line2,
  19. 'zip_code' => $this->zipCode,
  20. 'city' => $this->city,
  21. 'state' => $this->state,
  22. 'country' => $this->country,
  23. ]);
  24. }
  25. }