PagarmeCustomerUpdateRequestData.php 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Data\Pagarme\Request\PagarmeCustomerRequestData;
  3. use App\Data\Pagarme\PagarmeData;
  4. readonly class PagarmeCustomerUpdateRequestData extends PagarmeData
  5. {
  6. public function __construct(
  7. public ?string $name = null,
  8. public ?string $email = null,
  9. public ?string $document = null,
  10. public ?string $type = null,
  11. public ?string $documentType = null,
  12. public ?string $code = null,
  13. public ?PagarmeCustomerAddressRequestData $address = null,
  14. public ?PagarmeCustomerPhonesRequestData $phones = null,
  15. ) {}
  16. public function toArray(): array
  17. {
  18. return $this->filterFilledRecursive([
  19. 'name' => $this->name,
  20. 'email' => $this->email,
  21. 'document' => $this->document,
  22. 'type' => $this->type,
  23. 'document_type' => $this->documentType,
  24. 'code' => $this->code,
  25. 'address' => $this->address,
  26. 'phones' => $this->phones,
  27. ]);
  28. }
  29. }