Skip to content

Commit 4d66520

Browse files
committed
Update CreateParams make customer_name optional
1 parent 3430db3 commit 4d66520

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Data/CreateParams.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @property-read string|null $owner_username Username of the reseller "owner" of the new account
1616
* @property-read boolean|null $owns_itself Account should own itself (overrides $owner_username)
1717
* @property-read string $email Email address of the new account holder
18-
* @property-read string $customer_name Name of the customer
18+
* @property-read string|null $customer_name Name of the customer
1919
* @property-read string|null $password Password for the new account
2020
* @property-read string $domain Main domain name of the new account
2121
* @property-read string $package_name Name/identifier of the package/tier/quota for the new account
@@ -33,7 +33,7 @@ public static function rules(): Rules
3333
'owner_username' => ['string'],
3434
'owns_itself' => ['bool'],
3535
'email' => ['required', 'email'],
36-
'customer_name' => ['required', 'string'],
36+
'customer_name' => ['nullable', 'string'],
3737
'password' => ['string'],
3838
'domain' => ['required', 'domain_name'],
3939
'package_name' => ['required', 'string'],

src/Enhance/Provider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function create(CreateParams $params): AccountInfo
7474
$email = $this->findOwnerMember($customerId, $params->email)->getEmail();
7575
} else {
7676
$customerId = $this->createCustomer(
77-
$params->customer_name,
77+
$params->customer_name ?? $params->email,
7878
$params->email,
7979
$params->password ?: $this->generateRandomPassword()
8080
);

0 commit comments

Comments
 (0)