Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customfield error #41

Open
boahost opened this issue Dec 11, 2024 · 1 comment
Open

Customfield error #41

boahost opened this issue Dec 11, 2024 · 1 comment

Comments

@boahost
Copy link

boahost commented Dec 11, 2024

Quando eu tento adicionar para o customfield, recebo erro.

    $result = whmcs::client()->addClient([
        'firstname' => $request->input('nome'),
        'lastname' => $request->input('sobrenome'),
        'email' => $request->input('email'),
        'address1' => $request->input('endereco') . ',' . $request->input('numero') ,
        'city' => $request->input('cidade'),
        'postcode' => $request->input('cep'),
        'country' => 'BR',
        'state' => $request->input('estado'),
        'password2' => $request->input('password'),
        'phonenumber' => '55 65 99307 2186',
        'clientip' => $request->ip(),
        'customfields' => [
            base64_encode(serialize([ 1 => $request->input('cpf')]))
        ],
    ]);

"CPF/CNPJ é obrigatório"

Mesmo passando, porque?

@darthsoup
Copy link
Owner

Hi @boahost ,

as far i remember you have to encode/serialize the entire array like

$customFields = base64_encode(serialize(['1' => $request->input('cpf')]))
$result = Whmcs::client()->addClient([
    // rest of array
    'customfields' => $customFields
]);

sorry, i dont speak portuguese.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants