Jump to content

customized domain register with invoicepaid hook problem


emrag

Recommended Posts

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");

Link to comment
Share on other sites

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.

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.

Guest
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