Jump to content

How to use hooks to update invoice


wellconnit

Recommended Posts

Hi All,

 

Has anyone had any experience with a hook updating an invoice?

I want to use InvoicePaidPreEmail to append a credit card fee to the invoice.

I understand WHMCS is not willing to budge on per Gateway charges, but I can disclose to my customers that there is a credit card fee of x% and then send the right payment value to the bank, once it returns as approved I can then append it to the invoice and prior to the email being sent it will now include the charge on the invoice.

 

Any help with this is appreciated.

 

Link to comment
Share on other sites

Hi @DougK94,

 

Yeah i've seen those, however not happy to spend $70 to get something that is a basic function.

And if WHMCS decide to change their stance on however the module adds that fee then it will stop working.

+ trying to increase my skills when it comes to writing code so would be nice to do it myself.

 

Thanks Anyway

Link to comment
Share on other sites

7 hours ago, wellconnit said:

Yeah i've seen those, however not happy to spend $70 to get something that is a basic function.

well don't go to ModulesGarden then. :)

one of the products listed above costs a one-off $22, or $34 ("lifetime updates").

7 hours ago, wellconnit said:

And if WHMCS decide to change their stance on however the module adds that fee then it will stop working.

but the same would be true if you'd wrote it yourself.

7 hours ago, wellconnit said:

+ trying to increase my skills when it comes to writing code so would be nice to do it myself.

then i'll repost the link I posted in another thread on the same topic...

On 2/10/2018 at 16:31, brian! said:

in any event, the information is out there... there was a free addon years ago that added a percentage/fixed fee to invoices for those paying by different gateways - it's now available on GitHub and you can examine the source code... I just quickly tried it on v7.4.2 and it still works - but bear in mind that it's unlikely to work on v8 as it still uses old MySQL queries, so its code will have to be updated before then.... and unlike what you want to do, it just changes the invoices and is not shown during checkout.

that hook will work today and updates invoices (before they're sent to the client) with a gateway fee (percentage or fixed) based on it's admin settings... it would possibly need updating for v8, but that's probably 6 months away before a full general release, so plenty of time.

8_U02s_L6q_S9i_Uu_QL1exi_Glw.png

7 hours ago, DougK94 said:

But many of the gurus on here may be hesitant to help you with this as they do not like to infringe on topics that people are selling things in the marketplace that do the same basic function.

plural? - i'm not vain enough to think of myself as one, nor encourage others to call me it... even if others think of themselves like that. :P

Link to comment
Share on other sites

Coming here from this other post, could anyone comment on whether it would be possible to target this additional fee to a specific client ID? 

I simply want to charge an additional $5 fee for a specific user who insist on paying with a cheque (as my bank charges me $5 per cheque now).  So - I need a way to automatically add a $5 fee to each service invoice that gets generated.

In this particular case, the user is a charitable trust and I have carried the additional fee for the last two years to give them a chance to move banking methods - but there has been no change from this client and I would like to encourage them further.... Some clients are unfortunately stuck in the dark ages and need to be "encouraged" and motivated to pay with other method e.g. bank transfer - Carrot / Stick.

I will have a try with the mentioned code and update the thread if there is any success

 

Edited by sol2010
Link to comment
Share on other sites

Hi @sol2010,

I feel your pain.

If you do want it for a particular user I can't imagine it's harder than adding an IF statement at the top of the hook to compare the client ID with your clients ID and then add accordingly.

 

Please let me know if you do get it working as I haven't had the chance to try implement this in my own installation yet.

Thanks.

Link to comment
Share on other sites

10 hours ago, sol2010 said:

Coming here from this other post, could anyone comment on whether it would be possible to target this additional fee to a specific client ID? 

@wellconnit is right, it should just be a simple IF statement.

10 hours ago, sol2010 said:

I simply want to charge an additional $5 fee for a specific user who insist on paying with a cheque (as my bank charges me $5 per cheque now).

jeez - if my bank tried that, i'd be doing the same thing as you... :963_heavy_dollar_sign:

10 hours ago, sol2010 said:

So - I need a way to automatically add a $5 fee to each service invoice that gets generated.

the GitHub addon will do that.

11 hours ago, sol2010 said:

In this particular case, the user is a charitable trust and I have carried the additional fee for the last two years to give them a chance to move banking methods - but there has been no change from this client and I would like to encourage them further.... Some clients are unfortunately stuck in the dark ages and need to be "encouraged" and motivated to pay with other method e.g. bank transfer - Carrot / Stick.

the only built-in way to do it would be a little kinky, and would require applying a negative promotion code to each service - should work fine on existing services (and would apply regardless of gateway), but absolutely useless for new orders.

Link to comment
Share on other sites

On 04/03/2018 at 6:00 AM, brian! said:

the only built-in way to do it would be a little kinky, and would require applying a negative promotion code to each service - should work fine on existing services (and would apply regardless of gateway), but absolutely useless for new orders.

That is an interesting idea - I will try both and report back

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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