-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
Hi,
i had tried to use bank_trasfer method to create new transfer.
One of parameters is an instance of AccountHolder class.
I got an error Bad request. Invalid field user.email for this endpoint.
So, see in the contructor, email can be null. (i do not pass email in the constructor btw)
public function __construct(
string $legal_name,
string $email = null
)
Then method
public function toArray(): array
{
return [
"legal_name" => $this->legal_name,
"email" => $this->email // returns email anyway
];
}
Add condition, if email length>0 then set property 'email' for output array.
public function toArray(): array
{
$output = [
"legal_name" => $this->legal_name,
];
if($this->email){
$output["email"] = $this->email;
}
return $output;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels