Jump to content

Hook execution repeated when is fired width api


Recommended Posts

Hi i have a addclient hook that work perfectly in whmcs, but when i add a client width api internal call this hook is executed twiced. Why this?


call code

    $command = 'AddClient';
   $postData = array(
       'firstname' => 'prueba',
       'lastname' => 'Doe',
       'email' => 'xxx@gmail.cohmx',
       'address1' => '123 Main Street',
       'city' => 'Anytown',
       'state' => 'ST',
       'postcode' => '12345',
       'country' => 'US',
       'phonenumber' => '800-555-1234',
       'password2' => 'password',
       'cardtype' => 'Visa',
       'cardnum' => '4111111111111111',
       'expdate' => '0721',
       'clientip' => '',       
   $adminUsername = 'xxxx';

   $results = localAPI($command, $postData, $adminUsername);


hook code

   'ClientAdd', 1, function ($vars) {

       $userid = $vars['userid'];

       //insertamos dos puntos en el departamento de diseño
       $insertar= Capsule::table('mg_SupportTicketsLimiter_clients')->insert(
           ['department_id' => '6', 'client_id' => $userid, 'points' => '2' ]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated