PagarmeRecipientAddressData.php 988 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Data\Pagarme\Request\Objects;
  3. use App\Data\Pagarme\PagarmeData;
  4. readonly class PagarmeRecipientAddressData extends PagarmeData
  5. {
  6. public function __construct(
  7. public string $street,
  8. public string $complementary,
  9. public string $streetNumber,
  10. public string $neighborhood,
  11. public ?string $city,
  12. public ?string $state,
  13. public string $zipCode,
  14. public string $referencePoint,
  15. ) {}
  16. public function toArray(): array
  17. {
  18. return $this->filterFilledRecursive([
  19. 'street' => $this->street,
  20. 'complementary' => $this->complementary,
  21. 'street_number' => $this->streetNumber,
  22. 'neighborhood' => $this->neighborhood,
  23. 'city' => $this->city,
  24. 'state' => $this->state,
  25. 'zip_code' => $this->zipCode,
  26. 'reference_point' => $this->referencePoint,
  27. ]);
  28. }
  29. }