Some free WHMCS Hooks you might find useful.

Discussion in 'Coding, Scripting & Programming' started by KuJoe, Apr 18, 2015.

  1. KuJoe

    KuJoe New Member Verified Provider

    1,759
    1,318
    May 17, 2013
    Figured I'd post these here since some of these are pretty helpful.

    invoiceAddCredit - WHMCS hook to automatically add a percentage of credits based on payment processor. (Inspired by )

    chkClientDetails - A WHMCS hook that checks new client details for blocked words and displays an error if such words exist in any of the client fields. (Inspired by this thread.)

    Extended-Login-Tracker - A WHMCS addon that records all IPs that login and makes them searchable (adapted from 2 different scripts). (Inspired by )

    IP_to_Domain - A simple WHMCS hook that replaces a services domain to the dedicated IP assigned to it during service creation (great for VPS services when you want to search for who has had a specific IP in the past and for identifying services since domains in WHMCS don't update for most VPS control panels when hostnames change). (Holy smokes an original!)

    closeFraud - A simple WHMCS hook to automatically close accounts who are marked Inactive and only have fraudulent orders. If an account has order marked as Fraud but also has an order not marked as fraud, the account is skipped. Runs after WHMCS's daily cron. (Holy smokes an original!)

    chkProxy - A simple WHMCS hook that checks if the client is using a proxy/VPN prior to ordering (saves tickets and time). (Holy smokes an original!)

    As you can see I get some original ideas sometimes but I'm always looking for inspiration so if you have any ideas or requests feel free to post them here and I'll see what I can do. :)
     
    kunnu, River, HalfEatenPie and 10 others like this.
  2. Nett

    Nett Article Submitter Verified Provider

    761
    189
    Nov 27, 2013
    Great scripts! May I request FraudRecord checks after ordering? AfterFraudCheck might be the hook to use :).
     
    River, AMDbuilder and MannDude like this.
  3. Syntrel

    Syntrel New Member

    4
    0
    Mar 23, 2015
    Great post, keep them coming.
     
  4. MannDude

    MannDude Just a dude vpsBoard Founder Moderator

    5,005
    2,618
    Mar 8, 2013
    MannDude
    Thanks for sharing @KuJoe, you da man!
     
    Servers4You likes this.
  5. mitgib

    mitgib New Member Verified Provider

    284
    219
    May 15, 2013
    @KuJoe I was searching for this post when I had the idea you have made a hook that issued credit on cancel and went and looked through https://github.com/KuJoe but I was mistaken.  Can I inspire you yet again?  I was thinking, along the same lines at BuyVM, when a customer cancels service and choses immediate, any remaining time is credited as account credit. When they chose end of billing period, obviously there is no credit due.


    I had thought this was built in since downgrades do the same thing, but I either missed it in the settings or I am looking for something @Aldryic C'boas hooked for BuyVM
     
    Last edited by a moderator: Apr 30, 2017
    HalfEatenPie likes this.
  6. KuJoe

    KuJoe New Member Verified Provider

    1,759
    1,318
    May 17, 2013
    I pushed this to my GitHub but I haven't had time to test it. If somebody else has a development WHMCS they want to try it out in it would be appreciated because my dev setup is in use at the moment for other testing and I don't want to test multiple modules/hooks/addons at once.


    https://github.com/KuJoe/cancelledCredit
     
    Last edited by a moderator: Apr 30, 2017
    mitgib and HalfEatenPie like this.
  7. mitgib

    mitgib New Member Verified Provider

    284
    219
    May 15, 2013
    I tried this out since I had 1 immediate cancel this morning, changed the $admin user to a valid admin, no credit posted. Sorry I am unable to provide any other details, looking at the detailed cron report has nothing to add. Will wait until you are able to try your test environment.
     
  8. rf-harris

    rf-harris Member

    39
    3
    Oct 26, 2015
    Thank you for sharing, they are definitely pretty helpful :)
     
  9. qps

    qps Active Member Verified Provider

    341
    132
    May 15, 2013


    We've been using this for a while and it has been working great, but I think recently MaxMind may have changed the way that they process queries, because now I am seeing a score of 0.00 being returned with an error, which gives an error in the script and prevents users from ordering.  Anyone else seeing this?
     
    Last edited by a moderator: Feb 22, 2016
  10. KuJoe

    KuJoe New Member Verified Provider

    1,759
    1,318
    May 17, 2013
    What error are you seeing? I'll review their API and see if they changed anything.
     
  11. qps

    qps Active Member Verified Provider

    341
    132
    May 15, 2013
    It says "city not found" when I click through to review the query.  I'm not sure if that what is causing the issue or not.
     
  12. KuJoe

    KuJoe New Member Verified Provider

    1,759
    1,318
    May 17, 2013
    That's really strange, it shouldn't be checking the city since it's just their proxy check. Are you sure you have the Proxy Detection credits and not just the minFraud credits?
     
  13. qps

    qps Active Member Verified Provider

    341
    132
    May 15, 2013
    Yes, these are the same proxy check credits I've been using all along.  They only recently started throwing this error.
     
  14. UltratechHost

    UltratechHost New Member Verified Provider

    20
    2
    Feb 7, 2016
    Hi,


    From the source code or date of update for InvoiceAddCredit it looks like is from WHMCS 5 not for WHMCS 6.X


    So can you please confirm whether they works with WHMCS 6.X
     
  15. KuJoe

    KuJoe New Member Verified Provider

    1,759
    1,318
    May 17, 2013
    It will work with WHMCS 6.x until they disable the SQL Helpers.
     
  16. kevinsimmons

    kevinsimmons New Member

    10
    0
    Mar 16, 2016
    Great man ! Thank you for sharing, they are definitely more helpful :)
     
  17. kunnu

    kunnu Member Verified Provider

    165
    25
    Apr 29, 2013
    Login IP tracker and Proxy IP checker is really very useful however using hooks is really harmful because of I was use "chkClientDetails" type script for avoiding spam tickets but even ticket of some customers was blocked so I stop using this hooks.
     
  18. KuJoe

    KuJoe New Member Verified Provider

    1,759
    1,318
    May 17, 2013
    It shouldn't have anything to do with tickets unless WHMCS forgot to update their documentation for the ClientDetailsValidation hook:

     
  19. Hosterbox

    Hosterbox New Member Verified Provider

    14
    1
    Nov 11, 2015
    Thanks for the post!
     
  20. WSH_DNYT

    WSH_DNYT New Member Verified Provider

    10
    0
    Nov 21, 2013
    thank you for sharing.


    The Discount on payment gateway used is interesting as you could reward ppl paying with bitcoin (less cost on our side)