Jump to content

Lanexbg

Member
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Lanexbg

  1. The issue is solved. The problem was in the pid ('pid[0]' => $pid,), I changed it to 'pid' => $pid and the order was added. It was added as pending and I called AcceptOrder and now everything looks okay.
  2. Hi there guys, I'm trying to use the API to add a free service (it's completely free of charge) to a customer when he register a domain (it must be active as soon as the domain is successfully registered, so it must be automatic). So I use the AfterRegistrarRegistration hook and everything is okay until the point I call AddOrder, like this: $command = 'AddOrder'; $postData = array( 'clientid' => $userid, 'pid[0]' => $pid, 'paymentmethod' => 'mailin', ); $orderIt = localAPI($command, $postData, $adminUsername); It gives me {"result":"error","message":"No items added to cart so order cannot proceed"}. I don't see a way to add items to the cart and there is no cart when the hook is triggered, so how should I add the service to the customer. I couldn't find a direct way to do it, so I went with adding an order, but at this moment that doesn't work. P.S. The $postData values, in case someone might think they are causing the error somehow: {"clientid":"3","pid[0]":"4","paymentmethod":"mailin"}
×
×
  • 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