Jump to content

[UNCONFIRMED] Hook 'InvoicePaid' is not triggered in some cases


Kirill

Recommended Posts

===========DESCRIPTION===========

 

Seems like hook 'InvoicePaid' is not triggered if invoice amount was fully charged from credit balance.

 

=========STEPS TO REPLICATE=========

 

[1] Create some function and attach it to hook 'InvoicePaid'.

[2] Create an invoice for account which has some credited amount that is enough to cover the invoice. In my case invoices were created by 'createinvoice' command called under hook 'AcceptOrder' but I'm not sure there is any difference.

[3] That's all. Invoice is marked as paid but function wasn't triggered. The function works fine if it was triggered by invoice which really had to be paid. Also function works fine if I force running it with specifying invoice ID.

Link to comment
Share on other sites

Hello,

 

On my installation when I create an invoice with the createinvoice api call and a user has credit which is applied the hook is triggered:

 

[~/public_html/whmcs]# php apicall.php

stdClass Object

(

[result] => success

[invoiceid] => 5

)

 

Results in the following activity log entries with the Hook Debug logging enabled:

 

04/02/2015 11:03

Hooks Debug: No Hook Functions Defined

System 10.100.4.23

 

04/02/2015 11:03

Hooks Debug: Called Hook Point InvoiceCreated

System 10.100.4.23

04/02/2015 11:03

 

Hooks Debug: Hook Completed - Returned False

System 10.100.4.23

04/02/2015 11:03

 

Hooks Debug: Hook Point InvoicePaid - Calling Hook Function create_forum_account

System 10.100.4.23

04/02/2015 11:03

 

Hooks Debug: Called Hook Point InvoicePaid

System 10.100.4.23

04/02/2015 11:03

 

Email Sent to Tesing User (Invoice Payment Confirmation) - User ID: 1

System 10.100.4.23

04/02/2015 11:03

 

Hooks Debug: No Hook Functions Defined

System 10.100.4.23

04/02/2015 11:03

 

Hooks Debug: Called Hook Point EmailPreSend

System 10.100.4.23

04/02/2015 11:03

Hooks Debug: No Hook Functions Defined

System 10.100.4.23

04/02/2015 11:03

 

Hooks Debug: Called Hook Point InvoicePaidPreEmail

System 10.100.4.23

04/02/2015 11:03

 

Invoice Marked Paid - Invoice ID: 5

System 10.100.4.23

04/02/2015 11:03

 

Hooks Debug: No Hook Functions Defined

System 10.100.4.23

04/02/2015 11:03

 

Hooks Debug: Called Hook Point UpdateInvoiceTotal

System 10.100.4.23

04/02/2015 11:03

 

Credit Automatically Applied at Invoice Creation - Invoice ID: 5 - Amount: 10.00

System 10.100.4.23

 

If you are having issues here, a support ticket might be a better path forward.

 

Have a great day,

 

Nate C

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.

×
×
  • 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