emrag Posted July 2, 2010 Share Posted July 2, 2010 i'm trying to add my own customized domain register api. i want when an invoice paid, register ordered domain automatically. i'm using invoicepaid hook. but problem is i cant get details of order with invoice id. for example this code doesnt return anything. i look db and i see when an order comes in tblorders table invoiceid column is "0". whmcs update invoiceid column after hook files run so i cant get order details with invoice id. what can i do or i'm using wrong hook point? (note: i added credits to an user and i try this api with him. so if credit balance is enough it must be automatically register.) function hook_invoicepaid($vars) { $invoiceid = $vars['invoiceid']; $sql = "SELECT * FROM tblorders WHERE invoiceid = '$invoiceid' LIMIT 1"; $result = mysql_query($sql); $row = mysql_fetch_object($result); print_r($row); // ..... } add_hook("InvoicePaid",1,"hook_invoicepaid"); 0 Quote Link to comment Share on other sites More sharing options...
lynnette Posted July 5, 2010 Share Posted July 5, 2010 Am I missing something, don't you just set that in Settings -> Domain Pricing under Auto Registration? or is your hook wanting to do something else as well. 0 Quote Link to comment Share on other sites More sharing options...
emrag Posted July 5, 2010 Author Share Posted July 5, 2010 Am I missing something, don't you just set that in Settings -> Domain Pricing under Auto Registration? or is your hook wanting to do something else as well. i know there is but i need to run some custom functions while registering domains. 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.