PagarmeRecipientRegisterInformationData.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace App\Data\Pagarme\Request\Objects;
  3. use App\Data\Pagarme\PagarmeData;
  4. readonly class PagarmeRecipientRegisterInformationData extends PagarmeData
  5. {
  6. public function __construct(
  7. public string $name,
  8. public string $email,
  9. public string $document,
  10. public string $type,
  11. public ?string $birthdate,
  12. public int $monthlyIncome,
  13. public string $professionalOccupation,
  14. public PagarmeRecipientPhoneNumbersData $phoneNumbers,
  15. public PagarmeRecipientAddressData $address,
  16. ) {}
  17. public function toArray(): array
  18. {
  19. return $this->filterFilledRecursive([
  20. 'name' => $this->name,
  21. 'email' => $this->email,
  22. 'document' => $this->document,
  23. 'type' => $this->type,
  24. 'birthdate' => $this->birthdate,
  25. 'monthly_income' => $this->monthlyIncome,
  26. 'professional_occupation' => $this->professionalOccupation,
  27. 'phone_numbers' => $this->phoneNumbers,
  28. 'address' => $this->address,
  29. ]);
  30. }
  31. }