zaegoth Posted May 28, 2015 Share Posted May 28, 2015 Hi guys. My first post here. Up until now I somehow managed to tackle all problems I encountered either on my own or with the help of this forum. But this time, I feel defeated. I am writing a script that should place an order and accept it immediately after that. Why exactly I need that will be a bit complicated to explain, however the script in question does only that. I am using the following functions: function add_order( $params ) { $command = "addorder"; $adminuser = "admin"; $values["clientid"] = $params['clientid']; $values["pid"] = $params['pid']; $values["domain"] = $params['domain']; $values["notes"] = $params['notes']; $values["billingcycle"] = $params['billingcycle']; $values["dnsmanagement"] = $params['dnsmanagement']; $values["paymentmethod"] = $params['paymentmethod']; $values["domaintype"] = $params['domaintype']; $values["regperiod"] = $params['regperiod']; $values["nameserver1"] = $params['nameserver1']; $values["customfields"] = base64_encode( serialize ( $params['customfields'] )); $values["configoptions"] = base64_encode( serialize ( $params['configoptions'] )); $res = localAPI($command, $values, $adminuser); if ($res['result'] == 'success' ) { return $res['orderid']; } else { return $res; } } No problems to this moment, the order is added successfully and a valid order ID is returned from the function. After that, I try to accept the new order with the following function : function accept_order( $oid , $autosetup = true, $sendmail = true) { $command = "acceptorder"; $adminuser = "admin"; $values["orderid"] = $oid; $values["autosetup"] = $autosetup; $values["sendemail"] = $sendmail; $res = localAPI($command,$values,$adminuser); if ($res['result'] == 'success' ) { return $res['result']; } else { return $res; } } I pass the valid order ID (I inspected the data a few times). After the call: $res = localAPI($command,$values,$adminuser); , nothing happens. Execution of the script is terminated as if an error occurred, however, no errors are displayed. Also the logged in user is logged out. I tried setting the $autosetup parameter to false, as this has fixed the issue before. however I had no success. I have no idea how to debug this, or what might be causing it. I can provide the whole script if needed, however, I am certain the problem occurs on that line, as the execution is normal and the data is 100% correct before that point. Any help will be greatly appreciated guys. Thanks in advance. Cheers 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.